/* ============================================================
   SENTINEL FLEET — enterprise design system
   ============================================================ */
@font-face {
  font-family: 'InterVar';
  src: url('vendor/fonts/inter.woff2') format('woff2');
  font-weight: 100 900; font-display: swap; font-style: normal;
}

:root {
  /* surfaces (elevation) */
  --bg:      #070a12;
  --s1:      #0b1120;
  --s2:      #101a2c;
  --s3:      #17223a;
  --panel:   rgba(15, 24, 42, 0.78);
  --glass:   rgba(18, 28, 49, 0.66);

  /* theming overlays (flip in light mode) */
  --ov: 255, 255, 255;
  --input-bg: rgba(0, 0, 0, 0.3);
  --map-bg: #070a12;

  /* lines */
  --line:    rgba(150, 168, 200, 0.10);
  --line-2:  rgba(150, 168, 200, 0.18);
  --hair:    rgba(var(--ov), 0.05);

  /* text */
  --text:    #e9eefb;
  --muted:   #97a4be;
  --faint:   #5d6a86;

  /* brand + status */
  --accent:  #34e0d0;
  --accent-2:#2a9df4;
  --grad:    linear-gradient(135deg, #3ee9d1, #2a9df4);
  --glow:    rgba(52, 224, 208, 0.40);
  --moving:  #2fe6c9;
  --idle:    #f6b64f;
  --offline: #6a7994;
  --danger:  #fb7185;

  /* metrics */
  --radius:  16px;
  --radius-sm: 11px;
  --radius-xs: 8px;
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.35);
  --shadow:    0 24px 70px rgba(0,0,0,0.55);
  --shadow-lg: 0 30px 90px rgba(0,0,0,0.6);
  --ease:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out:cubic-bezier(0.22, 0.61, 0.36, 1);
  --font: 'InterVar', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SFMono-Regular', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

/* ---------- Light theme ---------- */
:root[data-theme="light"] {
  --bg: #eef1f6;
  --s1: #ffffff;
  --s2: #ffffff;
  --s3: #eef1f6;
  --panel: rgba(255, 255, 255, 0.9);
  --glass: rgba(255, 255, 255, 0.94);
  --line: rgba(22, 32, 55, 0.11);
  --line-2: rgba(22, 32, 55, 0.18);
  --text: #16223c;
  --muted: #55627a;
  --faint: #8b97ac;
  --accent: #0e9e90;
  --accent-2: #2678cf;
  --grad: linear-gradient(135deg, #12b3a3, #2678cf);
  --glow: rgba(14, 158, 144, 0.22);
  --moving: #0f9d6b;
  --idle: #b45309;
  --offline: #6b7a93;
  --danger: #e11d48;
  --shadow-sm: 0 2px 10px rgba(22, 32, 55, 0.10);
  --shadow: 0 20px 50px rgba(22, 32, 55, 0.16);
  --shadow-lg: 0 24px 60px rgba(22, 32, 55, 0.2);
  --ov: 22, 32, 55;
  --input-bg: rgba(22, 32, 55, 0.05);
  --map-bg: #e6ebf3;
}
:root[data-theme="light"] .topbar { background: linear-gradient(180deg, #ffffff, #f5f8fc); }
:root[data-theme="light"] .map-scrim { box-shadow: inset 0 0 100px rgba(22, 32, 55, 0.08); }
:root[data-theme="light"] .veh-label,
:root[data-theme="light"] .leaflet-tooltip.gf-label { background: rgba(255, 255, 255, 0.92); color: #16223c; }
:root[data-theme="light"] .veh-disc { background: rgba(255, 255, 255, 0.78); }
:root[data-theme="light"] .leaflet-control-attribution { background: rgba(255, 255, 255, 0.8) !important; }
:root[data-theme="light"] .field input:focus { background: var(--input-bg); }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.006em;
}
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.logo { width: 34px; height: 34px; flex: none; }

/* ============================================================ LOGIN */
.login-screen {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background:
    radial-gradient(1100px 620px at 78% -8%, rgba(42,157,244,0.14), transparent 55%),
    radial-gradient(900px 560px at 8% 108%, rgba(52,224,208,0.13), transparent 55%),
    var(--bg);
}
.login-aurora {
  position: absolute; width: 620px; height: 620px; border-radius: 50%;
  background: conic-gradient(from 120deg, rgba(52,224,208,0.16), rgba(42,157,244,0.14), rgba(52,224,208,0.16));
  filter: blur(80px); opacity: 0.55; pointer-events: none;
  animation: spin 26s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-card {
  position: relative; width: min(410px, 92vw);
  background: var(--glass); backdrop-filter: blur(26px);
  border: 1px solid var(--line-2); border-radius: 22px;
  padding: 38px 34px; box-shadow: var(--shadow-lg);
}
.login-card::before {
  content: ''; position: absolute; inset: 0; border-radius: 22px; padding: 1px;
  background: linear-gradient(160deg, rgba(52,224,208,0.5), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.login-brand { display: flex; align-items: center; gap: 15px; margin-bottom: 30px; }
.login-brand .logo { width: 46px; height: 46px; }
.login-brand h1 { font-size: 23px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.tagline { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); letter-spacing: 0.01em; }

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 7px;
}
.field input, .search input {
  width: 100%; padding: 12px 14px;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 15px; outline: none; transition: border-color .18s, box-shadow .18s, background .18s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); background: rgba(0,0,0,0.4); }

.btn-primary {
  position: relative; width: 100%; padding: 13px; margin-top: 4px;
  background: var(--grad); color: #04231f; font-weight: 700; font-size: 15px;
  border-radius: var(--radius-sm); overflow: hidden;
  box-shadow: 0 10px 30px rgba(52,224,208,0.30); transition: transform .1s, box-shadow .2s, filter .2s;
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 14px 40px rgba(52,224,208,0.45); }
.btn-primary:active { transform: translateY(1px); }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 2px 0 8px; }
.login-foot { margin-top: 22px; text-align: center; font-size: 12px; color: var(--faint); }

/* ============================================================ APP */
.app { display: flex; flex-direction: column; height: 100vh; }

/* ---- Topbar ---- */
.topbar {
  height: 64px; flex: 0 0 64px;
  display: flex; align-items: center; gap: 22px; padding: 0 20px;
  background: linear-gradient(180deg, rgba(11,17,32,0.96), rgba(9,13,24,0.92));
  border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
  position: relative; z-index: 30;
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(52,224,208,0.35), transparent);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text span { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand-text em {
  font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: 0.22em;
  color: var(--accent); margin-top: 3px;
}

/* KPI chips */
.kpis { display: flex; gap: 10px; align-items: stretch; }
.kpi {
  display: flex; align-items: center; gap: 11px; padding: 8px 15px 8px 12px;
  background: linear-gradient(180deg, rgba(var(--ov),0.035), rgba(var(--ov),0.012));
  border: 1px solid var(--line); border-radius: 13px; min-width: 96px;
  transition: border-color .2s, transform .12s, background .2s; cursor: pointer;
}
.kpi:hover { border-color: var(--line-2); transform: translateY(-1px); }
.kpi.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.kpi-ico { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px;
  background: rgba(var(--ov),0.04); color: var(--muted); }
.kpi-ico .icon { width: 16px; height: 16px; }
.kpi-body { display: flex; flex-direction: column; line-height: 1.1; }
.kpi-body b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-body i { font-style: normal; font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.kpi-moving b { color: var(--moving); }
.kpi-wide { min-width: 92px; }
.kpi-wide .kpi-body b { color: var(--accent-2); }

.pulse-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--moving); box-shadow: 0 0 0 0 var(--moving); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(47,230,201,0.5)} 70%{box-shadow:0 0 0 9px rgba(47,230,201,0)} 100%{box-shadow:0 0 0 0 rgba(47,230,201,0)} }
.sq-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sq-dot.idle { background: var(--idle); }
.sq-dot.offline { background: var(--offline); }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.live-badge { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em; color: var(--moving); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--moving); box-shadow: 0 0 8px var(--moving); animation: pulse 1.8s infinite; }
.clock { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.clock .icon { width: 15px; height: 15px; opacity: 0.7; }
.clock span { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.usermenu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px;
  background: rgba(var(--ov),0.04); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; transition: border-color .2s; }
.user-btn:hover { border-color: var(--line-2); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #04231f; font-weight: 800; font-size: 12px; }
.chev { width: 14px; height: 14px; opacity: 0.6; }
.user-dropdown { position: absolute; right: 0; top: 46px; min-width: 200px;
  background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); overflow: hidden; z-index: 50; }
.ud-head { padding: 13px 15px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.ud-head b { font-size: 14px; } .ud-head i { font-style: normal; font-size: 11px; color: var(--muted); text-transform: capitalize; }
.user-dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 12px 15px; font-size: 13px; color: var(--text); }
.user-dropdown button:hover { background: rgba(var(--ov),0.05); }
.user-dropdown .icon { width: 16px; height: 16px; color: var(--muted); }

/* ---- Body ---- */
.body { flex: 1; display: flex; min-height: 0; }

/* Sidebar */
.sidebar { width: 332px; flex: 0 0 332px; background: var(--s1); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; }
.sidebar-head { display: flex; align-items: center; gap: 10px; padding: 18px 18px 12px;
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.count-chip { font-size: 12px; font-weight: 700; color: var(--muted); background: rgba(var(--ov),0.05);
  border: 1px solid var(--line); padding: 2px 9px; border-radius: 999px; }
.segmented { display: flex; gap: 3px; margin: 0 16px 12px; padding: 4px; background: var(--input-bg); border: 1px solid var(--line); border-radius: 11px; }
.segmented button { flex: 1; padding: 7px 0; font-size: 12px; font-weight: 600; color: var(--muted); border-radius: 8px; transition: color .15s, background .15s; }
.segmented button.active { color: var(--text); background: rgba(var(--ov),0.07); box-shadow: var(--shadow-sm); }
.segmented button:hover:not(.active) { color: var(--text); }

.search { display: flex; align-items: center; gap: 9px; margin: 0 16px 8px; padding: 0 12px;
  background: var(--input-bg); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .18s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.search .icon { width: 16px; height: 16px; color: var(--faint); }
.search input { border: none; background: none; padding: 11px 0; }
.search input:focus { box-shadow: none; }

.vehicle-list { flex: 1; overflow-y: auto; padding: 6px 10px 10px; }
.vehicle-list::-webkit-scrollbar { width: 9px; }
.vehicle-list::-webkit-scrollbar-thumb { background: rgba(var(--ov),0.08); border-radius: 8px; border: 2px solid var(--s1); }
.vehicle-list::-webkit-scrollbar-thumb:hover { background: rgba(var(--ov),0.14); }

.vehicle { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 13px; margin-bottom: 6px;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: rgba(var(--ov),0.018);
  transition: background .14s, border-color .14s, transform .1s; cursor: pointer; }
.vehicle::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: transparent; transition: background .15s; }
.vehicle:hover { background: rgba(var(--ov),0.05); border-color: var(--line); }
.vehicle.active { background: linear-gradient(90deg, rgba(52,224,208,0.12), rgba(52,224,208,0.02)); border-color: rgba(52,224,208,0.4); }
.vehicle.active::before { background: var(--accent); }

.v-badge { position: relative; width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center;
  background: rgba(var(--ov),0.04); border: 1px solid var(--line); color: var(--muted); }
.v-badge .icon { width: 19px; height: 19px; }
.v-badge.lg { width: 46px; height: 46px; }
.v-badge .status-dot { position: absolute; right: -3px; top: -3px; border: 2.5px solid var(--s1); }
.detail .v-badge .status-dot { border-color: var(--s2); }
.v-main { flex: 1; min-width: 0; }
.v-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.v-sub .mono { color: var(--faint); }
.v-right { text-align: right; }
.v-right b { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.v-right i { display: block; font-style: normal; font-size: 10px; color: var(--faint); letter-spacing: 0.04em; }

.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.st-moving { background: var(--moving); box-shadow: 0 0 9px var(--moving); }
.st-idle { background: var(--idle); }
.st-offline { background: var(--offline); }

.sidebar-foot { padding: 11px 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--faint); display: flex; align-items: center; gap: 7px; }

/* ---- Map ---- */
.map-wrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: var(--map-bg); }
.map-scrim { position: absolute; inset: 0; pointer-events: none; z-index: 400;
  box-shadow: inset 0 0 160px rgba(0,0,0,0.55); }
.leaflet-container { background: var(--map-bg); font-family: var(--font); }
.leaflet-control-attribution { background: rgba(7,10,18,0.7) !important; color: var(--faint) !important; font-size: 10px !important; border-radius: 6px 0 0 0 !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-control-zoom { border: none !important; box-shadow: var(--shadow-sm) !important; }
.leaflet-bar a { background: var(--s2) !important; color: var(--text) !important; border-color: var(--line) !important; width: 32px !important; height: 32px !important; line-height: 32px !important; }
.leaflet-bar a:hover { background: var(--s3) !important; }

.map-controls { position: absolute; right: 14px; top: 14px; z-index: 410; display: flex; flex-direction: column; gap: 8px; }
.mc-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px;
  background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--line-2); color: var(--text); box-shadow: var(--shadow-sm); transition: border-color .18s, transform .1s; }
.mc-btn:hover { border-color: var(--accent); }
.mc-btn:active { transform: scale(0.94); }

/* markers */
.veh-marker { will-change: transform; }
.veh-arrow { width: 34px; height: 34px; position: relative; display: grid; place-items: center; }
.veh-disc { position: absolute; inset: 4px; border-radius: 50%; background: rgba(7,10,18,0.55);
  border: 1.5px solid currentColor; box-shadow: 0 2px 8px rgba(0,0,0,0.6), inset 0 0 8px rgba(0,0,0,0.4); }
.veh-arrow svg { position: relative; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.7)); }
.veh-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid currentColor; opacity: 0; }
.veh-arrow.moving .veh-ring { animation: ring 2s ease-out infinite; }
@keyframes ring { 0%{transform:scale(0.55);opacity:0.7} 100%{transform:scale(1.7);opacity:0} }
.veh-label { position: absolute; top: 37px; left: 50%; transform: translateX(-50%);
  background: rgba(7,10,18,0.9); border: 1px solid var(--line-2); padding: 3px 8px; border-radius: 7px;
  font-size: 11px; font-weight: 600; white-space: nowrap; color: var(--text); pointer-events: none; box-shadow: var(--shadow-sm); }
