/* ============================================================
   A Que Maciel · Abasto & Mini Market
   tema.css — piel del sistema

   La paleta sale del LOGO del negocio, medida del propio PNG:
     rojo    #E4362B   (11.525 px muestreados)
     amarillo#FAC61C   (29.917 px)
     verde   #72B234   (54.671 px)
     marron  #5D1311   (53.982 px)
     teal    #12687C   ( 6.753 px)

   Regla: un solo acento saturado (el verde). El marrón es la tinta
   y la superficie oscura. El rojo se reserva para errores y
   acciones destructivas — no para decorar.
   ============================================================ */

:root {
  /* --- marca --- */
  --rojo:        #E4362B;
  --rojo-osc:    #B8241B;
  --amarillo:    #FAC61C;
  --amarillo-suave: #FFF6DB;
  --verde:       #72B234;
  --verde-osc:   #4A7A1C;
  --verde-suave: #EFF7E4;
  --marron:      #5D1311;
  --marron-2:    #7A2018;
  --teal:        #12687C;
  --teal-suave:  #E4F1F4;

  /* --- superficies --- */
  --fondo:       #FFFCF6;
  --fondo-2:     #FDF6EA;
  --tarjeta:     #FFFFFF;
  --borde:       #F0E4D4;
  --borde-2:     #E3D3BE;

  /* --- texto --- */
  --tinta:       #3A1D15;
  --tinta-2:     #6B5449;
  --gris:        #94837A;

  /* --- estados (fijos, no se derivan de la marca) --- */
  --ok:          #2E7D32;
  --ok-suave:    #E8F5E9;
  --aviso:       #B26A00;
  --aviso-suave: #FFF4E0;
  --error:       #C62828;
  --error-suave: #FDECEA;

  /* --- forma --- */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --sombra-1: 0 2px 10px rgba(93,19,17,.06);
  --sombra-2: 0 4px 18px rgba(93,19,17,.09);
  --sombra-3: 0 10px 30px rgba(93,19,17,.16);
  --alto-barra: 62px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  /* clip y no hidden: hidden crea contenedor de scroll y rompe sticky */
  overflow-x: clip;
}

/* [hidden] pierde contra una clase con display */
[hidden] { display: none !important; }
.oculto  { display: none !important; }

