:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #17202a;
  --muted: #6b7480;
  --line: #e4e8ed;
  --primary: #162b49;
  --primary-strong: #0f213a;
  --danger: #b42318;
  --success: #157347;
  --shadow: 0 10px 35px rgba(20, 33, 50, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(22,43,73,.06), transparent 32%),
    var(--bg);
}

button, input, select {
  font: inherit;
}

button { touch-action: manipulation; }

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 18px max(34px, env(safe-area-inset-bottom));
}

.app-shell.narrow { width: min(100%, 520px); }

.view { animation: enter .2s ease-out; }
.hidden { display: none !important; }

@keyframes enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand-block {
  text-align: center;
  padding: 42px 10px 28px;
}

.brand-block.compact-brand {
  padding-top: 18px;
}

.brand-mark {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: var(--primary);
  color: white;
  font-size: 38px;
  box-shadow: var(--shadow);
}

.brand-block h1 {
  margin: 0;
  font-size: clamp(28px, 7vw, 38px);
  letter-spacing: -.04em;
}

.brand-block p {
  color: var(--muted);
  margin: 10px auto 0;
  line-height: 1.45;
  max-width: 420px;
}

.card, .hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card { padding: 20px; }

.auth-card { padding-top: 12px; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 13px;
  background: #eef1f4;
  margin-bottom: 22px;
}

.tab {
  border: 0;
  padding: 11px 8px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.tab.active {
  background: white;
  color: var(--text);
  box-shadow: 0 2px 9px rgba(20,33,50,.08);
}

.form-stack {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

input, select {
  width: 100%;
  min-height: 49px;
  border: 1px solid #ccd3db;
  border-radius: 12px;
  padding: 10px 13px;
  background: white;
  color: var(--text);
  outline: none;
}

input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,43,73,.09);
}

.btn {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
}

.btn.primary {
  background: var(--primary);
  color: white;
}

.btn.primary:active {
  background: var(--primary-strong);
}

.btn.secondary {
  background: #eef1f4;
  color: var(--text);
}

.btn.danger {
  background: var(--danger);
  color: white;
}

.btn.compact {
  min-height: 42px;
  padding: 9px 13px;
  font-size: 14px;
}

.link-button, .back-btn, .icon-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.link-button {
  color: var(--primary);
  font-weight: 800;
  padding: 8px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 2px 18px;
}

.topbar h2, .section-heading h3 {
  margin: 2px 0 0;
  letter-spacing: -.025em;
}

.back-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--line);
  font-size: 22px;
}

.icon-btn {
  color: var(--primary);
  font-weight: 800;
  padding: 9px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.hero-card {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fff, #f8fafc);
}

.big-number {
  display: block;
  font-size: 36px;
  line-height: 1;
  margin-top: 4px;
}

.section-block {
  margin-top: 28px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 12px;
}

.list-stack {
  display: grid;
  gap: 10px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.list-main {
  min-width: 0;
}

.list-title {
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #eef1f4;
}

.badge.success {
  background: #e9f6ef;
  color: var(--success);
}

.empty-state {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,.65);
  border: 1px dashed #ccd3db;
  border-radius: 14px;
}

.instruction {
  display: flex;
  gap: 13px;
  margin-bottom: 20px;
}

.instruction-icon {
  flex: 0 0 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eef1f4;
  font-weight: 900;
  color: var(--primary);
}

.instruction p,
.helper-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.success-wrap {
  text-align: center;
  padding-top: 48px;
}

.success-icon {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e9f6ef;
  color: var(--success);
  font-size: 42px;
  font-weight: 900;
  margin: 0 auto 22px;
}

.success-wrap h2 {
  font-size: 30px;
  margin: 8px 0;
  letter-spacing: -.04em;
}

.success-wrap > p {
  color: var(--muted);
  line-height: 1.45;
}

.success-details {
  text-align: left;
  margin: 24px 0 18px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child { border-bottom: 0; }

.detail-row span:first-child {
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 32px), 560px);
  z-index: 1000;
  border-radius: 12px;
  padding: 13px 15px;
  background: #17202a;
  color: white;
  box-shadow: var(--shadow);
  font-weight: 700;
  text-align: center;
}

.toast.error { background: #7a271a; }
.toast.success { background: #14532d; }

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(92vw, 480px);
}

dialog::backdrop {
  background: rgba(0,0,0,.42);
}

.dialog-card {
  background: white;
  border-radius: 18px;
  padding: 22px;
}

.dialog-card h3 { margin-top: 0; }

.dialog-card p {
  color: var(--muted);
  line-height: 1.45;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; }
  .hero-card { align-items: flex-end; }
}

@media (min-width: 760px) {
  .app-shell { padding-left: 24px; padding-right: 24px; }
}


/* Bloque 6.3 — Tarjeta de unidad ordenada */
.vehicle-card {
  align-items: stretch;
}

.vehicle-card-main {
  flex: 1 1 auto;
  padding-right: 8px;
}

.vehicle-card-side {
  flex: 0 0 auto;
  min-width: 86px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.status-badge {
  align-self: flex-end;
}

.vehicle-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.vehicle-action {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  display: grid;
  place-items: center;
  padding: 0;
  background: #f7f9fb;
  color: var(--primary);
  font-size: 21px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
}

.vehicle-action.edit:hover,
.vehicle-action.edit:focus-visible {
  background: #eef3f9;
  border-color: #c9d5e3;
}

.vehicle-action.remove {
  color: var(--danger);
  background: #fff8f7;
  border-color: #f0d5d1;
}

.vehicle-action.remove:hover,
.vehicle-action.remove:focus-visible {
  background: #fcecea;
  border-color: #e6b7b0;
}

.vehicle-action:active {
  transform: scale(.96);
}

@media (max-width: 520px) {
  .vehicle-card-side {
    min-width: 82px;
  }
}

.optional-label {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}


/* =========================================================
   Bloque 11 — Tracking actual
   ========================================================= */

.tracking-summary {
  flex-wrap: wrap;
}

.tracking-summary-status {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  font-size: 12px;
  color: var(--muted);
}

.summary-pill strong {
  color: var(--text);
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 9px;
}

.status-dot.online {
  background: #179c52;
  box-shadow: 0 0 0 3px rgba(23,156,82,.12);
}

.status-dot.offline {
  background: #9aa3ad;
  box-shadow: 0 0 0 3px rgba(154,163,173,.12);
}

.tracking-map-section {
  margin-top: 22px;
}

.map-heading {
  align-items: center;
}

.refresh-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  font-size: 22px;
  line-height: 1;
}

.refresh-btn.spinning {
  animation: tracking-spin .7s linear infinite;
}

@keyframes tracking-spin {
  to { transform: rotate(360deg); }
}

.tracking-map-card {
  position: relative;
  overflow: hidden;
  min-height: 310px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #e8edf1;
  box-shadow: var(--shadow);
}

#tracking-map {
  width: 100%;
  height: 330px;
  background: #e8edf1;
  z-index: 1;
}

.map-empty-state {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 500;
  width: min(84%, 330px);
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  text-align: center;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.85);
  background: rgba(255,255,255,.93);
  box-shadow: 0 8px 28px rgba(20,33,50,.12);
}

.map-empty-state span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.tracking-updated {
  padding: 7px 4px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.tracking-vehicle-card {
  cursor: pointer;
  align-items: flex-start;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.tracking-vehicle-card.has-position:active {
  transform: scale(.994);
}

.vehicle-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tracking-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.tracking-status-badge.online {
  color: #116b3a;
  background: #e9f7ef;
}

.tracking-status-badge.offline {
  color: #626b75;
  background: #f0f2f4;
}

.vehicle-telemetry {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.telemetry-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 9px;
  background: #eff2f5;
  color: #4d5864;
  font-size: 12px;
  font-weight: 800;
}

.telemetry-chip.ignition-on {
  color: #116b3a;
  background: #e9f7ef;
}

.telemetry-chip.ignition-off {
  color: #626b75;
  background: #f0f2f4;
}

.telemetry-chip.neutral {
  color: #7b858f;
}

.tracking-last-seen {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.vehicle-device-meta {
  margin-top: 10px;
}

.vehicle-card-side {
  flex: 0 0 auto;
}

.vehicle-map-icon-wrapper {
  background: transparent;
  border: 0;
}

.vehicle-map-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 5px 13px rgba(20,33,50,.28);
}

.vehicle-map-icon.online {
  background: #179c52;
}

.vehicle-map-icon.offline {
  background: #88919b;
}

.vehicle-map-arrow {
  display: block;
  color: white;
  font-size: 15px;
  transform: translateY(-1px);
}

.map-popup {
  display: grid;
  gap: 4px;
  min-width: 155px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.map-popup strong {
  font-size: 14px;
}

.map-popup span {
  font-size: 12px;
  color: #5f6975;
}

.leaflet-control-attribution {
  font-size: 9px !important;
}

@media (max-width: 520px) {
  .tracking-summary {
    align-items: flex-start;
  }

  .tracking-summary-status {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .summary-pill {
    flex: 1;
    justify-content: center;
  }

  #tracking-map {
    height: 300px;
  }

  .tracking-map-card {
    min-height: 300px;
  }

  .vehicle-title-row {
    display: grid;
    gap: 7px;
  }

  .tracking-status-badge {
    width: fit-content;
  }
}


/* =========================================================
   Bloque 11.2 / 12 — Mapa + bottom sheet + inmovilizador
   ========================================================= */

.tracking-workspace {
  position: fixed;
  inset: 0;
  overflow: hidden;
  padding: 0 !important;
  background: #eef1f4;
}

.tracking-topbar {
  position: absolute;
  z-index: 900;
  top: 10px;
  left: 10px;
  right: 10px;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.84);
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 30px rgba(16,34,55,.13);
  backdrop-filter: blur(10px);
}

.tracking-brandline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tracking-account {
  display: block;
  max-width: 245px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.tracking-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.compact-round-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #122a4b;
  color: white;
  font-size: 20px;
  line-height: 1;
}

.compact-text-btn {
  border: 0;
  padding: 7px;
  background: transparent;
  color: #122a4b;
  font-weight: 800;
}

.tracking-kpis {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #5e6873;
  font-size: 11px;
  white-space: nowrap;
}

.tracking-kpis > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kpi-online {
  color: #126c3c;
}

.tracking-refresh {
  margin-left: auto;
  width: 29px;
  height: 29px;
  border: 1px solid #dce2e8;
  border-radius: 50%;
  background: white;
  font-size: 17px;
}

.tracking-map-stage {
  position: absolute;
  inset: 0;
  background: #e6ebef;
}

.tracking-map-stage #tracking-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-updated-floating {
  position: absolute;
  z-index: 700;
  top: 112px;
  right: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 4px 15px rgba(16,34,55,.1);
  color: #68727d;
  font-size: 10px;
}

.vehicle-sheet {
  position: absolute;
  z-index: 1000;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38vh;
  min-height: 118px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  border-radius: 22px 22px 0 0;
  background: rgba(250,251,252,.98);
  box-shadow: 0 -12px 38px rgba(16,34,55,.18);
  transition: height .24s ease;
  overflow: hidden;
}

.vehicle-sheet.sheet-collapsed {
  height: 128px;
}

.vehicle-sheet.sheet-mid {
  height: 38vh;
}

.vehicle-sheet.sheet-expanded {
  height: 80vh;
}

.vehicle-sheet.dragging {
  transition: none;
}

.sheet-handle-zone {
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  touch-action: none;
}

.sheet-handle {
  width: 46px;
  height: 5px;
  border-radius: 99px;
  background: #c9cfd6;
}

.sheet-heading {
  flex: 0 0 auto;
  display: flex;
  padding: 0 14px 8px;
}

.sheet-heading > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.sheet-heading strong {
  color: #111b27;
  font-size: 15px;
}

.sheet-heading span {
  color: #8a949e;
  font-size: 10px;
}

.vehicle-compact-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 10px 18px;
}

