@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap");

:root {
  --fondo: #f2f5fa;
  --blanco: #ffffff;
  --linea: #ebeef5;
  --linea2: #dce1ed;
  --hover: #eef2f9;
  --tx: #2c3345;
  --tx2: #141926;
  --mut: #647087;
  --mut2: #94a0b8;
  --azul: #0073ea;
  --azul-h: #005ec2;
  --azul-s: #d8ebff;
  --azul-xs: #ebf4ff;
  --verde: #0ea568;
  --verde-xs: #e8f8f0;
  --rojo: #e11d48;
  --rojo-xs: #fff0f3;
  --ambar: #d97706;
  --ambar-xs: #fef4e6;
  --r: 14px;
  --sombra: 0 1px 3px rgba(15, 23, 42, .05), 0 6px 18px rgba(15, 23, 42, .04);
  --sombra2: 0 10px 28px rgba(15, 23, 42, .10), 0 2px 6px rgba(15, 23, 42, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fondo);
  color: var(--tx);
  font: 400 14.5px/1.5 Figtree, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
a { color: var(--azul); text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; color: var(--tx2); letter-spacing: -.015em; }
.mut { color: var(--mut); }
.oculto { display: none !important; }
svg { flex: none; }
.ok-t { color: #098754; font-weight: 600; }
.rojo-t { color: var(--rojo) !important; font-weight: 600; }

/* ================================================ marco principal */
.app {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  grid-template-rows: 56px 1fr;
  min-height: 100vh;
}
.barra-sup {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px 0 16px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--blanco);
  box-shadow: 0 1px 0 var(--linea);
}
.barra-sup .marca { padding: 0; }
.barra-sup .sp, .barra-guardar .sp, .bh-herr .sp, .mf .sp { flex: 1; }
.barra-sup .yo { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.barra-sup .yo img, .barra-sup .yo .av { width: 34px; height: 34px; border-radius: 50%; font-size: 12.5px; background: var(--azul); color: #fff; }
.barra-sup .yo b { display: block; font-weight: 600; line-height: 1.2; color: var(--tx2); }
.barra-sup .yo button { background: none; border: 0; padding: 0; color: var(--mut); cursor: pointer; font-size: 12px; }
.barra-sup .yo button:hover { color: var(--azul); }

.marca { display: inline-flex; align-items: center; gap: 11px; text-decoration: none !important; color: var(--tx2); }
.marca .logo-img {
  height: 29px; width: auto; display: block; flex: none;
  object-fit: contain;
}
.marca-sep { width: 1px; height: 18px; background: var(--linea2); flex: none; }
.marca-sub {
  display: block; font-size: 11.5px; color: var(--mut); font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; line-height: 1;
}
.entrar .caja .marca .logo-img { height: 34px; }

.lado {
  background: var(--blanco);
  box-shadow: 1px 0 0 var(--linea);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  padding: 14px 12px 22px;
  overflow-y: auto;
}
.lado nav { display: flex; flex-direction: column; gap: 3px; }
.lado nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 11px; border-radius: 9px;
  color: var(--tx); font-weight: 500; font-size: 14px;
  text-decoration: none; transition: background .12s, color .12s;
}
.lado nav a svg { width: 18px; height: 18px; color: var(--mut); }
.lado nav a:hover { background: var(--hover); }
.lado nav a.on { background: var(--azul-xs); color: var(--azul); font-weight: 700; }
.lado nav a.on svg { color: var(--azul); }
.lado nav a .cuenta {
  margin-left: auto; font-size: 11.5px; font-weight: 700;
  background: var(--azul); color: #fff; border-radius: 99px;
  min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px;
}
.lado .titulo {
  font-size: 11.5px; color: var(--mut); font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 20px 11px 8px; display: flex; align-items: center;
}
.lado .titulo a {
  margin-left: auto; color: var(--mut); display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 6px;
}
.lado .titulo a:hover { background: var(--hover); color: var(--azul); }
.lado .titulo a svg { width: 15px; height: 15px; }
.lado .pruebas-lista a { font-size: 13px; padding: 6px 10px; gap: 10px; }
.lado .pruebas-lista span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.panel { min-width: 0; overflow-x: clip; background: var(--fondo); min-height: calc(100vh - 56px); }
.main { min-width: 0; padding: 28px 34px 72px; container: principal / inline-size; }
.movil { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto; }
  .barra-sup, .lado { display: none; }
  .panel { min-height: 100vh; }
  .movil {
    display: flex; align-items: center; gap: 10px;
    background: var(--blanco); box-shadow: 0 1px 0 var(--linea);
    padding: 10px 14px; position: sticky; top: 0; z-index: 35;
  }
  .movil .marca .marca-sep, .movil .marca small { display: none; }
  .movil .marca .logo-img { height: 25px; }
  .movil select { margin: 0 0 0 auto; width: auto; max-width: 46vw; height: 34px; padding: 0 10px; background: var(--fondo); border: 0; border-radius: 8px; font-weight: 600; }
  .main { padding: 18px 14px 60px; }
}

/* ================================================ botones, inputs y pastillas */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: 9px;
  border: 0; background: #e6ebf5; color: var(--tx2);
  font-weight: 600; font-size: 14px; cursor: pointer;
  white-space: nowrap; text-decoration: none !important;
  transition: background .15s, box-shadow .15s, transform .1s;
}
.btn:hover { background: #dce3f0; }
.btn:active { transform: scale(.98); }
.btn svg { width: 17px; height: 17px; }
.btn.pri { background: var(--azul); color: #fff; }
.btn.pri:hover { background: var(--azul-h); box-shadow: 0 4px 14px rgba(0, 115, 234, .28); }
.btn.verde { background: var(--verde); color: #fff; }
.btn.verde:hover { filter: brightness(.95); }
.btn.suave { background: var(--azul-xs); color: var(--azul); }
.btn.suave:hover { background: var(--azul-s); }
.btn.peligro { background: var(--rojo-xs); color: var(--rojo); }
.btn.peligro:hover { background: #ffe0e7; }
.btn.fantasma { background: transparent; color: var(--mut); }
.btn.fantasma:hover { background: var(--hover); color: var(--tx2); }
.btn.chico { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.lnk-a { color: var(--azul); font-weight: 600; font-size: 13.5px; }
.lnk-a:hover { text-decoration: underline; }
.lnk-b { background: none; border: 0; padding: 0; font: inherit; color: var(--azul); cursor: pointer; font-weight: 600; }
.lnk-b:hover { text-decoration: underline; }

label.f { display: block; font-size: 13px; font-weight: 600; color: var(--tx); }
input, select, textarea {
  width: 100%; margin-top: 6px;
  background: #f8fafd; color: var(--tx2);
  border: 1px solid var(--linea2); border-radius: 9px;
  padding: 9px 12px; font: inherit;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #b8c2d6; }
input:focus, select:focus, textarea:focus, [contenteditable]:focus {
  outline: 0; background: #fff; border-color: var(--azul);
  box-shadow: 0 0 0 3px var(--azul-s);
}
textarea { resize: vertical; min-height: 76px; }
.fila { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; cursor: pointer; padding: 12px 14px; background: var(--fondo); border-radius: 10px; }
.check input { width: auto; margin: 2px 0 0; accent-color: var(--azul); }
.check.grande { align-items: center; font-weight: 600; align-self: end; padding: 9px 12px; }
.check.grande input { width: 18px; height: 18px; margin: 0; }

.buscar { position: relative; display: block; }
.buscar svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--mut2); pointer-events: none; }
.buscar input { padding-left: 36px; margin: 0; background: var(--blanco); border-color: transparent; box-shadow: var(--sombra); height: 38px; }
.buscar input:focus { border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-s); }

.av {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--azul-xs); color: var(--azul);
  font-weight: 700; font-size: 13.5px; flex: none; letter-spacing: .02em;
}
.av.m { width: 42px; height: 42px; font-size: 14.5px; }
.av.g { width: 54px; height: 54px; font-size: 18px; }

.chipe {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
  background: var(--hover); color: var(--mut); white-space: nowrap;
}
.chipe.az { background: var(--azul-xs); color: var(--azul); }

.est-pil {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--hover); color: var(--mut);
}
.est-pil.esperando { background: var(--ambar-xs); color: var(--ambar); }
.est-pil.recibido, .est-pil.en_revision { background: var(--azul-xs); color: var(--azul); }
.est-pil.cerrado { background: var(--verde-xs); color: #098754; }

/* ================================================ sistema limpio de cards (sin bordes pesados ni L) */
.card {
  background: var(--blanco);
  border: 0;
  border-radius: var(--r);
  box-shadow: var(--sombra);
}
.card > .ch { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.card > .ch h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; }
.card > .ch .acc { margin-left: auto; display: flex; gap: 6px; }
.card > .cb { padding: 16px 20px 20px; }

.entra > * { animation: entra .18s cubic-bezier(.2, .7, .2, 1) backwards; }
.entra > *:nth-child(2) { animation-delay: .02s; }
.entra > *:nth-child(3) { animation-delay: .04s; }
.entra > *:nth-child(4) { animation-delay: .06s; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes latido { 0% { box-shadow: 0 0 0 0 rgba(14, 165, 104, .5); } 70% { box-shadow: 0 0 0 9px rgba(14, 165, 104, 0); } 100% { box-shadow: 0 0 0 0 rgba(14, 165, 104, 0); } }

/* cabeceras de página */
.migas { font-size: 13px; color: var(--mut); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.migas a { color: var(--mut); }
.migas a:hover { color: var(--azul); }

.bh { margin-bottom: 22px; }
.bh .fecha-sup { display: block; color: var(--mut); font-weight: 500; text-transform: capitalize; font-size: 13px; margin-bottom: 2px; }
.bh-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.bh h1 { font-size: 27px; font-weight: 800; line-height: 1.2; }
.bh p { margin: 4px 0 0; color: var(--mut); }
.bh-acc { display: flex; gap: 8px; align-items: center; }
.bh-herr { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.bh-herr .buscar { width: 290px; max-width: 100%; }
.bh-herr.sin-linea { margin: 0 0 16px; }

.cab { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.cab h1 { font-size: 26px; font-weight: 800; }
.cab .sub { color: var(--mut); margin-top: 3px; }
.cab .acc { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.vacio { padding: 36px 22px; text-align: center; color: var(--mut); }
.vacio .ilu { width: 68px; height: 68px; margin: 0 auto 12px; border-radius: 20px; background: var(--azul-xs); display: grid; place-items: center; color: var(--azul); }
.vacio .ilu svg { width: 32px; height: 32px; }
.vacio b { display: block; color: var(--tx2); font-size: 16.5px; margin-bottom: 4px; font-weight: 700; }
.vacio p { margin: 0 auto 16px; max-width: 42ch; }

.toast {
  position: fixed; left: 50%; bottom: 26px;
  transform: translateX(-50%) translateY(16px); opacity: 0;
  background: var(--tx2); color: #fff; padding: 11px 18px;
  border-radius: 10px; font-weight: 600; z-index: 1200;
  transition: .22s; pointer-events: none; box-shadow: var(--sombra2);
}
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast.mal { background: var(--rojo); }

/* ================================================ portadas de pruebas (estilo biblioteca) */
.portada {
  position: relative;
  height: 146px;
  background: linear-gradient(145deg, var(--bg1), var(--bg2));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 11px 12px 8px 18px;
  user-select: none;
}
.portada::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(255, 255, 255, .14), transparent 55%);
  pointer-events: none;
}
.portada .lomo, .portada-libro .lomo, .portada-mini .lomo {
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 11px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .28) 0%, rgba(0, 0, 0, .08) 65%, rgba(255, 255, 255, .18) 82%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}
.portada-top {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.portada .ptag {
  font-size: 10px; font-weight: 800; letter-spacing: .07em;
  color: rgba(255, 255, 255, .82); text-transform: uppercase;
}
.portada-arte {
  position: relative; z-index: 2;
  flex: 1; min-height: 0;
  display: grid; place-items: center;
  margin-top: 2px;
}
.portada-arte svg { width: 100%; max-width: 196px; height: 104px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .22)); }

/* miniatura de libro vertical (cabeceras y selector de batería) */
.portada-libro {
  position: relative;
  width: 62px; height: 80px; border-radius: 6px 9px 9px 6px;
  background: linear-gradient(145deg, var(--bg1), var(--bg2));
  box-shadow: 0 4px 12px rgba(15, 23, 42, .16);
  overflow: hidden; flex: none;
  display: grid; place-items: center; padding-left: 5px;
}
.portada-libro .lomo { width: 7px; }
.portada-libro .arte svg { width: 54px; height: 42px; }

/* miniatura compacta (menú lateral, tareas, línea de tiempo) */
.portada-mini {
  position: relative;
  width: 36px; height: 46px; border-radius: 4px 6px 6px 4px;
  background: linear-gradient(145deg, var(--bg1), var(--bg2));
  box-shadow: 0 2px 6px rgba(15, 23, 42, .15);
  overflow: hidden; flex: none;
  display: inline-grid; place-items: center; padding-left: 3px;
}
.portada-mini .lomo { width: 5px; }
.portada-mini svg { width: 32px; height: 24px; }
.portada-mini.xs { width: 24px; height: 30px; border-radius: 3px 5px 5px 3px; }
.portada-mini.xs .lomo { width: 3px; }
.portada-mini.xs svg { width: 21px; height: 16px; }

/* insignias sobre la portada */
.tbadge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 9px; border-radius: 99px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.tbadge.tipo { background: rgba(255, 255, 255, .18); color: #fff; backdrop-filter: blur(4px); }
.tbadge.si { background: #10b981; color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.tbadge.no { background: #ef4444; color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }

/* estantería de libros / tests (Mis pruebas y Perfil del paciente) */
.biblio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 18px;
}
.libro-card {
  background: var(--blanco);
  border-radius: var(--r);
  box-shadow: var(--sombra);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  color: var(--tx) !important;
  text-decoration: none !important;
  transition: transform .18s ease, box-shadow .18s ease;
}
.libro-card:hover { transform: translateY(-3px); box-shadow: var(--sombra2); }
.libro-card[hidden] { display: none; }

.estado-franja { height: 4px; width: 100%; }
.estado-franja.si { background: var(--verde); }
.estado-franja.no { background: var(--rojo); }

.libro-b { padding: 14px 16px 15px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.libro-b h3 { font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--tx2); }
.libro-autor, .libro-sub {
  margin: 0; font-size: 12.5px; color: var(--mut); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.libro-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: 12px; color: var(--mut); margin-top: 2px; }
.fuera-bat { font-size: 11.5px; color: var(--mut2); }
.libro-pie {
  margin-top: auto; padding-top: 11px;
  border-top: 1px solid var(--linea);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12.5px;
}
.pac-libro.si .acc-txt { color: #098754; font-weight: 700; font-size: 13px; }
.pac-libro.no .acc-txt { color: var(--rojo); font-weight: 700; font-size: 13px; }
.pac-libro:hover .acc-txt { text-decoration: underline; }

.libro-nuevo {
  background: rgba(255, 255, 255, .55);
  box-shadow: inset 0 0 0 2px var(--linea2);
  align-items: center; justify-content: center; text-align: center;
  padding: 28px 20px; min-height: 260px; gap: 8px;
}
.libro-nuevo:hover { background: var(--blanco); box-shadow: inset 0 0 0 2px var(--azul), var(--sombra); }
.nuevo-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--azul-xs); color: var(--azul); display: grid; place-items: center; margin: 0 auto 6px; }
.nuevo-ico svg { width: 24px; height: 24px; }
.libro-nuevo b { color: var(--tx2); font-size: 15px; }
.libro-nuevo small { color: var(--mut); font-size: 12.5px; max-width: 22ch; }

/* ================================================ cards de pacientes tipo carpeta clínica / expediente */
.pcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 16px;
}
.pcards-ancho { grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }

.pcard {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .05), 0 10px 24px rgba(30, 64, 115, .07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--tx) !important;
  text-decoration: none !important;
  transition: transform .18s ease, box-shadow .18s ease;
}
.pcard:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(30, 64, 115, .13), 0 3px 8px rgba(15, 23, 42, .05); }
.pcard[hidden] { display: none; }

