:root {
  --bg: #0f172a;
  --panel: #111c33;
  --panel2: #17233e;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, .22);
  --accent: #f59e0b;
  --accent2: #22c55e;
  --danger: #ef4444;
  --blue: #38bdf8;
  --shadow: 0 12px 45px rgba(0,0,0,.35);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at top left, #1f2a44, var(--bg) 42%); color: var(--text); font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }
.page { min-height: 100vh; padding: 22px; }
.shell { width: min(1180px, 100%); margin: 0 auto; }
.topbar { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom: 18px; }
.brand { display:flex; align-items:center; gap:12px; }
.logo { width:44px; height:44px; border-radius:14px; background: linear-gradient(135deg, #f59e0b, #fb923c); display:grid; place-items:center; color:#111827; font-weight:900; box-shadow: var(--shadow); }
.brand h1 { font-size: clamp(22px, 3vw, 34px); margin:0; letter-spacing:-.03em; }
.brand p { margin: 2px 0 0; color: var(--muted); }
.nav-actions { display:flex; gap:10px; flex-wrap: wrap; }
.card { background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.03)); border:1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.grid { display:grid; gap:16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hero { padding: 26px; }
.hero h2 { margin: 0 0 10px; font-size: clamp(30px, 5vw, 56px); letter-spacing:-.05em; line-height:1; }
.hero p { color: var(--muted); font-size: 18px; line-height:1.5; max-width: 740px; }
.btn { border:0; background: var(--panel2); color:var(--text); border:1px solid var(--border); border-radius: 14px; padding: 12px 16px; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; transition: transform .08s ease, background .15s ease; }
.btn:hover { background:#20304f; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, #f59e0b, #fb923c); color:#111827; border-color: rgba(255,255,255,.2); font-weight:800; }
.btn.success { background: linear-gradient(135deg, #16a34a, #22c55e); color:#052e16; font-weight:800; }
.btn.danger { background: linear-gradient(135deg, #ef4444, #f97316); color:white; font-weight:800; }
.btn.blue { background: linear-gradient(135deg, #0284c7, #38bdf8); color:#082f49; font-weight:800; }
.btn.full { width:100%; }
.btn.big { min-height: 64px; font-size: 20px; border-radius: 18px; }
.btn.status { min-height: 58px; font-size: 18px; background:#17233e; }
.btn.status.active { outline: 3px solid rgba(245,158,11,.45); background:#2a3654; }
.btn:disabled { opacity:.55; cursor:not-allowed; }
.input, select, textarea { width:100%; background:#0b1222; color:var(--text); border:1px solid var(--border); border-radius: 14px; padding: 13px 14px; outline:none; min-height: 46px; }
.input:focus, select:focus, textarea:focus { border-color: rgba(245,158,11,.7); box-shadow: 0 0 0 3px rgba(245,158,11,.12); }
label { display:block; color: var(--muted); font-size: 13px; margin: 10px 0 6px; }
.form-row { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.small { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.kpi { padding:16px; background:#0b1222; border:1px solid var(--border); border-radius:16px; }
.kpi .num { font-size: 30px; font-weight: 900; }
.kpi .label { color:var(--muted); }
.table-wrap { overflow:auto; border-radius: 16px; border:1px solid var(--border); }
table { width:100%; border-collapse: collapse; min-width: 720px; }
th, td { text-align:left; padding: 12px 14px; border-bottom:1px solid var(--border); vertical-align: middle; }
th { color:#cbd5e1; background:#0b1222; position:sticky; top:0; z-index:1; }
tr:hover td { background: rgba(255,255,255,.035); }
.pill { display:inline-flex; align-items:center; gap:6px; padding: 6px 10px; border-radius:999px; background:#24314d; border:1px solid var(--border); font-size:13px; font-weight:750; white-space:nowrap; }
.pill.live { background: rgba(34,197,94,.14); color:#86efac; border-color: rgba(34,197,94,.38); }
.pill.off { background: rgba(148,163,184,.12); color:#cbd5e1; }
.pill.warn { background: rgba(245,158,11,.14); color:#fcd34d; border-color: rgba(245,158,11,.38); }
.pill.danger { background: rgba(239,68,68,.14); color:#fca5a5; border-color: rgba(239,68,68,.38); }
.driver-wrap { min-height: 100vh; display:grid; place-items:center; padding: 16px; }
.phone-card { width:min(480px, 100%); }
.driver-title { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom: 12px; }
.driver-title h1 { margin:0; font-size: 28px; letter-spacing:-.03em; }
.status-banner { padding: 16px; border-radius: 18px; background:#0b1222; border:1px solid var(--border); margin: 12px 0; }
.status-banner.active { border-color: rgba(34,197,94,.55); box-shadow: 0 0 0 3px rgba(34,197,94,.09); }
.status-text { font-size: 28px; font-weight: 950; margin: 4px 0; }
.status-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.map-layout { display:grid; grid-template-columns: 1.05fr .95fr; gap:16px; align-items: stretch; }
#map, #detailMap { min-height: 520px; border-radius: var(--radius); overflow:hidden; border:1px solid var(--border); background:#0b1222; }
#detailMap { min-height: 300px; }
.side-panel { max-height: 720px; overflow:auto; }
.timeline { list-style:none; padding:0; margin:0; }
.timeline li { padding: 12px 0 12px 18px; border-left:2px solid var(--border); position:relative; }
.timeline li::before { content:''; position:absolute; left:-6px; top:18px; width:10px; height:10px; border-radius:999px; background:var(--accent); }
.toast-box { position: fixed; bottom: 18px; right: 18px; z-index: 9999; display:grid; gap:10px; width:min(380px, calc(100vw - 36px)); }
.toast { padding: 12px 14px; border-radius:14px; background:#0b1222; border:1px solid var(--border); box-shadow: var(--shadow); color: var(--text); }
.toast.error { border-color: rgba(239,68,68,.5); }
.toast.success { border-color: rgba(34,197,94,.5); }
.tabs { display:flex; gap:10px; flex-wrap:wrap; margin: 12px 0; }
.tab-btn.active { background: var(--accent); color:#111827; font-weight: 900; }
.tab { display:none; }
.tab.active { display:block; }
.footer-note { color:var(--muted); font-size: 12px; margin-top: 12px; line-height:1.5; }
.leaflet-container { color:#111; }

@media (max-width: 840px) {
  .page { padding: 14px; }
  .grid-2, .grid-3, .map-layout, .form-row { grid-template-columns: 1fr; }
  .topbar { align-items:flex-start; flex-direction:column; }
  .status-grid { grid-template-columns: 1fr; }
  #map { min-height: 420px; }
  table { min-width: 660px; }
}

/* Driver V2 - mobile-first, one-action workflow */
.driver-mobile-first { align-items: center; }
.driver-card-v2 { overflow: hidden; }
.driver-title-compact { margin-bottom: 14px; }
.btn-compact { min-height: 40px; padding: 9px 12px; border-radius: 13px; font-size: 14px; }
.driver-welcome-card {
  padding: 18px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 20% 0%, rgba(245,158,11,.20), transparent 36%),
    linear-gradient(180deg, rgba(15,23,42,.96), rgba(11,18,34,.96));
  border: 1px solid var(--border);
}
.start-day-card { min-height: 138px; display:grid; align-content:center; }
.driver-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(56,189,248,.12);
  border: 1px solid rgba(56,189,248,.28);
  color: #bae6fd;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.driver-badge.live { background: rgba(34,197,94,.14); border-color: rgba(34,197,94,.35); color: #bbf7d0; }
.driver-badge.off { background: rgba(148,163,184,.12); border-color: rgba(148,163,184,.25); color: #cbd5e1; }
.driver-main-action { min-height: 76px; font-size: 24px; border-radius: 24px; }
.driver-active-v2 { display:grid; gap: 14px; }
.driver-top-status { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.truck-line { margin-top: 8px; font-size: 17px; font-weight: 850; color: #e2e8f0; }
.gps-dot-wrap { display:flex; align-items:center; gap:7px; color: var(--muted); font-size:12px; background:#0b1222; border:1px solid var(--border); border-radius:999px; padding:8px 10px; white-space:nowrap; }
.gps-dot { width:8px; height:8px; background:#22c55e; border-radius:999px; box-shadow:0 0 0 4px rgba(34,197,94,.12); }
.driver-status-card {
  padding: 20px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 100% 10%, rgba(245,158,11,.22), transparent 34%),
    linear-gradient(180deg, rgba(23,35,62,.96), rgba(11,18,34,.98));
  border:1px solid rgba(245,158,11,.22);
  box-shadow: var(--shadow);
}
.uppercase { text-transform: uppercase; letter-spacing:.06em; font-weight:850; }
.driver-status-card h2 { margin: 6px 0 18px; font-size: clamp(34px, 9vw, 54px); letter-spacing:-.055em; line-height:.98; }
.driver-progress { display:grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.progress-step { display:grid; gap: 6px; align-content:start; min-width: 0; }
.progress-step span { display:block; height:8px; border-radius:999px; background: rgba(148,163,184,.20); border: 1px solid rgba(148,163,184,.18); }
.progress-step small { color: var(--muted); font-size: 10px; line-height:1.05; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.progress-step.done span { background: rgba(34,197,94,.55); border-color: rgba(34,197,94,.32); }
.progress-step.active span { background: linear-gradient(135deg, #f59e0b, #fb923c); border-color: rgba(255,255,255,.25); box-shadow:0 0 0 4px rgba(245,158,11,.12); }
.progress-step.active small { color:#fde68a; font-weight:900; }
.next-step-card { display:grid; gap:8px; }
.next-action {
  min-height: 104px;
  border-radius: 28px;
  background: linear-gradient(135deg, #f59e0b, #fb923c);
  color: #111827;
  border-color: rgba(255,255,255,.22);
  flex-direction: column;
  font-weight: 950;
  text-align: center;
  box-shadow: 0 18px 46px rgba(245, 158, 11, .18);
}
.next-action span { font-size: clamp(30px, 8vw, 46px); letter-spacing:-.04em; line-height:1; }
.next-action small { font-size: 13px; font-weight: 800; color: rgba(17,24,39,.78); }
.driver-info-strip { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini-kpi { background:#0b1222; border:1px solid var(--border); border-radius:18px; padding:12px 10px; text-align:center; }
.mini-kpi strong { display:block; font-size: 22px; line-height:1; }
.mini-kpi span { display:block; color:var(--muted); font-size: 12px; margin-top: 4px; }
.driver-secondary-actions { display:grid; grid-template-columns: 1.15fr .85fr; gap: 10px; }
.btn.issue { background: rgba(56,189,248,.10); border-color: rgba(56,189,248,.32); color:#e0f2fe; font-weight:850; }
.btn.end-day { background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.34); color:#fecaca; font-weight:850; }
.issue-panel {
  background:#0b1222;
  border:1px solid var(--border);
  border-radius:24px;
  padding:14px;
  display:grid;
  gap:12px;
}
.issue-panel-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.issue-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:8px; }
.issue-option { min-height:48px; border-radius:15px; background:#17233e; font-size:14px; font-weight:780; }
.pending-action {
  border:1px solid rgba(245,158,11,.38);
  background: rgba(245,158,11,.10);
  border-radius:22px;
  padding: 13px;
  box-shadow: 0 12px 40px rgba(245,158,11,.09);
}
.pending-top { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.cancel-pending { background:#0b1222; min-height:40px; border-radius:14px; font-weight:850; }
.pending-bar { height:9px; border-radius:999px; background:rgba(15,23,42,.85); overflow:hidden; margin-top:12px; border:1px solid rgba(255,255,255,.08); }
.pending-bar span { display:block; height:100%; background: linear-gradient(135deg, #f59e0b, #fb923c); border-radius:999px; transition: width .2s linear; }
.gps-note { text-align:center; }

@media (max-width: 540px) {
  html, body { min-height: 100dvh; }
  .driver-wrap { min-height: 100dvh; padding: 0; place-items: stretch; }
  .phone-card.driver-card-v2 {
    width: 100%;
    min-height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: calc(14px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
    box-shadow: none;
  }
  .driver-title h1 { font-size: 23px; }
  .driver-title-compact { align-items:center; }
  .btn-compact { min-height:38px; padding:8px 11px; }
  .driver-select-row { grid-template-columns: 1fr; }
  .driver-status-card { padding: 18px; border-radius: 24px; }
  .driver-status-card h2 { font-size: 42px; }
  .driver-progress { gap:4px; }
  .progress-step small { font-size:9px; }
  .next-action { min-height: 110px; border-radius: 26px; }
  .driver-info-strip { gap:7px; }
  .mini-kpi { padding: 11px 8px; border-radius:16px; }
  .mini-kpi strong { font-size: 20px; }
  .driver-secondary-actions { grid-template-columns: 1fr 1fr; }
  .issue-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 360px) {
  .driver-progress { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .driver-info-strip { grid-template-columns: 1fr; }
  .driver-secondary-actions { grid-template-columns: 1fr; }
}

/* Manager V1.2 - desktop-first live dispatch board */
.manager-page { padding: 20px; }
.manager-shell { width: min(1500px, 100%); }
.manager-app { display: grid; gap: 16px; }
.manager-topbar { position: sticky; top: 0; z-index: 35; padding: 10px 0; background: linear-gradient(180deg, rgba(15,23,42,.96), rgba(15,23,42,.76)); backdrop-filter: blur(12px); }
.compact-card { padding: 14px; }
.section-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom: 12px; }
.section-head h2 { margin:0; font-size: 20px; letter-spacing:-.03em; }
.section-head p { margin: 3px 0 0; }
.manager-summary-grid { display:grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 10px; }
.manager-kpi {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
  color: var(--text);
  border-radius: 18px;
  min-height: 86px;
  padding: 12px 10px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.manager-kpi span { display:block; font-size: clamp(22px, 2vw, 31px); font-weight: 950; line-height:1; letter-spacing:-.04em; }
.manager-kpi small { display:block; color: var(--muted); font-weight: 750; margin-top: 8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.manager-kpi:hover, .manager-kpi.active { border-color: rgba(245,158,11,.58); background: rgba(245,158,11,.10); }
.manager-kpi.danger { border-color: rgba(239,68,68,.25); }
.manager-kpi.danger span { color:#fecaca; }
.manager-kpi.danger.active, .manager-kpi.danger:hover { border-color: rgba(239,68,68,.62); background: rgba(239,68,68,.12); }
.muted-kpi { cursor: default; }
.muted-kpi:hover { border-color: var(--border); background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)); }
.toolbar-grid { display:grid; grid-template-columns: minmax(260px, 1.4fr) minmax(160px, .75fr) minmax(160px, .75fr) auto; gap: 12px; align-items:end; }
.toolbar-actions { display:flex; gap: 8px; flex-wrap:wrap; align-items:end; }
.btn.active, .tab-btn.active { background: var(--accent); color:#111827; font-weight: 900; border-color: rgba(255,255,255,.25); }
.manager-workspace { display:grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 16px; align-items:start; }
.manager-left-column { display:grid; gap:16px; min-width: 0; }
.manager-right-column { display:grid; gap:16px; position: sticky; top: 94px; min-width:0; }
.live-board-card { min-width: 0; }
.view-tabs { display:flex; gap:8px; }
.manager-table-wrap { max-height: 560px; }
.manager-table { min-width: 960px; }
.manager-table tr { cursor:pointer; }
.manager-table tr.row-attention td { background: rgba(239,68,68,.045); }
.manager-table tr.row-attention:hover td { background: rgba(239,68,68,.08); }
.truck-number { font-size: 18px; letter-spacing:-.02em; }
.tiny-alert { color:#fca5a5; font-size: 11px; font-weight:850; text-transform: uppercase; letter-spacing:.04em; }
#map { min-height: 470px; }
.map-card #map { min-height: 430px; }
.map-legend { display:flex; gap:8px; flex-wrap:wrap; margin-top: 12px; color: var(--muted); font-size:12px; }
.map-legend span { display:inline-flex; gap:6px; align-items:center; background:#0b1222; border:1px solid var(--border); border-radius:999px; padding:6px 9px; }
.map-legend i { width:10px; height:10px; border-radius:999px; display:inline-block; }
.truck-marker {
  min-width: 42px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  color:white;
  font-weight:950;
  font-size:12px;
  background: var(--marker-color);
  border: 2px solid white;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.truck-marker.attention { animation: pulseMarker 1.5s infinite; }
@keyframes pulseMarker { 0%,100%{ transform:scale(1);} 50%{ transform:scale(1.08);} }
.attention-list { display:grid; gap:10px; max-height: 390px; overflow:auto; padding-right:2px; }
.attention-item {
  width:100%;
  text-align:left;
  border:1px solid rgba(239,68,68,.32);
  background: rgba(239,68,68,.10);
  color:var(--text);
  border-radius: 16px;
  padding: 12px;
  cursor:pointer;
}
.attention-item:hover { background: rgba(239,68,68,.15); }
.attention-item div { display:flex; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.attention-item strong { font-size: 16px; }
.attention-item span { color: var(--muted); font-size: 13px; }
.attention-item p { color:#fecaca; margin:8px 0 0; font-weight:800; }
.empty-state { border:1px dashed var(--border); border-radius: 16px; padding: 18px; text-align:center; color: var(--muted); background: rgba(11,18,34,.55); }
.status-groups, .mini-groups { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.status-groups { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.status-group { border:1px solid var(--border); background:#0b1222; border-radius: 16px; padding: 10px; min-width:0; }
.status-group.large { min-height: 150px; }
.status-group-head { display:flex; justify-content:space-between; gap:8px; align-items:center; margin-bottom: 8px; color:#dbeafe; }
.status-group-head span { display:flex; gap:7px; align-items:center; font-weight:900; font-size: 13px; }
.status-group-head i { width:10px; height:10px; border-radius:999px; display:inline-block; }
.status-group-head b { background:#17233e; border:1px solid var(--border); padding:3px 8px; border-radius:999px; font-size:12px; }
.status-truck-list { display:grid; gap:7px; align-content:start; }
.truck-chip {
  border:1px solid var(--border);
  border-radius: 13px;
  background:#111c33;
  color:var(--text);
  text-align:left;
  padding:8px;
  display:grid;
  gap:2px;
  cursor:pointer;
}
.truck-chip strong { font-size:15px; }
.truck-chip span { color:#cbd5e1; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.truck-chip em { color:var(--muted); font-size:11px; font-style:normal; }
.truck-chip.attention { border-color: rgba(239,68,68,.45); background: rgba(239,68,68,.08); }
.empty-group { margin: 8px 0 4px; font-size:13px; }
.history-head { align-items:center; }
.history-actions { align-items:center; justify-content:flex-end; }
.history-actions .input { width: 180px; }
.history-actions #historySearch { width: 230px; }
.detail-drawer { position:fixed; inset:0; z-index: 1000; display:block; }
.drawer-backdrop { position:absolute; inset:0; background: rgba(2,6,23,.64); backdrop-filter: blur(4px); }
.drawer-panel {
  position:absolute;
  top:0;
  right:0;
  height:100dvh;
  width:min(720px, 100%);
  background: linear-gradient(180deg, #17233e, #0f172a);
  border-left:1px solid var(--border);
  box-shadow: -24px 0 70px rgba(0,0,0,.45);
  padding: 20px;
  overflow:auto;
}
.drawer-header { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:14px; }
.drawer-header h2 { margin: 3px 0; font-size: clamp(24px, 3vw, 36px); letter-spacing:-.04em; }
.drawer-kpis { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom:14px; }
.drawer-panel #detailMap { min-height: 330px; margin-bottom: 16px; }
.drawer-section h3 { margin: 0 0 10px; }

@media (max-width: 1180px) {
  .manager-summary-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .manager-workspace { grid-template-columns: 1fr; }
  .manager-right-column { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .manager-page { padding: 12px; }
  .manager-topbar { position: static; }
  .manager-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manager-kpi { min-height: 78px; }
  .toolbar-grid { grid-template-columns: 1fr; }
  .toolbar-actions { display:grid; grid-template-columns: 1fr 1fr; }
  .manager-right-column { grid-template-columns: 1fr; }
  .status-groups, .mini-groups { grid-template-columns: 1fr; }
  .section-head, .history-head { flex-direction:column; align-items:stretch; }
  .view-tabs { display:grid; grid-template-columns: 1fr 1fr; }
  .history-actions { display:grid; grid-template-columns: 1fr; width:100%; }
  .history-actions .input, .history-actions #historySearch { width:100%; }
  .map-card #map { min-height: 360px; }
  .drawer-panel { width:100%; padding: 14px; }
  .drawer-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 460px) {
  .manager-summary-grid { grid-template-columns: 1fr 1fr; gap:8px; }
  .manager-kpi small { font-size: 12px; }
  .manager-nav .btn { flex: 1 1 calc(50% - 8px); }
  .toolbar-actions { grid-template-columns:1fr; }
  .drawer-header { align-items:stretch; flex-direction:column; }
}

/* V1.3 bilingual + clearer driver identity/status */
.lang-toggle {
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:4px;
  border:1px solid var(--border);
  border-radius:999px;
  background:#0b1222;
  min-height:40px;
}
.lang-choice {
  border:0;
  min-height:30px;
  padding:5px 10px;
  border-radius:999px;
  color:var(--muted);
  background:transparent;
  cursor:pointer;
  font-weight:900;
  font-size:12px;
}
.lang-choice.active {
  color:#111827;
  background:linear-gradient(135deg, #f59e0b, #fb923c);
}
.driver-top-actions { display:flex; align-items:center; gap:8px; }
.driver-identity-card {
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px;
  border:1px solid rgba(56,189,248,.22);
  border-radius:20px;
  background:rgba(56,189,248,.07);
}
.driver-identity-card.active-identity { background:rgba(255,255,255,.045); border-color:var(--border); }
.driver-avatar {
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:16px;
  background:linear-gradient(135deg, #f59e0b, #fb923c);
  color:#111827;
  font-size:22px;
  flex:0 0 auto;
}
.driver-identity-card strong {
  display:block;
  font-size:19px;
  letter-spacing:-.02em;
}
.driver-identity-card span {
  display:block;
  color:var(--muted);
  font-size:13px;
  margin-top:2px;
}
.status-card-strong {
  position:relative;
  overflow:hidden;
  border-color:rgba(245,158,11,.45);
  box-shadow:0 18px 58px rgba(245,158,11,.12), var(--shadow);
}
.status-card-strong::before {
  content:'';
  position:absolute;
  inset:0 auto 0 0;
  width:7px;
  background:linear-gradient(180deg, #f59e0b, #22c55e);
  opacity:.95;
}
.status-label-large {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 11px;
  border-radius:999px;
  background:rgba(245,158,11,.14);
  border:1px solid rgba(245,158,11,.32);
  color:#fde68a;
  font-size:13px;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.status-label-large::before { content:'●'; color:#22c55e; font-size:10px; }
.status-card-strong h2 { text-transform:none; }

@media (max-width: 540px) {
  .driver-top-actions { gap:6px; }
  .lang-toggle { min-height:36px; padding:3px; }
  .lang-choice { min-height:28px; padding:4px 8px; }
  .driver-identity-card { padding:10px; }
  .driver-avatar { width:38px; height:38px; border-radius:14px; }
  .driver-identity-card strong { font-size:17px; }
  .driver-identity-card span { font-size:12px; }
  .status-label-large { font-size:12px; }
}

/* V1.4 security/consent/admin backup additions */
.consent-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(59, 130, 246, .35);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(14, 165, 233, .12), rgba(15, 23, 42, .9));
  margin: 4px 0 2px;
}
.consent-card p { margin: 6px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.consent-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: rgba(14,165,233,.16); font-size: 20px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; line-height: 1.35; color: var(--text); }
.check-row input { width: 18px; height: 18px; margin-top: 1px; accent-color: #22c55e; }
.security-grid { display:grid; grid-template-columns: 1fr 1fr; gap:16px; }
.backup-list { display:grid; gap:8px; margin-top:12px; }
.backup-item { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px; border:1px solid rgba(148,163,184,.18); border-radius:14px; background: rgba(15,23,42,.55); }
.audit-list { max-height:280px; overflow:auto; margin-top:12px; border:1px solid rgba(148,163,184,.18); border-radius:14px; }
.audit-row { display:grid; grid-template-columns: 145px 1fr 110px; gap:10px; padding:9px 10px; border-bottom:1px solid rgba(148,163,184,.12); font-size:12px; }
.audit-row:last-child { border-bottom:0; }
.audit-action { font-weight:800; color:#e5e7eb; }
.audit-details { color:var(--muted); }
@media (max-width: 760px) {
  .security-grid { grid-template-columns: 1fr; }
  .audit-row { grid-template-columns: 1fr; gap:3px; }
  .backup-item { align-items:flex-start; flex-direction:column; }
}
