/* Dual Ruta 438 · estilos del panel.
   Tema claro armado desde el logo: azul marino (#19303B) para texto y estructura, naranja (#FD7D01) como acento.
   Todos los colores viven en :root; las reglas de abajo usan solo tokens. */

/* ================= Tokens ================= */
:root {
  /* Marca (medidos del logo) */
  --navy: #19303B;
  --navy-hover: #24424F;
  --on-navy: #F4F8FA;
  --on-navy-2: #B8C8D1;         /* texto secundario sobre azul, 7.6:1 */
  --accent: #FD7D01;            /* solo rellenos e indicadores, nunca texto chico sobre claro */
  --accent-hover: #FF8E22;
  --accent-press: #F07400;
  --on-accent: #12242D;         /* texto sobre naranja, 6:1 */
  --accent-text: #A84E00;       /* naranja para texto sobre claro, 5.6:1 sobre blanco */
  --accent-soft: #FFF0DF;
  --accent-line: #F0B070;
  --focus: #C85600;             /* anillo de foco, 4.3:1 sobre blanco */

  /* Superficies: neutros fríos teñidos del azul del logo */
  --bg: #EEF1F3;
  --surface-1: #FCFDFD;
  --surface-2: #F2F5F6;
  --surface-3: #E5EAED;
  --surface-hover: #D9E0E4;
  --line: #DAE0E4;
  --line-strong: #B9C4CB;
  --field-line: #74858F;        /* borde de campos, 3.7:1 */
  --text: #12242D;              /* 15.6:1 sobre --surface-1 */
  --text-2: #3A4D58;            /* 8.6:1 */
  --text-3: #566873;            /* 5.7:1 */
  --text-off: #A3B0B8;          /* marcas de "sin dato", decorativas */

  /* Estados */
  --ok-bg: #E2F3E9;   --ok-text: #145C37;   --ok-line: #A5D5BA;   --ok-solid: #1B7A48;   --ok-solid-hover: #156339;
  --bad-bg: #FCE9E7;  --bad-text: #9F2228;  --bad-line: #EBAFAC;  --bad-solid: #C8323A;  --bad-soft: #FDF3F2;
  --warn-bg: #FFF2CF; --warn-text: #6F4A00; --warn-line: #E2BC5A; --warn-solid: #D99A00; --warn-soft: #FFF9E8;
  --info-bg: #E2EEF8; --info-text: #1B4B76; --info-line: #A9C8E3;
  --off: #8696A0;
  --hoy-bg: #FFF8EE;
  --hoy-head: #FFE6C7;

  /* Charla */
  --bubble-me: var(--navy);
  --bubble-her: var(--surface-1);
  --chat-bg: #F4F6F7;
  --chat-dot: #DDE3E7;

  --white: #FFFFFF;
  --scrim: rgba(18, 36, 45, .46);
  --scrim-fuerte: rgba(18, 36, 45, .72);
  --shadow: 0 1px 2px rgba(18, 36, 45, .05), 0 10px 26px -16px rgba(18, 36, 45, .22);
  --shadow-pop: 0 2px 6px rgba(18, 36, 45, .08), 0 22px 48px -18px rgba(18, 36, 45, .38);
  --shadow-lado: -24px 0 60px -30px rgba(18, 36, 45, .45);
  --shadow-arriba: 0 -24px 60px -30px rgba(18, 36, 45, .45);
  --shadow-col: 10px 0 14px -10px rgba(18, 36, 45, .28);
  --shadow-accent: 0 8px 20px -10px rgba(200, 86, 0, .65);
  --shadow-fina: 0 1px 1px rgba(18, 36, 45, .04);
  --shadow-tab: 0 1px 2px rgba(18, 36, 45, .14);
  --shadow-fab: 0 2px 4px rgba(18, 36, 45, .16), 0 16px 32px -14px rgba(18, 36, 45, .6);
  --anillo-campo: 0 0 0 3px rgba(253, 125, 1, .26);

  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-xl: 22px;
  --font: 'IBM Plex Sans', system-ui, 'Segoe UI', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --header-h: 72px;
  --nav-h: 76px;           /* alto reservado para la barra inferior */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.23, 1, .32, 1);
}

/* ================= Base ================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) transparent; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  accent-color: var(--accent); caret-color: var(--accent-text);
}
::selection { background: var(--hoy-head); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.num { font-variant-numeric: tabular-nums; }
svg { flex-shrink: 0; }
h1, h2, h3, h4 { text-wrap: balance; }
.hoja { display: flex; flex-direction: column; gap: inherit; }

/* ================= Botones ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface-1); color: var(--text); font-weight: 600; font-size: 16px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease);
}
.btn:hover { background: var(--surface-3); border-color: var(--field-line); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--on-accent); box-shadow: var(--shadow-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: transparent; }
.btn-primary:active { background: var(--accent-press); }
.btn-ok { background: var(--ok-solid); border-color: transparent; color: var(--white); }
.btn-ok:hover { background: var(--ok-solid-hover); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: transparent; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 15px; }
.input {
  min-height: 46px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--field-line);
  background: var(--white); color: var(--text); font-size: 16px; color-scheme: light;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--text-2); }
.input:focus { outline: none; border-color: var(--focus); box-shadow: var(--anillo-campo); }

/* ================= Barra superior ================= */
.topbar {
  height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--surface-1);
  position: sticky; top: 0; z-index: 30;
}
/* La marca ocupa solo lo que mide el logo; la navegación nunca se achica; lo de la derecha toma lo que sobra y SE ENCOGE
   (puntos suspensivos) en vez de desbordar: antes tenía flex-basis 0 + justify-content flex-end, y cuando no entraba
   se salía hacia la izquierda y se montaba sobre la navegación. */
.marca { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 0 1 auto; }
.marca-enlace { display: block; border-radius: 8px; }
.marca-logo { display: block; height: 52px; width: auto; }
.marca h1 { margin: 0; }
.topbar-der { flex: 1 1 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; overflow: clip; overflow-clip-margin: 6px; }
.topbar-der > * { flex-shrink: 0; }
.topbar-der > .conexion, .topbar-der > .chip-autor { flex-shrink: 1; min-width: 0; }
/* Estado honesto: hora de la última carga buena, o "Sin conexión" hasta que un pedido salga bien */
.conexion {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 14.5px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 0; max-width: 100%;
}
#conexion-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.conexion-punto { width: 8px; height: 8px; border-radius: 50%; background: var(--off); flex-shrink: 0; }
.conexion.bien .conexion-punto { background: var(--ok-solid); }
.conexion.sin { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-text); font-weight: 600; }
.conexion.sin .conexion-punto { background: var(--bad-solid); animation: parpadeo 1s infinite; }
.topbar-btn { width: 42px; height: 42px; color: var(--text-2); text-decoration: none; }
.topbar-btn:hover { color: var(--text); }
a.topbar-btn[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.6; }
.pill-real { background: var(--surface-3); color: var(--text-2); }
.pill-sim { background: var(--warn-bg); color: var(--warn-text); box-shadow: inset 0 0 0 1px var(--warn-line); }

/* ================= Navegación =================
   Escritorio/tablet: pestañas dentro de la cabecera (nunca tapan contenido).
   Celular: barra inferior FIJA y opaca; el body reserva su alto, así el contenido termina arriba de ella. */
.nav { display: flex; gap: 4px; align-self: stretch; flex: none; }
.nav a .et-corto { display: none; }
.nav a, .nav-mas {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px;
  color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 16px; white-space: nowrap;
  transition: color .18s var(--ease);
}
.nav-mas { display: none; border: 0; background: none; font-family: inherit; cursor: pointer; }
.nav a::after, .nav-mas::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0;
  background: var(--accent); opacity: 0; transform: scaleX(.5); transition: opacity .18s var(--ease), transform .22s var(--ease);
}
.nav a:hover, .nav-mas:hover { color: var(--text); }
.nav a:focus-visible, .nav-mas:focus-visible { outline-offset: -4px; border-radius: 10px; }
.nav a[aria-current="page"], .nav-mas.activa { color: var(--text); font-weight: 700; }
.nav a[aria-current="page"]::after, .nav-mas.activa::after { opacity: 1; transform: none; }
.nav a[aria-current="page"] svg, .nav-mas.activa svg { color: var(--accent-text); }
/* "Más" (celular): lo que no entra en la barra de abajo */
.menu-mas {
  position: fixed; z-index: 41; right: 8px; bottom: calc(var(--nav-h) + var(--safe-b) + 8px); min-width: 236px; padding: 6px;
  display: flex; flex-direction: column; border-radius: var(--radius-lg); background: var(--surface-1); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-pop); transform-origin: bottom right; animation: brota .16s var(--ease) both;
}
.menu-mas a, .menu-mas button {
  display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 12px; border: 0; border-radius: 10px; background: none;
  color: var(--text); font: inherit; font-size: 16.5px; font-weight: 500; text-decoration: none; text-align: left; cursor: pointer;
}
.menu-mas a:hover, .menu-mas button:hover { background: var(--surface-3); }
.menu-mas a[aria-current="page"] { background: var(--surface-3); font-weight: 700; }
.menu-mas svg { color: var(--text-2); }
.menu-mas-quien { margin: 0 0 4px; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 14.5px; }
.menu-mas-quien b { color: var(--text); }
@media (min-width: 721px) { .menu-mas { display: none; } }
.nav .nav-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--bad-solid); color: var(--white); font-variant-numeric: tabular-nums;
}

/* ================= Vistas ================= */
.vista { animation: aparece .22s var(--ease) both; }
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }

/* ================= CHARLA (panel lateral de la secretaria) ================= */
.chat { width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; background: var(--surface-1); }
.chat-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-1); }
.avatar {
  position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--navy); color: var(--on-navy);
  font-weight: 700; font-size: 17px; letter-spacing: .02em;
}
.avatar::after { content: ''; position: absolute; right: 1px; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok-solid); border: 2px solid var(--surface-1); }
.chat-head-txt { min-width: 0; flex: 1; }
.chat-head-txt strong { display: block; font-size: 18px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#chat-estado { font-size: 14.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
#chat-estado.sin { color: var(--bad-text); font-weight: 600; }
body.sin-conexion .avatar::after { background: var(--off); }
#chat-estado.escribiendo { color: var(--accent-text); }
.chat-head-acciones { display: flex; align-items: center; gap: 8px; }
.chip-autor {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px 0 6px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); cursor: pointer;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.chip-autor:hover { border-color: var(--line-strong); background: var(--surface-3); }
.chip-autor:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip-autor .ini { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); font-size: 13px; font-weight: 700; color: var(--on-accent); }
.chip-autor .etq { font-size: 14px; color: var(--text-3); }
.chip-autor .val { font-size: 16px; font-weight: 600; min-width: 0; max-width: 13ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-autor .ini { flex-shrink: 0; }
.chip-autor select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; font-size: 16px; }
.chip-autor select option { color: var(--text); }
.icon-btn {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--text);
  transition: background-color .15s var(--ease), transform .12s var(--ease), border-color .15s var(--ease), box-shadow .2s var(--ease);
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn:active { transform: scale(.96); }
.icon-btn:disabled { opacity: .5; cursor: wait; }
#btn-llamar { width: 42px; height: 42px; }
#btn-salir { width: 42px; height: 42px; }