.veh-marker.sel .veh-disc { box-shadow: 0 0 0 3px var(--glow), 0 2px 10px rgba(0,0,0,0.7); }

/* ---- Detail: instrument cluster ---- */
.detail { position: absolute; right: 16px; top: 16px; bottom: 16px; width: 372px; z-index: 420;
  background: var(--panel); backdrop-filter: blur(24px); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 20px; overflow-y: auto;
  animation: slideIn .4s var(--ease); }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.detail::-webkit-scrollbar { width: 8px; } .detail::-webkit-scrollbar-thumb { background: rgba(var(--ov),0.08); border-radius: 8px; }
.detail-close { position: absolute; right: 14px; top: 14px; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); display: grid; place-items: center; transition: background .15s, color .15s; }
.detail-close:hover { background: rgba(var(--ov),0.06); color: var(--text); }

.detail-head { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; padding-right: 30px; }
.detail-head h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.d-imei { font-size: 12px; color: var(--faint); margin-top: 3px; }
.d-status-tag { margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); }
.d-status-tag.moving { color: var(--moving); border-color: rgba(47,230,201,0.4); background: rgba(47,230,201,0.08); }
.d-status-tag.idle { color: var(--idle); border-color: rgba(246,182,79,0.4); background: rgba(246,182,79,0.08); }
.d-status-tag.offline { color: var(--offline); }