.compact-vehicle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 45px;
  padding: 7px 8px;
  border-bottom: 1px solid #edf0f3;
  cursor: pointer;
}

.compact-vehicle-row.selected {
  align-items: flex-start;
  margin-bottom: 3px;
  padding: 10px;
  border: 1px solid #dce4eb;
  border-radius: 14px;
  background: white;
  box-shadow: 0 4px 15px rgba(15,33,54,.07);
}

.compact-vehicle-main {
  min-width: 0;
  flex: 1;
}

.compact-vehicle-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111b27;
  font-size: 13px;
  font-weight: 850;
}

.compact-vehicle-status {
  flex: 0 0 auto;
  color: #7a848e;
  font-size: 10px;
}

.selected-vehicle-details {
  margin-top: 8px;
}

.selected-telemetry {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.selected-telemetry .telemetry-chip {
  min-height: 25px;
  padding: 4px 7px;
  font-size: 10px;
}

.vehicle-control-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}

.vehicle-control-btn {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 850;
}

.lock-control {
  background: #fff4f2;
  border-color: #f3cec7;
  color: #a93727;
}

.unlock-control {
  background: #eaf7ef;
  border-color: #c9e9d5;
  color: #126c3c;
}

.mini-action {
  width: 34px;
  height: 34px;
  border: 1px solid #dce3e9;
  border-radius: 10px;
  background: white;
}

.mini-action.danger {
  color: #c1332b;
  border-color: #f1d1cd;
}

.control-status {
  flex: 1;
  padding: 7px 9px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
}

.pending-control {
  background: #fff6d9;
  color: #7b5c00;
}

.safe-command-note {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #fff6dd;
  color: #6f570f;
  font-size: 12px;
  line-height: 1.4;
}

#immobilizer-dialog::backdrop {
  background: rgba(11,23,38,.52);
}

@media (min-width: 700px) {
  .tracking-workspace {
    max-width: 700px;
    left: 50%;
    right: auto;
    width: 700px;
    transform: translateX(-50%);
  }
}


/* =========================================================
   Bloque 12.2 — Feedback rápido de comandos
   ========================================================= */

.waiting-control {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  min-height: 34px;
}

.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 30px;
  height: 18px;
}

.thinking-dots i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .75;
  animation: command-thinking-dot 1s ease-in-out infinite;
}

.thinking-dots i:nth-child(2) {
  animation-delay: .14s;
}

.thinking-dots i:nth-child(3) {
  animation-delay: .28s;
}

@keyframes command-thinking-dot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: .45;
  }

  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thinking-dots i {
    animation: none;
    opacity: .8;
  }
}


/* =========================================================
   Bloque 12.3 — Estado efectivo por comando confirmado
   ========================================================= */

.control-effective-wrap {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.control-effective-wrap .vehicle-control-btn {
  flex: 0 0 auto;
}

.control-telemetry-note {
  min-width: 0;
  flex: 1;
  padding: 6px 8px;
  border-radius: 9px;
  background: #eef6ff;
  color: #355f87;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.25;
}

@media (max-width: 420px) {
  .control-effective-wrap {
    align-items: stretch;
    flex-direction: column;
    gap: 5px;
  }

  .control-effective-wrap .vehicle-control-btn {
    width: fit-content;
  }
}


/* =========================================================
   Bloque 13 — Historial de recorrido
   ========================================================= */

.vehicle-history-btn {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #d7e1eb;
  border-radius: 10px;
  background: #f4f8fb;
  color: #244c72;
  font-size: 11px;
  font-weight: 850;
}

.history-workspace {
  position: fixed;
  inset: 0;
  overflow: hidden;
  padding: 0 !important;
  background: #eef1f4;
}

.history-topbar {
  position: absolute;
  z-index: 1000;
  top: 10px;
  left: 10px;
  right: 10px;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 16px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 8px 28px rgba(16,34,55,.13);
  backdrop-filter: blur(10px);
}

.history-back-btn {
  width: 38px;
  height: 38px;
  border: 1px solid #dde4ea;
  border-radius: 50%;
  background: white;
  color: #142943;
  font-size: 30px;
  line-height: .8;
}

.history-title-wrap {
  min-width: 0;
  flex: 1;
}

.history-title-wrap strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111b27;
  font-size: 14px;
}

.history-controls {
  position: absolute;
  z-index: 950;
  top: 78px;
  left: 10px;
  right: 10px;
  display: grid;
  gap: 7px;
}

.history-presets {
  display: flex;
  gap: 6px;
}

.history-preset {
  flex: 1;
  min-height: 34px;
  border: 1px solid #dbe3e9;
  border-radius: 10px;
  background: rgba(255,255,255,.94);
  color: #4b5865;
  font-weight: 800;
  font-size: 11px;
  box-shadow: 0 4px 14px rgba(16,34,55,.06);
}

.history-preset.active {
  background: #142e50;
  border-color: #142e50;
  color: white;
}

.history-custom {
  border: 1px solid #dbe3e9;
  border-radius: 10px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 4px 14px rgba(16,34,55,.06);
}

.history-custom summary {
  padding: 8px 10px;
  color: #52606e;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.history-custom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 7px;
  padding: 0 9px 9px;
}

.history-custom-grid label {
  display: grid;
  gap: 3px;
}

.history-custom-grid label span {
  color: #7b8691;
  font-size: 9px;
  font-weight: 750;
}

.history-custom-grid input {
  min-width: 0;
  height: 34px;
  padding: 5px 7px;
  border: 1px solid #dce3e9;
  border-radius: 8px;
  background: white;
  font-size: 10px;
}

.history-map-stage {
  position: absolute;
  inset: 0 0 86px 0;
  background: #e6ebef;
}

#history-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.history-summary {
  position: absolute;
  z-index: 1000;
  left: 10px;
  right: 10px;
  bottom: 10px;
  min-height: 66px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 16px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 28px rgba(16,34,55,.13);
}

.history-metric {
  display: grid;
  align-content: center;
  gap: 2px;
  text-align: center;
  border-right: 1px solid #edf0f3;
}

.history-metric:last-child {
  border-right: 0;
}

.history-metric span {
  color: #818b95;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.history-metric strong {
  color: #15263a;
  font-size: 13px;
}

@media (max-width: 520px) {
  .history-custom-grid {
    grid-template-columns: 1fr 1fr;
  }

  .history-custom-grid .btn {
    grid-column: 1 / -1;
  }
}

@media (min-width: 700px) {
  .history-workspace {
    max-width: 700px;
    left: 50%;
    right: auto;
    width: 700px;
    transform: translateX(-50%);
  }
}


/* Bloque 13.1 — zona horaria del navegador */
.history-timezone-label {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7d8994;
  font-size: 9px;
  font-weight: 650;
}


/* =========================================================
   Bloque 13.2 — curso + inicio/fin + playback
   ========================================================= */

.history-map-stage {
  inset: 0 0 148px 0;
}

.history-summary {
  bottom: 10px;
}

.history-playback {
  position: absolute;
  z-index: 1000;
  left: 10px;
  right: 10px;
  bottom: 84px;
  display: grid;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 14px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 7px 24px rgba(16,34,55,.12);
  backdrop-filter: blur(8px);
}

.playback-main-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.playback-icon-btn,
.playback-play-btn,
.playback-speed {
  min-height: 32px;
  border: 1px solid #d9e2e9;
  border-radius: 9px;
  background: white;
  color: #203b59;
  font-size: 10px;
  font-weight: 850;
}

.playback-icon-btn {
  width: 34px;
  padding: 0;
  font-size: 18px;
}

.playback-play-btn {
  min-width: 88px;
  padding: 5px 8px;
  background: #17395f;
  border-color: #17395f;
  color: white;
}

.playback-speed {
  width: 58px;
  padding: 4px;
}

.history-progress {
  min-width: 0;
  flex: 1;
  accent-color: #17395f;
}

.playback-status-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #75808b;
  font-size: 9px;
  white-space: nowrap;
}

.history-endpoint-icon-shell,
.history-course-icon-shell,
.history-playback-icon-shell {
  background: transparent;
  border: 0;
}