body {
  font-family: -apple-system, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  background: var(--fondo);
  color: var(--tinta);
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- tipografía ---------- */
h1, h2, h3, h4 { margin: 0; color: var(--marron); line-height: 1.25; }
h1 { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
h2 { font-size: 16px; font-weight: 800; }
h3 { font-size: 14px; font-weight: 800; }
.gris { color: var(--gris); }
.chico { font-size: 12.5px; }
.mini { font-size: 11.5px; }
.negrita { font-weight: 700; }
.mono { font-variant-numeric: tabular-nums; }

/* ============================================================
   LAYOUT DEL PANEL
   ============================================================ */
/* ---------- velo del cajón móvil ----------
   Va FUERA del grid .app: si es hijo del grid ocupa la primera
   columna y desplaza el lateral y el contenido una casilla a la
   derecha (la página entera se rompe). position:fixed lo saca del
   flujo, pero el hueco de la columna lo seguía ocupando. */
.velo {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(58, 29, 21, .5);
  z-index: 85;
}
.velo.abierto { display: block; }

.app {
  display: grid;
  grid-template-columns: minmax(0, 232px) minmax(0, 1fr);
  min-height: 100vh;
}
/* La columna del cuerpo necesita min-width:0 o el grid la encoge al
   min-content de la tabla (la cabecera y el contenido quedaban en
   232 px y la tabla desbordaba escondida). */
.app > div { min-width: 0; }

/* ---------- lateral ---------- */
.lateral {
  background: var(--marron);
  color: #F6E7E0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.lateral__marca {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.lateral__marca img { width: 100%; max-width: 168px; height: auto; display: block; }
.lateral__marca p {
  margin: 8px 0 0; font-size: 11px; color: #D9BCB4; letter-spacing: .3px;
}

.menu { padding: 10px 8px; flex: 1; }
.menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: var(--r-md);
  color: #E5CFC8; font-size: 13.5px; font-weight: 600;
  text-decoration: none; margin-bottom: 2px;
  min-height: 44px;               /* área táctil */
  transition: background .12s ease, color .12s ease;
}
.menu a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.menu a.activo {
  background: var(--verde); color: #fff;
  box-shadow: 0 3px 12px rgba(114,178,52,.34);
}
.menu a svg { width: 18px; height: 18px; stroke: currentColor; fill: none;
              stroke-width: 1.9; flex: 0 0 auto; }
.menu__grupo {
  font-size: 10px; text-transform: uppercase; letter-spacing: .8px;
  color: #A9847A; padding: 14px 12px 5px; font-weight: 700;
}
.menu__badge {
  margin-left: auto; background: var(--rojo); color: #fff;
  font-size: 10.5px; font-weight: 800; min-width: 18px; height: 18px;
  border-radius: 999px; display: grid; place-items: center; padding: 0 5px;
}

/* Círculo rojo de pendientes: el número que el mostrador mira de reojo.
   Va en rojo lleno, no en verde, para que no se confunda con el ítem
   activo del menú. */
.menu__contador {
  margin-left: auto;
  background: var(--rojo);
  color: #fff;
  font-size: 11px; font-weight: 800;
  min-width: 20px; height: 20px;
  border-radius: 999px;
  display: grid; place-items: center;
  padding: 0 6px;
  box-shadow: 0 0 0 2px rgba(228,54,43,.25);
  animation: latir-contador 2.6s ease-in-out infinite;
}
.menu__contador--pago { background: #C98A00; box-shadow: 0 0 0 2px rgba(201,138,0,.25); }

@keyframes latir-contador {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

/* el badge de agotados ya usa margin-left:auto; cuando hay dos, el
   segundo no debe empujarse solo */
.menu a .menu__badge + .menu__contador { margin-left: 4px; }

.lateral__pie {
  padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.10);
  font-size: 11.5px; color: #B2938A;
}
.lateral__pie strong { color: #F6E7E0; font-weight: 700; display: block; font-size: 12.5px; }

/* ---------- cabecera ---------- */
.cab {
  background: var(--tarjeta);
  border-bottom: 1px solid var(--borde);
  padding: 12px 20px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 30;
}
.cab__titulo { min-width: 0; }
.cab__titulo h1 { font-size: 17px; }
.cab__titulo p  { margin: 1px 0 0; font-size: 12px; color: var(--gris); }
.cab__acciones { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.cab__hamburguesa { display: none; }

.contenido { padding: 20px; max-width: 1240px; }
@media (min-width: 1500px) { .contenido { max-width: 1400px; } }

/* ============================================================
   COMPONENTES
   ============================================================ */

/* ---------- tarjetas ---------- */
.tarjeta {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--r-lg);
  box-shadow: var(--sombra-1);
  padding: 18px;
}
.tarjeta--plana { box-shadow: none; }

/* ---------- KPI ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--tarjeta); border: 1px solid var(--borde);
  border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sombra-1);
  border-left: 4px solid var(--verde);
}
.kpi--aviso { border-left-color: var(--amarillo); }
.kpi--error { border-left-color: var(--rojo); }
.kpi--teal  { border-left-color: var(--teal); }
.kpi__etiqueta {
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--gris); font-weight: 700; margin-bottom: 5px;
}
.kpi__valor {
  font-size: 26px; font-weight: 800; letter-spacing: -.6px;
  color: var(--marron); line-height: 1.1; font-variant-numeric: tabular-nums;
}
.kpi__pie { font-size: 11.5px; color: var(--gris); margin-top: 4px; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 10px 18px; min-height: 44px;
  font-size: 13.5px; font-weight: 700; font-family: inherit;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .12s ease, box-shadow .12s ease, transform .06s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.1; }

.btn--primario { background: var(--verde); color: #fff; box-shadow: 0 3px 12px rgba(114,178,52,.34); }
.btn--primario:hover { background: var(--verde-osc); text-decoration: none; }

.btn--oscuro { background: var(--marron); color: #fff; }
.btn--oscuro:hover { background: var(--marron-2); text-decoration: none; }

.btn--secundario { background: var(--tarjeta); color: var(--marron); border-color: var(--borde-2); }
.btn--secundario:hover { background: var(--fondo-2); text-decoration: none; }

.btn--peligro { background: var(--rojo); color: #fff; }
.btn--peligro:hover { background: var(--rojo-osc); text-decoration: none; }

.btn--fantasma { background: transparent; color: var(--tinta-2); }
.btn--fantasma:hover { background: var(--fondo-2); text-decoration: none; }

.btn--chico { padding: 7px 13px; min-height: 36px; font-size: 12.5px; }
.btn--bloque { width: 100%; }

/* Acciones dentro de una celda de tabla: envolver en flex o se apilan */
.acciones-fila { display: flex; gap: 8px; align-items: center; }

.btn-icono {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; min-width: 38px;
  border: 1px solid var(--borde-2); border-radius: var(--r-sm);
  background: var(--tarjeta); color: var(--tinta-2);
  cursor: pointer; padding: 0;
  transition: background .12s, color .12s, border-color .12s;
}
.btn-icono svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-icono:hover { background: var(--fondo-2); border-color: var(--verde); color: var(--verde-osc); }
.btn-icono--peligro:hover { border-color: var(--rojo); color: var(--rojo); background: var(--error-suave); }

/* ---------- formularios ---------- */
.campo { margin-bottom: 15px; }
.campo__etiqueta {
  display: block; font-size: 12.5px; font-weight: 700;
  color: var(--tinta-2); margin-bottom: 5px;
}
.campo__etiqueta .req { color: var(--rojo); }
.campo__ayuda { font-size: 11.5px; color: var(--gris); margin-top: 4px; }
.campo__error { font-size: 11.5px; color: var(--error); margin-top: 4px; font-weight: 600; }

.input, .select, .textarea {
  width: 100%; font-family: inherit; font-size: 14.5px;
  padding: 11px 13px; min-height: 44px;
  border: 1px solid var(--borde-2); border-radius: var(--r-md);
  background: var(--tarjeta); color: var(--tinta);
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--verde); box-shadow: 0 0 0 3px rgba(114,178,52,.16);
}
.input::placeholder, .textarea::placeholder { color: #B5A69D; }
.textarea { min-height: 80px; resize: vertical; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B5449' stroke-width='2.2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  background-size: 17px; padding-right: 38px;
}

.fila-doble {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 0 14px;
}

/* grupo de inputs pegados (prefijo + campo) */
.grupo-input { display: flex; align-items: stretch; }
.grupo-input__prefijo {
  display: grid; place-items: center; padding: 0 12px;
  background: var(--fondo-2); border: 1px solid var(--borde-2); border-right: 0;
  border-radius: var(--r-md) 0 0 var(--r-md);
  font-size: 13px; font-weight: 800; color: var(--tinta-2);
}
.grupo-input .input { border-radius: 0 var(--r-md) var(--r-md) 0; }

/* interruptor */
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__pista {
  width: 46px; height: 26px; border-radius: 999px; background: var(--borde-2);
  position: relative; transition: background .16s; flex: 0 0 auto;
}
.switch__pista::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(93,19,17,.3); transition: transform .16s;
}
.switch input:checked + .switch__pista { background: var(--verde); }
.switch input:checked + .switch__pista::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__pista { box-shadow: 0 0 0 3px rgba(114,178,52,.28); }
.switch__texto { font-size: 13.5px; font-weight: 600; color: var(--tinta-2); }

/* ---------- buscador ---------- */
.buscador { position: relative; }
.buscador input { padding-left: 42px; }
.buscador svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; stroke: var(--gris); fill: none; stroke-width: 2;
  pointer-events: none;
}

/* ---------- barras de herramientas ---------- */
.barra-herramientas {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 16px;
}
.barra-herramientas .buscador { flex: 1 1 240px; min-width: 0; }
.barra-herramientas__fin { margin-left: auto; display: flex; gap: 8px; }

/* ---------- tablas ---------- */
.tabla-caja {
  background: var(--tarjeta); border: 1px solid var(--borde);
  border-radius: var(--r-lg); box-shadow: var(--sombra-1); overflow: hidden;
}
table.tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tabla th {
  text-align: left; padding: 12px 14px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--gris); font-weight: 800;
  background: var(--fondo-2); border-bottom: 1px solid var(--borde);
  white-space: nowrap;
}
table.tabla td {
  padding: 12px 14px; border-bottom: 1px solid var(--borde);
  vertical-align: middle;
}
table.tabla tbody tr:last-child td { border-bottom: 0; }
table.tabla tbody tr:hover { background: #FFFDF9; }
table.tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.celda-producto { display: flex; align-items: center; gap: 11px; min-width: 0; }
.celda-producto__foto {
  width: 46px; height: 46px; border-radius: var(--r-sm);
  background: #fff; border: 1px solid var(--borde);
  display: grid; place-items: center;
  font-size: 19px; flex: 0 0 auto; overflow: hidden;
}
/* La foto es cuadrada 900x900 con fondo blanco: contain la muestra
   entera sin recortar el envase, que en bolsas altas se perdería. */
.celda-producto__foto img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.celda-producto__txt { min-width: 0; }
.celda-producto__nom { font-weight: 700; font-size: 13.5px; line-height: 1.3; }
.celda-producto__sub { font-size: 11.5px; color: var(--gris); }

/* ---------- pastillas de estado ---------- */
.pastilla {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800; letter-spacing: .2px;
  padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase; white-space: nowrap;
}
.pastilla::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: 0 0 auto;
}
.pastilla--ok     { background: var(--ok-suave);      color: var(--ok); }
.pastilla--aviso  { background: var(--aviso-suave);   color: var(--aviso); }
.pastilla--error  { background: var(--error-suave);   color: var(--error); }
.pastilla--teal   { background: var(--teal-suave);    color: var(--teal); }
.pastilla--neutro { background: var(--fondo-2);       color: var(--tinta-2); }

/* ---------- avisos ---------- */
.aviso {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 16px; border-radius: var(--r-md);
  font-size: 13.5px; margin-bottom: 16px;
  border: 1px solid transparent;
}
.aviso strong { display: block; font-weight: 800; margin-bottom: 1px; }
.aviso--ok    { background: var(--ok-suave);    border-color: #C8E6C9; color: #1B5E20; }
.aviso--aviso { background: var(--aviso-suave); border-color: #FFE0B2; color: #8C4A00; }
.aviso--error { background: var(--error-suave); border-color: #FFCDD2; color: #B71C1C; }
.aviso--info  { background: var(--teal-suave);  border-color: #C3E0E8; color: #0B4C5C; }
.aviso svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px;
             stroke: currentColor; fill: none; stroke-width: 2; }

/* ---------- estado vacío ---------- */
.vacio {
  text-align: center; padding: 52px 20px; color: var(--gris);
}
.vacio__icono { font-size: 40px; margin-bottom: 10px; opacity: .55; }
.vacio h3 { color: var(--tinta-2); margin-bottom: 5px; }
.vacio p { font-size: 13px; margin: 0 0 16px; }

/* ---------- modales ---------- */
.modal-fondo {
  position: fixed; inset: 0; background: rgba(58,29,21,.52);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 18px; opacity: 0; visibility: hidden;
  transition: opacity .16s, visibility .16s;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.modal-fondo.abierto { opacity: 1; visibility: visible; }

.modal {
  background: var(--tarjeta); border-radius: var(--r-xl);
  box-shadow: var(--sombra-3);
  width: 100%; max-width: 560px; max-height: 92vh;
  display: flex; flex-direction: column;
  transform: translateY(12px) scale(.99);
  transition: transform .16s;
}
.modal-fondo.abierto .modal { transform: none; }
.modal--ancho { max-width: 780px; }

/* Los modales con formulario llevan <form> dentro del .modal. Ese form
   NO era flex y medía su altura completa (1005 px) dentro de un modal
   limitado a 92vh: el pie con «Crear pedido» quedaba fuera de pantalla
   y no había forma de pulsarlo. Hacerlo flex-column y darle min-height:0
   al cuerpo arregla el scroll interno. */
.modal > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: inherit;
  overflow: hidden;
  flex: 1 1 auto;
}
.modal > form > .modal__cuerpo { min-height: 0; }

.modal__cab {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--borde);
}
.modal__cab h2 { font-size: 16.5px; }
.modal__cab p { margin: 2px 0 0; font-size: 12.5px; color: var(--gris); }
.modal__cerrar {
  margin-left: auto; background: none; border: 0; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%; color: var(--gris);
  display: grid; place-items: center; flex: 0 0 auto;
}
.modal__cerrar:hover { background: var(--fondo-2); color: var(--tinta); }
.modal__cerrar svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.2; }

.modal__cuerpo { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal__pie {
  padding: 14px 20px 18px; border-top: 1px solid var(--borde);
  display: flex; gap: 10px; justify-content: flex-end;
}
/* primario a la derecha, cancelar a la izquierda (Ley de Jakob) */

/* ============================================================
   LOGIN
   ============================================================ */
.acceso {
  min-height: 100vh; display: grid; place-items: center;
  padding: 22px 16px;
  background:
    radial-gradient(circle at 15% 0%, rgba(250,198,28,.17), transparent 42%),
    radial-gradient(circle at 85% 100%, rgba(114,178,52,.15), transparent 45%),
    var(--fondo);
}
.acceso__caja {
  width: 100%; max-width: 400px;
  background: var(--tarjeta); border: 1px solid var(--borde);
  border-radius: var(--r-xl); box-shadow: var(--sombra-2);
  padding: 26px 24px 22px;
}
.acceso__logo { text-align: center; margin-bottom: 18px; }
.acceso__logo img {
  width: 100%; max-width: 210px; height: auto; display: inline-block;
}
.acceso h1 { font-size: 18px; text-align: center; margin-bottom: 3px; }
.acceso__sub {
  text-align: center; font-size: 12.5px; color: var(--gris);
  margin: 0 0 22px;
}
.acceso__enlace {
  display: block; text-align: center; font-size: 12.5px;
  margin-top: 14px; color: var(--teal);
}
.acceso__pie {
  text-align: center; font-size: 11px; color: var(--gris);
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--borde);
}

/* puerta de instalación PWA, debajo del enlace de clave */
.instalar { margin-top: 16px; text-align: center; }
.instalar__sep {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px;
  color: var(--gris); margin-bottom: 9px; font-weight: 700;
}
.instalar__btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--fondo-2); border: 1px solid var(--borde-2);
  border-radius: 999px; padding: 9px 17px; min-height: 44px;
  font-size: 12.5px; font-weight: 700; color: var(--tinta-2);
  cursor: pointer; font-family: inherit;
}
.instalar__btn:hover { border-color: var(--verde); color: var(--verde-osc); }
.instalar__btn svg { width: 16px; height: 16px; fill: currentColor; }
.instalar__nota { font-size: 10.5px; color: var(--gris); margin-top: 7px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* el lateral pasa a cajón */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }

  .lateral {
    display: none;                 /* cerrado es display:none, no translateX */
    position: fixed;
    top: 0; left: 0; bottom: 0; right: auto;
    width: min(280px, 84vw);

    /* El cajón tiene que caber ENTERO en la pantalla del teléfono.
       100vh miente en el móvil: el navegador descuenta la barra de
       direcciones al hacer scroll, y por eso el pie con «Cerrar
       sesión» quedaba debajo del borde. Con 100dvh (alto dinámico)
       el cajón mide lo que de verdad se ve. El 100vh queda como
       respaldo para navegadores viejos. */
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;

    /* el menú hace scroll por dentro, nunca el pie */
    flex-direction: column;
    overflow: hidden;
    z-index: 90;
    box-shadow: var(--sombra-3);
  }

  /* Cerrado no se ve; abierto ocupa la pantalla.
     Ojo con el orden: display:none va arriba y aquí NO se repite
     display:flex, o se anularía y el cajón taparía la página entera. */
  .lateral:not(.abierto) { display: none; }
  .lateral.abierto { display: flex; }

  /* el bloque de enlaces es lo único que se desplaza */
  .lateral .menu {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;                 /* sin esto flex no deja encoger */
  }

  /* el pie (usuario y Cerrar sesión) queda siempre visible al fondo */
  .lateral__pie {
    flex: 0 0 auto;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  /* la marca tampoco se comprime */
  .lateral__marca { flex: 0 0 auto; }

  .velo { display: none; }

  /* El botón hamburguesa queda POR ENCIMA del cajón abierto (z-index
     91 > 90). Así se puede cerrar con el mismo botón que lo abrió:
     antes el cajón lo tapaba y parecía que el menú no respondía. */
  .cab__hamburguesa {
    position: relative;
    z-index: 91;
    display: grid; place-items: center;
    width: 44px; height: 44px; min-width: 44px;
    border: 1px solid var(--borde-2); border-radius: var(--r-md);
    background: var(--tarjeta); color: var(--tinta-2); cursor: pointer; padding: 0;
  }
  .cab__hamburguesa svg { width: 20px; height: 20px; stroke: currentColor;
                          fill: none; stroke-width: 2.1; }

  .cab { padding: 10px 14px; }
  .contenido { padding: 14px; padding-bottom: calc(var(--alto-barra) + 26px); }
}

