/* style.css — SparkleMafia light theme */

:root {
  --bg:       #f4f9fa;
  --surface:  #ffffff;
  --surface2: #edf6f7;
  --surface3: #ddf0f1;
  --accent:   #119ba0;
  --accent2:  #d97706;
  --text:     #1a3038;
  --muted:    #263f47;
  --dim:      #1a3038;
  --green:    #16a34a;
  --red:      #dc2626;
  --yellow:   #b45309;
  --border:   rgba(17,155,160,0.14);
  --radius:   12px;
  --shadow:   0 2px 12px rgba(0,0,0,0.07);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--dim); }

/* ─── Typography ────────────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
.section-title {
  font-size: 1.4rem; font-weight: 700; color: var(--text);
  margin-bottom: 0.35rem;
}
.section-sub {
  font-size: 0.875rem; color: var(--muted);
  margin-bottom: 1.5rem;
}
.dim { color: var(--dim); font-size: 0.8em; }
.money { font-variant-numeric: tabular-nums; }

/* ─── Fade-in Animation ─────────────────────────────────────────────────── */
.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Sticky Header ─────────────────────────────────────────────────────── */
#header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}

/* ─── Gas Price Badge (injected by js/gas-ticker.js) ────────────────────── */
#gas-price-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#gas-price-badge .gpb-icon  { font-size: 0.8rem; }
#gas-price-badge .gpb-price { color: var(--accent); }
#gas-price-badge .gpb-unit  { font-size: 0.68rem; font-weight: 500; color: var(--muted); }
.header-left { display: flex; align-items: center; gap: 0.75rem; }
.header-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), #0e8a8f);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.header-title { font-size: 1rem; font-weight: 700; }
.header-sub   { font-size: 0.75rem; color: var(--muted); }
.header-right { display: flex; align-items: center; gap: 0.75rem; }

.pill-badge {
  padding: 0.3rem 0.75rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
  background: rgba(17, 155, 160, 0.12); color: var(--accent);
  border: 1px solid rgba(17, 155, 160, 0.25);
}
.admin-label { font-size: 0.78rem; color: var(--muted); }

#logout-btn {
  padding: 0.35rem 0.9rem; border-radius: 8px; border: none;
  background: var(--surface3); color: var(--muted);
  font-family: inherit; font-size: 0.8rem; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
#logout-btn:hover { background: var(--surface2); color: var(--text); }

/* ─── Hero Section ──────────────────────────────────────────────────────── */
#hero {
  padding: 2.5rem 1.5rem 2rem;
  background: linear-gradient(135deg, rgba(20,184,166,0.06) 0%, transparent 60%);
  border-bottom: 1px solid var(--border);
}
.hero-label {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem;
}
.hero-title { font-size: 1.85rem; margin-bottom: 0.4rem; }
.hero-sub   { font-size: 0.9rem; color: var(--muted); margin-bottom: 2rem; }

/* ─── KPI Cards ─────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  display: flex; align-items: flex-start; gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(0,0,0,0.1); }
.kpi-icon {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.kpi-icon.teal  { background: rgba(17,155,160,0.12); color: var(--accent); }
.kpi-icon.blue  { background: rgba(59,130,246,0.15); color: #3b82f6; }
.kpi-icon.amber { background: rgba(245,158,11,0.15); color: var(--accent2); }
.kpi-icon.green { background: rgba(34,197,94,0.15);  color: var(--green); }

.kpi-value {
  font-size: 1.75rem; font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kpi-label { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }

/* ─── Content Sections ──────────────────────────────────────────────────── */
.content-section {
  padding: 2.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.content-section:last-child { border-bottom: none; }

/* ─── Map Controls ──────────────────────────────────────────────────────── */
.map-controls {
  display: flex; align-items: center; gap: 0.6rem;
  flex-wrap: wrap; margin-bottom: 1rem;
}
#map {
  height: 520px; border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.emp-filter-btn {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.9rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-family: inherit; font-size: 0.8rem;
  cursor: pointer; transition: all 0.2s;
  min-height: 44px;
  touch-action: manipulation;
}
.emp-filter-btn:hover { border-color: var(--accent); color: var(--text); }
.emp-filter-btn.active { background: rgba(17,155,160,0.12); border-color: var(--accent); color: var(--accent); }
.emp-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

#toggle-all-routes {
  padding: 0.4rem 0.9rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--muted); font-family: inherit; font-size: 0.8rem;
  cursor: pointer; transition: all 0.2s;
}
#toggle-all-routes:hover { border-color: var(--accent2); color: var(--accent2); }
#toggle-all-routes.active { background: rgba(245,158,11,0.15); border-color: var(--accent2); color: var(--accent2); }
#toggle-all-routes.disabled,
#toggle-all-routes:disabled { opacity: 0.55; cursor: not-allowed; border-color: var(--border); color: var(--dim); }

/* ─── Leaflet Dark Popup ────────────────────────────────────────────────── */
.dark-popup .leaflet-popup-content-wrapper {
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12) !important;
  color: var(--text) !important;
}
.dark-popup .leaflet-popup-tip { background: #ffffff !important; }
.dark-popup .leaflet-popup-close-button { color: var(--muted) !important; }
.map-popup { font-family: 'Inter', sans-serif; min-width: 200px; }
.popup-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.25rem; color: var(--text); }
.popup-addr  { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.5rem; }
.popup-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.popup-stats { font-size: 0.8rem; display: grid; gap: 0.2rem; margin-bottom: 0.6rem; }
.popup-stats > div { display: flex; justify-content: space-between; gap: 0.75rem; }
.popup-label { color: var(--muted); }
.popup-val   { font-weight: 600; }
.val-green { color: var(--green); }
.val-red   { color: var(--red); }
.popup-btn {
  width: 100%; padding: 0.35rem; border-radius: 6px;
  background: rgba(17,155,160,0.12); border: 1px solid rgba(17,155,160,0.25);
  color: var(--accent); font-family: inherit; font-size: 0.8rem;
  cursor: pointer; transition: background 0.2s;
}
.popup-btn:hover { background: rgba(20,184,166,0.25); }

.popup-badge {
  font-size: 0.68rem; font-weight: 600; padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.popup-badge.eligible  { background: rgba(34,197,94,0.15);  color: var(--green); }
.popup-badge.pending   { background: rgba(245,158,11,0.15); color: var(--accent2); }
.popup-badge.opted-in  { background: rgba(17,155,160,0.12); color: var(--accent); }
.popup-badge.standard  { background: rgba(100,116,139,0.15); color: var(--muted); }

/* ─── Employee Table ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
#employeeTable { width: 100% !important; border-collapse: collapse; font-size: 0.875rem; }
#employeeTable thead th {
  background: var(--surface2) !important; color: var(--muted) !important;
  font-weight: 600; font-size: 0.78rem; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 0.85rem 1rem !important;
  border-bottom: 1px solid var(--border) !important;
  border-top: none !important;
}
#employeeTable tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
#employeeTable tbody tr:hover { background: rgba(17,155,160,0.05); }
#employeeTable tbody tr.row-selected { background: rgba(17,155,160,0.08) !important; }
#employeeTable tbody td {
  padding: 0.85rem 1rem !important;
  vertical-align: middle;
  color: var(--text);
  background: transparent !important;
  border: none !important;
}
#employeeTable tbody tr:nth-child(even) { background: rgba(17,155,160,0.03); }

.emp-cell   { display: flex; align-items: center; gap: 0.6rem; }
.emp-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.emp-name   { font-weight: 600; font-size: 0.875rem; }
.addr-cell  { font-size: 0.8rem; color: var(--muted); max-width: 200px; }
.center     { text-align: center !important; }

/* DataTables dark overrides */
.dataTables_wrapper .dataTables_filter input {
  background: var(--surface2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important; color: var(--text) !important;
  padding: 0.4rem 0.75rem !important; font-family: inherit !important;
  outline: none !important;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--accent) !important; box-shadow: 0 0 0 2px rgba(17,155,160,0.12) !important;
}
.dataTables_wrapper .dataTables_filter label { color: var(--muted) !important; }
table.dataTable thead .sorting::before,
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after { color: var(--dim) !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--muted) !important; border-radius: 6px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--surface2) !important; color: var(--text) !important;
  border-color: transparent !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: rgba(17,155,160,0.12) !important; color: var(--accent) !important;
  border-color: transparent !important;
}

/* ─── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 0.2rem 0.6rem;
  border-radius: 999px; font-size: 0.72rem; font-weight: 600;
  white-space: nowrap;
}
.badge-enrolled  { background: rgba(17,155,160,0.12); color: var(--accent); }
.badge-available { background: rgba(34,197,94,0.15);  color: var(--green); }
.badge-pending   { background: rgba(245,158,11,0.15); color: var(--accent2); }
.badge-enrolled-sm { font-size: 0.62rem; padding: 0.1rem 0.45rem; border-radius: 999px; background: rgba(17,155,160,0.1); color: var(--accent); }

/* ── Commute Zone Badges ───────────────────────────────────────────────────── */
.badge-zone-outlier {
  background: rgba(239,68,68,0.12);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.25);
}
.badge-zone-core {
  background: rgba(34,197,94,0.10);
  color: #16a34a;
  border: 1px solid rgba(34,197,94,0.2);
}
.badge-xs { font-size: 0.60rem; padding: 0.1rem 0.4rem; }

