/* Reparto — diseño pensado para el celu: una columna, barra abajo con el "+" al centro, números grandes. */

:root {
  color-scheme: light;
  --bg: #f5f3ef;
  --surface: #ffffff;
  --surface-2: #f0ede7;
  --ink: #17140f;
  --ink-2: #4f4a42;
  --muted: #8a847a;
  --line: #e7e3db;
  --border: rgba(23, 20, 15, 0.08);
  --accent: #e2620c;
  --accent-ink: #b44c06;
  --accent-soft: rgba(226, 98, 12, 0.1);
  --on-accent: #ffffff;
  --good: #1a9d55;
  --good-ink: #127a41;
  --good-soft: rgba(26, 157, 85, 0.12);
  --warning: #e8a317;
  --critical: #d23c3c;
  --critical-ink: #b02a2a;
  --shadow: 0 1px 2px rgba(23, 20, 15, 0.05), 0 6px 20px rgba(23, 20, 15, 0.05);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #11100e; --surface: #1b1a17; --surface-2: #26241f; --ink: #f3f0ea; --ink-2: #c9c3b8; --muted: #8f897e;
    --line: #2e2c27; --border: rgba(255, 255, 255, 0.08); --accent: #f27a2a; --accent-ink: #f8a467; --accent-soft: rgba(242, 122, 42, 0.16);
    --good-ink: #3ccb7f; --good-soft: rgba(60, 203, 127, 0.14); --critical-ink: #ef7676; --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11100e; --surface: #1b1a17; --surface-2: #26241f; --ink: #f3f0ea; --ink-2: #c9c3b8; --muted: #8f897e;
  --line: #2e2c27; --border: rgba(255, 255, 255, 0.08); --accent: #f27a2a; --accent-ink: #f8a467; --accent-soft: rgba(242, 122, 42, 0.16);
  --good-ink: #3ccb7f; --good-soft: rgba(60, 203, 127, 0.14); --critical-ink: #ef7676; --shadow: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 Manrope, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 16px; font-weight: 800; }
h3 { font-size: 14px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.neg { color: var(--critical-ink); }
.pos { color: var(--good-ink); }
[hidden] { display: none !important; }

/* ── Estructura: una columna centrada, como una app ── */
#app { max-width: 560px; margin: 0 auto; padding: 18px 16px calc(110px + env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.top p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.sec { margin-top: 22px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.sec-head a { font-size: 13px; font-weight: 700; color: var(--accent-ink); text-decoration: none; }

/* ── Tarjetas ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
a.card { display: block; text-decoration: none; color: inherit; }
.card + .card { margin-top: 12px; }
.label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.big { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.sub { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

/* Tarjeta principal (en naranja) */
.hero { background: var(--accent); color: var(--on-accent); border: 0; }
.hero .label, .hero .sub { color: rgba(255, 255, 255, .85); }
.hero .big { font-size: 38px; }
.hero .barra { background: rgba(255, 255, 255, .25); }
.hero .barra span { background: #fff; }
.chip-est { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, .22); vertical-align: 3px; margin-left: 6px; text-transform: none; letter-spacing: 0; }
.card:not(.hero) .chip-est { background: var(--surface-2); color: var(--ink-2); }
.hero-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .25); }
.hero-fila b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.hero-fila span { font-size: 12px; opacity: .85; }

