/* ==================================================================
   TrackPro — dashboard styles
   ================================================================== */
:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #0d9488;
  --primary-600: #0f766e;
  --primary-soft: #ccfbf1;
  --nav: #0b1220;
  --nav-2: #111c31;
  --green: #16a34a;
  --amber: #f59e0b;
  --red: #dc2626;
  --grey: #94a3b8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
}

body { overflow: hidden; }

.hidden { display: none !important; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ----------------------------- Buttons ---------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  background: #fff;
  color: var(--ink);
  border-radius: 9px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-600); }
.btn.ghost { border-color: var(--line); background: #fff; color: var(--ink); }
.btn.ghost:hover { background: #f8fafc; }
.btn.danger { background: #fef2f2; color: var(--red); border-color: #fecaca; }
.btn.danger:hover { background: #fee2e2; }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn.xs { padding: 4px 9px; font-size: 11px; }
.btn.full { width: 100%; }
.btn.icon { width: 34px; height: 34px; padding: 0; border-radius: 9px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ----------------------------- Inputs ----------------------------- */
.input, select, input[type="date"], input[type="datetime-local"], input[type="number"],
input[type="email"], input[type="password"], input[type="text"], textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}
textarea { resize: vertical; min-height: 70px; }

.field {
  display: block;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.field > input, .field > select, .field > textarea { margin-top: 6px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.field.inline { margin: 0; min-width: 150px; }
.field.inline > input, .field.inline > select { margin-top: 4px; }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); font-weight: 600; }
.check input { width: auto; }

/* ----------------------------- Login ------------------------------ */
.login-screen {
  height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(13, 148, 136, .28), transparent 60%),
    radial-gradient(700px 450px at 85% 90%, rgba(37, 99, 235, .22), transparent 60%),
    var(--nav);
  padding: 20px;
  overflow: auto;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 18px;
  padding: 34px 32px 26px;
  box-shadow: 0 30px 80px rgba(2, 6, 23, .55);
}
.login-card h1 { margin: 10px 0 2px; font-size: 26px; letter-spacing: -.02em; }
.login-card > p { margin: 0 0 22px; }
.brand-mark { font-size: 30px; color: var(--primary); line-height: 1; }
.brand-mark.sm { font-size: 20px; }
.login-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 12px;
  margin-bottom: 12px;
}
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 18px 0 12px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.demo { flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 11px; line-height: 1.3; }
.btn.demo small { color: var(--muted); font-weight: 500; font-size: 10px; }
.login-foot { font-size: 11px; color: var(--muted); text-align: center; margin: 16px 0 0; }

/* ----------------------------- Topbar ----------------------------- */
.app { height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 58px;
  flex: 0 0 58px;
  background: var(--nav);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 18px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; letter-spacing: -.01em; color: #fff; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-btn {
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 11px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.nav-btn:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-btn.active { color: #fff; background: rgba(13, 148, 136, .22); }
.nav-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: 1px;
}
.userbox { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-meta { text-align: right; line-height: 1.25; }
.user-meta span { display: block; font-size: 12.5px; font-weight: 600; color: #f1f5f9; }
.user-meta small { font-size: 10.5px; color: #94a3b8; }
.userbox .btn.ghost { background: transparent; border-color: rgba(255, 255, 255, .18); color: #e2e8f0; }
.userbox .btn.ghost:hover { background: rgba(255, 255, 255, .08); }

/* ----------------------------- Views ------------------------------ */
.views { flex: 1; min-height: 0; position: relative; }
.view { display: none; height: 100%; }
.view.active { display: flex; }

.panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 300px;
  flex: 0 0 300px;
}
.panel + .map-wrap { border-right: 1px solid var(--line); }
.detail-panel { border-right: 0; border-left: 1px solid var(--line); width: 320px; flex-basis: 320px; }
.panel-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0 0 10px; font-size: 14px; letter-spacing: -.01em; }
.panel-head .row-between h2 { margin: 0; }
.panel-head .row-between { margin-bottom: 10px; }
.panel-head .input { margin-top: 0; }
.pad { padding: 14px; overflow-y: auto; }
.scroll { overflow-y: auto; flex: 1; min-height: 0; }

.pill {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary-600);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  vertical-align: 1px;
}

.chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip:hover:not(.active) { background: #f8fafc; }

/* --------------------------- Map area ----------------------------- */
.map-wrap { position: relative; flex: 1; min-width: 0; }
.map { position: absolute; inset: 0; background: #dfe7ee; z-index: 1; }

.map-stats {
  position: absolute;
  z-index: 500;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 11.5px;
  color: var(--muted);
  box-shadow: var(--shadow);
}
.map-stats b { color: var(--ink); font-size: 13px; }
.map-stats div { display: flex; align-items: center; gap: 5px; }
.sim-state { border-left: 1px solid var(--line); padding-left: 12px; font-size: 10.5px; }

.legend {
  position: absolute;
  z-index: 500;
  bottom: 14px;
  left: 12px;
  display: flex;
  gap: 12px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 10.5px;
  color: var(--muted);
  box-shadow: var(--shadow);
}
.legend span { display: flex; align-items: center; gap: 4px; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grey); display: inline-block; flex: 0 0 8px; }
.dot.moving { background: var(--green); }
.dot.idle { background: var(--amber); }
.dot.stopped { background: var(--red); }
.dot.offline { background: var(--grey); }

/* -------------------------- Vehicle list -------------------------- */
.vehicle-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .12s;
}
.vehicle-item:hover { background: #f8fafc; }
.vehicle-item.active { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.vehicle-item .v-main { flex: 1; min-width: 0; }
.vehicle-item .v-name { font-weight: 700; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.vehicle-item .v-sub { color: var(--muted); font-size: 11px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vehicle-item .v-speed { text-align: right; font-size: 11px; color: var(--muted); white-space: nowrap; }
.vehicle-item .v-speed b { display: block; color: var(--ink); font-size: 13px; }

/* ------------------------ Map markers ----------------------------- */
.vpin { background: transparent; border: 0; }
.vpin .bubble {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--grey);
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .35);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  transition: background .2s;
}
.vpin.moving .bubble { background: var(--green); }
.vpin.idle .bubble { background: var(--amber); }
.vpin.stopped .bubble { background: var(--red); }
.vpin.offline .bubble { background: var(--grey); }
.vpin.selected .bubble { box-shadow: 0 0 0 4px rgba(13, 148, 136, .35), 0 2px 10px rgba(15, 23, 42, .4); }
.vpin .arrow { display: block; line-height: 1; transform-origin: 50% 50%; }
.vpin .tag {
  position: absolute;
  top: 33px; left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, .88);
  color: #fff;
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
}
.vpin .pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(13, 148, 136, .6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(.7); opacity: .9; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ------------------------ Detail panel ---------------------------- */
.empty-state { padding: 40px 24px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.empty-icon { font-size: 26px; margin-bottom: 10px; color: #cbd5e1; }
.detail-body { padding: 16px; overflow-y: auto; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.detail-head h3 { margin: 0 0 2px; font-size: 16px; letter-spacing: -.01em; }
.detail-head .plate { font-size: 11.5px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.metric {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: #f8fafc;
}
.metric span { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.metric b { font-size: 15px; letter-spacing: -.01em; }
.metric b small { font-size: 10px; color: var(--muted); font-weight: 600; }
.detail-rows { border-top: 1px solid var(--line); margin-bottom: 14px; }
.detail-rows div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.detail-rows span { color: var(--muted); }
.detail-rows b { font-weight: 600; text-align: right; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* -------------------------- Playback ------------------------------ */
.playback {
  position: absolute;
  z-index: 500;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  box-shadow: var(--shadow);
}
.playback input[type="range"] { flex: 1; accent-color: var(--primary); }
.playback select { width: auto; padding: 5px 7px; font-size: 12px; }
.playback .mono { font-size: 11px; color: var(--muted); min-width: 92px; text-align: right; }
.playback .btn.icon { background: var(--primary); color: #fff; border: 0; }

.hist-summary { margin-top: 14px; }
.hist-summary .hrow { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.hist-summary .hrow span { color: var(--muted); }
.hist-summary .hrow b { font-weight: 600; }

.quick-row { display: flex; gap: 5px; flex-wrap: wrap; margin: 2px 0 14px; }

/* --------------------------- Page views --------------------------- */
.page {
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px 40px;
}
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h2 { margin: 0 0 3px; font-size: 19px; letter-spacing: -.02em; }
.page-head p { margin: 0; font-size: 12.5px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
  box-shadow: var(--shadow);
}
.stat-card span { display: block; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.stat-card b { font-size: 21px; letter-spacing: -.02em; }
.stat-card b small { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 3px; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar select { width: auto; min-width: 150px; }

.filter-bar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 14px; margin-bottom: 16px; }
.filter-bar .field.inline { margin-bottom: 0; }

.tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 8px;
  cursor: pointer;
}
.tab.active { background: var(--nav); border-color: var(--nav); color: #fff; }

/* ---------------------------- Tables ------------------------------ */
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 700;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table .empty { text-align: center; color: var(--muted); padding: 30px; }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}
.badge.green { background: #dcfce7; color: #15803d; }
.badge.amber { background: #fef3c7; color: #b45309; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.badge.blue { background: #dbeafe; color: #1d4ed8; }
.badge.grey { background: #f1f5f9; color: #64748b; }
.badge.teal { background: var(--primary-soft); color: var(--primary-600); }

.sev { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: capitalize; }
.sev i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--grey); }
.sev.info i { background: #3b82f6; }
.sev.warning i { background: var(--amber); }
.sev.critical i { background: var(--red); }

.link-btn { background: none; border: 0; color: var(--primary-600); font-family: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 3px 5px; border-radius: 5px; }
.link-btn:hover { background: var(--primary-soft); }
.link-btn.danger { color: var(--red); }
.link-btn.danger:hover { background: #fee2e2; }

/* --------------------------- Geofences ---------------------------- */
.geo-item { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.geo-item .geo-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.geo-item .geo-name { font-weight: 700; font-size: 12.5px; }
.geo-item .geo-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.geo-item .geo-acts { display: flex; gap: 6px; margin-top: 7px; }
.form-title { margin: 0 0 12px; font-size: 13px; }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.5; background: #f8fafc; border: 1px dashed var(--line); border-radius: 8px; padding: 9px 10px; }
.draw-hint {
  position: absolute;
  z-index: 600;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--nav);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  padding: 8px 14px;
  box-shadow: var(--shadow);
  max-width: calc(100% - 32px);
  text-align: center;
}

/* ---------------------------- Modal ------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .55);
  backdrop-filter: blur(2px);
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 30px 70px rgba(2, 6, 23, .45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-body .field:last-child { margin-bottom: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--line); background: #f8fafc; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* --------------------------- Toasts ------------------------------- */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 6000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--nav);
  color: #fff;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 12.5px;
  box-shadow: 0 12px 30px rgba(2, 6, 23, .35);
  max-width: 340px;
  border-left: 3px solid var(--primary);
  animation: toastIn .2s ease-out;
}
.toast.warn { border-left-color: var(--amber); }
.toast.err { border-left-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------- Mobile helpers ------------------------- */
.fleet-toggle {
  display: none;
  position: absolute;
  z-index: 750;
  left: 12px;
  bottom: 14px;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(2, 6, 23, .28);
  cursor: pointer;
}
.fleet-toggle:active { transform: scale(.97); }
.fleet-panel { transition: transform .22s ease; }
.detail-head-right { display: flex; align-items: center; gap: 6px; }
.detail-close { display: none; }

/* -------------------------- Responsive ---------------------------- */
@media (max-width: 1280px) {
  .nav-btn { padding: 8px 8px; font-size: 12px; }
}
@media (max-width: 1150px) {
  .detail-panel { display: none; }
  .detail-panel.show {
    display: flex;
    position: fixed;
    z-index: 900;
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    flex-basis: auto;
    max-height: 62vh;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(2, 6, 23, .35);
    overflow: hidden;
  }
  .detail-panel.show .detail-close { display: inline-flex; }
}
@media (max-width: 900px) {
  .panel { width: 260px; flex-basis: 260px; }
  .fleet-panel {
    position: absolute;
    z-index: 700;
    top: 0;
    bottom: 0;
    left: 0;
    box-shadow: 0 0 40px rgba(2, 6, 23, .18);
    transform: translateX(-102%);
  }
  .fleet-panel.open { transform: none; }
  .fleet-toggle { display: inline-flex; }
  .legend { left: auto; right: 12px; }
  .view[data-view="live"] .map-wrap { margin-left: 0; }
  .user-meta { display: none; }
  .page { padding: 16px 14px 30px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .brand { font-size: 14px; }
  .nav { gap: 0; }
  .nav-btn { padding: 7px 7px; font-size: 11px; }
  .userbox { margin-left: 0; }
  .panel { width: 220px; flex-basis: 220px; }
  .map-stats { gap: 8px; padding: 6px 9px; }
  .legend { display: none; }
  .stat-card b { font-size: 17px; }
}
