/* ═══════════════════════════════════════════════════════════════════════════
   TurfInsight Design System — turfinsight.css
   Version: 1.0 (matches TurfInsightMVP quickcapture.html styling)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══ Design Tokens ═══ */
:root {
  /* Color Palette — exact values from MVP */
  --color-bg-primary: #213058;
  --color-bg-secondary: #1a2744;
  --color-bg-panel: rgba(33, 48, 88, 0.95);
  --color-brand: #4da03a;
  --color-brand-light: #c4e39c;
  --color-brand-dim: rgba(77, 160, 58, 0.15);
  --color-text-primary: #e5e8eb;
  --color-text-secondary: #98a0a8;
  --color-border: rgba(255, 255, 255, 0.08);

  /* Severity Colors */
  --severity-high: #dc2626;
  --severity-med: #f59e0b;
  --severity-low: #22c55e;
  --severity-info: #3b82f6;

  /* Category Colors (Annotation Groups) */
  --category-flight: #4da03a;
  --category-course: #f59e0b;
  --category-design: #3b82f6;

  /* Typography */
  --font-primary: 'Inter', sans-serif, system-ui;
  --font-size-xs: 10px;
  --font-size-sm: 11px;
  --font-size-base: 12px;
  --font-size-md: 13px;
  --font-size-lg: 14px;

  /* Spacing & Shape */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-pill: 16px;
  --shadow-panel: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.6);

  /* Layout */
  --header-height: 52px;
  --timeline-height: 80px;
  --panel-width: 260px;
}

/* ═══ Reset ═══ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-primary);
  font-size: var(--font-base);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════════════ */
#appHeader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  height: 28px;
  cursor: pointer;
}

/* Course selector dropdown */
.course-selector {
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 5px 28px 5px 10px;
  font-family: var(--font-primary);
  font-size: var(--font-size-md);
  cursor: pointer;
  outline: none;
  min-width: 160px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2398a0a8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.course-selector:hover {
  border-color: var(--color-brand);
}

.course-selector:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 2px var(--color-brand-dim);
}

.course-selector option {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.header-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Mode toggle buttons (2D / 3D / Ledger) */
.mode-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-md);
  font-family: var(--font-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  border-color: var(--color-brand);
  color: var(--color-brand-light);
}

.mode-btn.active {
  background: var(--color-brand);
  color: var(--color-bg-primary);
  border-color: var(--color-brand);
  font-weight: 600;
}

/* Header action buttons (Compare, Measure) */
.header-btn {
  background: transparent;
  border: 1px solid var(--color-brand);
  color: var(--color-brand-light);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-md);
  font-family: var(--font-primary);
  transition: all 0.2s ease;
}

.header-btn:hover {
  background: var(--color-brand-dim);
}

