/* GCE Dark Theme 10 — charcoal shell, raised cards, teal accent (desktop) */

html[data-gce-mode="dark"],
body[data-gce-mode="dark"],
body:not([data-gce-mode="light"]) {
  --gce-bg: #0b0e11;
  --gce-surface: #14181e;
  --gce-surface-2: #1a1d21;
  --gce-elevated: #1e2329;
  --gce-border: rgba(255, 255, 255, 0.06);
  --gce-border-strong: rgba(255, 255, 255, 0.1);
  --gce-accent: #14b8a6;
  --gce-accent-2: #0d9488;
  --gce-accent-dim: rgba(20, 184, 166, 0.16);
  --gce-accent-glow: rgba(20, 184, 166, 0.28);

  --panel: var(--gce-surface-2);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --blue: #14b8a6;
  --blue2: #0d9488;
  --purple: #2dd4bf;
  --line: var(--gce-border);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --radius: 12px;

  --dash-topbar-bg: var(--gce-surface);
  --dash-topbar-border: var(--gce-border);
  --dash-heading: #f8fafc;
  --dash-kpi-value: #ffffff;
  --dash-kpi-label: #94a3b8;
  --dash-search-bg: rgba(255, 255, 255, 0.04);
  --dash-search-text: #e2e8f0;
  --dash-search-border: var(--gce-border-strong);
  --dash-delta-pos: #4ade80;
  --dash-delta-neg: #f87171;
  --dash-util-inner-bg: var(--gce-surface);
  --dash-util-inner-text: #f1f5f9;
  --dash-chart-label: #94a3b8;
  --dash-fleet-label: #94a3b8;
  --dash-fleet-value: #f8fafc;
  --dash-safety-value: #f8fafc;
  --dash-safety-label: #94a3b8;
  --dash-deadline-text: #e2e8f0;
  --dash-deadline-date: #5eead4;
  --dash-section-border: var(--gce-border);

  --sdt-title: #f8fafc;
  --sdt-heading: #f1f5f9;
  --sdt-text: #e2e8f0;
  --sdt-muted: #94a3b8;
  --sdt-kpi-value: #ffffff;
  --sdt-kpi-label: #94a3b8;
  --sdt-info-label: #64748b;
  --sdt-pill-ok: #4ade80;
  --sdt-pill-blue: #5eead4;
  --sdt-pill-warn: #fbbf24;

  --prog-card-bg: var(--gce-surface-2);
  --prog-item-bg: rgba(255, 255, 255, 0.03);
  --prog-item-border: var(--gce-border);
  --prog-item-text: #cbd5e1;
  --prog-item-done-text: #4ade80;
  --prog-mini-label: #94a3b8;
  --prog-count-text: #99f6e4;

  color-scheme: dark;
}

/* Shell */
html[data-gce-mode="dark"] body,
body[data-gce-mode="dark"],
body:not([data-gce-mode="light"]) {
  background: var(--gce-bg) !important;
  color: var(--text);
}

html[data-gce-mode="dark"] body main,
body[data-gce-mode="dark"] main,
body:not([data-gce-mode="light"]) main {
  background: var(--gce-bg) !important;
}

html[data-gce-mode="dark"] body .sidebar,
html[data-gce-mode="dark"] body .sidebar.sidebar--field,
body[data-gce-mode="dark"] .sidebar,
body:not([data-gce-mode="light"]) .sidebar {
  background: var(--gce-bg) !important;
  border-right: 1px solid var(--gce-border) !important;
  backdrop-filter: none !important;
}

/* Nav — teal active rail like mock */
html[data-gce-mode="dark"] .nav--expert .nav-item,
body[data-gce-mode="dark"] .nav--expert .nav-item,
body:not([data-gce-mode="light"]) .nav--expert .nav-item {
  color: #94a3b8;
  border-radius: 10px;
  border: none;
  background: transparent;
}

