/* Radio Logs Design System v3.0
   Foundation refinement layer loaded last.
   Backend-safe: CSS-only visual system overrides. */

:root {
  /* Neutral palette */
  --bg: #edf2f7;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-muted: #f8fafc;
  --surface-soft: #f3f6fa;
  --surface-hover: #eef4fb;

  --text: #0b1220;
  --text-soft: #334155;
  --muted: #667085;

  --border: #d8e0ea;
  --border-strong: #c8d2df;
  --border-subtle: #e6ecf3;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #e8f0ff;

  --whro: #1867c9;
  --whrv: #a01845;
  --attention: #d97706;

  --success-bg: #e9f9ef;
  --success-text: #166534;
  --warn-bg: #fff5d6;
  --warn-text: #8a4b00;
  --danger-bg: #fdecec;
  --danger-text: #9f1239;
  --info-bg: #e8f5ff;
  --info-text: #075985;

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, .07);
  --shadow: 0 16px 40px rgba(15, 23, 42, .10);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, .16);

  --content-width: 1540px;
  --sidebar-width: 268px;
  --transition-fast: 140ms ease;
  --transition: 190ms ease;
}

html[data-theme="dark"] {
  --bg: #0c1424;
  --surface: #121b2b;
  --surface-raised: #162235;
  --surface-muted: #182438;
  --surface-soft: #111a2a;
  --surface-hover: #1d2a40;

  --text: #f7fbff;
  --text-soft: #d6e0ef;
  --muted: #9eabc0;

  --border: #263449;
  --border-strong: #3a4a62;
  --border-subtle: #1f2d42;

  --primary: #61a5ff;
  --primary-hover: #8fc0ff;
  --primary-soft: #102b4f;

  --whro: #61a5ff;
  --whrv: #fb5c8b;
  --attention: #fbbf24;

  --success-bg: #062d1a;
  --success-text: #8df0ad;
  --warn-bg: #3d2a07;
  --warn-text: #fde68a;
  --danger-bg: #421421;
  --danger-text: #fecdd3;
  --info-bg: #092e4c;
  --info-text: #bae6fd;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .28);
  --shadow-sm: 0 8px 22px rgba(0, 0, 0, .28);
  --shadow: 0 18px 50px rgba(0, 0, 0, .38);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .48);
}

* { transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast); }

body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, .08), transparent 34rem),
    linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 92%, #fff 8%) 100%);
  color: var(--text);
  font-feature-settings: "liga" 1, "calt" 1;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, .13), transparent 35rem),
    linear-gradient(180deg, #08101f 0%, var(--bg) 100%);
}

/* Application shell */
.app-shell-v22 .app-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #fbfcff 0%, #f6f8fb 100%) !important;
  border-right: 1px solid var(--border-subtle) !important;
  box-shadow: 8px 0 30px rgba(15, 23, 42, .05);
}

html[data-theme="dark"] .app-shell-v22 .app-sidebar {
  background: linear-gradient(180deg, #0d1626 0%, #0a1220 100%) !important;
  box-shadow: 8px 0 30px rgba(0, 0, 0, .2);
}

.app-sidebar-brand {
  padding: 18px 16px 20px !important;
}

.app-logo {
  min-height: 56px;
  padding: 10px !important;
  border-radius: var(--radius) !important;
}

.app-logo:hover {
  background: var(--surface) !important;
  box-shadow: var(--shadow-sm);
  text-decoration: none !important;
}

.app-logo-mark {
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%) !important;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .24);
}

.app-logo-text strong,
.app-topbar-title strong {
  letter-spacing: -.04em;
}

.nav-section {
  margin: 18px 10px 0 !important;
}

.nav-section-label {
  color: var(--muted) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase;
  padding: 0 10px 8px !important;
}

.app-nav-link {
  min-height: 40px;
  border-radius: 12px !important;
  color: var(--text-soft) !important;
  font-weight: 800 !important;
  padding: 9px 11px !important;
  position: relative;
}