.history-endpoint {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0,0,0,.28);
  color: white;
  font-size: 12px;
  font-weight: 950;
}

.start-point {
  background: #1a9b50;
}

.end-point {
  background: #d33a34;
}

.history-course-arrow {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  transform-origin: center;
  color: #244f79;
  text-shadow:
    -1px -1px 0 white,
    1px -1px 0 white,
    -1px 1px 0 white,
    1px 1px 0 white;
  font-size: 12px;
  line-height: 1;
  opacity: .88;
}

.history-playback-marker {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 3px solid white;
  border-radius: 50%;
  background: #163b63;
  box-shadow: 0 4px 14px rgba(0,0,0,.32);
}

.history-playback-arrow {
  display: grid;
  place-items: center;
  transform-origin: center;
  color: white;
  font-size: 16px;
  line-height: 1;
}

@media (max-width: 420px) {
  .playback-play-btn {
    min-width: 80px;
  }

  .playback-status-row {
    font-size: 8px;
  }
}


/* =========================================================
   Bloque 14 — Geocercas
   ========================================================= */

.geofence-round-btn {
  background: #2d6b58;
}

.geofence-workspace {
  position: fixed;
  inset: 0;
  overflow: hidden;
  padding: 0 !important;
  background: #eef1f4;
}

.geofence-topbar {
  position: absolute;
  z-index: 1100;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 16px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 28px rgba(16,34,55,.13);
}

.geofence-body {
  position: absolute;
  inset: 0;
}

.geofence-map-panel {
  position: absolute;
  inset: 0 0 46% 0;
  background: #e7ecef;
}

#geofence-map {
  position: absolute;
  inset: 0;
}

.geofence-map-help {
  position: absolute;
  z-index: 700;
  top: 78px;
  left: 10px;
  right: 10px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255,255,255,.93);
  box-shadow: 0 4px 14px rgba(16,34,55,.09);
  color: #65717c;
  font-size: 10px;
  text-align: center;
  pointer-events: none;
}

.geofence-editor-panel {
  position: absolute;
  z-index: 900;
  left: 0;
  right: 0;
  bottom: 0;
  height: 47%;
  overflow-y: auto;
  padding: 12px 10px 24px;
  border-radius: 22px 22px 0 0;
  background: rgba(250,251,252,.99);
  box-shadow: 0 -12px 32px rgba(16,34,55,.15);
}

.geofence-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.geofence-section-title > span {
  display: inline-grid;
  place-items: center;
  min-width: 27px;
  height: 25px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e9eef2;
  color: #52616f;
  font-size: 11px;
  font-weight: 800;
}

.geofence-list {
  display: grid;
  gap: 7px;
}

.geofence-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid #dde4ea;
  border-radius: 13px;
  background: white;
}

.geofence-card-main {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.geofence-card-main strong,
.geofence-card-main span,
.geofence-card-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.geofence-card-main strong {
  font-size: 13px;
}

.geofence-card-main span {
  color: #66727d;
  font-size: 10px;
}

.geofence-card-main small {
  color: #8a949e;
  font-size: 9px;
}

.geofence-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.notification-pill {
  padding: 5px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.notification-pill.on {
  background: #e8f6ed;
  color: #17683a;
}

.notification-pill.off {
  background: #eef1f3;
  color: #727b84;
}

.geofence-form {
  display: grid;
  gap: 10px;
}

.geofence-type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.geofence-type {
  min-height: 38px;
  border: 1px solid #dce4ea;
  border-radius: 10px;
  background: white;
  color: #586674;
  font-weight: 800;
}

.geofence-type.active {
  background: #17395f;
  border-color: #17395f;
  color: white;
}

.radius-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.radius-input-row input {
  flex: 1;
}

.radius-input-row span {
  color: #76818b;
  font-size: 11px;
}

.geofence-fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  padding: 9px;
  border: 1px solid #dde4ea;
  border-radius: 10px;
}

.geofence-fieldset legend {
  padding: 0 4px;
  color: #677481;
  font-size: 10px;
  font-weight: 800;
}

.geofence-fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.geofence-notify-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid #d9e7df;
  border-radius: 10px;
  background: #f3faf6;
}

.geofence-notify-toggle > span {
  display: grid;
  gap: 1px;
}

.geofence-notify-toggle strong {
  font-size: 11px;
}

.geofence-notify-toggle small {
  color: #728078;
  font-size: 9px;
}

.geofence-vehicle-picker {
  width: 100%;
  display: grid;
  gap: 5px;
}

.geofence-vehicle-option {
  min-height: 34px;
  display: flex !important;
  align-items: center;
  gap: 7px !important;
  padding: 5px 7px;
  border-radius: 8px;
  background: #f5f7f9;
}

.geofence-form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.quick-geofence-btn {
  background: #f0f8f4;
  border-color: #d4e7dc;
  color: #286447;
}

#quick-geofence-dialog::backdrop {
  background: rgba(11,23,38,.52);
}

@media (min-width: 700px) {
  .geofence-workspace {
    max-width: 700px;
    left: 50%;
    right: auto;
    width: 700px;
    transform: translateX(-50%);
  }

  .geofence-map-panel {
    inset: 0 44% 0 0;
  }

  .geofence-editor-panel {
    top: 0;
    left: 56%;
    height: 100%;
    padding-top: 82px;
    border-radius: 0;
  }
}


/* =========================================================
   Bloque 14.1 — Acciones móviles + DELETE 204
   ========================================================= */

.vehicle-control-stack {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.vehicle-control-primary {
  min-width: 0;
}

.vehicle-control-primary .control-effective-wrap,
.vehicle-control-primary .control-status {
  width: 100%;
}

.vehicle-secondary-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) 36px 36px;
  gap: 6px;
  align-items: center;
}

.vehicle-secondary-actions .vehicle-history-btn {
  width: 100%;
  min-width: 0;
  padding-inline: 6px;
  white-space: nowrap;
}

.vehicle-secondary-actions .mini-action {
  width: 36px;
  height: 36px;
}

@media (max-width: 390px) {
  .vehicle-secondary-actions {
    grid-template-columns: 1fr 1fr 36px 36px;
  }

  .vehicle-secondary-actions .vehicle-history-btn {
    font-size: 10px;
    padding-inline: 4px;
  }
}

@media (max-width: 345px) {
  .vehicle-secondary-actions {
    grid-template-columns: 1fr 1fr;
  }

  .vehicle-secondary-actions .mini-action {
    width: 100%;
  }
}

/* Evita que estilos antiguos intenten forzar toda la fila en horizontal. */
.vehicle-control-row {
  display: block;
  margin-top: 0;
}