#mensajes {
  flex: 1; overflow-y: auto; padding: 20px 20px 14px; display: flex; flex-direction: column; gap: 6px;
  background-color: var(--chat-bg);
  background-image: radial-gradient(var(--chat-dot) 1px, transparent 1px);
  background-size: 20px 20px;
  scrollbar-color: var(--line-strong) transparent;
}
.mensajes-in { width: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.dia {
  align-self: center; margin: 12px 0 8px; padding: 4px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  background: var(--surface-1); color: var(--text-2); border: 1px solid var(--line);
}
.burbuja {
  position: relative; max-width: 78%; padding: 9px 14px 6px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 17px; line-height: 1.5; animation: entra .2s var(--ease) both;
}
.burbuja.usuario { align-self: flex-end; background: var(--bubble-me); border: 1px solid var(--bubble-me); border-bottom-right-radius: 5px; color: var(--on-navy); }
.burbuja.asistente { align-self: flex-start; background: var(--bubble-her); border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: var(--shadow-fina); }
.burbuja .quien { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.burbuja.usuario .quien { color: var(--on-navy-2); }
.burbuja.asistente .quien { color: var(--accent-text); }
.burbuja .hora { display: block; text-align: right; font-size: 13px; color: var(--text-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.burbuja.usuario .hora { color: var(--on-navy-2); }
.burbuja + .burbuja.asistente, .burbuja.usuario + .burbuja.usuario { margin-top: 0; }
.burbuja.usuario + .burbuja.asistente, .burbuja.asistente + .burbuja.usuario { margin-top: 8px; }
.burbuja.error { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad-text); }
.burbuja.error .quien { color: var(--bad-text); }
.typing { display: inline-flex; gap: 5px; padding: 6px 2px 6px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); animation: punto 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes punto { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.bienvenida { margin: auto; text-align: center; max-width: 480px; padding: 24px 8px; }
.bienvenida .avatar { width: 72px; height: 72px; margin: 0 auto 16px; font-size: 24px; }
.bienvenida .avatar::after { width: 16px; height: 16px; border-color: var(--chat-bg); }
.bienvenida h2 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.bienvenida p { margin: 0 0 20px; color: var(--text-2); font-size: 17px; }
.sugerencias { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.sug {
  min-height: 48px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-1);
  color: var(--text); font-size: 16px; font-weight: 500; cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease);
}
.sug:hover { background: var(--accent-soft); border-color: var(--accent-line); }
.sug:active { transform: scale(.98); }

.composer { border-top: 1px solid var(--line); padding: 14px 16px 12px; background: var(--surface-1); }
.composer-in { max-width: 760px; margin: 0 auto; position: relative; }
#formulario { display: flex; align-items: flex-end; gap: 10px; }
.caja-texto {
  flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 6px; padding: 5px 5px 5px 4px; border-radius: 28px;
  background: var(--white); border: 1px solid var(--field-line); transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.caja-texto:focus-within { border-color: var(--focus); box-shadow: var(--anillo-campo); }
#texto {
  flex: 1; min-width: 0; min-height: 46px; max-height: 160px; resize: none; padding: 11px 0; border: 0; background: transparent;
  color: var(--text); font-size: 17px; line-height: 1.4; outline: none;
}
#texto::placeholder { color: var(--text-3); }
#enviar { width: 46px; height: 46px; background: var(--navy); border-color: transparent; color: var(--on-navy); }
#enviar:hover { background: var(--navy-hover); }
/* Micrófono grande (estados .grabando y .procesando los maneja voz.js) */
#btn-microfono {
  position: relative; width: 58px; height: 58px; background: var(--accent); border-color: transparent; color: var(--on-accent);
  box-shadow: var(--shadow-accent);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
#btn-microfono:hover { background: var(--accent-hover); }
#btn-microfono .ico-cargando { display: none; }
#btn-microfono.grabando { background: var(--bad-solid); color: var(--white); box-shadow: none; }
#btn-microfono.grabando::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--bad-solid);
  animation: latido 1.4s ease-out infinite;
}
#btn-microfono.procesando { background: var(--surface-3); border-color: var(--accent-line); color: var(--accent-text); box-shadow: none; cursor: wait; }
#btn-microfono.procesando .ico-mic { display: none; }
#btn-microfono.procesando .ico-cargando { display: block; animation: gira .9s linear infinite; }
#btn-microfono[aria-disabled="true"] { background: var(--surface-3); color: var(--text-3); box-shadow: none; cursor: not-allowed; }
#btn-microfono.sin-permiso::before { content: '!'; position: absolute; top: -2px; right: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--warn-solid); color: var(--text); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
@keyframes latido { from { transform: scale(.94); opacity: .8; } to { transform: scale(1.28); opacity: 0; } }
@keyframes gira { to { transform: rotate(360deg); } }

.composer-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding: 0 6px; }
#estado-voz { font-size: 15px; color: var(--text-2); font-variant-numeric: tabular-nums; min-height: 22px; display: flex; align-items: center; gap: 8px; }
#estado-voz:empty { visibility: hidden; }
.composer:has(#btn-microfono.grabando) #estado-voz { color: var(--bad-text); }
#estado-voz[data-error="1"] { color: var(--bad-text) !important; }
#estado-voz + button { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
#estado-voz + button:hover { background: var(--surface-3); }
.voz-tag { display: inline-flex; align-items: center; gap: 5px; margin: 0 0 3px; font-size: 13px; font-weight: 600; color: var(--on-navy-2); }
.burbuja .voz-tag { display: flex; }
.composer:has(#btn-microfono.grabando) #estado-voz::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--bad-solid); animation: parpadeo 1s infinite; }
@keyframes parpadeo { 50% { opacity: .3; } }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; color: var(--text-2); user-select: none; margin-left: auto; min-height: 36px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--field-line); position: relative; transition: background-color .2s var(--ease), border-color .2s var(--ease); flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-3); transition: transform .2s var(--ease), background-color .2s var(--ease); }
.switch input:checked + .track { background: var(--navy); border-color: var(--navy); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--accent); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch:hover { color: var(--text); }
.switch:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.bloqueo-nota { flex-basis: 100%; margin: 0; font-size: 14px; color: var(--warn-text); }

/* ================= SECCIONES: Playa, Gasoil, Cobros, Actividad ================= */
.vista-planillas { max-width: 1640px; margin: 0 auto; padding: 24px 24px 112px; display: flex; flex-direction: column; gap: 20px; }

.card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 20px 0; }
.card-title { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.card-sub { margin: 2px 0 0; color: var(--text-3); font-size: 15px; }

.aviso { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--text); }
.aviso .ico { color: var(--warn-text); }
.aviso p { margin: 0; flex: 1; font-size: 16px; }
.aviso strong { color: var(--warn-text); }

.planilla-acciones { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.buscador { position: relative; }
.buscador svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.buscador .input { padding-left: 40px; width: 300px; }

/* Barra de filtros rápidos (chips) + buscador */
.planilla-barra { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding: 2px 20px 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding: 4px; margin: -4px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 8px 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--text-2);
  font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .12s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--field-line); background: var(--surface-2); }
.chip:active { transform: scale(.98); }
.chip .n { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--surface-3); color: var(--text-2); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.chip[aria-pressed="true"] .n { background: var(--accent); color: var(--on-accent); }
.chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px var(--on-navy); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-bad { background: var(--bad-solid); } .dot-ok { background: var(--ok-solid); } .dot-warn { background: var(--warn-solid); }
.dot-off { background: var(--off); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 18px 20px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.kpi { padding: 14px 18px; min-width: 0; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; }
.kpi span { display: block; font-size: 14px; color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi strong { display: block; font-size: 25px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpi.ok strong { color: var(--ok-text); } .kpi.bad strong { color: var(--bad-text); }
.kpi.stock strong { color: var(--text); }
.kpi.stock.bad strong { color: var(--bad-text); }
.kpi.warn strong { color: var(--warn-text); }

.leyenda { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; padding: 14px 20px 12px; font-size: 15px; color: var(--text-2); }
.leyenda span { display: inline-flex; align-items: center; gap: 8px; }
.leyenda i { width: 16px; height: 16px; border-radius: 5px; display: inline-block; }
.leyenda .l-ok i { background: var(--ok-bg); border: 1px solid var(--ok-line); }
.leyenda .l-bad i { background: var(--bad-bg); border: 1px solid var(--bad-text); }
.leyenda .l-warn i { background: var(--warn-bg); border: 1px dashed var(--warn-text); }
.leyenda .l-hoy i { background: var(--hoy-head); box-shadow: inset 0 -3px 0 var(--accent); }

/* ---- Tabla PLAYA ----
   Columnas fijas al correr de costado: Cliente + Camiones siempre; Tarifa también desde 1024px (si no hay patentes).
   Los anchos viven en variables para poder calcular el "left" de cada columna fija. */
.tabla-wrap {
  --w-cli: 248px; --w-cam: 108px; --w-tar: 136px; --w-mes: 128px; --w-tot: 140px;
  position: relative; overflow: auto; max-height: min(70vh, 800px); border-top: 1px solid var(--line-strong);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); overscroll-behavior-x: contain;
  scrollbar-color: var(--line-strong) transparent;
}
.tabla-wrap:focus-visible, .gas-scroll:focus-visible { outline-offset: -3px; }
table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 16px; }
th, td { padding: 0 12px; height: 64px; white-space: nowrap; border-bottom: 1px solid var(--line); background: var(--surface-1); transition: background-color .12s var(--ease); }
thead th {
  position: sticky; top: 0; z-index: 3; height: 46px; background: var(--surface-3);
  font-size: 13px; font-weight: 700; color: var(--text-2); text-align: left; text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--line-strong);
}
th.r, td.r { text-align: right; }
th.c, td.c { text-align: center; }
.t-corto { display: none; }

/* Columnas fijas */
.fija { position: sticky; z-index: 2; }
thead .fija, tfoot .fija { z-index: 6; }
.col-cli { left: 0; width: var(--w-cli); min-width: var(--w-cli); max-width: var(--w-cli); padding-left: 20px; }
.col-cam { left: var(--w-cli); width: var(--w-cam); min-width: var(--w-cam); max-width: var(--w-cam); border-right: 1px solid var(--line-strong); }
.col-tar { width: var(--w-tar); min-width: var(--w-tar); max-width: var(--w-tar); }
.tabla-wrap.corrida .col-cam { box-shadow: var(--shadow-col); }
@media (min-width: 1024px) {
  .tabla-wrap:not(.con-patentes) .col-cam { border-right: 0; }
  .tabla-wrap:not(.con-patentes) .col-tar { position: sticky; z-index: 2; left: calc(var(--w-cli) + var(--w-cam)); border-right: 1px solid var(--line-strong); }
  .tabla-wrap:not(.con-patentes) thead .col-tar, .tabla-wrap:not(.con-patentes) tfoot .col-tar { z-index: 6; }
  .tabla-wrap.corrida:not(.con-patentes) .col-cam { box-shadow: none; }
  .tabla-wrap.corrida:not(.con-patentes) .col-tar { box-shadow: var(--shadow-col); }
}