.app-nav-link:hover {
  color: var(--text) !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-xs);
  text-decoration: none !important;
}

.app-nav-link.active,
.app-nav-link[aria-current="page"] {
  color: var(--primary) !important;
  background: var(--primary-soft) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 22%, transparent), var(--shadow-xs);
}

.app-nav-link.active::before,
.app-nav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
}

.nav-icon {
  width: 20px !important;
  height: 20px !important;
  display: inline-grid !important;
  place-items: center !important;
  border-radius: 7px;
  color: currentColor !important;
  opacity: .9;
}

.app-sidebar-footer {
  padding: 14px !important;
}

.user-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-xs);
  padding: 12px !important;
}

.user-avatar {
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%) !important;
  color: #fff !important;
}

.app-main-shell {
  background: transparent !important;
}

.app-topbar {
  min-height: 68px !important;
  background: color-mix(in srgb, var(--surface) 88%, transparent) !important;
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle) !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}

.app-content,
.page-wrap {
  max-width: var(--content-width) !important;
  padding: 34px 42px !important;
}

/* Page headers */
.page-header {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 0 22px !important;
  margin-bottom: 28px !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  background: transparent !important;
}

.page-title {
  font-size: 31px !important;
  line-height: 1.08 !important;
  font-weight: 900 !important;
  letter-spacing: -.055em !important;
}

.page-subtitle {
  color: var(--muted) !important;
  font-size: 15px !important;
  margin-top: 8px !important;
}

/* Cards and surfaces */
.page-card,
.app-card,
.info-card,
.status-card,
.station-panel,
.upload-panel,
.upload-side-panel,
.report-v2-card,
.compliance-v2-card,
.traffic-v2-page .page-card,
.traffic-v2-page .app-card,
.traffic-v2-page .info-card,
.traffic-v2-page .status-card,
.shared-log-page details,
.report-v2-table-wrap,
.compliance-v2-table-wrap,
.traffic-v2-table-wrap {
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-lg) !important;
  background: var(--surface-raised) !important;
  box-shadow: var(--shadow-sm) !important;
}

.station-panel {
  overflow: hidden;
}

.station-header {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-raised) 94%, var(--primary) 6%) 0%, var(--surface-raised) 100%) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
}

.station-header::before {
  width: 4px !important;
  top: 18px !important;
  bottom: 18px !important;
}

.station-header h2 {
  font-size: 29px !important;
  font-weight: 950 !important;
}

.station-body,
.upload-panel,
.upload-side-panel,
.report-v2-card,
.compliance-v2-card,
.traffic-v2-page .page-card,
.shared-log-page details > div {
  background: var(--surface-raised) !important;
}

.log-date-large,
.current-log-date {
  text-shadow: 0 1px 0 rgba(255,255,255,.25);
}

/* Metrics */
.snapshot-metrics,
.metric-grid,
.traffic-v2-metrics,
.compliance-v2-summary,
.session-grid .session-item,
.snapshot-metric,
.metric,
.traffic-v2-metric,
.compliance-v2-metric {
  background: var(--surface) !important;
  border-color: var(--border-subtle) !important;
}

.snapshot-metrics,
.metric-grid,
.traffic-v2-metrics,
.compliance-v2-summary {
  border-radius: var(--radius) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}

.snapshot-metric strong,
.metric strong,
.traffic-v2-metric strong,
.compliance-v2-metric strong {
  color: var(--text) !important;
  font-weight: 950 !important;
}

.snapshot-metric span,
.metric span,
.traffic-v2-metric span,
.compliance-v2-metric span {
  color: var(--muted) !important;
}

/* Buttons */
button,
.btn,
.primary-btn,
.secondary-btn,
.theme-btn,
.nav-btn,
.logout-btn,
.station-actions a,
.ops-actions a {
  border-radius: 11px !important;
  font-weight: 850 !important;
  min-height: 38px;
  gap: 7px !important;
}