/* ── Zone Separator Rows ─────────────────────────────────────────────────── */
.zone-sep td,
.zone-sep-cell {
  padding: 0.5rem 1rem !important;
  border: none !important;
  user-select: none;
}
.zone-sep-outlier { background: rgba(239,68,68,0.06); border-left: 3px solid #ef4444 !important; }
.zone-sep-core    { background: rgba(34,197,94,0.05); border-left: 3px solid #22c55e !important; }
.zone-sep-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 0.75rem;
}
.zone-sep-outlier .zone-sep-label { color: #ef4444; }
.zone-sep-core    .zone-sep-label { color: #16a34a; }
.zone-sep-sub {
  font-size: 0.70rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Company Impact Table extras ─────────────────────────────────────────── */
.text-amber { color: #f59e0b; }
.mono       { font-family: 'Courier New', monospace; font-size: 0.82rem; }
.th-sub     { font-size: 0.65rem; font-weight: 400; color: var(--muted); display: block; }

/* ── Route panel pay rate inline ─────────────────────────────────────────── */
.rp-rate-inline {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.35rem;
  white-space: nowrap;
}

/* ── Route panel pay rate comparison (legacy, kept for reference) ─────────── */
.rp-rate-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: rgba(17,155,160,0.04);
  border: 1px solid rgba(17,155,160,0.1);
  border-radius: 8px;
}
.rp-rate-block {
  flex: 1;
  text-align: center;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.rp-rate-lbl {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}
.rp-rate-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.rp-rate-unit {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.1em;
}
.rp-rate-diff {
  font-size: 0.65rem;
  color: #d97706;
  margin-top: 0.1rem;
}
.rp-rate-arrow {
  color: var(--dim);
  font-size: 1rem;
  flex-shrink: 0;
}
.rp-rate-active {
  border-color: rgba(17,155,160,0.35);
  background: rgba(17,155,160,0.07);
}
.rp-rate-optin .rp-rate-val {
  color: #d97706;
}
.rp-rate-optin.rp-rate-active .rp-rate-val {
  color: #119ba0;
}

/* ─── Opt-In Toggle Switch ──────────────────────────────────────────────────── */
.opt-toggle {
  position: relative; display: inline-block;
  width: 34px; height: 18px;
  vertical-align: middle; cursor: pointer; margin-right: 5px;
}
.opt-toggle input { display: none; }
.opt-slider {
  position: absolute; inset: 0;
  background: #263f47; border: 1px solid #263f47;
  border-radius: 18px; transition: background 0.2s, border-color 0.2s;
}
.opt-slider::before {
  content: ''; position: absolute;
  width: 11px; height: 11px;
  left: 3px; top: 2px;
  border-radius: 50%; background: #263f47;
  transition: transform 0.2s, background 0.2s;
}
.opt-toggle input:checked + .opt-slider {
  background: rgba(17,155,160,0.2); border-color: #119ba0;
}
.opt-toggle input:checked + .opt-slider::before {
  transform: translateX(15px); background: #119ba0;
}
.opt-label { font-size: 0.72rem; vertical-align: middle; font-weight: 600; }
.opt-label-on  { color: #119ba0; }
.opt-label-off { color: #6b7280; }

.text-green { color: var(--green) !important; font-weight: 700; }
.text-red   { color: var(--red)   !important; font-weight: 700; }
.text-yellow{ color: var(--yellow)!important; font-weight: 700; }

.btn-map {
  padding: 0.35rem 0.75rem; border-radius: 8px; cursor: pointer;
  background: var(--surface3); border: 1px solid var(--border);
  color: var(--muted); font-family: inherit; font-size: 0.78rem;
  transition: all 0.2s; white-space: nowrap;
}
.btn-map:hover { background: rgba(17,155,160,0.12); border-color: var(--accent); color: var(--accent); }
.btn-map.btn-detail { margin-left: 0.35rem; }

/* ─── Income Projector ──────────────────────────────────────────────────── */
.projector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 768px) { .projector-grid { grid-template-columns: 1fr; } }

.proj-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.proj-card-title { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 1rem; }

.slider-group { margin-bottom: 1.25rem; }
.slider-label {
  display: flex; justify-content: space-between;
  font-size: 0.85rem; color: var(--muted); margin-bottom: 0.4rem;
}
.slider-label strong { color: var(--text); font-weight: 600; }

input[type="range"] {
  width: 100%; height: 5px; border-radius: 999px;
  -webkit-appearance: none; appearance: none;
  background: var(--surface3); outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
  box-shadow: 0 2px 8px rgba(20,184,166,0.4);
  cursor: pointer; transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg); cursor: pointer;
}

.proj-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.proj-comp-card {
  background: var(--surface2); border-radius: 10px; padding: 1rem;
  border: 1px solid var(--border);
}
.proj-comp-card.accent-border { border-color: rgba(17,155,160,0.25); }
.proj-comp-label { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.5rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.proj-comp-daily  { font-size: 1.5rem; font-weight: 800; }
.proj-comp-weekly { font-size: 0.78rem; color: var(--muted); }
.proj-comp-reimb  { font-size: 0.78rem; color: var(--accent); margin-top: 0.25rem; }
.proj-comp-miles  { font-size: 0.78rem; color: var(--dim); }

.proj-result {
  text-align: center; padding: 1.25rem;
  background: var(--surface2); border-radius: 10px;
  border: 1px solid var(--border); margin-bottom: 0.75rem;
}
.proj-rate {
  font-size: 2.5rem; font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.rate-positive { color: var(--green); }
.rate-negative { color: var(--red); }

.proj-delta { font-size: 0.85rem; margin-top: 0.35rem; font-weight: 600; }
.delta-positive { color: var(--green); }
.delta-negative { color: var(--red); }

.proj-breakeven { font-size: 0.78rem; color: var(--muted); margin-top: 0.35rem; }

.proj-revenue-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem;
}
.proj-rev-card {
  background: var(--surface2); border-radius: 8px; padding: 0.85rem;
  text-align: center; border: 1px solid var(--border);
}
.proj-rev-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.3rem; }
.proj-rev-val   { font-size: 1.1rem; font-weight: 700; }
.proj-rev-sub   { font-size: 0.7rem; color: var(--accent); margin-top: 0.15rem; }

.chart-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  height: 320px;
  position: relative;
}
.chart-box.tall { height: 380px; }
.chart-title { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.05em; }

.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1.5rem; }
@media (max-width: 900px) { .charts-grid { grid-template-columns: 1fr; } }

/* ─── Program Overview Cards ────────────────────────────────────────────── */
.overview-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 800px) { .overview-grid { grid-template-columns: 1fr; } }

.overview-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.overview-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.overview-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: rgba(17,155,160,0.1); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 1rem;
}
.overview-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.4rem; }
.overview-desc  { font-size: 0.83rem; color: var(--muted); line-height: 1.6; }

.legal-callout {
  border: 1px solid rgba(245,158,11,0.3);
  background: rgba(245,158,11,0.05);
  border-radius: 10px; padding: 1rem 1.25rem;
  font-size: 0.82rem; color: var(--muted); line-height: 1.65;
}
.legal-callout strong { color: var(--accent2); }

/* ─── Footer ────────────────────────────────────────────────────────────── */
#footer {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.78rem; color: var(--dim);
  border-top: 1px solid var(--border);
}
.demo-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 600;
  background: rgba(245,158,11,0.1); color: var(--accent2);
  border: 1px solid rgba(245,158,11,0.2);
  margin-left: 0.5rem; vertical-align: middle;
}

/* ─── Login Page ────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(20,184,166,0.08) 0%, transparent 70%);
  padding: 1rem;
}
.login-card {
  width: 100%; max-width: 420px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2.5rem;
  box-shadow: 0 8px 40px rgba(17,155,160,0.12);
}
.login-logo {
  width: 64px; height: 64px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #0e8a8f);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; margin: 0 auto 1.5rem;
  box-shadow: 0 8px 24px rgba(17,155,160,0.25);
}
.login-title { font-size: 1.35rem; text-align: center; margin-bottom: 0.35rem; }
.login-sub   { font-size: 0.83rem; text-align: center; color: var(--muted); margin-bottom: 2rem; }

.input-group { position: relative; margin-bottom: 1rem; }
.input-group input[type="password"],
.input-group input[type="text"] {
  width: 100%; padding: 0.85rem 2.75rem 0.85rem 1rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text);
  font-family: inherit; font-size: 0.9rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17,155,160,0.12);
}
.input-icon { position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--dim); cursor: pointer; font-size: 1rem; user-select: none; }
.input-icon:hover { color: var(--muted); }

.login-btn {
  width: 100%; padding: 0.9rem;
  background: linear-gradient(135deg, var(--accent), #0e8a8f);
  border: none; border-radius: 10px; cursor: pointer;
  color: #fff; font-family: inherit; font-size: 0.95rem; font-weight: 700;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 16px rgba(17,155,160,0.25);
}
.login-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }

.login-error {
  display: none; color: var(--red); font-size: 0.82rem;
  text-align: center; margin-bottom: 0.75rem;
  padding: 0.5rem; background: rgba(239,68,68,0.1);
  border-radius: 6px; border: 1px solid rgba(239,68,68,0.2);
}
.login-error.visible { display: block; }

.login-footer { margin-top: 1.5rem; text-align: center; color: var(--dim); font-size: 0.75rem; }
.login-footer span { margin: 0 0.3rem; }

/* ─── Leaflet overrides ─────────────────────────────────────────────────── */
.leaflet-control-attribution { background: rgba(255,255,255,0.9) !important; color: var(--dim) !important; font-size: 0.65rem !important; }
.leaflet-control-attribution a { color: var(--dim) !important; }
.leaflet-bar { border: 1px solid var(--border) !important; box-shadow: var(--shadow) !important; }
.leaflet-bar a { background: var(--surface) !important; color: var(--text) !important; border-bottom: 1px solid var(--border) !important; }
.leaflet-bar a:hover { background: var(--surface2) !important; }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .content-section { padding: 1.5rem 1rem; }
  #hero { padding: 1.5rem 1rem; }
  #header { padding: 0.75rem 1rem; }
  .hero-title { font-size: 1.4rem; }
  .kpi-value { font-size: 1.4rem; }
  .proj-compare { grid-template-columns: 1fr; }
  .proj-revenue-row { grid-template-columns: 1fr; }
  /* Scenario toggle fixes for mobile */
  .scenario-toggle-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .scenario-btn {
    min-height: 44px; /* Touch-friendly */
    padding: 0.75rem 1rem;
  }
  /* Date filter bar mobile */
  .date-filter-section {
    padding: 0.5rem 1rem;
    top: 56px;
  }
  .date-filter-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .dfb-scroll-outer {
    width: 100%;
  }
  .date-filter-bar {
    justify-content: flex-start;
  }
  /* KPI cards - 2 columns on mobile */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .kpi-card {
    padding: 1rem;
  }
  /* Table horizontal scroll */
  .table-wrap {
    margin: 0 -1rem;
    padding: 0 1rem;
    width: calc(100% + 2rem);
  }
  /* Cost analysis tables */
  .cost-table-wrap {
    margin: 0 -1rem;
    padding: 0 1rem;
    width: calc(100% + 2rem);
  }
  /* Section title row stack */
  .section-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .section-title-row .admin-actions,
  .section-title-row > div:last-child {
    margin-left: 0;
    width: 100%;
  }
  .btn-admin, .btn-export {
    flex: 1;
    justify-content: center;
  }
  /* Projector grid stack */
  .projector-grid {
    grid-template-columns: 1fr;
  }
  /* Charts stack */
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .chart-box, .chart-box.tall {
    height: auto;
    min-height: 280px;
  }
  /* Overview cards stack */
  .overview-grid {
    grid-template-columns: 1fr;
  }
  /* SOP accordion adjustments */
  .sop-summary {
    padding: 0.75rem 1rem;
  }
  .sop-title {
    font-size: 0.85rem;
  }
  /* Legal callout */
  .legal-callout {
    padding: 1rem;
    font-size: 0.78rem;
  }
  /* Modal sizing */
  .modal-box {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  /* Scheduler mobile fixes */
  .sched-controls {
    padding: 0.75rem 1rem;
    flex-direction: column;
    align-items: stretch;
  }
  .sched-status-bar {
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
  }
  .sched-hero {
    padding: 1rem;
  }
  .type-filter-bar {
    padding: 0.5rem 1rem;
  }
  /* SMS panel mobile */
  .sms-grid {
    grid-template-columns: 1fr;
  }
  .reschedule-grid {
    grid-template-columns: 1fr;
  }
  /* Gantt mobile */
  .gantt-section {
    padding: 0.5rem 1rem;
    overflow-x: auto;
  }
  .gantt-row {
    min-width: 600px;
  }
  /* Admin actions in hero */
  .admin-actions {
    flex-wrap: wrap;
    margin-top: 0.75rem;
  }
  .btn-admin {
    min-height: 44px;
  }
}

