/* ==========================================================================
   Registro Vehicular — estilos
   Mobile first. Tema claro (diurno) y oscuro (nocturno).
   ========================================================================== */

:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --text: #13202d;
  --muted: #5d6a79;
  --line: #e2e7ee;
  --primary: #0e2a47;
  --primary-ink: #ffffff;
  --brand: #1d5a92;
  --brand-soft: #e7f0f9;
  --ok: #0f7a55;
  --ok-soft: #e3f4ec;
  --warn: #b86a00;
  --warn-soft: #fff3df;
  --danger: #b83227;
  --danger-soft: #fdecea;
  --focus: #2f7de1;
  --shadow: 0 1px 2px rgba(16, 32, 48, 0.06), 0 6px 20px rgba(16, 32, 48, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 64px;
  --nav-h: 72px;
  color-scheme: light;
}

[data-tema='oscuro'] {
  --bg: #0a111d;
  --surface: #121b2b;
  --surface-2: #172234;
  --text: #e9eef6;
  --muted: #95a3b8;
  --line: #233148;
  --primary: #2f6fd6;
  --primary-ink: #ffffff;
  --brand: #7db3ff;
  --brand-soft: #16263f;
  --ok: #3ccf91;
  --ok-soft: #10301f;
  --warn: #ffb547;
  --warn-soft: #33260f;
  --danger: #ff6b5e;
  --danger-soft: #3a1714;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.icono { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: -0.25em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.peq { font-size: 0.875rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.75rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, filter 0.15s ease, background 0.15s ease;
  user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primario { background: var(--primary); color: var(--primary-ink); }
.btn-exito { background: var(--ok); color: #fff; }
[data-tema='oscuro'] .btn-exito { color: #04130c; }
.btn-peligro { background: var(--danger-soft); color: var(--danger); }
.btn-borde { background: transparent; border-color: var(--line); }
.btn-link {
  background: none; border: 0; min-height: 44px; padding: 0.5rem; color: var(--brand);
  font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.btn-bloque { width: 100%; }
.btn-grande { min-height: 60px; font-size: 1.1rem; border-radius: 16px; }
.btn-icono {
  width: 48px; height: 48px; min-height: 48px; padding: 0; border-radius: 14px;
  background: transparent; border: 1px solid var(--line);
}
.btn-chico { min-height: 40px; padding: 0.4rem 0.85rem; font-size: 0.9rem; border-radius: 10px; }

/* ---------- Formularios ---------- */
.campo { display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.campo > label, .etiqueta { font-weight: 600; font-size: 0.95rem; }
.campo .req { color: var(--danger); }
.ayuda { font-size: 0.85rem; color: var(--muted); }
.input {
  width: 100%;
  min-height: 54px;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 1.05rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.input-patente { text-transform: uppercase; font-weight: 700; letter-spacing: 0.08em; font-size: 1.3rem; }
.input-patente::placeholder { text-transform: none; letter-spacing: 0.04em; font-weight: 500; font-size: 1.05rem; }
textarea.input { min-height: 80px; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.5rem; }
.error-form {
  background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm);
  padding: 0.75rem 1rem; font-weight: 600; margin-bottom: 1rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  min-height: 44px; padding: 0.4rem 0.85rem;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--surface); cursor: pointer; font-weight: 600; font-size: 0.95rem;
}
.chip[aria-pressed='true'] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.punto-color {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 1px solid rgba(0, 0, 0, 0.25); background: #ccc;
}

/* ---------- Estructura ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 0.75rem;
  min-height: 64px;
  padding: 0.6rem max(1rem, env(safe-area-inset-left)) 0.6rem max(1rem, env(safe-area-inset-right));
  padding-top: max(0.6rem, env(safe-area-inset-top));
  background: var(--primary);
  color: #fff;
}
[data-tema='oscuro'] .app-header { background: #0d1626; border-bottom: 1px solid var(--line); }
.app-header .logo { width: 40px; height: 40px; border-radius: 11px; background: #f7f7f7; flex: none; }
.app-header .titulo { flex: 1; min-width: 0; }
.app-header h1 { font-size: 1.05rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header .sub { font-size: 0.82rem; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header .btn-icono { color: #fff; border-color: rgba(255, 255, 255, 0.25); }

.contenedor { width: 100%; max-width: 720px; margin: 0 auto; padding: 1rem; }
.contenedor-ancho { max-width: 1180px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem;
}
.card + .card { margin-top: 1rem; }
.card h2 { font-size: 1.15rem; margin-bottom: 0.75rem; }
.fila { display: flex; align-items: center; gap: 0.75rem; }
.fila-entre { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.envolver { flex-wrap: wrap; }
.pila { display: grid; gap: 0.75rem; }
.separador { height: 1px; background: var(--line); margin: 1rem 0; border: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
  background: var(--brand-soft); color: var(--brand);
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-neutro { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.app-header .badge { background: rgba(255, 255, 255, 0.15); color: #fff; }

/* ---------- Avisos ---------- */
.aviso-conexion {
  position: sticky; top: var(--header-h); z-index: 19;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.5rem 1rem; font-size: 0.9rem; font-weight: 600;
  background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--line);
}

.toasts {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 100;
  display: grid; gap: 0.5rem; width: min(92vw, 440px); pointer-events: none;
}
.toast {
  padding: 0.85rem 1.1rem; border-radius: 14px; font-weight: 600;
  background: #13202d; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: entrar 0.25s ease;
}
.toast-ok { background: #0f7a55; }
.toast-error { background: #b83227; }
@keyframes entrar { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Modal (dialog) ---------- */
dialog.modal {
  width: min(100%, 520px);
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
}
dialog.modal::backdrop { background: rgba(8, 15, 26, 0.55); }
dialog.modal[open] { animation: subir 0.22s ease; }
@keyframes subir { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.modal-cuerpo { padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom)); overflow-y: auto; max-height: 92dvh; }
.modal-titulo { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.modal-titulo h2 { font-size: 1.25rem; }
.modal-acciones { display: grid; gap: 0.6rem; margin-top: 1.25rem; }
@media (min-width: 640px) {
  dialog.modal { margin: auto; border-radius: 24px; }
}

/* ---------- Inicio ---------- */
.inicio { min-height: 100dvh; background: linear-gradient(180deg, #0e2a47 0, #0e2a47 260px, var(--bg) 260px); }
.inicio .contenedor { max-width: 480px; padding-top: max(2rem, env(safe-area-inset-top)); padding-bottom: 2rem; }
.marca { text-align: center; color: #fff; margin-bottom: 1.5rem; }
.marca img { width: 76px; height: 76px; margin: 0 auto 0.85rem; border-radius: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
.marca h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.01em; }
.marca p { opacity: 0.8; margin-top: 0.25rem; }

.pantalla h2 { font-size: 1.3rem; margin-bottom: 0.35rem; }
.pantalla .bajada { color: var(--muted); margin-bottom: 1.1rem; }
.volver { display: inline-flex; align-items: center; gap: 0.35rem; margin: -0.25rem 0 0.75rem -0.5rem; }

.opciones { display: grid; gap: 0.85rem; }
.opcion {
  display: flex; align-items: center; gap: 1rem; width: 100%;
  min-height: 88px; padding: 1rem 1.1rem;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-align: left; cursor: pointer;
  transition: border-color 0.15s ease, transform 0.08s ease;
}
.opcion:hover { border-color: var(--brand); }
.opcion:active { transform: scale(0.99); }
.opcion .ico {
  display: grid; place-items: center; width: 56px; height: 56px; flex: none;
  border-radius: 16px; background: var(--brand-soft); color: var(--brand);
}
.opcion .ico svg { width: 30px; height: 30px; }
.opcion strong { display: block; font-size: 1.15rem; }
.opcion small { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 0.1rem; }
.opcion .flecha { margin-left: auto; color: var(--muted); }
.opcion-diurno .ico { background: #fff3d6; color: #c47a00; }
.opcion-nocturno .ico { background: #e4e8f7; color: #3b4a9c; }

.instalar {
  display: flex; align-items: center; gap: 0.85rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.9rem 1rem; box-shadow: var(--shadow); margin-bottom: 1rem;
}
.instalar img { width: 48px; height: 48px; border-radius: 12px; }
.instalar .texto { flex: 1; min-width: 0; }
.instalar strong { display: block; }
.instalar span { font-size: 0.88rem; color: var(--muted); }
.instalar-ios ol { margin: 0.5rem 0 0; padding-left: 1.2rem; color: var(--muted); font-size: 0.92rem; }
.instalar-ios li { margin: 0.2rem 0; }
.nota-ios { display: block; margin-top: 0.5rem; padding: 0.5rem 0.65rem; border-radius: 10px; background: var(--brand-soft); color: var(--text) !important; font-size: 0.85rem !important; }
.compartir-ico { display: inline-block; vertical-align: -3px; width: 18px; height: 18px; }

.pie { text-align: center; color: var(--muted); font-size: 0.82rem; margin-top: 1.5rem; }

/* ---------- Cobrador ---------- */
.app-cobrador { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 92px); }

.calle-hoy {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 1rem 1.1rem; border-radius: var(--radius);
  background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
  margin-bottom: 1rem;
}
.calle-hoy .ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--brand); color: #fff; flex: none; }
[data-tema='oscuro'] .calle-hoy .ico { color: #0a111d; }
.calle-hoy .ico svg { width: 26px; height: 26px; }
.calle-hoy .etq { font-size: 0.82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.calle-hoy .calle { font-size: 1.3rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.calle-hoy.sin-calle { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.calle-hoy.sin-calle .ico { background: var(--warn); }
.calle-hoy.sin-calle .calle { font-size: 1rem; font-weight: 600; }

.resumen-chico { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
.mini {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem; text-align: center;
}
.mini b { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.mini span { font-size: 0.78rem; color: var(--muted); font-weight: 600; }

.barra-lista { display: flex; gap: 0.6rem; margin-bottom: 0.85rem; }
.buscador { position: relative; flex: 1; }
.buscador svg { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }
.buscador .input { padding-left: 2.6rem; min-height: 50px; }

.lista-vehiculos { display: grid; gap: 0.85rem; }

.vehiculo {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 6px solid var(--ok);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1rem 1rem 0.95rem;
}
.vehiculo.por-subir { border-left-color: var(--warn); }
.vehiculo.pendiente { border-style: dashed; border-left-style: solid; }
.vehiculo-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.vehiculo-info { min-width: 0; }
.vehiculo-desc { display: flex; align-items: center; gap: 0.45rem; margin-top: 0.45rem; font-weight: 600; flex-wrap: wrap; }
.vehiculo-desc .sep { color: var(--muted); }
.vehiculo-obs { margin-top: 0.35rem; font-size: 0.92rem; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.vehiculo-crono { text-align: right; flex: none; }
.cronometro { font-size: 1.75rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; line-height: 1.1; }
.ingreso { font-size: 0.85rem; color: var(--muted); margin-top: 0.15rem; }
.vehiculo-pie { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.9rem; }
.vehiculo-pie .btn-exito { flex: 1; font-size: 1.1rem; min-height: 56px; }
.aviso-subida { font-size: 0.85rem; font-weight: 600; color: var(--warn); margin-top: 0.6rem; display: flex; align-items: center; gap: 0.35rem; }
.aviso-subida.tranquilo { color: var(--muted); font-weight: 500; }

.patente {
  display: inline-flex; flex-direction: column; overflow: hidden;
  border: 2px solid #1a1a1a; border-radius: 7px; background: #fff; color: #111;
  font-family: 'DIN Alternate', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  font-weight: 800; letter-spacing: 0.08em; line-height: 1;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}
.patente::before { content: ''; display: block; height: 6px; background: #1f4fa0; }
.patente span { padding: 0.3rem 0.55rem 0.35rem; font-size: 1.35rem; }
.patente.chica span { font-size: 1rem; padding: 0.2rem 0.4rem 0.25rem; }
.patente.chica::before { height: 4px; }

.vacio { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.vacio svg { width: 56px; height: 56px; margin: 0 auto 0.75rem; opacity: 0.5; }
.vacio strong { display: block; color: var(--text); font-size: 1.1rem; margin-bottom: 0.25rem; }

.fab {
  position: fixed; right: max(1rem, env(safe-area-inset-right));
  bottom: calc(var(--nav-h) + 1rem + env(safe-area-inset-bottom)); z-index: 15;
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 60px; padding: 0 1.4rem 0 1.1rem; border: 0; border-radius: 999px;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 10px 28px rgba(14, 42, 71, 0.35); cursor: pointer;
}
.fab svg { width: 26px; height: 26px; }

.nav-inferior {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 18;
  display: grid; grid-template-columns: repeat(2, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.nav-inferior button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
  border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 0.85rem; cursor: pointer; position: relative;
}
.nav-inferior button svg { width: 26px; height: 26px; }
.nav-inferior button[aria-selected='true'] { color: var(--brand); }
.nav-inferior button[aria-selected='true']::before {
  content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand);
}
.contador {
  position: absolute; top: 8px; left: calc(50% + 8px);
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--ok); color: #fff; font-size: 0.75rem; line-height: 22px; text-align: center;
}

.cobrado-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.cobrado-item:last-child { border-bottom: 0; }
.cobrado-item .datos { flex: 1; min-width: 0; }
.cobrado-item .linea2 { font-size: 0.85rem; color: var(--muted); }
.cobrado-item .monto { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.cobrado-item.anulado { opacity: 0.6; }
.cobrado-item.anulado .monto { text-decoration: line-through; }

.total-dia {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem; border-radius: var(--radius); margin-bottom: 1rem;
  background: var(--ok-soft); color: var(--ok);
}
.total-dia b { font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.total-dia span { font-weight: 600; }

/* Detalle del cobro */
.cobro-resumen { text-align: center; padding: 0.5rem 0 0.25rem; }
.cobro-resumen .patente { margin: 0 auto 0.75rem; }
.cobro-monto { font-size: 3rem; font-weight: 800; color: var(--ok); font-variant-numeric: tabular-nums; line-height: 1.1; margin: 0.5rem 0; }
.cobro-detalle { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 1rem; }
.cobro-detalle div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.65rem; }
.cobro-detalle span { display: block; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.cobro-detalle b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }

.menu-lista { display: grid; gap: 0.5rem; }
.menu-lista .btn { justify-content: flex-start; }

/* ---------- Encargado ---------- */
.segmentos {
  position: sticky; top: var(--header-h); z-index: 17;
  display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: none;
  padding: 0.6rem 1rem; background: var(--bg); border-bottom: 1px solid var(--line);
}
.segmentos::-webkit-scrollbar { display: none; }
.segmentos button {
  flex: none; display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 44px; padding: 0.5rem 1rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font-weight: 700; font-size: 0.92rem; cursor: pointer;
}
.segmentos button svg { width: 18px; height: 18px; }
.segmentos button[aria-selected='true'] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.segmentos-centro { max-width: 1180px; margin: 0 auto; display: flex; gap: 0.35rem; width: 100%; }

.barra-jornada {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.barra-jornada h2 { font-size: 1.3rem; }
.barra-jornada .fecha-sel { display: flex; align-items: center; gap: 0.5rem; }
.barra-jornada .input { min-height: 46px; width: auto; padding: 0.5rem 0.75rem; font-size: 1rem; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.kpi span { display: block; font-size: 0.82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi b { display: block; font-size: 1.65rem; font-variant-numeric: tabular-nums; margin-top: 0.2rem; }
.kpi.destacado { background: var(--primary); color: #fff; border-color: transparent; }
.kpi.destacado span { color: rgba(255, 255, 255, 0.75); }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } }

.lista-cobradores { display: grid; gap: 0.75rem; }
.cobrador-fila {
  display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.9rem 1rem; cursor: pointer; text-align: left; width: 100%;
}
.cobrador-fila:hover { border-color: var(--brand); }
.cobrador-fila .nombre { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.cobrador-fila .calle { color: var(--muted); font-size: 0.92rem; display: flex; align-items: center; gap: 0.3rem; }
.cobrador-fila .calle svg { width: 16px; height: 16px; }
.cobrador-fila .plata { text-align: right; font-weight: 800; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.cobrador-fila .stats { grid-column: 1 / -1; display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.35rem; }
.cobrador-fila.inactivo { opacity: 0.6; }

.asignar-fila {
  display: grid; gap: 0.6rem; padding: 0.95rem 0; border-bottom: 1px solid var(--line);
}
.asignar-fila:last-child { border-bottom: 0; }
.asignar-fila .quien { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.asignar-fila .quien strong { font-size: 1.05rem; }
.asignar-fila .controles { display: flex; gap: 0.5rem; }
.asignar-fila .controles .input { min-height: 50px; }
.asignar-fila .controles .btn { flex: none; min-height: 50px; }
.estado-guardado { font-size: 0.82rem; font-weight: 700; color: var(--ok); display: inline-flex; align-items: center; gap: 0.25rem; }
.estado-guardado.sucio { color: var(--warn); }
@media (min-width: 760px) {
  .asignar-fila { grid-template-columns: 260px 1fr; align-items: center; }
}

.acciones-barra { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.acciones-barra .btn { min-height: 46px; font-size: 0.95rem; }

.filtros { display: grid; gap: 0.6rem; grid-template-columns: 1fr 1fr; margin-bottom: 1rem; }
.filtros .input { min-height: 48px; font-size: 1rem; }
.filtros .ancho { grid-column: 1 / -1; }
@media (min-width: 760px) { .filtros { grid-template-columns: 180px 1fr 180px 1fr; } .filtros .ancho { grid-column: auto; } }

.tabla-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.tabla { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.tabla th, .tabla td { padding: 0.7rem 0.85rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabla th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla td.der, .tabla th.der { text-align: right; }
.tabla .fila-anulada td { color: var(--muted); }
.tabla .barra-dia { height: 8px; border-radius: 4px; background: var(--brand); min-width: 2px; }

.feed { display: grid; }
.mov { display: grid; grid-template-columns: auto 1fr auto; gap: 0.75rem; align-items: start; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.mov:last-child { border-bottom: 0; }
.mov .ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); color: var(--muted); }
.mov .ico svg { width: 20px; height: 20px; }
.mov.t-cobro .ico { background: var(--ok-soft); color: var(--ok); }
.mov.t-registro .ico { background: var(--brand-soft); color: var(--brand); }
.mov.t-anulacion .ico, .mov.t-desactivacion .ico { background: var(--danger-soft); color: var(--danger); }
.mov.t-asignacion .ico, .mov.t-tarifa .ico { background: var(--warn-soft); color: var(--warn); }
.mov .txt { font-size: 0.95rem; overflow-wrap: anywhere; }
.mov .txt small { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 0.1rem; }
.mov .hora { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.grilla-curso { display: grid; gap: 0.75rem; }
@media (min-width: 760px) { .grilla-curso { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grilla-curso { grid-template-columns: repeat(3, 1fr); } }
.curso-card { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--ok); border-radius: var(--radius); padding: 0.9rem; }
.curso-card.por-subir { border-left-color: var(--warn); }
.curso-card .cronometro { font-size: 1.4rem; }

.ajuste-fila { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ajuste-fila:last-child { border-bottom: 0; }

.cargando { display: flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 2rem; color: var(--muted); }
.cargando::before {
  content: ''; width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--brand); animation: girar 0.8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

@media (min-width: 900px) {
  body { font-size: 16px; }
  .app-encargado .contenedor { padding: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Deudas y avisos ---------- */
.deuda-caja { margin-top: 1rem; padding: 0.85rem 1rem; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }
.deuda-caja .peq, .deuda-caja li { color: var(--text); }
.ico-avisos { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); flex: none; }
.ico-avisos svg { width: 26px; height: 26px; }
.aviso-deuda {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; margin-bottom: 1rem; padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); border-radius: var(--radius-sm);
  background: var(--danger-soft); color: var(--danger); text-align: left; cursor: pointer; font-size: 0.95rem;
}
.aviso-deuda span { flex: 1; color: var(--text); }
.kpi.kpi-deuda { background: var(--danger); }

/* ---------- Administración ---------- */
.grilla-turnos { display: grid; gap: 0.75rem; margin-bottom: 1rem; }
@media (min-width: 760px) { .grilla-turnos { grid-template-columns: 1fr 1fr; } }
.grilla-turnos .card + .card { margin-top: 0; }
.turno-hoy h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 0.4rem; text-transform: capitalize; }
.barra-doble { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.b-dia { background: #e0a100; }
.b-noche { background: var(--brand); }
.leyenda { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.inactivo-fila { opacity: 0.6; }
.chip input[type='radio'], .chip input[type='checkbox'] { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }
.pie-admin { display: inline-block; margin-top: 0.5rem; color: var(--muted); font-size: 0.82rem; text-decoration: underline; background: none; border: 0; cursor: pointer; padding: 0.5rem; }

.codigo-turno { padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); display: grid; gap: 0.5rem; }
.codigo-turno .codigo { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 1.6rem; font-weight: 800; letter-spacing: 0.12em; color: var(--text); }
.error-form.aviso-info { background: var(--brand-soft); color: var(--brand); }
