/* Estilos compartidos: móvil primero, alto contraste para usarse al sol y en la carretera. */
:root {
  --bg: #f4f6f8; --card: #ffffff; --ink: #14213d; --muted: #5b6475; --line: #e3e7ee;
  --primary: #1d4ed8; --primary-ink: #ffffff; --accent: #f59e0b; --accent-ink: #1a1200;
  --ok: #15803d; --warn: #b45309; --danger: #b91c1c; --info: #0369a1;
  --radius: 14px; --shadow: 0 1px 2px rgba(20,33,61,.06), 0 6px 20px rgba(20,33,61,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .7em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1200px; }
.topbar { background: var(--ink); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 50; }
.topbar .brand { font-weight: 700; letter-spacing: .2px; display: flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; }
.topbar .brand .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; overflow: hidden; }
.topbar .brand .logo img { width: 28px; height: 28px; display: block; }
.topbar .spacer { flex: 1; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.grid { display: grid; gap: 12px; }
@media (min-width: 720px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.btn { appearance: none; border: 0; border-radius: 12px; padding: 12px 16px; font: inherit; font-weight: 600; cursor: pointer; background: var(--primary); color: var(--primary-ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.big { width: 100%; font-size: 1.1rem; min-height: 58px; }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.ok { background: var(--ok); }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn.subtle { background: #eef1f6; color: var(--ink); }
.btn.sm { padding: 8px 12px; min-height: 36px; font-size: .9rem; border-radius: 10px; }
.input, select, textarea { width: 100%; font: inherit; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); min-height: 46px; }
.input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
label.field { display: block; margin-bottom: 10px; }
label.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #e8edf7; color: var(--primary); }
.badge.ok { background: #dcfce7; color: var(--ok); } .badge.warn { background: #fef3c7; color: var(--warn); }
.badge.danger { background: #fee2e2; color: var(--danger); } .badge.info { background: #e0f2fe; color: var(--info); } .badge.gray { background: #eceff3; color: var(--muted); }
.map { width: 100%; height: 320px; border-radius: var(--radius); overflow: hidden; background: #dfe7ef; position: relative; }
.map-keyfail { position: absolute; inset: auto 8px 8px 8px; z-index: 500; background: #fff7ed; border: 1px solid #fdba74; color: #7c2d12; padding: 8px 10px; border-radius: 10px; font-size: .85rem; }
.map.tall { height: 56vh; min-height: 360px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 100; max-width: 92vw; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.toast.err { background: var(--danger); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.kv dt { color: var(--muted); font-size: .85rem; } .kv dd { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 22px; position: relative; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 13px; width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.timeline li.done::before { background: var(--ok); }
.timeline li .when { display: block; font-size: .78rem; color: var(--muted); }
.big-num { font-size: 2.4rem; font-weight: 800; letter-spacing: .08em; font-family: ui-monospace, Menlo, monospace; }
.hidden { display: none !important; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
tr.clickable { cursor: pointer; } tr.clickable:hover { background: #f6f8fb; }
.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-tabs button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .9rem; cursor: pointer; }
.pill-tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; border: 1px solid; }
.alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.alert.warn { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.alert.ok { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.alert.danger { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.leaflet-container { font: inherit; }
.bus-marker { background: var(--accent); color: var(--accent-ink); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; box-shadow: 0 2px 10px rgba(0,0,0,.35); border: 3px solid #fff; }
.pin-marker { width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.pin-marker.pickup { background: var(--primary); } .pin-marker.dropoff { background: var(--ok); } .pin-marker.fallback { background: var(--warn); }