/* Hide mobile menu button on desktop */
.mobile-menu-btn {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADDITIONS — Nav, Map Split, Route Panel, Opt-in Alert, Fixes
═══════════════════════════════════════════════════════════════════════════ */

/* ─── Header Nav ─────────────────────────────────────────────────────────── */
.header-nav {
  display: flex; align-items: center; gap: 0.25rem;
  background: var(--surface2); border-radius: 10px;
  padding: 0.25rem;
}
.nav-link {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 1rem; border-radius: 8px;
  font-size: 0.85rem; font-weight: 500;
  color: var(--muted); text-decoration: none;
  transition: all 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--surface3); }
.nav-link.active { background: rgba(17,155,160,0.12); color: var(--accent); }
.nav-icon { font-size: 0.9rem; }

/* ─── Map Split Layout ───────────────────────────────────────────────────── */
.map-route-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}
.map-side { display: flex; flex-direction: column; }
.map-side #map { height: 540px; flex: 1; }

.route-side {
  height: 540px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ─── Route Empty State ──────────────────────────────────────────────────── */
.route-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.75rem; padding: 2rem;
  color: var(--dim); text-align: center;
}
.route-empty-icon { font-size: 2.5rem; opacity: 0.4; }
.route-empty-text { font-size: 0.85rem; line-height: 1.6; }

/* ─── Route Panel Content ────────────────────────────────────────────────── */
.route-content {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}

.rp-header {
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}
.rp-emp-row {
  display: flex; align-items: center; gap: 0.75rem;
}
.rp-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.rp-emp-name  { font-weight: 700; font-size: 0.95rem; }
.rp-day-stat  { margin-left: auto; text-align: right; }
.rp-stat-val  { font-size: 1.1rem; font-weight: 800; color: var(--accent); }
.rp-stat-lbl  { font-size: 0.68rem; color: var(--dim); }

/* ─── Opt-in Alert ───────────────────────────────────────────────────────── */
.opt-in-alert {
  display: flex; align-items: flex-start; gap: 0.6rem;
  margin: 0.75rem 1rem;
  padding: 0.75rem 0.9rem;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 8px;
  font-size: 0.8rem; color: var(--muted); line-height: 1.5;
  flex-shrink: 0;
}
.opt-in-alert strong { color: var(--accent2); }
.alert-icon { font-size: 1rem; flex-shrink: 0; margin-top: 0.1rem; }

/* ─── Route Stops List ───────────────────────────────────────────────────── */
.rp-stops {
  flex: 1; overflow-y: auto; padding: 0.75rem 1rem;
  display: flex; flex-direction: column; gap: 0;
  -webkit-overflow-scrolling: touch;
}

.rp-stop {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.6rem 0;
}
.rp-stop-left {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0; width: 28px;
}
.rp-stop-num {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: #fff;
  border: 2px solid var(--bg); flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.rp-stop-icon.home-icon {
  font-size: 1.1rem; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
}
.rp-connector {
  width: 2px; background: var(--border);
  flex: 1; min-height: 18px; margin: 2px 0;
}

.rp-stop-body { flex: 1; min-width: 0; padding-bottom: 0.25rem; }
.rp-stop-header {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 0.5rem; margin-bottom: 0.2rem;
}
.rp-client  { font-weight: 600; font-size: 0.87rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-value   { font-weight: 700; font-size: 0.87rem; color: var(--accent); flex-shrink: 0; }
.rp-stop-addr { font-size: 0.75rem; color: var(--muted); margin-bottom: 0.3rem; line-height: 1.4; }
.rp-stop-label { font-size: 0.75rem; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem; }

.rp-stop-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.rp-tag {
  font-size: 0.68rem; padding: 0.15rem 0.5rem; border-radius: 999px;
  border: 1px solid transparent; font-weight: 500; white-space: nowrap;
}
.rp-tag.miles { background: rgba(100,116,139,0.15); color: var(--muted); border-color: var(--border); }
.rp-tag.dur   { background: rgba(59,130,246,0.1);   color: #60a5fa;      border-color: rgba(59,130,246,0.2); }

/* ─── Route Footer Summary ───────────────────────────────────────────────── */
.rp-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}
.rp-footer-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem;
}
.rp-footer-item { padding: 0.5rem 0.6rem; background: var(--surface3); border-radius: 8px; }
.rp-footer-lbl  { font-size: 0.65rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem; }
.rp-footer-val  { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.rp-footer-val.revenue    { color: var(--accent); }
.rp-footer-val.be-positive{ color: var(--green); }
.rp-footer-val.be-negative{ color: var(--red); }
.rp-footer-val.be-neutral { color: var(--muted); }
.rp-footer-sub  { font-size: 0.68rem; color: var(--dim); margin-top: 0.15rem; }

.route-period-note {
  margin: 0.9rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(245,158,11,0.25);
  background: rgba(245,158,11,0.08);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
.route-period-note strong { color: var(--accent2); }

.cleaner-detail-modal-box { max-width: 980px; }
.cleaner-detail-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.cleaner-detail-head .badge { margin-left: auto; }
.cleaner-detail-name { font-weight: 800; color: var(--text); }
.cleaner-detail-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.12rem; }
.cleaner-rule-note {
  padding: 0.75rem 0.9rem;
  background: rgba(17,155,160,0.08);
  border: 1px solid rgba(17,155,160,0.18);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  margin-bottom: 1rem;
}
.cleaner-detail-grid,
.cleaner-payout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.cleaner-metric,
.cleaner-payout-grid > div {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}
.cleaner-metric span,
.cleaner-payout-grid span {
  display: block;
  color: var(--dim);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.cleaner-metric strong,
.cleaner-payout-grid strong {
  color: var(--text);
  font-size: 1rem;
}
.cleaner-detail-table-wrap {
  margin-top: 0.4rem;
  overflow-x: auto;
}
.cleaner-detail-table { min-width: 860px; }

/* ─── DataTables search fix ──────────────────────────────────────────────── */
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 0.85rem !important;
}

/* ─── Scheduler Page Styles ──────────────────────────────────────────────── */
.sched-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1rem;
  height: 620px;
}
.sched-map-col { position: relative; }
#sched-map {
  height: 580px; /* explicit fallback — never collapses on mobile/tablet */
  min-height: 300px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sched-panel {
  display: flex; flex-direction: column; gap: 0.75rem;
  overflow-y: auto;
}
.sched-cleaner-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.85rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.sched-cleaner-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.sched-cleaner-card.emergency {
  border-color: var(--red) !important;
  box-shadow: 0 0 12px rgba(239,68,68,0.25) !important;
  animation: pulse-red 1s ease-in-out 3;
}
@keyframes pulse-red {
  0%,100% { box-shadow: 0 0 0 1px rgba(239,68,68,0.3); }
  50%      { box-shadow: 0 0 20px rgba(239,68,68,0.5); }
}

.sc-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.sc-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: #fff;
}
.sc-name    { font-weight: 700; font-size: 0.87rem; flex: 1; }
.sc-status  { font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 999px; font-weight: 600; }
.sc-status.on-time { background: rgba(34,197,94,0.12); color: var(--green); }
.sc-status.emergency { background: rgba(239,68,68,0.12); color: var(--red); }
.sc-status.pending  { background: rgba(245,158,11,0.12); color: var(--accent2); }