.cluster { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
.speedo { position: relative; width: 128px; height: 128px; flex: none; }
.speedo-svg { width: 128px; height: 128px; transform: rotate(135deg); }
.speedo-track { fill: none; stroke: rgba(var(--ov),0.07); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 235.6 314.16; }
.speedo-arc { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 0 1000; filter: drop-shadow(0 0 6px var(--glow)); transition: stroke-dasharray .6s var(--ease), stroke .3s; }
.speedo-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.speedo-center b { font-size: 38px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.speedo-center i { font-style: normal; font-size: 11px; color: var(--muted); letter-spacing: 0.05em; }

.metric-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.metric { display: flex; align-items: center; gap: 10px; padding: 10px 11px;
  background: rgba(var(--ov),0.03); border: 1px solid var(--line); border-radius: var(--radius-xs); }
.metric .icon { width: 17px; height: 17px; color: var(--accent); opacity: 0.85; }
.metric i { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); letter-spacing: 0.02em; }
.metric b { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }

.spark-card { background: rgba(var(--ov),0.025); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px 8px; margin-bottom: 16px; }
.spark-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); letter-spacing: 0.03em; margin-bottom: 6px; text-transform: uppercase; }
.spark { width: 100%; height: 56px; display: block; }

.detail-rows { border-top: 1px solid var(--line); padding-top: 14px; margin-bottom: 16px; }
.detail-rows .row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 11px; }
.detail-rows .row i { display: flex; align-items: center; gap: 8px; font-style: normal; color: var(--muted); }
.detail-rows .row i .icon { width: 15px; height: 15px; opacity: 0.6; }