/* tablas: scroll propio, nunca la página */
@media (max-width: 760px) {
  .tabla-caja { overflow-x: auto; }
  table.tabla { min-width: 620px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px 14px; border-radius: var(--r-md); }
  .kpi__valor { font-size: 21px; }
  .kpi__etiqueta { font-size: 10px; }
}

@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .contenido { padding: 12px; }
  .barra-herramientas__fin { margin-left: 0; width: 100%; }
  .barra-herramientas__fin .btn { flex: 1; }
  .modal { max-height: 94vh; border-radius: var(--r-lg); }
  .modal__cuerpo { padding: 15px 16px; }
  .modal__cab, .modal__pie { padding-left: 16px; padding-right: 16px; }
  .modal__pie { flex-direction: column-reverse; }
  .modal__pie .btn { width: 100%; }
}

/* ============================================================
   ACCESIBILIDAD Y UTILIDADES
   ============================================================ */
.visualmente-oculto {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.centro { text-align: center; }
.derecha { text-align: right; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-entre { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-centro { display: flex; align-items: center; gap: 10px; }

:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- impresión ---------- */
@media print {
  .lateral, .cab, .barra-herramientas, .acciones-fila, .modal-fondo { display: none !important; }
  .app { grid-template-columns: 1fr; }
  body { background: #fff; }
  .tarjeta, .tabla-caja { box-shadow: none; border-color: #ccc; }
}

/* ============================================================
   PEDIDOS (Fase 2)
   ============================================================ */

/* ---------- pestañas de filtro ---------- */
.pestanas {
  display: flex; flex-wrap: wrap; gap: 6px;
  background: var(--fondo-2); padding: 4px;
  border-radius: 999px; border: 1px solid var(--borde);
}
.pestana {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  color: var(--tinta-2); padding: 8px 14px; min-height: 38px;
  border-radius: 999px; transition: background .12s, color .12s;
  white-space: nowrap;
}
.pestana:hover { color: var(--marron); }
.pestana.activa {
  background: var(--tarjeta); color: var(--marron);
  box-shadow: 0 1px 4px rgba(93,19,17,.12);
}
.pestana__n {
  background: var(--rojo); color: #fff; font-size: 10.5px; font-weight: 800;
  min-width: 18px; height: 18px; border-radius: 999px;
  display: inline-grid; place-items: center; padding: 0 5px;
}

/* ---------- rejilla de pedidos ---------- */
.rejilla-pedidos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(268px, 100%), 1fr));
  gap: 12px;
}

.tarjeta-pedido {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--r-lg);
  box-shadow: var(--sombra-1);
  padding: 14px 15px 12px;
  display: flex; flex-direction: column; gap: 7px;
  border-top: 3px solid var(--verde);
  min-width: 0;
}
.tarjeta-pedido:has(.pastilla--error) { border-top-color: var(--rojo); }
.tarjeta-pedido:has(.pastilla--aviso) { border-top-color: var(--amarillo); }
.tarjeta-pedido:has(.pastilla--teal)  { border-top-color: var(--teal); }

.tp__cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tp__num {
  font-size: 17px; font-weight: 800; color: var(--marron);
  letter-spacing: -.4px;
}
.tp__cliente { font-weight: 700; font-size: 14px; color: var(--tinta); }
.tp__dir { font-size: 12.5px; color: var(--tinta-2); line-height: 1.35; }
.tp__tel { margin-top: -2px; }
.tp__total {
  display: flex; align-items: baseline; gap: 7px;
  padding-top: 7px; border-top: 1px dashed var(--borde);
  font-variant-numeric: tabular-nums;
}
.tp__total strong { font-size: 17px; color: var(--marron); }
.tp__acciones {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px;
}
.tp__acciones .btn { flex: 1 1 auto; }

/* ---------- carrito del nuevo pedido ---------- */
.resultados {
  display: flex; flex-direction: column; gap: 1px;
  max-height: 190px; overflow-y: auto; margin-bottom: 10px;
}
.res-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; cursor: pointer;
  background: var(--tarjeta); border: 1px solid var(--borde);
  border-radius: var(--r-sm); padding: 9px 12px; min-height: 42px;
  font-family: inherit; font-size: 13px; color: var(--tinta);
}
.res-item:hover:not(:disabled) { background: var(--fondo-2); border-color: var(--verde); }
.res-item:disabled { opacity: .5; cursor: not-allowed; }
.res-item__nom { min-width: 0; }
.res-item__precio { font-weight: 800; color: var(--marron); white-space: nowrap; }