.sc-homes-count {
  font-size: 0.75rem; color: var(--muted);
  margin-bottom: 0.5rem;
}
.sc-timeline {
  display: flex; flex-direction: column; gap: 0.25rem;
}
.sc-slot {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem; padding: 0.3rem 0.4rem;
  border-radius: 6px; background: var(--surface2);
  border-left: 3px solid transparent;
  transition: all 0.3s;
}
.sc-slot.assigned   { border-left-color: var(--accent); }
.sc-slot.reassigned { border-left-color: var(--accent2); background: rgba(245,158,11,0.08); }
.sc-slot.dropped    { border-left-color: var(--red); opacity: 0.5; text-decoration: line-through; }
.sc-slot-time  { color: var(--dim); width: 48px; flex-shrink: 0; }
.sc-slot-name  { color: var(--text); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-slot-type  { color: var(--muted); font-size: 1.25rem; flex-shrink: 0; line-height: 1; }

/* ─── Scheduler Controls Bar ─────────────────────────────────────────────── */
.sched-controls {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 1rem 1.5rem;
  background: var(--surface2); border-bottom: 1px solid var(--border);
}
.sched-btn {
  padding: 0.6rem 1.25rem; border-radius: 10px; border: none;
  font-family: inherit; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; gap: 0.4rem;
}
.sched-btn.primary { background: linear-gradient(135deg, var(--accent), #0e8a8f); color: #fff; box-shadow: 0 4px 14px rgba(17,155,160,0.25); }
.sched-btn.primary:hover { opacity: 0.9; transform: translateY(-1px); }
.sched-btn.primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.sched-btn.danger  { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }
.sched-btn.danger:hover { background: rgba(239,68,68,0.25); }
.sched-btn.danger:disabled { opacity: 0.4; cursor: not-allowed; }
.sched-btn.secondary { background: var(--surface3); border: 1px solid var(--border); color: var(--muted); }
.sched-btn.secondary:hover { color: var(--text); }

.sched-status-bar {
  display: flex; align-items: center; gap: 1.5rem;
  flex: 1; flex-wrap: wrap;
}
.sched-stat { text-align: center; }
.sched-stat-val { font-size: 1.2rem; font-weight: 800; color: var(--text); }
.sched-stat-lbl { font-size: 0.68rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.05em; }
.sched-clock    { font-size: 0.85rem; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.traffic-indicator {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.75rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
}
.traffic-indicator.clear  { background: rgba(34,197,94,0.12); color: var(--green); }
.traffic-indicator.moderate { background: rgba(245,158,11,0.12); color: var(--accent2); }
.traffic-indicator.heavy  { background: rgba(239,68,68,0.12); color: var(--red); }

/* ─── SMS Notification Panel ─────────────────────────────────────────────── */
.sms-panel {
  margin: 0 1.5rem 1.5rem;
  background: var(--surface);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  overflow: hidden;
  display: none;
}
.sms-panel.visible { display: block; animation: slideDown 0.4s ease; }
@keyframes slideDown { from { opacity:0; transform:translateY(-12px); } to { opacity:1; transform:translateY(0); } }

.sms-panel-header {
  background: rgba(239,68,68,0.1); padding: 0.85rem 1.25rem;
  display: flex; align-items: center; gap: 0.6rem;
  border-bottom: 1px solid rgba(239,68,68,0.2);
}
.sms-panel-title { font-weight: 700; font-size: 0.95rem; color: var(--red); flex: 1; }

.sms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; padding: 1rem 1.25rem; }

.sms-card {
  background: var(--surface2); border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border);
}
.sms-phone-header {
  background: var(--surface3); padding: 0.5rem 0.85rem;
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; font-weight: 600; color: var(--muted);
}
.sms-bubble {
  margin: 0.75rem; padding: 0.75rem 0.9rem;
  background: rgba(17,155,160,0.08); border-radius: 12px 12px 12px 4px;
  font-size: 0.8rem; line-height: 1.6; color: var(--text);
  border: 1px solid rgba(17,155,160,0.15);
}
.sms-bubble strong { color: var(--accent); }
.sms-homes-preview {
  margin: 0 0.75rem; font-size: 0.75rem; color: var(--muted);
  padding: 0.5rem 0;
}
.sms-homes-preview li { padding: 0.2rem 0; }
.sms-actions {
  display: flex; gap: 0.5rem; padding: 0.75rem;
  border-top: 1px solid var(--border);
}
.sms-yes, .sms-no {
  flex: 1; padding: 0.6rem; border-radius: 8px; border: none;
  font-family: inherit; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.sms-yes { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.sms-yes:hover { background: rgba(34,197,94,0.25); }
.sms-yes.confirmed { background: var(--green); color: #fff; cursor: default; }
.sms-no  { background: rgba(239,68,68,0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.sms-no:hover  { background: rgba(239,68,68,0.2); }
.sms-no.declined { background: var(--red); color: #fff; cursor: default; }

/* ─── Customer Reschedule Panel ──────────────────────────────────────────── */
.reschedule-panel {
  margin: 0 1.5rem 1.5rem;
  display: none;
}
.reschedule-panel.visible { display: block; animation: slideDown 0.4s ease; }
.reschedule-header {
  background: rgba(245,158,11,0.1); padding: 0.85rem 1.25rem;
  border: 1px solid rgba(245,158,11,0.3); border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 700; color: var(--accent2);
}
.reschedule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid rgba(245,158,11,0.15); border-top: none; border-radius: 0 0 var(--radius) var(--radius); }
.reschedule-msg {
  background: var(--surface2); border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
}
.reschedule-msg-header { background: var(--surface3); padding: 0.5rem 0.85rem; font-size: 0.72rem; color: var(--dim); display: flex; justify-content: space-between; }
.reschedule-bubble { margin: 0.75rem; padding: 0.65rem 0.85rem; background: rgba(245,158,11,0.08); border-radius: 10px; font-size: 0.78rem; line-height: 1.6; color: var(--text); border: 1px solid rgba(245,158,11,0.12); }

/* ─── Schedule Timeline (Gantt) ──────────────────────────────────────────── */
.gantt-section {
  padding: 0 1.5rem 1.5rem;
  display: none;
}
.gantt-section.visible { display: block; }
.gantt-title { font-size: 0.85rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.85rem; }
.gantt-row   { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.gantt-label { width: 110px; font-size: 0.75rem; font-weight: 600; color: var(--muted); flex-shrink: 0; }
.gantt-bar-track { flex: 1; height: 28px; background: var(--surface2); border-radius: 6px; position: relative; overflow: hidden; }
.gantt-bar {
  position: absolute; height: 100%; border-radius: 4px;
  display: flex; align-items: center; padding: 0 0.4rem;
  font-size: 0.65rem; font-weight: 600; color: #fff;
  transition: width 0.4s ease, left 0.4s ease;
  white-space: nowrap; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}
.gantt-time-axis {
  display: flex; margin-left: 116px; margin-bottom: 0.3rem;
  font-size: 0.65rem; color: var(--dim);
}
.gantt-tick { flex: 1; text-align: center; }

/* ─── Home Pool Map Markers ───────────────────────────────────────────────── */
.pool-home-marker {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 1px 6px rgba(0,0,0,0.5);
  transition: transform 0.2s;
  cursor: pointer;
}
.pool-home-marker:hover { transform: scale(1.5); }

/* ─── Overflow List ──────────────────────────────────────────────────────── */
.overflow-section {
  padding: 0 1.5rem 1.5rem; display: none;
}
.overflow-section.visible { display: block; }
.overflow-title { font-size: 0.85rem; font-weight: 600; color: var(--accent2); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.overflow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; }
.overflow-card { background: var(--surface2); border: 1px solid rgba(245,158,11,0.2); border-radius: 8px; padding: 0.6rem 0.8rem; font-size: 0.75rem; }
.overflow-card-client { font-weight: 600; color: var(--text); }
.overflow-card-addr   { color: var(--muted); font-size: 0.7rem; margin-top: 0.1rem; }
.overflow-card-type   { margin-top: 0.3rem; }

@media (max-width: 1100px) {
  /* iPad landscape (1024px) and smaller */

  /* Always show nav links on iPad — don't hide them */
  .header-nav {
    display: flex !important;
    position: static;
    background: transparent;
    border: none;
    padding: 0;
    flex-direction: row;
    gap: 0.25rem;
  }
  .nav-link { padding: 0.5rem 0.75rem; font-size: 0.82rem; }
  .mobile-menu-btn { display: none !important; }

  /* Map goes full width, route detail panel stacks below full width */
  .map-route-split {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .map-side { width: 100%; }
  .map-side #map { height: 480px; width: 100%; }
  #map { height: 480px; }

  /* Route detail panel: full width, auto height — shows all stops without fixed scroll box */
  .route-side {
    width: 100%;
    height: auto;
    min-height: 200px;
    max-height: none;
    overflow: visible;
  }
  /* Route stop list: allow natural page scroll, not clipped internal scroll box */
  .rp-stops {
    max-height: none !important;
    overflow: visible !important;
    flex: none;
  }

  /* Scheduler map — explicit height so it doesn't collapse */
  .sched-layout { grid-template-columns: 1fr; height: auto; }
  .sched-map-col { height: 440px; }
  #sched-map { height: 440px !important; }
  .sched-panel { max-height: 480px; }
  /* Keep projector grid side-by-side on iPad landscape */
  .projector-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  /* Keep cost scenario grid side-by-side on iPad */
  .cost-scenario-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  /* Charts can stay side-by-side on iPad */
  .charts-grid {
    grid-template-columns: 1fr 1fr;
  }
  /* Overview grid - 3 columns on iPad */
  .overview-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  /* KPI grid on iPad */
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* iPad Portrait (768px - 899px) */
@media (min-width: 768px) and (max-width: 899px) {
  /* Keep header nav visible in horizontal layout */
  .header-nav {
    display: flex;
    position: static;
    background: transparent;
    border: none;
    padding: 0;
  }
  .nav-link { padding: 0.45rem 0.8rem; font-size: 0.8rem; }
  /* Stack projector grid on iPad portrait */
  .projector-grid {
    grid-template-columns: 1fr;
  }
  /* Stack cost scenario grid on iPad portrait */
  .cost-scenario-grid {
    grid-template-columns: 1fr;
  }
  /* Stack charts on iPad portrait */
  .charts-grid {
    grid-template-columns: 1fr;
  }
  /* Overview grid - 2 columns on iPad portrait */
  .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  /* KPI grid - 2 columns on iPad portrait */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  /* Employee table scroll */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Cost tables scroll */
  .cost-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Route panel visible on iPad */
  .route-side {
    display: flex;
    height: 400px;
  }
  /* Mobile menu button hidden */
  .mobile-menu-btn { display: none; }
}

/* iPad-specific fixes */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Ensure route panel is visible on iPad */
  .route-side {
    display: flex !important;
    height: 400px;
  }
  /* Ensure all sections are visible */
  #cost-analysis-section,
  #projector-section,
  #charts-section,
  #sop-section {
    display: block;
  }
  /* Ensure tables are scrollable but visible */
  .cost-table-wrap,
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Ensure scenario toggle is usable */
  .scenario-toggle-wrap {
    flex-wrap: wrap;
  }
  .scenario-btn {
    min-height: 44px;
  }
}

@media (max-width: 767px) {
  .map-route-split { grid-template-columns: 1fr; }
  .map-side #map { height: 360px; }
  .route-side { height: auto; min-height: 180px; }
  .rp-stops { max-height: none !important; overflow: visible !important; flex: none; }
  .sched-layout { grid-template-columns: 1fr; height: auto; }
  .sched-map-col { height: 380px; }
  .sched-panel { max-height: 400px; }
  #sched-map { height: 380px !important; }
  /* Convert nav to stacked/mobile-friendly instead of hiding */
  .header-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 99;
    display: none; /* Hidden by default, toggled via JS */
  }
  .header-nav.mobile-visible { display: flex; }
  .nav-link { padding: 0.75rem 1rem; justify-content: center; }
  /* Hamburger menu button for mobile */
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    margin-right: 0.5rem;
  }
}

@media (max-width: 768px) {
  .map-side #map { height: 300px; }
  #map { height: 300px; }
  .sched-map-col { height: 300px; }
  #sched-map { height: 300px !important; }
}

/* ─── VIP markers & popups ──────────────────────────────────────────────── */
.vip-map-star {
  position: absolute; top: -6px; right: -6px;
  font-size: 9px; line-height: 1; pointer-events: none; user-select: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.7));
}
.pool-home-marker { position: relative; }
.assigned-marker  { transform: scale(1.18); transition: transform 0.25s; }
.popup-vip {
  margin: 0.45rem 0 0.25rem;
  font-size: 0.78rem; font-weight: 700; color: var(--accent2);
  padding: 0.25rem 0.5rem; background: rgba(245,158,11,0.12);
  border-radius: 6px; border: 1px solid rgba(245,158,11,0.2);
}

/* ─── Type filter buttons ────────────────────────────────────────────────── */
.type-filter-bar {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  padding: 0.6rem 1.5rem; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.type-filter-btn {
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.28rem 0.7rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 500; font-family: inherit;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer; transition: all 0.18s;
}
.type-filter-btn:hover  { border-color: var(--fc, var(--accent)); color: var(--text); }
.type-filter-btn.active { background: color-mix(in srgb, var(--fc, var(--accent)) 15%, transparent);
  border-color: var(--fc, var(--accent)); color: var(--fc, var(--accent)); }
.tfb-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ─── SMS card states ────────────────────────────────────────────────────── */
.sms-waiting       { opacity: 0.45; filter: grayscale(0.4); transition: opacity 0.4s, filter 0.4s; }
.sms-active        { opacity: 1; filter: none; border: 1px solid rgba(17,155,160,0.35) !important; }
.sms-confirmed     { border: 1px solid rgba(34,197,94,0.35) !important; }
.sms-declined      { opacity: 0.55; filter: grayscale(0.5); }
.sms-no-longer-needed { opacity: 0.35; filter: grayscale(0.7); }
.sms-priority-badge {
  background: linear-gradient(90deg, rgba(17,155,160,0.18), transparent);
  border-bottom: 1px solid rgba(17,155,160,0.15);
  padding: 0.3rem 0.85rem; font-size: 0.68rem; font-weight: 700;
  color: var(--accent); letter-spacing: 0.04em; text-transform: uppercase;
}
.sms-addr    { color: var(--dim); font-size: 0.68rem; margin-left: auto; }
.sms-queued-notice {
  padding: 0.45rem 0.85rem; font-size: 0.75rem; color: var(--dim);
  font-style: italic; border-top: 1px solid var(--border);
}
.sms-no-capacity {
  font-size: 0.75rem; color: var(--muted); padding: 0.5rem 0.85rem; margin: 0;
}

/* ─── OT Approval panel ──────────────────────────────────────────────────── */
.ot-panel {
  margin: 0; padding: 0.75rem 0.85rem;
  background: rgba(245,158,11,0.08); border-top: 1px solid rgba(245,158,11,0.2);
}
.ot-title {
  font-size: 0.8rem; font-weight: 700; color: var(--accent2); margin-bottom: 0.4rem;
}
.ot-detail {
  font-size: 0.75rem; color: var(--text); line-height: 1.55; margin-bottom: 0.6rem;
}
.ot-detail strong { color: var(--accent2); }
.ot-actions { display: flex; gap: 0.5rem; }
.ot-approve {
  flex: 1; padding: 0.35rem 0.6rem; border-radius: 8px;
  background: rgba(34,197,94,0.15); color: var(--green);
  border: 1px solid rgba(34,197,94,0.3); font-family: inherit;
  font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: background 0.18s;
}
.ot-approve:hover { background: rgba(34,197,94,0.28); }
.ot-deny {
  flex: 1; padding: 0.35rem 0.6rem; border-radius: 8px;
  background: rgba(239,68,68,0.1); color: var(--red);
  border: 1px solid rgba(239,68,68,0.25); font-family: inherit;
  font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: background 0.18s;
}
.ot-deny:hover { background: rgba(239,68,68,0.22); }
.ot-approved-badge {
  padding: 0.35rem 0.85rem; font-size: 0.72rem; font-weight: 600;
  color: var(--accent2); background: rgba(245,158,11,0.12);
  border-top: 1px solid rgba(245,158,11,0.2);
}
.ot-denied-msg {
  padding: 0.45rem 0.85rem; font-size: 0.75rem; color: var(--red);
  font-style: italic;
}

/* ─── Routing loading spinner ─────────────────────────────────────────────── */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════════
   SCENARIO TOGGLE & COST ANALYSIS — added for SparkleMafia trial features
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Scenario Toggle ─────────────────────────────────────────────────────── */
.scenario-toggle-wrap {
  display: flex; align-items: center; gap: 0.6rem;
  justify-content: center; flex-wrap: wrap;
  margin-top: 1.25rem; margin-bottom: 1.5rem;
}
.scenario-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.15rem; padding: 0.55rem 1.4rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--muted); cursor: pointer;
  font-family: inherit; transition: all 0.18s;
}
.scenario-btn strong { font-size: 0.9rem; color: var(--text); }
.scenario-btn span { font-size: 0.72rem; color: var(--dim); }
.scenario-btn:hover { border-color: var(--accent); background: rgba(17,155,160,0.08); }
.scenario-btn.active {
  border-color: var(--accent); background: rgba(17,155,160,0.12);
  box-shadow: 0 0 0 1px var(--accent);
}
.scenario-btn.active strong { color: var(--accent); }
.scenario-compliance-tag {
  font-size: 0.72rem; font-weight: 600; color: var(--accent2);
  background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3);
  border-radius: 6px; padding: 0.3rem 0.65rem;
}
.route-model-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.75rem;
  max-width: 760px;
  margin: 1.5rem auto;
}
.route-model-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  text-align: left;
}
.route-model-card.active {
  border-color: var(--accent);
  background: rgba(17,155,160,0.1);
}
.route-model-card strong {
  display: block;
  color: var(--text);
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}
.route-model-card span {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}
.route-model-wrap .scenario-compliance-tag {
  grid-column: 1 / -1;
  justify-self: center;
}
@media (max-width: 720px) {
  .route-model-wrap { grid-template-columns: 1fr; }
}


