:root {
  --navy: #0a1c3d;
  --navy-active: #1a4d8c;
  --blue: #1f4e79;
  --accent: #0d6efd;
  --ink: #0d1829;
  --muted: #4b5563;
  --line: #c5ced9;
  --surface: #dfe6ef;
  --white: #eef2f7;
  --card: #f7f9fc;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #dc2626;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* TOP NAV — single thin row (left rail removed) */
.sidebar {
  width: 100%;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  z-index: 120;
  overflow: hidden;
}
.sidebar-brand {
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-brand-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  width: auto;
}
.corp-logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  background: transparent;
}
.brand-text strong { font-size: 13px; display: block; font-weight: 700; letter-spacing: -0.01em; line-height: 1; }
.brand-text small { display: none; }
.sidebar-brand strong { font-size: 13px; display: block; font-weight: 700; letter-spacing: -0.01em; line-height: 1; }
.sidebar-brand small { display: none; }
.sidebar nav {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  flex: 1;
  min-width: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 0;
  scrollbar-width: none;
}
.sidebar nav::-webkit-scrollbar { display: none; }
.sidebar nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px;
  margin-bottom: 0;
  color: rgba(255,255,255,0.92);
  text-decoration: none;
  font-size: 12.5px;
  border-radius: 6px;
  position: relative;
  white-space: nowrap;
}
.sidebar nav a svg { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.95; }
.sidebar nav a:hover { background: rgba(255,255,255,0.08); }
.sidebar nav a.active {
  background: var(--navy-active);
  font-weight: 600;
}
.sidebar-footer {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  border-top: none;
  border-left: 1px solid rgba(255,255,255,0.12);
  padding: 0 0 0 8px;
  margin: 0;
  flex-shrink: 0;
  font-size: 12.5px;
}
.user-card { display: flex; gap: 6px; align-items: center; }
.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--navy-active);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 10px; flex-shrink: 0;
}
.user-card .user {
  font-weight: 700;
  font-size: 12px;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-card .role,
.user-card .site-status,
.last-login { display: none; }
.signout {
  display: flex; align-items: center; gap: 0;
  margin-top: 0;
  color: rgba(255,255,255,0.85);
  font-size: 0;
  text-decoration: none;
  padding: 4px;
}
.signout svg { width: 14px; height: 14px; }
.signout:hover { color: #fff; }

/* MAIN */
.main { margin-left: 0; width: 100%; flex: 1; min-height: 0; }

.topbar {
  position: relative;
  background:
    linear-gradient(105deg, rgba(31, 78, 121, 0.16) 0%, rgba(13, 110, 253, 0.08) 38%, transparent 68%),
    linear-gradient(180deg, #d7e6f6 0%, #e8f0f9 55%, #eef3f9 100%);
  border-bottom: 1px solid #9bb8d9;
  box-shadow: inset 0 3px 0 0 #1f4e79;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 0;
}
.topbar h1 {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--navy);
  line-height: 1.2;
}
.top-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12.5px;
}
.top-tools .sep { color: #c5c9d1; }
.bell {
  position: relative;
  width: 30px; height: 30px;
  border: none;
  border-radius: 7px;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--navy);
}
.bell .dot {
  position: absolute; top: 2px; right: 2px;
  min-width: 14px; height: 14px;
  padding: 0 3px;
  background: #2563eb;
  color: #fff;
  font-size: 9px; font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.content { padding: 14px 20px 36px; }

.info-banner {
  background: #d5e4f5;
  border: 1px solid #9bb8d9;
  color: #0f2f5c;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-banner.danger {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #7f1d1d;
}
.info-banner.danger .info-i {
  background: #dc2626;
}
.info-banner.filter-banner {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}
.info-i {
  width: 16px; height: 16px; border-radius: 50%;
  background: #0d6efd; color: #fff;
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.alert-inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 4px;
}
.alert-inline a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sla-over { color: #b91c1c; font-weight: 700; }
tr.row-alert td { background: rgba(239, 68, 68, 0.06); }
tr.row-selected td { background: rgba(37, 99, 235, 0.08); }

/* KPI CARDS */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 11px;
  margin-bottom: 15px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  border-left: 4px solid transparent;
}
.stat.glow-amber,
.stat.glow-purple,
.stat.glow-blue,
.stat.glow-red,
.stat.glow-green {
  background: var(--card);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.stat.glow-amber { border-left-color: #f59e0b; }
.stat.glow-purple { border-left-color: #8b5cf6; }
.stat.glow-blue { border-left-color: #2563eb; }
.stat.glow-red { border-left-color: #ef4444; }
.stat.glow-green { border-left-color: #10b981; }
/* Soft left-border glow only on mouseover */
.stat.glow-amber:hover,
a.stat.glow-amber:hover {
  border-color: var(--line);
  border-left-color: #f59e0b;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.32), 0 1px 3px rgba(15, 23, 42, 0.06);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16), var(--card) 48%);
}
.stat.glow-purple:hover,
a.stat.glow-purple:hover {
  border-color: var(--line);
  border-left-color: #8b5cf6;
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.32), 0 1px 3px rgba(15, 23, 42, 0.06);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.16), var(--card) 48%);
}
.stat.glow-blue:hover,
a.stat.glow-blue:hover {
  border-color: var(--line);
  border-left-color: #2563eb;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.32), 0 1px 3px rgba(15, 23, 42, 0.06);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.16), var(--card) 48%);
}
.stat.glow-red:hover,
a.stat.glow-red:hover {
  border-color: var(--line);
  border-left-color: #ef4444;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.32), 0 1px 3px rgba(15, 23, 42, 0.06);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.16), var(--card) 48%);
}
.stat.glow-green:hover,
a.stat.glow-green:hover {
  border-color: var(--line);
  border-left-color: #10b981;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.32), 0 1px 3px rgba(15, 23, 42, 0.06);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.16), var(--card) 48%);
}
.stat-top { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-icon {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 12px; height: 12px; }
.stat-icon.blue { background: #e8f1fc; color: #0d6efd; }
.stat-icon.green { background: #e8f6ee; color: #198754; }
.stat-icon.orange { background: #fff4e5; color: #e67e22; }
.stat-icon.red { background: #fdecea; color: #dc3545; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat .label { font-size: 10px; color: var(--muted); font-weight: 600; }
.stat .value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--navy);
  margin-top: 2px;
}
.delta { font-size: 9px; font-weight: 600; margin-top: 5px; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }
.delta.up::before { content: "↑ "; }
.delta.down::before { content: "↓ "; }

.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.topbar .hero-actions .btn {
  padding: 5px 10px;
  font-size: 12px;
}
.topbar .meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  max-width: 560px;
  line-height: 1.3;
}

.site-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.site-tabs a {
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
  background: transparent;
}
.site-tabs a:hover { background: rgba(15, 23, 42, 0.06); color: var(--navy); }
.site-tabs a.active {
  background: #dbe7f8;
  color: #0b4db8;
  border-color: #a8c0e0;
}

a.stat {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
/* Default link hover — skipped for glow-* cards (see .stat.glow-*:hover above) */
a.stat:not([class*="glow-"]):hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(13,110,253,0.08);
}
a.stat.stat-selected {
  border-color: #0d6efd;
  box-shadow: 0 0 0 2px rgba(13,110,253,0.15);
}
/* Selected: ring only — colored glow still hover-only */
a.stat.stat-selected.glow-amber,
a.stat.stat-selected.glow-purple,
a.stat.stat-selected.glow-blue,
a.stat.stat-selected.glow-red,
a.stat.stat-selected.glow-green {
  background: var(--card);
  box-shadow: 0 0 0 2px rgba(13,110,253,0.15);
}
a.stat.stat-selected.glow-amber { border-left-color: #f59e0b; }
a.stat.stat-selected.glow-purple { border-left-color: #8b5cf6; }
a.stat.stat-selected.glow-blue { border-left-color: #2563eb; }
a.stat.stat-selected.glow-red { border-left-color: #ef4444; }
a.stat.stat-selected.glow-green { border-left-color: #10b981; }
a.stat.stat-selected.glow-amber:hover {
  border-left-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(13,110,253,0.15), 0 4px 18px rgba(245, 158, 11, 0.34);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16), var(--card) 48%);
}
a.stat.stat-selected.glow-purple:hover {
  border-left-color: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(13,110,253,0.15), 0 4px 18px rgba(139, 92, 246, 0.34);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.16), var(--card) 48%);
}
a.stat.stat-selected.glow-blue:hover {
  border-left-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(13,110,253,0.15), 0 4px 18px rgba(37, 99, 235, 0.34);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.16), var(--card) 48%);
}
a.stat.stat-selected.glow-red:hover {
  border-left-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(13,110,253,0.15), 0 4px 18px rgba(239, 68, 68, 0.34);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.16), var(--card) 48%);
}
a.stat.stat-selected.glow-green:hover {
  border-left-color: #10b981;
  box-shadow: 0 0 0 2px rgba(13,110,253,0.15), 0 4px 18px rgba(16, 185, 129, 0.34);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.16), var(--card) 48%);
}

.queue-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-chips .chip {
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  text-decoration: none;
  border: 1px solid transparent;
  font-size: 12px;
}
.filter-chips .chip:hover { background: #e2e8f0; }
.filter-chips .chip.on {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}
.queue-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  min-width: min(100%, 420px);
  flex: 1;
  max-width: 560px;
}
.queue-search svg { color: var(--muted); flex-shrink: 0; }
.queue-search input[type="search"] {
  flex: 1;
  border: none;
  outline: none;
  font: inherit;
  font-size: 13px;
  min-width: 0;
}
.search-by {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 8px;
  flex-shrink: 0;
  max-width: 120px;
}
.search-bar .search-by {
  max-width: 140px;
  padding: 6px 10px;
  font-size: 13px;
}
.cell-strong { font-weight: 600; color: var(--ink); }
.cell-muted { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.table-footer {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

/* TABLE */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  padding: 12px 14px;
  background: #e8edf4;
  font-weight: 600;
  font-size: 12px;
  color: #334155;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
  background: var(--card);
}
tr:hover td { background: #e4ebf4; }
tr:last-child td { border-bottom: none; }
.case-link { color: #0d6efd; font-weight: 600; text-decoration: none; }
.case-link:hover { text-decoration: underline; }
.col-check { width: 36px; text-align: center; }
.col-check input { accent-color: #0d6efd; width: 15px; height: 15px; }
.th-sort::after { content: " ↕"; font-size: 10px; opacity: 0.35; }
.th-sort.active::after { content: " ↓"; opacity: 0.7; }

/* PILLS — mockup */
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-open { background: #fef3c7; color: #92400e; }
.pill-transit { background: #dbeafe; color: #1e40af; }
.pill-received { background: #d1fae5; color: #065f46; }
.pill-exception { background: #fee2e2; color: #991b1b; }
.pill-review { background: #ede9fe; color: #5b21b6; }
.pill-hold { background: #e5e7eb; color: #374151; }
.pill-new { background: #eef0f3; color: #495057; }
.pill-progress { background: #dbeafe; color: #1d4ed8; }
.pill-pending { background: #d1fae5; color: #047857; }
.pill-overdue { background: #fee2e2; color: #b91c1c; }
.pri-high { background: #fdecea; color: #c0392b; font-weight: 700; }
.pri-med { background: #fff4e5; color: #c47b17; font-weight: 700; }
.pri-low { background: #e8f6ee; color: #1e7e4a; font-weight: 700; }

.chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin: 2px 2px 2px 0;
  background: #ede9fe;
  color: #5b21b6;
}
.chip.blue { background: #dbeafe; color: #1e40af; }
.chip.amber { background: #fef3c7; color: #92400e; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #163a5f; }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: #e2e8f0; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-create { background: #059669; color: #fff; }
.btn-create:hover { background: #047857; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font: inherit;
  font-size: 14px;
}
.search-bar svg { color: var(--muted); }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(16,24,40,0.06);
}
.panel h3 {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 12px;
}

.case-bar {
  background: var(--navy);
  color: #fff;
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.case-bar-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.case-back {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.case-back:hover { color: #fff; }
.case-bar .id {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}
.case-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
}
.case-bar .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.case-bar .actions form.inline { display: inline; margin: 0; }

.case-stepper {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px 10px;
}
.case-stepper-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.case-step {
  flex: 1;
  min-width: 100px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
}
.case-step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
}
.case-step.done { color: #047857; }
.case-step.done .case-step-dot { background: #10b981; }
.case-step.current { color: var(--navy); }
.case-step.current .case-step-dot {
  background: #0d6efd;
  box-shadow: 0 0 0 3px #dbeafe;
}
.case-step.upcoming .case-step-label { opacity: 0.75; }

.whats-next {
  margin: 16px 28px 0;
  padding: 14px 16px;
  background: #eef6ff;
  border: 1px solid #bfd4f2;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.whats-next-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1a4d8c;
  margin-bottom: 4px;
}
.whats-next p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink);
  max-width: 640px;
  line-height: 1.4;
}

.case-tabs {
  list-style: none;
  margin: 16px 28px 0;
  padding: 0;
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
}
.case-tabs a {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.case-tabs a:hover { color: var(--navy); }
.case-tabs a.active {
  color: #0d6efd;
  border-bottom-color: #0d6efd;
}

.muted-note { color: var(--muted); font-size: 13px; margin: 0; line-height: 1.45; }
.ext-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.tab-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.check-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink);
}
.note-area {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 100px;
}
.fedex-label { font-size: 12px; color: #6b7280; }
.fedex-actions { display: flex; gap: 8px; margin-top: 12px; }
.btn-solid {
  background: #fff;
  color: var(--navy);
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.btn-solid:hover {
  background: #f1f5f9;
  color: var(--navy);
}
.btn-solid:disabled {
  opacity: 0.55;
  cursor: default;
}
.btn-light {
  background: rgba(255,255,255,0.12); color: #fff;
  border: 1px solid rgba(255,255,255,0.28);
  padding: 8px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: none;
}
.btn-light:hover { background: rgba(255,255,255,0.22); }

.case-layout {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 20px;
  padding: 22px 28px 48px;
}
.timeline-item {
  display: flex;
  gap: 14px;
  padding-bottom: 18px;
  position: relative;
}
.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.timeline-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 13px; font-weight: 700; color: #fff;
}
.timeline-icon.email { background: #2563eb; }
.timeline-icon.claude { background: #7c3aed; }
.timeline-icon.dock { background: #059669; }
.timeline-icon.fedex { background: #6d28d9; }
.timeline-icon.status { background: #0d6efd; }
.timeline-icon.system { background: #334155; }
.timeline-icon.note { background: #64748b; }
.timeline-body .when { font-size: 11.5px; color: var(--muted); }
.timeline-body .title { font-weight: 600; margin: 2px 0; }
.timeline-body .desc { font-size: 13px; color: var(--muted); }

.fedex-card {
  border: 1px solid #ddd6fe;
  background: #f5f3ff;
  border-radius: 8px;
  padding: 14px;
}
.fedex-card .tracking {
  font-size: 16px;
  font-weight: 700;
  color: #4c1d95;
  margin: 6px 0;
}
.progress {
  display: flex;
  justify-content: space-between;
  margin: 14px 0 6px;
  position: relative;
}
.progress::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 8%;
  right: 8%;
  height: 3px;
  background: #ddd6fe;
  z-index: 0;
}
.progress-step {
  text-align: center;
  font-size: 10.5px;
  color: var(--muted);
  z-index: 1;
  position: relative;
}
.progress-step .dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #ddd6fe;
  margin: 0 auto 4px;
  border: 2px solid #fff;
}
.progress-step.done .dot,
.progress-step.current .dot { background: #7c3aed; }
.progress-step.current .dot { box-shadow: 0 0 0 3px #ddd6fe; }

.fedex-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.fedex-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6d28d9;
}
.fedex-api-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.fedex-api-badge.pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.fedex-api-badge.ready {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}
.fedex-status-line {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--ink);
}
.fedex-scans {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  border-top: 1px solid #ddd6fe;
}
.fedex-scans li {
  padding: 8px 0;
  border-bottom: 1px solid #ede9fe;
}
.fedex-scans li:last-child { border-bottom: none; }
.fedex-scans .scan-when {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.fedex-scans .scan-desc {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.fedex-scans .scan-loc {
  font-size: 12px;
  color: var(--muted);
}
.fedex-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

html[data-theme="dark"] .fedex-card {
  background: #1e1b4b;
  border-color: #4c1d95;
}
html[data-theme="dark"] .fedex-card .tracking { color: #c4b5fd; }
html[data-theme="dark"] .fedex-scans { border-top-color: #4c1d95; }
html[data-theme="dark"] .fedex-scans li { border-bottom-color: #312e81; }
html[data-theme="dark"] .fedex-api-badge.pending {
  background: #422006;
  color: #fcd34d;
  border-color: #a16207;
}
html[data-theme="dark"] .fedex-api-badge.ready {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #059669;
}

.rate-bar { display: flex; align-items: center; gap: 8px; }
.rate-bar .track {
  width: 72px; height: 6px;
  background: #fee2e2;
  border-radius: 99px;
  overflow: hidden;
}
.rate-bar .fill { height: 100%; background: #dc2626; border-radius: 99px; }

.empty-state {
  padding: 40px 24px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
}
.empty-state p:first-child { font-size: 15px; color: var(--ink); margin-bottom: 6px; font-weight: 600; }
.alert-ok {
  padding: 14px 18px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  color: #065f46;
  font-size: 13.5px;
}
.note-form { display: flex; gap: 8px; margin-top: 12px; }
.note-form input[type="text"] {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form input[type="text"] {
  width: 110px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
}
.hidden-sites-note { margin-top: 12px; font-size: 12px; color: var(--muted); }

.acct-active { color: #198754; font-weight: 700; font-size: 12.5px; }
.acct-disabled { color: var(--muted); font-weight: 600; font-size: 12.5px; }

/* Edit user access modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none !important; }
.modal-card {
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
  border: 1px solid var(--line);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 8px;
}
.modal-title-row { display: flex; align-items: center; gap: 12px; }
.modal-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.modal-head h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
}
.modal-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 6px;
}
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 8px 20px 4px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 12px 0 6px;
}
.field-wrap { position: relative; }
.field-wrap input {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
  background: var(--card);
  color: var(--ink);
}
.field-wrap input[readonly] {
  background: var(--white);
  color: var(--muted);
}
.field-icon {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  display: flex;
}
.field-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
  background: #fff;
}
.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.field-section-title {
  font-size: 13px;
  font-weight: 700;
  margin-top: 16px;
  margin-bottom: 4px;
  color: var(--ink);
}
.site-check-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.site-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 13.5px;
}
.site-check-row:last-child { border-bottom: none; }
.site-check-row:hover { background: #f8fafc; }
.site-check-row input { accent-color: #0d6efd; width: 15px; height: 15px; }
.site-check-row span { flex: 1; }
.site-check-row .pin { color: #94a3b8; }
.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.toggle { position: relative; display: inline-flex; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 44px; height: 24px;
  background: #cbd5e1;
  border-radius: 999px;
  position: relative;
  transition: background 0.15s;
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.15s;
}
.toggle input:checked + .toggle-track { background: #0d6efd; }
.toggle input:checked + .toggle-track::after { transform: translateX(20px); }
.status-label { font-weight: 700; font-size: 13.5px; }
.status-label.on { color: #198754; }
.status-label.off { color: var(--muted); }

@media (max-width: 960px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .case-layout { grid-template-columns: 1fr; }
}

/* ========== Admin Users & Access (mockup) ========== */
:root {
  --admin-navy: #0a1a3b;
  --admin-blue: #0061ff;
  --admin-bg: #dfe6ef;
}
body.admin-shell {
  background: var(--admin-bg);
  display: block;
  min-height: 100vh;
}
.admin-sidebar {
  width: 100%;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  background: var(--admin-navy);
  color: #fff;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  overflow: hidden;
  z-index: 120;
  padding: 0 10px;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  flex-shrink: 0;
}
.admin-brand-icon { width: 18px; height: 18px; flex-shrink: 0; }
.admin-brand strong { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.admin-brand-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: auto;
  color: inherit;
  text-decoration: none;
}
.admin-brand-link .corp-logo { height: 25px; background: transparent; }
.admin-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  align-items: center;
  gap: 6px;
  padding: 0;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 0;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  font-size: 12.5px;
  border-radius: 8px;
  white-space: nowrap;
}
.admin-nav-link svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.9; }
.admin-nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.admin-nav-link.active {
  background: #1a4d8c;
  color: #fff;
  font-weight: 600;
}
.admin-sub {
  display: flex;
  position: static;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: transparent;
}
.admin-sub-link {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  margin: 0;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 12.5px;
  border-radius: 8px;
  white-space: nowrap;
}
.admin-sub-link:hover { color: #fff; background: rgba(255,255,255,0.06); }
.admin-sub-link.active {
  background: #1a4d8c;
  color: #fff;
  font-weight: 600;
}
.admin-sidebar-bottom {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  border-top: none;
  flex-shrink: 0;
  padding: 0;
}
.admin-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  padding: 0;
  border-radius: 10px;
}
.admin-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--admin-blue);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 10px;
  flex-shrink: 0;
}
.admin-avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.admin-profile-text .name { font-weight: 700; font-size: 12px; }
.admin-profile-text .role { display: none; }
.admin-profile .chev { display: none; }

.admin-main { margin-left: 0; min-height: 100vh; }
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  min-height: 0;
  background:
    linear-gradient(105deg, rgba(31, 78, 121, 0.16) 0%, rgba(13, 110, 253, 0.08) 38%, transparent 68%),
    linear-gradient(180deg, #d7e6f6 0%, #e8f0f9 55%, #eef3f9 100%);
  border-bottom: 1px solid #9bb8d9;
  box-shadow: inset 0 2px 0 0 #1f4e79;
}
.admin-topbar-left { display: flex; align-items: center; gap: 8px; }
.admin-topbar h1 {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.admin-topbar p {
  font-size: 11.5px;
  color: #475569;
  margin-top: 1px;
  line-height: 1.25;
}
.admin-icon-btn {
  border: none;
  background: transparent;
  color: #334155;
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.admin-topbar-right { display: flex; align-items: center; gap: 8px; }
.btn-add-user {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--admin-blue);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-add-user:hover { filter: brightness(1.05); }
.admin-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #334155;
}

.admin-content { padding: 14px 20px 28px; }
.admin-section-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.admin-section-strip a {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
}
.admin-section-strip a:hover {
  color: var(--ink);
  background: #eef2f7;
}
.admin-section-strip a.active {
  color: #0b3a6e;
  background: #e8f0ff;
  border-color: #c7dbf5;
}
.admin-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.admin-hub-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.admin-hub-card:hover {
  border-color: #9eb6d4;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
.admin-hub-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.admin-hub-card h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}
.admin-hub-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  flex: 1;
}
.admin-hub-stat {
  font-size: 12px;
  font-weight: 700;
  color: var(--admin-blue, #1f4e79);
  background: #e8f0ff;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.admin-hub-badge {
  font-size: 11.5px;
  font-weight: 750;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.admin-hub-badge.ok {
  color: #047857;
  background: #d1fae5;
}
.admin-hub-badge.warn {
  color: #b45309;
  background: #ffedd5;
}
.admin-hub-cta {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--admin-blue, #1f4e79);
}
.admin-hub-cta span { margin-left: 2px; }
.fedex-status-body { padding: 14px 18px 18px; }
.fedex-checklist {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.55;
}
.fedex-checklist li { margin-bottom: 8px; }
.fedex-admin-grid { margin-bottom: 0; }
@media (max-width: 900px) {
  .admin-hub-grid { grid-template-columns: 1fr; }
}
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 18px;
  align-items: start;
}
.users-card, .sites-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.users-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #eef1f5;
  flex-wrap: wrap;
}
.users-title { display: flex; align-items: center; gap: 10px; }
.users-title h2 { font-size: 16px; font-weight: 800; color: #0f172a; }
.users-count {
  background: #e8f0ff;
  color: var(--admin-blue);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.users-tools { display: flex; align-items: center; gap: 8px; }
.users-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  min-width: 220px;
  background: #eef2f7;
}
.users-search input {
  border: none;
  outline: none;
  font: inherit;
  font-size: 13px;
  width: 100%;
}
.users-search svg { color: #94a3b8; flex-shrink: 0; }
.btn-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #eef2f7;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
}

.users-table-wrap { overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.users-table th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #475569;
  border-bottom: 1px solid var(--line);
  background: #e8edf4;
}
.users-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  background: var(--card);
}
.users-table tr:last-child td { border-bottom: none; }
.user-cell { display: flex; align-items: center; gap: 12px; }
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.user-name { font-weight: 700; color: #0f172a; font-size: 13.5px; }
.user-email { color: #64748b; font-size: 12px; margin-top: 1px; }

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.role-admin { background: #e8f0ff; color: #2563eb; }
.role-super { background: #0f172a; color: #f8fafc; }
.role-operator { background: #f3e8ff; color: #7c3aed; }
.role-viewer { background: #dcfce7; color: #15803d; }

.site-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.site-tag {
  background: #f1f5f9;
  color: #475569;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}
.site-more { color: #64748b; font-size: 12px; font-weight: 600; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.status-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.status-pill.active { background: #ecfdf5; color: #15803d; }
.status-pill.active .dot { background: #22c55e; }
.status-pill.disabled { background: #f1f5f9; color: #64748b; }
.status-pill.disabled .dot { background: #94a3b8; }

.last-login-cell { color: #475569; font-size: 12.5px; white-space: nowrap; }
.last-login-cell .time { color: #64748b; font-size: 12px; margin-top: 2px; }

.row-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.row-actions .inline { display: inline; }
.act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  color: #0f172a;
}
.act:hover { background: #f8fafc; }
.act.enable { color: #15803d; }
.act.remove { color: #dc2626; }

.users-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid #eef1f5;
  color: #64748b;
  font-size: 12.5px;
  flex-wrap: wrap;
}
.pager { display: flex; gap: 4px; }
.pager-btn {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  background: var(--card);
}
.pager-btn.active {
  background: var(--admin-blue);
  border-color: var(--admin-blue);
  color: #fff;
}
.pager-btn.disabled { pointer-events: none; opacity: 0.4; }

.sites-card { padding: 16px 16px 12px; }
.sites-card h3 {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 10px;
  text-transform: none;
  letter-spacing: 0;
}
.sites-list { list-style: none; }
.sites-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid #eef1f5;
}
.sites-list li:last-child { border-bottom: none; }
.site-ico {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #e8f0ff;
  color: var(--admin-blue);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.site-name { font-weight: 700; font-size: 13px; color: #0f172a; }
.site-returns { font-size: 11.5px; color: #64748b; margin-top: 1px; }
.sites-list .chev { margin-left: auto; color: #cbd5e1; }
.view-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 10px 4px 4px;
  color: var(--admin-blue);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}

@media (max-width: 1100px) {
  .admin-grid { grid-template-columns: 1fr; }
}

.stats-kpi .unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 2px;
}
.lifecycle-table td { white-space: nowrap; }
.lifecycle-table td:nth-child(2) { white-space: normal; }

.lifecycle-panel {
  background:
    linear-gradient(135deg, rgba(31, 78, 121, 0.07), transparent 42%),
    var(--card);
}
.lifecycle-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.lifecycle-panel h3 { margin: 0; }
.lifecycle-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.lifecycle-wait {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 4px;
  row-gap: 0;
  align-items: baseline;
  padding: 8px 12px;
  border-radius: 10px;
  background: #e8f0fb;
  border: 1px solid #b7cce8;
  min-width: 108px;
  text-align: right;
}
.lifecycle-wait.over {
  background: #fef2f2;
  border-color: #fecaca;
}
.lifecycle-wait.done {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.lifecycle-wait-val {
  grid-column: 1;
  grid-row: 1;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--navy);
  line-height: 1;
}
.lifecycle-wait.over .lifecycle-wait-val { color: #b91c1c; }
.lifecycle-wait.done .lifecycle-wait-val { color: #047857; }
.lifecycle-wait-unit {
  grid-column: 2;
  grid-row: 1;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lifecycle-wait-label {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.lifecycle-steps {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  position: relative;
}
.lifecycle-steps::before {
  content: "";
  position: absolute;
  left: 12.5%;
  right: 12.5%;
  top: 15px;
  height: 2px;
  background: var(--line);
  z-index: 0;
}
.lifecycle-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 6px;
}
.ls-marker {
  display: flex;
  justify-content: center;
  width: 100%;
}
.ls-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid #94a3b8;
  box-shadow: 0 0 0 4px var(--card);
}
.lifecycle-step.done .ls-dot {
  background: #1f4e79;
  border-color: #1f4e79;
}
.lifecycle-step.current .ls-dot {
  background: #0d6efd;
  border-color: #0d6efd;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.18);
}
.ls-card {
  width: 100%;
  padding: 12px 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--white);
  text-align: left;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.lifecycle-step.done .ls-card {
  border-color: #b7cce8;
  background: linear-gradient(180deg, #f4f8fc, var(--white) 55%);
}
.lifecycle-step.current .ls-card {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}
.ls-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 4px;
}
.ls-copy {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  min-height: 2.7em;
}
.ls-field {
  display: block;
  margin: 0;
}
.ls-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 8px 10px;
  outline: none;
}
.ls-field input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
  background: var(--white);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lifecycle-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.lifecycle-drafts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lifecycle-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
@media (max-width: 900px) {
  .lifecycle-steps {
    grid-template-columns: 1fr 1fr;
    gap: 14px 10px;
  }
  .lifecycle-steps::before { display: none; }
}
@media (max-width: 560px) {
  .lifecycle-steps { grid-template-columns: 1fr; }
  .lifecycle-actions { flex-direction: column; align-items: stretch; }
  .lifecycle-drafts { flex-direction: column; }
}

html[data-theme="dark"] .lifecycle-panel {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), transparent 48%),
    var(--card);
}
html[data-theme="dark"] .ls-card {
  background: #0f172a;
  border-color: var(--line);
}
html[data-theme="dark"] .lifecycle-step.done .ls-card {
  background: linear-gradient(180deg, #132337, #0f172a 55%);
  border-color: #334155;
}
html[data-theme="dark"] .lifecycle-step.current .ls-card {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}
html[data-theme="dark"] .ls-title { color: var(--ink); }
html[data-theme="dark"] .ls-field input {
  background: #111827;
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme="dark"] .ls-dot {
  background: var(--card);
  box-shadow: 0 0 0 4px var(--card);
}
html[data-theme="dark"] .lifecycle-wait {
  background: #1e3a5f;
  border-color: #3b82f6;
}
html[data-theme="dark"] .lifecycle-wait.over {
  background: #3f1d1d;
  border-color: #f87171;
}
html[data-theme="dark"] .lifecycle-wait.done {
  background: #064e3b;
  border-color: #34d399;
}

.create-form { padding: 20px; }
.create-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.create-grid .field-span { grid-column: 1 / -1; }
.field-input, .field-select, .create-form .note-area {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13.5px;
  background: var(--card);
  color: var(--ink);
}
.create-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
@media (max-width: 720px) {
  .create-grid { grid-template-columns: 1fr; }
}

/* UI prefs — theme only, inline in top nav */
.ui-prefs {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin-top: 0;
  min-width: 0;
  padding: 2px 4px;
  background: transparent;
  border: none;
}
.ui-prefs-label { display: none; }
.ui-prefs-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
}
.ui-prefs-row:last-child { margin-bottom: 0; }
.ui-prefs-row > span { font-size: 10px; opacity: 0.7; }
.ui-seg {
  display: inline-flex;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
}
.ui-seg-btn {
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.75);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  cursor: pointer;
}
.ui-seg-btn.on {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

/* Dark theme — keep --navy dark for sidebar bg; text uses --ink / overrides */
html[data-theme="dark"] {
  --navy: #0b1220;
  --navy-active: #1e3a5f;
  --blue: #3b82f6;
  --accent: #93c5fd;
  --ink: #f1f5f9;
  --muted: #cbd5e1;
  --line: #334155;
  --surface: #0f172a;
  --white: #1e293b;
  --card: #1e293b;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
}
html[data-theme="dark"] body { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] .topbar {
  background:
    linear-gradient(105deg, rgba(37, 99, 235, 0.28) 0%, rgba(30, 58, 95, 0.45) 42%, transparent 72%),
    linear-gradient(180deg, #152238 0%, #1a2740 100%);
  border-color: #3b82f6;
  box-shadow: inset 0 3px 0 0 #60a5fa;
  color: var(--ink);
}
html[data-theme="dark"] .panel,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .users-card,
html[data-theme="dark"] .sites-card,
html[data-theme="dark"] .queue-search,
html[data-theme="dark"] .whats-next,
html[data-theme="dark"] .notify-panel,
html[data-theme="dark"] .create-form,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .alert-ok {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
}
/* Dark: flat at rest, glow on hover only */
html[data-theme="dark"] .stat.glow-amber,
html[data-theme="dark"] .stat.glow-purple,
html[data-theme="dark"] .stat.glow-blue,
html[data-theme="dark"] .stat.glow-red,
html[data-theme="dark"] .stat.glow-green {
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] .stat.glow-amber { border-left-color: #f59e0b; }
html[data-theme="dark"] .stat.glow-purple { border-left-color: #8b5cf6; }
html[data-theme="dark"] .stat.glow-blue { border-left-color: #2563eb; }
html[data-theme="dark"] .stat.glow-red { border-left-color: #ef4444; }
html[data-theme="dark"] .stat.glow-green { border-left-color: #10b981; }
html[data-theme="dark"] .stat.glow-amber:hover,
html[data-theme="dark"] a.stat.glow-amber:hover {
  border-color: var(--line);
  border-left-color: #f59e0b;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.38), 0 1px 3px rgba(0, 0, 0, 0.3);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.24), var(--card) 48%);
}
html[data-theme="dark"] .stat.glow-purple:hover,
html[data-theme="dark"] a.stat.glow-purple:hover {
  border-color: var(--line);
  border-left-color: #8b5cf6;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.38), 0 1px 3px rgba(0, 0, 0, 0.3);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.24), var(--card) 48%);
}
html[data-theme="dark"] .stat.glow-blue:hover,
html[data-theme="dark"] a.stat.glow-blue:hover {
  border-color: var(--line);
  border-left-color: #2563eb;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.38), 0 1px 3px rgba(0, 0, 0, 0.3);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.24), var(--card) 48%);
}
html[data-theme="dark"] .stat.glow-red:hover,
html[data-theme="dark"] a.stat.glow-red:hover {
  border-color: var(--line);
  border-left-color: #ef4444;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.38), 0 1px 3px rgba(0, 0, 0, 0.3);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.24), var(--card) 48%);
}
html[data-theme="dark"] .stat.glow-green:hover,
html[data-theme="dark"] a.stat.glow-green:hover {
  border-color: var(--line);
  border-left-color: #10b981;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.38), 0 1px 3px rgba(0, 0, 0, 0.3);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.24), var(--card) 48%);
}
html[data-theme="dark"] .info-banner {
  background: #1e3a5f;
  border-color: #3b82f6;
  color: #fff;
}
html[data-theme="dark"] .info-banner .info-i {
  background: rgba(255,255,255,0.25);
  color: #fff;
}
html[data-theme="dark"] .info-banner.danger {
  background: #450a0a;
  border-color: #dc2626;
  color: #fecaca;
}
html[data-theme="dark"] .info-banner.danger .info-i {
  background: #dc2626;
  color: #fff;
}
html[data-theme="dark"] .info-banner.filter-banner {
  background: #1e293b;
  border-color: #475569;
  color: #cbd5e1;
}
html[data-theme="dark"] .sla-over { color: #f87171; }
html[data-theme="dark"] tr.row-alert td { background: rgba(239, 68, 68, 0.12); }
html[data-theme="dark"] tr.row-selected td { background: rgba(59, 130, 246, 0.14); }
html[data-theme="dark"] .topbar h1,
html[data-theme="dark"] .stat .value,
html[data-theme="dark"] .user-name,
html[data-theme="dark"] .cell-strong,
html[data-theme="dark"] .bell,
html[data-theme="dark"] .admin-topbar h1,
html[data-theme="dark"] .login-brand strong {
  color: var(--ink);
}
html[data-theme="dark"] .topbar .meta,
html[data-theme="dark"] .cell-muted,
html[data-theme="dark"] .table-footer,
html[data-theme="dark"] .report-caption,
html[data-theme="dark"] .muted-note,
html[data-theme="dark"] .delta.flat,
html[data-theme="dark"] .stat .label,
html[data-theme="dark"] .user-email,
html[data-theme="dark"] .top-tools {
  color: var(--muted);
}
html[data-theme="dark"] .site-tabs a { color: var(--muted); }
html[data-theme="dark"] .site-tabs a:hover {
  background: #243044;
  color: var(--ink);
}
html[data-theme="dark"] .site-tabs a.active {
  background: #1e3a5f;
  color: #bfdbfe;
  border-color: #3b82f6;
}
html[data-theme="dark"] .filter-chips .chip {
  background: #243044;
  color: #e2e8f0;
}
html[data-theme="dark"] .filter-chips .chip.on {
  background: #2563eb;
  color: #fff;
}
html[data-theme="dark"] .btn-ghost {
  background: #243044;
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="dark"] .btn-primary {
  background: #2563eb;
  color: #fff;
}
html[data-theme="dark"] .case-link { color: #93c5fd; }
html[data-theme="dark"] .field-input,
html[data-theme="dark"] .field-select,
html[data-theme="dark"] .create-form .note-area,
html[data-theme="dark"] .note-area,
html[data-theme="dark"] .queue-search,
html[data-theme="dark"] .queue-search input,
html[data-theme="dark"] .search-by {
  background: #0f172a;
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="dark"] tr:hover td { background: #243044; }
html[data-theme="dark"] th {
  background: #162032;
  color: #cbd5e1;
  border-color: var(--line);
}
html[data-theme="dark"] td {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme="dark"] .login-page {
  background: linear-gradient(160deg, #020617 0%, #0f172a 45%, #1e293b 45%);
}
html[data-theme="dark"] .login-card { background: #1e293b; color: var(--ink); }
html[data-theme="dark"] .login-footnote { color: #94a3b8; }
html[data-theme="dark"] .admin-main,
html[data-theme="dark"] .admin-content { background: var(--surface); }
html[data-theme="dark"] body.admin-shell { background: var(--surface); }
html[data-theme="dark"] .admin-topbar {
  background:
    linear-gradient(105deg, rgba(37, 99, 235, 0.28) 0%, rgba(30, 58, 95, 0.45) 42%, transparent 72%),
    linear-gradient(180deg, #152238 0%, #1a2740 100%);
  border-color: #3b82f6;
  box-shadow: inset 0 2px 0 0 #60a5fa;
  color: var(--ink);
}
html[data-theme="dark"] .admin-topbar h1 { color: var(--ink); }
html[data-theme="dark"] .admin-topbar p { color: var(--muted); }
html[data-theme="dark"] .admin-icon-btn,
html[data-theme="dark"] .admin-user-chip { color: var(--ink); }
html[data-theme="dark"] .users-card,
html[data-theme="dark"] .sites-card,
html[data-theme="dark"] .admin-hub-card {
  background: var(--white);
  border-color: var(--line);
  box-shadow: none;
}
html[data-theme="dark"] .admin-section-strip {
  background: var(--card);
  border-color: var(--line);
}
html[data-theme="dark"] .admin-section-strip a:hover {
  background: #243044;
  color: var(--ink);
}
html[data-theme="dark"] .admin-section-strip a.active {
  color: #93c5fd;
  background: #1e3a5f;
  border-color: #334155;
}
html[data-theme="dark"] .admin-hub-card h2 { color: var(--ink); }
html[data-theme="dark"] .admin-hub-cta { color: #93c5fd; }
html[data-theme="dark"] .users-card-head,
html[data-theme="dark"] .users-foot,
html[data-theme="dark"] .sites-list li {
  border-color: var(--line);
}
html[data-theme="dark"] .users-title h2,
html[data-theme="dark"] .sites-card h3,
html[data-theme="dark"] .user-name,
html[data-theme="dark"] .site-name,
html[data-theme="dark"] .act {
  color: var(--ink);
}
html[data-theme="dark"] .users-count {
  background: #1e3a5f;
  color: #bfdbfe;
}
html[data-theme="dark"] .users-search,
html[data-theme="dark"] .btn-filter,
html[data-theme="dark"] .pager-btn {
  background: #0f172a;
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme="dark"] .users-search input {
  background: transparent;
  color: var(--ink);
}
html[data-theme="dark"] .users-search svg { color: var(--muted); }
html[data-theme="dark"] .users-table th {
  background: #162032;
  color: #cbd5e1;
  border-color: var(--line);
}
html[data-theme="dark"] .users-table td {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme="dark"] .users-table tr:hover td { background: #243044; }
html[data-theme="dark"] .user-email,
html[data-theme="dark"] .site-returns,
html[data-theme="dark"] .site-more,
html[data-theme="dark"] .users-foot,
html[data-theme="dark"] .last-login-cell,
html[data-theme="dark"] .last-login-cell .time {
  color: var(--muted);
}
html[data-theme="dark"] .site-tag {
  background: #243044;
  color: #e2e8f0;
}
html[data-theme="dark"] .site-ico {
  background: #1e3a5f;
  color: #93c5fd;
}
html[data-theme="dark"] .role-admin {
  background: #1e3a5f;
  color: #93c5fd;
}
html[data-theme="dark"] .role-super {
  background: #020617;
  color: #f8fafc;
  border: 1px solid #475569;
}
html[data-theme="dark"] .role-operator {
  background: #4c1d95;
  color: #e9d5ff;
}
html[data-theme="dark"] .role-viewer {
  background: #14532d;
  color: #bbf7d0;
}
html[data-theme="dark"] .status-pill.active {
  background: #14532d;
  color: #bbf7d0;
}
html[data-theme="dark"] .status-pill.disabled {
  background: #334155;
  color: #cbd5e1;
}
html[data-theme="dark"] .act:hover { background: #243044; }
html[data-theme="dark"] .act.enable { color: #4ade80; }
html[data-theme="dark"] .act.remove { color: #f87171; }
html[data-theme="dark"] .pager-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
html[data-theme="dark"] .view-all { color: #93c5fd; }
html[data-theme="dark"] .site-row-link:hover .site-name { color: #93c5fd; }
html[data-theme="dark"] .modal-card {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
}
html[data-theme="dark"] .modal-head,
html[data-theme="dark"] .modal-foot {
  border-color: var(--line);
}
html[data-theme="dark"] .modal-head h2,
html[data-theme="dark"] .field-label,
html[data-theme="dark"] .field-section-title,
html[data-theme="dark"] .status-label.on {
  color: var(--ink);
}
html[data-theme="dark"] .field-hint,
html[data-theme="dark"] .status-label.off {
  color: var(--muted);
}
html[data-theme="dark"] .field-wrap input,
html[data-theme="dark"] .field-select {
  background: #0f172a;
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="dark"] .field-wrap input[readonly] {
  background: #162032;
  color: var(--muted);
}
html[data-theme="dark"] .site-check-row {
  color: var(--ink);
}
html[data-theme="dark"] .admin-sidebar .ui-prefs-row {
  color: rgba(255,255,255,0.9);
}
html[data-theme="dark"] .detail-table td:first-child { color: var(--muted); }
html[data-theme="dark"] .notify-item strong { color: var(--ink); }
html[data-theme="dark"] .notify-item span,
html[data-theme="dark"] .notify-empty,
html[data-theme="dark"] .notify-title { color: var(--muted); }
html[data-theme="dark"] .whats-next {
  background: #1e3a5f;
  border-color: #3b82f6;
}
html[data-theme="dark"] .whats-next-label { color: #bfdbfe; }
html[data-theme="dark"] .whats-next p { color: #fff; }
html[data-theme="dark"] .case-tabs a { color: var(--muted); }
html[data-theme="dark"] .case-tabs a.active { color: #93c5fd; border-bottom-color: #3b82f6; }
html[data-theme="dark"] .panel h3 { color: var(--muted); }
html[data-theme="dark"] .stat-icon.blue { background: #1e3a5f; color: #93c5fd; }
html[data-theme="dark"] .stat-icon.green { background: #14532d; color: #86efac; }
html[data-theme="dark"] .stat-icon.orange { background: #7c2d12; color: #fdba74; }
html[data-theme="dark"] .stat-icon.red { background: #7f1d1d; color: #fca5a5; }
html[data-theme="dark"] .stat-icon.purple { background: #4c1d95; color: #c4b5fd; }

/* Top navigation — single thin row */
body {
  flex-direction: column;
}
.sidebar {
  position: sticky;
  top: 0;
  left: auto;
  bottom: auto;
  width: 100%;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  z-index: 120;
  overflow: hidden;
}
.sidebar-brand {
  padding: 0;
  flex-shrink: 0;
}
.sidebar-brand-link {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: auto;
}
.sidebar-brand-link .corp-logo {
  height: 28px;
  background: transparent;
}
.sidebar-brand .brand-icon {
  width: 18px;
  height: 18px;
  margin-top: 0;
}
.sidebar-brand strong {
  font-size: 13px;
  line-height: 1;
}
.sidebar-brand small,
.brand-text small { display: none; }
.sidebar nav {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  flex: 1;
  min-width: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 0;
  scrollbar-width: none;
}
.sidebar nav::-webkit-scrollbar { display: none; }
.sidebar nav a {
  margin-bottom: 0;
  white-space: nowrap;
  padding: 6px 8px;
  font-size: 12.5px;
  gap: 6px;
  border-radius: 6px;
}
.sidebar nav a svg {
  width: 14px;
  height: 14px;
}
.sidebar nav a.active::before { display: none; }
.sidebar-footer {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  border-top: none;
  border-left: 1px solid rgba(255,255,255,0.12);
  padding: 0 0 0 8px;
  margin: 0;
  flex-shrink: 0;
}
.sidebar-footer .user-card {
  align-items: center;
  gap: 6px;
}
.sidebar-footer .avatar {
  width: 26px;
  height: 26px;
  font-size: 10px;
}
.sidebar-footer .user {
  font-size: 12px;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-footer .user-card .site-status,
.sidebar-footer .role { display: none; }
.signout {
  margin-top: 0;
  font-size: 0;
  gap: 0;
  padding: 4px;
}
.signout svg {
  width: 14px;
  height: 14px;
}

/* Flatten prefs into one inline control strip */
.ui-prefs {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin-top: 0;
  min-width: 0;
  padding: 2px 4px;
  background: transparent;
  border: none;
}
.ui-prefs-label { display: none; }
.ui-prefs-row {
  margin: 0;
  gap: 4px;
}
.ui-prefs-row > span {
  font-size: 10px;
  opacity: 0.7;
}
.ui-seg-btn {
  padding: 2px 6px;
  font-size: 10px;
  line-height: 1.2;
}
.main { margin-left: 0; width: 100%; }

.admin-shell { display: block; }
.admin-sidebar {
  position: sticky;
  top: 0;
  left: auto;
  width: 100%;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  overflow: hidden;
  z-index: 120;
  padding: 0 10px;
}
.admin-brand { padding: 0; flex-shrink: 0; }
.admin-brand-link {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: auto;
}
.admin-brand-link .corp-logo { height: 25px; background: transparent; }
.admin-brand strong { font-size: 13px; }
.admin-brand-icon { width: 18px; height: 18px; }
.admin-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  align-items: center;
  gap: 6px;
  padding: 0;
}
.admin-nav-link {
  padding: 6px 10px;
  font-size: 12.5px;
  white-space: nowrap;
  margin-bottom: 0;
  border-radius: 8px;
}
.admin-nav-group {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
}
.admin-sub {
  display: flex;
  position: static;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: transparent;
}
.admin-sub-link {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  font-size: 12.5px;
  white-space: nowrap;
  margin: 0;
  border-radius: 8px;
}
.admin-sidebar-bottom {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  border-top: none;
  flex-shrink: 0;
  padding: 0;
}
.admin-avatar { width: 26px; height: 26px; font-size: 10px; }
.admin-profile-text .role { display: none; }
.admin-main { margin-left: 0; }

/* Login + notifications */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #0a1c3d 0%, #163a5f 45%, #e8eef6 45%);
  padding: 24px;
  position: relative;
}
.login-corp-logo {
  position: absolute;
  top: 22px;
  left: 24px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: transparent;
  padding: 0;
  border: none;
  border-radius: 0;
}
.login-corp-logo:hover { opacity: 0.92; background: transparent; }
.login-corp-logo img {
  display: block;
  height: 45px;
  width: auto;
  max-width: min(340px, 75vw);
  background: transparent;
}
@media (max-width: 520px) {
  .login-corp-logo { top: 16px; left: 16px; }
  .login-corp-logo img { height: 36px; background: transparent; }
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(10, 28, 61, 0.25);
  border: 1px solid var(--line);
}
.login-brand strong {
  display: block;
  font-size: 22px;
  color: #0a1c3d;
  letter-spacing: -0.02em;
}
.login-brand p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 13.5px;
  line-height: 1.4;
}
.login-error {
  margin-top: 14px;
  padding: 10px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 8px;
  font-size: 13px;
}
.login-form { margin-top: 18px; }
.login-form .field-label { margin-top: 12px; }
.login-form .field-optional {
  font-weight: 500;
  color: var(--muted);
  text-transform: lowercase;
  font-size: 11px;
  letter-spacing: 0.02em;
}
.login-form .field-input { margin-top: 4px; }
.login-footnote {
  margin-top: 16px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

.notify-wrap { position: relative; }
button.bell {
  cursor: pointer;
}
.notify-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 300px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  z-index: 40;
  padding: 10px;
}
.notify-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 4px 8px 8px;
}
.notify-item {
  display: block;
  text-decoration: none;
  padding: 10px 8px;
  border-radius: 8px;
  color: inherit;
}
.notify-item:hover { background: #f8fafc; }
.notify-item strong { display: block; font-size: 13.5px; color: var(--navy); }
.notify-item span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.notify-empty {
  padding: 10px 8px;
  font-size: 13px;
  color: var(--muted);
}
.notify-footer {
  display: block;
  margin-top: 4px;
  padding: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #0d6efd;
  text-decoration: none;
}
.notify-footer:hover { text-decoration: underline; }

.admin-topbar-right .notify-wrap { margin-left: 4px; }
.sites-total {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  font-size: 12.5px;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.sites-total strong { color: #0f172a; font-size: 14px; }

.panel-next {
  border: 1px solid #93c5fd;
  background: #f0f7ff;
  position: relative;
}
.panel-next .next-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  margin-bottom: 10px;
}
.panel-next .next-headline {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
.panel-next .next-step-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 750;
}
.panel-next .next-step-link:hover { color: var(--blue); }
.case-tabs a.tab-alert {
  color: #b45309;
  font-weight: 700;
}
.case-tabs a.tab-alert.active {
  color: #b45309;
  border-bottom-color: #f59e0b;
}
.exception-actions .field-label { margin-top: 10px; }
.exception-actions .tab-actions { margin-top: 12px; }
.timeline-body-text {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.panel-next p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.4;
}
.ext-meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
}
.fedex-full {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #0d6efd;
  text-decoration: none;
}
.fedex-full:hover { text-decoration: underline; }
.case-status-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.case-layout-mock {
  grid-template-columns: 1.2fr 1fr;
}
.stat-icon.purple { background: #f3e8ff; color: #7c3aed; }
.report-caption {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.ex-count { color: #b91c1c; font-weight: 700; }
.range-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--muted);
}
.range-select select {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  outline: none;
}

.expected-cols {
  margin: 8px 0 0;
  padding-left: 18px;
  columns: 2;
  gap: 24px;
  font-size: 13px;
  color: var(--ink);
}
.expected-cols li { margin-bottom: 4px; }
.upload-form .field-input[type="file"] {
  padding: 10px;
}
.alert-ok {
  background: #e8f6ee;
  border: 1px solid #86efac;
  color: #166534;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
}
.repair-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.repair-link-list li {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.repair-link-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.status-update-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.field-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
  background: var(--card);
  color: var(--ink);
}

.admin-brand-link,
.sidebar-brand-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  width: 100%;
}
.admin-brand-link .corp-logo,
.sidebar-brand-link .corp-logo {
  display: block;
  height: 35px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  background: transparent;
}
.site-row-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  color: inherit;
  text-decoration: none;
}
.site-row-link:hover .site-name { color: #0d6efd; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sites-list li { padding: 10px 8px; }