.header-btn.active {
  background: var(--color-brand);
  color: var(--color-bg-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   VERSION BADGE
   ═══════════════════════════════════════════════════════════════════════════ */
#versionBadge {
  position: fixed;
  top: calc(var(--header-height) + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 18, 20, 0.85);
  color: var(--color-text-secondary);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  z-index: 100;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   POPUP STACK (Compare + Measure)
   ═══════════════════════════════════════════════════════════════════════════ */
#popupStack {
  position: fixed;
  top: calc(var(--header-height) + 40px);
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
  pointer-events: none;
}

.compare-popup,
.measure-popup {
  position: static;
  transform: none;
  width: 100%;
  box-sizing: border-box;
  pointer-events: auto;
  background: rgba(16, 18, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.compare-popup.visible,
.measure-popup.visible {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

/* ═══ Compare Toolbar — Flight Selection Dropdowns ═══ */
.compare-toolbar {
  position: fixed;
  top: calc(var(--header-height) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  pointer-events: auto;
}

.compare-toolbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 18, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.compare-side {
  display: flex;
  align-items: center;
  gap: 6px;
}

.compare-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.compare-select {
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  cursor: pointer;
  outline: none;
  min-width: 130px;
  transition: border-color 0.2s ease;
}

.compare-select:hover,
.compare-select:focus {
  border-color: var(--color-brand);
}

.compare-select option {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.compare-vs {
  font-size: 16px;
  color: var(--color-brand);
  font-weight: 700;
}

.compare-close {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-secondary);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  margin-left: 4px;
}

.compare-close:hover {
  border-color: #ff4d4f;
  color: #ff4d4f;
  background: rgba(255, 77, 79, 0.1);
}

.compare-viewport-filter {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  margin-left: 4px;
}

.compare-viewport-filter input[type="checkbox"] {
  accent-color: var(--color-brand);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.compare-filter-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* Measure popup inner content */
.measure-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.measure-mode-label {
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.measure-switch-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-xs);
  font-family: var(--font-primary);
  transition: all 0.15s ease;
}

.measure-switch-btn:hover {
  background: var(--color-brand-dim);
  color: var(--color-brand-light);
  border-color: var(--color-brand);
}

.measure-live {
  width: 100%;
  font-size: 18px;
  font-weight: 600;
  color: #ff6b35;
  padding: 6px 0;
}

.measure-result {
  width: 100%;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  padding: 2px 0;
  border-top: 1px solid var(--color-border);
}

.measure-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-top: 4px;
  border-top: 1px solid var(--color-border);
}

.measure-clear-btn {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-xs);
  font-family: var(--font-primary);
  transition: all 0.15s ease;
}

.measure-clear-btn:hover {
  border-color: #ff4d4f;
  color: #ff4d4f;
}

.measure-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  opacity: 0.6;
}

/* Observation popup styles */
.obs-popup-container .maplibregl-popup-content {
  background: rgba(16, 18, 20, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  color: var(--color-text-primary);
}

.obs-popup-container .maplibregl-popup-close-button {
  color: var(--color-text-secondary);
  font-size: 18px;
  right: 6px;
  top: 4px;
  z-index: 2;
}

.obs-popup-thumb {
  width: 100%;
  height: 140px;
  background-size: cover;
  background-position: center;
  background-color: rgba(255, 255, 255, 0.05);
}

.obs-popup-content {
  padding: 10px 12px;
}

.obs-popup-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.obs-severity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.obs-popup-category {
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.obs-status {
  font-size: var(--font-size-xs);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  margin-left: auto;
  text-transform: capitalize;
}

.obs-status.open {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.obs-status.monitoring {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.obs-status.resolved {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.obs-status.closed {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

.obs-popup-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0 0 6px;
  line-height: 1.4;
}

.obs-popup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAP CONTAINER
   ═══════════════════════════════════════════════════════════════════════════ */
#viewDiv {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: var(--panel-width);
  bottom: var(--timeline-height);
  background: var(--color-bg-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BASEMAP TOGGLE
   ═══════════════════════════════════════════════════════════════════════════ */
#basemapToggle {
  position: fixed;
  bottom: calc(var(--timeline-height) + 50px);
  left: 16px;
  width: 60px;
  height: 60px;
  cursor: pointer;
  z-index: 100;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-panel);
  transition: border-color 0.2s ease;
}

#basemapToggle:hover {
  border-color: var(--color-brand);
}

#basemapIcon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Layer Toggles (DSM, Contours) */
.layer-toggles {
  position: fixed;
  bottom: calc(var(--timeline-height) + 130px);
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 100;
}

.layer-toggle-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: rgba(15, 16, 19, 0.85);
  color: var(--color-text-secondary);
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-panel);
  transition: all 0.15s;
}

.layer-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-text-secondary);
}

.layer-toggle-btn.active {
  background: rgba(0, 210, 255, 0.15);
  border-color: var(--brand-primary);
  color: var(--color-text-primary);
}

/* Contour style controls panel */
.contour-style-panel {
  background: rgba(20, 22, 28, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
  width: 180px;
}

.csp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.csp-row:last-child {
  margin-bottom: 0;
}

.csp-label {
  font-size: 10px;
  color: #94a3b8;
  min-width: 34px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.csp-val {
  font-size: 10px;
  color: #cbd5e1;
  min-width: 32px;
  text-align: right;
}

.csp-row input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  outline: none;
}

.csp-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.csp-row input[type="color"] {
  width: 24px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  background: none;
  cursor: pointer;
  padding: 0;
}

/* Status Bar (Pix4D-style bottom strip) */
#statusBar {
  position: fixed;
  bottom: var(--timeline-height, 80px);
  left: 0;
  right: 0;
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: rgba(10, 12, 18, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10.5px;
  font-family: var(--font-mono, 'SF Mono', 'Fira Code', monospace);
  color: rgba(180, 185, 200, 0.9);
  z-index: 100;
  pointer-events: none;
  gap: 0;
}

.sb-field {
  padding: 0 10px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.sb-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.toggle-icon {
  font-size: 14px;
}

.toggle-label {
  letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANNOTATIONS PANEL (Right Sidebar)
   ═══════════════════════════════════════════════════════════════════════════ */
#annotationsPanel {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: var(--panel-width);
  bottom: var(--timeline-height);
  background: var(--color-bg-secondary);
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  z-index: 500;
  overflow: hidden;
}

#annotationsPanel>header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.header-count {
  background: var(--color-brand-dim);
  color: var(--color-brand-light);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

/* Drawing toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border);
  background: rgba(0, 0, 0, 0.2);
}

.tool-btn {
  flex: 1 0 auto;
  min-width: 52px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-secondary);
  padding: 5px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-xs);
  font-family: var(--font-primary);
  text-align: center;
  transition: all 0.15s ease;
}

.tool-btn:hover {
  background: var(--color-brand-dim);
  border-color: var(--color-brand);
  color: var(--color-brand-light);
}

.tool-btn.active {
  background: var(--color-brand);
  color: var(--color-bg-primary);
  border-color: var(--color-brand);
}

/* Group Management Buttons (MVP: green "+ Group" / red "Group") */
.group-mgmt-row {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--color-border);
}

.group-mgmt-btn {
  flex: 1;
  padding: 6px 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-family: var(--font-primary);
  font-weight: 600;
  text-align: center;
  transition: all 0.15s ease;
}

.group-add-btn {
  background: var(--color-brand);
  color: #fff;
  border: 1px solid var(--color-brand);
}

.group-add-btn:hover {
  background: #5cb84a;
}

.group-mode-btn {
  background: transparent;
  color: #ff4d4f;
  border: 1px solid #ff4d4f;
}

.group-mode-btn:hover {
  background: rgba(255, 77, 79, 0.15);
}

.group-mode-btn.active {
  background: #ff4d4f;
  color: #fff;
}

/* Opacity Controls */
.opacity-controls {
  padding: 8px;
  border-bottom: 1px solid var(--color-border);
}

.opacity-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
}

.opacity-row input[type="checkbox"] {
  accent-color: var(--color-brand);
  margin: 0;
}

.opacity-row label {
  flex: 1;
  cursor: pointer;
  user-select: none;
}

.opacity-slider {
  width: 80px;
  accent-color: var(--color-brand);
  cursor: pointer;
}

/* Annotation list */
.annotation-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* Category section labels */
.anno-category-section {
  border-bottom: 1px solid var(--color-border);
}

.anno-category-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-text-secondary);
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cat-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-visibility-toggle {
  accent-color: var(--color-brand);
  margin: 0;
}