/* ─── Section title row (title + export btn side by side) ─────────────────── */
.section-title-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.5rem;
}
.btn-export {
  flex-shrink: 0; padding: 0.45rem 1rem;
  background: rgba(17,155,160,0.1); border: 1px solid rgba(17,155,160,0.3);
  border-radius: 8px; color: var(--accent); font-family: inherit;
  font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.18s;
}
.btn-export:hover { background: rgba(17,155,160,0.2); }

/* ─── Table: scenario-active column highlight ─────────────────────────────── */
.scenario-active-col { font-weight: 700; color: var(--accent); }
.dim-cell { color: var(--dim); font-size: 0.82rem; }

/* ─── Admin badge variants ────────────────────────────────────────────────── */
.badge-admin {
  display: inline-block; font-size: 0.62rem; font-weight: 700;
  padding: 0.1rem 0.4rem; border-radius: 4px;
  background: rgba(245,158,11,0.15); color: var(--accent2);
  border: 1px solid rgba(245,158,11,0.3); margin-left: 0.25rem;
}
.badge-admin-xs {
  display: inline-block; font-size: 0.6rem; font-weight: 600;
  padding: 0.08rem 0.3rem; border-radius: 3px;
  background: rgba(245,158,11,0.12); color: var(--accent2);
  border: 1px solid rgba(245,158,11,0.25); margin-left: 0.2rem;
}

/* ─── Cost Analysis Section ───────────────────────────────────────────────── */
.cost-scenario-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 1100px) {
  .cost-scenario-grid { grid-template-columns: 1fr; }
}
.cost-card {
  background: var(--surface); border-radius: 14px;
  border: 1px solid var(--border); overflow: hidden;
}
.cost-card-a { border-top: 3px solid var(--accent); }
.cost-card-b { border-top: 3px solid var(--teal); }
.cost-card-header {
  padding: 1rem 1.25rem 0.75rem; border-bottom: 1px solid var(--border);
}
.cost-card-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--dim); margin-bottom: 0.15rem;
}
.cost-card-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.cost-card-note { font-size: 0.72rem; color: var(--muted); margin-top: 0.2rem; }
.wa-note { color: var(--accent2); font-weight: 600; }
.cost-table-wrap { overflow-x: auto; }
.cost-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.8rem;
}
.cost-table th {
  padding: 0.5rem 0.75rem; text-align: center;
  background: var(--surface2); color: var(--dim);
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; border-bottom: 1px solid var(--border);
}
.cost-table th:first-child { text-align: left; }
.cost-table td {
  padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border);
  color: var(--text);
}
.cost-table tfoot td {
  padding: 0.6rem 0.75rem; border-top: 1px solid var(--border);
  border-bottom: none; background: var(--surface2);
  color: var(--text); font-size: 0.78rem;
}
.cost-table tr:last-child td { border-bottom: none; }

/* ── Sweet Spot table — alternating column shading ───────────────────────── */
/* Scoped to #company-impact-table only so other cost-tables are unaffected.  */
/* 0.07 opacity gives ~17-level RGB lift on the dark bg — clearly visible.    */
#company-impact-table thead th:nth-child(even) {
  background: rgba(255,255,255,0.07);
}
#company-impact-table tbody td:nth-child(even) {
  background: rgba(255,255,255,0.07);
}
#company-impact-table tfoot td:nth-child(even) {
  background: rgba(255,255,255,0.07);
}

.emp-name-cell { text-align: left; white-space: nowrap; }
.emp-dot-sm {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 0.4rem; flex-shrink: 0;
}
.rate-delta { font-size: 0.7rem; color: var(--red); display: block; }

.payroll-tax-import {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  max-width: 520px;
}

.payroll-tax-import input[type="number"] {
  width: 5.25rem;
  padding: 0.43rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
}

.payroll-tax-import input[type="file"] {
  max-width: 185px;
  color: var(--muted);
  font-size: 0.78rem;
}