html[data-gce-mode="dark"] .nav--expert .nav-item:hover,
body[data-gce-mode="dark"] .nav--expert .nav-item:hover,
body:not([data-gce-mode="light"]) .nav--expert .nav-item:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.04);
}

html[data-gce-mode="dark"] .nav--expert .nav-item.active,
body[data-gce-mode="dark"] .nav--expert .nav-item.active,
body:not([data-gce-mode="light"]) .nav--expert .nav-item.active {
  color: #fff !important;
  background: var(--gce-accent-dim) !important;
  border: 1px solid rgba(20, 184, 166, 0.28) !important;
  border-left: 3px solid var(--gce-accent) !important;
  padding-left: 11px;
  box-shadow: none !important;
}

html[data-gce-mode="dark"] .nav--expert .nav-item.active .nav-icon,
body[data-gce-mode="dark"] .nav--expert .nav-item.active .nav-icon,
body:not([data-gce-mode="light"]) .nav--expert .nav-item.active .nav-icon {
  color: var(--gce-accent);
  background: transparent !important;
}

/* Raised cards / panels */
html[data-gce-mode="dark"] .card,
html[data-gce-mode="dark"] .dash-kpi-card,
html[data-gce-mode="dark"] .dash-card,
html[data-gce-mode="dark"] .dash-panel,
html[data-gce-mode="dark"] .panel,
html[data-gce-mode="dark"] .stm-kpi,
html[data-gce-mode="dark"] .stm-table-wrap,
html[data-gce-mode="dark"] .tsk-card,
html[data-gce-mode="dark"] .crw-card,
html[data-gce-mode="dark"] .cal-card,
html[data-gce-mode="dark"] .sfty-card,
html[data-gce-mode="dark"] .cert-kpi-card,
html[data-gce-mode="dark"] .fin-card,
html[data-gce-mode="dark"] .fin-kpi-card,
body[data-gce-mode="dark"] .card,
body:not([data-gce-mode="light"]) .card,
body:not([data-gce-mode="light"]) .dash-kpi-card {
  background: var(--gce-surface-2) !important;
  border: 1px solid var(--gce-border) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

html[data-gce-mode="dark"] .dash-topbar,
body[data-gce-mode="dark"] .dash-topbar,
body:not([data-gce-mode="light"]) .dash-topbar {
  background: var(--gce-surface) !important;
  border-bottom: 1px solid var(--gce-border);
}

/* Progress bars — teal fill */
html[data-gce-mode="dark"] .progress > span,
html[data-gce-mode="dark"] .stm-progress-fill,
html[data-gce-mode="dark"] .dash-progress-fill,
html[data-gce-mode="dark"] .prog-bar > i,
html[data-gce-mode="dark"] .cl-category-fill,
body[data-gce-mode="dark"] .progress > span,
body:not([data-gce-mode="light"]) .stm-progress-fill {
  background: linear-gradient(90deg, var(--gce-accent-2), var(--gce-accent)) !important;
}

html[data-gce-mode="dark"] .progress,
html[data-gce-mode="dark"] .stm-progress-track,
body[data-gce-mode="dark"] .progress {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* Primary actions */
html[data-gce-mode="dark"] .btn,
html[data-gce-mode="dark"] .btn-primary,
html[data-gce-mode="dark"] .stm-btn-primary,
html[data-gce-mode="dark"] .fin-btn-primary,
html[data-gce-mode="dark"] .dash-ai-btn,
body[data-gce-mode="dark"] .btn,
body:not([data-gce-mode="light"]) .btn {
  background: linear-gradient(135deg, var(--gce-accent), var(--gce-accent-2)) !important;
  box-shadow: 0 8px 22px var(--gce-accent-glow) !important;
  color: #fff !important;
  border: none !important;
}

html[data-gce-mode="dark"] .btn-outline,
html[data-gce-mode="dark"] .stm-btn-outline,
html[data-gce-mode="dark"] .fin-btn-outline,
body[data-gce-mode="dark"] .btn-outline {
  background: var(--gce-elevated) !important;
  border: 1px solid var(--gce-border-strong) !important;
  color: #e2e8f0 !important;
  box-shadow: none !important;
}

/* Tables */
html[data-gce-mode="dark"] table th,
html[data-gce-mode="dark"] .stm-table th,
html[data-gce-mode="dark"] .fin-table th,
body[data-gce-mode="dark"] table th {
  color: #94a3b8 !important;
  border-bottom-color: var(--gce-border) !important;
}

html[data-gce-mode="dark"] table td,
html[data-gce-mode="dark"] .stm-table td,
html[data-gce-mode="dark"] .fin-table td,
body[data-gce-mode="dark"] table td {
  color: #e2e8f0 !important;
  border-bottom-color: var(--gce-border) !important;
}

/* Pills / status */
html[data-gce-mode="dark"] .pill.ok,
html[data-gce-mode="dark"] .stm-status--complete,
body[data-gce-mode="dark"] .pill.ok {
  background: rgba(34, 197, 94, 0.14) !important;
  color: #4ade80 !important;
}

html[data-gce-mode="dark"] .pill.warn,
body[data-gce-mode="dark"] .pill.warn {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #fbbf24 !important;
}

html[data-gce-mode="dark"] .pill.bad,
body[data-gce-mode="dark"] .pill.bad {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #f87171 !important;
}

html[data-gce-mode="dark"] .pill.blue,
body[data-gce-mode="dark"] .pill.blue {
  background: var(--gce-accent-dim) !important;
  color: #5eead4 !important;
}

/* Search */
html[data-gce-mode="dark"] .dash-search,
html[data-gce-mode="dark"] .stm-search,
html[data-gce-mode="dark"] input[type="search"],
body[data-gce-mode="dark"] .stm-search {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--gce-border-strong) !important;
  color: #e2e8f0 !important;
}

/* Modals */
html[data-gce-mode="dark"] .modal-card,
html[data-gce-mode="dark"] .m-modal-card,
html[data-gce-mode="dark"] .stg-drawer-panel,
body[data-gce-mode="dark"] .modal-card {
  background: var(--gce-surface-2) !important;
  border: 1px solid var(--gce-border-strong) !important;
  color: var(--text) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55) !important;
}