.cat-add-group-btn {
  background: rgba(77, 160, 58, 0.2);
  border: 1px solid rgba(77, 160, 58, 0.5);
  color: var(--color-brand);
  cursor: pointer;
  border-radius: 3px;
  font-size: 10px;
  padding: 0px 5px;
  line-height: 1.4;
  transition: background 0.15s;
}

.cat-add-group-btn:hover {
  background: rgba(77, 160, 58, 0.4);
}

/* Nested group node container */
.anno-group-node {
  position: relative;
}

/* Group body — drop target for drag-and-drop */
.anno-group-body {
  min-height: 4px;
  transition: background 0.15s;
}

.anno-group-body.drag-over {
  background: rgba(77, 160, 58, 0.15);
  outline: 1px dashed rgba(77, 160, 58, 0.5);
  outline-offset: -1px;
}

/* Color swatch interactive */
.group-swatch {
  cursor: pointer;
}

/* Delete button — subtle red on hover */
.grp-delete-btn:hover {
  color: #e53e3e !important;
  background: rgba(229, 62, 62, 0.15) !important;
}

/* Dragging annotation item */
.annotation-item[draggable='true'] {
  cursor: grab;
  transition: opacity 0.15s;
}

/* Group row (MVP: checkbox | swatch | name | (count) | action icons) */
.anno-group-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: background 0.15s ease;
  position: relative;
}

.anno-group-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.anno-group-row.active {
  background: var(--color-brand-dim);
  border-left: 3px solid var(--color-brand);
}

.anno-group-row .group-checkbox {
  accent-color: var(--color-brand);
  margin: 0;
}

.group-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.group-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-count {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
}

.group-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20, 20, 30, 0.92);
  padding: 2px 4px;
  border-radius: 4px;
  z-index: 2;
}

.anno-group-row:hover .group-actions {
  opacity: 1;
}

.grp-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 1px 2px;
  border-radius: 3px;
  transition: background 0.15s;
}

.grp-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Annotation items within active group */
.anno-item-list {
  padding: 2px 0;
  background: rgba(0, 0, 0, 0.15);
}

.annotation-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 32px;
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.annotation-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.annotation-item.selected {
  background: rgba(99, 102, 241, 0.15);
  border-left: 3px solid var(--color-brand);
  padding-left: 29px;
  /* compensate for border so text doesn't shift */
}

.annotation-type-icon {
  width: 16px;
  text-align: center;
  font-size: 12px;
}

.annotation-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Annotation action buttons (eye, copy, delete) */
.annotation-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
  margin-left: auto;
  flex-shrink: 0;
}

.annotation-item:hover .annotation-actions {
  opacity: 1;
}

.anno-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 1px 3px;
  border-radius: 3px;
  transition: background 0.15s;
  color: var(--color-text-secondary);
}

.anno-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.anno-vis-btn:hover {
  color: #f59e0b;
}

.anno-copy-btn:hover {
  color: #3b82f6;
}

.annotation-delete-btn {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 3px;
  transition: color 0.15s ease;
}

.annotation-delete-btn:hover {
  color: #ff4d4f;
  background: rgba(255, 77, 79, 0.1);
}

/* Viewer dialog overlay (copy-to-group, etc.) */
.admin-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.admin-dialog {
  background: var(--color-bg-secondary, #1a1b1f);
  border: 1px solid var(--color-border, rgba(255,255,255,0.08));
  border-radius: 10px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  color: var(--color-text-primary, #e0e0e0);
}

.admin-dialog h3 {
  font-size: 18px;
  margin-bottom: 16px;
}

.admin-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-secondary, #94a3b8);
  border: 1px solid var(--color-border, rgba(255,255,255,0.08));
  padding: 8px 16px;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.admin-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.admin-btn-primary {
  background: var(--color-brand, #4da03a);
  color: #fff;
  border-color: var(--color-brand, #4da03a);
}

.admin-btn-primary:hover {
  filter: brightness(1.1);
}

.admin-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border, rgba(255,255,255,0.08));
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--color-text-primary, #e0e0e0);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.admin-input:focus {
  border-color: var(--color-brand, #4da03a);
}

.admin-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.loading-state {
  padding: 12px;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TIMELINE BAR (Bottom)
   ═══════════════════════════════════════════════════════════════════════════ */
#timelineBar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--timeline-height);
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  z-index: 500;
  overflow: hidden;
}

#timelineToggleBtn {
  position: absolute;
  top: -24px;
  right: 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-bottom: none;
  color: var(--color-text-secondary);
  padding: 2px 12px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  font-size: var(--font-size-xs);
  z-index: 501;
}

#timelineWatermark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 50px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.08);
  letter-spacing: 4px;
  text-transform: uppercase;
  white-space: nowrap;
  font-family: 'Inter', sans-serif, system-ui;
  pointer-events: none;
  user-select: none;
}

#timelineCards {
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
}

#timelineCards:active {
  cursor: grabbing;
}

