/* Apto Laboral · sistema interno — el archivador de casos con lomos de color */
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/Montserrat-latin-var.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --fondo: #eef6f7;
  --papel: #ffffff;
  --papel-2: #f7fbfb;
  --tinta: #1a2e52;
  --tinta-2: #44587a;
  --tinta-3: #5b6c84;
  --linea: #d6e2e6;
  --linea-2: #e7eef1;
  --accion: #0b7f8a;
  --accion-hondo: #0a6d77;
  --accion-suave: #def2f3;
  --debe: #a8590c;
  --debe-suave: #fdf1df;
  --error: #a63d2a;
  --error-suave: #fbe9e4;
  /* lomos (estados) */
  --plomo: #68737f;   --plomo-suave: #eceff2;
  --amarillo: #f2b33d; --amarillo-tinta: #3d2a00; --amarillo-suave: #fdf3d8;
  --verde: #27804a;   --verde-suave: #e1f2e7;
  --azul: #2f6fc0;    --azul-suave: #e2ecf8;
  --cancelado: #c3cad2; --cancelado-suave: #f1f3f5;
  --radio: 14px;
  --radio-ch: 9px;
  --sombra-hoja: 0 -12px 40px -16px rgba(26, 46, 82, 0.45);
  --sombra-boton: 0 10px 22px -10px rgba(10, 109, 119, 0.75);
  --ease-salida: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-alto: 72px;
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
/* Sin cursor de texto fuera de las casillas: al tocar la pantalla no parece que se pudiera escribir (igual que SubsPro) */
body { caret-color: transparent; }
input, textarea, select, [contenteditable] { caret-color: var(--accion); }
button, .btn, nav, .barra, .lateral, .pestanas, .carpeta, .menu-mas, .aj-menu, .zona-subir, label.check { -webkit-user-select: none; user-select: none; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fondo);
  color: var(--tinta);
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--accion-suave); color: var(--tinta); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accion-hondo); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accion) 55%, white); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- barra de desplazamiento ---------- */
* { scrollbar-width: thin; scrollbar-color: #b9c8ce transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #b9c8ce; border-radius: 10px; border: 3px solid var(--fondo); }

/* ---------- iconos (SVG propios, trazo 2) ---------- */
.ic { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.ch { width: 20px; height: 20px; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--linea);
  background: var(--papel); color: var(--tinta); font-weight: 700; font-size: 15px; cursor: pointer;
  transition: transform 120ms var(--ease-salida), background 160ms, border-color 160ms, box-shadow 160ms;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:hover { border-color: #b8cbd1; }
.btn.prim { background: var(--accion); border-color: var(--accion); color: #fff; }
.btn.prim:hover { background: var(--accion-hondo); border-color: var(--accion-hondo); }
.btn.wsp { background: #e4f5ea; border-color: #c4e6d0; color: #17603a; }
.btn.peligro { color: var(--error); }
.btn.ancho { width: 100%; }
.btn.ch { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.cargando { color: transparent !important; position: relative; pointer-events: none; }
.btn.cargando::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.5); border-top-color: #fff; animation: girar 700ms linear infinite;
}
.btn:not(.prim).cargando::after { border-color: var(--linea); border-top-color: var(--accion); }
@keyframes girar { to { transform: rotate(360deg); } }
.enlace { background: none; border: 0; padding: 6px 2px; color: var(--accion-hondo); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- formularios ---------- */
.campo { display: grid; gap: 6px; margin-bottom: 14px; }
.campo > span { font-size: 14px; font-weight: 700; color: var(--tinta-2); }
.campo small { font-size: 13px; color: var(--tinta-3); font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"],
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="search"], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 11px; border: 1.5px solid var(--linea);
  background: var(--papel); font-size: 16px; font-weight: 500; caret-color: var(--accion);
  transition: border-color 160ms, box-shadow 160ms;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: #66758b; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accion); box-shadow: 0 0 0 3px var(--accion-suave); }
input[aria-invalid="true"] { border-color: var(--error); }
.fila2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.fila2 > * { min-width: 0; }
.fila2 input { min-width: 0; width: 100%; }   /* las fechas no empujan la fila fuera de la pantalla */   /* casillas alineadas aunque un título ocupe 2 líneas */
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--papel-2); border: 1px solid var(--linea-2); font-size: 15px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accion); flex: none; }
.opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.opcion { position: relative; }
.opciones.filas { flex-direction: column; }
.opciones.filas .opcion span { width: 100%; min-height: 48px; padding: 8px 14px; }
.opcion input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opcion span { display: inline-flex; align-items: center; min-height: 42px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--linea); background: var(--papel); font-weight: 700; font-size: 14px; }
.opcion .opcion-dos { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; padding-top: 8px; padding-bottom: 8px; }
.opcion .opcion-sub { font-size: 12.5px; font-weight: 600; color: var(--tinta-3); }
.opcion input:checked + .opcion-dos .opcion-sub { color: var(--accion-hondo); }
.opcion input:checked + span { border-color: var(--accion); background: var(--accion-suave); color: var(--accion-hondo); }
.opcion input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accion) 55%, white); outline-offset: 2px; }
.error-form { color: var(--error); background: var(--error-suave); padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; margin: 0 0 12px; }

/* ---------- marco general ---------- */
.app { min-height: 100dvh; }
.principal { padding: 0 0 calc(var(--nav-alto) + 28px + var(--seguro-abajo)); }
.cabeza { padding: max(18px, env(safe-area-inset-top)) 18px 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.cabeza h1 { font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.cabeza .sub { font-size: 14px; font-weight: 600; color: var(--tinta-2); margin-top: 3px; }
.cabeza .acciones { display: flex; gap: 8px; }
.seccion { padding: 0 16px; margin-top: 22px; }
.seccion > h2 { font-size: 17px; font-weight: 800; margin: 0 2px 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.seccion > h2 .cuenta { font-size: 14px; font-weight: 700; color: var(--tinta-3); }
.seccion-ayuda { margin: -6px 2px 8px; color: var(--tinta-2); font-size: 14px; }
/* «Hoy»: grupos dentro del cajón de las pestañas */
.cajon-ayuda { margin: 6px 6px 2px; font-size: 14px; font-weight: 600; color: var(--tinta-2); }
.grupo-hoy { padding: 2px 2px 4px; }
.grupo-hoy + .grupo-hoy { border-top: 1px solid var(--linea-2); margin-top: 8px; padding-top: 8px; }
.grupo-hoy > h2 { font-size: 15.5px; font-weight: 800; margin: 6px 4px 2px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.grupo-hoy > h2 .cuenta { font-size: 14px; font-weight: 700; color: var(--tinta-3); }
.grupo-hoy .ver-todos { display: block; margin: 2px auto 0; }
.volver-link { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 6px; margin: 0 0 6px -6px; border: 0; border-radius: 10px;
  background: none; color: var(--accion-hondo); font-weight: 700; font-size: 15px; cursor: pointer; }
.volver-link:hover { background: var(--accion-suave); }
.paginas { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px 4px; color: var(--tinta-2); font-size: 14px; }
.paginas span { text-align: center; }
.paginas small { display: block; color: var(--tinta-3); font-weight: 600; font-size: 12.5px; }
.icono-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.icono-btn.peligro { color: var(--error); }
.vacio { text-align: center; padding: 34px 18px; color: var(--tinta-2); font-weight: 600; }
.vacio p { margin: 6px 0 14px; font-weight: 500; }
.aviso-demo { margin: 10px 16px 0; padding: 10px 14px; border-radius: 12px; background: var(--amarillo-suave); color: #5a3d00; font-size: 13.5px; font-weight: 600; display: flex; gap: 10px; align-items: center; justify-content: space-between; }

/* ---------- barra inferior (celular) con el botón + al centro ---------- */
.barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--nav-alto) + var(--seguro-abajo)); padding-bottom: var(--seguro-abajo);
  background: var(--papel); border-top: 1px solid var(--linea);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: start;
}
.barra a, .barra button.mas {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 11px; height: var(--nav-alto);
  font-size: 13px; font-weight: 700; color: var(--tinta-3); text-decoration: none; background: none; border: 0; cursor: pointer; position: relative;
}
.barra a[aria-current="page"] { color: var(--accion-hondo); }
.barra a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accion); }
.barra .insignia { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--amarillo); color: var(--amarillo-tinta); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.boton-mas {
  justify-self: center; margin-top: -24px; width: 64px; height: 64px; border-radius: 50%; border: 4px solid var(--fondo);
  background: var(--accion); color: #fff; display: grid; place-items: center; box-shadow: var(--sombra-boton); cursor: pointer;
  transition: transform 160ms var(--ease-salida), background 160ms;
}
.boton-mas .ic { width: 30px; height: 30px; stroke-width: 2.6; }
.boton-mas:active { transform: scale(0.93); }
.boton-mas:hover { background: var(--accion-hondo); }