.primary-btn,
button.primary-btn,
a.primary-btn,
.primary-action {
  background: linear-gradient(180deg, #2f73f4 0%, var(--primary) 100%) !important;
  border-color: color-mix(in srgb, var(--primary) 86%, #000 14%) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .22) !important;
}

.primary-btn:hover,
.primary-action:hover {
  background: linear-gradient(180deg, #3b82f6 0%, var(--primary-hover) 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, .28) !important;
}

.secondary-btn,
button.secondary-btn,
a.secondary-btn {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border-strong) !important;
  box-shadow: var(--shadow-xs) !important;
}

.secondary-btn:hover,
button.secondary-btn:hover,
a.secondary-btn:hover {
  background: var(--surface-hover) !important;
  border-color: color-mix(in srgb, var(--primary) 38%, var(--border-strong)) !important;
  color: var(--primary) !important;
  transform: translateY(-1px);
  text-decoration: none !important;
}

/* Forms */
input,
select,
textarea,
.shared-log-page input,
.shared-log-page select,
.shared-log-page textarea,
.traffic-v2-page input,
.traffic-v2-page select,
.traffic-v2-page textarea {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 11px !important;
  color: var(--text) !important;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, .02);
}

input:focus,
select:focus,
textarea:focus,
.shared-log-page textarea:focus,
.shared-log-page input:focus,
.shared-log-page select:focus,
.traffic-v2-page input:focus,
.traffic-v2-page select:focus,
.traffic-v2-page textarea:focus {
  outline: none !important;
  border-color: color-mix(in srgb, var(--primary) 72%, var(--border)) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent) !important;
}

label,
.upload-field label,
.report-v2-filterbar label,
.compliance-v2-filterbar label {
  color: var(--text) !important;
  font-weight: 850 !important;
}

/* Tables */
table {
  font-size: 14px;
}

thead th,
.shared-log-page thead th,
.traffic-v2-page thead th,
.report-v2-page thead th,
.compliance-v2-page thead th {
  background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface-soft) 100%) !important;
  color: var(--text-soft) !important;
  border-bottom: 1px solid var(--border) !important;
}

tbody td,
.shared-log-page tbody td,
.traffic-v2-page tbody td,
.report-v2-page tbody td,
.compliance-v2-page tbody td {
  border-bottom: 1px solid var(--border-subtle) !important;
}

tbody tr:hover td,
.shared-log-page tbody tr:hover td,
.traffic-v2-page tbody tr:hover td,
.report-v2-page tbody tr:hover td,
.compliance-v2-page tbody tr:hover td {
  background: var(--surface-hover) !important;
}

/* Badges and status */
.pill,
.status-pill,
.status-big,
.badge,
.summary-pill,
.digest-pill {
  border-radius: 999px !important;
  font-weight: 900 !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}

.status-ready,
.status-pill.ready,
.status-big.status-ready,
.pill-info,
.badge-info {
  background: var(--info-bg) !important;
  color: var(--info-text) !important;
  border-color: color-mix(in srgb, var(--info-text) 20%, transparent) !important;
}

.status-review,
.status-pill.review,
.status-big.status-review,
.pill-warn,
.badge-warn,
.badge-warning {
  background: var(--warn-bg) !important;
  color: var(--warn-text) !important;
  border-color: color-mix(in srgb, var(--warn-text) 20%, transparent) !important;
}

.status-final,
.status-pill.final,
.status-big.status-final,
.pill-success,
.badge-success {
  background: var(--success-bg) !important;
  color: var(--success-text) !important;
  border-color: color-mix(in srgb, var(--success-text) 20%, transparent) !important;
}

.status-error,
.status-pill.error,
.status-big.status-error,
.pill-danger,
.badge-danger,
.badge-error {
  background: var(--danger-bg) !important;
  color: var(--danger-text) !important;
  border-color: color-mix(in srgb, var(--danger-text) 20%, transparent) !important;
}

/* Empty states */
.empty-note,
.report-v2-empty,
td[colspan] {
  color: var(--muted) !important;
}

/* Details sections */
details summary {
  cursor: pointer;
}