.carrito { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.car-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center; gap: 8px;
  background: var(--fondo-2); border-radius: var(--r-sm); padding: 8px 10px;
}
.car-item__nom { font-size: 13px; font-weight: 600; min-width: 0; }
.car-item__ctrl { display: flex; align-items: center; gap: 3px; }
.car-item__cant {
  width: 46px; text-align: center; font-family: inherit; font-size: 13px;
  font-weight: 700; color: var(--tinta);
  border: 1px solid var(--borde-2); border-radius: 7px;
  padding: 5px 2px; background: #fff;
}
.car-item__tot {
  font-size: 13px; font-weight: 800; color: var(--marron);
  min-width: 58px; text-align: right; font-variant-numeric: tabular-nums;
}
.mini-btn {
  width: 30px; height: 30px; min-width: 30px;
  border: 1px solid var(--borde-2); border-radius: 8px;
  background: #fff; color: var(--tinta-2); cursor: pointer;
  font-size: 15px; font-weight: 700; line-height: 1;
  display: grid; place-items: center; padding: 0; font-family: inherit;
}
.mini-btn:hover { border-color: var(--verde); color: var(--verde-osc); }
.mini-btn--x:hover { border-color: var(--rojo); color: var(--rojo); }

/* ---------- resumen de totales ---------- */
.resumen-pedido {
  background: var(--fondo-2); border: 1px solid var(--borde);
  border-radius: var(--r-md); padding: 12px 14px;
}
.resumen-linea {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; color: var(--tinta-2); padding: 3px 0;
  font-variant-numeric: tabular-nums;
}
.resumen-linea strong { color: var(--tinta); font-weight: 700; }
.resumen-linea--total {
  border-top: 1px solid var(--borde-2); margin-top: 6px; padding-top: 8px;
  font-size: 15px; font-weight: 800; color: var(--marron);
}
.resumen-linea--total strong { font-size: 19px; color: var(--marron); }