#timelineTrack {
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Timeline flight cards */
.timeline-card {
  position: absolute;
  width: 40px;
  height: 50px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.1s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timeline-card:hover {
  transform: translate(-50%, -50%) scale(1.1);
  z-index: 10;
}

.timeline-card.active {
  z-index: 11;
}

.timeline-card img {
  width: 100%;
  height: 36px;
  object-fit: contain;
  object-position: center;
  border: 1px solid #666;
  border-radius: 2px;
  display: block;
  background: #1a1b1f;
}

.timeline-card.active img {
  border: 2px solid var(--color-brand);
}

.timeline-date-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 2px 0;
  width: 100%;
  background: #2a2a2a;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.timeline-card.active .timeline-date-label {
  color: rgba(255, 255, 255, 1);
  font-weight: 600;
}

/* Timeline scan markers (💧 moisture scans) */
.timeline-scan-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 18px;
  cursor: pointer;
  filter: grayscale(0.3);
  opacity: 0.7;
  transition: all 0.15s ease;
  z-index: 5;
  user-select: none;
}

.timeline-scan-marker:hover {
  opacity: 1;
  filter: grayscale(0) drop-shadow(0 0 4px rgba(0, 180, 255, 0.6));
  transform: translate(-50%, -50%) scale(1.3);
}

.timeline-scan-marker.active {
  opacity: 1;
  filter: grayscale(0) drop-shadow(0 0 6px rgba(0, 180, 255, 0.8));
  transform: translate(-50%, -50%) scale(1.2);
}

/* Timeline axis tick marks */
.timeline-tick {
  position: absolute;
  height: 100%;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 4px;
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEVERITY PILLS
   ═══════════════════════════════════════════════════════════════════════════ */
.severity-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.severity-pill--high {
  background: rgba(220, 38, 38, 0.15);
  color: var(--severity-high);
}

.severity-pill--medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--severity-med);
}

.severity-pill--low {
  background: rgba(34, 197, 94, 0.15);
  color: var(--severity-low);
}

.severity-pill--info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--severity-info);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING / EMPTY STATES
   ═══════════════════════════════════════════════════════════════════════════ */