details[open] summary {
  border-bottom-color: var(--border-subtle) !important;
}

.past-log-details {
  background: var(--surface) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius) !important;
}

.past-row-clean {
  border-bottom-color: var(--border-subtle) !important;
}

/* Shared log density polish */
.shared-log-page details {
  overflow: clip !important;
}

.shared-log-page summary {
  background: var(--surface-raised) !important;
}

.shared-log-page .toolbar,
.shared-log-page .log-toolbar,
.shared-log-page .shared-toolbar,
.traffic-v2-toolbar {
  background: color-mix(in srgb, var(--surface-raised) 92%, transparent) !important;
  border-color: var(--border-subtle) !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Station-specific accents */
.station-whro .primary-btn,
.station-whro a.primary-btn {
  background: linear-gradient(180deg, #2f73f4 0%, #1867c9 100%) !important;
}

.station-whrv .log-date-large,
.station-whrv .current-log-date {
  color: var(--whrv) !important;
}

/* Print remains clean */
@media print {
  .app-sidebar,
  .app-topbar,
  .mobile-sidebar-backdrop,
  .no-print {
    display: none !important;
  }
  .app-main-shell,
  .app-content,
  .page-wrap {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }
  body { background: #fff !important; }
  .page-card,
  .app-card,
  .station-panel,
  .report-v2-card,
  .compliance-v2-card { box-shadow: none !important; }
}

@media (max-width: 900px) {
  .app-content,
  .page-wrap {
    padding: 22px 18px !important;
  }
  .page-title {
    font-size: 26px !important;
  }
}

/* Radio Logs Design System v3.1 - stronger color depth */

/* Light mode: reduce pure white / add commercial app depth */
html[data-theme="light"],
:root {
  --bg: #e9eef5 !important;
  --surface: #ffffff !important;
  --surface-muted: #f4f7fb !important;
  --surface-hover: #edf3fb !important;
  --border: #cfd8e3 !important;
  --border-strong: #b8c4d2 !important;

  --text: #101827 !important;
  --text-soft: #344054 !important;
  --muted: #667085 !important;

  --primary: #175cd3 !important;
  --primary-hover: #1849a9 !important;
  --whro: #175cd3 !important;
  --whrv: #9f1239 !important;
}

/* App background */
body,
.app-shell,
.app-main,
.main-content {
  background:
    radial-gradient(circle at top left, rgba(23, 92, 211, 0.08), transparent 32rem),
    linear-gradient(180deg, #eef3f9 0%, #e8edf4 100%) !important;
}

/* Sidebar gets its own panel color */
.app-sidebar,
.sidebar,
.rl-sidebar {
  background: #f8fafc !important;
  border-right: 1px solid #cfd8e3 !important;
}

/* Top bar slightly warmer than pure white */
.app-topbar,
.topbar,
.site-header,
.rl-topbar {
  background: rgba(255, 255, 255, 0.88) !important;
  border-bottom: 1px solid #cfd8e3 !important;
  backdrop-filter: blur(14px);
}

/* Cards should stand off the page */
.page-card,
.app-card,
.info-card,
.status-card,
.station-panel,
.upload-panel,
.upload-side-panel,
.report-v2-card,
.compliance-v2-card,
.traffic-v2-page .page-card,
.traffic-v2-page .app-card,
.traffic-v2-page .info-card,
.traffic-v2-page .status-card,
.compliance-v2-page .page-card,
.report-v2-page .page-card {
  background: #ffffff !important;
  border: 1px solid #cfd8e3 !important;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.07) !important;
}

/* Inner panels should not be pure white */
.session-item,
.snapshot-metric,
.metric,
.upload-station-preview,
.shared-log-page tbody td,
.traffic-v2-page tbody td,
.report-v2-page tbody td,
.compliance-v2-page tbody td {
  background: #fbfcfe !important;
}

/* Section/table headers */
.shared-log-page thead th,
.traffic-v2-page thead th,
.report-v2-page thead th,
.compliance-v2-page thead th {
  background: #eef3f9 !important;
  color: #243041 !important;
}

/* Station cards get a subtle identity wash */
.station-whro {
  background:
    linear-gradient(180deg, rgba(23, 92, 211, 0.045), transparent 170px),
    #ffffff !important;
}

.station-whrv {
  background:
    linear-gradient(180deg, rgba(159, 18, 57, 0.05), transparent 170px),
    #ffffff !important;
}

/* Page headers should feel like real surfaces */
.page-header {
  background: rgba(255,255,255,0.92) !important;
  border: 1px solid #cfd8e3 !important;
  border-radius: 18px !important;
  padding: 24px !important;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06) !important;
}

/* Buttons: slightly stronger */
.primary-btn,
button.primary-btn,
a.primary-btn {
  background: #175cd3 !important;
  border-color: #175cd3 !important;
  color: #ffffff !important;
}

.primary-btn:hover,
button.primary-btn:hover,
a.primary-btn:hover {
  background: #1849a9 !important;
  border-color: #1849a9 !important;
}

/* Navigation active item: stronger but not loud */
.app-sidebar a.active,
.sidebar a.active,
.rl-sidebar a.active,
.nav-active {
  background: #dbeafe !important;
  color: #175cd3 !important;
  border-color: #bfdbfe !important;
}

/* Inputs should not blend into cards */
input,
select,
textarea {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #175cd3 !important;
  box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.14) !important;
}

/* Dark mode remains dark, but a little less harsh */
html[data-theme="dark"] body,
html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .app-main,
html[data-theme="dark"] .main-content {
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.10), transparent 32rem),
    linear-gradient(180deg, #0b1220 0%, #0f172a 100%) !important;
}

html[data-theme="dark"] .app-sidebar,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .rl-sidebar {
  background: #0b1220 !important;
  border-right-color: #263449 !important;
}

html[data-theme="dark"] .app-topbar,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .rl-topbar {
  background: rgba(15, 23, 42, 0.88) !important;
  border-bottom-color: #263449 !important;
}


/* Radio Logs Design System v3.2 - dark mode correction */

html[data-theme="dark"] {
  --bg: #0b1220 !important;
  --surface: #111827 !important;
  --surface-muted: #172233 !important;
  --surface-hover: #1e293b !important;
  --border: #2d3b52 !important;
  --border-strong: #3b4b66 !important;

  --text: #f8fafc !important;
  --text-soft: #dbe7f3 !important;
  --muted: #a8b4c5 !important;

  --primary: #3b82f6 !important;
  --primary-hover: #2563eb !important;
  --whro: #3b82f6 !important;
  --whrv: #e11d48 !important;
}

/* Dark app shell */
html[data-theme="dark"] body,
html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .app-main,
html[data-theme="dark"] .main-content {
  background:
    radial-gradient(circle at top left, rgba(59,130,246,.16), transparent 34rem),
    linear-gradient(180deg, #08111f 0%, #0b1220 100%) !important;
  color: var(--text) !important;
}

/* Sidebar like the mockup */
html[data-theme="dark"] .app-sidebar,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .rl-sidebar {
  background: linear-gradient(180deg, #0a1322 0%, #08111f 100%) !important;
  border-right: 1px solid #263449 !important;
  color: var(--text) !important;
}

/* Top bar */
html[data-theme="dark"] .app-topbar,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .rl-topbar {
  background: rgba(10, 19, 34, .92) !important;
  border-bottom: 1px solid #263449 !important;
  color: var(--text) !important;
}

/* Page header */
html[data-theme="dark"] .page-header {
  background: rgba(17, 24, 39, .92) !important;
  border-color: #2d3b52 !important;
  color: var(--text) !important;
  box-shadow: 0 16px 38px rgba(0,0,0,.35) !important;
}

/* Main cards */
html[data-theme="dark"] .page-card,
html[data-theme="dark"] .app-card,
html[data-theme="dark"] .info-card,
html[data-theme="dark"] .status-card,
html[data-theme="dark"] .station-panel,
html[data-theme="dark"] .upload-panel,
html[data-theme="dark"] .upload-side-panel,
html[data-theme="dark"] .report-v2-card,
html[data-theme="dark"] .compliance-v2-card {
  background:
    linear-gradient(180deg, rgba(30, 41, 59, .82), rgba(17, 24, 39, .96)) !important;
  border: 1px solid #334155 !important;
  color: var(--text) !important;
  box-shadow: 0 18px 45px rgba(0,0,0,.38) !important;
}

/* Station identity wash */
html[data-theme="dark"] .station-whro {
  background:
    linear-gradient(180deg, rgba(59,130,246,.14), rgba(17,24,39,.96) 170px) !important;
}

html[data-theme="dark"] .station-whrv {
  background:
    linear-gradient(180deg, rgba(225,29,72,.15), rgba(17,24,39,.96) 170px) !important;
}

/* Text visibility */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] strong,
html[data-theme="dark"] label,
html[data-theme="dark"] .page-title,
html[data-theme="dark"] .station-header h2 {
  color: #f8fafc !important;
}

html[data-theme="dark"] .page-subtitle,
html[data-theme="dark"] .meta,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .station-header span,
html[data-theme="dark"] .log-subtitle {
  color: #a8b4c5 !important;
}

/* Metrics should be dark, not white */
html[data-theme="dark"] .snapshot-metric,
html[data-theme="dark"] .session-item,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .upload-station-preview {
  background: rgba(15, 23, 42, .72) !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* Tables and inner rows */
html[data-theme="dark"] .shared-log-page tbody td,
html[data-theme="dark"] .traffic-v2-page tbody td,
html[data-theme="dark"] .report-v2-page tbody td,
html[data-theme="dark"] .compliance-v2-page tbody td {
  background: #111827 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .shared-log-page thead th,
html[data-theme="dark"] .traffic-v2-page thead th,
html[data-theme="dark"] .report-v2-page thead th,
html[data-theme="dark"] .compliance-v2-page thead th {
  background: #172233 !important;
  color: #f8fafc !important;
}

/* Inputs */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #94a3b8 !important;
}

/* Buttons */
html[data-theme="dark"] .primary-btn,
html[data-theme="dark"] button.primary-btn,
html[data-theme="dark"] a.primary-btn {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .secondary-btn,
html[data-theme="dark"] button.secondary-btn,
html[data-theme="dark"] a.secondary-btn {
  background: rgba(15, 23, 42, .72) !important;
  border-color: #475569 !important;
  color: #e5edf7 !important;
}

html[data-theme="dark"] .secondary-btn:hover,
html[data-theme="dark"] a.secondary-btn:hover {
  background: #1e293b !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

/* Active sidebar item */
html[data-theme="dark"] .app-sidebar a.active,
html[data-theme="dark"] .sidebar a.active,
html[data-theme="dark"] .rl-sidebar a.active,
html[data-theme="dark"] .nav-active {
  background: linear-gradient(90deg, rgba(37,99,235,.9), rgba(37,99,235,.35)) !important;
  color: #ffffff !important;
  border-color: rgba(96,165,250,.55) !important;
}

/* User card */
html[data-theme="dark"] .user-card,
html[data-theme="dark"] .sidebar-user,
html[data-theme="dark"] .rl-user-card {
  background: rgba(17,24,39,.9) !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* Keep light pills readable in dark */
html[data-theme="dark"] .status-ready,
html[data-theme="dark"] .status-big.status-ready,
html[data-theme="dark"] .status-pill.ready {
  background: #bae6fd !important;
  color: #083344 !important;
  border-color: #7dd3fc !important;
}

/* Reduce disabled button washout */
html[data-theme="dark"] button:disabled,
html[data-theme="dark"] a[aria-disabled="true"],
html[data-theme="dark"] .disabled {
  color: #94a3b8 !important;
  border-color: #475569 !important;
  opacity: .75 !important;
}


/* Metric progress bar fill colors */
.metric-progress,
.report-metric-progress,
.summary-progress {
  height: 10px !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  background: #cbd5e1 !important;
}

.metric-progress-fill,
.report-metric-progress-fill,
.summary-progress-fill {
  height: 100% !important;
  border-radius: 999px !important;
  transition: width .35s ease !important;
}

/* Light mode fills */
.metric-total .metric-progress-fill,
.metric-total .report-metric-progress-fill,
.metric-total .summary-progress-fill {
  background: #2563eb !important;
}

.metric-underwriting .metric-progress-fill,
.metric-underwriting .report-metric-progress-fill,
.metric-underwriting .summary-progress-fill {
  background: #7c3aed !important;
}

.metric-verified .metric-progress-fill,
.metric-verified .report-metric-progress-fill,
.metric-verified .summary-progress-fill,
.metric-aired .metric-progress-fill,
.metric-aired .report-metric-progress-fill,
.metric-aired .summary-progress-fill {
  background: #16a34a !important;
}

.metric-unverified .metric-progress-fill,
.metric-unverified .report-metric-progress-fill,
.metric-unverified .summary-progress-fill,
.metric-late .metric-progress-fill,
.metric-late .report-metric-progress-fill,
.metric-late .summary-progress-fill {
  background: #f59e0b !important;
}

.metric-missed .metric-progress-fill,
.metric-missed .report-metric-progress-fill,
.metric-missed .summary-progress-fill {
  background: #ef4444 !important;
}

.metric-replaced .metric-progress-fill,
.metric-replaced .report-metric-progress-fill,
.metric-replaced .summary-progress-fill {
  background: #64748b !important;
}

/* Dark mode track */
html[data-theme="dark"] .metric-progress,
html[data-theme="dark"] .report-metric-progress,
html[data-theme="dark"] .summary-progress {
  background: #334155 !important;
}

/* Catch inline variable-based bars */
.metric-progress-fill[style],
.report-metric-progress-fill[style],
.summary-progress-fill[style] {
  min-width: 0 !important;
}

/* ============================================================
   Report Center v2 Progress Bars
   ============================================================ */

.rc-progress-track{
    height:10px;
    border-radius:999px;
    overflow:hidden;
    background:#cbd5e1;
}

html[data-theme="dark"] .rc-progress-track{
    background:#334155;
}

.rc-progress-fill{
    height:100%;
    width:100%;
    border-radius:999px;
}

/* metric colors */

.rc-summary-card.total .rc-progress-fill{
    background:#2563eb;
}

.rc-summary-card.underwriting .rc-progress-fill{
    background:#7c3aed;
}

.rc-summary-card.verified .rc-progress-fill,
.rc-summary-card.aired .rc-progress-fill{
    background:#16a34a;
}

.rc-summary-card.unverified .rc-progress-fill,
.rc-summary-card.late .rc-progress-fill{
    background:#f59e0b;
}

.rc-summary-card.missed .rc-progress-fill{
    background:#dc2626;
}

.rc-summary-card.replaced .rc-progress-fill{
    background:#64748b;
}


/* Report Center actual progress row colors */
.rc-progress-track {
  display: block !important;
  height: 10px !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  background: #cbd5e1 !important;
}

html[data-theme="dark"] .rc-progress-track {
  background: #334155 !important;
}

.rc-progress-fill {
  display: block !important;
  height: 100% !important;
  width: 0;
  border-radius: 999px !important;
  transition: width .35s ease !important;
}

.rc-metric-row.blue .rc-progress-fill {
  background: #2563eb !important;
}

.rc-metric-row.green .rc-progress-fill {
  background: #16a34a !important;
}

.rc-metric-row.amber .rc-progress-fill {
  background: #f59e0b !important;
}

.rc-metric-row.red .rc-progress-fill {
  background: #dc2626 !important;
}

.rc-metric-row.gray .rc-progress-fill {
  background: #64748b !important;
}

.logout-form {
  margin: 0;
  display: inline;
}

.logout-form .logout-btn {
  width: 100%;
}
