/* GeoCore Vista AMOLED dark theme.
   This file is intentionally the final theme layer. It owns application chrome;
   geological data colours and export SVG palettes remain data-owned. */
html[data-theme="dark"] {
  color-scheme: dark;
  --amoled-canvas: #000000;
  --amoled-surface: #0b0b0d;
  --amoled-surface-raised: #121214;
  --amoled-surface-high: #1a1a1d;
  --amoled-border: #29292e;
  --amoled-border-strong: #3a3a40;
  --amoled-text: #f1f1f3;
  --amoled-text-soft: #c9c9cf;
  --amoled-muted: #96969f;
  --amoled-accent: #cbd5e1;
  --amoled-accent-strong: #f1f5f9;
  --amoled-accent-surface: #1e293b;
  --amoled-focus: rgba(148, 163, 184, .28);
  --amoled-success: #94a3b8;
  --amoled-success-surface: #1e293b;
  --amoled-warning: #e2bb7d;
  --amoled-warning-surface: #382b18;
  --amoled-danger: #ef9a9a;
  --amoled-danger-surface: #3a1f22;

  /* Existing semantic tokens used by the legacy and TS surfaces. */
  --ink: var(--amoled-text);
  --muted: var(--amoled-muted);
  --muted-2: #777780;
  --paper: var(--amoled-surface-raised);
  --canvas: var(--amoled-canvas);
  --line: var(--amoled-border);
  --nav: var(--amoled-surface);
  --nav-soft: var(--amoled-surface-high);
  --accent: var(--amoled-accent);
  --accent-dark: var(--amoled-accent-strong);
  --accent-pale: var(--amoled-accent-surface);
  --blue: var(--amoled-accent);
  --warning: var(--amoled-warning);
  --warning-pale: var(--amoled-warning-surface);
  --danger: var(--amoled-danger);
  --shadow: none;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
  background: var(--amoled-canvas) !important;
  color: var(--amoled-text) !important;
}