.loading-state {
  padding: 24px 16px;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-style: italic;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLLBAR (matches MVP dark theme)
   ═══════════════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAPLIBRE OVERRIDES
   ═══════════════════════════════════════════════════════════════════════════ */
.maplibregl-ctrl-group {
  background: var(--color-bg-secondary) !important;
  border: 1px solid var(--color-border) !important;
}

.maplibregl-ctrl-group button {
  background-color: transparent !important;
}

.maplibregl-ctrl-group button+button {
  border-top: 1px solid var(--color-border) !important;
}

.maplibregl-ctrl-attrib-inner {
  color: var(--color-text-secondary) !important;
  font-size: 9px !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 60px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-family: 'Inter', sans-serif;
  color: var(--color-text-primary);
  background: rgba(26, 27, 31, 0.95);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  animation: toast-slide-in 0.3s ease-out;
  max-width: 360px;
}

.toast.toast-out {
  animation: toast-slide-out 0.25s ease-in forwards;
}

.toast-success {
  border-left: 3px solid #22c55e;
}

.toast-error {
  border-left: 3px solid #ef4444;
}

.toast-info {
  border-left: 3px solid #3b82f6;
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  line-height: 1.3;
}

@keyframes toast-slide-in {
  from {
    transform: translateX(120%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toast-slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING SKELETON
   ═══════════════════════════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.04) 25%,
      rgba(255, 255, 255, 0.08) 50%,
      rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-line {
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-line:last-child {
  width: 60%;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MICRO-ANIMATIONS & POLISH
   ═══════════════════════════════════════════════════════════════════════════ */

/* Smooth button interactions */
.toolbar-btn,
.panel-toggle,
.dropdown-trigger {
  transition: all 0.15s ease;
}

.toolbar-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toolbar-btn:active {
  transform: translateY(0);
}

.toolbar-btn.active {
  box-shadow: 0 0 0 2px var(--color-brand), 0 4px 12px rgba(77, 160, 58, 0.3);
}

/* Smooth panel transitions */
.annotation-panel,
.annotation-group-header,
.annotation-item {
  transition: background 0.15s ease;
}

/* Focus ring for accessibility */
input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   OBSERVATION FILTER CONTROLS
   ═══════════════════════════════════════════════════════════════════════════ */
.obs-filter-panel {
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(6px);
  font-size: var(--font-size-xs);
  align-items: center;
  flex-wrap: wrap;
}

.obs-filter-panel select,
.obs-filter-panel input[type="date"] {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  padding: 3px 6px;
}

.obs-filter-label {
  color: var(--color-text-secondary);
  font-weight: 500;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   OBSERVATION POPUP ACTIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.obs-popup-actions {
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

.obs-action-btn {
  display: inline-block;
  padding: 4px 12px;
  border: none;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}

.obs-action-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.obs-action-btn:active {
  transform: translateY(0);
}

.obs-resolve-btn {
  background: #22c55e;
  color: #0c0e11;
}

.obs-reopen-btn {
  background: #f59e0b;
  color: #0c0e11;
}

/* ═══════════════════════════════════════════════════════════════════════════
   OBSERVATION STATS BAR
   ═══════════════════════════════════════════════════════════════════════════ */
.obs-stats-bar {
  position: absolute;
  top: var(--header-h, 48px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 14px;
  background: rgba(12, 14, 17, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: none;
  border-radius: 0 0 8px 8px;
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 500;
}

.obs-stats-bar:empty {
  display: none;
}

.obs-stat {
  white-space: nowrap;
}

.obs-stat-open {
  color: #f59e0b;
}

.obs-stat-resolved {
  color: #22c55e;
}

.obs-stat-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tablet — ≤ 768px */
@media (max-width: 768px) {
  .annotation-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-height: 40vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-top: 1px solid var(--color-border);
  }

  .toolbar-btn .btn-label {
    display: none;
  }

  .header-toolbar {
    gap: 4px;
  }

  .obs-filter-panel {
    font-size: 10px;
  }
}

/* Mobile — ≤ 480px */
@media (max-width: 480px) {
  .header {
    flex-wrap: wrap;
    height: auto;
    padding: 6px 10px;
  }

  .header-brand {
    font-size: 14px;
  }

  .annotation-panel {
    max-height: 35vh;
  }

  .maplibregl-popup-content {
    max-width: 260px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   EXPORT BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.obs-export-btns {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.obs-export-btn {
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.obs-export-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-text-primary);
  border-color: var(--color-brand);
}

/* ═══════════════════════════════════════════════════════════════════════════
   OBSERVATION CREATOR FORM
   ═══════════════════════════════════════════════════════════════════════════ */
.obs-creator-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px;
}

.obs-creator-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.obs-creator-coords {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 4px;
}

.obs-creator-form label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.obs-creator-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 5px 8px;
  color: var(--color-text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
}

.obs-creator-input:focus {
  border-color: var(--color-brand);
  outline: none;
}

.obs-creator-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
@media print {

  /* Hide interactive chrome */
  #appHeader,
  .annotation-panel,
  .toolbar,
  .obs-filter-panel,
  .obs-popup-actions,
  .obs-export-btns,
  #versionBadge,
  #popupStack,
  #timelineBar,
  .maplibregl-ctrl-group,
  .maplibregl-ctrl-attrib,
  .header-btn,
  .toast {
    display: none !important;
  }

  /* White background for printing */
  body {
    background: #fff !important;
    color: #111 !important;
  }

  /* Map fills page */
  #mapContainer {
    position: relative !important;
    width: 100% !important;
    height: 80vh !important;
  }

  /* Stats bar prints cleanly */
  .obs-stats-bar {
    position: static !important;
    transform: none !important;
    background: #f5f5f5 !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    margin: 8px 0 !important;
    backdrop-filter: none !important;
    justify-content: center;
  }

  .obs-stat-sep {
    background: #ccc !important;
  }

  /* No page breaks inside popups */
  .maplibregl-popup-content {
    break-inside: avoid;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DUAL-RANGE SLIDERS (DSM / Moisture histogram clamp controls)
   Ported from rat-server/static/map.html
   ═══════════════════════════════════════════════════════════════════════════ */
.dual-range {
  position: relative;
  height: 24px;
  margin-top: -2px;
}

.dual-range input[type="range"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  height: 24px;
  margin: 0;
  z-index: 2;
}

.dual-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3a9bff;
  border: 2px solid #fff;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.dual-range input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3a9bff;
  border: 2px solid #fff;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.dual-range .track {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  height: 4px;
  background: #555;
  border-radius: 2px;
}

.dual-range .track-fill {
  position: absolute;
  top: 10px;
  height: 4px;
  background: #3a9bff;
  border-radius: 2px;
}

.histogram-wrap {
  position: relative;
  margin-bottom: 0;
}

.histogram-wrap canvas {
  width: 100%;
  display: block;
}

/* ═══ Smart Button States — Capability-Disabled ═══ */
.capability-disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: auto !important;
  /* keep hover for tooltip */
  position: relative;
}

.capability-disabled:hover {
  background: inherit !important;
  color: inherit !important;
}

.capability-disabled .disabled-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.92);
  color: #e5e8eb;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.capability-disabled .disabled-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.92);
}

.capability-disabled:hover .disabled-tip {
  display: block;
}

/* Layer toggle specific — show tooltip below instead of above */
.layer-toggle-btn.capability-disabled .disabled-tip {
  bottom: auto;
  top: calc(100% + 8px);
}

.layer-toggle-btn.capability-disabled .disabled-tip::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: rgba(0, 0, 0, 0.92);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DESIGN OVERLAYS PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

.overlay-panel-section {
  border-top: 1px solid var(--color-border);
}

.overlay-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.overlay-panel-header .header-count {
  font-size: 10px;
}

.overlay-add-btn {
  margin-left: auto;
  background: rgba(77, 160, 58, 0.2);
  border: 1px solid rgba(77, 160, 58, 0.5);
  color: var(--color-brand);
  cursor: pointer;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  padding: 0 6px;
  line-height: 1.6;
  transition: background 0.15s;
}

.overlay-add-btn:hover {
  background: rgba(77, 160, 58, 0.4);
}

.overlay-list {
  overflow-y: auto;
  max-height: 200px;
}

.overlay-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: var(--font-size-sm);
  transition: background 0.15s;
}

.overlay-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.overlay-vis-toggle {
  accent-color: var(--color-brand);
  margin: 0;
}

.overlay-type-icon {
  font-size: 12px;
  width: 16px;
  text-align: center;
}

.overlay-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overlay-badge {
  font-size: 10px;
  padding: 0 4px;
  border-radius: 3px;
  animation: pulse-badge 1.5s ease-in-out infinite;
}

.overlay-badge.needs-georef {
  color: #f59e0b;
}

@keyframes pulse-badge {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.overlay-opacity-slider {
  width: 50px;
  accent-color: var(--color-brand);
  cursor: pointer;
}

.overlay-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}

.overlay-row:hover .overlay-actions {
  opacity: 1;
}

.overlay-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 1px 3px;
  border-radius: 3px;
  transition: background 0.15s;
}

.overlay-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.overlay-delete-btn:hover {
  color: #e53e3e !important;
  background: rgba(229, 62, 62, 0.15) !important;
}

.overlay-empty {
  padding: 12px;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GEOREF PANEL (Floating)
   ═══════════════════════════════════════════════════════════════════════════ */

.georef-panel {
  position: fixed;
  top: 80px;
  left: 20px;
  width: 260px;
  background: rgba(15, 16, 22, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  font-family: var(--font-primary, 'Inter', sans-serif);
  color: var(--color-text-primary, #e8eaf0);
}

.georef-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 600;
}

.georef-close {
  background: none;
  border: none;
  color: var(--color-text-secondary, #94a3b8);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
}

.georef-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.georef-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.georef-hint {
  font-size: 11px;
  color: var(--color-text-secondary, #94a3b8);
  margin: 0;
  line-height: 1.4;
}

.georef-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-secondary, #b0b5c0);
}

.georef-slider {
  flex: 1;
  accent-color: var(--color-brand, #4da03a);
  cursor: pointer;
}

.georef-scale-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.georef-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 28px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.georef-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

#georefScaleVal,
#georefRotVal {
  min-width: 36px;
  text-align: center;
  font-size: 11px;
  color: var(--color-text-primary, #e8eaf0);
}

.georef-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.georef-cancel-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-text-secondary, #94a3b8);
  padding: 7px 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}

.georef-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.georef-save-btn {
  flex: 1;
  background: var(--color-brand, #4da03a);
  border: none;
  color: #fff;
  padding: 7px 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s;
}

.georef-save-btn:hover {
  background: #5cb84a;
}

/* --- Georef: Control Point Registration --- */

.georef-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.georef-register-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.1s;
  text-align: center;
}

.georef-register-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.georef-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 2px 0;
}

.georef-reg-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.georef-reg-prompt {
  font-size: 11px;
  color: var(--color-text-secondary, #94a3b8);
  line-height: 1.5;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.reg-step-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.reg-step-overlay {
  background: rgba(245, 158, 11, 0.25);
  color: #f59e0b;
}

.reg-step-map {
  background: rgba(34, 197, 94, 0.25);
  color: #22c55e;
}

.georef-reg-points {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.reg-point-pair {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

.reg-pair-num {
  font-weight: 600;
  color: #e8eaf0;
  margin-right: 2px;
}

.reg-pair-overlay {
  color: #f59e0b;
}

.reg-pair-map {
  color: #22c55e;
}

.georef-reg-actions {
  display: flex;
  gap: 6px;
}

.georef-btn-sm {
  font-size: 11px;
  padding: 4px 10px;
  width: auto;
  height: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   IMPORT DIALOG
   ═══════════════════════════════════════════════════════════════════════════ */

.import-dialog-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.import-dialog {
  width: 480px;
  max-height: 85vh;
  background: var(--color-bg-secondary, #14161c);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-primary, 'Inter', sans-serif);
  color: var(--color-text-primary, #e8eaf0);
}

.import-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 600;
}

.import-dialog-close {
  background: none;
  border: none;
  color: var(--color-text-secondary, #94a3b8);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
}

.import-dialog-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.import-dialog-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Format Selector */
.import-format-selector {
  display: flex;
  gap: 8px;
}

.import-format-option {
  flex: 1;
  cursor: pointer;
}

.import-format-option input {
  display: none;
}

.format-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.15s;
}

.import-format-option input:checked+.format-card {
  border-color: var(--color-brand, #4da03a);
  background: rgba(77, 160, 58, 0.1);
}

.format-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.format-icon {
  font-size: 20px;
}

.format-name {
  font-size: 12px;
  font-weight: 600;
}

.format-desc {
  font-size: 10px;
  color: var(--color-text-secondary, #94a3b8);
}

/* File Drop Zone */
.import-file-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.import-file-zone:hover,
.import-file-zone.drag-active {
  border-color: var(--color-brand, #4da03a);
  background: rgba(77, 160, 58, 0.05);
}

.import-file-icon {
  font-size: 24px;
}

.import-file-text {
  font-size: 12px;
  color: var(--color-text-secondary, #94a3b8);
}

.import-file-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-brand, #4da03a);
}

/* Preview Area */
.import-preview-area {
  max-height: 300px;
  overflow-y: auto;
}

.import-summary {
  padding: 0;
}

.import-summary h4 {
  font-size: 13px;
  margin: 0 0 10px;
}

.import-stat-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.import-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
}

.stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-brand, #4da03a);
}

.stat-label {
  font-size: 10px;
  color: var(--color-text-secondary, #94a3b8);
  margin-top: 2px;
}

/* DXF Layer List */
.dxf-select-all {
  margin-bottom: 6px;
  font-size: 12px;
}

.dxf-select-all input {
  accent-color: var(--color-brand, #4da03a);
}

.dxf-layer-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 200px;
  overflow-y: auto;
}

.dxf-layer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s;
}

.dxf-layer-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.dxf-layer-check {
  accent-color: var(--color-brand, #4da03a);
}

.dxf-layer-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.dxf-layer-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dxf-layer-count {
  color: var(--color-text-secondary, #94a3b8);
  font-size: 11px;
}

.dxf-layer-types {
  color: rgba(148, 163, 184, 0.6);
  font-size: 10px;
}

.import-option {
  margin-top: 8px;
  font-size: 12px;
}

.import-option input {
  accent-color: var(--color-brand, #4da03a);
}

.import-hint {
  font-size: 11px;
  color: var(--color-text-secondary, #94a3b8);
  margin: 8px 0 0;
}

/* CSV Mapping */
.csv-mapping {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.csv-map-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.csv-map-row label {
  min-width: 110px;
  color: var(--color-text-secondary, #b0b5c0);
}

.csv-map-row select {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-text-primary, #e8eaf0);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
}

.csv-preview-table {
  overflow-x: auto;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.csv-preview-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.csv-preview-table th {
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 8px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.csv-preview-table td {
  padding: 3px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.csv-more {
  text-align: center;
  font-size: 11px;
  color: var(--color-text-secondary, #94a3b8);
  padding: 6px;
}

/* Status Messages */
.import-status {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
}

.import-loading {
  padding: 12px;
  text-align: center;
  color: var(--color-text-secondary, #94a3b8);
}

.import-error {
  color: #ef4444;
  padding: 8px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 6px;
  font-size: 12px;
}

.import-success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.import-error-msg {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Dialog Footer */
.import-dialog-footer {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.import-cancel-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-text-secondary, #94a3b8);
  padding: 8px 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.import-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.import-submit-btn {
  flex: 1;
  background: var(--color-brand, #4da03a);
  border: none;
  color: #fff;
  padding: 8px 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}

.import-submit-btn:hover:not(:disabled) {
  background: #5cb84a;
}

.import-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Annotation Attribute Table — Slide-up Bottom Panel
   ═══════════════════════════════════════════════════════════════════════════ */

.attr-table-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30vh;
  min-height: 120px;
  max-height: 70vh;
  background: var(--panel-bg, #0f1923);
  border-top: 2px solid var(--accent, #00d2ff);
  z-index: 900;
  display: flex;
  flex-direction: column;
  animation: attrSlideUp 0.25s ease-out;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
}

.attr-table-panel.minimized {
  height: 40px !important;
  min-height: 40px;
}

.attr-table-panel.minimized .attr-table-body {
  display: none;
}

@keyframes attrSlideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

/* Resize handle */
.attr-table-resize-handle {
  height: 6px;
  cursor: ns-resize;
  background: transparent;
  position: relative;
}

.attr-table-resize-handle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 2px;
  width: 40px;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  transform: translateX(-50%);
}

.attr-table-resize-handle:hover::after {
  background: rgba(255, 255, 255, 0.4);
}

/* Toolbar */
.attr-table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.attr-table-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.attr-table-group-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.attr-table-group-name {
  font-weight: 600;
  font-size: 13px;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.attr-table-count {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}

.attr-table-toolbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.attr-table-search {
  width: 100%;
  max-width: 280px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
  color: #e0e0e0;
  font-size: 12px;
  outline: none;
}

.attr-table-search:focus {
  border-color: var(--accent, #00d2ff);
}

.attr-table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.attr-table-btn {
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #ccc;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.attr-table-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.attr-table-btn.attr-close:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

/* Table body (scrollable) */
.attr-table-body {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

/* Table */
.attr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}

.attr-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.attr-table th {
  background: #1a2332;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: relative;
}

.attr-table th:hover {
  color: rgba(255, 255, 255, 0.85);
}

.attr-table th .sort-arrow {
  font-size: 10px;
  margin-left: 3px;
  opacity: 0.5;
}

.attr-table th.sorted .sort-arrow {
  opacity: 1;
  color: var(--accent, #00d2ff);
}

.attr-table td {
  padding: 5px 10px;
  color: #c8d0d8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* Alternating rows */
.attr-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.attr-table tbody tr:hover {
  background: rgba(0, 210, 255, 0.06);
}

/* Selected row */
.attr-table tbody tr.attr-selected {
  background: rgba(0, 210, 255, 0.12) !important;
  outline: 1px solid rgba(0, 210, 255, 0.3);
}

/* Editable cells */
.attr-table td.editable {
  cursor: pointer;
  position: relative;
}

.attr-table td.editable:hover {
  background: rgba(255, 255, 255, 0.04);
}

.attr-table td.editable .placeholder {
  color: rgba(255, 255, 255, 0.2);
  font-style: italic;
}

/* Pencil edit button */
.cell-edit-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  opacity: 0.5;
  transition: opacity 0.15s;
  vertical-align: middle;
  margin-left: 4px;
}

.attr-table td.editable:hover .cell-edit-btn {
  display: inline;
}

.cell-edit-btn:hover {
  opacity: 1;
}

.cell-text {
  vertical-align: middle;
}

/* Inline edit input */
.attr-table td .attr-edit-input {
  width: 100%;
  padding: 1px 4px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--accent, #00d2ff);
  border-radius: 3px;
  color: #e0e0e0;
  font-size: 12px;
  outline: none;
}

/* Totals footer row */
.attr-table tfoot {
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.attr-totals-row {
  background: rgba(20, 20, 35, 0.95);
  border-top: 2px solid rgba(99, 102, 241, 0.4);
  font-size: 12px;
}

.attr-totals-row td {
  padding: 6px 8px;
  color: rgba(255, 255, 255, 0.9);
}

.attr-totals-label {
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 11px;
}

.attr-totals-value {
  color: #6ee7b7 !important;
}

/* Save flash */
.attr-table td.save-flash {
  animation: attrSaveFlash 0.6s ease-out;
}

@keyframes attrSaveFlash {
  0% {
    background: rgba(34, 197, 94, 0.3);
  }

  100% {
    background: transparent;
  }
}

/* Type badge */
.attr-type-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.attr-type-badge.point {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.attr-type-badge.line {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.attr-type-badge.polygon {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.attr-type-badge.circle {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

/* Empty state */
.attr-table-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE VIEWER MODE (?mobile=1)
   Simplified full-screen map for field users from the capture page.
   Hides desktop UI: annotations panel, timeline, toolbar buttons.
   ═══════════════════════════════════════════════════════════════════════════ */
body.mobile-view #annotationsPanel {
  display: none !important;
}

body.mobile-view #timelineBar {
  display: none !important;
}

body.mobile-view #statusBar {
  display: none !important;
}

body.mobile-view #popupStack {
  display: none !important;
}

body.mobile-view .header-center {
  display: none !important;
}

body.mobile-view .header-right .header-btn {
  display: none !important;
}

body.mobile-view .layer-toggles {
  display: none !important;
}

body.mobile-view #viewDiv {
  right: 0 !important;
  bottom: 0 !important;
}

body.mobile-view #appHeader {
  height: 44px;
  padding: 0 12px;
}

/* Floating back-to-capture button */
.mobile-back-btn {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 12px 24px;
  background: var(--color-brand, #4da03a);
  color: #fff;
  font-family: var(--font-primary, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 700;
  border-radius: 24px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.mobile-back-btn:hover {
  background: #5cb84a;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SUN ANALYSIS PANEL
   ═══════════════════════════════════════════════════════════════════════════ */
.sun-analysis-panel {
  position: fixed;
  bottom: calc(var(--timeline-height) + 200px);
  left: 16px;
  width: 280px;
  background: rgba(20, 22, 28, 0.94);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
  font-family: var(--font-primary);
  color: #e0e0e0;
  padding: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.sun-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 600;
}

.sun-panel-close {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  transition: color 0.15s;
}

.sun-panel-close:hover {
  color: #fff;
}

.sun-panel-body {
  padding: 12px 14px;
}

.sun-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sun-row label {
  font-size: 11px;
  text-transform: uppercase;
  color: #888;
  min-width: 36px;
  letter-spacing: 0.3px;
}

.sun-date-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e0e0e0;
  padding: 6px 10px;
  font-size: 13px;
  font-family: var(--font-primary);
  transition: border-color 0.2s;
}

.sun-date-input:focus {
  outline: none;
  border-color: #ffc832;
}

.sun-date-input::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
}

/* Readout Grid */
.sun-readout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.sun-metric {
  text-align: center;
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  transition: background 0.15s;
}

.sun-metric:hover {
  background: rgba(255, 255, 255, 0.07);
}

.sun-metric-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.sun-metric-value {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #ffc832;
}

/* Sunrise / Sunset */
.sun-times-row {
  display: flex;
  justify-content: space-around;
  margin-bottom: 14px;
  font-size: 12px;
  color: #ccc;
}

.sun-icon {
  margin-right: 4px;
}

/* Time Scrubber */
.sun-scrubber {
  position: relative;
  margin-bottom: 4px;
}

.sun-scrubber-track {
  position: relative;
  height: 28px;
  background: linear-gradient(90deg,
      #1a1a2e 0%,
      #2d1b4e 8%,
      #e6a817 18%,
      #ffc832 35%,
      #ffd700 50%,
      #ffc832 65%,
      #e6a817 82%,
      #2d1b4e 92%,
      #1a1a2e 100%);
  border-radius: 6px;
  overflow: hidden;
}

.sun-scrubber-track input[type="range"] {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  margin: 0;
  cursor: pointer;
}

.sun-scrubber-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 4px;
  height: 28px;
  background: #fff;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.8), 0 0 16px rgba(255, 215, 0, 0.3);
}

.sun-scrubber-track input[type="range"]::-moz-range-thumb {
  width: 4px;
  height: 28px;
  background: #fff;
  border-radius: 2px;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
}

.sun-scrubber-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #666;
  padding: 4px 2px 0;
}

.sun-current-time {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #ffc832;
  margin-top: 4px;
}

/* Sun toggle active state — golden glow */
#sunToggle.active {
  background: rgba(255, 200, 50, 0.15);
  border-color: #ffc832;
  color: #ffc832;
}

/* ── Shadow Controls (V2) ── */
.sun-shadow-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.shadow-toggle-btn {
  flex: 1;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: #888;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s;
}

.shadow-toggle-btn:hover:not(:disabled) {
  background: rgba(100, 80, 200, 0.1);
  color: #bbb;
}

.shadow-toggle-btn.active {
  background: rgba(100, 60, 200, 0.2);
  border-color: #7c5cbf;
  color: #c4a0ff;
}

.shadow-toggle-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.shadow-opacity-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
}

.shadow-opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c4a0ff;
  cursor: pointer;
}

.shadow-opacity-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c4a0ff;
  cursor: pointer;
  border: none;
}

.shadow-no-dsm {
  padding: 10px;
  margin-top: 8px;
  background: rgba(200, 100, 50, 0.1);
  border: 1px solid rgba(200, 100, 50, 0.2);
  border-radius: 6px;
  font-size: 12px;
  color: #e0a060;
  line-height: 1.5;
}

.shadow-no-dsm-hint {
  font-size: 11px;
  color: #999;
}