/* Celda de cliente: botón que abre la ficha */
.cli {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; width: 100%; min-width: 0; height: 100%;
  padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer;
}
.cli:focus-visible { outline: none; }
td.col-cli:has(.cli:focus-visible) { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 6px; }
.cli-nombre { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 16px; line-height: 1.25; color: var(--text); }
.cli-meta { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; overflow: hidden; font-size: 13.5px; line-height: 1.2; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cli-meta.debe { color: var(--bad-text); font-weight: 500; }
.cli-meta .sintel { display: inline-flex; color: var(--warn-text); }
tbody tr[data-id] { cursor: pointer; }
tbody tr[data-id]:hover td { background: var(--surface-2); }
tbody tr[data-id]:hover .cli-nombre { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
td.cam { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
td.tarifa { font-weight: 600; font-variant-numeric: tabular-nums; }
.tarifa small { color: var(--text-3); font-weight: 500; font-size: 13px; }

/* Patentes: chips en tipografía monoespaciada (dato de medición, se lee letra por letra) */
.pat {
  display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 6px; white-space: nowrap;
  font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: .03em; line-height: 1.5;
  background: var(--white); color: var(--text); border: 1px solid var(--field-line);
}
.pat-mas { font-size: 12.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pat-aviso { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; font-family: var(--font); letter-spacing: 0; }
.pat-aviso.de-mas { background: var(--warn-bg); color: var(--warn-text); box-shadow: inset 0 0 0 1px var(--warn-line); }
.pat-aviso.faltan { background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tabla-wrap.con-patentes { --w-cam: 252px; }
.tabla-wrap.con-patentes th.col-cam, .tabla-wrap.con-patentes td.col-cam { text-align: left; }
.cam-caja { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; min-width: 0; }
.cam-linea { display: flex; align-items: center; gap: 5px; min-width: 0; }
.cam-n { min-width: 18px; margin-right: 3px; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Meses */
th.mes { width: var(--w-mes); min-width: var(--w-mes); text-align: right; padding-right: 20px; }
td.mes { width: var(--w-mes); min-width: var(--w-mes); padding: 0 6px; }
th.mes.hoy { background: var(--hoy-head); color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
td.mes.hoy { background: var(--hoy-bg); }
tbody tr[data-id]:hover td.mes.hoy { background: var(--accent-soft); }
.celda {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 2px; height: 48px; padding: 0 14px;
  border-radius: 10px; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 16px; line-height: 1.15;
}
.celda small { font-size: 12.5px; font-weight: 500; }
.celda.pagado { background: var(--ok-bg); color: var(--ok-text); }
.celda.pendiente { background: var(--bad-bg); color: var(--bad-text); box-shadow: inset 0 0 0 1px var(--bad-text); }
.celda.parcial { background: var(--warn-bg); color: var(--warn-text); outline: 1px dashed var(--warn-text); outline-offset: -1px; }
.celda.vacia { color: var(--text-off); font-weight: 400; }

/* Totales por fila */
.col-tot { width: var(--w-tot); min-width: var(--w-tot); text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
thead th.col-tot { text-align: right; }
.col-tot.primera { border-left: 1px solid var(--line-strong); }
.col-tot:last-child { padding-right: 20px; }
td.t-pagado { color: var(--ok-text); }
td.t-debe { color: var(--bad-text); font-weight: 700; }
td.t-cero { color: var(--text-3); font-weight: 500; }

/* Pie con totales por mes */
tfoot td {
  position: sticky; bottom: 0; z-index: 3; height: 48px; background: var(--surface-3); font-weight: 700; font-variant-numeric: tabular-nums;
  border-top: 1px solid var(--line-strong); border-bottom: 0;
}
tfoot tr:first-child td { bottom: var(--pie2, 0px); }
tfoot tr + tr td { border-top: 1px solid var(--line); }
tfoot td.mes { padding-right: 20px; text-align: right; }
tfoot td.mes.hoy { background: var(--hoy-head); }
tfoot .t-ok { color: var(--ok-text); } tfoot .t-bad { color: var(--bad-text); }
tfoot .etq { color: var(--text); font-weight: 600; font-size: 14.5px; }
tfoot .t-nada { color: var(--text-off); font-weight: 400; }

.fila-vacia td { text-align: left; color: var(--text-2); height: auto; white-space: normal; }
.fila-vacia .vacio { position: sticky; left: 0; width: min(100%, calc(100vw - 80px)); }
.skeleton { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: brillo 1.4s infinite linear; }
.sk-1 { width: 140px; } .sk-2 { width: 110px; } .sk-3 { width: 160px; } .sk-largo { width: 600px; max-width: 60vw; } .sk-medio { width: 220px; }
@keyframes brillo { to { background-position: -200% 0; } }

/* ---- Ficha del cliente (panel lateral / hoja desde abajo) ---- */
dialog.ficha {
  position: fixed; inset: 0 0 0 auto; margin: 0; width: min(480px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
  padding: 0; border: 0; border-left: 1px solid var(--line-strong); border-radius: 0; background: var(--surface-1); color: var(--text);
  box-shadow: var(--shadow-lado);
}
dialog.ficha[open] { display: flex; flex-direction: column; animation: ficha-lado .26s var(--ease) both; }
@keyframes ficha-lado { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ficha-abajo { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.agarre { display: none; }
.ficha-head { display: flex; align-items: center; gap: 14px; padding: 20px 20px 18px; border-bottom: 1px solid var(--line); }
.ficha-ini {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--navy); color: var(--on-navy); font-weight: 700; font-size: 19px;
}
.ficha-tit { flex: 1; min-width: 0; }
.ficha-tit h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.ficha-tit p { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ficha-cerrar { width: 44px; height: 44px; background: transparent; border-color: transparent; color: var(--text-2); }
.ficha-cerrar:hover { background: var(--surface-3); color: var(--text); }
.ficha-cuerpo { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 26px; scrollbar-color: var(--line-strong) transparent; }
.ficha-cuerpo > * { flex-shrink: 0; } /* las cajas con overflow oculto no se aplastan cuando la ficha es larga */
.ficha-totales { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ficha-total { padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); }
.ficha-total span { display: block; font-size: 14px; color: var(--text-2); }
.ficha-total strong { display: block; margin-top: 2px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ficha-total.ok strong { color: var(--ok-text); }
.ficha-total.bad { border-color: var(--bad-line); background: var(--bad-bg); }
.ficha-total.bad strong { color: var(--bad-text); }
.ficha-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dato { padding: 12px 16px; min-width: 0; }
.ficha-datos .dato { border-bottom: 1px solid var(--line); }
.ficha-datos .dato.izq { border-right: 1px solid var(--line); }
.dato.ancho { grid-column: 1 / -1; }
.ficha-datos .dato:last-child { border-bottom: 0; }
.dato span { display: block; font-size: 13.5px; color: var(--text-3); }
.dato strong { display: block; margin-top: 2px; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dato strong small { color: var(--text-3); font-weight: 500; font-size: 14px; }
.ficha-sec h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; font-size: 16px; font-weight: 700; color: var(--text); }
.ficha-sec .nada { margin: 0; color: var(--text-3); font-size: 15px; }
.mchips { display: flex; flex-wrap: wrap; gap: 6px; }
.mchip { padding: 5px 11px; border-radius: 8px; font-size: 14.5px; font-weight: 600; background: var(--ok-bg); color: var(--ok-text); border: 1px solid var(--ok-line); }
.pend { display: flex; flex-direction: column; border: 1px solid var(--bad-line); border-radius: var(--radius); overflow: hidden; }
.pend-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; background: var(--bad-soft); }
.pend-fila + .pend-fila { border-top: 1px solid var(--bad-line); }
.pend-fila b { font-weight: 600; }
.pend-fila small { display: block; color: var(--text-2); font-size: 13.5px; }
.pend-fila .monto { color: var(--bad-text); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recs { display: flex; flex-direction: column; gap: 8px; }
.recs-sep { margin-top: 10px; }
.rec { padding: 11px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.rec-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rec-top b { font-weight: 600; font-variant-numeric: tabular-nums; }
.rec p { margin: 4px 0 0; color: var(--text-2); font-size: 15px; }
.ficha-pie { padding: 14px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface-1); display: flex; flex-direction: column; gap: 10px; }
.ficha-pie .btn { width: 100%; min-height: 50px; font-size: 16.5px; }
.falta { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--warn-bg); color: var(--warn-text); box-shadow: inset 0 0 0 1px var(--warn-line); }
.pill-ok { background: var(--ok-bg); color: var(--ok-text); box-shadow: inset 0 0 0 1px var(--ok-line); }
.pill-bad { background: var(--bad-bg); color: var(--bad-text); box-shadow: inset 0 0 0 1px var(--bad-line); }
/* Camiones del cliente */
.veh-aviso { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 10px; padding: 10px 14px; border-radius: var(--radius); font-size: 15px; line-height: 1.4; }
.veh-aviso.de-mas { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--text); }
.veh-aviso.de-mas b { color: var(--warn-text); }
.veh-aviso.de-mas svg { color: var(--warn-text); margin-top: 1px; }
.veh-aviso.faltan { background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.veh-aviso.faltan svg { color: var(--text-3); margin-top: 1px; }
.vehiculos { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.veh { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 10px 14px; }
.veh + .veh { border-top: 1px solid var(--line); }
.veh .pat { font-size: 15px; padding: 3px 10px; border-radius: 8px; }
.veh-tipo { font-size: 15px; font-weight: 600; }
.veh-nota { flex: 1 1 100%; color: var(--text-2); font-size: 14.5px; overflow-wrap: anywhere; }

.tabs { display: flex; gap: 4px; padding: 12px 12px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; border: 0; background: none;
  color: var(--text-2); font-size: 16px; font-weight: 600; cursor: pointer; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1px; border-radius: 8px 8px 0 0;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab:focus-visible { outline-offset: -3px; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.badge { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--surface-3); color: var(--text-2); font-variant-numeric: tabular-nums; }
.tab[aria-selected="true"] .badge { background: var(--navy); color: var(--on-navy); }
.badge.alerta, .tab[aria-selected="true"] .badge.alerta { background: var(--warn-bg); color: var(--warn-text); box-shadow: inset 0 0 0 1px var(--warn-line); }
.panel { padding: 16px 20px 20px; }
.panel-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-tools p { margin: 0; color: var(--text-2); font-size: 15px; max-width: 60ch; }
.lista { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; padding-bottom: 4px; scroll-padding-bottom: 12px; scrollbar-color: var(--line-strong) transparent; }
.item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.item-main { flex: 1; min-width: 0; }
.item-titulo { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.item-titulo.sep { margin-top: 6px; }
.item-meta { color: var(--text-3); font-size: 15px; font-weight: 400; font-variant-numeric: tabular-nums; }
.item-texto { margin-top: 6px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; }
.item code { font-family: var(--mono); font-size: 14px; padding: 1px 7px; border-radius: 6px; background: var(--white); border: 1px solid var(--line-strong); color: var(--warn-text); }
.estado { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.estado::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.e-programado { background: var(--info-bg); color: var(--info-text); box-shadow: inset 0 0 0 1px var(--info-line); }
.e-programado::before { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.e-en_aprobacion { background: var(--warn-bg); color: var(--warn-text); box-shadow: inset 0 0 0 1px var(--warn-line); }
.e-enviado { background: var(--ok-bg); color: var(--ok-text); box-shadow: inset 0 0 0 1px var(--ok-line); }
.e-cancelado { background: var(--surface-3); color: var(--text-2); }
.e-cancelado::before { display: none; }
.e-falta_telefono { background: var(--bad-bg); color: var(--bad-text); box-shadow: inset 0 0 0 1px var(--bad-line); }
/* Tarjeta por cliente (Recordatorios y mensajes enviados) */
.cli-card { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.cli-card.solo-canc { background: var(--surface-1); }
.cli-card.solo-canc .cli-nombre { color: var(--text-2); }
.cli-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.cli-card .cli-nombre { overflow: visible; overflow-wrap: anywhere; min-width: 0; }
.cli-nombre .item-meta { margin-left: 6px; }
.cli-resumen { color: var(--text-3); font-size: 15px; font-variant-numeric: tabular-nums; }
.cli-resumen strong { color: var(--text-2); font-weight: 600; }
.meses { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.mes-fila { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.mes-nombre { font-weight: 600; min-width: 6.4em; }
.mes-fila .estado { margin-left: auto; }
@media (max-width: 480px) { .mes-nombre { min-width: 0; flex: 0 0 5.6em; } .mes-fila { column-gap: 8px; } }
.mes-fecha { flex: 0 1 auto; min-width: 0; white-space: nowrap; color: var(--text-3); font-size: 15px; font-variant-numeric: tabular-nums; }
.mes-motivo { flex: 1 1 100%; color: var(--text-3); font-size: 14px; overflow-wrap: anywhere; }
.cli-canc { margin-top: 4px; border-top: 1px solid var(--line); }
.cli-canc > summary { cursor: pointer; padding: 8px 0 2px; color: var(--text-3); font-size: 15px; list-style: none; min-height: 32px; display: flex; align-items: center; gap: 6px; }
.cli-canc > summary::-webkit-details-marker { display: none; }
.cli-canc > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s var(--ease); margin: 0 4px 0 2px; }
.cli-canc[open] > summary::before { transform: rotate(45deg); }
.cli-canc > summary:hover { color: var(--text); }
.cli-canc > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.cli-canc .meses { margin-top: 2px; }
.cli-canc .mes-fila:first-child { border-top: 0; }
.msg-ultimo { margin-top: 6px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; }
.msg-viejo { padding: 8px 0; border-top: 1px solid var(--line); }
.msg-viejo:first-child { border-top: 0; }
.msg-viejo .item-texto { margin-top: 2px; font-size: 15px; }
.lote { border: 1px solid var(--warn-line); border-radius: var(--radius); background: var(--warn-soft); padding: 14px; margin-bottom: 12px; }
.lote-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.lote-head strong { font-size: 17px; }
.lote .item { background: var(--surface-1); }
.lote-pie { display: flex; justify-content: flex-end; margin-top: 12px; }
.lote-nota { margin: 10px 2px 0; color: var(--text-2); font-size: 15px; }
.item-btn { width: 100%; text-align: left; color: inherit; font: inherit; cursor: pointer; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.item-btn:hover { border-color: var(--field-line); background: var(--surface-3); }
.lote .item-btn:hover { background: var(--surface-2); }
.regla { display: flex; gap: 12px; align-items: flex-start; }
.regla-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-text); }
.regla-texto { font-size: 16.5px; line-height: 1.45; overflow-wrap: anywhere; }
.alcance { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.6; background: var(--surface-3); color: var(--text-2); border: 0; font-family: inherit; }
button.alcance { cursor: pointer; background: var(--info-bg); color: var(--info-text); box-shadow: inset 0 0 0 1px var(--info-line); }
button.alcance:hover { text-decoration: underline; }
.ajustes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.ajustes .dato { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.ajustes .dato.ancho { grid-column: 1 / -1; }
.ajustes .dato strong { font-size: 16px; font-weight: 500; }
.vacio { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 16px; color: var(--text-2); }
.vacio .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-3); margin-bottom: 4px; }
.vacio strong { color: var(--text); font-size: 17px; }
.vacio p { margin: 0; font-size: 15px; max-width: 42ch; }
.proximamente { padding: 56px 20px; }

/* ================= Diálogo de fecha ================= */
dialog {
  width: min(460px, calc(100vw - 32px)); padding: 0; border-radius: var(--radius-xl); border: 1px solid var(--line-strong);
  background: var(--surface-1); color: var(--text); box-shadow: var(--shadow-pop);
}
dialog::backdrop { background: var(--scrim); }
.dlg { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.dlg h2 { margin: 0; font-size: 20px; }
.dlg p { margin: 0; color: var(--text-2); font-size: 16px; }
.dlg .input { width: 100%; }
.dlg-acciones { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ================= Avisos flotantes ================= */
#toasts { position: fixed; right: 20px; bottom: 100px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: min(480px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); font-size: 16px; background: var(--navy); color: var(--on-navy); border: 1px solid var(--navy); box-shadow: var(--shadow-pop); animation: entra .22s var(--ease) both; }
.toast .ico { color: var(--accent); }
.toast.bad { background: var(--bad-bg); color: var(--text); border-color: var(--bad-text); }
.toast.bad .ico { color: var(--bad-text); }
.toast p { margin: 0; flex: 1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.toast button { background: none; border: 0; color: inherit; opacity: .75; cursor: pointer; padding: 2px; border-radius: 6px; }
.toast button:hover { opacity: 1; }

/* ================= Secretaria a mano (botón flotante + panel lateral / hoja) ================= */
.fab-sec {
  position: fixed; z-index: 45; right: 24px; bottom: calc(24px + var(--safe-b));
  display: inline-flex; align-items: center; gap: 10px; height: 60px; padding: 0 22px 0 6px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 16px;
  box-shadow: var(--shadow-fab);
  transition: transform .15s var(--ease), background-color .15s var(--ease);
}
.fab-sec:hover { background: var(--accent-hover); }
.fab-sec:active { transform: scale(.97); }
.fab-sec .fab-av { position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--on-navy); font-weight: 700; font-size: 15px; }
.fab-sec .fab-mic { position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--white); color: var(--navy); box-shadow: 0 0 0 2px var(--accent); }
body.cajon-abierto .fab-sec { display: none; }

.cajon-fondo { display: none; }
.cajon {
  position: fixed; z-index: 35; top: calc(var(--header-h) + var(--franjas-h, 0px)); right: 0; bottom: 0; width: var(--cajon-w, 440px); max-width: 100vw;
  display: flex; flex-direction: column; background: var(--surface-1); border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lado); animation: ficha-lado .24s var(--ease) both;
}
.cajon .chat { min-height: 0; flex: 1; }
.cajon .chat-head { padding: 12px 14px; gap: 10px; }
.cajon .chat-head .avatar { width: 42px; height: 42px; font-size: 15px; }
.cajon .chat-head-txt strong { font-size: 16.5px; }
.cajon #mensajes { padding: 14px 12px 10px; }
.cajon .burbuja { max-width: 88%; }
.cajon .composer { padding: 10px 12px 10px; }
.cajon #btn-microfono { width: 54px; height: 54px; }
.chat-cerrar { width: 42px; height: 42px; background: transparent; border-color: transparent; color: var(--text-2); }
.chat-cerrar:hover { background: var(--surface-3); color: var(--text); }
@media (min-width: 1100px) {
  /* Escritorio ancho: el panel queda al costado y el contenido se corre, no se tapa */
  body.cajon-abierto .vista { margin-right: 440px; margin-left: 0; max-width: none; }
  body.cajon-abierto #toasts { right: 460px; bottom: 24px; }
}

/* ================= Grabación de voz (lo dibuja voz.js) ================= */
.grab { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 58px; padding: 6px 8px 6px 6px;
  border-radius: 28px; background: var(--bad-soft); border: 1px solid var(--bad-line); }
.grab-cancelar { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; flex-shrink: 0; cursor: pointer; background: var(--surface-1); color: var(--text-2); }
.grab-cancelar:hover { color: var(--bad-text); background: var(--bad-bg); }
.grab-centro { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.grab-linea { display: flex; align-items: center; gap: 10px; min-width: 0; }
.grab-punto { width: 10px; height: 10px; border-radius: 50%; background: var(--bad-solid); flex-shrink: 0; animation: parpadeo 1s infinite; }
.grab-reloj { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 17px; color: var(--text); min-width: 40px; }
.grab-barras { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; height: 26px; overflow: hidden; }
.grab-barras i { flex: 1; min-width: 2px; max-width: 5px; height: 100%; border-radius: 2px; background: var(--bad-solid); transform: scaleY(.12); transform-origin: center; transition: transform .1s linear; }
.grab-pista { font-size: 14.5px; color: var(--text-2); line-height: 1.35; }
.grab.cancelando { background: var(--bad-bg); }
.grab.cancelando .grab-pista { color: var(--bad-text); font-weight: 600; }
.composer.con-grabacion .caja-texto, .composer.con-grabacion #btn-adjuntar, .composer.con-grabacion .prev-adj { display: none; }
.voz-aviso { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; margin: 0 auto 10px; max-width: 760px; border-radius: var(--radius); background: var(--warn-bg); border: 1px solid var(--warn-line); }
.voz-aviso-txt { flex: 1; min-width: 0; }
.voz-aviso strong { display: block; color: var(--warn-text); font-size: 16px; }
.voz-aviso p { margin: 2px 0 0; font-size: 15px; color: var(--text); line-height: 1.45; }
.voz-aviso-x { flex-shrink: 0; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
.voz-aviso-x:hover { background: var(--surface-3); }

/* Burbuja de audio mientras se transcribe */
.burbuja .voz-estado { display: inline-flex; align-items: center; gap: 8px; color: var(--on-navy-2); font-style: italic; }
.burbuja .voz-estado svg { animation: gira .9s linear infinite; }
.burbuja.voz-fallo { border-color: var(--bad-line); background: var(--bad-bg); color: var(--text); }
.burbuja.voz-fallo .quien, .burbuja.voz-fallo .voz-tag, .burbuja.voz-fallo .hora { color: var(--text-2); }
.burbuja .voz-error { display: block; color: var(--bad-text); font-size: 15.5px; }
.burbuja .reintentar { margin-top: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--text); font-size: 14.5px; font-weight: 600; cursor: pointer; }
.burbuja .reintentar:hover { background: var(--surface-3); }

/* Adjuntos (fotos) */
#btn-adjuntar { width: 46px; height: 46px; background: transparent; border-color: transparent; color: var(--text-2); }
#btn-adjuntar:hover { background: var(--surface-3); color: var(--text); }
#btn-adjuntar[aria-expanded="true"] { color: var(--accent-text); background: var(--accent-soft); }
#btn-adjuntar[aria-disabled="true"], #btn-llamar[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.menu-adj { position: absolute; z-index: 20; bottom: calc(100% + 8px); left: 0; min-width: 240px; padding: 6px; border-radius: var(--radius); background: var(--surface-1); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; transform-origin: bottom left; animation: brota .16s var(--ease) both; }
@keyframes brota { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.menu-adj button { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 16px; text-align: left; cursor: pointer; }
.menu-adj button:hover, .menu-adj button:focus-visible { background: var(--surface-3); }
.menu-adj svg { color: var(--accent-text); }
.prev-adj { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.prev-adj figure { position: relative; margin: 0; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface-2); }
.prev-adj img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prev-adj button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--scrim-fuerte); color: var(--white); cursor: pointer; }
.prev-adj .cargando { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--white); background: var(--scrim-fuerte); }
.burbuja .adj { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 4px 0 6px; width: min(320px, 62vw); }
.burbuja .adj.uno { grid-template-columns: 1fr; }
.burbuja .adj a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface-3); }
.burbuja .adj img { display: block; width: 100%; height: 100%; max-height: 260px; object-fit: cover; }

/* ================= Planilla: años, inactivos, vacío ================= */
.titulo-fila { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.anios { display: inline-flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--surface-3); }
.anio { min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: var(--text-2); font-size: 15px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; transition: background-color .15s var(--ease), color .15s var(--ease); }
.anio:hover { color: var(--text); background: var(--surface-hover); }
.anio[aria-pressed="true"] { background: var(--navy); color: var(--on-navy); }
tbody tr.inactivo td { background: var(--surface-2); }
tbody tr.inactivo td > * { opacity: .6; }
tbody tr.inactivo td.col-cli > .cli { opacity: 1; }
tbody tr.inactivo .cli-nombre { color: var(--text-2); }
tbody tr.inactivo td.t-debe { opacity: 1; }
.tag-inactivo { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line-strong); white-space: nowrap; }
.vacio-planilla { padding: 44px 20px 48px; }
.vacio-planilla .ejemplo { margin: 12px auto 4px; max-width: 560px; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); border: 1px dashed var(--accent-line); color: var(--text); font-size: 16.5px; line-height: 1.5; text-align: left; }
.vacio-planilla .ejemplo b { color: var(--accent-text); font-weight: 700; display: block; font-size: 14px; margin-bottom: 4px; }
.vacio-planilla .btn { margin-top: 14px; }
.vacio-planilla .ico { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.nota-regla { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--info-bg); border: 1px solid var(--info-line); color: var(--text); font-size: 15.5px; line-height: 1.45; }
.nota-regla svg { flex-shrink: 0; margin-top: 1px; color: var(--info-text); }
.cli-sub { margin: 10px 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--text-2); }
.cli-deuda .deuda-total-fila { margin-top: 6px; }
.deuda-total-fila { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 8px; border-radius: var(--radius); background: var(--bad-bg); border: 1px solid var(--bad-line); font-weight: 700; }
.deuda-total-fila span:last-child { color: var(--bad-text); font-variant-numeric: tabular-nums; font-size: 18px; }
.pend-anio { padding: 7px 14px 5px; font-size: 13px; font-weight: 700; color: var(--text-2); background: var(--surface-2); }
.pend-fila + .pend-anio { border-top: 1px solid var(--bad-line); }

/* ================= Planilla GASOIL ================= */
.meses-g { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.meses-g::-webkit-scrollbar { display: none; }
.meses-g .anio { white-space: nowrap; flex-shrink: 0; }
.gas-aviso { margin: 16px 20px 0; }
.gas-cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; padding: 16px 20px 20px; align-items: start; }
.gas-bloque { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface-1); min-width: 0; }
.gas-bloque-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--surface-1); border-bottom: 1px solid var(--line); }
.gas-bloque-head h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.gas-bloque-head span { font-size: 14px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.gas-scroll { overflow: auto; max-height: 460px; overscroll-behavior: contain; scrollbar-color: var(--line-strong) transparent; }
.gtabla { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 0; font-size: 16px; }
.gtabla th, .gtabla td { height: auto; padding: 10px 14px; white-space: normal; overflow-wrap: anywhere; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); background: var(--surface-1); }
.gtabla thead th { position: sticky; top: 0; z-index: 2; height: auto; padding: 9px 14px; font-size: 12.5px; white-space: nowrap; background: var(--surface-3); }
.gtabla .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.gtabla thead .r { font-weight: 700; }
.gtabla .f { white-space: nowrap; color: var(--text-2); font-variant-numeric: tabular-nums; }
.gtabla small { display: block; color: var(--text-3); font-size: 13.5px; }
.gtabla tbody tr:hover td { background: var(--surface-2); }
.gtabla tfoot td { position: sticky; bottom: 0; z-index: 2; background: var(--surface-3); font-weight: 700; border-top: 1px solid var(--line-strong); border-bottom: 0; }
.gtabla tr.g-compra td, .gtabla tbody tr.g-compra:hover td { background: var(--ok-bg); }
.gtabla tr.g-compra td.r { color: var(--ok-text); }
.gtabla tr.g-ajuste td, .gtabla tbody tr.g-ajuste:hover td { background: var(--warn-soft); }
.gtabla tr.g-ajuste td.r { color: var(--warn-text); }
.gtabla tr.g-anulado td { color: var(--text-3); }
.gtabla tr.g-anulado td.r { text-decoration: line-through; color: var(--text-3); }
.gtabla tr.g-sep td, .gtabla tbody tr.g-sep:hover td { background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 700; padding: 7px 14px; }
.gas-etq { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--text-2); white-space: nowrap; }
.gas-etq.compra { background: var(--surface-1); border-color: var(--ok-text); color: var(--ok-text); }
.gas-etq.ajuste { background: var(--warn-bg); border-color: var(--warn-text); color: var(--warn-text); border-style: dashed; }
.gtabla td.gas-vacio { padding: 24px 14px; text-align: center; color: var(--text-3); font-size: 15px; }
.gas-quien { list-style: none; margin: 0; padding: 6px 20px 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.gas-quien li { padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.gas-quien li.gas-vacio { grid-column: 1 / -1; border: 0; text-align: center; color: var(--text-3); }
.q-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.q-nombre { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.q-lit { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.q-meta { color: var(--text-3); font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.q-barra { height: 6px; margin-top: 8px; }
.q-barra i { display: block; height: 100%; border-radius: 999px; background: var(--navy); }
.gas-det > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 16px 20px; font-size: 17px; font-weight: 700; min-height: 56px; border-radius: var(--radius-lg); }
.gas-det > summary::-webkit-details-marker { display: none; }
.gas-det > summary small { font-weight: 500; color: var(--text-3); font-size: 14px; }
.gas-det > summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg); margin: -4px 6px 0 auto; transition: transform .18s var(--ease); }
.gas-det[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.gas-det > summary:hover { background: var(--surface-2); }
.gas-det[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.gas-det .gas-scroll { max-height: 560px; }

/* ================= AJUSTES ================= */
.vista-ajustes { max-width: 1100px; margin: 0 auto; padding: 24px 24px 112px; display: flex; flex-direction: column; gap: 20px; }
.ajustes-top h2 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.ajustes-top p { margin: 2px 0 0; color: var(--text-2); font-size: 16px; max-width: 70ch; }
.mente-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 20px 0; }
.mente-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; background: var(--navy); color: var(--on-navy); }
.mente-head h3 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.mente-head p { margin: 2px 0 0; color: var(--text-2); font-size: 15.5px; max-width: 72ch; }
.mente-cuerpo { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 26px; }
.clave-cuerpo { padding: 18px 20px 22px; }
.clave-form { display: flex; flex-direction: column; gap: 6px; max-width: 460px; }
.clave-form label { margin-top: 8px; font-size: 14.5px; font-weight: 600; color: var(--text); }
.clave-form .input { width: 100%; }
.clave-form .ayuda { margin: 2px 0 0; color: var(--text-3); font-size: 14px; }
.clave-acciones { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.clave-acciones .btn-primary { flex: 1 1 200px; }
.clave-msg { margin: 10px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 15px; line-height: 1.45; }
.clave-msg.bad { background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad-text); }
.clave-msg.ok { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-text); }
.aviso-solo-lectura { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--info-bg); border: 1px solid var(--info-line); color: var(--text); font-size: 15.5px; }
.aviso-solo-lectura svg { color: var(--info-text); }
.funciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.funcion { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 15px; min-width: 0; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.funcion b { display: block; font-weight: 600; }
.funcion small { display: block; color: var(--text-2); font-size: 13.5px; }
.funcion .dot { width: 10px; height: 10px; }
.modo h4 { margin: 0; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.modo > p { margin: 2px 0 12px; color: var(--text-3); font-size: 15px; }
.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.tarjeta {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: var(--radius); text-align: left; cursor: pointer;
  background: var(--surface-1); border: 1px solid var(--line-strong); color: var(--text); font: inherit;
  transition: border-color .15s var(--ease), background-color .15s var(--ease), transform .12s var(--ease);
}
.tarjeta:hover { border-color: var(--field-line); background: var(--surface-2); }
.tarjeta:active { transform: scale(.99); }
.tarjeta[aria-checked="true"] { border-color: var(--navy); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--navy) inset; }
.tarjeta[aria-disabled="true"] { cursor: not-allowed; transform: none; }
.tarjeta[aria-disabled="true"]:not([aria-checked="true"]) { opacity: .6; }
.tarjeta[aria-disabled="true"]:not([aria-checked="true"]):hover { border-color: var(--line-strong); background: var(--surface-1); }
.tarjeta-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tarjeta-nombre { font-weight: 700; font-size: 16.5px; line-height: 1.3; overflow-wrap: anywhere; }
.tarjeta-check { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; border: 2px solid var(--field-line); color: transparent; }
.tarjeta[aria-checked="true"] .tarjeta-check { background: var(--navy); border-color: var(--navy); color: var(--accent); }
.tarjeta-desc { color: var(--text-2); font-size: 14.5px; line-height: 1.45; }
.tarjeta-precio { align-self: stretch; padding: 7px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; line-height: 1.4; background: var(--ok-bg); color: var(--ok-text); font-variant-numeric: tabular-nums; }
.tarjeta-caps { display: flex; flex-wrap: wrap; gap: 5px; }
.cap { padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-1); color: var(--text-2); border: 1px solid var(--line-strong); }
.tarjeta.guardando { opacity: .7; }
.chip-pred { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-1); color: var(--accent-text); border: 1px solid var(--accent-line); }
.chip-pred svg { flex-shrink: 0; }
.mente-pred { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); font-size: 15.5px; }
.mente-pred > span { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text-2); }
.mente-pred.otra { background: var(--accent-soft); border-color: var(--accent-line); }
.mente-pred.otra > span { color: var(--text); }
.mente-pred svg { color: var(--accent-text); flex-shrink: 0; }
.modo-otra { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: -4px 0 12px; font-size: 14.5px; color: var(--text-2); }
.modo-otra b { color: var(--text); font-weight: 600; }
.btn-mini { min-height: 36px; padding: 6px 14px; text-align: center; border-radius: 18px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; background: var(--surface-1); color: var(--text); border: 1px solid var(--line-strong); }
.btn-mini:hover { border-color: var(--field-line); background: var(--surface-3); }
.btn-mini[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-mini:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ================= Entrada (sin sesión el servidor manda solo esto) ================= */
body:has(.login) { padding-bottom: 0; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-caja {
  width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 8px; padding: 32px 28px 28px;
  background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow);
  animation: entra .3s var(--ease) both;
}
.login-logo { display: block; width: 236px; max-width: 78%; height: auto; margin: 0 auto 14px; }
.login-caja h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.login-caja > p { margin: 0 0 8px; color: var(--text-2); font-size: 16px; text-align: center; }
.login-caja label { margin-top: 6px; font-size: 14.5px; font-weight: 600; color: var(--text); }
.login-caja .input { width: 100%; min-height: 48px; }
.login-caja .btn { width: 100%; margin-top: 16px; min-height: 50px; font-size: 17px; }
.login-error { margin: 6px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad-text); font-size: 15px; }
.chip-autor.fija { cursor: default; }
.chip-autor.fija:hover { border-color: var(--line); background: var(--surface-2); }

/* ================= Escritorio de gestión: inicio, acciones directas, actividad ================= */
.vista { container-type: inline-size; }
.vista-inicio { max-width: 1400px; margin: 0 auto; padding: 24px 24px 112px; display: flex; flex-direction: column; gap: 20px; }
.vista-angosta { max-width: 1100px; }
#act-filtros .chip { padding: 0 16px; }
.vista-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; }
.vista-top h2 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.vista-top p { margin: 2px 0 0; color: var(--text-2); font-size: 16px; max-width: 68ch; }
.acciones-rapidas { display: flex; gap: 10px; flex-wrap: wrap; }
.enlace { display: inline-flex; align-items: center; gap: 2px; color: var(--text-2); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; border-radius: 6px; }
.enlace:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.card-pie { padding: 6px 20px 18px; }
.sub-t { margin: 20px 20px 2px; font-size: 16px; font-weight: 700; }
.sk-ancho { width: 100%; max-width: 560px; height: 16px; }
.sk-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.vacio .btn { margin-top: 10px; }
.vacio-botones { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.vacio-botones .btn { margin-top: 0; }

/* Avisos permanentes bajo la cabecera */
.franjas { position: sticky; top: var(--header-h); z-index: 29; }
.franja { display: flex; align-items: center; gap: 10px; padding: 8px 24px; font-size: 15px; font-weight: 600; border-bottom: 1px solid; }
.franja-bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-text); }
.franja-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.franja a { color: inherit; text-underline-offset: 3px; border-radius: 4px; }
.franja .btn-mini { margin-left: auto; flex-shrink: 0; }

/* Inicio */
.inicio-cuerpo { display: flex; flex-direction: column; gap: 20px; }
.inicio-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; align-items: start; }
.inicio-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.atender { list-style: none; margin: 0; padding: 12px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.at {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface-1); color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease);
}
.at:hover { background: var(--surface-2); border-color: var(--line-strong); }
.at:active { transform: scale(.995); }
.at-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-3); color: var(--text-2); }
.at-warn { background: var(--warn-soft); border-color: var(--warn-line); }
.at-warn:hover { background: var(--warn-bg); border-color: var(--warn-solid); }
.at-warn .at-ico { background: var(--warn-bg); color: var(--warn-text); }
.at-bad { background: var(--bad-soft); border-color: var(--bad-line); }
.at-bad:hover { background: var(--bad-bg); border-color: var(--bad-solid); }
.at-bad .at-ico { background: var(--bad-bg); color: var(--bad-text); }
.at-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.at-txt b { font-weight: 600; font-size: 16.5px; overflow-wrap: anywhere; }
.at-txt span { color: var(--text-2); font-size: 15px; }
.at-ver { display: inline-flex; align-items: center; gap: 2px; font-size: 15px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.at-nada { display: flex; align-items: center; gap: 12px; margin: 14px 20px 20px; padding: 14px 16px; border-radius: var(--radius); background: var(--ok-bg); border: 1px solid var(--ok-line); font-size: 16px; }
.at-nada svg { color: var(--ok-text); }
.kpis.kpis-ir { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis-ir .kpi:nth-child(n) { border-width: 0 0 0 1px; border-style: solid; border-color: var(--line); }
.kpis-ir .kpi:first-child { border-left-width: 0; }
button.kpi { background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background-color .15s var(--ease); }
button.kpi:hover { background: var(--surface-3); }
button.kpi:focus-visible { outline-offset: -3px; border-radius: 10px; }
.filas-ir { list-style: none; margin: 0; padding: 6px 8px 8px; }
.filas-ir li + li { border-top: 1px solid var(--line); }
.filas-ir button {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border: 0; border-radius: 10px;
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background-color .12s var(--ease);
}
.filas-ir button:hover { background: var(--surface-2); }
.filas-ir button > svg { color: var(--text-3); }
.fi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fi-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-main small { color: var(--text-3); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-main .sintel { color: var(--warn-text); font-weight: 600; }
.fi-monto { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fi-monto.bad { color: var(--bad-text); }
.fi-monto.warn { color: var(--warn-text); }
.stock-ir {
  display: block; width: calc(100% - 40px); margin: 16px 20px 0; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.stock-ir:hover { background: var(--surface-3); border-color: var(--line-strong); }
.stock-ir span { display: block; font-size: 14px; color: var(--text-2); }
.stock-ir strong { display: block; margin-top: 2px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stock-ir small { display: block; margin-top: 2px; font-size: 14.5px; font-weight: 600; color: var(--bad-text); }
.stock-ir.bad { background: var(--bad-bg); border-color: var(--bad-line); }
.stock-ir.bad strong { color: var(--bad-text); }
.mini-datos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; margin: 0; padding: 14px 20px 18px; }
.mini-datos div { min-width: 0; }
.mini-datos dt { font-size: 13.5px; color: var(--text-3); }
.mini-datos dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
@container (max-width: 900px) { .inicio-grid { grid-template-columns: minmax(0, 1fr); } }
@container (max-width: 560px) {
  .kpis.kpis-ir { grid-template-columns: minmax(0, 1fr); }
  .kpis-ir .kpi:nth-child(n) { border-width: 1px 0 0; }
  .kpis-ir .kpi:first-child { border-top-width: 0; }
}

/* Actividad (también "Últimos movimientos" del inicio) */
.act-lista { list-style: none; margin: 0; padding: 8px 20px 12px; }
.act { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; }
.act + .act { border-top: 1px solid var(--line); }
.act-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-3); color: var(--text-2); }
.act-ico.gasoil { background: var(--accent-soft); color: var(--accent-text); }
.act-main { flex: 1; min-width: 0; }
.act-titulo { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 600; overflow-wrap: anywhere; }
.act-resumen { margin-top: 2px; color: var(--text-2); font-size: 15.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.act-meta { margin-top: 3px; color: var(--text-3); font-size: 14px; font-variant-numeric: tabular-nums; }
.act .btn-mini { flex-shrink: 0; align-self: center; }
.act.deshecha .act-ico, .act.deshecha .act-resumen { opacity: .55; }
.act.deshecha .act-titulo { color: var(--text-3); font-weight: 500; }
.act.sk { flex-direction: column; gap: 12px; padding: 16px 0; }
.act-vacio { padding: 8px 0; }
.act-pie { display: flex; justify-content: center; padding: 4px 20px 20px; }

/* Ficha: acciones directas */
.ficha-acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ficha-acciones .btn { min-height: 44px; padding: 6px 10px; white-space: normal; line-height: 1.2; text-align: center; }
.veh .veh-retirar { margin-left: auto; min-height: 32px; padding: 4px 12px; }
.buscador .tecla {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%); min-width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-3); font: 600 12.5px var(--mono); pointer-events: none;
}
.buscador .input:focus ~ .tecla, .buscador .input:not(:placeholder-shown) ~ .tecla { display: none; }
tbody tr[data-id]:focus-within td { background: var(--surface-2); }
tbody tr[data-id]:focus-within td.mes.hoy { background: var(--accent-soft); }
.cli { scroll-margin: 54px 0 104px; }

/* Diálogo de acciones: formulario, resumen de confirmación y errores */
dialog.dlg-accion { width: min(520px, calc(100vw - 32px)); max-height: min(92dvh, 780px); overflow: hidden; }
dialog.dlg-accion[open] { display: flex; animation: brota-dlg .2s var(--ease) both; }
@keyframes brota-dlg { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.dlg-accion form { display: flex; flex-direction: column; min-height: 0; width: 100%; }
.acc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 12px 14px 22px; border-bottom: 1px solid var(--line); }
.acc-head h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.acc-cuerpo { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px 20px; scrollbar-color: var(--line-strong) transparent; }
.acc-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; }
.acc-sub { grid-column: 1 / -1; margin: 0; color: var(--text-2); font-size: 15.5px; }
.campo { grid-column: 1 / -1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.campo.medio { grid-column: auto; }
.campo label, .campo .etq { font-size: 15px; font-weight: 600; }
.opc { margin-left: 4px; font-weight: 400; font-size: 13.5px; color: var(--text-3); }
.campo .input { width: 100%; min-height: 48px; font-size: 17px; }
.campo .input.num { font-weight: 600; font-variant-numeric: tabular-nums; }
.campo .input.mayus { text-transform: uppercase; font-family: var(--mono); letter-spacing: .03em; }
.campo .ayuda { margin: 0; color: var(--text-3); font-size: 14px; }
.campo-error { margin: 0; color: var(--bad-text); font-size: 14.5px; font-weight: 600; }
.campo.con-error .input { border-color: var(--bad-solid); background: var(--bad-soft); }
.con-signo { position: relative; }
.con-signo > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-weight: 600; pointer-events: none; }
.con-signo .input { padding-left: 28px; }
.con-signo.fin > span { left: auto; right: 12px; font-weight: 500; font-size: 15px; }
.con-signo.fin .input { padding-left: 12px; padding-right: 64px; }
.segmentos { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-3); }
.seg { flex: 1; position: relative; }
.seg input, .check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span { display: grid; place-items: center; min-height: 40px; padding: 0 12px; border-radius: 9px; font-size: 16px; font-weight: 600; color: var(--text-2); transition: background-color .15s var(--ease), color .15s var(--ease); }
.seg:hover span { color: var(--text); }
.seg input:checked + span { background: var(--surface-1); color: var(--text); box-shadow: var(--shadow-tab), inset 0 -3px 0 var(--accent); }
.seg input:focus-visible + span, .check input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks .nada { margin: 0; color: var(--text-3); font-size: 15px; }
.check { position: relative; }
.check span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--text-2); font-size: 15px; font-weight: 600; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); }
.check:hover span { border-color: var(--field-line); color: var(--text); }
.check input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.check input:checked + span .dot { box-shadow: 0 0 0 2px var(--on-navy); }
/* Total del mes en vivo (Editar cliente y Nuevo cliente) */
.total-vivo { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: 15.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* Patentes en lista: una fila por patente (patente + qué es + nota + quitar) */
.pat-filas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pat-fila { display: grid; grid-template-columns: minmax(0, 1.1fr) 124px minmax(0, 1.3fr) auto; gap: 8px; align-items: center; padding: 8px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.pat-fila.dup { border-color: var(--bad-solid); background: var(--bad-soft); }
.campo.con-error .pat-fila .input { border-color: var(--field-line); background: var(--white); }
.campo.con-error .pat-fila.dup .input { border-color: var(--bad-solid); }
.pat-fila .input { min-height: 46px; font-size: 16px; padding: 0 10px; }
.pat-fila .btn-mini { min-height: 42px; }
.pat-pie { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.pat-cuenta { color: var(--text-2); font-size: 14.5px; }
@media (max-width: 560px) {
  .pat-fila { grid-template-columns: minmax(0, 1fr) 118px; grid-template-areas: "pat tipo" "nota quitar"; }
  .pat-pat { grid-area: pat; } .pat-tipo { grid-area: tipo; } .pat-nota { grid-area: nota; } .pat-quitar { grid-area: quitar; justify-self: stretch; }
}
.tarifa small.fijo { display: block; }
.combo-lista { list-style: none; margin: 6px 0 0; padding: 4px; max-height: 266px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface-1); box-shadow: var(--shadow); }
.combo-lista [role="option"] { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 44px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.combo-lista [role="option"]:hover { background: var(--surface-2); }
.combo-lista [aria-selected="true"], .combo-lista [aria-selected="true"]:hover { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.op-n { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.op-m { color: var(--text-3); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.op-m.debe { color: var(--bad-text); font-weight: 600; }
.combo-nada { padding: 10px; color: var(--text-3); font-size: 15px; }
.cli-fijo { display: flex; align-items: center; min-height: 48px; padding: 0 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 17px; overflow-wrap: anywhere; }
.cli-info { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 14.5px; color: var(--text-2); }
.cli-info .btn-mini { margin-left: auto; }
.acc-error { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad-text); font-size: 15.5px; font-weight: 500; }
.resumen-intro { margin: 0 0 10px; color: var(--text-2); font-size: 15.5px; }
.resumen-caja { padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: 17px; font-weight: 500; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.resumen-avisos { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.resumen-avisos li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-bg); border: 1px solid var(--warn-line); font-size: 15.5px; }
.resumen-avisos svg { color: var(--warn-text); }
.acc-resumen .skeleton + .skeleton { margin-top: 12px; }
.acc-pie { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface-1); }
.acc-pie .btn-primary { min-width: 140px; }
.btn.cargando { position: relative; color: transparent; }
.btn.cargando::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--on-accent); border-right-color: transparent; animation: gira .7s linear infinite; }
.toast .toast-accion { flex-shrink: 0; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--on-navy-2); color: var(--on-navy); font-size: 14.5px; font-weight: 700; opacity: 1; }
.toast .toast-accion:hover { background: var(--navy-hover); }

.parecidos { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid var(--warn-line); font-size: 15.5px; }
.parecidos ul { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 6px; }
.parecido { width: 100%; display: flex; flex-direction: column; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.parecido:hover { border-color: var(--field-line); background: var(--surface-2); }
.parecido span { font-weight: 600; }
.parecido small { color: var(--text-3); font-size: 13.5px; }

/* Ajustes: modo de prueba y lo que aprendió */
.mente-head h3 .badge { margin-left: 6px; vertical-align: middle; }
.mente-ico.prueba { background: var(--warn-bg); color: var(--warn-text); box-shadow: inset 0 0 0 1px var(--warn-line); }
.prueba-estado { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; font-size: 16px; color: var(--text-2); }
.prueba-estado strong { color: var(--text); }
.prueba-form { display: flex; flex-direction: column; gap: 6px; max-width: 460px; }
.prueba-form label { font-size: 14.5px; font-weight: 600; }
.prueba-form .input { width: 100%; }

/* ================= Responsive ================= */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
}
/* Cabecera de escritorio, de más ancho a más angosto: cada escalón saca algo ANTES de que lo de la derecha toque la navegación.
   1) hasta 1360: "Cobros y recordatorios" pasa a "Cobros"; 2) hasta 1180: "Actualizado 09:08" pasa a "09:08" (junto con el nombre);
   3) hasta 1180: el nombre queda en la inicial; 4) hasta 1060: sin íconos en la navegación; 5) hasta 860: todo más chico. */
@media (max-width: 1360px) { .nav a .et-largo { display: none; } .nav a .et-corto { display: inline; } }
@media (max-width: 1180px) { .conexion .con-pref { display: none; } }
@media (max-width: 1180px) { .topbar .chip-autor .val { display: none; } .topbar .chip-autor { padding: 0 5px; } .nav a { padding: 0 11px; } }
@media (max-width: 1060px) and (min-width: 721px) {
  .nav a { padding: 0 9px; }
  .nav a svg { display: none; }
}
@media (max-width: 860px) and (min-width: 721px) { .topbar { padding: 0 12px; gap: 6px; } .marca-logo { height: 34px; } .nav { gap: 2px; } .nav a { padding: 0 6px; font-size: 15px; } .nav a::after { left: 6px; right: 6px; } .topbar-der { gap: 6px; } .conexion { padding: 0 8px; gap: 6px; font-size: 13.5px; } }
@media (max-width: 1099px) and (min-width: 721px) { .cajon { width: 420px; } }
@media (max-width: 1000px) { .gas-cols { grid-template-columns: minmax(0, 1fr); } .gas-quien { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  :root { --header-h: 58px; --nav-h: 70px; }
  .topbar { padding: 0 14px; }
  .marca-logo { height: 40px; }
  .topbar .chip-autor, .topbar-btn { display: none; }
  .conexion { min-height: 32px; padding: 0 10px; font-size: 13.5px; }
  .franja { padding: 8px 14px; font-size: 14.5px; }
  body { padding-bottom: calc(var(--nav-h) + var(--safe-b)); }
  .nav {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b));
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 0 4px var(--safe-b);
    border-top: 1px solid var(--line-strong); background: var(--surface-1);
  }
  .nav a, .nav-mas { flex-direction: column; gap: 3px; padding: 0; font-size: 13px; }
  .nav .nav-esc { display: none; }
  .nav-mas { display: flex; }
  .nav a::after, .nav-mas::after { top: 0; bottom: auto; left: 22%; right: 22%; border-radius: 0 0 3px 3px; }
  .nav a .et-largo { display: none; } .nav a .et-corto { display: inline; }
  .conexion .con-pref { display: inline; }
  .nav .nav-badge { position: absolute; top: 8px; right: calc(50% - 30px); margin: 0; }
  .chat-head { padding: 10px 12px; gap: 10px; }
  .chat-head .avatar { width: 42px; height: 42px; font-size: 15px; }
  .chat-head-txt strong { font-size: 16.5px; }
  #mensajes { padding: 14px 12px 10px; }
  .burbuja { max-width: 88%; }
  .composer { padding: 10px 10px 8px; }
  #formulario { gap: 8px; }
  #btn-microfono { width: 54px; height: 54px; }
  .composer-pie { margin-top: 6px; }
  .vista-planillas { padding: 16px 12px 96px; gap: 14px; }
  .vista-inicio { padding: 16px 12px 96px; gap: 14px; }
  .inicio-cuerpo, .inicio-grid, .inicio-col { gap: 14px; }
  .vista-top h2 { font-size: 23px; }
  .vista-top p { font-size: 15px; }
  .acciones-rapidas { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .acciones-rapidas .btn { white-space: normal; line-height: 1.2; padding: 6px 10px; min-height: 48px; font-size: 15px; }
  .atender { padding: 10px 8px 8px; }
  .at { padding: 10px; gap: 10px; align-items: flex-start; }
  .at-ver { display: none; }
  .at-nada { margin: 12px 16px 16px; }
  .sub-t { margin: 16px 16px 2px; }
  .stock-ir { width: calc(100% - 32px); margin: 14px 16px 0; }
  .mini-datos { padding: 12px 16px 16px; }
  .card-pie { padding: 4px 16px 16px; }
  .act-lista { padding: 4px 16px 10px; }
  .ficha-acciones { padding: 10px 16px; }
  .buscador .tecla { display: none; }
  .card-head { padding: 16px 16px 0; }
  .planilla-acciones { width: 100%; }
  .planilla-acciones .btn { flex: 1; }
  .buscador { flex: 1 1 100%; min-width: 0; }
  .buscador .input { width: 100%; }
  .kpis { margin: 14px 16px 0; }
  .kpi { padding: 12px 14px; }
  .kpi span { white-space: normal; line-height: 1.3; }
  .kpi strong { font-size: 20px; }
  .leyenda { padding: 12px 16px; gap: 10px 14px; }
  .planilla-barra { padding: 0 16px 14px; }
  .chips { flex: 1 1 100%; }
  /* En celular la tabla va de borde a borde para ganar ancho */
  .card-planilla { margin: 0 -12px; border-radius: 0; border-left: 0; border-right: 0; }
  .tabla-wrap { --w-cli: 140px; --w-cam: 64px; --w-tar: 116px; --w-mes: 114px; --w-tot: 124px; border-radius: 0; max-height: calc(100dvh - var(--header-h) - var(--nav-h) - 24px); }
  /* Con patentes, en celular solo queda fijo el cliente: las patentes se corren con el resto */
  .tabla-wrap.con-patentes { --w-cam: 236px; }
  .tabla-wrap.con-patentes .col-cam { position: static; box-shadow: none; }
  .tabla-wrap.con-patentes .col-cli { border-right: 1px solid var(--line-strong); }
  .tabla-wrap.con-patentes.corrida .col-cli { box-shadow: var(--shadow-col); }
  .tabla-wrap.con-patentes .t-largo { position: static; width: auto; height: auto; clip: auto; }
  .tabla-wrap.con-patentes .t-corto { display: none; }
  th, td { padding: 0 10px; height: 62px; }
  thead th { height: 44px; font-size: 12px; letter-spacing: .05em; }
  .col-cli { padding-left: 14px; }
  .cli-nombre { font-size: 15px; }
  .cli-meta { font-size: 12.5px; }
  .t-largo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .t-corto { display: inline; }
  td.cam { font-size: 17px; }
  .celda { padding: 0 10px; font-size: 15px; height: 46px; }
  th.mes { padding-right: 16px; }
  tfoot td.mes { padding-right: 16px; }
  .col-tot:last-child { padding-right: 14px; }
  dialog.ficha {
    inset: auto 0 0 0; width: 100vw; height: auto; max-height: 92dvh; border-left: 0; border-top: 1px solid var(--line-strong);
    border-radius: 22px 22px 0 0; box-shadow: var(--shadow-arriba);
  }
  dialog.ficha[open] { animation-name: ficha-abajo; }
  .agarre { display: block; width: 40px; height: 5px; border-radius: 999px; background: var(--line-strong); margin: 10px auto 0; flex-shrink: 0; }
  .ficha-head { padding: 12px 16px 14px; }
  .ficha-ini { width: 46px; height: 46px; font-size: 17px; }
  .ficha-tit h2 { font-size: 20px; }
  .ficha-cuerpo { padding: 16px 16px 20px; gap: 22px; }
  .ficha-total strong { font-size: 21px; }
  .ficha-pie { padding: 12px 16px calc(12px + var(--safe-b)); }
  .panel { padding: 14px 14px 16px; }
  #toasts { left: 12px; right: 12px; max-width: none; bottom: calc(var(--nav-h) + 86px + var(--safe-b)); }
  body.cajon-abierto #toasts, dialog #toasts { bottom: calc(16px + var(--safe-b)); }
  dialog.dlg-accion { margin: auto 0 0; width: 100vw; max-width: 100vw; max-height: 94dvh; border-width: 1px 0 0; border-radius: 22px 22px 0 0; }
  dialog.dlg-accion[open] { animation-name: ficha-abajo; }
  .acc-head { padding: 14px 8px 12px 16px; }
  .acc-cuerpo { padding: 16px 16px 18px; }
  .acc-pie { padding: 12px 16px calc(12px + var(--safe-b)); }
  .acc-pie .btn { flex: 1; }
  .gas-cols { padding: 14px 12px 16px; }
  .gas-aviso { margin: 14px 16px 0; }
  .gas-quien { padding: 4px 16px 14px; }
  .gas-det > summary { padding: 14px 16px; }
  .gtabla th, .gtabla td { padding: 9px 10px; }
  .gas-scroll { max-height: 380px; }
  #gas-todo th:nth-child(2), #gas-todo td:nth-child(2) { display: none; } /* el tipo va escrito arriba del nombre */
  #gas-todo td:nth-child(3)::before { content: attr(data-t); display: block; color: var(--text-3); font-size: 12.5px; font-weight: 600; }
  .gas-card { margin: 0 -12px; border-radius: 0; border-left: 0; border-right: 0; }
  /* En celular el botón queda redondo (solo el avatar) para tapar lo menos posible; el nombre sigue para lectores de pantalla */
  .fab-sec { right: 14px; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); height: 60px; padding: 0 6px; gap: 0; font-size: 0; }
  .fab-sec .fab-av { width: 48px; height: 48px; font-size: 15px; }
  .cajon-fondo { display: block; position: fixed; inset: 0; z-index: 49; background: var(--scrim); animation: aparece .2s var(--ease) both; }
  .cajon {
    z-index: 50; top: auto; left: 0; right: 0; bottom: 0; width: 100vw; height: min(90dvh, calc(100dvh - var(--header-h))); border-left: 0; border-top: 1px solid var(--line-strong);
    border-radius: 22px 22px 0 0; overflow: hidden; animation-name: ficha-abajo; box-shadow: var(--shadow-arriba);
    padding-bottom: var(--safe-b);
  }
  .cajon::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 999px; background: var(--line-strong); margin: 8px auto 0; flex-shrink: 0; }
  .vista-ajustes { padding: 16px 12px 96px; gap: 14px; }
  .ajustes-top h2 { font-size: 23px; }
  .mente-head { padding: 16px 16px 0; }
  .mente-cuerpo { padding: 14px 16px 18px; gap: 22px; }
  .clave-cuerpo { padding: 14px 16px 18px; }
  .funciones, .tarjetas { grid-template-columns: 1fr; }
  .grab-pista { font-size: 13.5px; }
  .login-caja { padding: 28px 20px 22px; }
}
@media (max-width: 400px) {
  .bienvenida h2 { font-size: 22px; }
  .chat-head-txt strong { font-size: 15.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ================= Gasoil: dos stocks, corregir movimientos y control por turno ================= */
/* Cabecera: a la derecha, arriba el cambio de planilla (Stock / Control por turno) y abajo las acciones */
.gas-head { align-items: flex-start; }
.gas-head > :first-child { flex: 1 1 360px; min-width: 0; }
.gas-lado { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.gas-lado .planilla-acciones { justify-content: flex-end; }
.gas-planillas .anio { white-space: nowrap; }
/* Selector de stock: Dual Ruta o Maxi, cada uno con lo que le queda */
.gas-stocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; max-width: 560px; margin: 16px 20px 0; padding: 4px; border-radius: var(--radius); background: var(--surface-3); }
.gas-stock { min-width: 0; padding: 8px 14px 10px; border: 0; border-radius: 9px; background: none; color: var(--text-2); font: inherit; text-align: left; cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease); }
.gas-stock:hover { color: var(--text); background: var(--surface-hover); }
.gas-stock span { display: block; font-size: 14px; font-weight: 600; }
.gas-stock strong { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.gas-stock[aria-pressed="true"] { background: var(--surface-1); color: var(--text); box-shadow: var(--shadow-tab), inset 0 -3px 0 var(--accent); }
.gas-aviso + .gas-aviso { margin-top: 10px; }
/* Quién despachó y turno: columnas en pantallas anchas, un renglón debajo del nombre en celular */
.g-sin { color: var(--text-3); font-weight: 400; white-space: nowrap; }
.gtabla .g-nombre { width: 100%; }
.gtabla small.g-angosto { display: none; }
/* Lápiz de cada fila (corregir o anular) y su menú */
.gtabla .g-acc { width: 1%; padding: 3px 8px 3px 0; text-align: right; vertical-align: middle; }
.g-editar { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--text-3); cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease); }
.g-editar:hover, .g-editar[aria-expanded="true"] { background: var(--surface-1); border-color: var(--line-strong); color: var(--text); }
.menu-fila { position: fixed; z-index: 45; min-width: 168px; padding: 6px; display: flex; flex-direction: column; border-radius: var(--radius); background: var(--surface-1); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop); }
.menu-fila button { display: flex; align-items: center; min-height: 46px; padding: 0 14px; border: 0; border-radius: 9px; background: none; color: var(--text); font: inherit; font-size: 16px; font-weight: 500; text-align: left; cursor: pointer; }
.menu-fila button:hover, .menu-fila button:focus-visible { background: var(--surface-3); }
/* Formularios: opciones que no entran en un renglón (quién despachó, turno) */
.segmentos.varias { flex-wrap: wrap; }
.segmentos.varias .seg { flex: 1 1 auto; }
.segmentos.varias .seg span { white-space: nowrap; }