.notification-bell-btn{position:relative;width:38px;height:38px;border:1px solid #dfe5ea;border-radius:50%;background:white;font-size:17px}.notification-badge{position:absolute;top:-5px;right:-5px;min-width:19px;height:19px;display:grid;place-items:center;padding:0 4px;border:2px solid white;border-radius:999px;background:#c8372d;color:white;font-size:9px;font-weight:900}.notifications-workspace{position:fixed;inset:0;overflow:hidden;padding:0!important;background:#eef1f4}.notifications-topbar{position:absolute;z-index:1000;top:10px;left:10px;right:10px;min-height:58px;display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid rgba(255,255,255,.86);border-radius:16px;background:rgba(255,255,255,.96);box-shadow:0 8px 28px rgba(16,34,55,.13)}.push-activation-card{position:absolute;z-index:900;top:80px;left:10px;right:10px;display:flex;align-items:center;gap:10px;padding:11px;border:1px solid #d8e4dc;border-radius:14px;background:#f7fbf8}.push-activation-card>div{min-width:0;flex:1;display:grid;gap:2px}.push-activation-card strong{font-size:12px}.push-activation-card span{color:#6d7871;font-size:10px;line-height:1.35}.notifications-list-panel{position:absolute;top:158px;left:10px;right:10px;bottom:10px;display:flex;flex-direction:column;overflow:hidden;border:1px solid #dde4ea;border-radius:16px;background:white}.notification-list-header{display:flex;align-items:center;justify-content:space-between;padding:10px;border-bottom:1px solid #edf0f3}.notifications-list{min-height:0;flex:1;overflow-y:auto;padding:4px 9px 20px}.notification-item{position:relative;display:flex;align-items:flex-start;gap:9px;padding:11px 5px;border-bottom:1px solid #edf0f3}.notification-item.unread{background:#f8fbff}.notification-item.read{opacity:.72}.notification-type-icon{flex:0 0 30px;width:30px;height:30px;display:grid;place-items:center;border-radius:50%;background:#e7f1eb;color:#246444;font-weight:950}.notification-item-body{min-width:0;flex:1;display:grid;gap:3px}.notification-item-body strong{font-size:12px}.notification-item-body span{color:#58636e;font-size:11px;line-height:1.35}.notification-item-body small{color:#8b959e;font-size:9px}.notification-unread-dot{position:absolute;top:15px;right:5px;width:7px;height:7px;border-radius:50%;background:#246bd5}


/* =========================================================
   Bloque 15.2 — Botón de pánico
   ========================================================= */

.notification-item.panic-notification {
  background: #fff7f6;
}

.notification-item.panic-notification.unread {
  border-left: 3px solid #c8372d;
  padding-left: 7px;
}

.notification-item.panic-notification .notification-type-icon {
  background: #fde4e1;
  color: #b3261e;
  font-size: 17px;
  font-weight: 950;
}


/* =========================================================
   Bloque 15.3 — Alimentación principal
   ========================================================= */

.notification-item.power-alert-notification {
  background: #fff9f0;
}

.notification-item.power-alert-notification.unread {
  border-left: 3px solid #d97706;
  padding-left: 7px;
}

.notification-item.power-alert-notification .notification-type-icon {
  background: #fff0cf;
  color: #9a5b00;
}

.notification-item.power-restored-notification {
  background: #f5fbf7;
}

.notification-item.power-restored-notification .notification-type-icon {
  background: #e0f3e5;
  color: #247044;
}


/* =========================================================
   Bloque 16 — Reportes
   ========================================================= */
.reports-round-btn { font-size: 17px; font-weight: 900; }
.reports-workspace { min-height: 100%; padding: 78px 10px 24px !important; background: #eef1f4; }
.reports-topbar { position: fixed; z-index: 1100; top: 10px; left: 10px; right: 10px; min-height: 58px; display:flex; align-items:center; gap:10px; padding:8px 10px; border:1px solid rgba(255,255,255,.86); border-radius:16px; background:rgba(255,255,255,.97); box-shadow:0 8px 28px rgba(16,34,55,.13); }
.reports-filter-card,.reports-results-card { max-width: 980px; margin: 0 auto 10px; padding: 12px; border:1px solid #dde4ea; border-radius:16px; background:white; }
.reports-filter-card { display:grid; gap:10px; }
.reports-filter-card label { display:grid; gap:5px; color:#65707b; font-size:11px; font-weight:700; }
.reports-filter-card select,.reports-filter-card input { width:100%; min-height:44px; border:1px solid #d9e0e6; border-radius:10px; background:white; padding:0 10px; font-size:16px; color:#26323c; }
.reports-presets { display:flex; gap:6px; }
.report-preset { min-height:38px; flex:1; border:1px solid #dce3e8; border-radius:10px; background:#f7f8fa; font-weight:800; }
.report-preset.active { border-color:#3f7255; background:#e8f2ec; color:#28523c; }
.reports-custom summary { cursor:pointer; color:#59656f; font-size:12px; font-weight:800; }
.reports-date-grid { display:grid; grid-template-columns:1fr; gap:8px; padding-top:8px; }
.reports-results-head { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.reports-results-head > div:first-child { display:grid; gap:2px; }
.reports-results-head span { color:#75808a; font-size:10px; }
.reports-export-actions { display:flex; gap:6px; }
.report-table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
.report-table { width:100%; border-collapse:collapse; min-width:640px; font-size:11px; }
.report-table th { position:sticky; top:0; background:#f5f7f9; color:#66717b; text-align:left; font-size:10px; padding:9px 8px; border-bottom:1px solid #dfe5ea; }
.report-table td { padding:10px 8px; border-bottom:1px solid #edf0f3; vertical-align:top; }
.report-table td strong,.report-table td small { display:block; }
.report-table td small { margin-top:2px; color:#7a858f; }
.motor-state { display:inline-flex; align-items:center; gap:4px; padding:4px 7px; border-radius:999px; font-weight:850; white-space:nowrap; }
.motor-state.on { background:#e5f3e9; color:#25613e; }
.motor-state.off { background:#eef0f2; color:#5d6670; }
.report-map-link { border:0; background:transparent; color:#2166b1; font-weight:800; white-space:nowrap; }
.report-map-dialog { width:min(92vw,680px); border:0; border-radius:16px; padding:0; overflow:hidden; box-shadow:0 24px 80px rgba(0,0,0,.28); }
.report-map-dialog::backdrop { background:rgba(15,23,32,.48); }
.report-map-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; background:white; }
.report-map-dialog-head > div { min-width:0; display:grid; gap:2px; }
.report-map-dialog-head span { color:#75808a; font-size:10px; }
.report-event-map { height: 380px; max-height: 60vh; background:#e9ecef; }
@media (min-width:700px) { .reports-date-grid { grid-template-columns:1fr 1fr; } .reports-filter-card { grid-template-columns:1.1fr 1.1fr auto; align-items:end; } .reports-filter-card .reports-presets,.reports-filter-card .reports-custom,.reports-filter-card #btn-generate-report { grid-column:1/-1; } }


/* =========================================================
   Bloque 16.3 — Branding GLE Watcher
   ========================================================= */

.login-brand-logo {
  display: block;
  width: min(290px, 82%);
  height: auto;
  margin: 0 auto 18px;
  object-fit: contain;
}

.login-logo,
.brand-mark,
.login-brand-mark {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

@media (max-width: 480px) {
  .login-brand-logo {
    width: min(250px, 88%);
    margin-bottom: 14px;
  }
}


/* =========================================================
   Bloque 17 — PWA Android install prompt
   ========================================================= */

.pwa-install-banner {
  position: fixed;
  z-index: 3000;
  left: 12px;
  right: 12px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid #dce4ea;
  border-radius: 16px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 12px 38px rgba(18,35,54,.18);
}

.pwa-install-icon-wrap {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid #e4e8ec;
  border-radius: 12px;
  background: white;
}

.pwa-install-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pwa-install-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.pwa-install-copy strong {
  font-size: 12px;
}

.pwa-install-copy span {
  color: #68737c;
  font-size: 10px;
  line-height: 1.3;
}

.pwa-install-dismiss {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 22px;
  color: #6f7880;
}

@media (min-width: 700px) {
  .pwa-install-banner {
    left: 50%;
    right: auto;
    width: min(560px, calc(100% - 24px));
    transform: translateX(-50%);
  }
}


/* =========================================================
   Bloque 17.2 — Recuperación segura del inmovilizador
   ========================================================= */

.control-warning {
  margin-bottom: 8px;
  border: 1px solid #ecdca6;
  background: #fff7d8;
  color: #6f5700;
}

.control-recovery-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.secondary-control {
  opacity: .82;
}

@media (min-width: 420px) {
  .control-recovery-actions {
    grid-template-columns: 1fr 1fr;
  }
}


/* =========================================================
   Bloque 17.3 — Protección branding acumulativa
   ========================================================= */

.login-brand-logo {
  display: block !important;
  width: min(290px, 82%) !important;
  max-width: 290px !important;
  height: auto !important;
  max-height: 180px !important;
  margin: 0 auto 18px !important;
  object-fit: contain !important;
}

@media (max-width: 480px) {
  .login-brand-logo {
    width: min(250px, 88%) !important;
    max-width: 250px !important;
    max-height: 150px !important;
    margin-bottom: 14px !important;
  }
}


/* =========================================================
   Bloque 18B — Scanner compacto de registro
   ========================================================= */

.identifier-scan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.identifier-scan-row input {
  min-width: 0;
}

.scan-field-btn {
  min-width: 104px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.scanner-dialog {
  width: min(520px, calc(100% - 18px));
  max-width: 520px;
  padding: 0;
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  background: transparent;
}

.scanner-dialog::backdrop {
  background: rgba(3, 11, 18, .74);
  backdrop-filter: blur(4px);
}

.scanner-modal-card {
  background: #fff;
  color: #16242d;
  padding: 12px;
}

.scanner-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.scanner-modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.scanner-close-btn {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  font-size: 25px;
  line-height: 1;
  background: #eef3f6;
  color: #364952;
}

.imei-scanner-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: min(58vh, 410px);
  overflow: hidden;
  border-radius: 16px;
  background: #05090c;
}

#imei-scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.imei-scanner-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.imei-scanner-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 88%;
  height: 34%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 14px;
}

.scanner-corner {
  position: absolute;
  width: 28px;
  height: 28px;
}

.scanner-corner.tl {
  left: -2px;
  top: -2px;
  border-left: 4px solid #39a9dc;
  border-top: 4px solid #39a9dc;
  border-radius: 12px 0 0 0;
}

.scanner-corner.tr {
  right: -2px;
  top: -2px;
  border-right: 4px solid #39a9dc;
  border-top: 4px solid #39a9dc;
  border-radius: 0 12px 0 0;
}

.scanner-corner.bl {
  left: -2px;
  bottom: -2px;
  border-left: 4px solid #39a9dc;
  border-bottom: 4px solid #39a9dc;
  border-radius: 0 0 0 12px;
}

.scanner-corner.br {
  right: -2px;
  bottom: -2px;
  border-right: 4px solid #39a9dc;
  border-bottom: 4px solid #39a9dc;
  border-radius: 0 0 12px 0;
}

.imei-scan-line {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 50%;
  height: 2px;
  background: #39a9dc;
  box-shadow: 0 0 10px #39a9dc;
  animation: imeiScannerLine 1.6s ease-in-out infinite alternate;
}

@keyframes imeiScannerLine {
  from { top: 14%; }
  to { top: 86%; }
}

.imei-scanner-message {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  max-width: calc(100% - 20px);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.62);
  color: #fff;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}

.scanner-quick-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 9px;
}

.scanner-quick-tools > .btn {
  flex: 0 0 auto;
}

.scanner-zoom {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
}

.scanner-zoom span {
  font-size: 11px;
  color: #64737c;
}

.scanner-zoom input {
  width: 100%;
}

.imei-scanner-result {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #d9e6ed;
  border-radius: 14px;
  background: #f7fbfd;
  text-align: center;
}

.imei-scanner-result strong {
  display: block;
  margin: 5px 0 2px;
  font: 800 clamp(18px, 5vw, 25px)/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.imei-scanner-result small {
  color: #71808a;
}

.scanner-result-actions {
  margin-top: 10px;
}

.scanner-modal-footer {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.scanner-modal-footer .btn {
  min-height: 38px;
  font-size: 12px;
}

@media (max-width: 420px) {
  .identifier-scan-row {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  .scan-field-btn {
    min-width: 48px;
    width: 48px;
    padding: 0;
    font-size: 0;
  }

  .scan-field-btn span:first-child {
    font-size: 21px;
  }

  .scanner-dialog {
    width: calc(100% - 10px);
  }

  .scanner-modal-card {
    padding: 9px;
  }

  .imei-scanner-video-wrap {
    aspect-ratio: 1 / 1;
    max-height: 54vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .imei-scan-line {
    animation: none;
  }
}


/* =========================================================
   Bloque 18C — Zoom móvil y controles de geocercas
   ========================================================= */

input,
select,
textarea {
  font-size: 16px !important;
}

button,
.btn,
a,
input,
select,
textarea,
label {
  touch-action: manipulation;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Controles nativos compactos dentro del módulo de geocercas. */
.geofence-form input[type="radio"],
.geofence-form input[type="checkbox"],
.geofence-editor input[type="radio"],
.geofence-editor input[type="checkbox"],
#geofence-screen input[type="radio"],
#geofence-screen input[type="checkbox"],
#geofences-screen input[type="radio"],
#geofences-screen input[type="checkbox"] {
  appearance: auto !important;
  -webkit-appearance: auto !important;
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  flex: 0 0 20px !important;
}

.geofence-form fieldset,
.geofence-editor fieldset,
#geofence-screen fieldset,
#geofences-screen fieldset {
  min-width: 0;
  max-width: 100%;
}

.geofence-form fieldset label,
.geofence-editor fieldset label,
#geofence-screen fieldset label,
#geofences-screen fieldset label {
  width: auto !important;
  min-width: 0 !important;
  max-width: 100%;
}

.geofence-form .radio-group,
.geofence-form .checkbox-group,
.geofence-editor .radio-group,
.geofence-editor .checkbox-group,
#geofence-screen .radio-group,
#geofence-screen .checkbox-group,
#geofences-screen .radio-group,
#geofences-screen .checkbox-group {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 12px 18px !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: visible !important;
}

@media (max-width: 480px) {
  .geofence-form input[type="radio"],
  .geofence-form input[type="checkbox"],
  .geofence-editor input[type="radio"],
  .geofence-editor input[type="checkbox"],
  #geofence-screen input[type="radio"],
  #geofence-screen input[type="checkbox"],
  #geofences-screen input[type="radio"],
  #geofences-screen input[type="checkbox"] {
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    flex-basis: 18px !important;
  }
}


/* =========================================================
   Bloque 18C.1 — Controles reales de Geocercas
   ========================================================= */

/*
 * Reemplazamos la apariencia nativa iOS sólo dentro del formulario
 * de Geocercas para evitar radios/checks gigantes y separación del texto.
 */
#geofence-form input[type="radio"],
#geofence-form input[type="checkbox"] {
  -webkit-appearance: none !important;
  appearance: none !important;

  display: inline-block !important;
  position: relative !important;

  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;

  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;

  margin: 0 !important;
  padding: 0 !important;

  border: 2px solid #9aa7b1 !important;
  background: #fff !important;
  box-shadow: none !important;

  flex: 0 0 20px !important;
  vertical-align: middle !important;
}

/* Radio */
#geofence-form input[type="radio"] {
  border-radius: 50% !important;
}

#geofence-form input[type="radio"]:checked {
  border-color: #1597e5 !important;
  box-shadow: inset 0 0 0 5px #1597e5 !important;
}

/* Checkbox */
#geofence-form input[type="checkbox"] {
  border-radius: 5px !important;
}

#geofence-form input[type="checkbox"]:checked {
  border-color: #1597e5 !important;
  background-color: #1597e5 !important;
  background-image:
    linear-gradient(45deg, transparent 42%, #fff 42%, #fff 55%, transparent 55%),
    linear-gradient(-45deg, transparent 46%, #fff 46%, #fff 57%, transparent 57%) !important;
  background-size: 8px 12px, 12px 8px !important;
  background-position: 3px 4px, 6px 7px !important;
  background-repeat: no-repeat !important;
}

/* ---------------------------------------------------------
   Detectar: las tres opciones forman parte de una sola tarjeta.
   --------------------------------------------------------- */

#geofence-form .geofence-fieldset {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;

  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;

  gap: 10px 14px !important;

  padding: 11px 12px !important;
  margin: 0 !important;

  overflow: hidden !important;
}

#geofence-form .geofence-fieldset > legend {
  float: none !important;
  width: auto !important;
  max-width: 100% !important;
  padding: 0 5px !important;
}

#geofence-form .geofence-fieldset > label {
  display: inline-flex !important;
  grid-template-columns: none !important;

  flex: 0 1 auto !important;

  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;

  align-items: center !important;
  justify-content: flex-start !important;

  gap: 7px !important;

  margin: 0 !important;
  padding: 3px 0 !important;

  white-space: nowrap !important;
  overflow: visible !important;

  color: #263844 !important;
  font-size: 14px !important;
  line-height: 1.25 !important;
  font-weight: 650 !important;
}

/* ---------------------------------------------------------
   Notificación: checkbox + TODO el texto dentro de la tarjeta.
   --------------------------------------------------------- */

#geofence-form .geofence-notify-toggle {
  box-sizing: border-box !important;

  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;

  display: flex !important;
  grid-template-columns: none !important;

  align-items: center !important;
  justify-content: flex-start !important;

  gap: 10px !important;

  padding: 11px 12px !important;
  margin: 0 !important;

  overflow: hidden !important;
}

#geofence-form .geofence-notify-toggle > input {
  flex: 0 0 20px !important;
}

#geofence-form .geofence-notify-toggle > span {
  display: grid !important;
  flex: 1 1 auto !important;

  min-width: 0 !important;
  max-width: calc(100% - 30px) !important;

  gap: 2px !important;

  overflow: hidden !important;
}

#geofence-form .geofence-notify-toggle strong,
#geofence-form .geofence-notify-toggle small {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;

  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

#geofence-form .geofence-notify-toggle strong {
  color: #263844 !important;
  font-size: 14px !important;
  line-height: 1.25 !important;
}

#geofence-form .geofence-notify-toggle small {
  color: #728078 !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
}

/* ---------------------------------------------------------
   Vehículos: checkbox y nombre dentro de la misma fila/tarjeta.
   --------------------------------------------------------- */

#geofence-form .geofence-vehicle-picker {
  box-sizing: border-box !important;

  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;

  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;

  gap: 7px !important;

  overflow: hidden !important;
}

#geofence-form .geofence-vehicle-option {
  box-sizing: border-box !important;

  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;

  min-height: 42px !important;

  display: flex !important;
  grid-template-columns: none !important;

  align-items: center !important;
  justify-content: flex-start !important;

  gap: 9px !important;

  padding: 9px 10px !important;
  margin: 0 !important;

  overflow: hidden !important;
}

#geofence-form .geofence-vehicle-option > input {
  flex: 0 0 20px !important;
}

#geofence-form .geofence-vehicle-option > span {
  display: block !important;
  flex: 1 1 auto !important;

  min-width: 0 !important;
  max-width: calc(100% - 29px) !important;

  color: #263844 !important;
  font-size: 14px !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;

  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

/*
 * El editor no debe poder crear un ancho mayor al viewport.
 */
#geofence-form,
.geofence-editor-panel,
.geofence-editor-content,
.geofence-workspace {
  box-sizing: border-box !important;
  max-width: 100% !important;
}

/* Móvil: distribuir Detectar de manera predecible. */
@media (max-width: 480px) {
  #geofence-form .geofence-fieldset {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    column-gap: 8px !important;
    row-gap: 7px !important;
  }

  #geofence-form .geofence-fieldset > legend {
    grid-column: 1 / -1 !important;
  }

  #geofence-form .geofence-fieldset > label {
    width: 100% !important;
    justify-content: flex-start !important;
    font-size: 13px !important;
  }

  #geofence-form input[type="radio"],
  #geofence-form input[type="checkbox"] {
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;

    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;

    flex-basis: 18px !important;
  }

  #geofence-form input[type="radio"]:checked {
    box-shadow: inset 0 0 0 4px #1597e5 !important;
  }

  #geofence-form .geofence-notify-toggle > input,
  #geofence-form .geofence-vehicle-option > input {
    flex-basis: 18px !important;
  }
}

