/* Jinjer Fuel — shared visual language.
   Tokens and component classes are deliberately matched to the ACTUAL
   Jinjer production frontend (apps/frontend-web in the jinjerSales repo:
   its Layout.tsx app shell, WaAnalyticsDashboard KPI/card grammar,
   AgentLeaderboardView podium/table/segmented-control patterns, and
   IntelligenceHealthPage status-badge convention) -- not approximated
   from screenshots, and not modelled on any other internal tool. Values
   below are the same Tailwind slate/indigo/emerald/amber/red palette
   that frontend actually ships. No framework dependency -- plain CSS,
   matching this app's existing lightweight, no-build stack. */

:root {
  /* Interactive / primary -- indigo, not teal */
  --primary: #4f46e5;        /* indigo-600 */
  --primary-hover: #4338ca;  /* indigo-700 */
  --primary-soft: #eef2ff;   /* indigo-50 */
  --primary-soft-border: #e0e7ff; /* indigo-100 */
  --primary-border: #c7d2fe; /* indigo-200 */
  --primary-ring: #e0e7ff;   /* indigo-100, focus ring */
  --primary-text: #4338ca;   /* indigo-700 */

  /* Status */
  --success: #059669;        /* emerald-600 */
  --success-text: #047857;   /* emerald-700 */
  --success-soft: #d1fae5;   /* emerald-100 */
  --success-soft-bg: #ecfdf5;/* emerald-50 */
  --warning: #d97706;        /* amber-600 */
  --warning-text: #b45309;   /* amber-700 */
  --warning-soft: #fef3c7;   /* amber-100 */
  --warning-soft-bg: #fffbeb;/* amber-50 */
  --danger: #dc2626;         /* red-600 */
  --danger-text: #b91c1c;    /* red-700 */
  --danger-soft: #fee2e2;    /* red-100 */
  --danger-soft-bg: #fef2f2; /* red-50 */
  --neutral-text: #64748b;   /* slate-500 */
  --neutral-soft: #f1f5f9;   /* slate-100 */

  /* Neutrals */
  --ink: #0f172a;      /* slate-900 */
  --ink-soft: #475569;  /* slate-600 */
  --label: #64748b;     /* slate-500 */
  --border: #e2e8f0;    /* slate-200 */
  --border-strong: #cbd5e1; /* slate-300 */
  --surface: #f8fafc;   /* slate-50 */
  --white: #ffffff;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 10px 15px -3px rgba(199, 210, 254, 0.4), 0 4px 6px -4px rgba(199, 210, 254, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(226, 232, 240, 0.4), 0 8px 10px -6px rgba(226, 232, 240, 0.3);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------------------------------------------------------------- shell */

.app-shell {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(to bottom right, #f1f5f9, rgba(238, 242, 255, 0.4) 45%, rgba(253, 244, 255, 0.4));
}

.sidebar {
  width: 256px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.9);
  border-right: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 4px 0 24px rgba(199, 210, 254, 0.18);
  backdrop-filter: blur(6px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}
.brand-mark {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--primary); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 16px; height: 16px; }
.brand-name { font-weight: 700; font-size: 15px; color: var(--ink); letter-spacing: -0.01em; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 0; }

/* Context hierarchy in the sidebar: Network stands alone; the second
   group is everything belonging to the currently selected Site, with its
   own live heading, then a lighter sub-label for the supporting
   Operational workspaces beneath the two primary Site Workspaces. */
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-group + .nav-group { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.nav-group-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--label); padding: 4px 12px 2px; margin-top: 14px;
}
.nav-group-label:first-child { margin-top: 0; }
.nav-site-heading {
  display: flex; align-items: center; gap: 7px;
  padding: 2px 12px 10px; font-size: 12px; font-weight: 700; color: var(--primary-text);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.nav-site-heading svg { width: 13px; height: 13px; flex-shrink: 0; }

.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 13.5px; font-weight: 500;
  background: transparent; color: var(--ink-soft);
  cursor: pointer; text-align: left; transition: background 0.12s ease, color 0.12s ease;
}
.sidebar-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-link:hover { background: var(--neutral-soft); color: #1e293b; }
.sidebar-link.active { background: var(--primary-soft); color: var(--primary-text); border-color: var(--primary-soft-border); box-shadow: var(--shadow-sm); }
.sidebar-link .nav-count {
  margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: var(--white); font-size: 10px; font-weight: 700;
}
.sidebar-link.active .nav-count { background: var(--primary); }

.main-column { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  min-height: 64px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; row-gap: 8px;
  padding: 12px 24px;
  gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; row-gap: 6px; }
.topbar-build { font-size: 12px; color: #6b7280; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; row-gap: 6px; }
.topbar-station { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.topbar-station > span {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--label);
}
.topbar-user-email { font-size: 13px; color: #374151; white-space: nowrap; }

.app-main { flex: 1; overflow-y: auto; padding: 28px 24px; }
.app-main-inner { max-width: 1280px; margin: 0 auto; width: 100%; }

.page-header { margin-bottom: 20px; }
.page-eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--label); margin: 0 0 4px; }
.page-title { font-size: 24px; font-weight: 700; color: var(--ink); margin: 0; letter-spacing: -0.01em; }
.page-description { font-size: 13.5px; color: var(--ink-soft); margin: 4px 0 0; }

.hero {
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  margin-bottom: 20px;
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.hero .page-eyebrow { color: rgba(255,255,255,0.7); }
.hero .page-title { color: var(--white); }
.hero .page-description { color: rgba(255,255,255,0.82); }

/* -------------------------------------------------------------- cards */

.card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-header h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.card-header .card-header-sub { font-size: 12px; color: var(--label); margin-top: 2px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1100px) { .grid-5, .grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------- kpi */

.kpi-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--primary-soft-border);
  border-radius: var(--radius-lg);
  padding: 16px; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 2px;
}
.kpi-label { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; color: var(--label); }
.kpi-value { font-size: 22px; font-weight: 600; color: var(--ink); line-height: 1.2; margin-top: 6px; }
.kpi-sub { font-size: 11.5px; color: var(--label); margin-top: 3px; }
.kpi-card.tone-warning { border-color: #fde68a; background: var(--warning-soft-bg); }
.kpi-card.tone-warning .kpi-value { color: var(--warning-text); }
.kpi-card.tone-danger .kpi-value { color: var(--danger-text); }
.kpi-card.tone-success .kpi-value { color: var(--success-text); }

/* -------------------------------------------------------------- badges */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 4px 11px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: var(--success-text); }
.badge-warning { background: var(--warning-soft); color: var(--warning-text); }
.badge-danger { background: var(--danger-soft); color: var(--danger-text); }
.badge-neutral { background: var(--neutral-soft); color: var(--neutral-text); }
.badge-accent { background: var(--primary-soft); color: var(--primary-text); }
.badge-primary { background: var(--primary-soft); color: var(--primary-text); }

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius); border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; padding: 9px 18px; height: 40px;
  cursor: pointer; transition: transform 0.05s ease, background 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--primary); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:disabled { background: var(--primary-border); }