/* ---------- ficha de datos del pedido ---------- */
.ficha-datos {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 10px 18px;
}
.ficha-datos div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ficha-datos strong { font-size: 13.5px; color: var(--tinta); font-weight: 700; }

.seccion-titulo {
  font-size: 11px; text-transform: uppercase; letter-spacing: .7px;
  color: var(--gris); font-weight: 800;
  margin: 4px 0 10px; padding-bottom: 5px;
  border-bottom: 1px solid var(--borde);
}

@media (max-width: 600px) {
  .pestanas { width: 100%; overflow-x: auto; flex-wrap: nowrap; border-radius: var(--r-md); }
  .pestana { padding: 7px 11px; }
  .rejilla-pedidos { grid-template-columns: minmax(0, 1fr); }
  .car-item { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .car-item__tot { text-align: left; }
}

/* ============================================================
   REPORTES (Fase 4)
   ============================================================ */

.rep-filtros {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  background: var(--tarjeta); border: 1px solid var(--borde);
  border-radius: var(--r-lg); padding: 12px 14px; margin-bottom: 14px;
  box-shadow: var(--sombra-1);
}
.rep-atajos { display: flex; flex-wrap: wrap; gap: 4px; }
.rep-atajo {
  border: 1px solid var(--borde-2); background: #fff; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 700; color: var(--tinta-2);
  padding: 7px 12px; border-radius: 999px; min-height: 34px;
  transition: all .12s; white-space: nowrap;
}
.rep-atajo:hover { border-color: var(--verde); color: var(--verde-osc); }
.rep-atajo.activo { background: var(--marron); border-color: var(--marron); color: #fff; }

.rep-fechas { display: flex; align-items: flex-end; gap: 8px; }
.rep-campo { display: flex; flex-direction: column; gap: 3px; }
.rep-campo span { font-size: 10.5px; font-weight: 700; color: var(--gris); text-transform: uppercase; letter-spacing: .4px; }
.rep-campo input {
  font-family: inherit; font-size: 13px; color: var(--tinta);
  border: 1px solid var(--borde-2); border-radius: var(--r-sm);
  padding: 7px 9px; background: #fff; min-height: 36px;
}
.rep-campo input:focus { outline: 0; border-color: var(--verde); box-shadow: 0 0 0 3px rgba(114,178,52,.14); }

.rep-exportar { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }

/* ---------- KPIs con variación ---------- */
.kpi__var { margin-top: 4px; }
.var { font-size: 11px; font-weight: 800; display: inline-flex; align-items: baseline; gap: 4px; }
.var--sube { color: var(--verde-osc); }
.var--baja { color: var(--rojo); }
.var--neutra { color: var(--gris); }
.var__etiq { font-weight: 600; color: var(--gris); font-size: 10.5px; }

/* ---------- bloques ---------- */
.rep-bloque { padding: 16px 18px; margin-bottom: 14px; }
.rep-bloque__cab {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.rep-bloque__cab h2 { font-size: 15px; font-weight: 800; color: var(--marron); margin: 0 0 2px; }
.rep-bloque__cab p { margin: 0; }
.rep-columnas {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 14px;
}
.rep-columnas > .rep-bloque { margin-bottom: 0; }
.rep-columnas + .rep-columnas { margin-top: 14px; }

.rep-cargando { padding: 26px; text-align: center; color: var(--gris); font-size: 13px; }
.rep-vacio { padding: 24px 12px; text-align: center; color: var(--gris); font-size: 13px; }
.rep-tabla-caja { overflow-x: auto; }

/* ---------- gráfica de barras ---------- */
.gra-serie {
  display: flex; align-items: flex-end; gap: 2px;
  height: 190px; padding-top: 6px;
}
.gra-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.gra-pista {
  flex: 1 1 auto; display: flex; align-items: flex-end;
  min-height: 0; position: relative;
}
.gra-barra {
  width: 100%; border-radius: 3px 3px 0 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--fondo-2); transition: filter .12s;
  min-height: 2px;
}
.gra-col:hover .gra-barra { filter: brightness(1.06); }
.gra-barra--vacia { background: var(--borde); }
.gra-barra__venta { background: var(--verde); width: 100%; }
.gra-barra__del { background: var(--rojo); width: 100%; opacity: .75; }
.gra-x {
  display: block; font-size: 9.5px; color: var(--gris); text-align: center;
  padding-top: 4px; white-space: nowrap; overflow: hidden;
}
.gra-x--vacia { visibility: hidden; }
.gra-nota {
  font-size: 11.5px; color: var(--tinta-2); padding: 0 2px 10px;
}
.gra-nota strong { color: var(--marron); }

.rep-leyenda { display: flex; gap: 12px; align-items: center; }
.rep-leyenda__item {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; color: var(--tinta-2);
}
.rep-leyenda__item i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* ---------- tabla dentro de reportes ---------- */
.tabla--rep { font-size: 12.5px; }
.tabla--rep th { font-size: 10.5px; padding: 6px 8px; }
.tabla--rep td { padding: 7px 8px; }
.tabla--rep tbody tr:hover { background: var(--fondo-2); }
.rep-nom { font-weight: 700; color: var(--tinta); line-height: 1.25; }
.rep-mini-barra {
  height: 3px; background: var(--fondo-3); border-radius: 99px; margin-top: 4px; overflow: hidden;
}
.rep-mini-barra i { display: block; height: 100%; background: var(--verde); border-radius: 99px; }

/* ---------- categorías ---------- */
.rep-cat { margin-bottom: 13px; }
.rep-cat:last-child { margin-bottom: 0; }
.rep-cat__cab {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; color: var(--tinta); margin-bottom: 4px;
}
.rep-cat__cab strong { color: var(--marron); font-weight: 800; }
.rep-cat__barra { height: 7px; background: var(--fondo-3); border-radius: 99px; overflow: hidden; }
.rep-cat__barra i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--verde), var(--verde-osc));
}
.rep-cat__pie { margin-top: 3px; }

