/* AuxiRuta · tokens y componentes compartidos */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --border: #dde1e8;
  --text: #141a24;
  --text-2: #5a6475;
  --brand: #f26a1b;          /* naranja de seguridad vial */
  --brand-ink: #ffffff;
  --brand-soft: #fde9dc;
  --navy: #0f1b2d;
  --ok: #1f9d55;    --ok-soft: #dcf3e5;
  --warn: #c98a00;  --warn-soft: #fbf0d0;
  --danger: #d6342c;--danger-soft: #fbe0de;
  --info: #2563eb;  --info-soft: #dde8fd;
  --accent: #7c3aed;--accent-soft: #ebe1fd;
  --muted: #7a8394; --muted-soft: #e7e9ee;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 14px rgba(16,24,40,.06);
  --map-bg: #dbe7ef;
  --map-land: #f4f2ea;
  --map-road: #c4cad4;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b111b; --surface: #121a27; --surface-2: #1a2434; --border: #263246;
    --text: #e8edf5; --text-2: #97a3b6; --brand-soft: #3a2214; --navy: #060b13;
    --ok-soft: #12321f; --warn-soft: #3a2d08; --danger-soft: #3b1513; --info-soft: #14254a;
    --accent-soft: #2a1a4a; --muted-soft: #222b39; --map-bg: #0d1724; --map-land: #1a2433; --map-road: #3a4a63;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b111b; --surface: #121a27; --surface-2: #1a2434; --border: #263246;
  --text: #e8edf5; --text-2: #97a3b6; --brand-soft: #3a2214; --navy: #060b13;
  --ok-soft: #12321f; --warn-soft: #3a2d08; --danger-soft: #3b1513; --info-soft: #14254a;
  --accent-soft: #2a1a4a; --muted-soft: #222b39; --map-bg: #0d1724; --map-land: #1a2433; --map-road: #3a4a63;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
button, input, select, textarea { font: inherit; color: inherit; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: #dc5a10; }
.btn-danger { color: var(--danger); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #18834a; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tone-ok { color: var(--ok); background: var(--ok-soft); }
.tone-warn { color: var(--warn); background: var(--warn-soft); }
.tone-danger { color: var(--danger); background: var(--danger-soft); }
.tone-info { color: var(--info); background: var(--info-soft); }
.tone-accent { color: var(--accent); background: var(--accent-soft); }
.tone-muted { color: var(--muted); background: var(--muted-soft); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, select.input, textarea.input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; outline: none; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; min-width: 0; }

.toast-wrap { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; max-width: calc(100vw - 32px); }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; border-left: 4px solid var(--brand); animation: toastIn .25s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* marcadores del mapa */
.mk { display: grid; place-items: center; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); font-size: 15px; }
.mk-inc { width: 34px; height: 34px; background: var(--danger); }
.mk-inc.sel { outline: 3px solid var(--brand); outline-offset: 2px; }
.mk-inc.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(214,52,44,.6); } 70% { box-shadow: 0 0 0 16px rgba(214,52,44,0); } 100% { box-shadow: 0 0 0 0 rgba(214,52,44,0); } }
.mk-op { width: 30px; height: 30px; color: #fff; font-size: 14px; }
.mk-op.disponible { background: var(--ok); }
.mk-op.en_servicio { background: var(--info); }
.mk-op.fuera_linea { background: var(--muted); }
.mk-me { width: 22px; height: 22px; background: var(--info); border: 3px solid #fff; }
.leaflet-container { font-family: var(--font); background: var(--map-bg); }
.map-place { display: block; text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; text-shadow: 0 0 3px var(--map-bg), 0 0 3px var(--map-bg); }
.map-note { background: var(--surface); color: var(--text-2); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; font-size: 11px; font-weight: 600; }

/* confirmación dentro de la página */
.ask-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(6, 11, 19, .55); display: grid; place-items: center; padding: 16px; }
.ask-box { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; padding: 20px; width: min(380px, 100%); box-shadow: var(--shadow); }
.ask-box p { margin: 0 0 16px; font-weight: 600; }
.ask-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:focus-visible, .input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