.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-ghost { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 11px; font-size: 13px; font-weight: 600;
  background: rgba(var(--ov),0.04); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .15s, background .15s, color .15s; }
.btn-ghost .icon { width: 16px; height: 16px; }
.btn-ghost:hover { border-color: var(--line-2); background: rgba(var(--ov),0.07); }
.btn-ghost.on { border-color: var(--accent); color: var(--accent); background: rgba(52,224,208,0.12); }

/* ---- Modal ---- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(4,7,14,0.65); backdrop-filter: blur(4px); }
.modal-card { width: min(380px, 92vw); background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-lg); }
.modal-card h3 { margin: 0 0 20px; font-size: 18px; }
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal-actions .btn-primary, .modal-actions .btn-ghost { margin-top: 0; }

/* ---- Playback / history ---- */
.playback {
  position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 420;
  background: var(--panel); backdrop-filter: blur(24px);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 14px 16px; animation: slideUp .35s var(--ease);
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.pb-top { display: flex; align-items: center; gap: 14px; margin-bottom: 13px; }
.pb-title { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.pb-title .icon { width: 16px; height: 16px; color: var(--accent); }
.pb-title b { color: var(--text); font-size: 14px; }
.pb-ranges { display: flex; gap: 3px; padding: 3px; background: var(--input-bg); border: 1px solid var(--line); border-radius: 9px; }
.pb-ranges button { padding: 5px 12px; font-size: 12px; font-weight: 600; color: var(--muted); border-radius: 6px; }
.pb-ranges button.active { color: var(--text); background: rgba(var(--ov),0.08); }
.pb-trips { margin-left: auto; background: var(--input-bg); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 12px; max-width: 230px; }
.pb-close { width: 30px; height: 30px; border-radius: 8px; color: var(--muted); display: grid; place-items: center; }
.pb-close:hover { background: rgba(var(--ov),0.06); color: var(--text); }
.pb-controls { display: flex; align-items: center; gap: 14px; }
.pb-play { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--grad); color: #04231f; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(52,224,208,0.3); transition: transform .1s, filter .2s; }
.pb-play:hover { filter: brightness(1.05); }
.pb-play:active { transform: scale(0.94); }
.pb-play svg { width: 18px; height: 18px; fill: #04231f; stroke: none; }
.pb-speed { flex: none; min-width: 46px; padding: 8px 10px; font-size: 13px; font-weight: 700; color: var(--accent); background: rgba(52,224,208,0.1); border: 1px solid rgba(52,224,208,0.3); border-radius: 9px; }
.pb-time { flex: none; min-width: 168px; text-align: right; font-size: 12.5px; color: var(--muted); }
.pb-stats { margin-top: 11px; font-size: 12px; color: var(--faint); letter-spacing: 0.02em; }
#scrubber { flex: 1; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 6px;
  background: linear-gradient(90deg, var(--accent) var(--pct,0%), rgba(var(--ov),0.10) var(--pct,0%)); outline: none; }
#scrubber::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px var(--glow), 0 2px 6px rgba(0,0,0,0.5); cursor: pointer; }
#scrubber::-moz-range-thumb { width: 16px; height: 16px; border: none; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px var(--glow); cursor: pointer; }

/* ---- Phase 3: tabs / zones / alerts ---- */
.side-tabs { display: flex; padding: 10px 14px 0; gap: 4px; border-bottom: 1px solid var(--line); }
.side-tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 0; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.side-tabs button .icon { width: 16px; height: 16px; }
.side-tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.side-tabs button:hover:not(.active) { color: var(--text); }
.side-tabs button .tab-badge { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #2a0a10; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.tab-pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.alerts-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.ap-list.side { padding: 6px 8px; }
.ap-list.side .ap-empty { padding: 26px 14px; }

.add-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: #04231f; background: var(--grad); border-radius: 8px; }
.add-btn .icon { width: 15px; height: 15px; }
.add-btn.on { background: rgba(52,224,208,0.14); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.add-btn.alt { margin-left: 6px; background: rgba(var(--ov),0.06); color: var(--accent); box-shadow: inset 0 0 0 1px var(--line-2); }
.add-btn.alt.on { background: rgba(52,224,208,0.14); box-shadow: inset 0 0 0 1px var(--accent); }

.rules { margin: 12px 16px; padding: 13px 14px; background: rgba(var(--ov),0.025); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.rules-title { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.rules-title .icon { width: 14px; height: 14px; color: var(--idle); }
.rule-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin-bottom: 12px; }
.rule-inp { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.rule-inp input { width: 58px; padding: 6px 8px; background: var(--input-bg); border: 1px solid var(--line); border-radius: 7px; color: var(--text); font-size: 13px; text-align: right; }
.rule-inp input:focus { border-color: var(--accent); outline: none; }
.rule-toggle { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text); margin-bottom: 9px; cursor: pointer; }
.rule-toggle input { width: 15px; height: 15px; accent-color: var(--accent); }
.rule-toggle:last-child { margin-bottom: 0; }

.zone-list { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.zone { display: flex; align-items: center; gap: 11px; padding: 11px 12px; margin-bottom: 6px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(var(--ov),0.02); }
.zone-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }
.zone-main { flex: 1; min-width: 0; }
.zone-name { font-size: 13.5px; font-weight: 600; }
.zone-sub { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.zone-del { width: 28px; height: 28px; border-radius: 7px; color: var(--muted); display: grid; place-items: center; }
.zone-del:hover { background: rgba(251,113,133,0.14); color: var(--danger); }
.zone-del .icon { width: 15px; height: 15px; }
.draw-hint { margin: 6px 16px 14px; padding: 11px 13px; font-size: 12px; color: var(--accent); background: rgba(52,224,208,0.08); border: 1px solid rgba(52,224,208,0.3); border-radius: var(--radius-sm); line-height: 1.5; }

.bell { position: relative; width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); background: rgba(var(--ov),0.04); }
.bell:hover { color: var(--text); border-color: var(--line-2); }
.bell.ring { color: var(--idle); animation: bellring .6s ease; }
@keyframes bellring { 0%,100%{transform:rotate(0)} 20%{transform:rotate(12deg)} 40%{transform:rotate(-10deg)} 60%{transform:rotate(6deg)} 80%{transform:rotate(-4deg)} }
.badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #2a0a10; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--s1); }

.alerts-panel { position: fixed; top: 66px; right: 16px; width: 360px; max-height: 72vh; z-index: 60; display: flex; flex-direction: column;
  background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; animation: slideIn .25s var(--ease); }
.ap-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ap-head b { font-size: 15px; }
.ap-head button { font-size: 12px; color: var(--accent); }
.ap-head button:hover { text-decoration: underline; }
.ap-list { overflow-y: auto; padding: 6px; }
.alert-item { display: flex; gap: 11px; padding: 11px 12px; border-radius: var(--radius-sm); }
.alert-item:hover { background: rgba(var(--ov),0.03); }
.alert-item.unread { background: rgba(52,224,208,0.05); }
.a-ico { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; }
.a-ico .icon { width: 16px; height: 16px; }
.a-geofence_enter, .a-geofence_exit { background: rgba(52,224,208,0.12); color: var(--accent); }
.a-overspeed { background: rgba(251,113,133,0.14); color: var(--danger); }
.a-ignition { background: rgba(246,182,79,0.14); color: var(--idle); }
.a-tamper { background: rgba(251,113,133,0.2); color: var(--danger); }
.a-harsh_driving { background: rgba(246,182,79,0.14); color: var(--idle); }
.a-low_battery { background: rgba(246,182,79,0.14); color: var(--idle); }
.a-maintenance { background: rgba(52,224,208,0.12); color: var(--accent); }
.a-fatigue { background: rgba(246,182,79,0.14); color: var(--idle); }
.a-main { flex: 1; min-width: 0; }
.a-msg { font-size: 13px; line-height: 1.4; }
.a-time { font-size: 11px; color: var(--faint); margin-top: 3px; }
.ap-empty { padding: 36px 16px; text-align: center; color: var(--faint); font-size: 13px; }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 11px; padding: 12px 16px; min-width: 300px; max-width: 420px; background: var(--s2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg); animation: toastIn .3s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(16px); } }
.toast .a-ico { width: 30px; height: 30px; }
.toast .t-msg { font-size: 13px; }

.leaflet-tooltip.gf-label { background: rgba(7,10,18,0.85); border: 1px solid var(--line-2); color: var(--text); padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; box-shadow: var(--shadow-sm); }
.leaflet-tooltip.gf-label::before { display: none; }

/* ---- Phase 4: management ---- */
.manage-btn { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text); background: rgba(var(--ov),0.04); border: 1px solid var(--line); }
.manage-btn:hover { border-color: var(--line-2); }
.manage-btn .icon { width: 16px; height: 16px; }

.manage-overlay { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(4,7,14,0.6); backdrop-filter: blur(6px); }
.manage-panel { width: min(1040px, 94vw); height: min(720px, 90vh); display: flex; flex-direction: column; background: var(--s1); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; animation: slideIn .3s var(--ease); }
.manage-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.manage-title { display: flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 700; }
.manage-title .icon { width: 20px; height: 20px; color: var(--accent); }
.manage-close { width: 34px; height: 34px; border-radius: 9px; color: var(--muted); display: grid; place-items: center; }
.manage-close:hover { background: rgba(var(--ov),0.06); color: var(--text); }
.manage-body { flex: 1; display: flex; min-height: 0; }
.manage-nav { width: 210px; flex: none; border-right: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.manage-nav button { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; color: var(--muted); text-align: left; }
.manage-nav button .icon { width: 18px; height: 18px; }
.manage-nav button:hover { color: var(--text); background: rgba(var(--ov),0.04); }
.manage-nav button.active { color: var(--text); background: rgba(52,224,208,0.10); box-shadow: inset 0 0 0 1px rgba(52,224,208,0.3); }
.manage-content { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 18px 22px; }
.mc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mc-head h3 { margin: 0; font-size: 17px; }
.mc-table-wrap { flex: 1; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.mc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mc-table thead th { position: sticky; top: 0; background: var(--s2); text-align: left; padding: 11px 14px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.mc-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--hair); }
.mc-table tbody tr:hover { background: rgba(var(--ov),0.02); }
.mc-table tbody tr:last-child td { border-bottom: none; }
.mc-actions { display: flex; gap: 4px; justify-content: flex-end; }
.mc-actions button { width: 30px; height: 30px; border-radius: 7px; color: var(--muted); display: grid; place-items: center; }
.mc-actions button:hover { background: rgba(var(--ov),0.06); color: var(--text); }
.mc-actions button.del:hover { background: rgba(251,113,133,0.14); color: var(--danger); }
.mc-actions .icon { width: 15px; height: 15px; }
.mc-empty td { padding: 40px !important; text-align: center; color: var(--faint); font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: rgba(var(--ov),0.05); border: 1px solid var(--line); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.due-badge { padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.due-badge.due { color: var(--idle); background: rgba(246,182,79,0.14); }
.due-badge.overdue { color: var(--danger); background: rgba(251,113,133,0.16); }

.rec-field { margin-bottom: 13px; }
.rec-field > label { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.rec-field input, .rec-field select { width: 100%; padding: 10px 12px; background: var(--input-bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; outline: none; }
.rec-field input:focus, .rec-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.rec-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#recModal .modal-card { width: min(470px, 94vw); }
#recFields { max-height: 60vh; overflow-y: auto; padding-right: 4px; }

.veh-profile { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.veh-profile:empty { display: none; }

/* ---- Phase 5: reports / users / settings ---- */
.nav-div { height: 1px; background: var(--line); margin: 8px 6px; }
.mc-custom { flex: 1; overflow-y: auto; }
.mc-table-wrap.hidden, .mc-custom.hidden { display: none; }

.rep-bar { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.rep-field { display: flex; flex-direction: column; gap: 6px; }
.rep-field label { font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); }
.rep-field input, .rep-field select { padding: 9px 11px; background: var(--input-bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; outline: none; }
.rep-field input:focus, .rep-field select:focus { border-color: var(--accent); }
.rep-bar .add-btn { padding: 10px 16px; }
.rep-csv { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--text); background: rgba(var(--ov),0.04); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.rep-csv:hover { border-color: var(--accent); color: var(--accent); }
.rep-csv .icon { width: 15px; height: 15px; }

.role-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: capitalize; }
.role-chip.admin { color: var(--accent); background: rgba(52,224,208,0.12); }
.role-chip.manager { color: var(--idle); background: rgba(246,182,79,0.12); }
.role-chip.viewer { color: var(--muted); background: rgba(var(--ov),0.05); }

.settings-form { max-width: 460px; }
.settings-form .rec-field { margin-bottom: 18px; }
.settings-form .hint { font-size: 11.5px; color: var(--faint); margin-top: 5px; }
.settings-form .btn-primary { max-width: 200px; }

body:not(.role-admin) .manage-nav [data-sec="users"],
body:not(.role-admin) .manage-nav [data-sec="settings"],
body:not(.role-admin) .manage-nav .nav-div { display: none; }
body.role-viewer .add-btn,
body.role-viewer .mc-actions,
body.role-viewer #addZoneBtn,
body.role-viewer .zone-del { display: none !important; }
body.role-viewer .rules { opacity: 0.55; pointer-events: none; }

/* ---- Maintenance calendar ---- */
.cal-head { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 14px; }
.cal-head h3 { margin: 0; min-width: 190px; text-align: center; font-size: 16px; }
.cal-nav { width: 34px; height: 34px; border-radius: 9px; font-size: 20px; color: var(--muted); border: 1px solid var(--line); }
.cal-nav:hover { color: var(--text); border-color: var(--accent); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: 4px 0; }
.cal-cell { min-height: 78px; border: 1px solid var(--line); border-radius: 9px; padding: 5px; background: rgba(var(--ov),0.02); }
.cal-cell.empty { border: none; background: none; }
.cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-day { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.cal-cell.today .cal-day { color: var(--accent); }
.cal-ev { font-size: 10px; padding: 2px 5px; border-radius: 5px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.due { background: rgba(246,182,79,0.18); color: var(--idle); }
.cal-ev.overdue { background: rgba(251,113,133,0.18); color: var(--danger); }

/* ---- Print (PDF export) ---- */
#printArea { display: none; }
@media print {
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block !important; padding: 8px; color: #000; background: #fff; font-family: var(--font); }
  #printArea * { color: #000 !important; }
  #printArea .ph { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
  #printArea .psub { font-size: 12px; color: #555 !important; margin-bottom: 14px; }
  #printArea table { width: 100%; border-collapse: collapse; margin-top: 8px; }
  #printArea th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 2px solid #000; padding: 6px 8px; }
  #printArea td { font-size: 12px; border-bottom: 1px solid #ccc; padding: 6px 8px; }
  #printArea .pfoot { margin-top: 22px; font-size: 10px; color: #888 !important; }
  @page { margin: 1.4cm; }
}

/* ---- Responsive ---- */
@media (max-width: 1080px) { .kpi-wide { display: none; } }
@media (max-width: 900px) { .kpis { display: none; } }
/* mobile chrome — hidden on desktop */
.menu-btn { display: none; width: 38px; height: 38px; border-radius: 10px; color: var(--text); place-items: center; }
.menu-btn .icon { width: 21px; height: 21px; }
.nav-backdrop { display: none; }

@media (max-width: 720px) {
  .menu-btn { display: grid; }
  .topbar { height: 56px; flex-basis: 56px; gap: 10px; padding: 0 12px; }
  .brand-text em { display: none; }
  .brand-text span { font-size: 15px; }
  .clock { display: none; }
  .top-right { gap: 9px; }
  .live-badge span { display: none; }
  .manage-btn span { display: none; }
  .manage-btn { padding: 8px; }
  .user-btn #userName, .chev { display: none; }
  .user-btn { padding: 5px; }

  /* sidebar → slide-in drawer */
  .sidebar { position: fixed; top: 56px; bottom: 0; left: 0; width: 84vw; max-width: 330px; z-index: 45;
    transform: translateX(-103%); transition: transform .28s var(--ease); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  .nav-backdrop { display: block; position: fixed; top: 56px; left: 0; right: 0; bottom: 0; z-index: 44;
    background: rgba(0, 0, 0, 0.5); opacity: 0; pointer-events: none; transition: opacity .28s; }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

  /* detail → bottom sheet */
  .detail { left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-height: 64vh;
    border-radius: 18px 18px 0 0; animation: sheetUp .3s var(--ease); }
  @keyframes sheetUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

  /* playback → full-width bottom */
  .playback { left: 0; right: 0; bottom: 0; border-radius: 16px 16px 0 0; }
  .pb-top { flex-wrap: wrap; gap: 8px; }
  .pb-trips { margin-left: 0; }
  .pb-time { min-width: 0; }

  /* alerts panel → near full width */
  .alerts-panel { top: 56px; left: 8px; right: 8px; width: auto; max-height: 72vh; }

  /* manage overlay → full screen, horizontal nav */
  .manage-panel { width: 100vw; height: 100vh; max-width: none; border-radius: 0; }
  .manage-body { flex-direction: column; }
  .manage-nav { width: 100%; flex-direction: row; overflow-x: auto; border-right: none;
    border-bottom: 1px solid var(--line); padding: 8px; gap: 6px; flex: 0 0 auto; }
  .manage-nav button { flex: 0 0 auto; white-space: nowrap; }
  .manage-nav .nav-div { display: none; }
  .manage-content { padding: 14px; }
  .mc-table thead th, .mc-table tbody td { padding: 9px 10px; }
  #recModal .modal-card { width: calc(100vw - 28px); }
}