html[data-theme="dark"] body,
html[data-theme="dark"] button,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .main-area,
html[data-theme="dark"] .content-wrap,
html[data-theme="dark"] .work-grid,
html[data-theme="dark"] .work-main {
  background: var(--amoled-canvas) !important;
  color: var(--amoled-text) !important;
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .bottom-nav {
  background: var(--amoled-surface) !important;
  border-color: var(--amoled-border) !important;
  box-shadow: none !important;
  background-image: none !important;
}

html[data-theme="dark"] .sidebar {
  border-right: 1px solid var(--amoled-border) !important;
}

html[data-theme="dark"] .topbar {
  border-bottom: 1px solid var(--amoled-border) !important;
  backdrop-filter: none !important;
}

html[data-theme="dark"] .bottom-nav {
  border-top: 1px solid var(--amoled-border) !important;
}

html[data-theme="dark"] .brand,
html[data-theme="dark"] .sidebar .workspace-label,
html[data-theme="dark"] .sidebar .nav-caption,
html[data-theme="dark"] .side-version,
html[data-theme="dark"] .breadcrumbs,
html[data-theme="dark"] .hole-manager label,
html[data-theme="dark"] .topbar label {
  color: var(--amoled-text-soft) !important;
}

html[data-theme="dark"] .brand small,
html[data-theme="dark"] .side-version,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .hint,
html[data-theme="dark"] .field-hint,
html[data-theme="dark"] .help-text,
html[data-theme="dark"] .section-description {
  color: var(--amoled-muted) !important;
}

html[data-theme="dark"] .nav-item,
html[data-theme="dark"] .bottom-tab,
html[data-theme="dark"] .project-switch,
html[data-theme="dark"] .sidebar-toggle {
  color: var(--amoled-text-soft) !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .bottom-tab:hover,
html[data-theme="dark"] .project-switch:hover,
html[data-theme="dark"] .sidebar-toggle:hover {
  background: var(--amoled-surface-high) !important;
  color: var(--amoled-text) !important;
}

html[data-theme="dark"] .nav-item.active,
html[data-theme="dark"] .nav-item[aria-current="page"],
html[data-theme="dark"] .bottom-tab.active {
  background: var(--amoled-accent-surface) !important;
  color: var(--amoled-accent-strong) !important;
  border-color: var(--amoled-accent) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .page-card,
html[data-theme="dark"] .rail-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .section-content,
html[data-theme="dark"] .section-head,
html[data-theme="dark"] .page-section,
html[data-theme="dark"] .settings-page-body,
html[data-theme="dark"] .settings-section,
html[data-theme="dark"] .project-folder,
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .file-card,
html[data-theme="dark"] .record-card,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .info-card,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .progress-strip,
html[data-theme="dark"] .record-tag {
  background: var(--amoled-surface) !important;
  color: var(--amoled-text) !important;
  border-color: var(--amoled-border) !important;
  box-shadow: none !important;
  background-image: none !important;
}

html[data-theme="dark"] .project-folder-body,
html[data-theme="dark"] .project-folder-header,
html[data-theme="dark"] .explorer-subfolder-box,
html[data-theme="dark"] .subfolder-card,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .table-container,
html[data-theme="dark"] .data-panel,
html[data-theme="dark"] .lookup-menu,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .context-menu,
html[data-theme="dark"] .popover,
html[data-theme="dark"] .tooltip,
html[data-theme="dark"] .toast {
  background: var(--amoled-surface-raised) !important;
  color: var(--amoled-text) !important;
  border-color: var(--amoled-border) !important;
  box-shadow: none !important;
  background-image: none !important;
}

html[data-theme="dark"] .control,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .table-input,
html[data-theme="dark"] .search-input,
html[data-theme="dark"] .filter-input {
  background: var(--amoled-surface-raised) !important;
  color: var(--amoled-text) !important;
  border: 1px solid var(--amoled-border-strong) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--amoled-muted) !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .control:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] .table-input:focus {
  outline: 2px solid var(--amoled-focus) !important;
  outline-offset: 1px;
  border-color: var(--amoled-accent) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .button,
html[data-theme="dark"] button.button,
html[data-theme="dark"] .button-secondary,
html[data-theme="dark"] .button-quiet,
html[data-theme="dark"] .button-small,
html[data-theme="dark"] .icon-button {
  background: var(--amoled-surface-high) !important;
  color: var(--amoled-text) !important;
  border: 1px solid var(--amoled-border-strong) !important;
  box-shadow: none !important;
  background-image: none !important;
}

html[data-theme="dark"] .button:hover,
html[data-theme="dark"] .button-secondary:hover,
html[data-theme="dark"] .button-quiet:hover,
html[data-theme="dark"] .icon-button:hover {
  background: #232329 !important;
  border-color: #51515a !important;
}

html[data-theme="dark"] .button-primary,
html[data-theme="dark"] .button[data-variant="primary"],
html[data-theme="dark"] .primary-action {
  background: #355d9b !important;
  color: #f4f7ff !important;
  border-color: #4e79ba !important;
}

html[data-theme="dark"] .button-primary:hover,
html[data-theme="dark"] .primary-action:hover {
  background: #416ead !important;
}

html[data-theme="dark"] .data-table,
html[data-theme="dark"] table {
  background: var(--amoled-surface) !important;
  color: var(--amoled-text) !important;
  border-color: var(--amoled-border) !important;
}

html[data-theme="dark"] .data-table th,
html[data-theme="dark"] .data-table thead,
html[data-theme="dark"] table th,
html[data-theme="dark"] table thead {
  background: var(--amoled-surface-high) !important;
  color: var(--amoled-text-soft) !important;
  border-color: var(--amoled-border) !important;
}

html[data-theme="dark"] .data-table td,
html[data-theme="dark"] .data-table tr,
html[data-theme="dark"] table td,
html[data-theme="dark"] table tr {
  background: transparent !important;
  color: var(--amoled-text) !important;
  border-color: var(--amoled-border) !important;
}

html[data-theme="dark"] .data-table tbody tr:hover,
html[data-theme="dark"] table tbody tr:hover,
html[data-theme="dark"] .list-row:hover,
html[data-theme="dark"] .record-row:hover {
  background: var(--amoled-surface-high) !important;
}

html[data-theme="dark"] .data-table tr.selected,
html[data-theme="dark"] table tr.selected,
html[data-theme="dark"] .list-row.selected,
html[data-theme="dark"] .record-row.selected {
  background: var(--amoled-accent-surface) !important;
}

html[data-theme="dark"] .tab,
html[data-theme="dark"] .subtab,
html[data-theme="dark"] .module-tab,
html[data-theme="dark"] .settings-tab,
html[data-theme="dark"] .audit-tab {
  background: var(--amoled-surface) !important;
  color: var(--amoled-text-soft) !important;
  border-color: var(--amoled-border) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .tab.active,
html[data-theme="dark"] .subtab.active,
html[data-theme="dark"] .module-tab.active,
html[data-theme="dark"] .settings-tab.active,
html[data-theme="dark"] .audit-tab.active {
  background: var(--amoled-accent-surface) !important;
  color: var(--amoled-accent-strong) !important;
  border-color: var(--amoled-accent) !important;
}

html[data-theme="dark"] .modal-backdrop,
html[data-theme="dark"] .modal-overlay,
html[data-theme="dark"] .dialog-backdrop,
html[data-theme="dark"] [role="dialog"]::before {
  background: rgba(0, 0, 0, .78) !important;
}

html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .dialog,
html[data-theme="dark"] .confirm-dialog,
html[data-theme="dark"] .welcome-portal-shell,
html[data-theme="dark"] .description-dock,
html[data-theme="dark"] .voice-modal,
html[data-theme="dark"] .map-print-modal,
html[data-theme="dark"] .security-dialog {
  background: var(--amoled-surface-raised) !important;
  color: var(--amoled-text) !important;
  border: 1px solid var(--amoled-border-strong) !important;
  box-shadow: none !important;
  background-image: none !important;
}

html[data-theme="dark"] .modal-card header,
html[data-theme="dark"] .modal-card footer,
html[data-theme="dark"] .dialog header,
html[data-theme="dark"] .dialog footer,
html[data-theme="dark"] .description-dock-header {
  background: var(--amoled-surface-high) !important;
  border-color: var(--amoled-border) !important;
}

html[data-theme="dark"] .geophysics-plot-card,
html[data-theme="dark"] .geophysics-sources-card,
html[data-theme="dark"] .geophysics-plot-scroll,
html[data-theme="dark"] .geophysics-toolbar,
html[data-theme="dark"] .geophysics-method-card,
html[data-theme="dark"] .drilling-card,
html[data-theme="dark"] .qa-card,
html[data-theme="dark"] .sampling-card,
html[data-theme="dark"] .ai-card,
html[data-theme="dark"] .classifier-card,
html[data-theme="dark"] .trench-card,
html[data-theme="dark"] .modeling-card {
  background: var(--amoled-surface) !important;
  color: var(--amoled-text) !important;
  border-color: var(--amoled-border) !important;
  box-shadow: none !important;
  background-image: none !important;
}

html[data-theme="dark"] .geophysics-plot-svg text,
html[data-theme="dark"] .chart-label,
html[data-theme="dark"] .axis-label,
html[data-theme="dark"] .legend-label {
  fill: var(--amoled-text-soft) !important;
  color: var(--amoled-text-soft) !important;
}

html[data-theme="dark"] .settings-page-body,
html[data-theme="dark"] .settings-page-body h1,
html[data-theme="dark"] .settings-page-body h2,
html[data-theme="dark"] .settings-page-body h3,
html[data-theme="dark"] .settings-page-body label,
html[data-theme="dark"] .settings-page-body p,
html[data-theme="dark"] .settings-page-body li,
html[data-theme="dark"] .settings-page-body .setting-title {
  color: var(--amoled-text) !important;
}


html[data-theme="dark"] .status-success,
html[data-theme="dark"] .save-status.success,
html[data-theme="dark"] .sync-status.success {
  background: var(--amoled-success-surface) !important;
  color: var(--amoled-success) !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .mini-badge.amber,
html[data-theme="dark"] .status-warning,
html[data-theme="dark"] .warning-banner {
  background: var(--amoled-warning-surface) !important;
  color: var(--amoled-warning) !important;
  border-color: #765523 !important;
}

html[data-theme="dark"] .status-error,
html[data-theme="dark"] .error-banner,
html[data-theme="dark"] .danger-action {
  background: var(--amoled-danger-surface) !important;
  color: var(--amoled-danger) !important;
  border-color: #71373c !important;
}

/* Inline legacy UI surfaces. SVG and data swatches are intentionally excluded. */
html[data-theme="dark"] div[style*="background:#fff"],
html[data-theme="dark"] div[style*="background: #fff"],
html[data-theme="dark"] section[style*="background:#fff"],
html[data-theme="dark"] article[style*="background:#fff"],
html[data-theme="dark"] button[style*="background:#fff"],
html[data-theme="dark"] div[style*="background:#ffffff"],
html[data-theme="dark"] section[style*="background:#ffffff"],
html[data-theme="dark"] article[style*="background:#ffffff"] {
  background: var(--amoled-surface-raised) !important;
  color: var(--amoled-text) !important;
  border-color: var(--amoled-border) !important;
}

html[data-theme="dark"] div[style*="background:#f8fafc"],
html[data-theme="dark"] div[style*="background:#f0fdf4"],
html[data-theme="dark"] section[style*="background:#f8fafc"],
html[data-theme="dark"] article[style*="background:#f8fafc"] {
  background: var(--amoled-surface) !important;
  color: var(--amoled-text) !important;
}

html[data-theme="dark"] div[style*="color:#0f172a"],
html[data-theme="dark"] div[style*="color:#111827"],
html[data-theme="dark"] section[style*="color:#0f172a"],
html[data-theme="dark"] article[style*="color:#0f172a"],
html[data-theme="dark"] button[style*="color:#0f172a"] {
  color: var(--amoled-text) !important;
}

html[data-theme="dark"] .skeleton,
html[data-theme="dark"] .loading,
html[data-theme="dark"] .progress-bar {
  background: var(--amoled-surface-high) !important;
  background-image: none !important;
}

html[data-theme="dark"] a {
  color: var(--amoled-accent-strong);
}

html[data-theme="dark"] hr,
html[data-theme="dark"] .nav-divider,
html[data-theme="dark"] .bottom-nav-divider {
  border-color: var(--amoled-border) !important;
  background: var(--amoled-border) !important;
}

html[data-theme="dark"] * {
  scrollbar-color: #3b3b42 #000000;
}

html[data-theme="dark"] *::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html[data-theme="dark"] *::-webkit-scrollbar-track {
  background: #000000;
}

html[data-theme="dark"] *::-webkit-scrollbar-thumb {
  background: #3b3b42;
  border: 2px solid #000000;
  border-radius: 5px;
}

html[data-theme="dark"] *::-webkit-scrollbar-thumb:hover {
  background: #55555e;
}

@media (max-width: 760px) {
  html[data-theme="dark"] .topbar,
  html[data-theme="dark"] .bottom-nav,
  html[data-theme="dark"] .mobile-topbar,
  html[data-theme="dark"] .mobile-header {
    background: var(--amoled-surface) !important;
  }
}
@media (max-width: 760px) {
  html[data-theme="dark"] .sampling-table:not(.drilling-runs-table) .sampling-row,
  html[data-theme="dark"] .sampling-table.drilling-runs-table .drilling-run-row {
    background: var(--amoled-surface-raised) !important;
    border-color: var(--amoled-border) !important;
  }
  html[data-theme="dark"] .mobile-record-summary { color: var(--amoled-text) !important; }
  html[data-theme="dark"] .mobile-record-depth { color: var(--amoled-text-soft) !important; }
  html[data-theme="dark"] .mobile-record-meta,
  html[data-theme="dark"] .mobile-record-chevron { color: var(--amoled-muted) !important; }
}
/* Closed/selected labels are interface chrome, not success indicators. */
html[data-theme="dark"] .mini-badge.green { background: var(--amoled-surface-high) !important; color: var(--amoled-text-soft) !important; border-color: var(--amoled-border-strong) !important; }

html[data-theme="dark"]{--ui-notice-background:#121214;--ui-notice-border:#3a3a40;--ui-notice-title:#f1f1f3;--ui-notice-text:#c9c9cf}