/* Control por turno (surtidor) */
.surt { display: flex; flex-direction: column; gap: 14px; padding: 16px 20px 20px; }
.surt > .gas-aviso { margin: 0; }
.surt-barra { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.surt-dia { display: flex; align-items: center; gap: 8px; min-width: 0; }
.surt-dia .icon-btn:disabled { opacity: .4; cursor: default; }
.surt-fecha { min-width: 0; padding: 0 4px; }
.surt-fecha strong { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.surt-fecha span { display: block; font-size: 13.5px; color: var(--text-3); }
.surt-turnos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
@container (max-width: 1040px) { .surt-turnos { grid-template-columns: minmax(0, 1fr); } }
.surt-turno.en-curso { border-color: var(--accent-line); box-shadow: inset 0 3px 0 var(--accent); }
.surt-turno.en-curso > .gas-bloque-head { background: var(--hoy-bg); }
.surt-turno.no-coincide { border-color: var(--bad-line); }
.gas-bloque-head h3 small { margin-left: 4px; font-size: 14px; font-weight: 500; color: var(--text-3); }
.estado.e-ok { background: var(--ok-bg); color: var(--ok-text); box-shadow: inset 0 0 0 1px var(--ok-line); }
.estado.e-no_coincide { background: var(--bad-bg); color: var(--bad-text); box-shadow: inset 0 0 0 1px var(--bad-line); }
.estado.e-abierto { background: var(--surface-3); color: var(--text-2); }
.estado.e-sin_referencia { background: var(--info-bg); color: var(--info-text); box-shadow: inset 0 0 0 1px var(--info-line); }
.surt-cuerpo { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 14px 14px; }
.surt-resp { margin: 0; font-size: 15px; color: var(--text-2); }
.surt-resp b { color: var(--text); }
/* La cuenta del turno, renglón por renglón: lectura inicial + despachado = debería marcar | marcó | diferencia */
.surt-cuenta { align-self: stretch; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.surt-cuenta div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 12px; }
.surt-cuenta div + div { border-top: 1px solid var(--line); }
.surt-cuenta dt { min-width: 0; font-size: 15px; color: var(--text-2); }
.surt-cuenta dt small { display: block; font-size: 13px; color: var(--text-3); }
.surt-cuenta dd { margin: 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.surt-cuenta .total { background: var(--surface-3); }
.surt-cuenta .total dt, .surt-cuenta .total dd, .surt-cuenta .dif dd { color: var(--text); font-weight: 700; }
.surt-turno.no-coincide .surt-cuenta .dif { background: var(--bad-bg); }
.surt-turno.no-coincide .surt-cuenta .dif dd, .surt-turno.no-coincide .surt-frase { color: var(--bad-text); }
.surt-frase { margin: 0; font-size: 15px; line-height: 1.4; color: var(--text-2); }
.surt-turno.no-coincide .surt-frase { font-weight: 600; }
.surt-sin-turno > .surt-frase { padding: 10px 14px; }
.surt-emp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--text-3); }
.surt-turno > .gas-scroll, .surt-sin-turno > .gas-scroll { max-height: 320px; border-top: 1px solid var(--line); }
.surt-nada { margin: 0; padding: 12px 14px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 15px; }
.surt-vacio { border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.surt-vacio p { max-width: 62ch; }
.surt-total { margin: 0; }
.surt-total b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ================= Playa: promo (pagás 5, te regalamos 1) ================= */
.tag-promo, .pill-promo, .celda.regalo, .mchip.regalo { background: var(--accent-soft); color: var(--accent-text); }
.tag-promo, .pill-promo, .celda.regalo { box-shadow: inset 0 0 0 1px var(--accent-line); }
.mchip.regalo { border-color: var(--accent-line); }
.tag-promo { display: inline-block; max-width: 100%; padding: 0 7px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================= Inicio: los dos stocks de gasoil ================= */
.stocks-ir { display: flex; flex-direction: column; }
.stocks-ir .stock-ir small { color: var(--text-2); font-weight: 500; }
.stock-ir .stock-mes { margin-top: 4px; font-size: 13.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.stocks-nota { margin: 12px 20px 18px; }

@media (max-width: 720px) {
  .gas-head > :first-child { flex-basis: 100%; }
  .gas-lado { width: 100%; align-items: stretch; }
  .gas-planillas { display: flex; }
  .gas-planillas .anio { flex: 1; }
  .gas-stocks { max-width: none; margin: 14px 16px 0; }
  .gas-stock { padding: 8px 12px 10px; }
  .gas-stock strong { font-size: 19px; }
  .gtabla .g-ancho { display: none; }
  .gtabla small.g-angosto { display: block; }
  .gtabla .g-acc { padding: 2px 2px 2px 0; }
  .g-editar { width: 36px; height: 36px; }
  #gas-todo th, #gas-todo td { padding-left: 7px; padding-right: 7px; }
  #gas-todo thead th:nth-child(3) { white-space: normal; }
  .surt { padding: 14px 12px 16px; }
  .surt-fecha strong { font-size: 16.5px; }
  .tag-promo .promo-hasta { display: none; }
  .stocks-nota { margin: 10px 16px 16px; }
}
/* ================= "(modificado)", resumen del día y "debería marcar ahora" del control por turno ================= */
.g-mod { margin-right: 6px; font-size: 12.5px; font-weight: 600; color: var(--warn-text); white-space: nowrap; cursor: help; }
.gtabla small.g-mod-det { color: var(--warn-text); }
.surt-resumen { margin: 0; }
.surt-resumen .kpi small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.3; color: var(--text-3); }
.surt-resumen .kpi.ok small { color: var(--ok-text); } .surt-resumen .kpi.bad small { color: var(--bad-text); font-weight: 600; }
.surt-turno.en-curso .surt-cuenta .total { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.surt-turno.en-curso .surt-cuenta .total dd { font-size: 24px; letter-spacing: -.01em; color: var(--accent-text); }
.surt-cuenta .total dt small { font-weight: 500; }
.surt-turno .gtabla .g-mod { display: block; margin: 0; }
/* Contador automático: franja de 3 números, turnos por empezar atenuados, cierre automático y acción discreta */
.surt-resumen { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.surt-turno.por-empezar { opacity: .62; }
.surt-turno.por-empezar .surt-cuerpo { padding-bottom: 12px; }
.surt-cierre { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 15px; color: var(--text-2); }
.surt-cierre b { color: var(--text); font-variant-numeric: tabular-nums; }
.surt-otro { align-self: flex-start; min-height: 34px; padding: 0 8px; margin-left: -8px; font-size: 14.5px; color: var(--text-3); }
@media (max-width: 720px) { .surt-resumen { grid-template-columns: minmax(0, 1fr); } .surt-resumen .kpi:nth-child(n) { border-left: 0; } .surt-resumen .kpi + .kpi { border-top: 1px solid var(--line); } }