.pcard-portada {
  position: relative;
  background:
    radial-gradient(240px 130px at 96% 0%, rgba(255, 255, 255, .20), transparent 68%),
    linear-gradient(135deg, #315fa8 0%, #4576c2 54%, #5d8fd8 100%);
  padding: 13px 16px 15px;
  color: #fff;
}
.pcard-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 11px;
}
.pcard-meta > span:first-child {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: rgba(255, 255, 255, .82);
}
.pbadge {
  display: inline-flex; align-items: center; height: 21px; padding: 0 9px;
  border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.pbadge.aldia { background: rgba(255, 255, 255, .20); color: #fff; }
.pbadge.ok { background: rgba(255, 255, 255, .90); color: #087a4b; }
.pbadge.debe { background: #e11d48; color: #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, .22); }

.pcard-ident { display: flex; align-items: center; gap: 12px; }
.pcard-av {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255, 255, 255, .20);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .38);
  display: grid; place-items: center; flex: none;
  color: #fff; font-weight: 800; font-size: 14.5px; letter-spacing: .03em;
}
.pcard-id { flex: 1; min-width: 0; }
.pcard-id b {
  display: block; font-size: 16.5px; font-weight: 800; color: #fff;
  line-height: 1.22; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pcard-id small {
  display: block; font-size: 12.5px; color: rgba(255, 255, 255, .86); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.pcard-linea {
  height: 2px;
  background: linear-gradient(90deg, #3b76d0 0%, #3ec9a7 100%);
}

.pcard-cuerpo {
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px; flex: 1;
}
.pcard-motivo {
  border-left: 3px solid #7aa8e0;
  padding-left: 10px;
  min-height: 38px;
  display: flex; align-items: center;
}
.pcard-motivo span {
  font-size: 13px; color: var(--tx); line-height: 1.42;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard-motivo.vacio-m { border-left-color: var(--linea2); }
.pcard-motivo.vacio-m span { color: var(--mut2); font-style: italic; }

.pcard-tests { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.ptest-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 7px;
}
.ptest-chip i { font-style: normal; font-weight: 900; font-size: 11px; }
.ptest-chip.si { background: #dff5eb; color: #087a4b; }
.ptest-chip.no { background: #ffe4e9; color: #be123c; }
.pcard-sin { font-size: 12px; color: var(--mut2); margin-top: auto; }

.pcard-pie {
  padding: 10px 16px;
  background: #f4f8fe;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12.5px; color: #526580;
}
.pcard-pie b { color: var(--tx2); }
.pcard-pie .ir { color: var(--azul); font-weight: 700; }
.pcard:hover .pcard-pie .ir { text-decoration: underline; }

/* ================================================ inicio: pacientes arriba + tareas abajo con prioridad y orden */
.ini-sec { margin-top: 8px; }
.ini-tareas { margin-top: 38px; }
.ini-h { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.ini-h h2 { font-size: 20px; font-weight: 800; }
.ini-sec > .ini-h h2 { flex: 1; }
.ini-h .buscar { width: 235px; max-width: 100%; }
.ini-h .buscar input { height: 35px; font-size: 13.5px; }

.tareas-bar { justify-content: space-between; gap: 14px; }
.tareas-tit { display: flex; align-items: center; gap: 9px; }
.tareas-ctrl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctrl-l { font-size: 12.5px; font-weight: 600; color: var(--mut); }

.ord-tabs {
  display: inline-flex; background: var(--blanco); padding: 3px;
  border-radius: 10px; box-shadow: var(--sombra); gap: 2px; flex-wrap: wrap;
}
.ord-tabs button {
  border: 0; background: transparent; padding: 5px 11px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--mut); cursor: pointer; transition: .12s;
}
.ord-tabs button:hover { color: var(--tx2); }
.ord-tabs button.on { background: #132235; color: #fff; }

.tgrupo { margin-bottom: 20px; }
.tgrupo:last-child { margin-bottom: 0; }
.tgrupo-h {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 9px; padding: 0 4px;
}
.tg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--azul); flex: none; }
.tgrupo.g-alta .tg-dot { background: var(--rojo); }
.tgrupo.g-media .tg-dot { background: var(--ambar); }
.tgrupo.g-baja .tg-dot { background: #64748b; }
.tgrupo-h b { font-size: 14.5px; font-weight: 800; color: var(--tx2); }
.tg-n { font-size: 11.5px; font-weight: 700; background: var(--blanco); color: var(--tx2); padding: 1px 8px; border-radius: 99px; box-shadow: var(--sombra); }
.tgrupo-h small { font-size: 12.5px; color: var(--mut); margin-left: 4px; }

.tlista { display: flex; flex-direction: column; gap: 8px; }
.tfila {
  position: relative;
  display: grid;
  grid-template-columns: 32px 42px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 13px;
  background: var(--blanco);
  border-radius: 13px;
  padding: 12px 16px 12px 18px;
  box-shadow: var(--sombra);
  overflow: hidden;
  transition: transform .14s ease, box-shadow .14s ease;
}
.tfila:hover { transform: translateY(-1px); box-shadow: var(--sombra2); }
.tfila::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--ambar);
}
.tfila.prio-alta::before { background: var(--rojo); }
.tfila.prio-media::before { background: var(--ambar); }
.tfila.prio-baja::before { background: #64748b; }

.torden {
  font-size: 13px; font-weight: 800; color: var(--mut2);
  font-variant-numeric: tabular-nums; text-align: center;
}
.tfila.prio-alta .torden { color: var(--rojo); }

.tico {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; flex: none;
}
.tico svg { width: 20px; height: 20px; }
.tico.ev { background: var(--azul-xs); color: var(--azul); }
.tico.ap { background: #eef2ff; color: #2563eb; }
.tico.en { background: var(--ambar-xs); color: var(--ambar); }
.tico.sg { background: var(--verde-xs); color: #098754; }
.tico.cb { background: var(--rojo-xs); color: var(--rojo); }

.tinfo { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tinfo-sup { display: flex; align-items: center; gap: 7px; }
.ttipo { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.ttipo.ev, .ttipo.ap { color: var(--azul); }
.ttipo.en { color: var(--ambar); }
.ttipo.sg { color: #098754; }
.ttipo.cb { color: var(--rojo); }
.tmanual { font-size: 10px; font-weight: 700; background: #eef2ff; color: #3730a3; padding: 1px 6px; border-radius: 4px; }
.tinfo b { font-size: 14.5px; font-weight: 700; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tinfo small { font-size: 13px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.prio-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px; border: 0; border-radius: 99px;
  font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: filter .12s;
}
.prio-btn:hover { filter: brightness(.95); }
.prio-btn i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.prio-btn svg { width: 13px; height: 13px; opacity: .7; }
.prio-btn.alta { background: var(--rojo-xs); color: var(--rojo); }
.prio-btn.alta i { background: var(--rojo); }
.prio-btn.media { background: var(--ambar-xs); color: #b45309; }
.prio-btn.media i { background: var(--ambar); }
.prio-btn.baja { background: #eef2f7; color: #475569; }
.prio-btn.baja i { background: #64748b; }

.tacc { display: flex; align-items: center; gap: 6px; }

@container principal (max-width: 620px) {
  .tfila { grid-template-columns: 26px 38px minmax(0, 1fr); row-gap: 8px; padding: 11px 14px; }
  .prio-btn { grid-column: 2 / 4; justify-self: start; }
  .tacc { grid-column: 3 / 4; justify-self: end; grid-row: 2; }
}

.pop.prio-pop { width: 235px; padding: 8px; gap: 3px; }
.prio-pop-t { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); padding: 4px 8px 6px; }
.prio-op {
  display: grid; grid-template-columns: 10px 1fr; column-gap: 9px; row-gap: 1px;
  align-items: center; text-align: left; border: 0; background: transparent;
  padding: 7px 10px; border-radius: 8px; cursor: pointer;
}
.prio-op:hover { background: var(--fondo); }
.prio-op.on { background: var(--azul-xs); }
.prio-op i { width: 9px; height: 9px; border-radius: 50%; }
.prio-op.alta i { background: var(--rojo); }
.prio-op.media i { background: var(--ambar); }
.prio-op.baja i { background: #64748b; }
.prio-op span { font-size: 13px; font-weight: 700; color: var(--tx2); }
.prio-op small { grid-column: 2; font-size: 11.5px; color: var(--mut); }

.prio-elige { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.prio-elige label { cursor: pointer; position: relative; }
.prio-elige input { position: absolute; opacity: 0; pointer-events: none; }
.prio-elige .pe {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; border-radius: 9px; background: var(--fondo); font-weight: 700; font-size: 13.5px;
}
.prio-elige .pe i { width: 9px; height: 9px; border-radius: 50%; }
.prio-elige .pe.alta i { background: var(--rojo); }
.prio-elige .pe.media i { background: var(--ambar); }
.prio-elige .pe.baja i { background: #64748b; }
.prio-elige input:checked + .pe { background: var(--azul-xs); box-shadow: inset 0 0 0 2px var(--azul); color: var(--azul); }

.sin-res { padding: 14px 4px; }

/* ================================================ ficha del paciente */
.pac-hero {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 22px; flex-wrap: wrap;
}
.hero-pac {
  flex: 1; min-width: 240px;
  display: flex; align-items: center; gap: 16px;
  background: none; border: 0; padding: 6px 10px 6px 6px; margin: -6px;
  border-radius: 12px; text-align: left; cursor: pointer;
  transition: background .15s;
}
.hero-pac:hover { background: var(--fondo); }
.pac-hero .item-t { flex: 1; min-width: 180px; }
.hero-tit { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pac-hero h1 { font-size: 24px; font-weight: 800; line-height: 1.2; }
.pill-perfil {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px; border-radius: 99px;
  background: var(--azul-xs); color: var(--azul);
  font-size: 12px; font-weight: 700; transition: background .15s;
}
.pill-perfil svg { width: 14px; height: 14px; }
.hero-pac:hover .pill-perfil { background: var(--azul); color: #fff; }
.pac-hero p { margin: 4px 0 0; color: var(--mut); font-size: 14px; }
.pac-hero .motivo { margin-top: 6px; color: var(--tx); font-size: 13.5px; max-width: 82ch; }
.pac-hero .acc { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* pop-up de perfil actual */
.pf-mh { display: flex; align-items: center; gap: 14px; }
.pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .pf-grid { grid-template-columns: minmax(0, 1fr); } }
.pf-item { background: #f6f8fc; border-radius: 10px; padding: 10px 13px; }
.pf-item.ancho { grid-column: 1 / -1; }
.pf-item small { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); margin-bottom: 3px; }
.pf-item > div { font-size: 14px; font-weight: 600; color: var(--tx2); overflow-wrap: anywhere; }

.ps { margin-top: 28px; }
.ps-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ps-h h2 { font-size: 19px; font-weight: 700; }
.ps-r { flex: 1; margin: 0; color: var(--mut); font-size: 13.5px; min-width: 200px; }
.ps-r b { color: var(--tx2); }
.ps-r b.verde { color: #098754; }

/* línea de tiempo horizontal de sesiones */
.tl { display: flex; overflow-x: auto; padding: 6px 2px 14px; gap: 0; scroll-snap-type: x proximity; }
.tl::-webkit-scrollbar { height: 6px; }
.tl::-webkit-scrollbar-thumb { background: #cfd6e6; border-radius: 9px; }
.tl-i { flex: 0 0 205px; position: relative; padding: 26px 12px 0 0; scroll-snap-align: end; }
.tl-i.ev { flex-basis: 185px; }
.tl-i.fin { flex-basis: 175px; padding-right: 0; }
.tl-i::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 2px; background: #d5dce9; }
.tl-i:first-child::before { left: 8px; }
.tl-i.fin::before { right: auto; width: 8px; }
.tl-p { position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--fondo); z-index: 1; }
.tl-p.ok { background: var(--verde); }
.tl-p.pend { background: var(--rojo); }
.tl-p.test { background: var(--azul); }
.tl-p.nuevo { background: var(--blanco); box-shadow: inset 0 0 0 2px var(--azul); }
.tl-d { display: block; font-size: 12px; color: var(--mut); margin: 0 0 6px; font-weight: 600; }

.tl-c {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  background: var(--blanco); border: 0; border-radius: 12px;
  padding: 12px 14px; cursor: pointer; min-height: 92px; width: 100%;
  box-shadow: var(--sombra); text-align: left; color: var(--tx2);
  transition: transform .15s ease, box-shadow .15s ease;
}
.tl-c:hover { transform: translateY(-2px); box-shadow: var(--sombra2); }
.tl-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; }
.tl-c b { font-size: 14px; color: var(--tx2); }
.tl-c .tl-m { font-size: 16.5px; font-weight: 800; color: var(--tx2); }
.tl-c small { font-size: 12px; color: var(--mut); }
.tl-c p { margin: 2px 0 0; font-size: 12px; color: var(--mut); line-height: 1.35; }
.tl-pago { border: 0; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 2px 8px; cursor: pointer; }
.tl-pago.ok { background: var(--verde-xs); color: #098754; }
.tl-pago.pend { background: var(--rojo-xs); color: var(--rojo); }

.tl-c.test { flex-direction: row; align-items: center; gap: 10px; text-decoration: none !important; }
.tl-c.test small { display: block; font-size: 11px; }
.tl-c.test b { font-size: 13.5px; display: block; }
.tl-c.nuevo {
  background: rgba(255, 255, 255, .6);
  box-shadow: inset 0 0 0 2px #c8d7f5;
  color: var(--azul); font-weight: 700; font-size: 13px;
  justify-content: center; align-items: center; text-align: center;
}
.tl-c.nuevo:hover { background: var(--blanco); box-shadow: inset 0 0 0 2px var(--azul), var(--sombra); }
.tl-c.nuevo svg { width: 20px; height: 20px; }

/* sección clínica inferior: apuntes del psicólogo + anamnesis */
.ps-clinica {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: stretch;
  margin-top: 30px;
}
@container principal (max-width: 960px) { .ps-clinica { grid-template-columns: minmax(0, 1fr); } }

.notas-card, .anam-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.clin-h { display: flex; align-items: center; gap: 12px; }
.clin-h > div { flex: 1; min-width: 0; }
.clin-h h2 { font-size: 17px; font-weight: 700; line-height: 1.2; }
.clin-h small { display: block; font-size: 12.5px; color: var(--mut); margin-top: 2px; }
.clin-ico {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--azul-xs); color: var(--azul);
  display: grid; place-items: center; flex: none;
}
.clin-ico svg { width: 18px; height: 18px; }
.apu-est { font-size: 12px; font-weight: 600; color: var(--mut); background: var(--fondo); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }

.apuntes {
  flex: 1; width: 100%; min-height: 190px;
  background: #faf9f5;
  border: 1px solid #eae5d7;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14.5px; line-height: 1.6; color: var(--tx2);
  margin: 0; resize: vertical;
}
.apuntes:hover { border-color: #dcd4c0; }
.apuntes:focus { background: #fffefb; border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-s); }

.anam-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@container principal (max-width: 600px) { .anam-grid { grid-template-columns: minmax(0, 1fr); } }
.anam-item { background: #f6f8fc; border-radius: 11px; padding: 12px 14px; }
.anam-item.ancho { grid-column: 1 / -1; }
.anam-item h4 { margin: 0 0 4px; font-size: 11.5px; color: var(--azul); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.anam-item p { margin: 0; font-size: 13.5px; color: var(--tx2); }
.pre { white-space: pre-wrap; line-height: 1.55; }
.anam-vacio { background: #f6f8fc; border-radius: 12px; padding: 24px 18px; text-align: center; flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; }
.anam-vacio p { margin: 0; font-size: 13.5px; }

/* ================================================ filtros flotantes */
.desp { position: relative; }
.btn-h {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px; border: 0;
  background: var(--blanco); box-shadow: var(--sombra);
  border-radius: 9px; font-size: 13.5px; font-weight: 600;
  color: var(--tx2); cursor: pointer; white-space: nowrap;
}
.btn-h:hover, .btn-h[aria-expanded="true"] { background: var(--hover); }
.btn-h svg { width: 16px; height: 16px; color: var(--mut); }
.btn-h.on { background: var(--azul-xs); color: var(--azul); }
.btn-h.on svg { color: var(--azul); }
.nF:empty { display: none; }
.nF { font-size: 11px; font-weight: 700; background: var(--azul); color: #fff; border-radius: 99px; padding: 0 6px; line-height: 18px; }
.nres { font-size: 13px; }

.pop {
  background: var(--blanco); border-radius: 14px;
  box-shadow: 0 16px 42px rgba(15, 23, 42, .18), 0 2px 8px rgba(15, 23, 42, .08);
  padding: 16px; width: min(500px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 14px;
  max-height: min(72vh, 560px); overflow: auto;
}
.pop[hidden] { display: none; }
.pop.flot { position: fixed; z-index: 1000; }
.pop.flot.hoja { left: 12px; right: 12px; bottom: 12px; top: auto; width: auto; max-height: 75vh; }
.pop-s > small { display: block; font-size: 12px; font-weight: 700; color: var(--mut); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 7px; }
.pop-s > div { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 31px; padding: 0 11px; border: 0; border-radius: 8px;
  background: var(--fondo); font-size: 13px; font-weight: 500;
  color: var(--tx2); cursor: pointer; white-space: nowrap;
}
.fchip small { color: var(--mut); font-size: 11.5px; }
.fchip span { font-size: 11.5px; color: var(--mut); background: var(--blanco); border-radius: 99px; padding: 0 6px; font-weight: 600; }
.fchip:hover { background: #e5ebf6; }
.fchip.on { background: var(--azul); color: #fff; font-weight: 600; }
.fchip.on small { color: rgba(255, 255, 255, .82); }
.fchip.on span { background: rgba(255, 255, 255, .22); color: #fff; }
.pop-pie { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--linea); padding-top: 12px; position: sticky; bottom: -16px; background: var(--blanco); }

.activos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -6px 0 16px; }
.activos:empty { display: none; }
.pild {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 8px 0 11px; border: 0; border-radius: 99px;
  background: var(--azul-xs); color: var(--azul); font-size: 13px; font-weight: 600; cursor: pointer;
}
.pild svg { width: 14px; height: 14px; }
.pild:hover { background: var(--azul-s); }
.lnk { background: none; border: 0; color: var(--mut); font-size: 13px; cursor: pointer; text-decoration: underline; }

/* ================================================ formularios (paciente dinámico por etapa y cobros) */
.ficha-form { display: flex; flex-direction: column; gap: 18px; max-width: 1120px; }
.ficha-dinamica { display: flex; flex-direction: column; gap: 18px; animation: entra .22s ease both; }
.ficha-dinamica[hidden], .etapa-aviso[hidden] { display: none; }

.etapa-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@container principal (max-width: 820px) { .etapa-grid { grid-template-columns: minmax(0, 1fr); } }

.etapa-card {
  position: relative;
  display: flex; align-items: flex-start; gap: 13px;
  text-align: left; border: 0; border-radius: 14px;
  background: #f5f8fd; padding: 16px; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .14s;
}
.etapa-card:hover { background: #ebf1fb; transform: translateY(-2px); }
.etapa-card.on {
  background: linear-gradient(135deg, #132235 0%, #1f3959 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(19, 34, 53, .20);
}
.etapa-ico {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--blanco); color: var(--azul);
  display: grid; place-items: center; flex: none;
  box-shadow: var(--sombra);
}
.etapa-ico svg { width: 26px; height: 26px; }
.etapa-card.on .etapa-ico { background: rgba(255, 255, 255, .14); color: #6ef0c8; box-shadow: none; }

.etapa-tx { flex: 1; min-width: 0; }
.etapa-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.etapa-top b { font-size: 16px; font-weight: 800; color: var(--tx2); }
.etapa-top span { font-size: 11.5px; font-weight: 700; color: var(--azul); background: var(--azul-xs); padding: 2px 8px; border-radius: 99px; }
.etapa-card.on .etapa-top b { color: #fff; }
.etapa-card.on .etapa-top span { background: rgba(255, 255, 255, .16); color: #cfe4ff; }
.etapa-tx small { display: block; font-size: 12.5px; color: var(--mut); line-height: 1.4; }
.etapa-card.on .etapa-tx small { color: #b8cde5; }

.etapa-chk {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--blanco); box-shadow: inset 0 0 0 1.5px var(--linea2);
  display: grid; place-items: center; flex: none; color: transparent;
}
.etapa-chk svg { width: 13px; height: 13px; }
.etapa-card.on .etapa-chk { background: #2fd3a3; box-shadow: none; color: #0f1c2e; }

.etapa-aviso {
  background: var(--blanco); border-radius: 14px; box-shadow: var(--sombra);
  padding: 26px 20px; text-align: center; color: var(--mut); font-weight: 600; font-size: 14px;
}

.tipo-rapido { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tipo-rapido label { cursor: pointer; position: relative; }
.tipo-rapido input { position: absolute; opacity: 0; pointer-events: none; }
.tipo-rapido span {
  display: grid; place-items: center; height: 34px; border-radius: 8px;
  background: var(--fondo); font-size: 12.5px; font-weight: 700; color: var(--mut);
}
.tipo-rapido input:checked + span { background: #132235; color: #fff; }

.tag-ad {
  display: inline-block; font-style: normal; font-size: 11px; font-weight: 700;
  color: var(--ambar); background: var(--ambar-xs); padding: 1px 7px; border-radius: 99px; margin-top: 4px;
}

.fsec { border-radius: var(--r); background: var(--blanco); box-shadow: var(--sombra); overflow: hidden; }
.fsec > header { display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px; border-bottom: 1px solid var(--linea); }
.fsec .num { width: 30px; height: 30px; border-radius: 8px; background: var(--azul); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.fsec .num svg { width: 17px; height: 17px; }
.fsec h2 { font-size: 16.5px; font-weight: 700; margin: 2px 0; }
.fsec header p { margin: 0; color: var(--mut); font-size: 13.5px; }
.fsec-b { padding: 18px 20px; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.g2 .ancho { grid-column: 1 / -1; }
@container principal (max-width: 820px) { .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container principal (max-width: 560px) { .g3, .g2 { grid-template-columns: minmax(0, 1fr); } }
.nota-f { align-self: end; color: var(--mut); font-size: 13px; padding-bottom: 10px; }

.bat-el { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.bat-el label {
  display: flex; align-items: center; gap: 14px;
  background: var(--fondo); border-radius: 12px; padding: 12px;
  cursor: pointer; position: relative; min-width: 0; transition: .15s;
}
.bat-el label:hover { background: #e8eef8; }
.bat-el label.on { background: var(--azul-xs); box-shadow: inset 0 0 0 2px var(--azul); }
.bat-el input { position: absolute; opacity: 0; pointer-events: none; }
.bat-el span { min-width: 0; flex: 1; }
.bat-el b { display: block; font-weight: 700; font-size: 14px; color: var(--tx2); line-height: 1.3; }
.bat-el small { display: block; color: var(--mut); font-size: 12px; margin-top: 3px; }
.bat-el .tick { width: 22px; height: 22px; border-radius: 6px; background: var(--blanco); box-shadow: inset 0 0 0 1.5px var(--linea2); display: grid; place-items: center; flex: none; color: transparent; }
.bat-el .tick svg { width: 14px; height: 14px; }
.bat-el label.on .tick { background: var(--azul); box-shadow: none; color: #fff; }

.barra-guardar {
  position: sticky; bottom: 12px; z-index: 30;
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px);
  border-radius: 12px; box-shadow: var(--sombra2);
}
@media (max-width: 600px) { .barra-guardar #nbat { display: none; } }

.modo { display: flex; flex-direction: column; gap: 10px; }
.modo label { display: flex; gap: 12px; align-items: flex-start; background: var(--fondo); border-radius: 12px; padding: 14px 16px; cursor: pointer; }
.modo label.on { background: var(--azul-xs); box-shadow: inset 0 0 0 2px var(--azul); }
.modo input[type=radio] { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--azul); }
.modo b { display: block; font-weight: 700; color: var(--tx2); }
.modo small { display: block; color: var(--mut); font-size: 13px; margin-top: 2px; }
.modo .pc { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 700; }
.modo .pc input { width: 90px; margin: 0; height: 36px; background: #fff; }

/* ================================================ detalle de prueba y subir */
.pest { display: flex; gap: 4px; border-bottom: 1px solid var(--linea2); margin: 20px 0 18px; overflow-x: auto; scrollbar-width: none; }
.pest::-webkit-scrollbar { display: none; }
.pest button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 15px; font-size: 14px; font-weight: 600; color: var(--mut);
  cursor: pointer; white-space: nowrap; margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 7px; border-radius: 8px 8px 0 0;
}
.pest button:hover { color: var(--tx2); background: rgba(255, 255, 255, .5); }
.pest button.on { border-bottom-color: var(--azul); color: var(--azul); }
.pest button span, .pest button .n { font-size: 11.5px; background: var(--blanco); color: var(--mut); border-radius: 99px; padding: 1px 8px; font-weight: 700; }
.pest button.on span, .pest button.on .n { background: var(--azul-xs); color: var(--azul); }

.secs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.secs-ancho { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.sec { background: var(--fondo); border-radius: 12px; padding: 12px 14px; }
.sec-card { padding: 16px 18px; }
.sec-h { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--linea); margin-bottom: 6px; }
.sec-h b { font-size: 15px; color: var(--tx2); }
.grp-f { padding: 10px 0; border-bottom: 1px solid var(--linea); }
.grp-f:last-child { border-bottom: 0; padding-bottom: 0; }
.grp-cab { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 13.5px; }
.grp-cab small { color: var(--mut); }
.items-i { display: flex; flex-wrap: wrap; gap: 5px; }
.items-i span { font-size: 12px; background: var(--fondo); border-radius: 6px; padding: 3px 8px; color: var(--tx); }

.sec details { border-bottom: 1px solid var(--linea2); padding: 7px 0; }
.sec details:last-child { border: 0; }
.sec summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; list-style: none; }
.sec summary::-webkit-details-marker { display: none; }
.sec summary > span:first-of-type { flex: 1; }
.sec ul { margin: 6px 0 2px; padding-left: 22px; color: var(--mut); font-size: 13px; }

.tabla-s { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabla-s th { text-align: left; font-size: 12px; color: var(--mut); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--linea); }
.tabla-s td { padding: 11px 10px; border-bottom: 1px solid var(--linea); vertical-align: top; }
.tabla-s tr:last-child td { border: 0; }

.ed-prueba { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 18px; align-items: start; }
.ed-prueba.solo { grid-template-columns: 1fr; max-width: 860px; }
@media (max-width: 1100px) { .ed-prueba { grid-template-columns: 1fr; } }

.soltar {
  display: block; border: 2px dashed #c2cde0; border-radius: 18px;
  padding: 46px 20px; text-align: center; background: var(--blanco);
  cursor: pointer; transition: .2s;
}
.soltar:hover, .soltar.sobre { border-color: var(--azul); background: var(--azul-xs); }
.soltar b { display: block; font-size: 18px; font-weight: 800; margin-bottom: 4px; color: var(--tx2); }
.soltar .tipos { display: flex; gap: 6px; justify-content: center; margin-top: 14px; }
.opciones-subir { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
@media (max-width: 900px) { .opciones-subir { grid-template-columns: 1fr; } }
.opciones-subir .card { padding: 20px; display: flex; gap: 14px; align-items: flex-start; }
.opciones-subir h3 { font-size: 15px; margin-bottom: 4px; }
.opciones-subir p { margin: 0 0 12px; color: var(--mut); font-size: 13.5px; }
.ic-redondo { width: 40px; height: 40px; border-radius: 12px; background: var(--azul-xs); color: var(--azul); display: grid; place-items: center; flex: none; }
.ic-redondo svg { width: 20px; height: 20px; }

/* ================================================ sesión en vivo y mesa de trabajo */
.ses-hero { margin-bottom: 16px; }
.datos-s { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px !important; color: var(--mut); font-size: 13.5px; }
.guardado { color: var(--mut); font-size: 13px; }

.pasos {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px; margin-bottom: 20px;
}
@container principal (max-width: 760px) { .pasos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.paso {
  display: flex; align-items: center; gap: 10px;
  background: var(--blanco); box-shadow: var(--sombra);
  padding: 10px 14px; border-radius: 11px; min-width: 0;
  color: var(--mut); font-weight: 600; font-size: 13.5px;
}
.paso .num { width: 26px; height: 26px; border-radius: 50%; background: var(--fondo); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; flex: none; }
.paso.hecho { color: var(--tx2); }
.paso.hecho .num { background: var(--verde-xs); color: #098754; }
.paso.actual { background: var(--azul); color: #fff; }
.paso.actual .num { background: #fff; color: var(--azul); }
.paso small { display: block; font-weight: 500; font-size: 11.5px; color: var(--mut); }
.paso.actual small { color: rgba(255, 255, 255, .85); }
.paso > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.envivo { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
@container principal (max-width: 920px) { .envivo { grid-template-columns: minmax(0, 1fr); } }
.qrcard { padding: 26px; text-align: center; }
.qrcard .et { display: inline-flex; align-items: center; gap: 8px; background: var(--verde-xs); color: #098754; font-weight: 700; font-size: 12px; padding: 5px 12px; border-radius: 99px; }
.qrcard .et::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--verde); animation: latido 1.6s infinite; }
.qrcard h2 { font-size: 19px; font-weight: 800; margin: 14px 0 4px; }
.qrcard p { color: var(--mut); margin: 0 0 20px; font-size: 13.5px; }
.qrbox { width: min(100%, 220px); aspect-ratio: 1; margin: 0 auto 20px; background: #fff; border-radius: 16px; padding: 14px; box-shadow: inset 0 0 0 1px var(--linea2); }
.qrbox svg, .qrbox img { width: 100%; height: 100%; display: block; }
.qrcard .enlace { display: flex; gap: 6px; margin-bottom: 10px; }
.qrcard .enlace input { margin: 0; font-size: 12.5px; color: var(--mut); }
.qrcard .acc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qrcard .acc .btn { justify-content: center; }
.qrcard .caduca { font-size: 12px; color: var(--mut); margin-top: 14px; }

.llegada { list-style: none; margin: 0; padding: 0; }
.llegada li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linea); }
.llegada li:last-child { border: 0; }
.llegada .ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--fondo); color: var(--mut); }
.llegada .ic svg { width: 17px; height: 17px; }
.llegada li.ok .ic { background: var(--verde-xs); color: #098754; }
.llegada li b { display: block; font-weight: 600; font-size: 14px; color: var(--tx2); }
.llegada li small { color: var(--mut); font-size: 12.5px; }
.llegada li .der { font-size: 12px; color: var(--mut); }
@container principal (max-width: 560px) { .llegada li { grid-template-columns: 34px minmax(0, 1fr) auto; } .llegada li .der { display: none; } }

.llego { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 16px; }
.llego figure { margin: 0; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--fondo); position: relative; box-shadow: var(--sombra); }
.llego figure img { width: 100%; height: 100%; object-fit: cover; }
.llego figure figcaption { position: absolute; left: 8px; bottom: 8px; background: rgba(255, 255, 255, .92); font-size: 11.5px; padding: 3px 9px; border-radius: 99px; font-weight: 600; }

/* mesa de trabajo */
.mesa { display: grid; grid-template-columns: minmax(300px, 40%) minmax(0, 1fr); gap: 20px; align-items: start; }
.mesa.sin-fotos { grid-template-columns: minmax(0, 1fr); }
.mesa.sin-fotos .izq { position: static; max-height: none; order: 2; }
@container principal (max-width: 1020px) { .mesa { grid-template-columns: minmax(0, 1fr); } .mesa .izq { position: static !important; max-height: none !important; } }

.mesa .izq { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 92px); overflow: auto; padding-bottom: 4px; }
.mesa .izq > .card { flex-shrink: 0; }
.visor { overflow: hidden; }
.visor .lienzo { height: min(54vh, 500px); display: grid; place-items: center; overflow: hidden; cursor: zoom-in; background: #e9edf5; padding: 14px; }
.visor canvas, .visor img { max-width: 100%; max-height: 100%; box-shadow: 0 4px 18px rgba(0, 0, 0, .12); border-radius: 4px; }
.visor .barra { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--linea); flex-wrap: wrap; align-items: center; }
.visor .barra button { background: var(--fondo); border: 0; color: var(--tx2); border-radius: 99px; padding: 5px 12px; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.visor .barra button.on { background: var(--azul); color: #fff; }
.visor .barra .sp { flex: 1; }
.visor .nada { color: var(--mut); padding: 36px; text-align: center; }
.zoom { position: fixed; inset: 0; background: rgba(15, 20, 35, .86); z-index: 1100; display: grid; place-items: center; cursor: zoom-out; backdrop-filter: blur(4px); }
.zoom canvas, .zoom img { max-width: 94vw; max-height: 92vh; border-radius: 8px; }

.respuestas .rt { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linea); }
.respuestas .rt:last-child { border: 0; }
.respuestas .rt .n { width: 26px; height: 26px; border-radius: 7px; background: var(--fondo); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--mut); }
.respuestas .rt small { display: block; color: var(--mut); font-size: 13px; margin-bottom: 2px; }
.respuestas .rt b { display: block; font-size: 14.5px; font-weight: 600; color: var(--tx2); line-height: 1.45; }
.respuestas .rt em { color: var(--mut2); font-size: 13px; }
.mesa:not(.sin-fotos) .respuestas { max-height: 480px; overflow: auto; }

.pestanas.pest { margin-top: 0; }
.mb14 { margin-bottom: 14px; }

.secnav { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.secnav button {
  border: 0; background: var(--blanco); box-shadow: var(--sombra);
  border-radius: 9px; padding: 8px 13px; font-size: 13px; font-weight: 600;
  color: var(--tx); cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.secnav button:hover { background: var(--hover); }
.secnav button.on { background: var(--azul); color: #fff; }
.secnav button i { font-style: normal; font-size: 11px; min-width: 19px; height: 19px; border-radius: 99px; display: grid; place-items: center; background: var(--azul-xs); color: var(--azul); padding: 0 5px; font-weight: 700; }
.secnav button.on i { background: rgba(255, 255, 255, .24); color: #fff; }
.secnav button i:empty { display: none; }

.hoja-ind > .cb { padding: 10px 0 0; }
.grupo { display: grid; grid-template-columns: minmax(160px, 210px) minmax(0, 1fr); border-top: 1px solid var(--linea); }
.grupo:first-child { border-top: 0; }
.grupo h4 { grid-row: span 2; margin: 0; padding: 13px 16px; border-right: 1px solid var(--linea); background: #fafbfd; display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 13.5px; }
.modo-g { font-size: 11.5px; font-weight: 500; color: var(--mut); }
.grupo .chips { padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 7px; }
.grupo .desc { margin: 0 16px 12px; padding: 10px 12px; background: var(--azul-xs); border-radius: 8px; font-size: 13px; color: var(--tx2); display: none; }
.grupo .desc.on { display: block; }
@container principal (max-width: 620px) { .grupo { grid-template-columns: minmax(0, 1fr); } .grupo h4 { grid-row: auto; border-right: 0; border-bottom: 1px solid var(--linea); flex-direction: row; justify-content: space-between; align-items: center; } }

.chip {
  border: 0; background: var(--fondo); color: var(--tx2);
  border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 500;
  cursor: pointer; text-align: left; line-height: 1.3;
  display: inline-flex; align-items: center; gap: 6px; transition: .12s;
}
.chip:hover { background: #e2e9f5; }
.chip.on { background: var(--azul); color: #fff; font-weight: 600; }
.chip.on::before { content: "✓"; font-weight: 800; }
.chip.bloq { opacity: .35; }

/* cuestionarios / escalas (Sacks, etc.) */
.avance { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font-size: 13px; color: var(--mut); font-weight: 600; }
.avance div { flex: 1; height: 7px; background: #dfe5f2; border-radius: 9px; overflow: hidden; }
.avance i { display: block; height: 100%; background: var(--verde); transition: width .3s; border-radius: 9px; }

.leyenda-p { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px 14px; border-radius: 10px; background: var(--blanco); box-shadow: var(--sombra); margin: 0 0 14px; font-size: 13px; }
.leyenda-p span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda-p i { font-style: normal; min-width: 24px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; background: var(--mut2); }
.leyenda-p i.v2 { background: var(--rojo); }
.leyenda-p i.v1 { background: var(--ambar); }
.leyenda-p i.v0 { background: var(--verde); }

.esc-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--azul-xs); color: var(--azul); font-size: 12px; font-weight: 700; margin-right: 8px; }
.esc-card > .cb { padding-top: 6px; padding-bottom: 6px; }
.item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 14px; padding: 13px 0; border-top: 1px solid var(--linea); align-items: center; }
.item:first-child { border-top: 0; }
.item .n { width: 26px; height: 26px; border-radius: 7px; background: var(--fondo); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--mut); }
.item .q { font-size: 13px; color: var(--mut); }
.item .r { font-size: 15px; font-weight: 600; color: var(--tx2); margin-top: 3px; line-height: 1.45; }
.item .r.vacia { color: var(--mut2); font-weight: 400; font-style: italic; font-size: 13.5px; }
@container principal (max-width: 560px) { .item { grid-template-columns: 28px minmax(0, 1fr); } .item .seg { grid-column: 1 / -1; justify-self: start; } }

.seg { display: flex; gap: 4px; background: var(--fondo); padding: 3px; border-radius: 9px; }
.seg button { min-width: 36px; height: 30px; border: 0; background: transparent; border-radius: 7px; cursor: pointer; font-weight: 700; font-size: 13px; color: var(--mut); }
.seg button:hover { background: #fff; }
.seg button.on { color: #fff; background: var(--azul); }
.seg button.on.v2 { background: var(--rojo); }
.seg button.on.v1 { background: var(--ambar); }
.seg button.on.v0 { background: var(--verde); }

/* informe */
.herr { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.informe { background: var(--blanco); border-radius: var(--r); padding: 42px 50px; box-shadow: var(--sombra); }
@media (max-width: 700px) { .informe { padding: 22px; } }
.informe .tit { text-align: center; font-weight: 800; font-size: 19px; color: var(--tx2); margin-bottom: 8px; }
.informe .meta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.informe .bl { margin: 0 0 20px; }
.informe .bl h4 { font-size: 14px; font-weight: 700; margin: 0 0 6px -8px; color: var(--azul); padding: 2px 8px; border-radius: 6px; }
.informe .bl [contenteditable] { padding: 6px 8px; margin: 0 -8px; border-radius: 8px; text-align: justify; line-height: 1.7; font-size: 14.5px; min-height: 28px; color: var(--tx); }
.informe .bl [contenteditable]:hover { background: var(--fondo); }
.informe table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; border: 1px solid var(--linea); border-radius: 10px; overflow: hidden; }
.informe td { border-bottom: 1px solid var(--linea); padding: 8px 12px; }
.informe tr:last-child td { border: 0; }
.informe tr:nth-child(odd) td { background: #fafbfd; }
.informe .firma { margin-top: 48px; display: flex; justify-content: flex-end; }
.informe .firma div { border-top: 1.5px solid var(--tx2); padding-top: 8px; min-width: 240px; text-align: center; font-size: 13.5px; }

.aviso { font-size: 12.5px; color: var(--mut); margin-top: 12px; display: flex; gap: 8px; align-items: flex-start; }
.aviso svg { width: 16px; height: 16px; margin-top: 2px; color: var(--azul); }
.aviso span { flex: 1; }

/* ================================================ modal */
.velo { position: fixed; inset: 0; background: rgba(15, 23, 42, .46); z-index: 900; display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px); }
.modal { background: var(--blanco); border-radius: 18px; width: min(600px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 24px 70px rgba(15, 23, 42, .26); animation: entra .2s both; }
.modal .mh { padding: 22px 24px 0; }
.modal .mh h2 { font-size: 20px; font-weight: 800; }
.modal .mh p { margin: 4px 0 0; color: var(--mut); font-size: 13.5px; }
.modal .mb { padding: 18px 24px; display: flex; flex-direction: column; gap: 18px; }
.modal .mf { padding: 14px 24px; border-top: 1px solid var(--linea); display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: 0; background: var(--blanco); }

.elige { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-top: 8px; max-height: 240px; overflow: auto; padding: 2px; }
.elige.elige-pr { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.elige label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--fondo); border-radius: 11px; cursor: pointer; font-size: 13px; font-weight: 600; line-height: 1.25; position: relative; transition: .12s; }
.elige label:hover { background: #e6ecf7; }
.elige input { position: absolute; opacity: 0; pointer-events: none; width: 0; }
.elige label:has(input:checked) { background: var(--azul-xs); box-shadow: inset 0 0 0 2px var(--azul); }
.elige label > span:last-child { min-width: 0; flex: 1; }
.elige small { display: block; color: var(--mut); font-weight: 500; font-size: 11.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.elige .nuevo { color: var(--azul); }
.elige .av { width: 30px; height: 30px; font-size: 12px; }

/* ================================================ estadísticas */
.stats-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 18px; }
.w-num { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.w-num span { font-size: 12.5px; color: var(--mut); font-weight: 600; }
.w-num b { font-size: 28px; font-weight: 800; color: var(--tx2); line-height: 1.15; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 16px; }
.w .wh { padding: 16px 18px 12px; border-bottom: 1px solid var(--linea); display: flex; flex-direction: column; gap: 2px; }
.w .wh b { font-size: 15px; }
.w .wh small { color: var(--mut); font-size: 12.5px; }
.w .wb { padding: 16px 18px; }

.barras { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding-top: 10px; }
.barras div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.barras i { display: block; width: 100%; max-width: 40px; background: linear-gradient(180deg, #4b9eff, #0073ea); border-radius: 8px 8px 4px 4px; min-height: 4px; }
.barras small { font-size: 12px; color: var(--mut); text-transform: capitalize; }
.barras b { font-size: 12.5px; font-weight: 700; }

.hbar { display: grid; grid-template-columns: minmax(110px, 1.2fr) 2fr 32px; gap: 12px; align-items: center; padding: 8px 0; font-size: 13px; }
.hbar > span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hbar > span:first-child b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.hbar .tr { height: 8px; border-radius: 99px; background: var(--fondo); overflow: hidden; }
.hbar .tr i { display: block; height: 100%; border-radius: 99px; background: var(--azul); }
.hbar > span:last-child { text-align: right; font-weight: 700; }

.lista-stat { display: flex; flex-direction: column; }
.lista-stat > div { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--linea); font-size: 14px; }
.lista-stat > div:last-child { border-bottom: 0; }

/* ================================================ pantalla de acceso */
.entrar { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--blanco); }
@media (max-width: 900px) { .entrar { grid-template-columns: 1fr; } .entrar .arte { display: none; } }
.entrar .arte {
  background: radial-gradient(700px 400px at 0% 0%, rgba(255, 255, 255, .2), transparent 60%), linear-gradient(140deg, #005ec2, #0073ea 55%, #3b95ff);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
}
.entrar .arte h1 { color: #fff; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; font-weight: 800; max-width: 15ch; margin: 0 0 14px; }
.entrar .arte p { opacity: .92; font-size: 15.5px; max-width: 44ch; margin: 0 0 32px; }
.entrar .flot { display: flex; flex-direction: column; gap: 12px; max-width: 410px; }
.flot-c { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--tx); }
.flot-c > div { flex: 1; min-width: 0; }
.flot-c b { font-size: 14px; display: block; color: var(--tx2); }
.flot-c small { color: var(--mut); font-size: 12.5px; }
.entrar .caja { display: grid; place-items: center; padding: 40px 24px; }
.entrar .caja > div { width: min(380px, 100%); }
.entrar .caja .marca { padding: 0 0 32px; }
.entrar .caja h2 { font-size: 25px; font-weight: 800; margin-bottom: 6px; }
.entrar .caja p { color: var(--mut); margin: 0 0 24px; }

@media print {
  body, .panel { background: #fff; }
  .barra-sup, .lado, .movil, .migas, .ses-hero, .pasos, .mesa .izq, .pestanas, .no-imprimir, .toast { display: none !important; }
  .app, .mesa { display: block; }
  .main { padding: 0; }
  .informe { box-shadow: none; padding: 0; }
  .informe .bl [contenteditable] { padding: 0; margin: 0; }
}

/* modo de aplicación: enlace / a mano / IA */
.modo-apl { display: grid; gap: 8px; margin-top: 8px; }
.modo-apl label { display: flex; align-items: center; gap: 12px; padding: 11px 13px; background: var(--fondo); border-radius: 11px; cursor: pointer; position: relative; transition: .12s; }
.modo-apl label:hover { background: #e6ecf7; }
.modo-apl input { position: absolute; opacity: 0; pointer-events: none; width: 0; }
.modo-apl label:has(input:checked) { background: var(--azul-xs); box-shadow: inset 0 0 0 2px var(--azul); }
.modo-apl .ma-ico { width: 34px; height: 34px; border-radius: 9px; background: #fff; color: var(--azul); display: grid; place-items: center; flex: none; box-shadow: var(--sombra); }
.modo-apl .ma-ico svg { width: 18px; height: 18px; }
.modo-apl b { display: block; font-size: 13.5px; color: var(--tx2); }
.modo-apl small { display: block; font-size: 12px; color: var(--mut); font-weight: 500; margin-top: 1px; }
.modo-apl em { font-style: normal; font-size: 10.5px; font-weight: 800; background: var(--ambar-xs); color: var(--ambar); padding: 2px 8px; border-radius: 99px; margin-left: 6px; text-transform: uppercase; letter-spacing: .04em; }
.modo-apl .ma-off { opacity: .6; cursor: not-allowed; }
.modo-apl .ma-off:hover { background: var(--fondo); }

/* ================================================ tienda de tests y selector lógico de batería */
.lado nav a .tag-dev {
  margin-left: auto; font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; background: var(--ambar-xs); color: var(--ambar);
  padding: 2px 7px; border-radius: 99px; line-height: 1.4;
}
.pill-dev {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: 99px; font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; background: var(--ambar-xs); color: var(--ambar); white-space: nowrap;
}
.vacio-acc { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }

.modal:has(.sinpr-grid), .modal:has(.modal-bat) { width: min(680px, 100%); }

.sinpr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.sinpr-op {
  display: flex; flex-direction: column; gap: 8px; padding: 18px;
  border-radius: 14px; background: var(--fondo); color: var(--tx) !important;
  text-decoration: none !important; transition: transform .15s, box-shadow .15s, background .15s;
}
.sinpr-op:hover { background: #e8eef8; transform: translateY(-2px); box-shadow: var(--sombra); }
.sinpr-op.dest {
  background: linear-gradient(155deg, #ebf4ff 0%, #f4f8ff 100%);
  box-shadow: inset 0 0 0 1.5px #b9d9ff;
}
.sinpr-op.dest:hover { box-shadow: inset 0 0 0 2px var(--azul), var(--sombra); }
.sinpr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.sinpr-ico {
  width: 40px; height: 40px; border-radius: 11px; background: var(--azul); color: #fff;
  display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0, 115, 234, .24);
}
.sinpr-ico.sec { background: #fff; color: var(--tx2); box-shadow: var(--sombra); }
.sinpr-ico svg { width: 20px; height: 20px; }
.sinpr-op b { font-size: 16px; font-weight: 800; color: var(--tx2); }
.sinpr-op small { font-size: 13px; color: var(--mut); line-height: 1.45; flex: 1; }
.sinpr-ir { font-size: 13.5px; font-weight: 700; color: var(--azul); margin-top: 6px; }

.bat-mas {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 14px; border-radius: 11px;
  background: var(--fondo); font-size: 13px; color: var(--mut);
}
.bat-mas a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--azul); }
.bat-mas a:hover { text-decoration: underline; }
.bat-mas a svg { width: 15px; height: 15px; }
.bat-mas em { font-style: normal; font-size: 10px; font-weight: 800; text-transform: uppercase; background: var(--ambar-xs); color: var(--ambar); padding: 2px 6px; border-radius: 99px; }
.bat-vacio { padding: 6px 0; }
.bat-vacio p { margin: 0 0 12px; }
.bat-vacio .vacio-acc { justify-content: flex-start; }

.tienda-aviso {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--blanco); border-radius: var(--r);
  padding: 16px 20px; margin-bottom: 18px;
  box-shadow: inset 4px 0 0 var(--ambar), var(--sombra);
}
.tienda-aviso-ico {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--ambar-xs); color: var(--ambar);
  display: grid; place-items: center; flex: none;
}
.tienda-aviso-ico svg { width: 20px; height: 20px; }
.tienda-aviso-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.tienda-aviso-top b { font-size: 15px; color: var(--tx2); }
.tienda-aviso p { margin: 0; font-size: 13.5px; color: var(--mut); line-height: 1.48; }

.tienda-pac-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: var(--azul-xs); border-radius: 13px; padding: 12px 18px; margin-bottom: 18px;
}
.tienda-pac-bar > div:first-child { display: flex; align-items: center; gap: 12px; }
.tienda-pac-bar b { display: block; font-size: 14.5px; color: var(--tx2); }
.tienda-pac-bar small { display: block; font-size: 12.5px; color: var(--mut); }

.tienda-grid { grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); }
.tienda-card { cursor: default; }
.tienda-feat {
  list-style: none; margin: 12px 0 14px; padding: 10px 12px;
  background: var(--fondo); border-radius: 10px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--tx); font-weight: 500;
}
.tienda-pie {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--linea);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.tienda-precio b { display: block; font-size: 13.5px; font-weight: 800; color: #098754; line-height: 1.2; }
.tienda-precio small { display: block; font-size: 11px; color: var(--mut); margin-top: 1px; }
.tienda-acc { display: flex; align-items: center; gap: 6px; }
.tienda-ya { font-size: 12.5px; font-weight: 700; color: #098754; }