/* ---------- menú lateral (PC) ---------- */
.lateral { display: none; }

/* ---------- el archivador ---------- */
.buscar { padding: 4px 16px 0; }
.buscar label { position: relative; display: block; }
.buscar .ic { position: absolute; left: 14px; top: 12px; color: var(--tinta-3); }
.buscar input { padding-left: 46px; background: var(--papel); }
.pestanas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 14px 16px 0; align-items: end; }
.pestanas:not(.con-filtro) { align-items: stretch; }
.pestana {
  border: 0; cursor: pointer; border-radius: 12px 12px 0 0; padding: 8px 4px 9px; text-align: center;
  font-size: 13px; font-weight: 800; line-height: 1.15; color: #fff; min-height: 66px;
  transition: padding 220ms var(--ease-salida), filter 160ms; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
}
.pestana b { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 22px; font-weight: 800; line-height: 1.1; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.pestana b .ic { width: 18px; height: 18px; stroke-width: 2.2; flex: none; }
.pestana[aria-pressed="true"], .pestanas:not(.con-filtro) .pestana { padding-top: 15px; padding-bottom: 12px; }
/* Con una pestaña elegida: las demás quedan lavadas (claramente apagadas) y la elegida sube, a todo color, con una
   raya blanca abajo. Así se distingue también la plomo. */
.pestana[aria-pressed="false"].hay-sel { opacity: 0.38; filter: saturate(0.35); }
.pestana[aria-pressed="true"] { box-shadow: inset 0 -4px 0 rgba(255, 255, 255, 0.92), 0 6px 14px -8px rgba(16, 30, 54, 0.55); z-index: 1; }
.pestana.e-con_especialista[aria-pressed="true"], .pestana.h-sinrespuesta[aria-pressed="true"] { box-shadow: inset 0 -4px 0 rgba(78, 52, 0, 0.55), 0 6px 14px -8px rgba(16, 30, 54, 0.55); }
/* Pestañas de «Hoy» */
.pestana.h-llamar { background: var(--plomo); }
.pestana.h-sinrespuesta { background: var(--amarillo); color: var(--amarillo-tinta); }
.pestana.h-cobrar { background: var(--debe); }
.pestana.h-citas { background: var(--verde); }
.pestana.h-pagar { background: var(--azul); }
.pestanas.cinco { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.pestanas.cinco .pestana { padding-left: 2px; padding-right: 2px; }
@media (max-width: 699px) { .pestanas.cinco .pestana { font-size: 11.5px; } .pestanas.cinco .pestana b { font-size: 19px; gap: 3px; } .pestanas.cinco .pestana b .ic { width: 15px; height: 15px; } }
.total-pagar { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 4px 6px 10px; font-weight: 700; color: var(--tinta-2); }
.total-pagar b { font-size: 18px; color: var(--tinta); }
.por-pagar h3 { display: flex; justify-content: space-between; gap: 10px; }
.por-pagar h3 .num { white-space: nowrap; flex: none; }
.por-pagar h3 > span:first-child { min-width: 0; }
.pestana.e-registrado { background: var(--plomo); }
.pestana.e-con_especialista { background: var(--amarillo); color: var(--amarillo-tinta); }
.pestana.e-aprobado { background: var(--verde); }
.pestana.e-levantado { background: var(--azul); }
.pestana.salta b { animation: salto 420ms var(--ease-salida); }
@keyframes salto { 0% { transform: scale(1); } 35% { transform: scale(1.28); } 100% { transform: scale(1); } }

.cajon { background: var(--papel); margin: 0 16px; border-radius: 0 0 var(--radio) var(--radio); padding: 8px 8px 10px; border: 1px solid var(--linea); border-top: 0; }
.cajon.sin-pestanas { border-radius: var(--radio); border-top: 1px solid var(--linea); }
.cajon-pie { display: flex; justify-content: center; padding: 8px 4px 2px; }
.carpetas { display: grid; grid-template-columns: minmax(0, 1fr); }   /* nunca más ancho que la pantalla (Cobros en celular) */
.carpetas .carpeta { background: var(--papel); border-color: var(--linea); }

.carpeta {
  display: flex; align-items: stretch; width: 100%; margin: 6px 0; text-align: left; cursor: pointer;
  border: 1px solid var(--linea-2); border-radius: 10px; overflow: hidden; background: var(--papel-2);
  text-decoration: none; color: inherit; transition: border-color 160ms, background 160ms, transform 120ms var(--ease-salida);
}
.carpeta:hover { border-color: #c3d4da; background: #fff; }
.carpeta:active { transform: scale(0.99); }
.carpeta[aria-current="true"] { border-color: var(--accion); background: #fff; box-shadow: 0 0 0 2px var(--accion-suave); }
.lomo { width: 32px; flex: none; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lomo span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: #fff; position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.lomo.e-registrado { background: var(--plomo); }
.lomo.e-con_especialista { background: var(--amarillo); }
.lomo.e-con_especialista span { color: var(--amarillo-tinta); }
.lomo.e-aprobado { background: var(--verde); }
.lomo.e-levantado { background: var(--azul); }
.lomo.e-cancelado { background: var(--cancelado); }
.lomo.e-cancelado span { color: #3c4652; }
/* firma: al cambiar de estado, el color nuevo sube por el lomo */
.repinta .lomo::before { content: ""; position: absolute; inset: 0; background: var(--lomo-antes, var(--plomo)); transform-origin: top; animation: barrido 620ms var(--ease-salida) forwards; }
@keyframes barrido { from { transform: scaleY(1); } to { transform: scaleY(0); } }
.carpeta .cuerpo { flex: 1; min-width: 0; padding: 10px 12px 11px; }
.carpeta .nombre { font-size: 16px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.carpeta.cancelada .nombre { text-decoration: line-through 2px var(--cancelado); color: var(--tinta-3); }
.carpeta .dato { font-size: 14px; font-weight: 500; color: var(--tinta-2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carpeta .paso { font-size: 13.5px; font-weight: 700; color: var(--accion-hondo); margin-top: 5px; display: flex; gap: 6px; align-items: center; min-width: 0; }
.carpeta .paso span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carpeta .paso.alerta { color: var(--debe); }
.carpeta .paso.gris { color: var(--tinta-3); }
.carpeta .plata { padding: 10px 12px 10px 4px; text-align: right; font-size: 15px; font-weight: 800; color: var(--tinta-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.carpeta .plata.debe { color: var(--debe); }
.carpeta .plata.ok { color: var(--verde); font-size: 13px; font-weight: 700; }
.carpeta .plata small { display: block; font-size: 12.5px; font-weight: 700; color: var(--tinta-3); }

/* ---------- carpeta abierta (detalle) ---------- */
.detalle { padding-bottom: 20px; }
.tapa { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 14px 14px; color: #fff; }
.tapa.e-registrado { background: var(--plomo); }
.tapa.e-con_especialista { background: var(--amarillo); color: var(--amarillo-tinta); }
.tapa.e-aprobado { background: var(--verde); }
.tapa.e-levantado { background: var(--azul); }
.tapa.e-cancelado { background: var(--cancelado); color: #2f3a46; }
.tapa.repinta::before { content: ""; position: absolute; inset: 0; background: var(--lomo-antes, var(--plomo)); transform-origin: top; animation: barrido 620ms var(--ease-salida) forwards; }
.tapa > * { position: relative; }
.tapa .volver { width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, 0.22); color: inherit; display: grid; place-items: center; cursor: pointer; flex: none; }
.tapa .cod { font-size: 14px; font-weight: 800; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.tapa .est { font-size: 18px; font-weight: 800; line-height: 1.2; }
.tapa .ed { margin-left: auto; }
.tapa .ed .btn { background: rgba(255, 255, 255, 0.92); border-color: transparent; color: var(--tinta); }
.ficha { padding: 16px 18px 4px; }
.ficha h2 { font-size: 23px; font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.ficha .linea-dato { color: var(--tinta-2); font-weight: 600; font-size: 15px; margin-top: 4px; }
.ficha-nombre { display: flex; align-items: flex-start; gap: 10px; }
.ficha-nombre h2 { flex: 1; min-width: 0; }
.icono-btn.lapiz { width: 40px; height: 40px; flex: none; margin-top: -4px; color: var(--tinta-2); }
.icono-btn.lapiz .ic { width: 19px; height: 19px; }
.motivo { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--papel); border: 1px solid var(--linea); font-size: 15px; line-height: 1.5; }
.motivo b { display: block; font-size: 12.5px; font-weight: 800; color: var(--tinta-3); margin-bottom: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: 8px; background: var(--papel); border: 1px solid var(--linea); font-size: 13px; font-weight: 700; color: var(--tinta-2); }
.chip.ambar { background: var(--debe-suave); border-color: #f2d6ac; color: var(--debe); }
.chip.verde { background: var(--verde-suave); border-color: #bfe2cc; color: #1f6b3d; }

.siguiente { margin: 16px 16px 0; padding: 16px; border-radius: var(--radio); background: var(--papel); border: 1.5px solid var(--accion); }
.siguiente .paso-txt { font-size: 19px; font-weight: 800; line-height: 1.3; margin: 0 0 12px; text-wrap: balance; }
.siguiente .acc { display: grid; gap: 8px; }
.siguiente .acc-sec { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.bloque { margin: 14px 16px 0; padding: 14px 16px; border-radius: var(--radio); background: var(--papel); border: 1px solid var(--linea); }
.bloque > h3 { font-size: 15px; font-weight: 800; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fila-dato { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--linea-2); font-size: 15px; }
.fila-dato > span:first-child { min-width: auto; overflow-wrap: normal; }   /* la etiqueta («Médico») no se parte a media palabra */
.fila-dato:first-of-type { border-top: 0; }
.fila-dato > span:first-child { color: var(--tinta-2); font-weight: 600; }
.fila-dato > span:last-child { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.fila-dato.total > span { font-weight: 800; color: var(--tinta); }
.fila-dato.total.debe > span:last-child { color: var(--debe); }

/* recorrido del caso (como el seguimiento de un envío) */
.recorrido { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.recorrido li { position: relative; padding-top: 21px; font-size: 13px; font-weight: 700; color: var(--tinta-3); line-height: 1.25; }
.recorrido .riel { position: absolute; top: 3px; left: 0; right: 0; height: 9px; border-radius: 5px; background: var(--linea-2); overflow: hidden; }
.recorrido li.hecho .riel { background: var(--c); }
.recorrido li.actual { color: var(--tinta); }
.recorrido li.actual .riel { background: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 16%, white), 0 2px 10px -2px color-mix(in srgb, var(--c) 70%, transparent); }
.recorrido li small { display: block; font-weight: 600; font-size: 12.5px; color: var(--tinta-3); margin-top: 2px; }

.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--linea-2); font-size: 15px; }
.lista-simple li:first-child { border-top: 0; }
.lista-simple .crece { flex: 1; min-width: 0; }
.lista-simple .crece b { display: block; font-weight: 700; overflow-wrap: anywhere; }
.lista-simple .crece small { color: var(--tinta-3); font-weight: 600; font-size: 13px; }
.historial li { align-items: flex-start; }
.historial .punto { width: 10px; height: 10px; border-radius: 50%; background: var(--linea); margin-top: 6px; flex: none; }
.historial .punto.estado { background: var(--accion); }
.historial .punto.pago { background: var(--verde); }

/* ---------- filas de dinero / tablas ---------- */
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: left; font-size: 12.5px; font-weight: 800; color: var(--tinta-3); padding: 8px 6px; border-bottom: 1.5px solid var(--linea); white-space: nowrap; }
.tabla td { padding: 10px 6px; border-bottom: 1px solid var(--linea-2); vertical-align: top; }
.tabla td.n, .tabla th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla tfoot td { font-weight: 800; border-bottom: 0; border-top: 1.5px solid var(--linea); }
.envoltura-tabla { overflow-x: auto; margin: 0 -4px; }
.cuadre { margin: 0; padding: 6px 16px 10px; border-radius: var(--radio); background: var(--papel); border: 1px solid var(--linea); }
.cuadre .fila-dato { font-size: 16px; padding: 9px 0; }
.cuadre .fila-dato > span:last-child { font-weight: 800; }
.cuadre .fila-dato.menos > span:last-child { color: var(--debe); }
.cuadre .fila-dato.total { border-top: 3px double var(--tinta-2); margin-top: 4px; padding-top: 12px; }
.cuadre .fila-dato.total > span { font-size: 18px; font-weight: 800; }
.cuadre .fila-dato.total > span:last-child { color: var(--accion-hondo); font-size: 22px; }
.resumen-mes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cifra { padding: 12px 14px; border-radius: 12px; background: var(--papel-2); border: 1px solid var(--linea-2); }
.cifra span { display: block; font-size: 13px; font-weight: 700; color: var(--tinta-2); }
.cifra b { display: block; font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; margin-top: 2px; }
.cifra.final { grid-column: 1 / -1; background: var(--accion-suave); border-color: #bfe3e6; }
.cifra.final b { font-size: 26px; color: var(--accion-hondo); }
.cifra.debe b { color: var(--debe); }
.barras { display: grid; gap: 8px; }
.barra-h { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 38px; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.barra-h .pista { height: 12px; border-radius: 6px; background: var(--linea-2); overflow: hidden; }
.barra-h .pista i { display: block; height: 100%; border-radius: 6px; background: var(--accion); transform-origin: left; animation: crecer 700ms var(--ease-salida) both; }
.barra-h b { text-align: right; font-variant-numeric: tabular-nums; }
@keyframes crecer { from { transform: scaleX(0); } }
.mes-sel { display: flex; align-items: center; gap: 6px; }
.mes-sel b { min-width: 132px; text-align: center; font-size: 15px; font-weight: 800; }
.mes-sel select { width: auto; min-width: 136px; }
.cabeza { flex-wrap: wrap; }
.reparto { margin-top: 10px; padding-top: 4px; border-top: 1.5px dashed var(--linea); }
@media (max-width: 699px) {
  .tabla.apilada thead { display: none; }
  .tabla.apilada, .tabla.apilada tbody, .tabla.apilada tfoot { display: block; }
  .tabla.apilada tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; padding: 10px 0; border-bottom: 1px solid var(--linea-2); }
  .tabla.apilada td { display: flex; justify-content: space-between; gap: 8px; border: 0; padding: 2px 0; }
  .tabla.apilada td:first-child { grid-column: 1 / -1; display: block; font-weight: 700; padding-bottom: 4px; }
  .tabla.apilada td[data-label]::before { content: attr(data-label); color: var(--tinta-3); font-weight: 600; font-size: 12.5px; }
  .tabla.apilada tfoot tr { border-bottom: 0; border-top: 1.5px solid var(--linea); }
  .tabla.apilada tfoot td { border-top: 0; }
}
.icono-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--linea); background: var(--papel); display: grid; place-items: center; cursor: pointer; color: var(--tinta); }
.icono-btn:hover { border-color: #b8cbd1; }

/* ---------- menú «Más» ---------- */
.menu-mas { display: grid; gap: 8px; padding: 0 16px; }
.menu-mas a, .menu-mas button { display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 0 16px; border-radius: 14px; background: var(--papel); border: 1px solid var(--linea); font-weight: 700; font-size: 16px; text-decoration: none; color: var(--tinta); cursor: pointer; width: 100%; }
.menu-mas .ic { color: var(--accion-hondo); }
.menu-mas small { margin-left: auto; color: var(--tinta-3); font-weight: 600; font-size: 13px; }
/* Opciones con título y explicación (Nuevo caso): ícono a la izquierda y el texto alineado a su lado */
.menu-mas .opcion-nuevo { min-height: 72px; padding: 12px 16px; text-align: left; }
.menu-mas .opcion-nuevo .ic { width: 26px; height: 26px; flex: none; }
.menu-mas .opcion-nuevo > span { display: grid; gap: 2px; flex: 1; min-width: 0; }
.menu-mas .opcion-nuevo small { margin: 0; font-size: 13.5px; line-height: 1.35; }
.logo-mas { display: block; width: 210px; height: auto; margin: max(18px, env(safe-area-inset-top)) 18px 0; }

/* ---------- Ajustes por secciones (como SubsPro): en el celular, primero la lista y luego la sección;
   en PC, la lista a la izquierda y la sección a la derecha ---------- */
.aj-lista { display: grid; gap: 8px; padding: 0 16px; }
.aj-lista a { display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 10px 16px; border-radius: 14px; background: var(--papel); border: 1px solid var(--linea); color: var(--tinta); text-decoration: none; }
.aj-lista a .ic { width: 24px; height: 24px; flex: none; color: var(--accion-hondo); }
.aj-lista a > span { display: grid; gap: 1px; flex: 1; min-width: 0; }
.aj-lista a b { font-size: 16px; font-weight: 700; }
.aj-lista a small { font-size: 13px; font-weight: 600; color: var(--tinta-3); }
.aj-lista a .flecha { width: 18px; height: 18px; color: var(--tinta-3); }
.aj-nav { display: none; }
.aj-sec .bloque > p.linea-dato:first-child { margin-top: 0; }
.aj-fila { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--linea-2); }
.aj-fila:first-of-type, .bloque > h3 + .aj-fila { border-top: 0; }
.aj-fila-t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.aj-fila-t b { font-size: 15px; font-weight: 700; }
.aj-fila-t small { font-size: 13px; font-weight: 600; color: var(--tinta-3); }
.aj-fila-d { flex: none; max-width: 58%; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.aj-estado { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.aj-estado::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.aj-estado.ok { color: var(--verde); }
.aj-estado.alerta { color: var(--amarillo-tinta); }
.aj-estado.mal { color: var(--error); }
.aj-estado.gris { color: var(--tinta-3); }
.aj-cifra { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.aj-acciones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.lista-descuentos { display: grid; gap: 8px; margin-bottom: 10px; }
.fila-descuento { display: grid; grid-template-columns: minmax(0, 1fr) 80px 44px; gap: 8px; align-items: center; }
.solo-ver .fila-descuento { grid-template-columns: minmax(0, 1fr) 80px; }
.fila-descuento .pct { position: relative; }
.fila-descuento .pct input { padding-right: 30px; text-align: right; }
.fila-descuento .pct span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--tinta-3); font-weight: 700; pointer-events: none; }

/* ---------- hojas (diálogos) ---------- */
dialog.hoja {
  border: 0; padding: 0; margin: 0; max-width: none; width: 100%; max-height: 92dvh;
  position: fixed; inset: auto 0 0 0; border-radius: 22px 22px 0 0; background: var(--papel); color: var(--tinta);
  box-shadow: var(--sombra-hoja); overflow: hidden; display: flex; flex-direction: column;
}
dialog.hoja:not([open]) { display: none; }
dialog.hoja[open] { animation: subir 440ms var(--ease-mg); }
dialog.hoja::backdrop { background: rgba(16, 30, 54, 0.42); animation: aparecer 240ms ease-out; }
@keyframes subir { from { transform: translateY(100%); } }
@keyframes aparecer { from { opacity: 0; } }
.hoja-cab { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--linea-2); }
.hoja-cab::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--linea); }
.hoja-cab h2 { font-size: 18px; font-weight: 800; margin: 8px 0 0; flex: 1; line-height: 1.25; }
.hoja-cab .cerrar { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--papel-2); display: grid; place-items: center; cursor: pointer; color: var(--tinta-2); margin-top: 6px; }
.hoja-cuerpo { padding: 16px 20px 8px; overflow-y: auto; overscroll-behavior: contain; }
.hoja-pie { padding: 12px 20px calc(14px + var(--seguro-abajo)); border-top: 1px solid var(--linea-2); display: flex; gap: 10px; background: var(--papel); }
.hoja-pie .btn { flex: 1; }
.pasos-envio { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pasos-envio li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.pasos-envio .nro { width: 30px; height: 30px; border-radius: 50%; background: var(--accion-suave); color: var(--accion-hondo); font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.pasos-envio li.listo .nro { background: var(--verde); color: #fff; }
.previa-msg { white-space: pre-wrap; font-size: 14px; background: var(--papel-2); border: 1px dashed var(--linea); border-radius: 10px; padding: 10px 12px; margin: 6px 0 8px; color: var(--tinta-2); }

/* lectura de hoja */
.subida { display: grid; gap: 10px; }
.zona-subir { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; border: 2px dashed #b7cdd3; background: var(--papel-2); cursor: pointer; font-weight: 700; }
.zona-subir:hover { border-color: var(--accion); }
.zona-subir .ic { width: 30px; height: 30px; color: var(--accion-hondo); }
.zona-subir small { display: block; font-weight: 500; color: var(--tinta-3); font-size: 13px; }
.leyendo { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 12px; background: var(--accion-suave); font-weight: 700; color: var(--accion-hondo); }
.leyendo .rueda { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #b9e1e4; border-top-color: var(--accion); animation: girar 800ms linear infinite; flex: none; }
.interconsulta { border: 1px solid var(--linea); border-radius: 14px; padding: 14px 14px 2px; margin-bottom: 12px; background: var(--papel); }
.interconsulta > h3 { font-size: 15px; font-weight: 800; margin: 0 0 10px; display: flex; justify-content: space-between; }
.nota-ia { font-size: 13px; font-weight: 600; color: var(--tinta-2); background: var(--amarillo-suave); padding: 8px 10px; border-radius: 9px; margin: 0 0 12px; }

/* ---------- avisos ---------- */
.avisos { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-alto) + 16px + var(--seguro-abajo)); z-index: 60; display: grid; gap: 8px; pointer-events: none; }
.aviso { pointer-events: auto; justify-self: center; max-width: 520px; width: 100%; background: var(--tinta); color: #fff; border-radius: 12px; padding: 12px 16px; font-weight: 600; font-size: 15px; box-shadow: 0 14px 30px -14px rgba(16, 30, 54, 0.6); animation: subir-aviso 320ms var(--ease-salida); display: flex; align-items: center; gap: 10px; }
.aviso.error { background: var(--error); }
@keyframes subir-aviso { from { transform: translateY(16px); opacity: 0; } }

/* ---------- acceso ---------- */
.acceso { min-height: 100dvh; display: grid; place-items: center; padding: 24px 18px; }
.acceso-caja { width: 100%; max-width: 400px; }
.acceso-caja .logo { width: 220px; margin: 0 auto 26px; }
/* El check verde del logo brilla: un destello que lo recorre y un halo suave (recortado a la forma del check) */
.logo-brilla { position: relative; width: 220px; margin: 0 auto 26px; }
.acceso-caja .logo-brilla .logo { margin: 0; display: block; }
.logo-brilla .check-logo, .logo-brilla .destello { position: absolute; inset: 0; pointer-events: none; }
.logo-brilla .check-logo { width: 100%; height: auto; animation: halo-check 3.6s ease-in-out infinite; }
.logo-brilla .destello {
  -webkit-mask: url(../img/logo-check.png) center / 100% 100% no-repeat; mask: url(../img/logo-check.png) center / 100% 100% no-repeat;
  background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, 0.95) 50%, transparent 62%) no-repeat;
  background-size: 260% 100%; background-position: 130% 0; animation: destello-check 3.6s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}
@keyframes destello-check { 0%, 38% { background-position: 130% 0; } 72%, 100% { background-position: -30% 0; } }
@keyframes halo-check {
  0%, 30%, 100% { filter: drop-shadow(0 0 0 rgba(54, 168, 98, 0)); }
  58% { filter: drop-shadow(0 0 7px rgba(54, 168, 98, 0.75)) drop-shadow(0 0 16px rgba(54, 168, 98, 0.35)); }
}
.acceso-caja form { background: var(--papel); border: 1px solid var(--linea); border-radius: 18px; padding: 22px 20px 8px; }
.acceso-caja h1 { font-size: 20px; font-weight: 800; margin: 0 0 16px; }
.acceso-pie { text-align: center; font-size: 13px; color: var(--tinta-3); margin-top: 18px; font-weight: 600; }
.acceso-pie a { color: var(--tinta-2); }
.roles-demo { display: grid; gap: 8px; margin-top: 14px; }

/* ---------- inactividad ---------- */
dialog.pausa { border: 0; padding: 20px; margin: 0; width: 100%; height: 100%; max-width: none; max-height: none; background: transparent; place-items: center; }
dialog.pausa[open] { display: grid; }
dialog.pausa::backdrop { background: rgba(238, 246, 247, 0.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.pausa-caja { background: var(--papel); border: 1px solid var(--linea); border-radius: 18px; padding: 24px 22px; max-width: 360px; width: 100%; text-align: center; box-shadow: 0 20px 50px -24px rgba(16, 30, 54, 0.5); }
.pausa-caja h2 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.pausa-caja p { margin: 0 0 16px; color: var(--tinta-2); }

/* ---------- PC: menú lateral, archivador al centro y carpeta abierta a la derecha ---------- */
@media (min-width: 1024px) {
  .solo-movil { display: none !important; }
  .barra { display: none; }
  .app { display: grid; grid-template-columns: 252px 1fr; }
  .lateral {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; padding: 24px 14px 18px; overflow-y: auto;
    background: var(--papel); border-right: 1px solid var(--linea);
  }
  .lateral .logo { width: 214px; margin: 2px 6px 24px; }
  .aj { display: grid; grid-template-columns: 236px minmax(0, 760px); gap: 26px; padding: 0 28px; align-items: start; }
  .aj-lista { display: none; }
  .aj-nav { display: grid; gap: 2px; position: sticky; top: 16px; }
  .aj-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 11px; color: var(--tinta-2); font-weight: 700; text-decoration: none; font-size: 15px; }
  .aj-nav a .ic { width: 20px; height: 20px; }
  .aj-nav a:hover { background: var(--papel-2); color: var(--tinta); }
  .aj-nav a[aria-current="page"] { background: var(--accion-suave); color: var(--accion-hondo); }
  .aj .bloque { margin: 0 0 14px; }
  .aj-sec > .cabeza { display: none; }
  .lateral .nuevo { margin: 0 4px 18px; min-height: 52px; font-size: 16px; }
  .lateral nav { display: grid; gap: 2px; }
  .lateral nav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 11px; color: var(--tinta-2); font-weight: 700; text-decoration: none; font-size: 15px; }
  .lateral nav a:hover { background: var(--papel-2); color: var(--tinta); }
  .lateral nav a[aria-current="page"] { background: var(--accion-suave); color: var(--accion-hondo); }
  .lateral nav a .insignia { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--amarillo); color: var(--amarillo-tinta); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
  .lateral .usuario { margin-top: auto; padding: 12px; border-radius: 12px; background: var(--papel-2); font-size: 14px; }
  .lateral .usuario b { display: block; }
  .lateral .usuario small { color: var(--tinta-3); font-weight: 600; }
  .lateral .credito { font-size: 12px; color: var(--tinta-3); margin: 12px 12px 0; font-weight: 600; }
  .lateral .credito a { color: var(--tinta-3); }
  .principal { padding: 10px 0 40px; min-width: 0; }
  .cabeza { padding: 18px 28px 12px; }
  .cabeza h1 { font-size: 30px; }
  .seccion { padding: 0 28px; }
  .buscar { padding: 4px 28px 0; }
  .pestanas { padding: 16px 28px 0; }
  .cajon { margin: 0 28px; }
  .aviso-demo { margin: 10px 28px 0; }
  .menu-mas { padding: 0 28px; max-width: 720px; }
  .avisos { bottom: 24px; left: 276px; }
  .dos-paneles { display: grid; grid-template-columns: minmax(380px, 470px) 1fr; align-items: start; }
  .dos-paneles > .panel-detalle { position: sticky; top: 0; height: 100dvh; overflow-y: auto; border-left: 1px solid var(--linea); background: var(--fondo); }
  .dos-paneles .cajon, .dos-paneles .pestanas, .dos-paneles .buscar { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .dos-paneles > div:first-child { padding: 0 20px 0 28px; }
  .dos-paneles > div:first-child .cabeza { padding-left: 0; padding-right: 0; }
  .dos-paneles > div:first-child .aviso-demo { margin-left: 0; margin-right: 0; }
  .panel-vacio { height: 100%; display: grid; place-items: center; color: var(--tinta-3); font-weight: 600; text-align: center; padding: 40px; }
  .panel-vacio .lomos-deco { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
  .panel-vacio .lomos-deco i { width: 18px; height: 74px; border-radius: 4px; }
  .detalle .tapa .volver { display: none; }
  .detalle .tapa { padding-top: 18px; }
  .ancho-lectura { max-width: 860px; }
  dialog.hoja { inset: 0; margin: auto; width: min(600px, calc(100vw - 48px)); max-height: min(86dvh, 860px); border-radius: 20px; height: fit-content; }
  dialog.hoja[open] { animation: aparecer-dlg 380ms var(--ease-mg); }
  .hoja-cab::before { display: none; }
  .hoja-cab h2 { margin-top: 0; }
  .hoja-cab .cerrar { margin-top: 0; }
  .pestana { font-size: 14px; }
  .cuadre { max-width: 620px; }
}
@keyframes aparecer-dlg { from { opacity: 0; transform: translateY(14px) scale(0.98); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ---------- nada se sale de su cuadro (correos y nombres largos) ---------- */
.bloque, .aj-fila-t, .aj-fila-d, .fila-dato > span, .cabeza .sub, .lista-simple .crece, .carpeta .nombre { overflow-wrap: anywhere; min-width: 0; }
.aj-fila-d { flex: 0 1 auto; }

/* ---------- etiquetas (especialidades): como las de YouTube ---------- */
.etiquetas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 52px; padding: 8px; border: 1.5px solid var(--linea); border-radius: 11px; background: var(--papel); cursor: text; }
.etiquetas:focus-within { border-color: var(--accion); box-shadow: 0 0 0 3px var(--accion-suave); }
.etiqueta { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--accion-suave); color: var(--accion-hondo); font-size: 14px; font-weight: 700; animation: aparecer 180ms ease-out; }
.etiqueta span { overflow-wrap: anywhere; }
.etiqueta button { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.etiqueta button:hover { background: rgba(14, 137, 149, 0.16); }
.etiqueta button .ic { width: 15px; height: 15px; }
.etiquetas input[type="text"] { flex: 1 1 150px; min-width: 120px; min-height: 36px; padding: 4px 6px; border: 0; box-shadow: none; background: transparent; }
.etiquetas input[type="text"]:focus { box-shadow: none; }

/* ---------- Finanzas: pestañas internas y cifras ---------- */
.segmento { display: flex; gap: 4px; margin: 14px 16px 0; padding: 4px; border: 1px solid var(--linea); border-radius: 13px; background: var(--papel-2); overflow-x: auto; scrollbar-width: none; }
.segmento button { flex: 1 0 auto; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--tinta-2); font-weight: 700; font-size: 14.5px; white-space: nowrap; cursor: pointer; }
.segmento button[aria-pressed="true"] { background: var(--papel); color: var(--tinta); box-shadow: 0 1px 4px rgba(16, 30, 54, 0.16); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kpi { padding: 12px 14px; border: 1px solid var(--linea); border-radius: var(--radio); background: var(--papel); min-width: 0; }
.kpi small { display: block; font-size: 13px; font-weight: 700; color: var(--tinta-2); }
.kpi b { display: block; margin-top: 2px; font-size: 21px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi em { display: block; font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--tinta-3); margin-top: 2px; }
.kpi.bien b { color: var(--verde); }
.kpi.mal b { color: var(--debe); }
.kpi.fuerte { background: var(--accion-suave); border-color: transparent; }
.kpi.fuerte b { color: var(--accion-hondo); }
.barra-celda { display: block; height: 6px; margin-top: 5px; border-radius: 3px; background: var(--accion); opacity: 0.75; }
.barra-celda.neg { background: var(--debe); }
@media (min-width: 1024px) {
  .segmento { margin: 14px 28px 0; max-width: 760px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.tabla tr.fila-actual td { font-weight: 800; }
.bloque > h3 + .envoltura-tabla, .bloque > p + .envoltura-tabla { margin-top: 2px; }
.tabla td, .tabla th { overflow-wrap: normal; word-break: normal; }   /* en tablas las palabras no se parten */
.tabla td:first-child { overflow-wrap: break-word; }
/* pestañas de Finanzas: si no entran, se deslizan; un degradado avisa que hay más */
.segmento { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.segmento.al-final { -webkit-mask-image: none; mask-image: none; }
@media (min-width: 1024px) { .segmento { -webkit-mask-image: none; mask-image: none; } }
@media (max-width: 1023px) { .tabla.apilada tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .tabla.apilada td { min-width: 0; } .tabla.apilada td[data-label]::before { white-space: nowrap; } }

/* ---------- guía para el ojo: cosas que «cargan» (solo transform/opacity: livianas para el celular) ---------- */
/* recorrido: un brillo recorre el paso en curso (con el color de su estado)… */
.recorrido li.en-curso .riel i { position: absolute; top: 0; bottom: 0; left: 0; width: 50%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent); transform: translateX(-100%); animation: brillo 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
/* …y sigue, suave, por el paso siguiente: «quiere ir a consulta» */
.recorrido li.proximo .riel i { position: absolute; top: 0; bottom: 0; left: 0; width: 55%; border-radius: 5px; background: linear-gradient(90deg, color-mix(in srgb, var(--c-sig) 55%, transparent), transparent); transform: translateX(-100%); opacity: 0; animation: hacia 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
@keyframes brillo { 0% { transform: translateX(-100%); } 55%, 100% { transform: translateX(200%); } }
@keyframes hacia { 0%, 42% { transform: translateX(-100%); opacity: 0; } 55% { opacity: 1; } 95%, 100% { transform: translateX(140%); opacity: 0; } }
.recorrido li.actual { font-weight: 800; }

/* mandar al especialista: 1 → 2 → 3 conectados */
.pasos-envio { gap: 0; }
.pasos-envio li { position: relative; padding-bottom: 18px; }
.pasos-envio li:last-child { padding-bottom: 0; }
.pasos-envio .conector { position: absolute; left: 13px; top: 36px; bottom: 4px; width: 4px; border-radius: 2px; background: var(--linea-2); overflow: hidden; }
.pasos-envio .conector i { position: absolute; inset: 0; border-radius: 2px; background: var(--accion); transform-origin: top; transform: scaleY(0); }
.pasos-envio li.actual .conector i { animation: bajar 1.6s cubic-bezier(0.45, 0, 0.25, 1) infinite; }
.pasos-envio li.pasado .conector i { transform: scaleY(1); background: var(--verde); transition: transform 500ms var(--ease-salida); }
@keyframes bajar { 0% { transform: scaleY(0); opacity: 1; } 65% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.pasos-envio .nro { position: relative; z-index: 1; transition: background 200ms, color 200ms; }
.pasos-envio .nro .ok { display: none; width: 17px; height: 17px; stroke-width: 2.8; }
.pasos-envio li.actual .nro { background: var(--accion); color: #fff; }
.pasos-envio li.actual .nro::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--accion); animation: halo-nro 1.6s ease-out infinite; }
@keyframes halo-nro { from { transform: scale(0.8); opacity: 0.9; } to { transform: scale(1.3); opacity: 0; } }
.pasos-envio li.listo .nro { background: var(--verde); color: #fff; }
.pasos-envio li.listo .nro .n { display: none; }
.pasos-envio li.listo .nro .ok { display: block; }
.btn.llama { position: relative; }
.btn.llama::after { content: ""; position: absolute; inset: -4px; border-radius: 15px; border: 3px solid var(--accion); pointer-events: none; animation: halo-btn 1.6s ease-out infinite; }
@keyframes halo-btn { from { transform: scale(1); opacity: 0.85; } to { transform: scale(1.05, 1.22); opacity: 0; } }

/* zona para subir archivos (reemplaza al «Seleccionar archivo» del navegador) */
.za { margin: 0 0 14px; }
.za-aviso { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-weight: 800; font-size: 15px; color: var(--amarillo-tinta); }
.za-aviso .ic { width: 22px; height: 22px; stroke-width: 2.6; color: #b07a10; flex: none; animation: rebote 1.1s ease-in-out infinite; }
@keyframes rebote { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(4px); } }
.zona-archivo { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 14px 16px; border-radius: 14px; border: 2px dashed #b7cdd3; background: var(--papel-2); cursor: pointer; overflow: hidden; transition: background 200ms, border-color 200ms; }
.zona-archivo:hover { border-color: var(--accion); }
.zona-archivo:focus-within { box-shadow: 0 0 0 3px var(--accion-suave); }
.za-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accion-suave); color: var(--accion-hondo); transition: background 200ms, color 200ms; }
.za-ic .ic { width: 24px; height: 24px; stroke-width: 2.2; }
.za-ic .i-check { display: none; }
.za-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.za-txt b { font-size: 16.5px; font-weight: 800; line-height: 1.25; color: var(--tinta); }
.za-txt small { font-size: 13.5px; font-weight: 600; color: var(--tinta-3); overflow-wrap: anywhere; }
.za-btn { flex: none; padding: 9px 13px; border-radius: 10px; background: var(--accion); color: #fff; font-weight: 800; font-size: 14px; }
.zona-archivo.pendiente { border-color: var(--amarillo); background: var(--amarillo-suave); }
.zona-archivo.pendiente .za-ic { background: var(--amarillo); color: var(--amarillo-tinta); }
.zona-archivo.pendiente .za-btn { background: var(--amarillo); color: var(--amarillo-tinta); }
.za-carga { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; overflow: hidden; background: color-mix(in srgb, var(--amarillo) 45%, white); }
.za-carga i { position: absolute; top: 0; bottom: 0; left: 0; width: 45%; background: linear-gradient(90deg, transparent, var(--amarillo), transparent); transform: translateX(-100%); animation: brillo 1.9s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
.zona-archivo.listo { border-style: solid; border-color: var(--verde); background: var(--verde-suave); }
.zona-archivo.listo .za-ic { background: var(--verde); color: #fff; }
.zona-archivo.listo .i-subir { display: none; }
.zona-archivo.listo .i-check { display: block; }
.zona-archivo.listo .za-btn { background: transparent; color: var(--verde); box-shadow: inset 0 0 0 1.5px var(--verde); }
.zona-archivo.listo .za-carga { background: var(--verde); }
.zona-archivo.listo .za-carga i { display: none; }

/* ---------- nuevo caso: «o» y registrar a mano ---------- */
.o-separador { display: flex; align-items: center; gap: 10px; color: var(--tinta-3); font-weight: 700; font-size: 14px; margin: 2px 0; }
.o-separador::before, .o-separador::after { content: ""; flex: 1; height: 1px; background: var(--linea); }
.zona-subir.a-mano { width: 100%; text-align: left; font: inherit; font-weight: 700; color: inherit; border-style: solid; background: var(--papel); }
.agregar-ic { width: 100%; margin: -2px 0 14px; border-style: dashed; }
.interconsulta > h3 { align-items: baseline; gap: 10px; }
.interconsulta > h3 .ic-titulo { flex: 1; }
.nota-campo { margin: -6px 0 14px; font-size: 13.5px; font-weight: 600; color: var(--tinta-3); }

/* ---------- otras observaciones del mismo paciente ---------- */
.otras-obs { margin: 12px 0 6px; padding: 10px 14px 4px; border: 1px solid var(--linea); border-radius: 12px; background: var(--papel); }
.otras-obs > b { display: block; font-size: 14px; font-weight: 800; color: var(--tinta-2); margin-bottom: 4px; }
.otras-obs .obs { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--linea-2); color: inherit; text-decoration: none; }
.otras-obs .obs i { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.otras-obs .obs span { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; }
.otras-obs .obs small { flex: none; font-size: 13px; font-weight: 700; color: var(--tinta-3); }

/* ---------- paquetes (Ajustes → Precios) ---------- */
.lista-paquetes { display: grid; gap: 10px; margin-bottom: 10px; }
.lista-paquetes:empty::before { content: "Aún no hay paquetes."; color: var(--tinta-3); font-weight: 600; font-size: 14.5px; }
.fila-paquete { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 8px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--linea-2); }
.fila-paquete > input[type="text"] { grid-column: 1 / 3; }
.solo-ver .fila-paquete > input[type="text"] { grid-column: 1 / -1; }
.fila-paquete .sufijo, .fila-paquete .prefijo { position: relative; display: block; min-width: 0; }
.fila-paquete .sufijo { grid-column: 1; }
.fila-paquete .prefijo { grid-column: 2; }
.fila-paquete .sufijo input { padding-right: 96px; text-align: right; }
.fila-paquete .prefijo input { padding-left: 42px; }
.fila-paquete .sufijo span, .fila-paquete .prefijo span { position: absolute; top: 50%; transform: translateY(-50%); color: var(--tinta-3); font-weight: 700; pointer-events: none; }
.fila-paquete .sufijo span { right: 12px; }
.fila-paquete .prefijo span { left: 14px; }
.error-txt { color: var(--error); font-weight: 700; }

/* ---------- charlas a empresas ---------- */
.carpeta-charla { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.carpeta-charla .paso .ic { width: 15px; height: 15px; }
.estado-charla { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15px; }
.estado-charla i.lomo { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.acciones-charla { display: grid; gap: 8px; margin-top: 4px; }
.tema-charla h3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tema-charla h3 > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.tema-acc { display: flex; gap: 6px; flex: none; }
.tema-acc .icono-btn { width: 38px; height: 38px; }
.plegable > summary { cursor: pointer; font-weight: 800; font-size: 15px; color: var(--tinta-2); padding: 6px 2px 10px; }

/* ---------- costos del caso (anteojos, test, comisión) ---------- */
.con-accion { display: inline-flex; align-items: center; gap: 6px; }
.icono-btn.mini { width: 30px; height: 30px; border-radius: 9px; color: var(--tinta-3); }
.icono-btn.mini .ic { width: 15px; height: 15px; }
.enlace.agregar-costo { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 14px; text-decoration: none; }

/* ---------- Finanzas › Gastos ---------- */
.gasto-grupo { margin: 0 0 12px; }
.gasto-grupo > h3 { margin-bottom: 4px; }
.gasto-grupo .lista-simple li small { overflow-wrap: anywhere; }
.acciones-gasto { display: flex; gap: 8px; flex-wrap: wrap; }
.cuadre .fila-dato > span:last-child, .gasto-grupo > h3 .num, .lista-simple li > b.num { white-space: nowrap; flex: none; }
.gasto-grupo > h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.gasto-grupo > h3 > span:first-child { min-width: 0; }

/* ---------- recibo del levantamiento (vista previa + impresión) ---------- */
.acciones-recibo { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--linea); }
.recibo-previa { border: 1px solid var(--linea); border-radius: 14px; padding: 18px 16px; background: #fff; color: #1b2b33; }
.recibo { font-size: 14px; line-height: 1.45; color: #1b2b33; }
.recibo-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 2px solid #1b2b33; }
.recibo-cab img { width: 170px; height: auto; }
.recibo-emp { display: grid; gap: 1px; text-align: right; font-size: 12.5px; }
.recibo-emp b { font-size: 13.5px; }
.recibo h1 { font-size: 17px; margin: 14px 0 10px; letter-spacing: 0; }
.recibo-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; margin-bottom: 14px; }
.recibo-datos span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: #5b6b73; }
.recibo-datos b { overflow-wrap: anywhere; }
.recibo-tabla { width: 100%; border-collapse: collapse; }
.recibo-tabla th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: #5b6b73; border-bottom: 1px solid #c9d4d8; padding: 6px 4px; }
.recibo-tabla td { padding: 8px 4px; border-bottom: 1px solid #e3e9eb; vertical-align: top; }
.recibo-tabla td small { display: block; color: #5b6b73; }
.recibo-tabla .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.recibo-tabla tfoot td { border-bottom: 0; padding-top: 6px; font-weight: 700; }
.recibo-tabla tfoot tr:first-child td { border-top: 2px solid #1b2b33; padding-top: 10px; }
.recibo-tabla tfoot .debe td { color: #a4431b; }
.recibo-firma { margin: 46px 0 0 auto; width: 210px; border-top: 1px solid #1b2b33; text-align: center; padding-top: 4px; font-size: 12.5px; color: #5b6b73; }
.recibo-nota { margin: 18px 0 0; font-size: 11.5px; color: #5b6b73; }
#zona-impresion { display: none; }
@media print {
  @page { size: A5 portrait; margin: 12mm; }
  body.imprimiendo { background: #fff !important; }
  body.imprimiendo > *:not(#zona-impresion) { display: none !important; }
  body.imprimiendo #zona-impresion { display: block; }
  #zona-impresion .recibo { font-size: 11.5pt; }
}
.con-accion { white-space: nowrap; flex: none; }
.reparto .fila-dato > span:first-child { min-width: 0; }
.enlace.agregar-costo { width: auto; justify-content: flex-start; text-align: left; padding-left: 0; }

/* ---------- 26/11 (tanda 7): boleta por pago, casilla de consultorio, personal, completar datos ---------- */
.chip-btn { cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; }
.chip-btn:hover { filter: brightness(0.97); }
.fila-dato .boleta-num { display: block; margin-top: 2px; font-size: 13px; color: var(--tinta-2); font-weight: 700; }
.fila-dato .enlace.boleta-btn { display: block; padding: 2px 0 0; font-size: 13px; text-align: left; width: auto; }
.caja-consultorio { display: grid; gap: 10px; margin-bottom: 14px; }
.caja-consultorio > .campo { margin: 0; }
.ayuda-casilla { display: block; margin: 6px 2px 14px; color: var(--tinta-3); font-size: 13px; }
.lista-personal { display: grid; gap: 10px; margin-bottom: 10px; }
.lista-personal:empty::before { content: "Aún no hay personal."; color: var(--tinta-3); font-weight: 600; font-size: 14.5px; }
.fila-persona { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr) 44px; gap: 8px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--linea-2); }
.fila-persona > input:first-child { grid-column: 1 / 3; }
.solo-ver .fila-persona > input:first-child { grid-column: 1 / -1; }
.fila-persona > input:nth-child(2) { grid-column: 1; }
.fila-persona .prefijo { grid-column: 2 / 4; position: relative; display: block; min-width: 0; }
.fila-persona .prefijo input { padding-left: 42px; }
.fila-persona .prefijo span { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); color: var(--tinta-3); font-weight: 700; pointer-events: none; }
.fila-persona > .icono-btn { grid-column: 3; grid-row: 1; }

/* ---------- 27/11 (tanda 8): entradas suaves tipo motion graphics (lento al empezar, lento al terminar) ---------- */
:root { --ease-mg: cubic-bezier(0.65, 0, 0.35, 1); }
.entra { animation: entra-mg 640ms var(--ease-mg) both; animation-delay: calc(var(--i, 0) * 48ms); }
@keyframes entra-mg { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.entrando .barra-h .pista i, .entrando .barra-celda { animation: crecer 900ms var(--ease-mg) 260ms both; transform-origin: left; }
.acceso-caja { animation: entra-mg 720ms var(--ease-mg) both; }
.hoja-entra > * { animation: entra-mg 460ms var(--ease-mg) both; }
.hoja-entra > :nth-child(2) { animation-delay: 45ms; }
.hoja-entra > :nth-child(3) { animation-delay: 90ms; }
.hoja-entra > :nth-child(4) { animation-delay: 135ms; }
.hoja-entra > :nth-child(n+5) { animation-delay: 180ms; }

/* ---------- montos tocables: cada cifra muestra de qué está hecha ---------- */
.fila-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fila-btn.solo { display: block; flex: 1; }
.fila-btn.solo b { display: block; }
.fila-btn .flecha { flex: none; width: 18px; height: 18px; color: var(--tinta-3); }
.fila-btn:hover .crece b, .fila-btn.solo:hover b { text-decoration: underline; text-underline-offset: 3px; }
.fila-btn:focus-visible { outline: 2px solid var(--accion); outline-offset: 3px; border-radius: 6px; }
.lista-montos .crece small, .fila-btn .crece small { display: block; }
.lista-montos .num.rojo, .num.rojo { color: var(--debe); }
.monto-lado { display: flex; flex-direction: column; align-items: flex-end; flex: none; text-align: right; }
.monto-lado small { font-size: 12px; font-weight: 700; color: var(--tinta-3); }
.monto-lado small.ok { color: var(--verde); }
.monto-lado small.debe { color: var(--debe); }
button.fila-dato { width: 100%; margin: 0; background: none; border-left: 0; border-right: 0; border-bottom: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cuadre button.fila-dato:first-of-type { border-top: 0; }
.fila-clic > span:last-child::after { content: "›"; margin-left: 8px; color: var(--tinta-3); font-weight: 800; }
button.fila-dato:hover > span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.tabla tr.fila-clic { cursor: pointer; }
.tabla tr.fila-clic:hover td, .tabla tr.fila-clic:focus-visible td { background: var(--papel-2); }
.tabla tr.fila-clic:focus-visible { outline: 2px solid var(--accion); outline-offset: -2px; }
button.kpi { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.kpi-btn small::after { content: " ›"; color: var(--tinta-3); }
.kpi-btn:hover { border-color: var(--accion); }
.kpi-btn:focus-visible { outline: 2px solid var(--accion); outline-offset: 2px; }
.sub-hoja { margin: 18px 0 4px; font-size: 15px; font-weight: 800; }
.volver-hoja { display: inline-flex; align-items: center; gap: 4px; margin: -4px 0 10px; text-decoration: none; }
.cuadre .fila-dato.total.debe > span:last-child { color: var(--debe); }

/* ---------- 27/11: enlace de la página para pacientes (Archivo y Hoy) ---------- */
.barra-tramite { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin: 10px 16px 0; padding: 8px 12px; border-radius: 12px; background: var(--accion-suave); color: var(--accion-hondo); font-size: 13.5px; font-weight: 600; }
.barra-tramite .ic { width: 16px; height: 16px; flex: none; }
.barra-tramite .bt-txt { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.barra-tramite .bt-txt a { color: inherit; font-weight: 800; }
.barra-tramite .enlace { padding: 2px 0; font-size: 13.5px; }
@media (min-width: 1024px) { .barra-tramite { margin: 10px 28px 0; } .dos-paneles .barra-tramite { margin-left: 0; margin-right: 0; } }
.chip.verde-chip { background: var(--verde-suave); color: var(--verde); border-color: transparent; }