/* Teléfonos muy estrechos: Detectar baja de forma limpia a 2+1. */
@media (max-width: 350px) {
  #geofence-form .geofence-fieldset {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}


/* =========================================================
   Bloque 18C.2 — Controles de Geocerca rápida
   ========================================================= */

/*
 * La Geocerca rápida usa un formulario/modal distinto al editor
 * principal, por eso requiere reglas equivalentes propias.
 */

/* Radios y checkbox compactos dentro del modal rápido */
#quick-geofence-dialog input[type="radio"],
#quick-geofence-dialog input[type="checkbox"],
.quick-geofence-dialog input[type="radio"],
.quick-geofence-dialog input[type="checkbox"] {
  -webkit-appearance: none !important;
  appearance: none !important;

  display: inline-block !important;
  position: relative !important;

  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;

  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;

  margin: 0 !important;
  padding: 0 !important;

  border: 2px solid #9aa7b1 !important;
  background: #fff !important;
  box-shadow: none !important;

  flex: 0 0 20px !important;
  vertical-align: middle !important;
}

/* Radios */
#quick-geofence-dialog input[type="radio"],
.quick-geofence-dialog input[type="radio"] {
  border-radius: 50% !important;
}

#quick-geofence-dialog input[type="radio"]:checked,
.quick-geofence-dialog input[type="radio"]:checked {
  border-color: #1597e5 !important;
  box-shadow: inset 0 0 0 5px #1597e5 !important;
}

/* Checkbox */
#quick-geofence-dialog input[type="checkbox"],
.quick-geofence-dialog input[type="checkbox"] {
  border-radius: 5px !important;
}

#quick-geofence-dialog input[type="checkbox"]:checked,
.quick-geofence-dialog input[type="checkbox"]:checked {
  border-color: #1597e5 !important;
  background-color: #1597e5 !important;
  background-image:
    linear-gradient(45deg, transparent 42%, #fff 42%, #fff 55%, transparent 55%),
    linear-gradient(-45deg, transparent 46%, #fff 46%, #fff 57%, transparent 57%) !important;
  background-size: 8px 12px, 12px 8px !important;
  background-position: 3px 4px, 6px 7px !important;
  background-repeat: no-repeat !important;
}

/* Grupo "¿Qué deseas detectar?" */
#quick-geofence-dialog fieldset,
.quick-geofence-dialog fieldset {
  box-sizing: border-box !important;

  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;

  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;

  column-gap: 8px !important;
  row-gap: 7px !important;

  padding: 11px 12px !important;
  margin: 0 !important;

  overflow: hidden !important;
}

#quick-geofence-dialog fieldset > legend,
.quick-geofence-dialog fieldset > legend {
  grid-column: 1 / -1 !important;

  float: none !important;
  width: auto !important;
  max-width: 100% !important;

  padding: 0 5px !important;
}

/*
 * Cada opción: control + texto en la misma celda.
 */
#quick-geofence-dialog fieldset > label,
.quick-geofence-dialog fieldset > label {
  display: inline-flex !important;
  grid-template-columns: none !important;

  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;

  align-items: center !important;
  justify-content: flex-start !important;

  gap: 7px !important;

  margin: 0 !important;
  padding: 3px 0 !important;

  color: #263844 !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
  font-weight: 650 !important;

  white-space: nowrap !important;
  overflow: visible !important;
}

/*
 * Tarjeta de notificación:
 * checkbox + bloque de texto siempre dentro.
 */
#quick-geofence-dialog .quick-geofence-notify,
#quick-geofence-dialog .geofence-notify-toggle,
.quick-geofence-dialog .quick-geofence-notify,
.quick-geofence-dialog .geofence-notify-toggle {
  box-sizing: border-box !important;

  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;

  display: flex !important;
  grid-template-columns: none !important;

  align-items: center !important;
  justify-content: flex-start !important;

  gap: 10px !important;

  padding: 11px 12px !important;
  margin: 0 !important;

  overflow: hidden !important;
}

#quick-geofence-dialog .quick-geofence-notify > input,
#quick-geofence-dialog .geofence-notify-toggle > input,
.quick-geofence-dialog .quick-geofence-notify > input,
.quick-geofence-dialog .geofence-notify-toggle > input {
  flex: 0 0 20px !important;
}

#quick-geofence-dialog .quick-geofence-notify > span,
#quick-geofence-dialog .geofence-notify-toggle > span,
.quick-geofence-dialog .quick-geofence-notify > span,
.quick-geofence-dialog .geofence-notify-toggle > span {
  display: grid !important;
  flex: 1 1 auto !important;

  min-width: 0 !important;
  max-width: calc(100% - 30px) !important;

  gap: 2px !important;
  overflow: hidden !important;
}

#quick-geofence-dialog .quick-geofence-notify strong,
#quick-geofence-dialog .quick-geofence-notify small,
#quick-geofence-dialog .geofence-notify-toggle strong,
#quick-geofence-dialog .geofence-notify-toggle small,
.quick-geofence-dialog .quick-geofence-notify strong,
.quick-geofence-dialog .quick-geofence-notify small,
.quick-geofence-dialog .geofence-notify-toggle strong,
.quick-geofence-dialog .geofence-notify-toggle small {
  display: block !important;

  width: 100% !important;
  max-width: 100% !important;

  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

#quick-geofence-dialog .quick-geofence-notify strong,
#quick-geofence-dialog .geofence-notify-toggle strong,
.quick-geofence-dialog .quick-geofence-notify strong,
.quick-geofence-dialog .geofence-notify-toggle strong {
  color: #263844 !important;
  font-size: 14px !important;
  line-height: 1.25 !important;
}

#quick-geofence-dialog .quick-geofence-notify small,
#quick-geofence-dialog .geofence-notify-toggle small,
.quick-geofence-dialog .quick-geofence-notify small,
.quick-geofence-dialog .geofence-notify-toggle small {
  color: #728078 !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
}

/*
 * Defensa contra crecimiento horizontal del contenido del modal.
 */
#quick-geofence-dialog,
#quick-geofence-dialog form,
#quick-geofence-dialog .dialog-card,
#quick-geofence-dialog .modal-card,
.quick-geofence-dialog,
.quick-geofence-dialog form {
  box-sizing: border-box !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

@media (max-width: 480px) {
  #quick-geofence-dialog input[type="radio"],
  #quick-geofence-dialog input[type="checkbox"],
  .quick-geofence-dialog input[type="radio"],
  .quick-geofence-dialog input[type="checkbox"] {
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;

    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;

    flex-basis: 18px !important;
  }

  #quick-geofence-dialog input[type="radio"]:checked,
  .quick-geofence-dialog input[type="radio"]:checked {
    box-shadow: inset 0 0 0 4px #1597e5 !important;
  }

  #quick-geofence-dialog .quick-geofence-notify > input,
  #quick-geofence-dialog .geofence-notify-toggle > input,
  .quick-geofence-dialog .quick-geofence-notify > input,
  .quick-geofence-dialog .geofence-notify-toggle > input {
    flex-basis: 18px !important;
  }
}

@media (max-width: 350px) {
  #quick-geofence-dialog fieldset,
  .quick-geofence-dialog fieldset {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}


/* =========================================================
   Bloque 18D — Paginación de Notificaciones
   ========================================================= */

.notifications-load-more-wrap,
.notifications-end {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 16px 14px 18px;
  border-top: 1px solid #edf1f3;
  background: #fff;
}

.notifications-load-more {
  width: min(260px, 100%);
  min-height: 44px;
}

.notifications-load-more-wrap small,
.notifications-end small {
  color: #8a969d;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
}


/* GLE_WATCHER_V2_BLOCK1L_MOBILE_SERVICE_UI */
.gle-build-witness{display:block;margin-top:3px;font-size:10px;line-height:1.2;opacity:.58;letter-spacing:.02em}
.compact-vehicle-row.service-expired{border-color:rgba(220,38,38,.55);background:linear-gradient(90deg,rgba(220,38,38,.10),rgba(220,38,38,.035))}
.compact-vehicle-row.service-grace{border-color:rgba(217,119,6,.50);background:linear-gradient(90deg,rgba(245,158,11,.10),rgba(245,158,11,.025))}
.compact-vehicle-row.service-pending{border-color:rgba(100,116,139,.35)}
.service-validity-note{display:flex;flex-wrap:wrap;gap:3px 8px;align-items:baseline;margin-top:4px;font-size:11px;line-height:1.25}
.service-validity-note strong{font-size:11px}.service-validity-note span{opacity:.76}
.service-validity-note.service-active strong{color:#16803c}.service-validity-note.service-grace strong{color:#b45309}.service-validity-note.service-expired strong{color:#b91c1c}.service-validity-note.service-pending strong{color:#64748b}
.compact-vehicle-row.service-expired .compact-vehicle-status{color:#b91c1c;font-weight:700}.compact-vehicle-row.service-grace .compact-vehicle-status{color:#b45309;font-weight:700}


/* GLE_WATCHER_V2_BLOCK1M3_MOBILE_VEHICLES */
.vehicle-menu-btn {
  font-size: 17px;
  line-height: 1;
}

.mobile-vehicles-workspace {
  min-height: 100dvh;
  background: #f5f7fa;
}

.mobile-vehicles-topbar {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) 14px 12px;
  background: #111827;
  color: #fff;
}

.mobile-vehicles-note {
  margin: 14px 14px 0;
  padding: 12px 13px;
  border: 1px solid #dbe5ef;
  border-radius: 12px;
  background: #f8fbff;
  color: #526173;
  font-size: 12px;
  line-height: 1.5;
}

.mobile-vehicle-admin-list {
  display: grid;
  gap: 12px;
  padding: 14px 14px calc(24px + env(safe-area-inset-bottom));
}

.mobile-vehicle-admin-card {
  padding: 15px;
  border: 1px solid #e2e8f0;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .04);
}

.mobile-vehicle-admin-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.mobile-vehicle-admin-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eef7fb;
  font-size: 20px;
}

.mobile-vehicle-admin-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mobile-vehicle-admin-copy strong {
  color: #172033;
  font-size: 15px;
}

.mobile-vehicle-admin-copy span {
  font-size: 11px;
  font-weight: 700;
}

.mobile-vehicle-admin-copy .has-gps {
  color: #157347;
}

.mobile-vehicle-admin-copy .no-gps {
  color: #64748b;
}

.mobile-vehicle-admin-details {
  display: grid;
  gap: 3px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid #eef2f6;
  color: #748195;
  font-size: 11px;
}

.mobile-vehicle-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.mobile-vehicle-admin-actions .btn {
  flex: 1 1 auto;
  min-width: 88px;
}

.danger-note {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fff7f7;
  color: #8b3030;
  font-size: 12px;
  line-height: 1.45;
}


/* GLE_WATCHER_MOBILE_V2_SIM_RECHARGE_BUILD6 */
.mobile-sim-recharge-card{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;padding:12px 13px;border:1px solid rgba(14,165,233,.28);border-radius:12px;background:rgba(14,165,233,.07)}
.mobile-sim-recharge-card.is-empty{border-color:rgba(148,163,184,.32);background:rgba(148,163,184,.06)}
.mobile-sim-recharge-copy{min-width:0}
.mobile-sim-recharge-copy span{display:block;margin-bottom:4px;color:#64748b;font-size:11px;font-weight:700}
.mobile-sim-recharge-copy strong{display:block;color:#0f172a;font-size:15px;overflow-wrap:anywhere}
.mobile-sim-recharge-copy-btn,.mobile-sim-copy-btn{flex:0 0 auto;border:1px solid rgba(14,165,233,.34);border-radius:9px;padding:8px 10px;background:#fff;color:#075985;font-weight:750;cursor:pointer}
.mobile-sim-edit-section{padding:13px;border:1px solid rgba(14,165,233,.28);border-radius:12px;background:rgba(14,165,233,.06)}
.mobile-sim-input-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-top:6px}
.mobile-sim-help{margin:8px 0 0;color:#64748b;font-size:12px;line-height:1.45}
@media(max-width:420px){.mobile-sim-recharge-card{align-items:flex-start;flex-direction:column}.mobile-sim-recharge-copy-btn{width:100%}}


/* =========================================================
   GLE Watcher Mobile V2 — Visual Block 1
   Look & feel: dark / turquoise / glass / map-first
   Build: 2026-08-29.v2b1
   ========================================================= */

:root {
  --bg: #071419;
  --surface: #0b1d23;
  --surface-2: #10262d;
  --surface-3: #143039;
  --text: #eef9f8;
  --muted: #8fa8ab;
  --line: rgba(157, 224, 218, .13);
  --primary: #10d9c5;
  --primary-strong: #07bda9;
  --danger: #ff6464;
  --success: #1ae0b5;
  --shadow: 0 18px 50px rgba(0, 0, 0, .34);
  --radius: 20px;
  --v2-glass: rgba(8, 28, 34, .82);
  --v2-glass-strong: rgba(10, 31, 37, .95);
  --v2-cyan-glow: 0 0 24px rgba(16, 217, 197, .18);
}

html,
body {
  background: #071419;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 85% -10%, rgba(16, 217, 197, .12), transparent 28%),
    radial-gradient(circle at 8% 20%, rgba(10, 111, 121, .12), transparent 28%),
    #071419;
}

.card,
.hero-card,
.list-item {
  background: linear-gradient(180deg, rgba(15, 39, 46, .96), rgba(8, 27, 33, .96));
  border-color: var(--line);
  color: var(--text);
}

.brand-block p,
.list-meta,
.eyebrow {
  color: var(--muted);
}

input,
select {
  border-color: rgba(170, 220, 217, .16);
  background: #0d2228;
  color: var(--text);
}

input::placeholder {
  color: #688085;
}

input:focus,
select:focus {
  border-color: rgba(16, 217, 197, .75);
  box-shadow: 0 0 0 3px rgba(16, 217, 197, .12);
}

.btn.primary {
  background: linear-gradient(135deg, #13d9c5, #08b6a4);
  color: #03221f;
  box-shadow: 0 8px 24px rgba(16, 217, 197, .17);
}

.btn.secondary {
  background: #10272e;
  color: #d8e8e7;
  border: 1px solid rgba(169, 221, 217, .12);
}

.link-button {
  color: var(--primary);
}

.tracking-workspace {
  background: #071419;
}

.tracking-map-stage {
  background: #071419;
}

.tracking-map-stage .leaflet-tile-pane {
  filter: invert(.91) hue-rotate(152deg) saturate(.55) brightness(.48) contrast(1.18);
}

.tracking-map-stage .leaflet-control-zoom a,
.tracking-map-stage .leaflet-control-attribution {
  background: rgba(7, 20, 25, .88) !important;
  color: #8fa8ab !important;
  border-color: rgba(150, 217, 212, .12) !important;
}

.tracking-map-stage .leaflet-control-attribution a {
  color: #52d7cb !important;
}

.tracking-topbar {
  top: max(10px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  gap: 12px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(155, 226, 220, .12);
  border-radius: 23px;
  background:
    linear-gradient(145deg, rgba(13, 40, 47, .93), rgba(6, 24, 29, .89));
  box-shadow:
    0 18px 46px rgba(0, 0, 0, .32),
    inset 0 1px 0 rgba(255, 255, 255, .025);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.tracking-brandline {
  align-items: flex-start;
}

.tracking-greeting {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.tracking-greeting .eyebrow {
  color: #83a0a4;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .025em;
  text-transform: none;
}

.tracking-screen-title {
  margin-top: 1px;
  color: #f2fbfa;
  font-size: clamp(19px, 5.4vw, 25px);
  line-height: 1.04;
  letter-spacing: -.035em;
  font-weight: 900;
}

.tracking-account {
  display: block;
  max-width: 230px;
  margin-top: 4px;
  color: #9eb4b6;
  font-size: 10px;
  font-weight: 600;
}

.build-witness {
  width: fit-content;
  margin-top: 5px;
  padding: 3px 7px;
  border: 1px solid rgba(16, 217, 197, .18);
  border-radius: 999px;
  background: rgba(16, 217, 197, .055);
  color: #61cfc5;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .08em;
}

.tracking-top-actions {
  gap: 7px;
}

.compact-round-btn,
.notification-bell-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(155, 226, 220, .12);
  border-radius: 12px;
  background: linear-gradient(145deg, #12313a, #0b2229);
  color: #b7cfce;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  font-size: 16px;
}

.notification-bell-btn {
  position: relative;
}

.compact-round-btn:active,
.notification-bell-btn:active {
  transform: scale(.96);
  background: #163a42;
}

.compact-text-btn {
  color: #8ba5a8;
  font-size: 11px;
}

.tracking-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 32px;
  gap: 7px;
  color: #a1b6b8;
  font-size: 9px;
  white-space: normal;
}

.tracking-kpis > span {
  min-height: 48px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  align-items: end;
  column-gap: 5px;
  row-gap: 1px;
  padding: 7px 8px;
  border: 1px solid rgba(159, 225, 220, .09);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(17, 50, 58, .7), rgba(8, 30, 36, .7));
}

.tracking-kpis > span > strong {
  grid-column: 1 / -1;
  grid-row: 1;
  color: #f1fbfa;
  font-size: 19px;
  line-height: 1;
  letter-spacing: -.04em;
}

.tracking-kpis > span .status-dot {
  grid-column: 1;
  grid-row: 2;
}

.tracking-kpis > span {
  line-height: 1.05;
}

.tracking-kpis > span:first-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.tracking-kpis > span:first-child strong {
  display: block;
}

.kpi-online {
  color: #95aaa9;
}

.status-dot.online {
  background: #1be0b3;
  box-shadow: 0 0 9px rgba(27, 224, 179, .62);
}

.status-dot.offline {
  background: #60777b;
  box-shadow: none;
}

.tracking-refresh {
  align-self: stretch;
  width: 32px;
  height: auto;
  min-height: 48px;
  margin-left: 0;
  border: 1px solid rgba(159, 225, 220, .10);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(18, 50, 58, .8), rgba(8, 29, 35, .8));
  color: #75cfc7;
}

.map-updated-floating {
  top: 190px;
  right: 12px;
  padding: 6px 9px;
  border: 1px solid rgba(155, 226, 220, .10);
  background: rgba(6, 23, 28, .84);
  color: #8ba4a6;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  backdrop-filter: blur(12px);
}

.vehicle-sheet {
  left: 10px;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  height: 36vh;
  max-height: 76vh;
  border: 1px solid rgba(154, 224, 218, .12);
  border-radius: 25px;
  background:
    linear-gradient(155deg, rgba(13, 42, 49, .97), rgba(6, 24, 29, .97));
  box-shadow: 0 -6px 44px rgba(0, 0, 0, .37);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.vehicle-sheet.sheet-collapsed {
  height: 126px;
}

.vehicle-sheet.sheet-mid {
  height: 36vh;
}

.vehicle-sheet.sheet-expanded {
  height: 76vh;
}

.sheet-handle {
  width: 42px;
  height: 4px;
  background: #38565a;
}

.sheet-heading {
  padding: 0 14px 9px;
}

.sheet-heading strong {
  color: #f0f9f8;
  font-size: 14px;
}

.sheet-heading span {
  color: #718d90;
}

.vehicle-compact-list {
  padding: 0 10px 15px;
}

.compact-vehicle-row {
  position: relative;
  min-height: 54px;
  margin: 0 0 7px;
  padding: 9px 10px 9px 43px;
  border: 1px solid rgba(156, 223, 218, .075);
  border-radius: 14px;
  background: rgba(13, 38, 45, .58);
}

.compact-vehicle-row::before {
  content: "⌁";
  position: absolute;
  left: 11px;
  top: 50%;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgba(16, 217, 197, .19);
  border-radius: 8px;
  background: rgba(16, 217, 197, .075);
  color: #46d7ca;
  font-size: 16px;
  font-weight: 900;
}

.compact-vehicle-row.selected {
  padding: 11px 11px 11px 45px;
  border-color: rgba(16, 217, 197, .24);
  background:
    radial-gradient(circle at 90% 0%, rgba(16, 217, 197, .08), transparent 32%),
    rgba(14, 42, 49, .91);
  box-shadow: 0 0 24px rgba(16, 217, 197, .18);
}

.compact-vehicle-title {
  color: #edf7f6;
  font-size: 12px;
}

.compact-vehicle-status {
  color: #819a9d;
}

.selected-telemetry .telemetry-chip {
  border-color: rgba(155, 224, 219, .1);
  background: #102c33;
  color: #aec0c1;
}

.vehicle-control-btn,
.mini-action {
  border-color: rgba(151, 218, 214, .13);
  background: #102b32;
}

.unlock-control {
  border-color: rgba(27, 224, 179, .20);
  background: rgba(20, 94, 76, .23);
  color: #4ce1bc;
}

.lock-control {
  border-color: rgba(255, 100, 100, .20);
  background: rgba(118, 40, 40, .22);
  color: #ff8b86;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #0c252c;
  color: #e9f5f4;
}

.leaflet-popup-content-wrapper {
  border: 1px solid rgba(156, 223, 218, .12);
  box-shadow: 0 16px 40px rgba(0,0,0,.38);
}

#view-auth .brand-block {
  padding-top: max(42px, env(safe-area-inset-top));
}

.tabs {
  background: #0b242a;
}

.tab {
  color: #839c9f;
}

.tab.active {
  background: #14343c;
  color: #eaf7f6;
  box-shadow: none;
}

@media (max-width: 430px) {
  .tracking-topbar {
    left: 9px;
    right: 9px;
    padding: 12px 11px 10px;
  }

  .tracking-top-actions {
    gap: 5px;
  }

  .compact-round-btn,
  .notification-bell-btn {
    width: 33px;
    height: 33px;
    border-radius: 11px;
    font-size: 14px;
  }

  .tracking-account {
    max-width: 145px;
  }

  .tracking-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 29px;
    gap: 5px;
  }

  .tracking-kpis > span {
    min-height: 46px;
    padding: 6px 7px;
    font-size: 8px;
  }

  .tracking-kpis > span > strong {
    font-size: 17px;
  }

  .tracking-refresh {
    width: 29px;
    min-height: 46px;
  }

  .map-updated-floating {
    top: 181px;
    right: 9px;
  }

  .vehicle-sheet {
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
  }
}


/* =========================================================
   GLE Watcher Mobile V2 — Visual Block 2
   Requested refinements for map prominence
   Build: 2026-08-29.v2b2
   ========================================================= */

#view-auth {
  background:
    radial-gradient(circle at 50% 10%, rgba(16, 217, 197, .10), transparent 23%),
    radial-gradient(circle at 15% 12%, rgba(15, 111, 124, .10), transparent 20%),
    #061319;
}

#view-auth .brand-block {
  position: relative;
  padding: max(28px, env(safe-area-inset-top)) 12px 20px;
}

#view-auth .brand-block::before {
  content: "";
  position: absolute;
  inset: 12px 16px auto;
  height: 180px;
  border-radius: 30px;
  background:
    radial-gradient(circle at center, rgba(16, 217, 197, .13), rgba(16, 217, 197, .035) 45%, transparent 72%);
  filter: blur(4px);
  pointer-events: none;
}

.login-brand-logo {
  position: relative;
  z-index: 1;
  width: min(310px, 88%) !important;
  max-width: 310px !important;
  max-height: 180px !important;
  margin: 0 auto 14px !important;
  padding: 10px 14px;
  border: 1px solid rgba(115, 207, 201, .08);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(15, 41, 48, .38), rgba(9, 26, 32, .18));
  box-shadow:
    0 0 0 1px rgba(255,255,255,.015) inset,
    0 0 26px rgba(16, 217, 197, .12);
  filter: brightness(1.07) contrast(1.06) drop-shadow(0 0 24px rgba(16, 217, 197, .12));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#view-auth .brand-block h1 {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 18px rgba(0,0,0,.32);
}

#view-auth .brand-block p {
  position: relative;
  z-index: 1;
  color: #a3b5b6;
  text-shadow: 0 1px 10px rgba(0,0,0,.28);
  max-width: 320px;
}

.tracking-topbar {
  gap: 10px;
  padding: 12px 12px 10px;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(9, 34, 39, .82), rgba(5, 24, 29, .78));
  box-shadow:
    0 18px 42px rgba(0, 0, 0, .28),
    inset 0 1px 0 rgba(255,255,255,.02);
}

.tracking-brandline {
  align-items: center;
}

.tracking-greeting {
  gap: 4px;
}

.tracking-greeting .eyebrow,
.tracking-screen-title {
  display: none !important;
}

.tracking-account {
  margin-top: 0;
  max-width: 150px;
  color: #d8e7e7;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.15;
}

.build-witness {
  margin-top: 0;
  padding: 2px 8px;
  font-size: 9px;
  letter-spacing: .09em;
}

.gle-build-witness {
  display: none !important;
}

.tracking-top-actions {
  align-items: center;
  gap: 6px;
}

.compact-round-btn,
.notification-bell-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(19, 47, 55, .94), rgba(10, 28, 34, .92));
  color: #a9c2c3;
}

.compact-text-btn {
  padding: 0 0 0 3px;
  color: #d8e3e4;
  font-size: 12px;
  font-weight: 750;
}

.tracking-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr)) 30px;
  gap: 6px;
}