/* ---------- horas ---------- */
.rep-grafica-horas .hor-serie {
  display: flex; align-items: flex-end; gap: 3px; height: 150px;
}
.hor-col { flex: 1 1 0; display: flex; flex-direction: column; height: 100%; min-width: 0; }
.hor-pista { flex: 1 1 auto; display: flex; align-items: flex-end; min-height: 0; }
.hor-barra {
  width: 100%; background: var(--teal); border-radius: 3px 3px 0 0;
  transition: filter .12s; min-height: 1px;
}
.hor-col:hover .hor-barra { filter: brightness(1.15); }
.hor-x {
  font-size: 9px; color: var(--gris); text-align: center;
  padding-top: 3px; overflow: hidden;
}

/* ---------- cancelados ---------- */
.rep-cancel-resumen {
  display: flex; gap: 22px; padding: 4px 0 12px;
  border-bottom: 1px solid var(--borde); margin-bottom: 10px;
}
.rep-cancel-resumen div { display: flex; flex-direction: column; gap: 1px; }
.rep-cancel-resumen strong { font-size: 19px; color: var(--marron); font-weight: 800; }

.texto-rojo { color: var(--rojo); }
.texto-aviso { color: #B8860B; }

@media (max-width: 700px) {
  .rep-exportar { margin-left: 0; width: 100%; }
  .rep-fechas { width: 100%; }
  .rep-campo { flex: 1 1 auto; }
  .rep-campo input { width: 100%; }
  .gra-serie { height: 150px; }
  .rep-bloque { padding: 13px 14px; }
}

/* Con muchos días en pantalla angosta, 28 barras de 13 px no se pueden
   ni tocar ni leer. Se da un ancho mínimo por barra y se permite
   deslizar horizontalmente: la tendencia se ve igual y cada día queda
   alcanzable con el dedo. */
@media (max-width: 700px) {
  .rep-grafica { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .gra-serie { min-width: max-content; }
  .gra-col { flex: 0 0 22px; }
  .rep-grafica-horas { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .hor-serie { min-width: max-content; }
  .hor-col { flex: 0 0 26px; }
}

/* ============================================================
   REPARTIDORES (panel)
   ============================================================ */
.rep-admin-cab {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 14px; flex-wrap: wrap;
}
.rep-admin-cab p { margin: 0; max-width: 560px; line-height: 1.4; }
.rep-admin-cab code {
  background: var(--fondo-2); padding: 2px 6px; border-radius: 4px;
  font-size: 11.5px; color: var(--marron);
}

.rep-adm-quien { display: flex; align-items: center; gap: 10px; }
.rep-adm-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
  background: var(--verde); color: #fff;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 800; letter-spacing: .3px;
}
.tabla--rep-adm td { vertical-align: middle; }
.tabla--rep-adm .acc { text-align: right; white-space: nowrap; }
.btn-ico {
  width: 32px; height: 32px; border-radius: 8px; margin-left: 3px;
  border: 1px solid var(--borde-2); background: #fff;
  cursor: pointer; font-size: 14px; line-height: 1;
  transition: all .12s;
}
.btn-ico:hover { border-color: var(--verde); background: var(--fondo-2); }

.rep-vacio-panel { text-align: center; padding: 46px 20px; }
.rep-vacio-panel__ico { font-size: 40px; margin-bottom: 10px; }
.rep-vacio-panel h3 { font-size: 16px; color: var(--marron); margin: 0 0 5px; }
.rep-vacio-panel p { margin: 0; }

.rep-clave-caja {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 24px; font-weight: 800; letter-spacing: 2px;
  color: var(--marron); background: #FBF5EC;
  border: 1.5px dashed var(--verde); border-radius: 12px;
  padding: 16px; text-align: center; user-select: all;
}

.campo--ayuda { justify-content: flex-end; }
.pastilla--gris { background: #EDE6DE; color: #7A6660; }
.pastilla--amarilla { background: #FEF3D0; color: #8A6A12; }
.pastilla--verde { background: #E4F3D5; color: #4F7A22; }

/* ------------------------------------------------------------------
   Formularios dentro de modales

   Los campos van en dos columnas cuando caben, para que el formulario
   no se estire en una tira larguísima. En pantalla angosta pasan a una
   sola columna.
   ------------------------------------------------------------------ */
.form-rejilla {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
@media (max-width: 640px) {
  .form-rejilla { grid-template-columns: 1fr; }
}

/* fila del campo de clave: el input manda y el botón se ajusta */
.form-clave__fila { display: flex; gap: 8px; align-items: stretch; }
.form-clave__fila .input { flex: 1 1 auto; min-width: 0; }
.form-clave__fila .btn { flex: 0 0 auto; align-self: stretch; }

/* Adorno de los campos obligatorios */
.campo__etiqueta .req { color: var(--rojo); font-weight: 800; }

/* interruptor de sí/no, para opciones tipo «puede entrar» */
.interruptor {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; margin-bottom: 4px;
  border: 1.5px solid var(--borde-2); border-radius: var(--r-md);
  background: var(--fondo-2);
  cursor: pointer; user-select: none;
}
.interruptor input { position: absolute; opacity: 0; width: 0; height: 0; }
.interruptor__pista {
  flex: 0 0 auto;
  width: 42px; height: 24px; border-radius: 999px;
  background: #D6C8BC; position: relative;
  transition: background .16s ease;
}
.interruptor__bola {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .16s ease;
}
.interruptor input:checked + .interruptor__pista { background: var(--verde); }
.interruptor input:checked + .interruptor__pista .interruptor__bola {
  transform: translateX(18px);
}
.interruptor input:focus-visible + .interruptor__pista {
  outline: 2px solid var(--verde); outline-offset: 2px;
}
.interruptor__txt { font-size: 13.5px; font-weight: 600; color: var(--tinta-2); }

/* lista de repartidores al asignar un pedido */
.rep-lista-elige { display: flex; flex-direction: column; gap: 6px; }
.rep-elige {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--borde-2); border-radius: 10px;
  padding: 10px 12px; cursor: pointer; transition: all .12s;
}
.rep-elige:hover { border-color: var(--verde); background: var(--fondo-2); }
.rep-elige input { width: 18px; height: 18px; accent-color: var(--verde); flex: 0 0 auto; }
.rep-elige:has(input:checked) { border-color: var(--verde); background: #F4FAEC; }
.rep-elige__txt { display: flex; flex-direction: column; gap: 1px; }
.rep-elige__txt strong { font-size: 13.5px; color: var(--tinta); }
.rep-cargando-mini { padding: 16px; text-align: center; color: var(--gris); font-size: 12.5px; }

/* ============================================================
   PAGOS (panel)
   ============================================================ */
.pag-tabs {
  display: flex; gap: 6px; margin-bottom: 18px;
  background: #F5EEE5; padding: 5px; border-radius: 12px; width: fit-content;
}
.pag-tab {
  border: 0; background: transparent; padding: 9px 18px; border-radius: 9px;
  font-family: inherit; font-size: 13px; font-weight: 700; color: #8A7870;
  cursor: pointer; transition: all .14s; display: flex; align-items: center; gap: 7px;
}
.pag-tab.activo { background: #fff; color: #5D1311; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.pag-tab__n {
  background: #E4362B; color: #fff; font-size: 11px; font-weight: 800;
  padding: 1px 7px; border-radius: 12px; min-width: 20px; text-align: center;
}

.pago-aviso {
  background: #FFF7E0; border: 1px solid #F0DFA8; border-left: 4px solid #FAC61C;
  border-radius: 10px; padding: 13px 16px; margin-bottom: 18px;
  font-size: 13px; color: #7A5E12; line-height: 1.5;
}
.pago-aviso strong { color: #5D1311; display: block; margin-bottom: 2px; }
.pago-aviso--info {
  background: #E9F2F5; border-color: #BFD9E0; border-left-color: #12687C; color: #14606F;
}
.pago-aviso--info strong { color: #12687C; }

/* ---- tarjeta de pago pendiente ---- */
.pago-tj {
  background: #fff; border: 1px solid #EDE1D2; border-radius: 14px;
  padding: 16px 18px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(93,19,17,.05);
}
.pago-tj__cab {
  display: flex; align-items: center; gap: 11px; margin-bottom: 11px;
  padding-bottom: 11px; border-bottom: 1px solid #F5EEE5;
}
.pago-tj__num { font-size: 16px; font-weight: 800; color: #5D1311; }
.pago-tj__metodo {
  background: #E9F2F5; color: #12687C; font-size: 11px; font-weight: 800;
  padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: .3px;
}
.pago-tj__tot { margin-left: auto; font-size: 16px; font-weight: 800; color: #72B234; }
.pago-tj__cli { font-size: 13px; color: #5A4842; margin-bottom: 5px; }
.pago-tj__cli a { color: #12687C; text-decoration: none; font-weight: 700; }
.pago-tj__ref { font-size: 12.5px; color: #8A7870; }
.pago-tj__ref strong { color: #3C2B26; font-family: ui-monospace, monospace; }
.pago-tj__acciones { display: flex; gap: 9px; margin-top: 13px; }
.pago-tj__acciones .btn { flex: 1; }

.pago-vacio { text-align: center; padding: 50px 20px; background: #fff; border-radius: 14px; border: 1px solid #EDE1D2; }
.pago-vacio__ico { font-size: 42px; color: #72B234; margin-bottom: 10px; }
.pago-vacio p { margin: 0 0 4px; font-size: 14px; color: #5A4842; }

/* ---- comprobante ---- */
.captura-caja {
  background: #F5F2EC; border-radius: 12px; padding: 12px;
  display: flex; align-items: center; justify-content: center;
  min-height: 180px; max-height: 46vh; overflow: hidden;
}
.captura-caja img { max-width: 100%; max-height: 42vh; border-radius: 8px; display: block; }
.captura-sin { color: #A08E88; font-size: 13px; font-weight: 600; }
.captura-datos {
  display: grid; grid-template-columns: 1fr 1fr; gap: 11px 18px; margin-top: 15px;
}
.captura-datos > div { display: flex; flex-direction: column; gap: 2px; }
.captura-datos span { font-size: 11px; color: #A08E88; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.captura-datos strong { font-size: 13.5px; color: #3C2B26; }

/* ---- cuentas de cobro ---- */
.cuenta-tj {
  background: #fff; border: 1px solid #EDE1D2; border-radius: 14px;
  padding: 18px; margin-bottom: 14px;
}
.cuenta-tj__cab {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #F5EEE5;
}
.cuenta-tj__cab strong { font-size: 15px; color: #5D1311; }
.cuenta-tj__campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.cuenta-tj .btn--chico { margin-top: 4px; }

@media (max-width: 700px) {
  .cuenta-tj__campos { grid-template-columns: 1fr; }
  .captura-datos { grid-template-columns: 1fr; }
}

/* El modal de comprobante no lleva <form>, así que la regla
   `.modal > form` no le da estructura: sin esto su altura era 0 y el
   contenido desbordaba por encima del fondo, que se comía los clics. */
#pagoModalCaptura .modal {
  height: auto;
  max-height: 92vh;
  overflow: hidden;
}
#pagoModalCaptura .modal__cuerpo {
  min-height: 0;
  overflow-y: auto;
}
#pagoModalCaptura .modal__pie { flex-shrink: 0; }