.payroll-tax-status {
  flex-basis: 100%;
  min-height: 1rem;
  text-align: right;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

/* ─── Cost Explainer ──────────────────────────────────────────────────────── */
.cost-explainer {
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 1rem 1.25rem; background: var(--surface2);
  border-radius: 10px; border: 1px solid var(--border);
}
.cost-explainer-item { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }

/* ─── Date Filter Bar ────────────────────────────────────────────────────── */
.date-filter-section {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 2rem;
  position: sticky;
  top: 64px;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.date-filter-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  overflow: hidden;
}
.date-filter-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  flex-shrink: 0;
  white-space: nowrap;
}
.dfb-scroll-outer {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(17,155,160,0.2) transparent;
  mask-image: linear-gradient(to right, transparent 0, black 1.5rem, black calc(100% - 1.5rem), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 1.5rem, black calc(100% - 1.5rem), transparent 100%);
}
.dfb-scroll-outer::-webkit-scrollbar { height: 4px; }
.dfb-scroll-outer::-webkit-scrollbar-track { background: transparent; }
.dfb-scroll-outer::-webkit-scrollbar-thumb { background: rgba(17,155,160,0.2); border-radius: 2px; }
.date-filter-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.35rem;
  align-items: center;
  padding: 0.25rem 1.5rem;
  width: max-content;
}
.date-filter-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
  padding: 0.3rem 0.65rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.14s;
  min-width: 52px;
  min-height: 44px;
  flex-shrink: 0;
  line-height: 1;
  touch-action: manipulation;
}
.date-filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(17,155,160,0.06);
}
.date-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.date-all-btn {
  flex-shrink: 0;
}
.dfb-scroll-arrow {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.14s;
  flex-shrink: 0;
}
.dfb-scroll-arrow:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(17,155,160,0.08);
}
.dfb-scroll-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}
.dfb-month-sep {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  padding: 0.15rem 0.5rem;
  background: var(--surface2);
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
  margin: 0 0.15rem;
}
.dfb-day  { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.dfb-date { font-size: 0.82rem; font-weight: 600; }
.dfb-count { font-size: 0.58rem; opacity: 0.65; white-space: nowrap; }
.date-filter-btn.active .dfb-count { opacity: 0.85; }

/* ─── Earnings Charts — full-width stacked, vertical bars ────────────────── */
.earnings-grid {
  display: grid;
  grid-template-columns: 1fr;   /* stack vertically, full width */
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.earnings-chart-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.earnings-chart-wrap {
  position: relative;
  height: 320px;       /* fixed height — vertical bars, auto-scaled Y */
}
.earnings-chart-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}
.chart-legend-inline {
  font-size: 0.72rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.cleg { display: flex; align-items: center; gap: 0.3rem; }
.cleg.enrolled     { color: #119ba0; }
.cleg.not-enrolled { color: #ef4444; }
.cost-explainer-item strong { color: var(--text); }

.wage-cut-wrap {
  max-width: 420px;
  margin: 1.25rem auto 0;
  text-align: center;
}
.wage-cut-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.wage-cut-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
}
.wage-cut-wrap input[type=range] {
  width: 100%;
  accent-color: var(--accent);
}
.wage-cut-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.25rem;
  padding: 0 2px;
}
.wage-cut-step-hint {
  font-size: 0.68rem;
  color: var(--dim, #6b7280);
  margin-top: 0.2rem;
  letter-spacing: 0.03em;
}

/* ─── Admin Action Buttons ────────────────────────────────────────────────── */
.admin-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}
.btn-admin {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  padding: 0.38rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-admin:hover {
  background: rgba(17,155,160,0.1);
  border-color: rgba(17,155,160,0.35);
  color: var(--accent);
}

.header-action-btn {
  background: none;
  border: 1px solid #1e3a5a;
  color: #263f47;
  padding: 0.32rem 0.85rem;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}
.header-action-btn:hover {
  border-color: #119BA0;
  color: #119BA0;
}
.header-action-btn.active {
  border-color: #119BA0;
  color: #119BA0;
  background: rgba(17,155,160,0.08);
}

.admin-hub-section {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 2rem;
}

.admin-import-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.admin-bundle-panel {
  background: var(--surface);
  border: 1px solid rgba(17,155,160,0.24);
  border-radius: 8px;
  padding: 1.35rem;
  margin-top: 1rem;
  box-shadow: var(--shadow);
}

.admin-bundle-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.admin-bundle-head h2 {
  margin: 0 0 0.35rem;
  color: var(--text);
  font-size: 1.05rem;
  letter-spacing: 0;
}

.admin-bundle-head p {
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.5;
  max-width: 720px;
}

.admin-bundle-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-run-btn {
  background: rgba(17,155,160,0.14);
  border-color: rgba(17,155,160,0.38);
  color: var(--accent);
}

.admin-bundle-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1.2fr 0.55fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.admin-bundle-file {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}

.admin-bundle-file span {
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-bundle-file input {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.43rem 0.5rem;
  font: inherit;
  font-size: 0.78rem;
}

.admin-bundle-file small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.admin-bundle-file.has-file {
  border-color: rgba(17,155,160,0.32);
  background: rgba(17,155,160,0.05);
}

.admin-bundle-file.has-file small {
  color: var(--text);
  font-weight: 600;
}

.admin-bundle-status {
  color: var(--text);
  font-size: 0.84rem;
  margin-top: 0.8rem;
  min-height: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  background: var(--surface2);
  line-height: 1.45;
}

.admin-bundle-status.ok {
  border-color: rgba(34,197,94,0.28);
  background: rgba(34,197,94,0.08);
}

.admin-bundle-status.warn,
.admin-bundle-status.working {
  border-color: rgba(245,158,11,0.3);
  background: rgba(245,158,11,0.08);
}

.admin-bundle-status.bad {
  border-color: rgba(239,68,68,0.26);
  background: rgba(239,68,68,0.07);
}

.admin-bundle-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.bundle-result {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 8px;
  padding: 0.75rem;
  background: var(--surface2);
  color: var(--text);
  font-size: 0.77rem;
  line-height: 1.4;
}

.bundle-result strong {
  display: block;
  color: var(--text);
  font-size: 0.84rem;
  margin-bottom: 0.25rem;
}

.bundle-result.ok { border-left-color: #22c55e; }
.bundle-result.warn { border-left-color: #f59e0b; }
.bundle-result.bad { border-left-color: #ef4444; }

.admin-import-card,
.admin-verify-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.15rem;
  box-shadow: var(--shadow);
}

.admin-import-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.admin-import-kicker {
  color: var(--dim);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.admin-import-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: 0;
}

.admin-import-card p {
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}

.admin-import-status {
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid transparent;
}
.admin-import-status.ready {
  background: rgba(34,197,94,0.12);
  color: #16a34a;
  border-color: rgba(34,197,94,0.22);
}
.admin-import-status.missing {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
  border-color: rgba(239,68,68,0.2);
}
.admin-import-status.warn {
  background: rgba(245,158,11,0.12);
  color: #d97706;
  border-color: rgba(245,158,11,0.24);
}

.admin-import-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--text);
  font-size: 0.76rem;
  margin-bottom: 1rem;
}
.admin-import-meta span {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.admin-import-action {
  width: fit-content;
}

.admin-revenue-upload,
.admin-payroll-import {
  justify-content: flex-start;
  max-width: none;
}

.admin-revenue-upload {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.admin-revenue-upload input[type="file"] {
  max-width: 220px;
  color: var(--text);
  font-size: 0.78rem;
}

.admin-import-note {
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1.4;
  margin-top: 0.7rem;
  min-height: 2rem;
}

.admin-verify-panel {
  margin-top: 1rem;
}

.admin-verify-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.admin-verify-row {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 8px;
  padding: 0.75rem;
}
.admin-verify-row span {
  display: block;
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.admin-verify-row strong {
  color: var(--text);
  font-size: 0.84rem;
}
.admin-verify-row.ok { border-left-color: #22c55e; }
.admin-verify-row.warn { border-left-color: #f59e0b; }
.admin-verify-row.missing { border-left-color: #ef4444; }

@media (max-width: 960px) {
  .admin-import-grid,
  .admin-verify-list,
  .admin-bundle-grid,
  .admin-bundle-results {
    grid-template-columns: 1fr;
  }

  .admin-bundle-head {
    flex-direction: column;
  }
}

/* ─── Modal Overlay ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem 0;
}
.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--dim);
  line-height: 1;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--surface2); color: var(--text); }
.modal-body {
  padding: 1.1rem 1.5rem;
  flex: 1;
}
.modal-desc {
  font-size: 0.835rem;
  color: var(--dim);
  margin-bottom: 1.1rem;
  line-height: 1.55;
}
.modal-status {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.4em;
  line-height: 1.4;
}
.modal-footer {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.9rem 1.5rem 1.3rem;
  border-top: 1px solid var(--border);
}

/* ─── Modal Buttons ───────────────────────────────────────────────────────── */
.btn-modal-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0.52rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-modal-primary:hover  { background: #0e8a8f; }
.btn-modal-primary:disabled { opacity: 0.48; cursor: not-allowed; }
.btn-modal-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 0.52rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-modal-secondary:hover { background: var(--surface3); }
.btn-modal-ghost {
  background: none;
  color: var(--dim);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0.52rem 0.85rem;
  font-size: 0.875rem;
  font-family: inherit;
  margin-left: auto;
  transition: color 0.15s;
}
.btn-modal-ghost:hover { color: var(--text); }

/* ─── Upload Drop Area ────────────────────────────────────────────────────── */
.upload-drop-area {
  border: 2px dashed rgba(17,155,160,0.25);
  border-radius: 10px;
  padding: 1.75rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-drop-area:hover {
  border-color: var(--accent);
  background: rgba(17,155,160,0.05);
}
.upload-drop-area input[type="file"] { display: none; }
.upload-drop-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--dim);
  font-size: 0.88rem;
  pointer-events: none;
}
.upload-drop-icon { font-size: 2rem; }

/* ─── Cleaner Form Fields ─────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem 1rem;
}
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-full  { grid-column: 1 / -1; }
.form-group label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-hint {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--dim);
  text-transform: none;
  letter-spacing: 0;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 0.875rem;
  padding: 0.44rem 0.65rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="date"]:focus { border-color: var(--accent); }
.form-group input[type="color"] {
  width: 52px;
  height: 36px;
  border-radius: 7px;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 2px 3px;
  background: var(--surface);
}
.form-check-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}
.form-check-row label {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.form-check-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--accent);
}

/* ─── Upload Progress Bar ─────────────────────────────────────────────────── */
.upload-progress-wrap {
  margin-top: 0.85rem;
}
.upload-progress-track {
  height: 7px;
  background: var(--surface3);
  border-radius: 999px;
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #22c55e);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.upload-progress-label {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.35rem;
  min-height: 1.1em;
  line-height: 1.3;
}

/* ─── SOP Accordion ───────────────────────────────────────────────────────── */
.sop-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.sop-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.sop-item[open] {
  border-color: rgba(17,155,160,0.3);
}
.sop-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  outline: none;
}
.sop-summary::-webkit-details-marker { display: none; }
.sop-summary:hover { background: rgba(17,155,160,0.04); }
.sop-icon { font-size: 1.1rem; flex-shrink: 0; }
.sop-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.sop-chevron {
  font-size: 1.2rem;
  color: var(--dim);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.sop-item[open] .sop-chevron { transform: rotate(90deg); }
.sop-body {
  padding: 0 1.1rem 1rem;
  border-top: 1px solid var(--border);
}
.sop-body p, .sop-body li {
  font-size: 0.855rem;
  color: var(--muted);
  line-height: 1.65;
}
.sop-body p { margin-bottom: 0.55rem; }
.sop-body ul, .sop-body ol {
  padding-left: 1.4rem;
  margin-bottom: 0.55rem;
}
.sop-body li { margin-bottom: 0.25rem; }
.sop-body strong { color: var(--text); }
.sop-body .sop-note {
  background: rgba(17,155,160,0.07);
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0.75rem;
  border-radius: 0 6px 6px 0;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.sop-step {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
  align-items: flex-start;
}
.sop-step-num {
  background: var(--accent);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.sop-step-text {
  font-size: 0.855rem;
  color: var(--muted);
  line-height: 1.5;
}
.sop-section-sub {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0.85rem 0 0.35rem;
}

/* ─── OT Message Bubbles ──────────────────────────────────────────────────── */
.ot-manager-msg {
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.ot-msg-bubble {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.79rem;
  line-height: 1.45;
  max-width: 88%;
}
.ot-msg-bubble.outgoing {
  background: rgba(17,155,160,0.1);
  border: 1px solid rgba(20,184,166,0.25);
  color: var(--muted);
  align-self: flex-end;
  text-align: right;
}
.ot-msg-bubble.incoming {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--muted);
  align-self: flex-start;
  animation: fadeSlideIn 0.4s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Typing / sending indicator dots */
.ot-sending-indicator {
  display: flex;
  align-items: center;
  padding: 0.35rem 0.5rem;
}
.ot-dot {
  width: 6px; height: 6px;
  background: var(--muted);
  border-radius: 50%;
  margin: 0 2px;
  animation: dotBounce 1.2s infinite;
}
.ot-dot:nth-child(2) { animation-delay: 0.2s; }
.ot-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBounce {
  0%,80%,100% { transform: scale(0.8); opacity: 0.5; }
  40%         { transform: scale(1.2); opacity: 1; }
}

/* "Sending to next cleaner" notice on declined card */
.sms-next-notify {
  padding: 0.5rem 0.85rem;
  border-top: 1px solid var(--border);
  background: rgba(20,184,166,0.05);
}
.sms-next-label {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ─── Reschedule Panel Enhancements ───────────────────────────────────────── */
.reschedule-no-cleaners {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1rem;
}
.rna-icon { font-size: 1.5rem; flex-shrink: 0; }
.rna-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 0.25rem;
}
.rna-sub {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}
.reschedule-dates {
  padding: 0.55rem 0.85rem 0.65rem;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.reschedule-dates-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dim);
  margin-bottom: 0.45rem;
}
.reschedule-dates-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.reschedule-date-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 7px;
  cursor: pointer;
  padding: 0.32rem 0.7rem;
  font-size: 0.76rem;
  font-family: inherit;
  transition: all 0.15s;
}
.reschedule-date-btn:hover { border-color: var(--accent); color: var(--accent); }
.reschedule-date-btn.selected {
  background: rgba(17,155,160,0.12);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.reschedule-date-btn.preferred { border-color: rgba(20,184,166,0.4); }
.preferred-tag {
  font-size: 0.62rem;
  background: rgba(17,155,160,0.12);
  color: var(--accent);
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  margin-left: 0.3rem;
}

/* ─── SMS Probation Notice ───────────────────────────────────────────────── */
.sms-probation-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: rgba(234,179,8,0.08);
  border: 1px solid rgba(234,179,8,0.28);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin: 0.5rem 0.85rem 0.65rem;
  font-size: 0.76rem;
}
.sms-prob-icon { font-size: 1.15rem; flex-shrink: 0; line-height: 1.3; }
.sms-prob-title {
  font-weight: 700;
  color: #eab308;
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
}
.sms-prob-sub {
  color: var(--muted);
  line-height: 1.5;
}
.sms-prob-sub code {
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-size: 0.72rem;
  color: #263f47;
  font-family: 'Courier New', monospace;
}

/* ─── SMS Emergency Override Note ────────────────────────────────────────── */
.sms-override-note {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.71rem;
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.22);
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  margin: 0.35rem 0.85rem 0;
}

/* ─── Emergency Home Marker ──────────────────────────────────────────────── */
.emergency-home-marker {
  width: 18px; height: 18px; border-radius: 50%;
  background: #ef4444;
  border: 2.5px solid #fca5a5;
  box-shadow: 0 0 0 0 rgba(239,68,68,0.8);
  animation: emergency-pulse 1s ease-in-out infinite;
  cursor: pointer;
  position: relative;
}
@keyframes emergency-pulse {
  0%   { transform: scale(1);   box-shadow: 0 0 0 0   rgba(239,68,68,0.85); background: #ef4444; }
  50%  { transform: scale(1.6); box-shadow: 0 0 0 10px rgba(239,68,68,0);   background: #f87171; }
  100% { transform: scale(1);   box-shadow: 0 0 0 0   rgba(239,68,68,0);    background: #ef4444; }
}

/* ─── Gantt Tooltip ───────────────────────────────────────────────────────── */
#gantt-tooltip {
  position: fixed;
  display: none;
  z-index: 9999;
  pointer-events: none;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 9px;
  padding: 0.6rem 0.85rem;
  box-shadow: 0 8px 28px rgba(0,0,0,0.55);
  min-width: 170px;
  max-width: 230px;
}
.gt-client {
  font-size: 0.83rem; font-weight: 700; color: #f1f5f9;
  margin-bottom: 0.3rem;
}
.gt-time  { font-size: 0.72rem; color: #263f47; margin-bottom: 0.15rem; }
.gt-type  { font-size: 0.72rem; color: #263f47; margin-bottom: 0.2rem; }
.gt-rev   { font-size: 0.8rem; font-weight: 600; color: #22c55e; }

/* ─── Overflow Contact Button ─────────────────────────────────────────────── */
.overflow-contact-btn {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.3rem 0.55rem;
  font-size: 0.69rem;
  font-weight: 600;
  font-family: inherit;
  background: rgba(20,184,166,0.09);
  border: 1px solid rgba(20,184,166,0.28);
  color: var(--accent);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.overflow-contact-btn:hover {
  background: rgba(20,184,166,0.2);
  border-color: var(--accent);
}

/* ─── Contact Modal ───────────────────────────────────────────────────────── */
.contact-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  animation: cmFadeIn 0.18s ease;
}
@keyframes cmFadeIn { from { opacity: 0; } to { opacity: 1; } }
.contact-modal {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 1.5rem;
  width: 480px;
  max-width: calc(100vw - 2rem);
  box-shadow: 0 24px 64px rgba(0,0,0,0.65);
  animation: cmSlideUp 0.2s ease;
}
@keyframes cmSlideUp { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.contact-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1rem;
}
.contact-modal-title { font-size: 1rem; font-weight: 700; color: #f1f5f9; }
.contact-modal-sub   { font-size: 0.75rem; color: #263f47; margin-top: 0.15rem; }
.contact-modal-close {
  background: transparent; border: none; color: #263f47;
  font-size: 1.3rem; cursor: pointer; line-height: 1; padding: 0 0.2rem;
  transition: color 0.15s;
}
.contact-modal-close:hover { color: #f1f5f9; }
.contact-method-toggle { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.contact-method-btn {
  flex: 1; padding: 0.45rem; border-radius: 8px;
  font-size: 0.8rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all 0.15s;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04); color: #263f47;
}
.contact-method-btn.active {
  background: rgba(17,155,160,0.12);
  border-color: var(--accent); color: var(--accent);
}
.contact-preview {
  background: #0f172a; border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px; padding: 0.85rem 1rem; margin-bottom: 1rem;
}
.contact-preview-label {
  font-size: 0.65rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: #263f47; margin-bottom: 0.45rem;
}
.contact-preview-to   { font-size: 0.73rem; color: #263f47; margin-bottom: 0.6rem; }
.contact-preview-body { font-size: 0.8rem; color: #263f47; line-height: 1.6; white-space: pre-wrap; }
.contact-send-btn {
  width: 100%; padding: 0.6rem;
  background: var(--accent); color: #0f172a;
  border: none; border-radius: 9px;
  font-size: 0.875rem; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: background 0.15s;
}
.contact-send-btn:hover { background: #0d9488; }
.contact-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.contact-sent-confirm {
  display: flex; align-items: center; gap: 0.65rem;
  background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.25);
  border-radius: 9px; padding: 0.65rem 1rem;
  font-size: 0.82rem; font-weight: 600; color: var(--green);
  animation: fadeSlideIn 0.3s ease;
}

/* ─── Unresolved Cleaner Warning Banner ──────────────────────────── */
.unresolved-cleaner-banner {
  display: flex; align-items: flex-start; gap: 0.75rem;
  background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.35);
  border-radius: 10px; padding: 0.85rem 1rem; margin: 0.5rem 1rem 0;
  font-size: 0.78rem; color: #e2e8f0; position: relative;
}
.ucb-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 0.1rem; }
.ucb-body { flex: 1; }
.ucb-body strong { color: #fbbf24; font-size: 0.82rem; }
.ucb-names { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.45rem 0 0.35rem; }
.ucb-tag {
  background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3);
  color: #fbbf24; border-radius: 4px; padding: 0.15rem 0.5rem;
  font-size: 0.72rem; font-weight: 600; font-family: monospace;
}
.ucb-hint { color: #263f47; font-size: 0.72rem; line-height: 1.5; }
.ucb-hint code { background: rgba(255,255,255,0.08); border-radius: 3px; padding: 0.1rem 0.3rem; font-size: 0.7rem; }
.ucb-close {
  background: none; border: none; color: #263f47; font-size: 1rem;
  cursor: pointer; flex-shrink: 0; padding: 0; line-height: 1;
  margin-top: 0.1rem;
}
.ucb-close:hover { color: #e2e8f0; }

/* ─── End of Year Alert Banner ───────────────────────────── */
.eoy-banner {
  display: flex; align-items: flex-start; gap: 0.75rem;
  background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.35);
  border-radius: 10px; padding: 0.85rem 1rem; margin: 0.75rem 1rem 0;
  font-size: 0.78rem; color: #e2e8f0;
}
.eoy-banner.eoy-urgent {
  background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.4);
  animation: eoy-pulse 2s ease-in-out infinite;
}
@keyframes eoy-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.2); }
  50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}
.eoy-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 0.1rem; }
.eoy-body { flex: 1; }
.eoy-body strong { color: #a5b4fc; font-size: 0.82rem; }
.eoy-banner.eoy-urgent .eoy-body strong { color: #fca5a5; }
.eoy-actions { display: flex; gap: 0.5rem; margin-top: 0.55rem; flex-wrap: wrap; }
.eoy-btn-primary {
  background: #6366f1; border: none; color: #fff;
  border-radius: 6px; padding: 0.3rem 0.75rem;
  font-size: 0.73rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: background 0.15s;
}
.eoy-btn-primary:hover { background: #4f46e5; }
.eoy-btn-dismiss {
  background: none; border: 1px solid rgba(255,255,255,0.12); color: #263f47;
  border-radius: 6px; padding: 0.3rem 0.75rem;
  font-size: 0.73rem; cursor: pointer; font-family: inherit;
}
.eoy-btn-dismiss:hover { color: #263f47; border-color: rgba(255,255,255,0.2); }

/* ── Mileage Sub-Nav ─────────────────────────────────────────────────────────── */
.mileage-sub-nav {
  position: sticky;
  top: 56px; /* sit just below fixed header */
  z-index: 90;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.5rem;
  height: 48px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.sub-nav-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 100%;
}

.sub-nav-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0 0.9rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.sub-nav-btn:hover { color: var(--accent); }
.sub-nav-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.sub-nav-slider {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.wage-cut-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#wage-cut-slider {
  width: 120px;
  accent-color: var(--accent);
  cursor: pointer;
}

.wage-cut-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 5rem;
  text-align: right;
}

@media (max-width: 640px) {
  .mileage-sub-nav {
    flex-direction: column;
    height: auto;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    top: 56px;
  }
  .sub-nav-tabs { width: 100%; justify-content: space-between; }
  .sub-nav-btn { padding: 0 0.6rem; font-size: 0.75rem; }
  #wage-cut-slider { width: 90px; }
}

/* ── Program Sweet Spot — Rate Adjuster ──────────────────────────────────────── */
.impact-rate-adjuster {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.impact-rate-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex-shrink: 0;
}
.impact-rate-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.impact-rate-hint {
  font-size: 0.72rem;
  color: var(--dim);
  font-style: italic;
}
.impact-rate-track {
  flex: 1;
  min-width: 180px;
}
.impact-slider-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.impact-track-tick {
  font-size: 0.7rem;
  color: var(--dim);
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  flex-shrink: 0;
}
.impact-rate-adjuster .wage-cut-slider-input {
  flex: 1;
  height: 6px;
  accent-color: var(--accent);
  cursor: pointer;
}
.bonus-model-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 0.85rem;
  margin: 1rem 0;
}
.bonus-model-control {
  display: grid;
  grid-template-columns: minmax(140px, 0.7fr) minmax(190px, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}
.bonus-model-control input[type="range"] {
  flex: 1;
  height: 6px;
  accent-color: var(--accent);
  cursor: pointer;
}
.bonus-model-value {
  min-width: 5.4rem;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.8rem;
  box-shadow: 0 2px 8px rgba(17,155,160,0.22);
}
.bonus-model-value span {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.bonus-model-value small {
  font-size: 0.62rem;
  font-weight: 700;
  color: rgba(255,255,255,0.78);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.12rem;
  white-space: nowrap;
}
.bonus-model-value.compact span {
  font-size: 1.05rem;
}
.mini-input-row {
  display: grid;
  grid-template-columns: auto minmax(7rem, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
}
.mini-input-row input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  padding: 0.45rem 0.55rem;
  font-variant-numeric: tabular-nums;
}
.bonus-tier-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0 1rem;
}
.bonus-tier-strip > div,
.bonus-model-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 0.95rem;
  box-shadow: var(--shadow);
}
.bonus-tier-strip strong,
.bonus-model-kpi span {
  display: block;
  color: var(--dim);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}
.bonus-tier-strip span {
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.45;
}
.bonus-model-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.bonus-model-kpi strong {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.bonus-model-kpi strong.text-green { color: var(--green); }
.bonus-model-kpi strong.text-red { color: var(--red); }
.bonus-model-note {
  margin: 0.5rem 0 1rem;
}
.bonus-model-table .impact-stack {
  min-width: 170px;
}
.wage-move-stack {
  display: grid;
  gap: 0.26rem;
  min-width: 112px;
  text-align: left;
}
.wage-move-stack > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.55rem;
}
.wage-move-stack span {
  color: var(--dim);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wage-move-stack strong {
  color: var(--text);
  font-size: 0.82rem;
  white-space: nowrap;
}
.wage-move-stack strong.text-red { color: var(--red); }
.page-sop-section {
  margin-top: 1.1rem;
}
.sop-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
.sop-quick-grid > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0.9rem 1rem;
}
.sop-quick-grid strong {
  display: block;
  color: var(--text);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}
.sop-quick-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}
.family-note {
  border: 1px solid rgba(17,155,160,0.28);
  border-radius: 8px;
  background: rgba(17,155,160,0.08);
  color: var(--text);
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  line-height: 1.5;
}
.family-note strong,
.family-note span {
  display: block;
}
.family-note strong {
  margin-bottom: 0.25rem;
}
@media (max-width: 980px) {
  .bonus-model-controls,
  .bonus-tier-strip,
  .bonus-model-kpis,
  .sop-quick-grid {
    grid-template-columns: 1fr;
  }
  .bonus-model-control {
    grid-template-columns: 1fr;
  }
}
/* The value box — the big prominent display */
.impact-rate-value-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border-radius: 10px;
  padding: 0.45rem 1rem;
  min-width: 5.5rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(17,155,160,0.25);
}
.impact-rate-value-box .wage-cut-val-display {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.impact-rate-unit {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.1rem;
}
@media (max-width: 640px) {
  .impact-rate-adjuster { gap: 0.75rem; }
  .impact-rate-adjuster .wage-cut-slider-input { min-width: 0; }
  .impact-rate-value-box { min-width: 4rem; }
  .impact-rate-value-box .wage-cut-val-display { font-size: 1.2rem; }
}

/* ── Calculation Disclosure ──────────────────────────────────────────────────── */
.calc-disclosure {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.calc-disclosure-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  background: var(--surface2);
  list-style: none;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}
.calc-disclosure-toggle::-webkit-details-marker { display: none; }
.calc-disclosure[open] .calc-disclosure-toggle {
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}
.calc-disclosure-toggle:hover { background: var(--surface3); color: var(--accent); }
.calc-disclosure-body {
  padding: 1.25rem;
  background: var(--surface);
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.calc-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}
.calc-block-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.calc-block-formula {
  margin-bottom: 0.5rem;
}
.calc-block-formula code {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  background: rgba(17,155,160,0.08);
  border: 1px solid rgba(17,155,160,0.15);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  display: inline-block;
  color: var(--text);
}
.calc-block p {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

/* ── Verdict Badges ──────────────────────────────────────────────────────────── */
.verdict {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.verdict-good    { background: rgba(34,197,94,0.12);  color: #16a34a; border: 1px solid rgba(34,197,94,0.3); }
.verdict-ok      { background: rgba(34,197,94,0.07);  color: #15803d; border: 1px solid rgba(34,197,94,0.2); }
.verdict-caution { background: rgba(245,158,11,0.1);  color: #b45309; border: 1px solid rgba(245,158,11,0.3); }
.verdict-warn    { background: rgba(239,68,68,0.1);   color: #b91c1c; border: 1px solid rgba(239,68,68,0.25); }
.verdict-bad     { background: rgba(100,116,139,0.1); color: #263f47; border: 1px solid rgba(100,116,139,0.2); }
.verdict-na      { background: rgba(100,116,139,0.08);color: #263f47; border: 1px dashed rgba(100,116,139,0.25); }
.verdict-sched-label {
  font-size: 0.62rem;
  color: var(--dim);
  margin-left: 0.2rem;
  font-style: italic;
}

/* ── OT Risk Note in table ───────────────────────────────────────────────────── */
.ot-risk-note {
  font-size: 0.68rem;
  color: #b91c1c;
  margin-top: 0.2rem;
  font-style: italic;
}

/* ── Min wage floor badge ────────────────────────────────────────────────────── */
.badge-floor {
  background: rgba(245,158,11,0.1);
  color: #b45309;
  border: 1px solid rgba(245,158,11,0.3);
  font-size: 0.62rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-left: 0.3rem;
  font-weight: 600;
}

/* Side-by-side Opt-In comparison report */
.impact-stack {
  display: grid;
  gap: 0.28rem;
  min-width: 155px;
  text-align: left;
}
.impact-stack > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 0.18rem;
}
.impact-stack > div:last-child { border-bottom: 0; padding-bottom: 0; }
.impact-stack span {
  color: var(--dim);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.impact-stack strong { color: var(--text); white-space: nowrap; }
.impact-result {
  display: grid;
  gap: 0.22rem;
  min-width: 130px;
}
.impact-result span { color: var(--dim); font-size: 0.72rem; font-weight: 600; }
.scenario-compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.scenario-card {
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 8px;
  padding: 0.85rem;
}
.scenario-card h4 {
  margin: 0 0 0.7rem;
  color: var(--text);
  font-size: 0.9rem;
}
.scenario-card-result { border-color: rgba(17,155,160,0.35); }
@media (max-width: 900px) {
  .scenario-compare-grid { grid-template-columns: 1fr; }
}

/* Cleaner Opt-In comparison modal redesign */
.cleaner-detail-modal-box {
  width: min(1080px, calc(100vw - 24px));
  max-width: 1080px;
  max-height: calc(100vh - 24px);
  overflow: hidden;
}
.cleaner-detail-modal-box .modal-header {
  padding: 1.1rem 1.35rem 0.65rem;
  border-bottom: 1px solid var(--border);
}
.cleaner-detail-modal-box .modal-body {
  padding: 1rem 1.35rem;
  overflow-y: auto;
  min-height: 0;
}
.cleaner-detail-modal-box .modal-footer {
  padding: 0.8rem 1.35rem 1rem;
}
.compare-report { display: grid; gap: 0.9rem; }
.compare-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.compare-person {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.compare-verdict {
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}
.compare-verdict.good { background: rgba(22,163,74,0.12); color: var(--green); }
.compare-verdict.review { background: rgba(245,158,11,0.14); color: var(--accent2); }
.compare-note {
  border: 1px solid rgba(17,155,160,0.2);
  background: rgba(17,155,160,0.07);
  border-radius: 8px;
  padding: 0.8rem 0.9rem;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.45;
}
.compare-note strong { color: var(--text); }
.compare-delta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}
.compare-delta-card {
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 8px;
  padding: 0.75rem;
  min-width: 0;
}
.compare-delta-card.good { border-color: rgba(22,163,74,0.28); }
.compare-delta-card.bad { border-color: rgba(239,68,68,0.28); }
.compare-delta-card span,
.compare-delta-card small {
  display: block;
  color: var(--dim);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.compare-delta-card strong {
  display: block;
  color: var(--text);
  font-size: 1.05rem;
  margin: 0.22rem 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.compare-delta-card.good strong { color: var(--green); }
.compare-delta-card.bad strong { color: var(--red); }
.compare-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
.compare-panel {
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 8px;
  padding: 0.9rem;
  min-width: 0;
}
.compare-panel.current { border-color: rgba(148,163,184,0.22); }
.compare-panel.schedule { border-color: rgba(17,155,160,0.28); }
.compare-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.65rem;
}
.compare-panel-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
}
.compare-panel-head span {
  color: var(--dim);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: right;
}
.compare-rows { display: grid; gap: 0.32rem; }
.compare-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: baseline;
  gap: 0.8rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.compare-row:last-child { border-bottom: 0; }
.compare-row span {
  color: var(--dim);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  min-width: 0;
}
.compare-row strong {
  color: var(--text);
  font-size: 0.93rem;
  white-space: nowrap;
  text-align: right;
}
.compare-section-title {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 0.1rem;
}
.compare-daily-table { min-width: 760px; }
@media (max-width: 820px) {
  .cleaner-detail-modal-box {
    width: calc(100vw - 10px);
    max-height: calc(100vh - 10px);
    border-radius: 10px;
  }
  .cleaner-detail-modal-box .modal-header,
  .cleaner-detail-modal-box .modal-body,
  .cleaner-detail-modal-box .modal-footer {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }
  .compare-hero { align-items: flex-start; flex-direction: column; }
  .compare-delta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compare-panels { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .compare-delta-grid { grid-template-columns: 1fr; }
  .compare-panel-head { display: block; }
  .compare-panel-head span { display: block; text-align: left; margin-top: 0.2rem; }
  .compare-row { grid-template-columns: minmax(0, 1fr); gap: 0.12rem; }
  .compare-row strong { text-align: left; }
}
