/* Copyright 2026 QuantumZiroAi by Robert D. and Daniel M. */
/* Quantum style — dark: deep navy, teal accents, glassy cards */
:root {
  --teal: #14b8a6;
  --teal-bright: #2dd4bf;
  --teal-dark: #0d9488;
  --teal-light: rgba(45, 212, 191, .16);
  --teal-glow: rgba(20, 184, 166, .35);
  --ink: #e2e8f0;
  --head: #f1f5f9;
  --muted: #8da2bf;
  --nav-ink: #b6c5dc;
  --line: rgba(148, 163, 184, .18);
  --line-soft: rgba(148, 163, 184, .1);
  --bg: #0a1228;
  --navy: #0f1d3d;
  --card: rgba(20, 33, 61, .55);
  --glass-hi: rgba(255, 255, 255, .045);
  --side-1: rgba(15, 29, 61, .85);
  --side-2: rgba(10, 21, 44, .9);
  --pop-1: #13224a;
  --pop-2: #0e1a3a;
  --input-bg: rgba(10, 18, 40, .6);
  --danger: #f87171;
  --warn: #fbbf24;
  --ok: #4ade80;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(2, 6, 23, .4), 0 12px 32px -12px rgba(2, 6, 23, .7);
  --page-bg:
    radial-gradient(1100px 500px at 85% -10%, rgba(20, 184, 166, .14), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(56, 189, 248, .08), transparent 60%),
    linear-gradient(180deg, #0a1228, #0b1530 55%, #0a1228);
  --map-filter: brightness(.65) invert(1) contrast(2.6) hue-rotate(195deg) saturate(.35) brightness(.75);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--page-bg);
  background-attachment: fixed;
}

.layout { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 232px; flex: none; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, var(--side-1), var(--side-2));
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: conic-gradient(from 210deg, #14b8a6, #0d9488, #2dd4bf, #14b8a6);
  box-shadow: 0 0 0 4px var(--teal-light), 0 4px 18px var(--teal-glow);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px;
}
.brand h1 { font-size: 16px; margin: 0; letter-spacing: .2px; color: var(--head); }
.brand small { color: var(--muted); display: block; font-size: 11px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 10px; color: var(--nav-ink); text-decoration: none; font-weight: 500;
}
.nav a .ico { width: 20px; text-align: center; opacity: .85; }
.nav a:hover { background: var(--glass-hi); color: var(--ink); }
.nav a.active {
  background: linear-gradient(90deg, var(--teal-dark), var(--teal));
  color: #fff; box-shadow: 0 6px 18px -6px var(--teal-glow);
}
.nav .sep { margin: 10px 12px 4px; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--muted); }
.sidebar footer { font-size: 10.5px; color: var(--muted); padding: 12px 10px 0; line-height: 1.5; }

/* ---------- main ---------- */
.main { flex: 1; min-width: 0; padding: 22px 28px 40px; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 21px; letter-spacing: .2px; color: var(--head); }
.page-head .sub { color: var(--muted); }
.page-head .spacer { flex: 1; }

