:root {
  --bg: #F2F5F8; --card: #FFFFFF; --ink: #13212B; --muted: #5A6B78; --line: #E2E8ED; --soft: #F6F8FA;
  --primary: #123B57; --primary-2: #0C2A40; --blue: #3E86C8; --blue-soft: #E7F0F9;
  --green: #1C7C5C; --green-soft: #E3F4EC; --teal: #3CCB9A;
  --amber: #A45A00; --amber-bar: #EBB45C; --amber-soft: #FFF3DC;
  --red: #B42318; --red-soft: #FDECEA; --gray-soft: #EEF1F4;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,34,48,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.45 "Nunito Sans", system-ui, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
code, .mono { font-family: "JetBrains Mono", Consolas, monospace; font-size: 13px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(60,203,154,.22) 0, transparent 42%),
    radial-gradient(circle at 85% 90%, rgba(242,182,50,.12) 0, transparent 38%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23F3F6F4' stroke-opacity='.06' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M26 14v20M16 24h20'/%3E%3Cpath d='M80 44s-14-8-14-18a7 7 0 0 1 14-2 7 7 0 0 1 14 2c0 10-14 18-14 18z'/%3E%3Crect x='14' y='72' width='28' height='28' rx='4'/%3E%3Cpath d='M14 80h28M22 68v8M34 68v8'/%3E%3Cpath d='M70 76h10l5-9 7 18 5-9h9'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, #16384F 0%, #0E1A21 62%); }
@media (min-width: 1040px) {
  .login { grid-template-columns: minmax(0, 1fr) 420px; gap: clamp(32px, 5vw, 80px); padding: 40px clamp(32px, 6vw, 96px); place-items: center stretch; }
  .login-card { justify-self: end; }
}
.login-escena { display: none; color: #F3F6F4; max-width: 680px; }
@media (min-width: 1040px) { .login-escena { display: block; } }
.escena-lema { display: inline-block; margin: 0 0 14px; padding: 5px 12px; border-radius: 999px; background: rgba(60,203,154,.16); color: #3CCB9A; font-weight: 800; font-size: 14px; letter-spacing: .02em; }
.escena-titulo { margin: 0 0 12px; font-size: clamp(28px, 2.6vw, 40px); line-height: 1.12; font-weight: 800; color: #F3F6F4; }
.escena-texto { margin: 0 0 22px; color: #C9D7E1; font-size: 16px; line-height: 1.55; max-width: 560px; }
.escena-dibujo { position: relative; }
.escena-dibujo img { width: 100%; height: auto; display: block; filter: drop-shadow(0 18px 30px rgba(0,0,0,.35)); }
.nota-flotante { position: absolute; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  background: #fff; color: #13212B; border-radius: 14px; padding: 9px 13px; font-size: 13px; box-shadow: 0 10px 28px rgba(0,0,0,.28);
  animation: flotar 6s ease-in-out infinite; white-space: nowrap; }
.nota-flotante b { grid-column: 2; font-size: 13px; color: #123B57; }
.nota-flotante small { grid-column: 2; color: #5A6B78; font-size: 11.5px; }
.n1 { top: 2%; left: -2%; }
.n2 { top: 14%; right: -3%; animation-delay: -1.5s; }
.n3 { bottom: -3%; left: 8%; animation-delay: -3s; }
.n4 { bottom: 34%; left: 2%; animation-delay: -4.5s; }
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .nota-flotante { animation: none; } }
.login-card { width: min(420px, 100%); background: var(--card); border-radius: 20px; padding: 32px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-marca { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.login-marca img { border-radius: 14px; }
.marca-nombre { font-size: 22px; font-weight: 800; color: var(--primary); }
.marca-nombre span { font-size: 12px; background: var(--teal); color: #0E1A21; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.marca-sub { font-size: 13px; color: var(--muted); }
.login h1 { font-size: 20px; margin-bottom: 12px; }
.login label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 12px 0 4px; }
.login-texto { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.login-enlace { text-align: center; margin: 14px 0 0; }
.enlace { background: none; border: 0; padding: 4px; color: #0E7A5C; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.enlace:hover { text-decoration: underline; }
.aviso-login { font-size: 14px; color: #0E7A5C; min-height: 1.2em; }
.clave { position: relative; display: block; }
.clave input { width: 100%; padding-right: 48px; }
.ojo { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 6px 8px;
  cursor: pointer; color: var(--muted); border-radius: 8px; line-height: 0; }
.ojo:hover { background: rgba(0,0,0,.06); }
.ojo svg { width: 20px; height: 20px; }
.login-pie { font-size: 12px; color: var(--muted); margin: 16px 0 0; text-align: center; }
.error { color: var(--red); font-size: 13px; min-height: 18px; margin: 8px 0; }

/* ---------- barra superior ---------- */
.topbar { height: 76px; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 24px; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.marca img { border-radius: 9px; }
.marca-texto { display: flex; flex-direction: column; line-height: 1.1; }
.marca-texto b { color: var(--primary); font-size: 17px; }
.marca-texto small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .3px; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 10px 12px; border-radius: 10px; text-decoration: none; color: #3C4B57; font-weight: 600; white-space: nowrap; font-size: 15px; }
.nav a:hover { background: var(--soft); }
.nav a.activo { color: var(--primary); background: var(--blue-soft); font-weight: 800; }
.nav .badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--amber-bar); color: #3A2400; font-size: 11px; font-weight: 800; text-align: center; }
.topbar-der { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.pill-bot { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 800; font-size: 13px; }
.pill-bot .punto { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.pill-bot.off { background: var(--red-soft); color: var(--red); }
.pill-bot.off .punto { background: var(--red); }
.usuario { display: flex; align-items: center; gap: 10px; }
.usuario-datos { display: flex; flex-direction: column; text-align: right; line-height: 1.2; }
.usuario-datos small { color: var(--muted); font-size: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.subbar { display: flex; align-items: center; gap: 16px; padding: 10px 28px; border-bottom: 1px solid var(--line); background: var(--card); }
.progreso { display: flex; gap: 4px; }
.progreso span { width: 62px; height: 3px; border-radius: 2px; background: var(--line); }
.progreso span.on { background: var(--primary); }
.seccion { font-size: 12px; font-weight: 800; letter-spacing: 1.2px; color: #8796A2; text-transform: uppercase; flex: 1; }
.link-salir { background: none; border: 0; color: #8796A2; font-weight: 700; cursor: pointer; font-size: 13px; }

/* ---------- layout ---------- */
.vista { padding: 28px; max-width: 1440px; margin: 0 auto; outline: none; }
.cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.cabecera h1 { font-size: 24px; }
.cabecera p { margin: 4px 0 0; color: var(--muted); }
.acciones { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 18px; }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .g-3 { grid-template-columns: 1fr; } }
.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 1100px) { .g-main, .g-2 { grid-template-columns: 1fr; } .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1px solid #EDF1F4; min-width: 0; }
.card h2 { font-size: 17px; margin-bottom: 14px; color: var(--ink); }
.card-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.card-cab h2 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }

/* ---------- botones y formularios ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid #CED8DF; background: var(--card); color: var(--ink); font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #9FB0BD; }
.btn.primario { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primario:hover { background: var(--primary-2); }
.btn.peligro { color: var(--red); border-color: #EFC1BC; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.ancho { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--primary); font-weight: 800; cursor: pointer; padding: 0; font-size: 14px; text-decoration: none; }
.icono { background: none; border: 0; cursor: pointer; font-size: 18px; color: var(--muted); width: 36px; height: 36px; border-radius: 8px; }
.icono:hover { background: var(--soft); }
input, select, textarea { width: 100%; height: 42px; border: 1px solid #CED8DF; border-radius: 10px; padding: 0 12px; background: var(--card); }
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.campo { display: flex; flex-direction: column; gap: 4px; }
.campo label { font-size: 12px; font-weight: 800; color: var(--muted); }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.buscador { width: 260px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.check input { width: 18px; height: 18px; }

/* ---------- etiquetas ---------- */
.tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; }
.t-verde { background: var(--green-soft); color: var(--green); }
.t-ambar { background: var(--amber-soft); color: var(--amber); }
.t-azul { background: var(--blue-soft); color: #1F5E97; }
.t-rojo { background: var(--red-soft); color: var(--red); }
.t-gris { background: var(--gray-soft); color: #4F5F6B; }

/* ---------- KPI ---------- */
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .lab { font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #6F7F8B; }
.kpi .num { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1.15; }
/* historia clínica */
.hc-alertas { border-left: 4px solid var(--red); }
.hc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hc-chip { border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 700; background: var(--amber-soft); color: var(--amber); }
.hc-chip.alto { background: var(--red-soft); color: var(--red); }
.hc-destacada { border: 1.5px solid var(--red-soft); }
.hc-sinos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
.hc-sinos.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .hc-sinos.tres { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .hc-sinos, .hc-sinos.tres { grid-template-columns: 1fr; } }
.hc-sino { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.hc-sino > span { flex: 1; min-width: 140px; font-size: 13.5px; }
.hc-bt { display: flex; gap: 4px; }
.hc-bt button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.hc-bt button.on.si { background: var(--red); border-color: var(--red); color: #fff; }
.hc-bt button.on.no { background: var(--green); border-color: var(--green); color: #fff; }
.hc-det { flex-basis: 100%; }
.hc-pre { color: #1F5E97; font-size: 11px; }
.hc-barra { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 12px 0; background: var(--bg); }
.hc-signos { display: flex; flex-wrap: wrap; gap: 4px 16px; background: var(--bg); border-radius: 10px; padding: 8px 12px; margin-top: 10px; font-size: 13px; }
.hc-signos-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; }
@media (max-width: 700px) { .hc-signos-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hc-bloque { margin: 10px 0 0; font-size: 13.5px; }
.hc-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.hc-foto { margin: 0; } .hc-foto img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: var(--bg); cursor: zoom-in; }
.hc-foto figcaption { font-size: 12px; margin-top: 4px; }
.hc-labs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.hc-fuera { border-color: var(--red) !important; color: var(--red); background: var(--red-soft); }
.hc-rojo { color: var(--red); }
/* editor de texto con formato (tipo Word) */
.hc-editor { border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; }
.hc-editor:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(14, 122, 92, .12); }
.hc-ed-barra { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--line); background: var(--bg); }
.hc-ed-b { border: 0; background: transparent; color: var(--ink); border-radius: 6px; padding: 3px 8px; font: inherit; font-size: 12.5px; cursor: pointer; }
.hc-ed-b:hover, .hc-ed-b:focus-visible { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.hc-ed { padding: 9px 12px; outline: none; font-size: 14px; line-height: 1.55; overflow-y: auto; max-height: 340px; }
.hc-rico ul, .hc-rico ol { margin: 2px 0; padding-left: 22px; }
.hc-rico p, .hc-rico div { margin: 0; }
.hc-rico mark { background: #FFF3A3; color: inherit; padding: 0 2px; border-radius: 3px; }
.hc-rico .rojo { color: var(--red); } .hc-rico .azul { color: #1F5E97; } .hc-rico .verde { color: var(--green); }
.hc-bloque .hc-rico { margin-top: 2px; }
.hc-tipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.hc-tipo { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.hc-tipo span { font-size: 22px; } .hc-tipo:hover, .hc-tipo:focus-visible { border-color: var(--green); box-shadow: 0 0 0 3px rgba(14, 122, 92, .12); }
.hc-ed h4 { margin: 10px 0 2px; color: var(--green); font-size: 14px; }
.hc-ed p { margin: 0 0 8px; }
/* mapa corporal */
.hc-mapa { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; margin-top: 8px; }
.hc-lienzos { display: flex; gap: 8px; }
.hc-silueta { margin: 0; text-align: center; font-size: 11px; color: var(--muted, #5A6B78); }
.hc-silueta svg { display: block; max-width: 100%; height: auto; }
/* un solo contorno: las piezas se dibujan con borde grueso debajo y el relleno encima */
.hc-cuerpo-borde { fill: #9AA9A4; stroke: #9AA9A4; stroke-width: 3; }
.hc-cuerpo { fill: var(--bg); }
.hc-cuerpo-det { fill: none; stroke: #B5C2BD; stroke-width: 1.2; }
.hc-marca { cursor: pointer; }
.hc-mapa-lista { flex: 1; min-width: 220px; margin: 0; padding-left: 22px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.hc-punto { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: -1px; margin-right: 4px; }
.hc-paleta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.hc-color { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.hc-color.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 700; }
.hc-mapa-ed summary { flex-wrap: wrap; justify-content: flex-start; }
/* diagnósticos CIE-11 y sugerencias de la IA */
.hc-dx-buscar { position: relative; }
.hc-dx-res { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); max-height: 300px; overflow-y: auto; }
.hc-dx-op { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink);
  padding: 8px 12px; font: inherit; font-size: 13.5px; cursor: pointer; }
.hc-dx-op:hover, .hc-dx-op:focus-visible { background: var(--bg); }
.hc-dx-op small, .hc-dx small { color: var(--muted, #5A6B78); margin-left: 6px; }
.hc-dx-lista { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.hc-dx-fila { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 13.5px; }
.hc-dx-fila > span { flex: 1; min-width: 180px; }
.hc-estrella { border: 0; background: transparent; font-size: 18px; color: #C9D3CF; cursor: pointer; padding: 0 2px; }
.hc-estrella.on { color: #F2B632; }
.hc-dx-ver { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.hc-dx { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; background: var(--card); }
.hc-dx.principal { border-color: var(--green); background: var(--green-soft, #E8F7F0); }
.hc-btn-ia { border-color: #B9A7F5 !important; color: #5B3FD6 !important; }
.hc-ia-adv { background: var(--amber-soft); color: #7A4A00; border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 8px; }
.hc-ia-no { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 8px; }
.hc-ia-adv ul, .hc-ia-no ul { margin: 4px 0 0; padding-left: 18px; }
.hc-ia-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; font-size: 13.5px; }
.hc-ia-item > div { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.hc-qx { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin-top: 10px; font-size: 12.5px; color: var(--muted, #5A6B78); }
.hc-qx b { display: block; color: var(--ink); font-size: 13.5px; }
.hc-sistemas { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 10px 0; }
.hc-sistemas summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hc-sis { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.hc-sis > span { flex: 1; min-width: 160px; font-size: 13.5px; }
.hc-sis-res { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
/* en el teléfono, las cifras de dinero grandes (RD$1,569,130.95) no se salen de la tarjeta */
@media (max-width: 600px) { .g-4 { grid-template-columns: 1fr; } .kpi .num { overflow-wrap: anywhere; } }
.kpi .det { font-size: 13px; font-weight: 700; }
.bien { color: var(--green); } .alerta { color: var(--amber); } .mal { color: var(--red); }
.hero { background: var(--primary); color: #fff; border-radius: var(--radius); padding: 26px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 28px; }
.hero .lab { color: #9CC3E6; font-size: 12px; font-weight: 800; letter-spacing: 1px; }
.hero .grande { font-size: 60px; font-weight: 800; line-height: 1; }
.hero .grande small { font-size: 18px; color: #7FE0B8; margin-left: 6px; }
.hero p { color: #D4E3EF; margin: 8px 0 0; font-size: 14px; }
.barra { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.barra .fila { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.barra .riel { height: 9px; border-radius: 5px; background: rgba(255,255,255,.14); overflow: hidden; }
.barra .riel i { display: block; height: 100%; border-radius: 5px; }
.riel-claro { height: 8px; border-radius: 4px; background: var(--gray-soft); overflow: hidden; }
.riel-claro i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } }

/* gráfico de barras */
.grafico { display: flex; align-items: flex-end; gap: 14px; height: 220px; padding-top: 10px; border-bottom: 1px solid var(--line); }
.grafico .dia { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 2px; min-width: 0; }
.grafico .seg { border-radius: 6px 6px 0 0; min-height: 2px; }
.grafico .seg.b { background: #4A90D9; }
.grafico .seg.d { background: var(--amber-bar); border-radius: 0; }
.ejes { display: flex; gap: 14px; }
.ejes span { flex: 1; text-align: center; font-size: 12px; font-weight: 800; color: #8796A2; padding-top: 8px; }
.leyenda { display: flex; gap: 18px; font-size: 13px; color: var(--muted); margin-top: 12px; }
.leyenda i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini-kpis div { background: var(--soft); border-radius: 12px; padding: 14px; }
.ranking { display: flex; flex-direction: column; gap: 12px; }
.ranking .item { display: grid; grid-template-columns: 30px minmax(0, 1fr) 48px; gap: 8px; align-items: center; }
.ranking .n { color: #9AA8B3; font-size: 12px; font-weight: 800; }
.ranking .v { text-align: right; font-weight: 800; }
.lista-simple { display: flex; flex-direction: column; }
.lista-simple .item { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--soft); }
.aviso { background: var(--amber-soft); color: var(--amber); border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 700; margin-top: 12px; }
.aviso.azul { background: var(--blue-soft); color: #1F5E97; }

/* ---------- tablas ---------- */
.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #7B8A96; padding: 14px 18px; background: var(--soft); }
.tabla td { padding: 14px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
.tabla tr.click { cursor: pointer; }
.tabla tr.click:hover td { background: #FAFBFC; }
.tabla .sub { display: block; font-size: 12px; color: var(--muted); }
.tabla-card { padding: 0; overflow: hidden; }
.tabla-card .scroll { overflow-x: auto; }

/* ---------- bandeja ---------- */
.bandeja { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .bandeja { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.columna-cab { display: flex; justify-content: space-between; align-items: center; font-weight: 800; margin-bottom: 10px; font-size: 14px; }
.columna-cab .cuadro { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 8px; }
.columna-cab .cnt { color: #8796A2; }
.columna { display: flex; flex-direction: column; gap: 12px; }
.tarjeta { background: var(--card); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); border: 1px solid #EDF1F4; border-top: 3px solid var(--c, var(--blue)); cursor: pointer; }
.tarjeta:hover { border-color: #C7D3DC; border-top-color: var(--c, var(--blue)); }
.tarjeta .fila { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tarjeta b { font-size: 15px; }
.tarjeta .hora { font-size: 12px; color: #8796A2; font-weight: 800; }
.tarjeta .espera { font-size: 12px; color: var(--amber); font-weight: 800; }
.tarjeta p { margin: 6px 0 10px; color: #3C4B57; font-size: 14px; }
.tarjeta .pie-t { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tarjeta .agente { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #3C4B57; }
.tarjeta .dos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.canal { font-size: 11px; font-weight: 800; color: #8796A2; text-transform: uppercase; letter-spacing: .5px; }
.vacia { border: 1px dashed #CBD5DD; border-radius: 12px; padding: 18px; text-align: center; color: #8796A2; font-size: 13px; }

/* ---------- chat (panel) ---------- */
.panel { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.panel-fondo { position: absolute; inset: 0; background: rgba(12,26,36,.35); opacity: 0; transition: opacity .2s; }
.panel-cuerpo { position: absolute; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: var(--bg); transform: translateX(100%); transition: transform .22s; display: flex; flex-direction: column; box-shadow: -20px 0 50px rgba(0,0,0,.15); }
.panel.abierto { pointer-events: auto; }
.panel.abierto .panel-fondo { opacity: 1; }
.panel.abierto .panel-cuerpo { transform: none; }
.panel-cab { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.panel-cab h2 { font-size: 18px; }
.panel-contenido { flex: 1; overflow: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.chat { display: flex; flex-direction: column; gap: 8px; background: var(--card); border-radius: 12px; padding: 16px; min-height: 260px; max-height: 52vh; overflow-y: auto; border: 1px solid #EDF1F4; }
.burbuja { max-width: 78%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; font-size: 14px; }
.burbuja.paciente { background: #EEF2F5; align-self: flex-start; border-bottom-left-radius: 4px; }
.burbuja.bot { background: #E6F6EF; align-self: flex-end; border-bottom-right-radius: 4px; }
.burbuja.agente { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.burbuja .meta { display: block; font-size: 11px; opacity: .7; margin-top: 4px; font-weight: 700; }
.burbuja .ops { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.burbuja .ops span { font-size: 12px; background: rgba(255,255,255,.7); border: 1px solid #BFE3D2; border-radius: 6px; padding: 1px 7px; }
.sistema { align-self: center; font-size: 12px; color: #8796A2; font-weight: 700; background: var(--soft); border-radius: 999px; padding: 3px 12px; }
.responder { display: flex; gap: 8px; }
.responder textarea { min-height: 48px; height: 48px; }
.info-paciente { background: var(--card); border-radius: 12px; padding: 14px 16px; border: 1px solid #EDF1F4; font-size: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }

/* ---------- chatbot ---------- */
.pasos { display: flex; flex-direction: column; gap: 0; }
.paso { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; position: relative; padding-bottom: 20px; }
.paso:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 0; width: 2px; background: var(--line); }
.paso .num { width: 28px; height: 28px; border-radius: 7px; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.paso h3 { font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.paso p { margin: 0; color: #3C4B57; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chips span { background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px; font-size: 12px; font-weight: 700; color: #4F5F6B; }
.faq { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--soft); border-radius: 12px; padding: 14px 16px; cursor: pointer; border: 1px solid transparent; }
.faq:hover { border-color: #C7D3DC; }
.faq.borrador { background: transparent; border: 1px dashed #BFCBD4; }
.faq b { display: block; font-size: 15px; }
.faq small { color: var(--muted); }
.faqs { display: flex; flex-direction: column; gap: 10px; }

/* ---------- plantillas ---------- */
.wa-preview { background: #E9E2D8; border-radius: 12px; padding: 18px; }
.wa-burbuja { background: #fff; border-radius: 10px 10px 10px 2px; padding: 10px 12px; max-width: 320px; font-size: 14px; white-space: pre-wrap; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.wa-botones { max-width: 320px; display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.wa-botones span { background: #fff; border-radius: 8px; text-align: center; padding: 8px; color: #0A7CFF; font-weight: 700; font-size: 14px; }

/* ---------- modal, toast, pie ---------- */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(640px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(12,26,36,.45); }
#modal-contenido { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
#modal-contenido h2 { font-size: 19px; }
.modal-acciones { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 700; opacity: 0; pointer-events: none; transition: .2s; z-index: 90; }
.toast.ver { opacity: 1; transform: translateX(-50%); }
.toast.error { background: var(--red); }
.pie { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 18px; color: #8796A2; font-size: 12px; }
.pie img { border-radius: 5px; }
.cargando { padding: 40px; text-align: center; color: var(--muted); }
.estado-int { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--soft); }

/* selección de seguros e importación */
.chips-sel { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-sel { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line, #D9E3E0);
  border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip-sel input { width: auto; margin: 0; }
.chip-sel:has(input:checked) { border-color: #0E7A5C; background: rgba(14,122,92,.08); }

/* registro de médicos y centros, y aviso del estado de la cuenta */
.login-registro { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--linea, #E3E8EF); text-align: center; font-size: 14px; color: var(--muted); }
.login-registro .btn { margin-top: 8px; }
.tipo-cuenta { display: flex; gap: 8px; margin: 4px 0 6px; }
.tipo-cuenta label { flex: 1; display: flex; align-items: center; gap: 6px; border: 1px solid var(--linea, #E3E8EF); border-radius: 10px; padding: 10px; cursor: pointer; font-weight: 600; }
.tipo-cuenta input, .acepto input { width: auto; margin: 0; }
.acepto { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin-top: 12px; }
.banner-cuenta { margin: 0 24px; padding: 10px 16px; border-radius: 12px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 14px; }
.banner-cuenta.prueba { background: #FFF7E6; border: 1px solid #EBB45C; color: #7A4B00; }
.banner-cuenta.inactiva { background: #FDECEA; border: 1px solid #E8A6A0; color: #8A1F17; }
.banner-cuenta.demo { background: #E8F1FB; border: 1px solid #8DB4E2; color: #123E6B; position: sticky; top: 0; z-index: 30; }
.lista-elegir { display: flex; flex-wrap: wrap; gap: 6px; max-height: 190px; overflow: auto; padding: 2px; }

/* punto de venta */
.tabs-pos { display: flex; gap: 6px; flex-wrap: wrap; }
.pos-productos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; max-height: 60vh; overflow: auto; }
.pos-prod { display: flex; flex-direction: column; gap: 4px; text-align: left; border: 1px solid var(--linea, #E3E8EF); border-radius: 12px; padding: 10px;
  background: #fff; cursor: pointer; font: inherit; }
.pos-prod:hover { border-color: #0E7A5C; box-shadow: 0 2px 8px rgba(14,122,92,.12); }
.tabla.compacta td, .tabla.compacta th { padding: 6px 8px; }
.tabla.compacta input { height: 32px; padding: 4px 6px; }
.pos-totales { margin-top: 10px; border-top: 1px solid var(--linea, #E3E8EF); padding-top: 8px; }
.pos-totales div { display: flex; justify-content: space-between; padding: 2px 0; }
.pos-totales .grande { font-size: 20px; color: #0E7A5C; }
.pos-cambio { font-size: 20px; text-align: center; margin: 12px 0 0; }
.g-pos { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
@media (max-width: 1100px) { .g-pos { grid-template-columns: 1fr; } }

/* =============================================================== tema oscuro */
:root { --titulo: var(--primary); --borde: #CED8DF; --borde-card: #EDF1F4; --fila-hover: #FAFBFC; --texto-nav: #3C4B57; --lateral: #FFFFFF; }
html[data-tema="oscuro"] {
  color-scheme: dark;
  --bg: #0E161C; --card: #15212A; --ink: #E4ECF2; --muted: #93A4B1; --line: #26343F; --soft: #1B2832;
  --primary: #2F6EA3; --primary-2: #245985; --blue: #5AA2E0; --blue-soft: #1A3346;
  --green: #4CC596; --green-soft: #163A2D; --teal: #3CCB9A; --amber: #F2B65E; --amber-bar: #EBB45C; --amber-soft: #3A2C12;
  --red: #F2867A; --red-soft: #3F1F1B; --gray-soft: #22303A; --shadow: 0 1px 2px rgba(0,0,0,.4);
  --titulo: #E4ECF2; --borde: #33434F; --borde-card: #22303A; --fila-hover: #1B2832; --texto-nav: #B9C7D1; --lateral: #121D25;
}
h1, h2, h3, .marca-texto b, .marca-nombre { color: var(--titulo); }
.card { border-color: var(--borde-card); }
.btn, input, select, textarea { border-color: var(--borde); }
.tabla tr.click:hover td { background: var(--fila-hover); }
.t-azul { color: var(--blue); }
.t-gris { color: var(--muted); }
html[data-tema="oscuro"] a { color: var(--blue); }
html[data-tema="oscuro"] .burbuja.paciente { background: #22303A; }
html[data-tema="oscuro"] .burbuja.bot { background: #163A2D; }
html[data-tema="oscuro"] .pos-prod, html[data-tema="oscuro"] .wa-burbuja { background: var(--card); }
html[data-tema="oscuro"] .banner-cuenta.prueba { background: var(--amber-soft); color: var(--amber); }
html[data-tema="oscuro"] .banner-cuenta.inactiva { background: var(--red-soft); color: var(--red); }
html[data-tema="oscuro"] .banner-cuenta.demo { background: var(--blue-soft, #16314F); color: var(--blue, #9CC3EE); }
.aviso.rojo { background: var(--red-soft); color: var(--red); border: 1px solid transparent; }
.aviso.verde { background: var(--green-soft); color: var(--green); }

/* =============================================================== menú lateral por grupos */
.app { min-height: 100vh; }
.app.lateral { display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.app.lateral.compacto { grid-template-columns: 72px minmax(0, 1fr); }
.app.hidden { display: none !important; }
.lateral-menu { display: none; }
.app.lateral .lateral-menu { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--lateral); border-right: 1px solid var(--line); padding: 16px 12px; gap: 2px; z-index: 25; }
.lateral-menu .marca { padding: 4px 6px 10px; }
.lateral-grupo { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--texto-nav); padding: 11px 10px;
  display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; cursor: pointer; border-radius: 10px; text-align: left; font-family: inherit; }
.lateral-grupo:hover { background: var(--soft); color: var(--titulo); }
.lateral-grupo > span:first-child { flex: 1; }
.lateral-grupo i { font-style: normal; font-size: 18px; line-height: 1; transition: transform .15s; }
.lateral-bloque.abierto .lateral-grupo i { transform: rotate(90deg); }
.lateral-bloque.abierto .lateral-grupo { color: var(--muted); }
.lateral-grupo .badge { margin-left: 0 !important; letter-spacing: 0; flex: none; }
.lateral-items { display: none; flex-direction: column; gap: 2px; padding-bottom: 6px; }
.lateral-bloque.abierto .lateral-items { display: flex; }
.app.compacto .lateral-items { display: flex; }
.app.compacto .lateral-grupo i, .app.compacto .lateral-grupo .badge { display: none; }
.lateral-menu nav a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--texto-nav);
  font-weight: 650; font-size: 14.5px; white-space: nowrap; position: relative; }
.lateral-menu nav a:hover { background: var(--soft); }
.lateral-menu nav a.activo { background: var(--blue-soft); color: var(--titulo); font-weight: 800; }
.lateral-menu nav a svg, .lateral-pie svg { width: 19px; height: 19px; flex-shrink: 0; }
.lateral-menu nav .badge { margin-left: auto; display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--amber-bar);
  color: #3A2400; font-size: 11px; font-weight: 800; text-align: center; }
.lateral-pie { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.lateral-pie button { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; border: 0; background: none; color: var(--texto-nav);
  font-weight: 650; cursor: pointer; text-align: left; }
.lateral-pie button:hover { background: var(--soft); }
.app.compacto .lateral-menu .marca-texto, .app.compacto .lateral-grupo span, .app.compacto .lateral-menu nav a span,
.app.compacto .lateral-pie button span { display: none; }
.app.compacto .lateral-menu nav a, .app.compacto .lateral-pie button { justify-content: center; padding: 10px 0; }
.app.compacto .lateral-menu nav .badge { position: absolute; top: 2px; right: 6px; margin: 0; }
.app.compacto .lateral-grupo { border-top: 1px solid var(--line); padding: 0; margin: 8px 6px; }
.app.compacto .lateral-menu .marca { justify-content: center; }
.app.lateral .topbar .marca, .app.lateral .topbar .nav { display: none; }
.app.lateral .topbar { height: 64px; }
.topbar .titulo-seccion { font-size: 18px; font-weight: 800; color: var(--titulo); flex: 1; display: none; }
.app.lateral .topbar .titulo-seccion { display: block; }
.app.lateral .subbar { display: none; }
.btn-menu { display: none; background: none; border: 0; padding: 8px; border-radius: 10px; color: var(--ink); cursor: pointer; }
.btn-menu svg { width: 22px; height: 22px; }
.nav a { color: var(--texto-nav); }

/* menú de preferencias del usuario */
.usuario { position: relative; cursor: pointer; border-radius: 12px; padding: 4px 6px; }
.usuario:hover { background: var(--soft); }
.preferencias { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.22); padding: 12px; z-index: 40; cursor: default; }
.preferencias h4 { margin: 8px 4px 6px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.opciones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.opciones.dos { grid-template-columns: repeat(2, 1fr); }
.opciones button { border: 1px solid var(--borde); background: var(--card); color: var(--ink); border-radius: 10px; padding: 8px 4px; font-weight: 700;
  font-size: 12.5px; cursor: pointer; }
.opciones button.on { border-color: var(--blue); background: var(--blue-soft); color: var(--titulo); }
.preferencias .salir { width: 100%; margin-top: 12px; }

@media (max-width: 900px) {
  .app.lateral, .app.lateral.compacto { grid-template-columns: minmax(0, 1fr); }
  .app.lateral .lateral-menu { position: fixed; left: 0; top: 0; width: 270px; transform: translateX(-105%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .app.lateral.menu-abierto .lateral-menu { transform: none; }
  .app.compacto .lateral-menu .marca-texto, .app.compacto .lateral-grupo span, .app.compacto .lateral-menu nav a span { display: revert; }
  .app.compacto .lateral-menu nav a { justify-content: flex-start; padding: 9px 10px; }
  .app.lateral .btn-menu { display: inline-flex; }
  .usuario-datos { display: none; }
}
.kpi.click { cursor: pointer; transition: border-color .15s, transform .15s; }
.kpi.click:hover { border-color: var(--green); transform: translateY(-1px); }
.kpi .num.mal { color: var(--red); } .kpi .num.alerta { color: var(--amber); } .kpi .num.bien { color: var(--green); }
.lista-simple .item .sub { display: block; font-size: 12px; color: var(--muted, #6F7F8B); font-weight: 500; }

/* ---------- punto de venta: mejoras (compras, caja, catálogos, timbrado) ---------- */
dialog.ancho { width: min(980px, calc(100vw - 32px)); }
.con-boton { display: flex; gap: 6px; align-items: stretch; }
.con-boton select, .con-boton input { flex: 1; min-width: 0; }
.caja-suave { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.cm-lineas { display: flex; flex-direction: column; gap: 10px; }
.cm-linea { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.cm-linea .campo.ancho { grid-column: 1 / -1; }
.cm-linea input, .cm-linea select { font-size: 15px; min-height: 42px; }
.cm-pie { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grid-den { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.den { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); font-size: 13px; }
.den span { font-weight: 800; }
.den input { font-size: 16px; min-height: 40px; }
.den b { font-size: 12px; color: var(--muted, #6F7F8B); text-align: right; }
.chips .chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; }
.chips .chip small { color: var(--muted, #6F7F8B); font-weight: 600; }
.chips .chip.apagado { opacity: .5; text-decoration: line-through; }
.chips .chip .icono { padding: 2px 6px; }
.timbrado { display: grid; grid-template-columns: 180px 1fr; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--soft); }
.timbrado-vista { height: 90px; border: 1px dashed var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; }
.timbrado-vista img { max-width: 100%; max-height: 100%; object-fit: contain; }
@media (max-width: 640px) { .timbrado { grid-template-columns: 1fr; } }
html[data-tema="oscuro"] .chips span { color: var(--ink); }
@media (prefers-color-scheme: dark) { html[data-tema="auto"] .chips span, html:not([data-tema]) .chips span { color: var(--ink); } }

/* ---------- idioma ---------- */
.login-card { position: relative; }
.login-idioma { display: flex; justify-content: flex-end; gap: 4px; margin: -12px -12px 8px 0; }
.login-idioma button { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.login-idioma button.on { border-color: #0E7A5C; background: rgba(14,122,92,.1); }
img.bandera { width: 20px; height: 14px; border-radius: 2px; vertical-align: -2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.opciones button img.bandera, .login-idioma img.bandera { margin-right: 2px; }

/* ---------- acuerdo de confidencialidad (firma electrónica) ---------- */
.acuerdo { margin: 10px 0 4px; }
.acuerdo-texto { max-height: 230px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--soft);
  font-size: 12.5px; line-height: 1.5; text-align: left; }
#modal .acuerdo-texto { max-height: 52vh; }
.acuerdo-texto h3 { font-size: 15px; margin: 0 0 6px; color: #0E7A5C; }
.acuerdo-texto h4 { font-size: 13px; margin: 10px 0 2px; }
.acuerdo-texto p { margin: 0 0 6px; }
.acuerdo-campos { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.con-bandera { display: flex; align-items: center; gap: 8px; }
.con-bandera select { flex: 1; }
.usuario-datos b img.bandera { margin-right: 4px; }

/* ---------- acceso con Google / Facebook y acuerdo en ventana ---------- */
.acceso-externo { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 6px; }
.btn.externo { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--card); }
.separador { display: flex; align-items: center; gap: 10px; color: var(--muted, #6F7F8B); font-size: 12px; margin-top: 6px; }
.separador::before, .separador::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.acuerdo-resumen { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; margin: 12px 0 6px;
  border: 1px dashed var(--line); border-radius: 10px; background: var(--soft); }
.acuerdo-resumen > div { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.acuerdo-resumen.firmado { border-style: solid; border-color: #0E7A5C; }
.acuerdo-resumen.firmado #g-acuerdo-estado { color: #0E7A5C; font-weight: 700; }
#modal .acuerdo-ventana .acuerdo-texto { max-height: 58vh; font-size: 13.5px; }
.acuerdo-campos .acepto { display: flex; gap: 8px; align-items: flex-start; text-align: left; }
.acuerdo-campos .acepto input { margin-top: 3px; flex: none; }

/* caja: contador de la cola y facturas recién llegadas */
.contador { display: inline-block; min-width: 22px; padding: 1px 7px; margin-left: 6px; border-radius: 11px; background: var(--amber-bar); color: #3A2400; font-size: 12px; font-weight: 800; text-align: center; vertical-align: middle; }
.tabla tr.nueva td { background: color-mix(in srgb, var(--amber-bar) 22%, transparent); }
.tabla tr.nueva td:first-child { box-shadow: inset 3px 0 0 var(--amber-bar); }

/* cuenta con acceso gratis por cortesía de Softnest */
.banner-cuenta.cortesia { background: #E8F4FD; border: 1px solid #9CC8EE; color: #1F5E97; }
html[data-tema="oscuro"] .banner-cuenta.cortesia { background: var(--blue-soft); color: var(--blue); }

/* aviso de cierre de sesión por inactividad */
.aviso-inactividad { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px;
  background: rgba(14, 26, 31, .55); }
.aviso-inactividad .card { max-width: 380px; width: 100%; text-align: center; }
.aviso-inactividad .dos { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }

/* tablas: el título de cada columna ordena (▲ de A a Z, ▼ de Z a A) */
.tabla thead th:not(:empty) { cursor: pointer; user-select: none; white-space: nowrap; }
.tabla thead th:not(:empty):hover { color: var(--texto, #10212B); }
.tabla thead th:not(:empty)::after { content: " ↕"; opacity: .35; font-size: 11px; }
.tabla thead th[data-orden="asc"]::after { content: " ▲"; opacity: 1; }
.tabla thead th[data-orden="desc"]::after { content: " ▼"; opacity: 1; }

/* edad del paciente junto a su nombre */
.edad { color: var(--verde, #0E7A5C); font-weight: 600; }
.sub.edad { font-weight: 600; }

/* conexiones: bandera y país */
.pais { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.paises { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 13px; }
.fila-alerta td { background: #FFF7E6; }

/* aviso (toast) en la capa superior: por encima de las ventanas abiertas */
.toast[popover] { inset: 18px auto auto 50%; margin: 0; border: 0; overflow: visible; max-width: min(92vw, 560px); box-shadow: 0 12px 34px rgba(0,0,0,.28); }
.toast[popover]:not(.ver) { transform: translateX(-50%) translateY(-20px); }

/* escanear códigos con la cámara */
dialog.camara { width: min(520px, 94vw); }
#camara-contenido { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
#camara-contenido h2 { font-size: 19px; }
.camara-caja { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.camara-caja video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camara-mira { position: absolute; left: 12%; right: 12%; top: 34%; bottom: 34%; border: 3px solid rgba(255, 255, 255, .9);
  border-radius: 10px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); pointer-events: none; }
/* teléfonos: los formularios en una sola columna (los campos se ven completos) */
@media (max-width: 560px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  #modal-contenido { padding: 18px 16px; }
}
/* teléfonos: la barra de arriba cabe en la pantalla (si no, el navegador encoge la página y las ventanas salen cortadas) */
@media (max-width: 560px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .topbar-der { gap: 8px; flex-shrink: 1; min-width: 0; }
  .topbar .titulo-seccion { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
  #bot-estado { display: none; }
  #btn-ayuda { padding: 6px 9px; }
}

/* odontograma (historia clínica odontológica) */
.od-caja { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; margin: 8px 0 4px; }
.od-svg { display: block; margin: 0 auto; }
.od-svg .od-cara { stroke: #5A6B78; stroke-width: 1; }
.od-svg .od-num { font-size: 10px; font-weight: 700; fill: #0E1A1F; }
.od-editable .od-cara { cursor: pointer; }
.od-editable .od-cara:hover { stroke: #0E7A5C; stroke-width: 2.2; }
.od-editable .od-num { cursor: pointer; }
.od-leyenda { display: flex; gap: 14px; justify-content: center; font-size: 11.5px; color: var(--muted, #5A6B78); margin: 2px 0 6px; }
.od-leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.od-lista { columns: 2; font-size: 12.5px; padding-left: 18px; margin: 4px 0; }
.od-lista li { break-inside: avoid; margin-bottom: 2px; }
.od-barra { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 8px 0 2px; }
.od-grupo { margin-top: 4px; }
.od-grupo .hc-paleta { margin-top: 2px; }
.od-comparar { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.od-comparar > div { min-width: 0; }
.od-cambios { grid-column: 1 / -1; font-size: 13px; }
.od-cambios ul { columns: 2; padding-left: 18px; margin: 4px 0; }
.od-mas { color: #B42318; } .od-menos { color: #0E7A5C; }
@media (max-width: 720px) { .od-comparar { grid-template-columns: 1fr; } .od-lista, .od-cambios ul { columns: 1; } }
/* presupuesto odontológico */
.pr-tarjeta { cursor: pointer; }
.pr-tarjeta:hover { box-shadow: 0 0 0 2px var(--line); }
.pr-cifras { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 13px; margin-top: 10px; }
.pr-avance { flex: 1; min-width: 120px; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.pr-avance i { display: block; height: 100%; background: #1F5E97; }
.pr-tabla input, .pr-tabla select { padding: 6px 8px; min-height: 0; }
.pr-tabla td.n { text-align: right; white-space: nowrap; }
.pr-cancelado { opacity: .55; text-decoration: line-through; }
.pr-totales { margin: 10px 0 0 auto; max-width: 340px; font-size: 13.5px; }
.pr-totales div { display: flex; justify-content: space-between; padding: 2px 0; }
.pr-totales .g { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 6px; font-size: 15px; }
.pr-firma { width: 100%; max-width: 560px; height: 160px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; touch-action: none; display: block; }
/* periodontograma */
.pe-arcada { margin: 6px 0 10px; }
.pe-tabla { border-collapse: collapse; font-size: 11px; margin-top: 3px; }
.pe-tabla th, .pe-tabla td { border: 1px solid var(--line); padding: 0; text-align: center; min-width: 17px; height: 20px; }
.pe-tabla th:first-child { min-width: 92px; text-align: left; padding: 0 6px; font-weight: 600; color: var(--muted, #5A6B78); white-space: nowrap; }
.pe-tabla th small { font-weight: 400; }
.pe-tabla .pe-num { cursor: pointer; }
.pe-tabla .pe-aus { background: repeating-linear-gradient(45deg, #EEF1F3, #EEF1F3 4px, #fff 4px, #fff 8px); color: #98A2B3; }
.pe-in { width: 18px; height: 19px; border: 0; padding: 0; text-align: center; font: inherit; font-size: 11.5px; background: transparent; border-radius: 0; min-height: 0; }
.pe-in:focus { outline: 2px solid #0E7A5C; background: #E9F7F1; }
.pe-tabla td.pe-s, .pe-tabla td.pe-p { cursor: default; }
.pe-ed .pe-tabla td.pe-s, .pe-ed .pe-tabla td.pe-p { cursor: pointer; }
.pe-tabla td.pe-s.on { background: #D92D20; }
.pe-tabla td.pe-p.on { background: #F2B632; }
.pe-naranja, .pe-tabla .pe-naranja .pe-in { color: #B54708; font-weight: 700; }
.pe-rojo, .pe-tabla .pe-rojo .pe-in { color: #B42318; font-weight: 700; }
.pe-tabla td.pe-sangra { box-shadow: inset 0 -3px 0 #D92D20; }
.pe-indices { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; margin: 6px 0; }
.pe-indices span { background: var(--fondo, #F3F6F4); border-radius: 8px; padding: 3px 8px; }
.pe-ver summary { cursor: pointer; }

/* urología: IPSS, IIEF-5, examen urológico y estudios */
.uro-parte { border-top: 1px solid var(--line); padding: 6px 0; }
.uro-parte > summary { cursor: pointer; padding: 4px 0; }
.uro-total { margin-left: 8px; font-weight: 700; color: var(--verde, #0E7A5C); }
.uro-preg { display: grid; grid-template-columns: 1fr minmax(180px, 280px); gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
@media (max-width: 700px) { .uro-preg { grid-template-columns: 1fr; gap: 4px; } }
.uro-sub { margin: 10px 0 4px; font-size: 13px; color: var(--muted, #5A6B78); }
.uro-calculo { display: grid; grid-template-columns: 1.2fr 1.2fr 70px 70px 1.5fr auto; gap: 6px; margin-bottom: 6px; }
@media (max-width: 700px) { .uro-calculo { grid-template-columns: 1fr 1fr; } }
.uro-grafica { width: 100%; max-width: 560px; display: block; margin: 6px 0 10px; }
.uro-evolucion { min-width: 0; }
.uro-evolucion .scroll { overflow-x: auto; max-width: 100%; }
.uro-reg > span { display: flex; flex-direction: column; gap: 3px; }
.uro-cuest .acciones { margin: 0; }
.uro-cuest details .scroll { max-height: 280px; overflow: auto; }

/* Citas: las acciones bajan a otra línea en vez de ensanchar la tabla (sin barra para desplazarse a los lados);
   la historia clínica va primero */
.acciones-cita { min-width: 250px; }
.acciones-cita > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
/* Tablas anchas en computadora: la tabla se desplaza dentro de su recuadro, así la barra para moverse a los lados
   siempre está a la vista (no hay que bajar hasta la última fila) y los títulos de las columnas quedan fijos */
@media (min-width: 900px) {
  .tabla-card .scroll { max-height: calc(100vh - 190px); overflow: auto; }
  .tabla-card .scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--soft); }
}

/* historia por especialidad (especialidades.js) */
.esp-ed .esp-grupo{border-top:1px solid var(--borde, #e3e8ee);padding:6px 0}
.esp-ed .esp-grupo>summary{cursor:pointer;padding:4px 0}
.esp-ancho{grid-column:1/-1}
.esp-multi{display:flex;flex-wrap:wrap;gap:6px 14px}
.esp-op{display:inline-flex;align-items:center;gap:5px;font-weight:400;cursor:pointer}
.esp-op input{width:auto;margin:0}
.esp-ojos{display:grid;grid-template-columns:auto 1fr auto 1fr;gap:6px;align-items:center}
.esp-ojos span{font-size:12px;font-weight:700;color:var(--muted, #667)}
.esp-lista{margin:6px 0}
.esp-fila{border:1px dashed var(--borde, #d5dbe2);border-radius:8px;padding:8px;margin:6px 0;display:grid;gap:6px}
.esp-fila>.btn{justify-self:end}
.esp-calc:not(:empty){margin-top:10px;padding:8px 10px;border-radius:8px;background:var(--soft, #f4f7f6)}
.esp-lesiones{margin:2px 0 6px 18px;padding:0}
@media (max-width:600px){.esp-ojos{grid-template-columns:auto 1fr}}
/* crecimiento (pediatría): curvas de la OMS */
.hc-curva svg { width: 100%; height: auto; max-width: 760px; display: block; }
.tabla .sub.rojo { color: var(--red); font-weight: 600; }
#hc-cuerpo .card .scroll { overflow-x: auto; max-width: 100%; }
.nowrap { white-space: nowrap; }
/* clases con dibujo (Mallampati en anestesia) */
.esp-dibujos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.esp-dib { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; border: 2px solid var(--line, #D9E3E0);
  border-radius: 12px; background: var(--card, #fff); color: var(--ink); cursor: pointer; text-align: center; font: inherit; }
.esp-dib svg { width: 100%; max-width: 96px; height: auto; }
.esp-dib span { font-size: 12px; color: var(--muted); line-height: 1.25; }
.esp-dib:hover { border-color: #7FB8A6; }
.esp-dib.sel { border-color: #0E7A5C; background: rgba(14,122,92,.09); box-shadow: 0 0 0 2px rgba(14,122,92,.15); }
.esp-dib-ver { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.esp-dib-ver svg { width: 56px; height: 56px; flex: none; }
@media (max-width: 560px) { .esp-dibujos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* dibujar sobre la boca (anestesia) */
.esp-lienzo-caja { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.esp-lienzo { position: relative; width: 260px; max-width: 100%; aspect-ratio: 1; border: 1px solid var(--line, #D9E3E0); border-radius: 12px; background: #fff; }
.esp-fondo, .esp-lienzo canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.esp-fondo svg { width: 100%; height: 100%; }
.esp-fondo.tenue { opacity: .35; }
.esp-lienzo canvas { touch-action: none; cursor: crosshair; }
.esp-herr { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; max-width: 260px; }
.esp-color { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line, #D9E3E0); cursor: pointer; padding: 0; }
.esp-color.sel { box-shadow: 0 0 0 3px #0E7A5C; }
.esp-capas { position: relative; display: inline-block; flex: none; }
.esp-capas img { position: absolute; inset: 0; width: 100%; height: 100%; }
.esp-dib-ver .esp-capas svg { width: 90px; height: 90px; display: block; }
/* reseñas de los pacientes */
.rs-total { text-align: center; } .rs-num { font-size: 52px; font-weight: 800; color: var(--green, #0E7A5C); line-height: 1.1; }
.rs-est { color: #F5A524; font-size: 22px; letter-spacing: 2px; }
.rs-dist div, .rs-preg { display: grid; grid-template-columns: 48px 1fr 34px; gap: 8px; align-items: center; font-size: 13px; margin: 4px 0; text-align: left; }
.rs-preg { grid-template-columns: minmax(0, 1.4fr) 1fr 34px; }
.rs-barra { height: 8px; border-radius: 99px; background: var(--soft, #EEF3F1); overflow: hidden; } .rs-barra i { display: block; height: 100%; background: #F5A524; border-radius: 99px; }
.rs-grupo { font-weight: 700; margin: 12px 0 4px; color: var(--green, #0E7A5C); font-size: 13px; }
.rs-item { padding: 12px 0; border-bottom: 1px solid var(--line, #E2E8ED); } .rs-item:last-child { border-bottom: 0; } .rs-item.apagado { opacity: .5; }
.rs-cab { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .rs-cab .rs-est { font-size: 16px; }
.rs-item p { margin: 6px 0; } .rs-previa { width: 100%; max-width: 420px; display: block; margin: 0 auto; border-radius: 12px; }
/* antes y después: lado a lado o con deslizador */
.segmento { display: inline-flex; gap: 6px; }
.cmp-lado { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp-lado figure { margin: 0; } .cmp-lado img { width: 100%; aspect-ratio: 3 / 4; max-height: 62vh; object-fit: contain; background: var(--bg); border-radius: 10px; }
.cmp-lado figcaption, .cmp-lado.sin-img > div { font-size: 12.5px; margin-top: 4px; line-height: 1.6; }
.cmp-desl { position: relative; max-width: 520px; margin: 0 auto; aspect-ratio: 3 / 4; background: var(--bg); border-radius: 10px; overflow: hidden; }
.cmp-desl img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cmp-desl .linea { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: #fff; box-shadow: 0 0 4px rgba(0, 0, 0, .5); pointer-events: none; }
.cmp-desl .rot { position: absolute; top: 8px; background: rgba(19, 33, 43, .7); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 1px; padding: 2px 8px; border-radius: 12px; }
.cmp-desl .rot.izq { left: 8px; } .cmp-desl .rot.der { right: 8px; }
.cmp-desl + input[type=range] { max-width: 520px; display: block; margin: 8px auto; }
.cmp-cambio { margin-top: 12px; border: 2px solid var(--primario, #0E7A5C); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.cmp-cifras { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.cmp-cifras div { background: var(--bg); border-radius: 8px; padding: 4px 12px; text-align: center; }
.cmp-cifras small { display: block; font-size: 10px; text-transform: uppercase; } .cmp-cifras b { font-size: 16px; }
@media (max-width: 560px) { .cmp-lado { gap: 6px; } }
/* oftalmología: dibujo del fondo de ojo (OD y OI) */
.esp-dib-ver .esp-capas.grande svg { width: 150px; height: 150px; }
.esp-esquemas { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.esp-escala { margin: 4px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.esp-escala li { display: grid; grid-template-columns: 1fr minmax(180px, 260px); gap: 6px 12px; align-items: center; }
.esp-escala li label { font-weight: 400; margin: 0; font-size: 13px; color: var(--texto, inherit); text-transform: none; letter-spacing: 0; }
@media (max-width: 640px) { .esp-escala li { grid-template-columns: 1fr; } }

/* seguros (ARS) y tarifarios */
.ars-ini { display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: #E6F4EF; color: #0E7A5C; font-weight: 700; font-size: 13px; flex: none; }
.ars-codigo { display: flex; flex-direction: column; margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: #F4F8F7; border: 1px dashed #B9D8CD; }
.ars-codigo b { font-size: 22px; letter-spacing: .5px; color: #0E7A5C; }

/* reclamaciones a la ARS */
.recl-cab{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;background:#F4F8F7;border-radius:10px;padding:10px 12px;margin:8px 0}
.recl-cab>div{display:flex;flex-direction:column;gap:2px}
.recl-dx{display:grid;grid-template-columns:110px 1fr auto;gap:6px;margin-bottom:6px}
.recl-buscar{position:relative;margin:4px 0 8px}
.recl-res{position:absolute;left:0;right:0;top:100%;z-index:5;background:#fff;border:1px solid #DCE5E2;border-radius:10px;box-shadow:0 6px 18px rgba(0,0,0,.08);max-height:260px;overflow:auto}
.recl-res:empty{display:none}
.recl-res button{display:block;width:100%;text-align:left;background:none;border:0;border-bottom:1px solid #EEF2F0;padding:8px 10px;cursor:pointer;font:inherit;color:inherit}
.recl-res button:hover{background:#F4F8F7}
.recl-lin input{padding:5px 6px}
.recl-tot{display:flex;gap:18px;flex-wrap:wrap;justify-content:flex-end;margin:10px 0;font-size:14px}
.recl-ars{display:flex;flex-direction:column;gap:4px}
.recl-ars b{font-size:20px}
@media (max-width:600px){.recl-dx{grid-template-columns:80px 1fr auto}}
.pf-opciones{display:flex;flex-direction:column;gap:8px;margin:10px 0}
.pf-opciones .btn{justify-content:flex-start;text-align:left}
.fila-error td{background:#FEF3F2}

/* ---------- emergencia: tablero, niveles de triaje y camas */
.em-datos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.em-dato { padding: 12px 14px; margin: 0; } .em-dato b { display: block; font-size: 22px; } .em-dato span { font-size: 12px; color: var(--muted); }
.em-dato.em-alerta { border-color: var(--red); background: var(--red-soft); } .em-dato.em-alerta b { color: var(--red); }
.em-leyenda { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; margin-bottom: 12px; align-items: center; }
.em-leyenda > span { display: inline-flex; gap: 6px; align-items: center; }
.em-nivel { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 13px; flex: none; }
.em-nivel.em-sin { background: #8A99A6; }
.em-lista { display: flex; flex-direction: column; gap: 10px; }
.em-fila { display: flex; justify-content: space-between; gap: 14px; border-left: 6px solid #8A99A6; margin: 0; padding: 12px 14px; flex-wrap: wrap; }
.em-izq { display: flex; gap: 12px; align-items: flex-start; flex: 1 1 320px; min-width: 0; } .em-izq .em-nivel { width: 38px; height: 38px; font-size: 18px; }
.em-nombre { font-weight: 800; } .em-der { text-align: right; flex: 0 1 360px; }
.em-tiempo { font-size: 14px; } .em-tiempo.vencido { color: var(--red); font-weight: 700; } .em-tiempo.vencido::before { content: "⏰ "; }
.em-camas { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.em-cama { border: 1px solid var(--line, #D5DCE1); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; background: var(--green-soft); }
.em-cama.ocupada { background: var(--amber-soft); }
.em-res { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.em-op { text-align: left; background: #F4F8F7; border: 1px solid #DCE5E2; border-radius: 8px; padding: 8px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.em-op:hover { background: #E7F1EE; }
.em-op.en-deposito { background: #E3F2EC; border-color: #0E7A5C; font-weight: 600; }
.em-deposito { border: 1px dashed #9BC7B8; border-radius: 10px; padding: 10px 12px; margin: 8px 0; background: #FAFDFC; }
.em-dep-lista { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-height: 220px; overflow: auto; }
.em-dep-item { display: flex; align-items: center; gap: 8px; }
.em-dep-item > span { flex: 1; display: flex; flex-direction: column; }
.em-dep-item input { width: 64px; }
.em-sub { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 6px; }
.em-sub .btn { text-transform: none; letter-spacing: 0; margin-left: 8px; vertical-align: middle; }
.em-alarmas { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; }
.em-alarma { display: flex; flex-direction: column; gap: 2px; } .em-alarma .check { font-size: 13px; margin: 0; }
.em-sug { display: flex; gap: 12px; align-items: flex-start; border: 2px solid #8A99A6; border-radius: 10px; padding: 10px 12px; margin: 12px 0; }
.em-sug ul { margin: 4px 0 0; padding-left: 18px; } .em-sug .em-nivel { width: 38px; height: 38px; font-size: 18px; }
@media (max-width: 640px) { .em-der { text-align: left; flex-basis: 100%; } .em-der .acciones { justify-content: flex-start !important; } }
.em-pend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.em-pend span { font-size: 11px; background: var(--amber-soft); color: var(--amber); border-radius: 999px; padding: 1px 8px; }
.em-nota { margin-bottom: 10px; }
.em-nota h3 { margin: 0; font-size: 14px; }
.em-dx { display: grid; grid-template-columns: 110px 1fr; gap: 8px; margin-bottom: 6px; }
.em-susp td { opacity: .6; }
.em-barra { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 36px; gap: 8px; align-items: center; margin: 4px 0; }
.em-barra div { background: var(--gray-soft); border-radius: 4px; height: 12px; overflow: hidden; }
.em-barra i { display: block; height: 100%; border-radius: 4px; }
.em-horas { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 90px; align-items: end; }
.em-horas div { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.em-horas i { display: block; background: #1F5E97; border-radius: 2px 2px 0 0; min-height: 1px; }
.em-horas span { font-size: 9px; color: var(--muted); text-align: center; height: 12px; }
@media (max-width: 640px) { .em-dx { grid-template-columns: 1fr; } .em-barra { grid-template-columns: 90px 1fr 30px; } }
.em-cuenta { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1100px) { .em-cuenta { grid-template-columns: minmax(0, 1fr); } }
/* hospitalización: censo por habitación */
.ho-paciente { border-left-color: var(--accent, #1F5E97); cursor: pointer; justify-content: flex-start; align-items: flex-start; }
.ho-paciente:hover, .ho-paciente:focus-visible { box-shadow: 0 0 0 2px var(--accent, #1F5E97); outline: none; }
.ho-hab { display: flex; flex-direction: column; align-items: center; min-width: 74px; gap: 2px; font-size: 15px; }
.ho-fila { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line, #D5DCE1); flex-wrap: wrap; }
.ho-fila:first-of-type { border-top: 0; }
button.em-cama { font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.em-cama:hover, button.em-cama:focus-visible { box-shadow: 0 0 0 2px var(--accent, #1F5E97); outline: none; }
.em-precuenta { background: #F2FAF7; border: 1px solid #CFE9DE; border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.em-precuenta div { display: flex; justify-content: space-between; padding: 2px 0; font-size: 14px; }
.em-precuenta .grande { font-size: 17px; color: #0E7A5C; }
.em-precuenta p { margin: 4px 0 0; }
html[data-tema="oscuro"] .em-precuenta { background: rgba(14,122,92,.12); border-color: rgba(14,122,92,.35); }
@media (prefers-color-scheme: dark) { html[data-tema="auto"] .em-precuenta, html:not([data-tema]) .em-precuenta { background: rgba(14,122,92,.12); border-color: rgba(14,122,92,.35); } }
#em-cuerpo > .card + .card, #ex-cuerpo > .card + .card { margin-top: 14px; }
.em-dolor { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.em-dolor button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 0 6px; border: 2px solid var(--line, #DCE5E2); border-radius: 10px; background: #fff; cursor: pointer; overflow: hidden; font: inherit; color: var(--ink, #1d2b36); }
.em-dolor button i { display: block; width: 100%; height: 6px; background: var(--c); }
.em-dolor .cara { font-size: 20px; line-height: 1.2; margin-top: 4px; }
.em-dolor button b { font-size: 14px; }
.em-dolor button:hover { border-color: var(--c); }
.em-dolor button.sel { border-color: var(--c); box-shadow: 0 0 0 2px var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
.em-dolor-pie { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; font-size: 11px; color: var(--muted); margin-top: 4px; text-align: center; }
.em-dolor-pie span:not(:first-child):not(:last-child) { border-top: 2px solid var(--line, #DCE5E2); padding-top: 2px; }
.em-dol-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; border-left: 4px solid var(--c); padding: 0 6px; border-radius: 4px; background: var(--gray-soft); white-space: nowrap; }
.em-grafs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; padding: 0 14px 14px; }
.em-graf { margin: 0; }
.em-graf figcaption { font-size: 13px; margin-bottom: 2px; }
.em-graf svg { width: 100%; height: auto; display: block; }
.em-graf-rej { stroke: #E3E9EE; stroke-width: 1; }
.em-graf-eje { font-size: 10px; fill: #6B7C88; }
.em-graf-banda { fill: #2E7D32; opacity: .07; }
.em-graf-pt:hover circle:last-of-type { r: 7; }
@media (max-width: 640px) { .em-dolor { grid-template-columns: repeat(6, minmax(0, 1fr)); } .em-dolor-pie { display: none; } }
.em-turno { display: inline-flex; align-items: center; gap: 8px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--gray-soft); font-size: 12px; margin-bottom: 4px; }
.em-turno b { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 999px; background: #1F5E97; color: #fff; font-size: 14px; }
.em-turno.vencido b { background: #C62828; }
.em-tarde { color: #C62828; }
.em-puntaje b { color: var(--c); }
.em-calidad { list-style: none; margin: 0; padding: 0; }
.em-calidad li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-top: 1px solid var(--line, #E3E9EE); font-size: 14px; }
.em-calidad li:first-child { border-top: 0; }
.em-calidad li > span { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 999px; font-weight: 700; color: #fff; background: #8A99A6; }
.em-calidad li.si > span { background: #2E7D32; }
.em-calidad li.no > span { background: #C62828; }
.em-calidad li.na { color: var(--muted); }
.em-pje { font-weight: 700; color: var(--c); }
.em-tabla-calidad td { white-space: nowrap; }
.em-tabla-calidad th { white-space: normal; }
.em-auto { position: sticky; top: -1px; z-index: 3; display: flex; gap: 14px; align-items: center; margin: -8px -4px 0; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--c, #8A99A6) 12%, #fff); border: 2px solid var(--c, #8A99A6); box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.em-auto-n { display: grid; place-items: center; flex: none; width: 54px; height: 54px; border-radius: 14px; background: var(--c); color: #fff; font-size: 28px; font-weight: 800; }
.em-auto-t { font-size: 15px; }
.em-auto-r { color: var(--muted); margin-top: 2px; }
.em-vits { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.em-vit { border: 2px solid var(--line, #DCE5E2); border-radius: 12px; padding: 8px 10px; background: #fff; transition: border-color .15s, background .15s; }
.em-vit label { font-size: 12px; font-weight: 600; color: var(--muted); }
.em-vit-in { display: flex; align-items: baseline; gap: 6px; }
.em-vit-in input { width: 100%; min-width: 0; border: 0; border-bottom: 1px solid var(--line, #DCE5E2); border-radius: 0; padding: 2px 0; font-size: 24px; font-weight: 700; background: transparent; }
.em-vit-in input:focus { outline: none; border-bottom-color: #1F5E97; }
.em-vit-in span, .em-vit-in i { font-size: 12px; color: var(--muted); font-style: normal; white-space: nowrap; }
.em-vit-pa { grid-column: span 2; }
.em-vit-pie { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; min-height: 18px; }
.em-vit-est { font-size: 11px; white-space: nowrap; }
.em-vit.ok { border-color: #2E7D32; } .em-vit.ok .em-vit-est { color: #2E7D32; }
.em-vit.fuera { border-color: #C77700; } .em-vit.fuera .em-vit-est { color: #8A5A00; }
.em-vit.nivel { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, #fff); } .em-vit.nivel .em-vit-est { color: var(--ink, #1d2b36); }
.em-gcs { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line, #DCE5E2); border-radius: 12px; background: var(--gray-soft); }
.em-gcs-cab { display: flex; justify-content: space-between; margin-bottom: 6px; }
.em-gcs-fila { margin-top: 6px; }
.em-opciones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.em-opciones button { border: 1px solid var(--line, #DCE5E2); background: #fff; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.em-opciones button.sel { background: #1F5E97; border-color: #1F5E97; color: #fff; }
.em-seg { display: inline-flex; border: 1px solid var(--line, #DCE5E2); border-radius: 10px; overflow: hidden; margin-bottom: 10px; flex-wrap: wrap; }
.em-seg button { border: 0; background: #fff; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.em-seg button.sel { background: #1F5E97; color: #fff; }
.em-caras { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.em-caras button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border: 2px solid var(--line, #DCE5E2); border-top: 6px solid var(--c); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; }
.em-caras .cara { font-size: 34px; line-height: 1.1; }
.em-caras button b { font-size: 13px; }
.em-caras button.sel { border-color: var(--c); box-shadow: 0 0 0 2px var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
.em-chk { display: flex; gap: 6px; align-items: flex-start; padding: 4px 6px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.em-chk:has(input:checked) { background: color-mix(in srgb, var(--c) 14%, #fff); box-shadow: inset 3px 0 0 var(--c); font-weight: 600; }
.em-niveles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 8px 0; }
.em-niveles button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 2px solid var(--c); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; font-size: 12px; }
.em-niveles button b { font-size: 20px; color: var(--c); }
.em-niveles button.sel { background: var(--c); color: #fff; } .em-niveles button.sel b { color: #fff; }
@media (max-width: 640px) { .em-vit-pa { grid-column: auto; } .em-caras { grid-template-columns: repeat(3, minmax(0, 1fr)); } .em-niveles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.em-chk input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; flex: none; margin: 2px 0 0; padding: 0; }
@media (max-width: 640px) { .em-vits { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .em-vits .em-vit-pa { grid-column: span 2; } .em-vit-in input { font-size: 20px; } .em-vit-pie > span.xs { display: none; } }
.em-epi { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 600; color: #8E1B1B; background: #FDECEA; border-radius: 6px; padding: 2px 8px; }
.em-ic { border-left: 4px solid #1F5E97; margin-bottom: 10px; }
.em-ic.vencida { border-left-color: #C62828; }
.em-ic-cab { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.em-ic-resp { margin-top: 6px; padding: 8px 10px; background: var(--gray-soft); border-radius: 8px; }
.em-med { display: grid; grid-template-columns: 2.2fr 1fr 0.9fr 1.2fr 1fr 0.8fr 1.8fr auto; gap: 6px; margin-bottom: 6px; align-items: center; }
.em-med input, .em-med select { min-width: 0; }
@media (max-width: 900px) { .em-med { grid-template-columns: 1fr 1fr; padding: 8px; border: 1px solid var(--line, #DCE5E2); border-radius: 10px; } .em-med [data-k="medicamento"], .em-med [data-k="indicaciones"] { grid-column: span 2; } }

/* quirófano: etapas de la cirugía y el siguiente paso */
.qx-etapas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.qx-etapas span { font-size: 12px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--borde, #D9E1EA); color: var(--muted, #5B6B7C); }
.qx-etapas span.ok { background: #E8F5EC; border-color: #A9D8B8; color: #1F6B3A; }
.qx-siguiente { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px;
  border-radius: 10px; background: #EEF5FC; }
.qx-item { padding: 8px 0; border-bottom: 1px solid var(--borde, #E3E8EE); }
.qx-item:last-of-type { border-bottom: 0; }
html[data-tema="oscuro"] .qx-etapas span.ok { background: #183524; border-color: #2E6B45; color: #9FD9B3; }
html[data-tema="oscuro"] .qx-siguiente { background: #1A2A3B; }
@media (prefers-color-scheme: dark) {
  html[data-tema="auto"] .qx-etapas span.ok, html:not([data-tema]) .qx-etapas span.ok { background: #183524; border-color: #2E6B45; color: #9FD9B3; }
  html[data-tema="auto"] .qx-siguiente, html:not([data-tema]) .qx-siguiente { background: #1A2A3B; }
}

/* expediente de hospitalización: historia por partes, Kardex */
.hi-fila { display: flex; gap: 6px; align-items: center; }
.hi-fila input { flex: 1; min-width: 0; }
.hi-lista { display: grid; gap: 6px; margin-bottom: 10px; }
.hi-sis { display: grid; grid-template-columns: minmax(140px, 220px) auto 1fr; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line, #E3E8EE); }
.hi-op { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.hi-op label { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
@media (max-width: 640px) { .hi-sis { grid-template-columns: 1fr; } }
.kx-tabla td { vertical-align: top; }
.kx-dosis { display: inline-flex; flex-direction: column; align-items: center; min-width: 54px; padding: 4px 6px; margin: 2px; border: 1px solid var(--line, #D9E1EA);
  border-radius: 8px; background: var(--card, #fff); color: inherit; font: inherit; font-size: 12px; line-height: 1.2; cursor: pointer; }
.kx-dosis[disabled] { cursor: default; }
.kx-dosis:not([disabled]):hover { outline: 2px solid var(--primary, #1F5E97); }
.kx-dosis .xs { font-size: 10px; opacity: .85; }
.kx-dosis.t-verde, .kx-dosis.t-rojo, .kx-dosis.t-ambar, .kx-dosis.t-gris { border-color: transparent; }
.hi-op input[type="radio"], .hi-op input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; flex: none; box-shadow: none; }
#hx-dia { width: auto; }
/* listado de ingresados y egresos de hospitalización */
.ho-filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 10px; }
.ho-filtros > input[type="search"] { flex: 2 1 260px; }
.ho-filtros > select { flex: 1 1 170px; width: auto; }
.ho-filtros .campo { margin: 0; flex: 0 1 170px; }
.ho-tabla tbody tr { cursor: pointer; }
.ho-tabla tbody tr:hover, .ho-tabla tbody tr:focus-visible { background: var(--soft, #F6F8FA); outline: none; }
.ho-tabla tbody tr:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--blue, #3E86C8); }
.ho-avisos .tag { margin: 1px 0; }
.ho-tabla td.ho-avisos { white-space: normal; min-width: 150px; }
.ho-tabla td:nth-child(2) { min-width: 170px; }
.ex-volver { margin-bottom: 8px; font-weight: 700; }
/* expediente de hospitalización: menú de secciones a la izquierda (médico, enfermería, administración) */
.hx-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.hx-nav { position: sticky; top: 76px; background: var(--card, #fff); border: 1px solid var(--line, #E3E8EE); border-radius: 12px; padding: 8px; }
.hx-grupo { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #6B7785); padding: 12px 10px 4px; }
.hx-grupo:first-child { padding-top: 4px; }
.hx-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; background: none; border: 0;
  border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink, #1F2D3D); cursor: pointer; }
.hx-item:hover { background: var(--soft, #F3F6F9); }
.hx-item.activo { background: var(--navy, #14304A); color: #fff; }
.hx-n { font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 6px; background: var(--soft, #EEF2F6); color: var(--ink, #1F2D3D); }
.hx-n.alerta { background: #FDECEA; color: #B42318; }
.hx-n.ok { background: #E7F6EE; color: #0E7A5C; }
.hx-item.activo .hx-n { background: rgba(255, 255, 255, .2); color: #fff; }
.hx-titulo { margin: 0 0 12px; font-size: 20px; }
.hx-def th { width: 32%; text-align: left; font-weight: 700; vertical-align: top; }
.hx-h4 { margin: 12px 0 6px; font-size: 14px; }
.hx-mas { position: relative; display: inline-block; }
.hx-mas > summary { list-style: none; }
.hx-mas > summary::-webkit-details-marker { display: none; }
.hx-mas-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--card, #fff); border: 1px solid var(--line, #E3E8EE);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(20, 48, 74, .15); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.hx-mas-menu .btn { justify-content: flex-start; border: 0; width: 100%; text-align: left; }
@media (max-width: 900px) {
  .hx-layout { grid-template-columns: 1fr; }
  .hx-nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding: 6px; }
  .hx-grupo { display: none; }
  .hx-item { width: auto; white-space: nowrap; flex: 0 0 auto; }
}
.hx-def th { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink, #1F2D3D); }
/* notas médicas de hospitalización: por día, con su nombre */
.nn-dia { margin-bottom: 10px; }
.nn-dia > summary { cursor: pointer; padding: 10px 12px; background: var(--card, #fff); border: 1px solid var(--line, #E3E8EE); border-radius: 10px; }
.nn-dia[open] > summary { margin-bottom: 10px; }
.nn-dia > summary b { text-transform: capitalize; }
.nn-atajos { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.chip-nota { border: 1px solid var(--line, #D5DCE4); background: var(--card, #fff); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip-nota:hover { border-color: var(--navy, #14304A); }
.chip-nota.activo { background: var(--navy, #14304A); color: #fff; border-color: var(--navy, #14304A); }
/* hoja de temperatura gráfica */
.tp-leyenda { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 8px; }
.tp-leyenda i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 4px; }
.tp-leyenda i.hueco { background: #fff; border: 2px solid; }
.tp-svg { display: block; max-width: none; font-family: inherit; }
.tp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hx-panel { min-width: 0; }
/* cabecera compacta del expediente de hospitalización */
.hx-cab { background: var(--card, #fff); border: 1px solid var(--line, #E3E8EE); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.hx-cab-fila { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hx-nombre { margin: 0; font-size: 20px; line-height: 1.2; }
.hx-etq { font-size: 13px; font-weight: 600; color: var(--muted, #6B7785); margin-left: 4px; }
.hx-datos { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 13px; color: var(--ink, #1F2D3D); }
.hx-datos > span { white-space: nowrap; }
.hx-datos > span:last-child { white-space: normal; }
.hx-avisos { margin-top: 8px; padding: 6px 10px; border-radius: 8px; background: #FFF6E5; font-size: 12.5px; display: grid; gap: 2px; }
.hx-rojo { color: #B42318; font-weight: 600; }
.hx-falta { padding: 0; font-size: inherit; text-align: left; text-decoration: underline dotted; text-underline-offset: 3px; }
.hx-falta.hx-rojo { color: #B42318; }
.hx-avisos .hx-falta:not(.hx-rojo) { color: inherit; font-weight: 600; }
.hx-titulo { margin: 2px 0 10px; font-size: 18px; }
.hx-nav { top: 70px; }
@media (max-width: 900px) { .hx-datos > span { white-space: normal; } }
/* tarjeta de plan: título de cada sección (CRM, HIS, ERP) */
.plan-sec { margin-top: 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #0E7A5C; }
.plan-sec:first-child { margin-top: 0; }

/* «Ver como» del equipo de Softnest: resaltado cuando mira un solo cliente */
#ver-cuenta.ver-activo { border-color: var(--amber, #F2B632); box-shadow: 0 0 0 2px rgba(242, 182, 50, .35); font-weight: 600; }
@media (max-width: 900px) { #ver-cuenta { max-width: 150px; } }

/* Agenda de servicios: una columna por sala con sus citas del día */
.sv-barra { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.sv-barra input[type=date] { width: auto; }
.sv-salas { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.sv-sala h3 { margin: 0 0 6px; }
.sv-cita { border: 1px solid var(--line, #D9E3E0); border-left: 4px solid #0E7A5C; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.sv-cita.apagada { opacity: .55; border-left-color: #B9C4C1; }
.sv-cita-cab { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 2px; }
.sv-horas { display: flex; flex-wrap: wrap; gap: 6px; }
.sv-horas .chip-sel { background: none; font: inherit; font-size: 13px; }
.sv-horas .chip-sel.activo { border-color: #0E7A5C; background: #0E7A5C; color: #fff; }
.sv-horario input[type=time] { width: auto; min-width: 96px; }

/* Turnos: el puesto que llama, la fila, el ticket y los tiempos de espera */
.tn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.tn-actual { text-align: center; }
.tn-actual .acciones { justify-content: center; }
.tn-grande { font-size: 64px; font-weight: 900; line-height: 1.1; color: var(--primary); letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.tn-llamar { font-size: 18px; padding: 14px 28px; }
.tn-cod { display: inline-block; min-width: 64px; font-variant-numeric: tabular-nums; }
.tn-fila .acciones { flex-wrap: nowrap; }
.tn-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tn-area { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); font: inherit; cursor: pointer; text-align: left; }
.tn-area:hover { border-color: var(--green); background: var(--green-soft); }
.tn-area b { font-size: 24px; color: var(--primary); }
.tn-area small { color: var(--muted); }
.tn-ticket { text-align: center; padding: 10px; border: 2px dashed var(--line); border-radius: 12px; }
.tn-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 12px; }
.tn-kpis .card { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.tn-kpis b { font-size: 26px; color: var(--primary); }
.tn-barra-h { display: grid; grid-template-columns: 64px 1fr 32px 64px; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 4px; }
.tn-barra-h div { background: var(--gray-soft); border-radius: 4px; height: 12px; }
.tn-barra-h i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.tn-enlaces { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.tn-enlaces > div { padding: 12px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }

/* caja con seguro: porcentaje por grupo y por línea */
.pv-grupos { background: var(--amber-soft); border-radius: 10px; padding: 10px 12px; margin: 0 0 8px; display: flex; flex-direction: column; gap: 6px; }
.pv-gr-fila { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.pv-gr-campo { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; white-space: nowrap; margin: 0; }
.pv-gr-campo input { width: 64px; padding: 4px 6px; }
td.pv-cubre { min-width: 104px; }
td.pv-cubre > input { width: 96px; }
.pv-pct { display: flex; gap: 4px; align-items: center; margin-top: 4px; font-size: 13px; white-space: nowrap; }
.pv-pct input { width: 64px; padding: 4px 6px; }

/* informe semanal Epi-1 (vigilancia epidemiológica) */
.ep-tabla th { padding: 6px 4px; font-size: 11px; }
.ep-tabla td { padding: 3px 6px; }
.ep-tabla td.ep-cod { font-size: 11px; color: var(--muted); max-width: 120px; word-break: break-word; }
.ep-tabla td.ep-nom { min-width: 280px; font-size: 13px; line-height: 1.3; }
.ep-tabla td.ep-n { width: 50px; text-align: center; padding: 3px 2px; }
.ep-tabla td.ep-n input { width: 44px; text-align: center; padding: 3px 0; -moz-appearance: textfield; }
.ep-tabla td.ep-n input::-webkit-outer-spin-button, .ep-tabla td.ep-n input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ep-tabla td.ep-t { font-weight: 700; }
.ep-tabla td.ep-aj, .ep-tabla td.ep-aj input { background: var(--amber-soft); }
.ep-tabla td.ep-gris { background: var(--gray-soft); }
.ep-tabla tr.ep-sel td { background: var(--blue-soft); }
.ep-tabla .ep-fila { text-align: left; }
.timbrado-vista.sello { height: 120px; }
/* «Arma tu plan»: módulos con su precio, en columnas por sección */
.am-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 22px; margin-top: 10px; }
.am-sec { margin-top: 10px; }
.am-mod { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.am-mod:hover { background: var(--soft); }
.am-mod.on { background: var(--green-soft); }
.am-mod input { width: auto; margin: 0; }
.am-mod span { flex: 1; }
.am-mod b { white-space: nowrap; font-size: 12px; }
/* dictado por voz */
.btn.dictar { height: 26px; padding: 0 10px; font-size: 12px; margin-left: 6px; vertical-align: middle; }
.btn.dictar.grabando { background: var(--red, #C0392B); border-color: var(--red, #C0392B); color: #fff; animation: dictado-pulso 1.2s ease-in-out infinite; }
@keyframes dictado-pulso { 50% { box-shadow: 0 0 0 6px rgba(192, 57, 43, .18); } }
@media (prefers-reduced-motion: reduce) { .btn.dictar.grabando { animation: none; } }
.dictado-vivo { font-weight: 400; font-style: italic; margin-left: 6px; }
/* escuchar al paciente (transcripción con su permiso) */
.escucha-panel { margin-top: 8px; padding: 12px; border: 1px solid var(--line, #DCE3EA); border-radius: 10px; background: var(--soft, #F6F9FB); }
.escucha-panel .esc-texto { margin-top: 8px; max-height: 180px; overflow: auto; white-space: pre-wrap; font-size: 14px; line-height: 1.5; }
.escucha-panel .esc-punto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--red, #C0392B); margin-right: 4px; animation: dictado-pulso 1.2s ease-in-out infinite; }
.escucha-panel .esc-punto.pausa { background: var(--muted, #8A99A6); animation: none; }
@media (prefers-reduced-motion: reduce) { .escucha-panel .esc-punto { animation: none; } }

/* «Todas» al lado del título de una lista de casillas (seguros/ARS) */
.todas-chk { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; font-weight: 600; color: var(--verde, #0E7A5C); cursor: pointer; }