/* Grilla de datos chicos */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; }
.tile b { display: block; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile small { color: var(--muted); font-size: 12px; }

/* Barras de progreso */
.barra { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.barra span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.barra.ok span { background: var(--good); }

/* Hoy */
a.card.hoy, .hoy { display: flex; align-items: center; gap: 14px; }
.hoy .ico { font-size: 26px; width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); display: grid; place-items: center; flex: none; }
.hoy > div:nth-child(2) { flex: 1; min-width: 0; }
.hoy b { font-size: 16px; }

/* ── Botones ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 800; font-size: 15px; padding: 12px 18px; border-radius: 14px; border: 0; background: var(--accent); color: var(--on-accent); text-decoration: none; cursor: pointer; }
.btn:disabled { opacity: .6; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: transparent; color: var(--critical-ink); border: 1px solid var(--line); }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 11px; }
.btn.block { width: 100%; }
.icon-btn { background: none; border: 0; color: var(--ink-2); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 8px; border-radius: 10px; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: .3; cursor: default; }

/* Segmentos y chips */
.seg { display: flex; background: var(--surface-2); border-radius: 13px; padding: 3px; gap: 2px; }
.seg button { flex: 1; font: inherit; font-weight: 700; font-size: 14px; border: 0; background: none; color: var(--muted); padding: 8px 6px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; font: inherit; font-size: 13px; font-weight: 700; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); padding: 7px 12px; border-radius: 99px; cursor: pointer; text-decoration: none; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Filtro de tiempo (uno solo para toda la app) */
.filtro { margin-bottom: 14px; }
.periodo { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-weight: 800; }
.periodo span { font-size: 15px; }

/* ── Listas de movimientos ── */
.dia-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 18px 4px 6px; }
.lista { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.mov { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.mov:last-child { border-bottom: 0; }
.mov:active { background: var(--surface-2); }
.mov .ico { font-size: 18px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface-2); }
.mov .ico.dia { background: var(--accent-soft); }
.mov .ico.pago { background: var(--good-soft); }
.mov .txt { flex: 1; min-width: 0; }
.mov .t { font-weight: 700; }
.mov .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mov .m { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.totales { font-size: 14px; color: var(--ink-2); margin: 0 4px 4px; }
.totales b { color: var(--ink); }
.vacia { text-align: center; padding: 30px 16px; color: var(--muted); }
.vacia p { margin: 0 0 14px; }

/* ── Gráfico de barras ── */
.graf { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 18px; }
.graf .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.graf .bar { width: 100%; max-width: 38px; border-radius: 8px 8px 4px 4px; background: color-mix(in srgb, var(--accent) 35%, transparent); position: relative; min-height: 3px; }
.graf .col.on .bar { background: var(--accent); }
.graf .bar.neg { background: color-mix(in srgb, var(--critical) 45%, transparent); }
.graf .v { font-size: 10.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.graf .col.on .v { color: var(--ink); }
.graf .x { font-size: 11px; color: var(--muted); font-weight: 700; white-space: nowrap; }

/* Reparto de gastos */
.reparto-gastos { display: flex; height: 12px; border-radius: 99px; overflow: hidden; margin: 10px 0 8px; background: var(--surface-2); }
.reparto-gastos span:nth-child(1) { background: var(--accent); }
.reparto-gastos span:nth-child(2) { background: #6a5acd; }
.leyenda { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ── Mili en las pantallas ── */
.mili-cara { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; border: 3px solid var(--muted); background: var(--surface-2); }
.mili-cara.lg { width: 72px; height: 72px; border-width: 4px; }
.mili-cara.verde { border-color: var(--good); }
.mili-cara.amarillo { border-color: var(--warning); }
.mili-cara.rojo { border-color: var(--critical); }
a.card.insight, .insight { display: flex; gap: 12px; align-items: center; }
.insight .who { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-ink); }
.insight p { margin: 2px 0 0; font-size: 14.5px; }
.estado { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.estado i { font-style: normal; font-size: 9px; }
.estado.verde i { color: var(--good); }
.estado.amarillo i { color: var(--warning); }
.estado.rojo { color: var(--critical-ink); }
.estado.rojo i { color: var(--critical); }
.salud-lista { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.salud-lista li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.salud-lista li .estado { flex: none; margin-top: 1px; }

/* ── Formularios ── */
form.card { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > label, .field > .label-txt { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface-2); border: 1px solid transparent; border-radius: 12px; padding: 12px 14px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
input[type="file"] { padding: 10px; font-size: 14px; }
.monto-grande { font-size: 30px; font-weight: 800; padding: 14px 16px; text-align: center; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.acciones-form { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.acciones-form .btn:last-child { flex: 1; }

/* Contador con − y + (para cargar paquetes con una mano) */
.contador { display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; align-items: center; }
.contador button { height: 52px; border-radius: 14px; border: 0; background: var(--surface-2); color: var(--ink); font-size: 24px; font-weight: 700; cursor: pointer; }
.contador button:active { background: var(--accent-soft); }
.contador input { text-align: center; font-size: 26px; font-weight: 800; padding: 9px; }
.rapidos { display: flex; gap: 6px; flex-wrap: wrap; }

/* Repuestos */
.rep-fila { display: grid; grid-template-columns: 1fr 110px 36px; gap: 8px; margin-bottom: 8px; }
.total-auto { font-size: 18px; font-weight: 800; text-align: right; }

/* ── Barra de abajo con el "+" ── */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.tabbar nav { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; height: 66px; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700; }
.tabbar a .i { font-size: 20px; line-height: 1; filter: grayscale(1); opacity: .75; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on .i { filter: none; opacity: 1; }
.fab { justify-self: center; width: 58px; height: 58px; border-radius: 20px; border: 0; background: var(--accent); color: #fff; font-size: 32px; font-weight: 400; line-height: 1; cursor: pointer; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-10px); }
.fab:active { transform: translateY(-8px) scale(.96); }

/* Hoja que sube desde abajo (elegir qué cargar) */
.sheet-fondo { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .4); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { width: 100%; max-width: 560px; background: var(--surface); border-radius: 24px 24px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); animation: subir .25s cubic-bezier(.2, .9, .3, 1); }
.sheet .asa { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { margin: 0 4px 12px; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-grid a { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 18px; background: var(--surface-2); text-decoration: none; color: var(--ink); font-weight: 800; }
.sheet-grid a span { font-size: 28px; }
.sheet-grid a small { color: var(--muted); font-weight: 600; font-size: 12px; }
@keyframes subir { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ── Avisos ── */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.banner { background: var(--accent-soft); border-radius: 14px; padding: 10px 14px; font-size: 13px; display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* Visor de comprobantes */
.visor { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 16px; }
.visor-caja { background: var(--surface); border-radius: 18px; padding: 16px; max-width: 520px; width: 100%; max-height: 90vh; overflow: auto; text-align: center; }
.visor-caja img { max-width: 100%; border-radius: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Ingreso */
.login { min-height: 80vh; display: grid; place-items: center; }
.login .card { width: 100%; max-width: 380px; display: grid; gap: 14px; }
.marca { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.marca span:first-child { width: 38px; height: 38px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; }

/* Ajustes */
.opciones { padding: 0; }
.opcion { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; font: inherit; text-align: left; cursor: pointer; }
.opcion:last-child { border-bottom: 0; }
.opcion small { display: block; color: var(--muted); font-size: 12.5px; }
.opcion .flecha { color: var(--muted); }

/* En la compu: la columna queda centrada y la barra también */
@media (min-width: 900px) {
  #app { padding-top: 32px; }
}

/* ───────────────────────── Versión web (compu) ─────────────────────────
   Misma app, otro armado: menú al costado, contenido más ancho y en dos columnas.
   En el celu el menú del costado no existe y se usa la barra de abajo. */
.side { display: none; }
.dash .col > .card:first-child, .dash .col > .sec:first-child { margin-top: 0 !important; }
.dash .col + .col { margin-top: 12px; }

@media (min-width: 1024px) {
  .tabbar { display: none !important; }
  .side {
    display: flex; flex-direction: column; gap: 18px; position: fixed; inset: 0 auto 0 0; width: 248px; padding: 24px 16px;
    background: var(--surface); border-right: 1px solid var(--border); z-index: 20;
  }
  .side .marca { text-decoration: none; color: inherit; padding: 0 6px; }
  .side .marca small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
  .side nav { display: grid; gap: 2px; }
  .side nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; text-decoration: none; color: var(--ink-2); font-weight: 700; }
  .side nav a:hover { background: var(--surface-2); }
  .side nav a.on { background: var(--accent-soft); color: var(--accent-ink); }
  .side nav a .i { font-size: 18px; width: 22px; text-align: center; }
  .side-foot { padding: 0 6px; }
  .side-salir { margin: auto 6px 8px; }

  #app { max-width: 1120px; margin: 0 0 0 248px; padding: 36px 48px 60px; }
  .side[hidden] ~ #app { margin: 0 auto; }
  h1 { font-size: 28px; }

  /* Dos columnas en Inicio y Números */
  .dash { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 20px; align-items: start; }
  .dash .col + .col { margin-top: 0; }
  .dash .sec { margin-top: 0; }
  .dash .col > * + * { margin-top: 16px; }
  .tiles { grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 14px 0 22px; }
  .hero .big { font-size: 46px; }

  /* El filtro de tiempo en una sola fila */
  .filtro { display: flex; align-items: center; gap: 20px; }
  .filtro .seg { width: 420px; flex: none; }
  .periodo { margin-top: 0; flex: 1; justify-content: flex-start; gap: 8px; }

  /* Movimientos y formularios: ancho cómodo para leer */
  .totales, .dia-head, .lista, .chips, .vacia { max-width: 820px; }
  form.card { max-width: 640px; }
  .back { display: none; }

  /* La hoja del "+" pasa a ser una ventanita al centro */
  .sheet-fondo { align-items: center; }
  .sheet { border-radius: 24px; padding: 22px 22px 24px; max-width: 640px; }
  .sheet .asa { display: none; }
  .sheet-grid { grid-template-columns: repeat(4, 1fr); }
  .toast { bottom: 32px; }
}

/* El cartel "Powered by Netlify" tapaba la barra de abajo */
#nl-badge-frame { display: none !important; }

/* Pantalla del PIN */
.pin-caja { width: 100%; max-width: 320px; margin: 0 auto; text-align: center; display: grid; gap: 18px; justify-items: center; }
.pin-caja .marca { font-size: 22px; }
.pin-caja p { margin: 0; min-height: 1.4em; }
.pin-puntos { display: flex; gap: 14px; }
.pin-puntos i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); transition: .15s; }
.pin-puntos i.on { background: var(--accent); border-color: var(--accent); transform: scale(1.1); }
.pin-teclado { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px; margin-top: 6px; }
.pin-teclado button { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 28px; font-weight: 700; cursor: pointer; }
.pin-teclado button:active { background: var(--accent-soft); transform: scale(.95); }
.pin-caja.mal .pin-puntos { animation: pin-mal .4s; }
@keyframes pin-mal { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

/* Control de la quincena */
.control-fila { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.control-fila:last-child { border-bottom: 0; }
.control-fila b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.control-fila.total { font-weight: 800; }

.opcion b { white-space: nowrap; flex: none; }

/* Nafta por marca */
.tabla-wrap { overflow-x: auto; margin: 8px 0; }
.tabla-nafta { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tabla-nafta th, .tabla-nafta td { padding: 7px 5px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tabla-nafta thead th { color: var(--ink); font-weight: 800; }
.tabla-nafta tbody th { text-align: left; color: var(--ink-2); font-weight: 600; }
.tres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tres input { padding: 10px; }

/* Mapa de zonas */
.mapa-card { margin-top: 12px; padding: 12px; }
.mapa { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-auto-rows: minmax(42px, auto); gap: 3px; }
.zona { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; padding: 2px 1px; border: 0; border-radius: 7px; background: var(--surface-2); color: var(--muted); font: inherit; font-size: 8px; font-weight: 700; line-height: 1.05; text-align: center; cursor: pointer; overflow-wrap: anywhere; }
.zona b { font-size: 12px; font-weight: 800; }
.zona.prov { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent); }
.zona.real { background: var(--good-soft); color: var(--good-ink); box-shadow: inset 0 0 0 1px var(--good); }
.ley { background: var(--surface-2); }
.ley.prov { background: var(--accent); }
.ley.real { background: var(--good); }
.mov-zona { width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; font: inherit; text-align: left; cursor: pointer; }
.mov-zona .s { white-space: normal; }
.form-zona { display: grid; gap: 14px; }
@media (min-width: 1024px) {
  .mapa-card { max-width: 720px; }
  .mapa { grid-auto-rows: 62px; gap: 5px; }
  .zona { font-size: 11px; }
  .zona b { font-size: 15px; }
}

/* Mapa real: recorrido del día */
.mapa-tabs { margin-top: 10px; }
.mapa-dias { margin-top: 10px; }
.mapa-real { position: relative; z-index: 0; height: 360px; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.mapa-error { padding: 24px; text-align: center; }
.pin { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; box-sizing: border-box; border-radius: 50%; border: 2px solid #fff; color: #fff; font: 800 12px Manrope, sans-serif; box-shadow: 0 1px 5px rgba(0, 0, 0, .4); }
.pin.ok, .ley-pin.ok { background: #1a9d55; }
.pin.mix, .ley-pin.mix { background: #e2620c; }
.pin.mal, .ley-pin.mal { background: #d23c3c; }
.leyenda i.ley-pin { border-radius: 50%; }
.km-card { margin-top: 12px; }
.km-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 700; }
.km-head b { font-size: 24px; font-variant-numeric: tabular-nums; }
.km-barra { display: flex; height: 10px; margin-top: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.km-barra i { display: block; height: 100%; }
.km-barra .iv { background: var(--muted); }
.km-barra .pa { background: var(--good); }
.km-barra .pe { background: var(--critical); }
.pin.base { background: #17140f; font-size: 14px; }
.km-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.km-dos.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.km-dos span, .km-dos small { display: block; font-size: 12px; color: var(--muted); }
.km-dos b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.ic.parada { display: flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; font-size: 13px; }
:root[data-theme="dark"] .leaflet-tile { filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile { filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.9); } }
@media (min-width: 1024px) { .mapa-real { height: 480px; } }

.pin.chico { width: 24px; height: 24px; font-size: 10px; border-width: 1.5px; }
.pin.aprox { border-style: dashed; }
.paradas-dia { margin-top: 12px; }
.paradas-dia summary { font-weight: 700; cursor: pointer; }
.paradas-dia .lista { margin-top: 10px; }

/* Real vs aproximado */
.dato { display: inline-block; font-style: normal; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; margin-left: 4px; vertical-align: 1px; }
.dato.real { background: var(--good-soft); color: var(--good-ink); }
.dato.aprox { background: var(--accent-soft); color: var(--accent-ink); }
.rango { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--muted); }

/* Tablero */
.opcion-tablero { margin-top: 12px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.tabla-kpi th, .tabla-kpi td { white-space: nowrap; font-size: 12px; }

/* ── Diseño por secciones ── */
:root:not([data-theme="dark"]) { --bg: #f2f3f5; --surface: #fff; --surface-2: #eceef1; --ink: #2f3340; --ink-2: #515769; --muted: #717686; --line: #dfe1e5; --border: #dfe1e5; --shadow: none; --radius: 14px; }
body { font-family: Montserrat, system-ui, sans-serif; }
.card, .tile, .lista { box-shadow: none; }
h1 { font-size: 23px; } h2 { font-size: 15px; font-weight: 800; }
.svg { width: 21px; height: 21px; display: block; }
.tabbar a .i, .side .i { filter: none; opacity: 1; display: inline-flex; }
.tabbar a.on { color: var(--accent-ink); }
.sec-tabs { position: sticky; top: 0; z-index: 12; display: flex; gap: 2px; margin: 12px -16px 0; padding: 0 12px; overflow-x: auto; background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.sec-tabs::-webkit-scrollbar { display: none; }
.sec-tabs a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 12px 10px; color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; border-bottom: 3px solid transparent; }
.sec-tabs a .svg { width: 16px; height: 16px; }
.sec-tabs a.on { color: var(--accent-ink); border-bottom-color: var(--accent); }
.sec-body { padding-top: 14px; }
.sec-body > .sec:first-child { margin-top: 0; }
.cat { margin-top: 18px; }
.dash .col > .cat:first-child { margin-top: 0; }
.cat h2 { margin-bottom: 9px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cat-grid a { display: flex; flex-direction: column; align-items: center; gap: 7px; min-height: 88px; padding: 11px 3px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--ink); font-size: 10.5px; font-weight: 700; line-height: 1.15; text-align: center; text-decoration: none; }
.cat-grid span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); }
.hoy .ico { color: var(--accent-ink); display: grid; place-items: center; }
.clave { text-decoration: none; color: inherit; align-items: center; }
.clave .t { white-space: normal; }
.ic.parada .svg { width: 16px; height: 16px; }
.nav-t { margin: 14px 12px 4px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.opcion-tablero { border: 1px solid var(--border); box-shadow: none; }
@media (min-width: 1024px) { .sec-tabs { margin-left: 0; margin-right: 0; padding: 0; } .cat-grid a { font-size: 12px; } .side nav a { padding-top: 7px; padding-bottom: 7px; } }

.km-compara { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--accent-soft); }
.km-compara b, .km-compara span { display: block; }
.km-compara span { margin-top: 3px; color: var(--ink-2); font-size: 13px; }

/* Inicio */
.inicio-kpis .tile { display: block; color: inherit; text-decoration: none; }
.inicio-kpis .tile b { margin: 2px 0; font-size: 19px; }
.inicio-kpis small { display: block; }
.dash .col > .insight:first-child { margin-top: 0; }
.dash .col > .insight + .cat { margin-top: 18px; }
@media (max-width: 1023px) { .dash .col + .col { margin-top: 12px; } }

/* Ingreso vs. costo: categorías que se abren */
.abrir-lista { display: grid; gap: 10px; }
.abrir { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.abrir summary { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 14px; cursor: pointer; list-style: none; }
.abrir summary::-webkit-details-marker { display: none; }
.abrir-ic { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.abrir-ic svg { width: 19px; height: 19px; }
.abrir-t { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; }
.abrir summary b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.abrir-flecha { color: var(--muted); font-size: 20px; line-height: 1; transition: transform .15s; }
.abrir[open] .abrir-flecha { transform: rotate(90deg); }
.abrir-cuerpo { padding: 2px 14px 10px; border-top: 1px solid var(--line); }
.abrir-ganancia { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 16px; background: var(--accent-soft); font-weight: 800; }
.abrir-ganancia small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 500; }
.abrir-ganancia b { font-size: 19px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.abrir-texto { margin: 10px 0 4px; font-size: 14px; line-height: 1.45; }
.abrir-link { display: inline-block; padding: 6px 0; color: var(--accent); font-size: 14px; font-weight: 700; text-decoration: none; }
.abrir .abrir-cuerpo .control-fila:last-child { border-bottom: 0; }

/* Inicio: lo que saca por día */
.pordia { display: block; margin-top: 12px; color: inherit; text-decoration: none; }
.pordia-big { margin: 2px 0; color: var(--accent); font-size: 34px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pordia-lista { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.pordia-fila { display: grid; grid-template-columns: 56px 1fr 82px; align-items: center; gap: 8px; font-size: 14px; }
.pordia-fila i { display: block; height: 8px; overflow: hidden; border-radius: 99px; background: var(--line); }
.pordia-fila u { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.pordia-fila u.neg { background: var(--critical); }
.pordia-fila b { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Perfiles */
.panel-kpis { margin-top: 12px; }
.panel-kpis .tile { display: block; color: inherit; text-decoration: none; }
.panel-kpis .tile b { margin: 2px 0; font-size: 18px; }
.panel-kpis small { display: block; }
@media (min-width: 1024px) { .panel-kpis { grid-template-columns: repeat(3, 1fr); } }
.panel-auto { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: inherit; text-decoration: none; font-weight: 700; }
.panel-auto small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 500; }
.panel-auto b { font-size: 17px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.perfil-simple .sec { margin-top: 18px; }

/* Recorrido */
.dia-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); text-align: center; }
.dia-nav b { display: block; font-size: 16px; }
.dia-nav small { color: var(--muted); font-size: 12px; }
.reco-resumen { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 12px; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.reco-resumen div { min-width: 0; padding: 12px 4px; text-align: center; border-right: 1px solid var(--line); }
.reco-resumen div:last-child { border-right: 0; }
.reco-resumen b { display: block; font-size: 17px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.reco-resumen span { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.2; }
.ruta { position: relative; display: grid; gap: 0; margin: 0; padding: 4px 14px; overflow: hidden; list-style: none; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.ruta li { position: relative; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 7px 0; }
.ruta li + li { border-top: 1px solid var(--line); }
.ruta li > i { z-index: 1; display: grid; flex: none; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 12px; font-style: normal; font-weight: 800; background: #1a9d55; }
.ruta li.mix > i { background: #e2620c; }
.ruta li.mal > i { background: #d23c3c; }
.ruta li.base > i { background: var(--accent-soft); font-size: 14px; }
.ruta li > div { flex: 1; min-width: 0; }
.ruta li b { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.ruta li small { color: var(--muted); font-size: 12px; }
.ruta li > span { flex: none; color: #15803f; font-size: 11.5px; font-weight: 700; }
.ruta li.mix > span { color: #c2540a; }
.ruta li.mal > span { color: var(--critical-ink); }
.pordia-ver { display: block; margin-top: 12px; color: var(--accent); font-size: 14px; font-weight: 700; }
@media (min-width: 1024px) { .reco-dash { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 18px; align-items: start; } .reco-dash > .sec { margin-top: 0; } .mapa-real { height: 460px; } }

.prox-cobro { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.prox-cobro span { color: var(--muted); font-size: 12px; }
.prox-cobro b { grid-column: 1; font-size: 15px; }
.prox-cobro small { grid-column: 2; grid-row: 1 / span 2; max-width: 130px; color: var(--muted); font-size: 12px; text-align: right; }
.ruta-filtro { margin-bottom: 10px; }
.ruta.solo-no li.ok, .ruta.solo-no li.base { display: none; }
.ruta.solo-no li + li { border-top: 0; }

.panel-gestion { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; color: inherit; text-decoration: none; font-weight: 700; }
.panel-gestion small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 500; }
.panel-gestion b { color: var(--accent); font-size: 17px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.ruta li.aprox > i { outline: 2px dashed currentColor; outline-offset: 1px; color: #fff; }
.ruta li.aprox.ok > i { outline-color: #1a9d55; }
.ruta li.aprox.mix > i { outline-color: #e2620c; }
.ruta li.aprox.mal > i { outline-color: #d23c3c; }

.ruta li { min-height: 46px; padding: 5px 0; }

.btn-perfil { flex: none; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.btn-perfil:hover { border-color: var(--accent); color: var(--accent); }