.btn-secondary { background: var(--white); border-color: var(--border); color: #334155; box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background: var(--surface); }
.btn-danger { background: var(--danger-soft); color: var(--danger-text); border-color: #fecaca; }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: var(--white); }
.btn-ghost { background: transparent; color: var(--primary-text); border-color: var(--primary-border); }
.btn-ghost:hover:not(:disabled) { background: var(--primary-soft); }
.btn-sm { padding: 6px 13px; height: 32px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* --------------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 160px; }
label.field-label, .field-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--label);
}
.input, input.input, select.input, textarea.input {
  width: 100%;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 9px 13px; font-size: 13.5px; color: var(--ink); background: var(--white);
  font-family: inherit; box-shadow: var(--shadow-sm);
}
.input:focus { outline: none; border-color: var(--primary-border); box-shadow: 0 0 0 3px var(--primary-ring); }
.input::placeholder { color: #94a3b8; }
.hint { font-size: 12px; color: var(--label); margin-top: 4px; }
.hint-warning { color: var(--warning-text); }

.select, select.select {
  appearance: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 8px center;
  padding: 8px 30px 8px 12px;
  font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer;
}
.select:focus, select.select:focus { outline: none; border-color: var(--primary-border); box-shadow: 0 0 0 3px var(--primary-ring); }

/* -------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table thead tr { background: var(--surface); }
table.table th {
  text-align: left; padding: 11px 16px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--label);
  border-bottom: 1px solid var(--border);
}
table.table td { padding: 13px 16px; border-bottom: 1px solid #f1f5f9; color: var(--ink); vertical-align: middle; }
table.table tbody tr:last-child td { border-bottom: none; }
table.table tbody tr.clickable { cursor: pointer; }
table.table tbody tr.clickable:hover { background: var(--surface); }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- empty */

.empty-state { padding: 40px 20px; text-align: center; color: var(--label); }
.empty-state svg { width: 30px; height: 30px; color: #cbd5e1; margin-bottom: 10px; }
.empty-state .empty-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.empty-state .empty-detail { font-size: 12px; }

.loading-state { padding: 30px; text-align: center; color: var(--label); font-size: 13px; }

/* --------------------------------------------------------- status dot */

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-right: 6px; flex-shrink: 0; }
.status-dot.success { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.danger { background: var(--danger); }
.status-dot.neutral { background: var(--neutral-text); }

/* ------------------------------------------------------------ checklist */

.checklist { display: flex; flex-direction: column; gap: 2px; }
.checklist-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 4px; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.checklist-item:last-child { border-bottom: none; }
.checklist-icon { width: 20px; height: 20px; border-radius: 999px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.checklist-icon.done { background: var(--success-soft); color: var(--success-text); }
.checklist-icon.pending { background: var(--warning-soft); color: var(--warning-text); }
.checklist-icon svg { width: 12px; height: 12px; }
.checklist-text { color: var(--ink); }
.checklist-item.done .checklist-text { color: var(--label); text-decoration: line-through; text-decoration-color: #cbd5e1; }

/* ------------------------------------------------ operating day command centre */

.od-status-panel .od-status-headline { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 9px; color: var(--ink); }
.od-status-panel .od-status-headline svg { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.od-status-panel .od-status-sub { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.od-status-meta { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.od-status-meta .field-label { display: block; margin-bottom: 4px; }
.od-status-meta > div > div:last-child { font-size: 13.5px; font-weight: 600; color: var(--ink); }

.od-close-panel.tone-ready { border-color: #a7f3d0; background: var(--success-soft-bg); }
.od-close-panel.tone-ready .od-status-headline svg { color: var(--success); }
.od-close-panel.tone-blocked { border-color: #fde68a; background: var(--warning-soft-bg); }
.od-close-panel.tone-blocked .od-status-headline svg { color: var(--warning); }

.od-timeline { display: flex; flex-direction: column; }
.od-timeline-row { display: flex; gap: 14px; padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.od-timeline-row:last-child { border-bottom: none; }
.od-timeline-time { flex-shrink: 0; width: 56px; font-variant-numeric: tabular-nums; color: var(--label); font-weight: 600; }
.od-timeline-text { color: var(--ink); }

/* --------------------------------------------------------- fuel gauge */

.fuel-gauge { height: 8px; border-radius: 999px; background: var(--neutral-soft); overflow: hidden; }
.fuel-gauge-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.2s ease; }
.fuel-gauge-fill.tone-warning { background: var(--warning); }
.fuel-gauge-fill.tone-danger { background: var(--danger); }

/* -------------------------------------------------------------- toast */

.toast-stack { position: fixed; top: 16px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast {
  border-radius: var(--radius); padding: 12px 14px; font-size: 13px; box-shadow: var(--shadow-lg);
  border: 1px solid transparent;
}
.toast-success { background: var(--success-soft-bg); color: var(--success-text); border-color: #a7f3d0; }
.toast-error { background: var(--danger-soft-bg); color: var(--danger-text); border-color: #fecaca; }
.toast-info { background: var(--primary-soft); color: var(--primary-text); border-color: var(--primary-soft-border); }

/* -------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 15px; font-weight: 700; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--label); padding: 4px; border-radius: var(--radius-sm); display: flex; }
.icon-btn:hover { background: var(--neutral-soft); }
.icon-btn svg { width: 18px; height: 18px; }

/* --------------------------------------------------------------- misc */

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--ink-soft); }
.text-sm { font-size: 12px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.tag-strip { display: flex; gap: 6px; flex-wrap: wrap; }

.callout {
  border-radius: var(--radius); padding: 13px 16px; font-size: 13px;
  border: 1px solid var(--border); background: var(--neutral-soft); color: var(--ink);
  display: flex; gap: 10px; align-items: flex-start;
}
.callout svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.callout-warning { background: var(--warning-soft-bg); border-color: #fde68a; color: var(--warning-text); }
.callout-danger { background: var(--danger-soft-bg); border-color: #fecaca; color: var(--danger-text); }
.callout-accent { background: var(--primary-soft); border-color: var(--primary-soft-border); color: var(--primary-text); }

.shift-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 15px 17px;
  background: var(--white); cursor: pointer; transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.shift-card:hover { border-color: var(--primary-border); }
.shift-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.shift-card .shift-name { font-weight: 600; font-size: 14px; }
.shift-card .shift-meta { font-size: 12px; color: var(--label); margin-top: 3px; }

.tank-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 17px; background: var(--white); }
.tank-card .tank-name { font-weight: 600; font-size: 14px; }
.tank-card .tank-grade { font-size: 12px; color: var(--label); }

.delivery-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 15px 17px; background: var(--white);
}
.delivery-card.flagged { background: #fef2f2; border-color: #fecaca; }

.recon-leg-card { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--white); box-shadow: var(--shadow-sm); }
.recon-leg-head { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.recon-leg-head h4 { margin: 0; font-size: 13.5px; font-weight: 600; }
.recon-leg-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; }
.recon-primary-figure { font-size: 28px; font-weight: 700; color: var(--ink); margin-bottom: 10px; letter-spacing: -0.01em; }
.recon-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; }
.recon-row .recon-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.recon-leg-card.tone-success { border-top: 3px solid var(--success); }
.recon-leg-card.tone-warning { border-top: 3px solid var(--warning); }
.recon-leg-card.tone-danger { border-top: 3px solid var(--danger); }
.recon-leg-card.tone-neutral { border-top: 3px solid var(--border-strong); }

/* ------------------------------------------------------- segmented control */

.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; gap: 2px; }
.segmented-option {
  border: none; background: transparent; border-radius: var(--radius-sm);
  padding: 7px 14px; font-size: 12.5px; font-weight: 500; color: var(--label); cursor: pointer;
}
.segmented-option.active { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); }

/* --------------------------------------------------- correction chain */
/* Communicates immutability visually, not just technically: the original
   fact is always the first, permanent step -- nothing here ever implies
   it was overwritten, only that later steps were appended after it. */
.correction-chain { display: flex; align-items: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.correction-chain-step { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--label); white-space: nowrap; }
.correction-chain-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--border-strong); flex-shrink: 0; }
.correction-chain-step.done { color: var(--ink-soft); }
.correction-chain-step.done .correction-chain-dot { background: var(--success); }
.correction-chain-step.current { color: var(--primary-text); font-weight: 600; }
.correction-chain-step.current .correction-chain-dot { background: var(--primary); }
.correction-chain-step.danger .correction-chain-dot { background: var(--danger); }
.correction-chain-step.danger { color: var(--danger-text); }
.correction-chain-arrow { color: var(--border-strong); font-size: 11px; }
.correction-reopen { border-left: 3px solid var(--danger); }

.pill-tab {
  border: 1px solid var(--border); background: var(--white); color: var(--ink-soft);
  border-radius: 999px; padding: 7px 16px; font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.pill-tab.active { border-color: var(--primary-border); background: var(--primary); color: var(--white); box-shadow: var(--shadow-sm); }

/* --------------------------------------------------- mission control */

.site-status-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 14px 4px; border-bottom: 1px solid var(--border); cursor: pointer;
  border-radius: var(--radius-sm); transition: background 0.12s ease;
}
.site-status-row:last-child { border-bottom: none; }
.site-status-row:hover { background: var(--surface); }
.site-status-row svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--border-strong); align-self: center; }
.site-status-name { font-weight: 600; font-size: 13.5px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.site-status-frags { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.site-status-emoji { font-size: 14px; line-height: 1; }
.site-status-row.tone-danger { border-left: 3px solid var(--danger); padding-left: 11px; }
.site-status-row.tone-warning { border-left: 3px solid var(--warning); padding-left: 11px; }

/* Exception-driven rows: used wherever Mission Control pulls out the few
   items that need eyes (a flagged delivery, a low tank, a compliance
   callout) from a larger, otherwise-collapsed set. */
.mc-flag-row { border-radius: var(--radius-sm); padding: 10px 12px; }
.mc-flag-row.tone-danger { background: var(--danger-soft-bg); border: 1px solid #fecaca; }
.mc-flag-row.tone-warning { background: var(--warning-soft-bg); border: 1px solid #fde68a; }
.mc-flag-row svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--label); }

.severity-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.05s ease;
  display: flex; flex-direction: column; gap: 2px;
}
.severity-card:hover { border-color: var(--primary-border); box-shadow: var(--shadow-card); }
.severity-card:active { transform: translateY(1px); }
.severity-card .kpi-value { margin-top: 6px; }
.severity-card.tone-empty { opacity: 0.55; cursor: default; }
.severity-card.tone-empty:hover { border-color: var(--border); box-shadow: var(--shadow-sm); }
.severity-card.tone-danger { border-top: 3px solid var(--danger); }
.severity-card.tone-warning { border-top: 3px solid var(--warning); }
.severity-card.tone-neutral { border-top: 3px solid var(--border-strong); }

.queue-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 4px; border-bottom: 1px solid var(--border);
}
.queue-row:last-child { border-bottom: none; }
.queue-row-main { min-width: 0; }
.queue-row-title { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.queue-row-detail { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }

.queue-group-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--label); margin: 18px 0 4px; padding: 0 4px;
}
.queue-group-label:first-child { margin-top: 0; }

.tank-health-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--border); font-size: 12.5px;
}
.tank-health-row:last-child { border-bottom: none; }
.tank-health-station { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--label); margin: 16px 0 2px; padding: 0 4px; }
.tank-health-station:first-child { margin-top: 0; }

/* ------------------------------------------------------ sign-in screen */

.sign-in-screen {
  min-height: 100vh;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 20px;
  background: linear-gradient(180deg, var(--surface) 0%, #eef1f8 100%);
}
.sign-in-panel {
  width: 100%; max-width: 880px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px 36px 40px;
}
.sign-in-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; color: var(--ink);
}
.sign-in-brand svg { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.sign-in-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.sign-in-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}