/* Finance mockup dark polish */
html[data-gce-mode="dark"] .fin-mock-open-site,
body[data-gce-mode="dark"] .fin-mock-open-site {
  background: var(--gce-accent-dim) !important;
  color: #5eead4 !important;
  border-color: rgba(20, 184, 166, 0.35) !important;
}

html[data-gce-mode="dark"] .fin-mock-btn-primary,
body[data-gce-mode="dark"] .fin-mock-btn-primary {
  background: linear-gradient(135deg, var(--gce-accent), var(--gce-accent-2)) !important;
  border-color: transparent !important;
}

html[data-gce-mode="dark"] .fin-mock-tab.active,
body[data-gce-mode="dark"] .fin-mock-tab.active {
  color: #5eead4 !important;
  border-color: rgba(20, 184, 166, 0.35) !important;
  background: var(--gce-accent-dim) !important;
}

/* Brand mark */
html[data-gce-mode="dark"] .logo.logo--tower,
body[data-gce-mode="dark"] .logo.logo--tower,
body:not([data-gce-mode="light"]) .logo.logo--tower {
  background: linear-gradient(135deg, #14b8a6, #0f766e) !important;
  color: #fff !important;
  box-shadow: 0 10px 28px var(--gce-accent-glow) !important;
}

/* Kill purple/blue body glow leftovers */
html[data-gce-mode="dark"] body:not(.gce-login-active),
body[data-gce-mode="dark"]:not(.gce-login-active) {
  background-image: none !important;
}