.tracking-kpis > span {
  min-height: 42px;
  padding: 6px 8px;
  border-radius: 13px;
}

.tracking-kpis > span > strong {
  font-size: 18px;
}

.tracking-refresh {
  width: 30px;
  min-height: 42px;
}

.map-updated-floating {
  top: 138px;
  right: 12px;
  font-size: 10px;
}

.vehicle-sheet {
  height: 33vh;
  max-height: 74vh;
}

.vehicle-sheet.sheet-collapsed {
  height: 118px;
}

.vehicle-sheet.sheet-mid {
  height: 33vh;
}

.vehicle-sheet.sheet-expanded {
  height: 74vh;
}

.sheet-heading {
  padding: 0 14px 8px;
}

.sheet-heading strong {
  font-size: 13px;
}

.sheet-heading span {
  font-size: 10px;
}

.leaflet-popup-content-wrapper {
  background: linear-gradient(180deg, rgba(11, 43, 50, .96), rgba(9, 34, 40, .96));
}

.leaflet-popup-content {
  margin: 14px 16px;
}

@media (max-width: 430px) {
  .tracking-topbar {
    left: 8px;
    right: 8px;
    padding: 10px 10px 9px;
    gap: 8px;
  }

  .tracking-account {
    max-width: 118px;
    font-size: 11px;
  }

  .build-witness {
    font-size: 8px;
  }

  .compact-round-btn,
  .notification-bell-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .compact-text-btn {
    font-size: 11px;
  }

  .tracking-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 28px;
    gap: 5px;
    font-size: 8px;
  }

  .tracking-kpis > span {
    min-height: 40px;
    padding: 5px 7px;
  }

  .tracking-kpis > span > strong {
    font-size: 16px;
  }

  .tracking-refresh {
    width: 28px;
    min-height: 40px;
  }

  .map-updated-floating {
    top: 129px;
    right: 8px;
    padding: 5px 8px;
    font-size: 9px;
  }

  .vehicle-sheet {
    left: 8px;
    right: 8px;
    height: 31vh;
  }

  .vehicle-sheet.sheet-mid {
    height: 31vh;
  }

  #view-auth .brand-block {
    padding-top: max(24px, env(safe-area-inset-top));
  }

  .login-brand-logo {
    width: min(282px, 90%) !important;
    max-width: 282px !important;
    max-height: 164px !important;
    padding: 9px 12px;
  }
}