/* ---------- cards / KPIs (glassy) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(12px); padding: 16px 18px;
}
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 4px; color: var(--head); }
.kpi .value small { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi.accent { border-top: 3px solid var(--teal); }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(12px); padding: 18px; margin-bottom: 18px;
}
.panel h3 { margin: 0 0 12px; font-size: 15px; color: var(--head); }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:hover td { background: var(--glass-hi); }
tr.clickable { cursor: pointer; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- badges ---------- */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px;
  font-weight: 600; letter-spacing: .03em; white-space: nowrap;
}
.badge.NEW { background: rgba(56, 189, 248, .16); color: #7dd3fc; }
.badge.PLANNED { background: rgba(167, 139, 250, .16); color: #c4b5fd; }
.badge.PICKED_UP, .badge.OUT_FOR_DELIVERY { background: rgba(251, 191, 36, .15); color: #fcd34d; }
.badge.IN_TRANSIT, .badge.UNDERWAY, .badge.ON_TRIP { background: var(--teal-light); color: var(--teal-bright); }
.badge.AT_WAREHOUSE { background: rgba(148, 163, 184, .15); color: #cbd5e1; }
.badge.DELIVERED, .badge.COMPLETED, .badge.PAID, .badge.SENT_OK, .badge.AVAILABLE { background: rgba(74, 222, 128, .15); color: #86efac; }
.badge.CANCELLED, .badge.OVERDUE, .badge.FAILED, .badge.WORKSHOP { background: rgba(248, 113, 113, .15); color: #fca5a5; }
.badge.DRAFT, .badge.QUEUED, .badge.REST { background: rgba(148, 163, 184, .15); color: #cbd5e1; }
.badge.SENT { background: rgba(56, 189, 248, .16); color: #7dd3fc; }
.badge.adr { background: rgba(251, 146, 60, .14); color: #fdba74; border: 1px solid rgba(251, 146, 60, .35); }

/* ---------- buttons & forms ---------- */
button, .btn {
  font: inherit; border: 1px solid var(--line); background: var(--glass-hi); color: var(--ink);
  border-radius: 9px; padding: 7px 14px; cursor: pointer; font-weight: 600;
  transition: all .15s ease; backdrop-filter: blur(6px);
}
button:hover { border-color: var(--teal); color: var(--teal-bright); }
button.primary {
  background: linear-gradient(90deg, var(--teal-dark), var(--teal)); color: #fff; border: none;
  box-shadow: 0 6px 18px -6px var(--teal-glow);
}
button.primary:hover { filter: brightness(1.12); color: #fff; }
button.danger { color: var(--danger); }
button.small { padding: 4px 10px; font-size: 12px; }

input, select, textarea {
  font: inherit; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px;
  background: var(--input-bg); color: var(--ink); width: 100%;
}
input::placeholder, textarea::placeholder { color: #64748b; }
select option { background: var(--navy); color: var(--ink); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-light);
}
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.field { margin-bottom: 2px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type="search"], .toolbar select { width: auto; min-width: 160px; }

/* ---------- map (dark tiles via filter) ---------- */
.map { height: 440px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; background: var(--navy); }
.map-small { height: 300px; }
.map .leaflet-tile { filter: var(--map-filter); }
.map .leaflet-control-attribution { background: var(--side-2); color: var(--muted); }
.map .leaflet-control-attribution a { color: var(--teal-bright); }
.map .leaflet-bar a { background: var(--navy); color: var(--ink); border-color: var(--line); }
.map .leaflet-bar a:hover { background: #16254a; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--navy); color: var(--ink); }
.truck-marker {
  background: var(--teal); color: #fff; border-radius: 50%;
  width: 30px; height: 30px; display: grid; place-items: center; font-size: 15px;
  box-shadow: 0 0 0 4px var(--teal-glow), 0 4px 10px rgba(0, 0, 0, .45);
  border: 2px solid var(--bg);
}

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(2, 6, 23, .65);
  display: grid; place-items: center; z-index: 1000; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal {
  background: linear-gradient(180deg, var(--pop-1), var(--pop-2));
  border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  width: min(860px, 100%); max-height: 90vh; overflow: auto; padding: 22px 24px;
}
.modal h3 { margin-top: 0; color: var(--head); }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 26px; }
.timeline li::before {
  content: ""; position: absolute; left: 6px; top: 5px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--teal-bright); box-shadow: 0 0 0 3px var(--teal-light);
}
.timeline li::after {
  content: ""; position: absolute; left: 10px; top: 18px; bottom: 0; width: 1.5px; background: var(--line);
}
.timeline li:last-child::after { display: none; }
.timeline .t-time { font-size: 11.5px; color: var(--muted); }

/* ---------- misc ---------- */
.muted { color: var(--muted); }
.right { text-align: right; }
.mt { margin-top: 14px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { color: var(--muted); text-align: center; padding: 28px 0; }
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  background: var(--pop-1); color: var(--head); border: 1px solid var(--line);
  padding: 12px 18px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); max-width: 380px; font-weight: 500;
}
.toast.error { background: #7f1d1d; border-color: rgba(248, 113, 113, .4); }
.warn-text { color: var(--warn); font-weight: 600; }
.danger-text { color: var(--danger); font-weight: 600; }
.ok-text { color: var(--ok); font-weight: 600; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs button { border-radius: 999px; }
.tabs button.active { background: var(--teal); border-color: var(--teal); color: #04221e; }

.trip-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px;
  background: var(--glass-hi); }
.trip-card .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.trip-card .head strong { font-size: 15px; color: var(--head); }
.stop { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.stop .order { width: 22px; height: 22px; border-radius: 50%; background: var(--teal-light);
  color: var(--teal-bright); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }

.integration { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.integration:last-child { border-bottom: none; }
.integration .dot { width: 10px; height: 10px; border-radius: 50%; background: #475569; flex: none; }
.integration .dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(74, 222, 128, .2); }
.integration .grow { flex: 1; min-width: 200px; }
.integration input { max-width: 320px; }

pre.code {
  background: #060c1e; color: #a7f3d0; border: 1px solid var(--line);
  padding: 14px 16px; border-radius: 10px;
  overflow: auto; font-size: 12.5px; line-height: 1.55;
}

/* ---------- light animations (CSS transforms/opacity only) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .main > * { animation: qf-rise .28s ease both; }
  .main > *:nth-child(2) { animation-delay: .04s; }
  .main > *:nth-child(3) { animation-delay: .08s; }
  .modal { animation: qf-pop .18s ease both; }
  .toast { animation: qf-rise .2s ease both; }
}
@keyframes qf-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes qf-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.card, .trip-card { transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
a.card { display: block; color: inherit; text-decoration: none; cursor: pointer; }
a.card:hover, .trip-card:hover {
  transform: translateY(-2px); border-color: rgba(45, 212, 191, .45);
}
.nav a { transition: background .15s ease, color .15s ease; }
button:active { transform: scale(.97); }
td { transition: background .12s ease; }
.kpi .hint { font-size: 10.5px; color: var(--muted); margin-top: 4px; opacity: 0; transition: opacity .15s ease; }
a.card:hover .hint { opacity: 1; }

/* ---------- AI assistant widget (every screen) ---------- */
.qa-btn {
  position: fixed; right: 20px; bottom: 20px; z-index: 1400;
  width: 52px; height: 52px; border-radius: 50%; border: none; font-size: 22px;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal)); color: #fff;
  box-shadow: 0 8px 24px -4px var(--teal-glow); cursor: pointer;
  display: grid; place-items: center; transition: transform .15s ease, box-shadow .15s ease;
}
.qa-btn:hover { transform: translateY(-2px) scale(1.05); color: #fff; }
.qa-panel {
  position: fixed; right: 20px; bottom: 84px; z-index: 1400;
  width: min(380px, calc(100vw - 32px)); max-height: min(560px, 70vh);
  display: none; flex-direction: column;
  background: linear-gradient(180deg, var(--pop-1), var(--pop-2));
  backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55); overflow: hidden;
}
.qa-panel.open { display: flex; animation: qf-pop .18s ease both; }
.qa-head { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--head); }
.qa-close { cursor: pointer; color: var(--muted); padding: 2px 6px; }
.qa-close:hover { color: var(--ink); }
.qa-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.qa-msg { max-width: 88%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.qa-msg.user { align-self: flex-end; background: linear-gradient(90deg, var(--teal-dark), var(--teal)); color: #fff; border-bottom-right-radius: 4px; }
.qa-msg.assistant { align-self: flex-start; background: var(--glass-hi); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.qa-tag { display: inline-block; margin-left: 8px; font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--teal-bright); border: 1px solid rgba(45, 212, 191, .35);
  border-radius: 999px; padding: 1px 6px; vertical-align: middle; }
.qa-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.qa-input button { flex: none; }
.qa-note { font-size: 10px; color: var(--muted); text-align: center; padding: 0 12px 8px; }
@media (max-width: 900px) { .qa-btn { bottom: 16px; right: 16px; } .qa-panel { right: 16px; } }

/* ---------- onboarding tour ---------- */
.tour-scrim { position: fixed; inset: 0; z-index: 1290; background: rgba(2, 6, 23, .6); }
.tour-hi { position: relative; z-index: 1295; outline: 2px solid var(--teal-bright);
  outline-offset: 3px; border-radius: 10px; box-shadow: 0 0 0 7px var(--teal-light); }
.tour-pop {
  position: fixed; z-index: 1300; width: min(330px, calc(100vw - 32px));
  background: linear-gradient(180deg, var(--pop-1), var(--pop-2)); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 18px 48px rgba(0, 0, 0, .55); padding: 14px 16px;
  animation: qf-pop .18s ease both;
}
.tour-pop h4 { margin: 0 0 6px; color: var(--head); font-size: 14px; }
.tour-pop p { margin: 0 0 12px; font-size: 13px; color: var(--ink); line-height: 1.5; }
.tour-pop .tour-step { font-size: 11px; color: var(--muted); }
.tour-pop .actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.tour-pop .actions .tour-step { margin-right: auto; }

/* ---------- mobile (spec platform: Mobile) ---------- */
.menu-btn {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 1200;
  width: 42px; height: 42px; border-radius: 12px; font-size: 19px; padding: 0;
  background: var(--side-1); backdrop-filter: blur(10px);
  border: 1px solid var(--line); color: var(--ink);
}
.scrim {
  display: none; position: fixed; inset: 0; z-index: 1090;
  background: rgba(2, 6, 23, .55); backdrop-filter: blur(2px);
}
/* ---------- light theme (toggle ◐ in sidebar; org default in Settings) ---------- */
body[data-theme="light"] {
  --ink: #0f172a;
  --head: #0f172a;
  --muted: #64748b;
  --nav-ink: #334155;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --bg: #f8fafc;
  --navy: #ffffff;
  --card: rgba(255, 255, 255, .9);
  --glass-hi: rgba(15, 23, 42, .045);
  --side-1: rgba(255, 255, 255, .92);
  --side-2: rgba(240, 253, 250, .95);
  --pop-1: #ffffff;
  --pop-2: #f8fafc;
  --input-bg: #ffffff;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #16a34a;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --page-bg:
    radial-gradient(1100px 500px at 85% -10%, var(--teal-glow), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(13, 148, 136, .08), transparent 60%),
    #f8fafc;
  --map-filter: none;
}
body[data-theme="light"] .badge.NEW, body[data-theme="light"] .badge.SENT { background: #e0f2fe; color: #0369a1; }
body[data-theme="light"] .badge.PLANNED { background: #ede9fe; color: #6d28d9; }
body[data-theme="light"] .badge.PICKED_UP, body[data-theme="light"] .badge.OUT_FOR_DELIVERY { background: #fef3c7; color: #b45309; }
body[data-theme="light"] .badge.IN_TRANSIT, body[data-theme="light"] .badge.UNDERWAY, body[data-theme="light"] .badge.ON_TRIP { background: var(--teal-light); color: var(--teal-dark); }
body[data-theme="light"] .badge.AT_WAREHOUSE, body[data-theme="light"] .badge.DRAFT,
body[data-theme="light"] .badge.QUEUED, body[data-theme="light"] .badge.REST { background: #f1f5f9; color: #475569; }
body[data-theme="light"] .badge.DELIVERED, body[data-theme="light"] .badge.COMPLETED, body[data-theme="light"] .badge.PAID,
body[data-theme="light"] .badge.SENT_OK, body[data-theme="light"] .badge.AVAILABLE { background: #dcfce7; color: #15803d; }
body[data-theme="light"] .badge.CANCELLED, body[data-theme="light"] .badge.OVERDUE,
body[data-theme="light"] .badge.FAILED, body[data-theme="light"] .badge.WORKSHOP { background: #fee2e2; color: #b91c1c; }
body[data-theme="light"] .badge.adr { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
body[data-theme="light"] .timeline li::before { background: var(--teal); }
body[data-theme="light"] .stop .order { color: var(--teal-dark); }
body[data-theme="light"] .qa-tag { color: var(--teal-dark); }
body[data-theme="light"] .qa-msg.assistant { background: #f8fafc; }
body[data-theme="light"] .truck-marker { border-color: #fff; }
body[data-theme="light"] .tabs button.active { color: #fff; }
body[data-theme="light"] .toast { color: #fff; background: #0f172a; }
body[data-theme="light"] .map .leaflet-bar a { background: #fff; color: #0f172a; }

/* ---------- deep-link highlight ---------- */
tr.row-hi td { background: var(--teal-light) !important; }
.trip-card.row-hi, tr.row-hi { outline: 2px solid var(--teal-bright); outline-offset: -1px; }
td a, .stop a, .trip-card a, .qa-msg a, .leaflet-popup-content a {
  color: var(--teal-bright); text-decoration: none;
}
body[data-theme="light"] td a, body[data-theme="light"] .qa-msg a { color: var(--teal-dark); }
td a:hover, .qa-msg a:hover { text-decoration: underline; }

/* ---------- login screen & user chip ---------- */
.login-back {
  position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center;
  background: var(--page-bg); background-attachment: fixed; padding: 20px;
}
.login-card {
  width: min(380px, 100%); padding: 28px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); backdrop-filter: blur(14px);
  animation: qf-pop .22s ease both;
}
.login-card .logo {
  width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 12px;
  background: conic-gradient(from 210deg, #14b8a6, #0d9488, #2dd4bf, #14b8a6);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 24px;
  box-shadow: 0 0 0 5px var(--teal-light);
}
.login-card h2 { margin: 0 0 2px; text-align: center; color: var(--head); font-size: 19px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 12.5px; margin-bottom: 18px; }
.login-card .field { margin-bottom: 12px; }
.login-card .err { color: var(--danger); font-size: 12.5px; min-height: 18px; margin: 6px 0; }
.login-card .sso-sep { display: flex; align-items: center; gap: 10px; color: var(--muted);
  font-size: 11px; margin: 14px 0 10px; }
.login-card .sso-sep::before, .login-card .sso-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-card footer { margin-top: 16px; text-align: center; font-size: 10.5px; color: var(--muted); }

.user-chip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-top: 8px;
  border-top: 1px solid var(--line); }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--teal-light); color: var(--teal-bright); display: grid; place-items: center;
  font-size: 12px; font-weight: 700; }
body[data-theme="light"] .user-chip .avatar { color: var(--teal-dark); }
.user-chip .who { flex: 1; min-width: 0; line-height: 1.25; }
.user-chip .who b { font-size: 12px; color: var(--head); display: block; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { font-size: 10px; color: var(--muted); text-transform: capitalize; }
.user-chip button { padding: 4px 8px; font-size: 11px; }
.theme-toggle { border-radius: 50%; width: 30px; height: 30px; padding: 0; font-size: 14px;
  display: grid; place-items: center; flex: none; }

@media (max-width: 900px) {
  .menu-btn { display: grid; place-items: center; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 1100;
    transform: translateX(-105%); transition: transform .22s ease;
    box-shadow: 0 0 60px rgba(0, 0, 0, .6); width: 256px;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; }
  .main { padding: 64px 14px 32px; }
  .page-head h2 { font-size: 18px; }
  .grid2 { grid-template-columns: 1fr; }
  .map { height: 320px; }
  .toolbar input[type="search"], .toolbar select { min-width: 0; flex: 1; }
  .modal { padding: 16px; }
  td, th { padding: 7px 6px; }
  .main > * { min-width: 0; }
  .panel { overflow-x: auto; }
}