/* =========================================================
   GLE Watcher Mobile V2 — Visual Block 2.1
   Map usability + more turquoise hue
   Build: 2026-08-29.v2b21
   ========================================================= */

:root {
  --primary: #12d7d0;
  --primary-strong: #0cb7c7;
  --surface: #0a1f28;
  --surface-2: #0d2530;
  --surface-3: #123342;
  --line: rgba(154, 227, 231, .13);
  --muted: #96afb4;
}

/* Shift whole visual language slightly from green to turquoise */
body {
  background:
    radial-gradient(circle at 84% -8%, rgba(18, 215, 208, .13), transparent 30%),
    radial-gradient(circle at 8% 20%, rgba(25, 132, 166, .12), transparent 26%),
    #06141b;
}

.card,
.hero-card,
.list-item {
  background: linear-gradient(180deg, rgba(11, 35, 44, .97), rgba(7, 23, 30, .97));
}

.btn.primary {
  background: linear-gradient(135deg, #19dce0, #08b7c5);
  color: #032128;
  box-shadow: 0 8px 24px rgba(18, 215, 208, .18);
}

.link-button {
  color: #37e1dd;
}

.tracking-topbar {
  background:
    linear-gradient(145deg, rgba(8, 35, 43, .84), rgba(5, 22, 30, .80));
  border-color: rgba(154, 227, 231, .13);
}

.compact-round-btn,
.notification-bell-btn,
.tracking-refresh {
  border-color: rgba(154, 227, 231, .12);
  background: linear-gradient(145deg, rgba(17, 47, 58, .94), rgba(9, 29, 38, .92));
  color: #b8d3d5;
}

.build-witness {
  border-color: rgba(18, 215, 208, .24);
  background: rgba(18, 215, 208, .07);
  color: #7ce4df;
}

.tracking-kpis > span {
  border-color: rgba(154, 227, 231, .10);
  background:
    linear-gradient(145deg, rgba(14, 46, 56, .76), rgba(8, 28, 36, .78));
}

.status-dot.online {
  background: #19e2d5;
  box-shadow: 0 0 10px rgba(25, 226, 213, .65);
}

.tracking-refresh {
  color: #7de1dc;
}

.vehicle-sheet {
  border-color: rgba(154, 227, 231, .13);
  background:
    linear-gradient(155deg, rgba(9, 36, 45, .97), rgba(5, 22, 29, .97));
}

.compact-vehicle-row {
  border-color: rgba(154, 227, 231, .08);
  background: rgba(11, 35, 44, .60);
}

.compact-vehicle-row.selected {
  border-color: rgba(18, 215, 208, .26);
  background:
    radial-gradient(circle at 90% 0%, rgba(18, 215, 208, .08), transparent 34%),
    rgba(10, 39, 49, .92);
  box-shadow: 0 0 24px rgba(18, 215, 208, .16);
}

.compact-vehicle-row::before {
  border-color: rgba(18, 215, 208, .22);
  background: rgba(18, 215, 208, .08);
  color: #59e1da;
}

.selected-telemetry .telemetry-chip {
  background: #0f2a36;
  border-color: rgba(154, 227, 231, .11);
}

.vehicle-control-btn,
.mini-action {
  border-color: rgba(154, 227, 231, .14);
  background: #102a35;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #0c2832;
}

.leaflet-popup-content-wrapper {
  border-color: rgba(154, 227, 231, .13);
}

/* Main usability fix: lighter, more legible dark map */
.tracking-map-stage .leaflet-tile-pane {
  filter: invert(.82) hue-rotate(168deg) saturate(.78) brightness(.78) contrast(1.05);
}

.tracking-map-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 15, 20, .08), rgba(4, 15, 20, .03) 18%, rgba(4, 15, 20, .03) 82%, rgba(4, 15, 20, .08));
}

/* Give labels / controls a cleaner dark-turquoise framing */
.tracking-map-stage .leaflet-control-zoom a,
.tracking-map-stage .leaflet-control-attribution {
  background: rgba(7, 21, 28, .82) !important;
  color: #a4bdc2 !important;
  border-color: rgba(154, 227, 231, .13) !important;
}

.tracking-map-stage .leaflet-control-attribution a {
  color: #55deda !important;
}

.map-updated-floating {
  border-color: rgba(154, 227, 231, .12);
  background: rgba(7, 22, 28, .80);
  color: #a0b9bd;
}

/* Let the map breathe a bit more visually */
.vehicle-sheet.sheet-mid {
  height: 30vh;
}

.vehicle-sheet {
  height: 30vh;
}

.vehicle-sheet.sheet-collapsed {
  height: 112px;
}

.vehicle-sheet.sheet-expanded {
  height: 72vh;
}

@media (max-width: 430px) {
  .tracking-map-stage .leaflet-tile-pane {
    filter: invert(.82) hue-rotate(168deg) saturate(.76) brightness(.80) contrast(1.04);
  }

  .vehicle-sheet,
  .vehicle-sheet.sheet-mid {
    height: 29vh;
  }

  .vehicle-sheet.sheet-collapsed {
    height: 108px;
  }

  .map-updated-floating {
    top: 129px;
    font-size: 9px;
  }
}
