/* ADHENNA Salud · Sistema para centros médicos
   Estilo de la casa ADHENNA (el mismo del Control, el Captador y la Hotelería): azul marino con degradado,
   azul ADHENNA #005BFF, tarjetas con sombra y el logo de `logos.css`. Sin tipografías de internet: funciona
   sin conexión. El verde azulado (--clin) queda solo para lo clínico («en atención»). Tiene modo oscuro. */
:root {
  color-scheme: light;
  --bg: #EEF2F8;
  --surface: #FFFFFF;
  --surface-2: #F4F7FC;
  --surface-3: #E7ECF4;
  --ink: #0E1525;
  --ink-2: #3B4A63;
  --muted: #5E6B80;
  --line: #DDE3ED;
  --blue: #005BFF;
  --blue-700: #0046CC;
  --pastel-1: #E9F1FF;
  --pastel-2: #D6E4FF;
  --pastel-3: #B9D1FF;
  --pastel-4: #7FB0FF;
  --marino: #071A45;
  --marino-2: #0B2A6F;
  --titulo: #071A45;
  --grad: linear-gradient(120deg, #061638 0%, #0B2A6F 55%, #0F48C8 100%);
  --grad-v: linear-gradient(175deg, #061638 0%, #0A2463 58%, #0F48C8 135%);
  --grad-azul: linear-gradient(135deg, #005BFF 0%, #2F7BFF 100%);
  --clin: #0E9F9A;
  --clin-bg: #E6F7F6;
  --ok: #0E9F6E;
  --ok-bg: #E2F7EE;
  --ok-line: #A8E2C8;
  --warn: #8A5A00;
  --warn-bg: #FFF3D6;
  --warn-line: #F3D58A;
  --bad: #B42318;
  --bad-bg: #FDE7E7;
  --bad-line: #F3B9B9;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(7, 26, 69, .06), 0 6px 20px rgba(7, 26, 69, .07);
  --shadow-lg: 0 10px 30px rgba(7, 26, 69, .18);
  --font-title: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: ui-monospace, Consolas, "Cascadia Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #070D1C; --surface: #0F182B; --surface-2: #141F36; --surface-3: #1B2944;
    --ink: #EEF2F8; --ink-2: #C1C8D4; --muted: #8E9AB0; --line: #22304D; --titulo: #EEF2F8;
    --blue: #3D84FF; --blue-700: #8AB4FF; --pastel-1: #12224A; --pastel-2: #1B3160; --pastel-3: #24427F; --pastel-4: #3359A6;
    --clin: #2CC5BE; --clin-bg: #0F2F31;
    --ok: #34C38F; --ok-bg: #0E2A20; --ok-line: #1B4E3B; --warn: #E9A93A; --warn-bg: #2E230C; --warn-line: #57421A; --bad: #F06A6E; --bad-bg: #331417; --bad-line: #5C2629;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070D1C; --surface: #0F182B; --surface-2: #141F36; --surface-3: #1B2944;
  --ink: #EEF2F8; --ink-2: #C1C8D4; --muted: #8E9AB0; --line: #22304D; --titulo: #EEF2F8;
  --blue: #3D84FF; --blue-700: #8AB4FF; --pastel-1: #12224A; --pastel-2: #1B3160; --pastel-3: #24427F; --pastel-4: #3359A6;
  --clin: #2CC5BE; --clin-bg: #0F2F31;
  --ok: #34C38F; --ok-bg: #0E2A20; --ok-line: #1B4E3B; --warn: #E9A93A; --warn-bg: #2E230C; --warn-line: #57421A; --bad: #F06A6E; --bad-bg: #331417; --bad-line: #5C2629;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14.5px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
h1, h2, h3, h4 { font-family: var(--font-title); margin: 0; letter-spacing: -.2px; color: var(--titulo); }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.hidden { display: none !important; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ok-t { color: var(--ok); } .bad-t { color: var(--bad); } .warn-t { color: var(--warn); }

/* ── Franjas: motivo tomado de la "E" del logo ── */
.stripes { display: grid; gap: 4px; }
.stripes i { display: block; height: 5px; border-radius: 3px; background: var(--pastel-3); }
.stripes i:nth-child(1) { width: 100%; background: var(--pastel-2); }
.stripes i:nth-child(2) { width: 72%; background: var(--pastel-3); }
.stripes i:nth-child(3) { width: 44%; background: var(--pastel-4); }
.band { height: 5px; background: var(--grad); flex: none; }
/* Logo ADHENNA (logos.css trae las dos versiones): `logo-auto` muestra la que corresponde al modo claro u oscuro */
.logo { display: block; aspect-ratio: 5 / 1; width: 170px; max-width: 100%; }
.logo-auto .logo-oscuro { display: none; }
:root[data-theme="dark"] .logo-auto .logo-claro { display: none; }
:root[data-theme="dark"] .logo-auto .logo-oscuro { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-auto .logo-claro { display: none; }
  :root:not([data-theme="light"]) .logo-auto .logo-oscuro { display: block; }
}

/* ── Ingreso: a la izquierda la marca sobre el degradado marino, a la derecha el formulario ── */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.login-arte { position: relative; overflow: hidden; background: var(--grad); color: #fff; padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.login-arte::before { content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 36px 36px; -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); }
.login-arte::after { content: ""; position: absolute; width: 420px; height: 420px; right: -140px; bottom: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(47,123,255,.55), transparent 65%); }
.login-arte > * { position: relative; z-index: 1; }
.login-arte .logo { width: 300px; }
.login-producto { display: inline-flex; align-items: center; gap: 9px; align-self: flex-start; padding: 6px 13px; border-radius: 99px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); font-weight: 600; font-size: 13.5px; letter-spacing: .04em; color: #DCE7FF; }
.login-producto svg.i { color: #7FB0FF; }
.login-arte h2 { font-size: 32px; font-weight: 700; margin: 4px 0 0; max-width: 480px; color: #fff; line-height: 1.15; }
.resalte { background: linear-gradient(90deg, #7FB0FF, #B9D3FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-puntos { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.login-puntos li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: #D7E4FF; }
.login-puntos svg.i { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.15); }
.login-pie { color: #7FB0FF; letter-spacing: .25em; text-transform: uppercase; font-size: 11.5px; margin: 10px 0 0; }
.login-card { align-self: center; justify-self: center; width: 100%; max-width: 420px; padding: 32px 26px; display: grid; gap: 16px; }
.login-card .logo { width: 200px; }
.login-card h1 { font-size: 28px; }
.login-card .centro { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); margin-top: -8px; }
.login-demo { padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn); font-size: 13px; }
.roles-hint { display: flex; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.roles-hint button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 20px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ink-2); display: inline-flex; gap: 5px; align-items: center; }
.roles-hint button:hover { border-color: var(--pastel-4); color: var(--blue); }
.roles-hint svg.i { width: 14px; height: 14px; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-arte { padding: 28px 22px; gap: 12px; }
  .login-arte .logo { width: 210px; }
  .login-arte h2 { font-size: 22px; }
  .login-puntos, .login-pie { display: none; }
}

/* ── Formularios ── */
label.f { display: grid; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
label.f .opt { font-weight: 400; color: var(--muted); }
input:not([type]), input[type=text], input[type=number], input[type=password], input[type=tel], input[type=email], input[type=date], input[type=month], input[type=time], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; min-height: 42px;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 91, 255, .15); }
input.err { border-color: var(--bad); }
textarea { min-height: 76px; resize: vertical; }
.grid { display: grid; gap: 14px; align-content: start; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.full { grid-column: 1 / -1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.nw { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 10px; align-content: start; }
.chk { display: inline-flex; gap: 8px; align-items: center; font-size: 13.5px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--blue); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--blue-700); box-shadow: 0 1px 3px rgba(7, 26, 69, .14); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 9px 15px; font-weight: 700; cursor: pointer; background: var(--grad-azul); color: #fff; min-height: 40px; white-space: nowrap; transition: box-shadow .15s, transform .05s, background .15s, border-color .15s; text-decoration: none; box-shadow: 0 4px 14px rgba(0, 91, 255, .28); }
.btn:hover { box-shadow: 0 6px 18px rgba(0, 91, 255, .42); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn.sec { background: var(--surface); color: var(--ink); border-color: var(--line); font-weight: 600; box-shadow: none; }
.btn.sec:hover { border-color: var(--pastel-3); box-shadow: 0 2px 8px rgba(0, 91, 255, .12); }
.btn.soft { background: var(--pastel-1); color: var(--blue-700); box-shadow: none; }
.btn.soft:hover { background: var(--pastel-2); box-shadow: none; }
.btn.clin { background: linear-gradient(135deg, #0E9F9A, #2CC5BE); box-shadow: 0 4px 14px rgba(14, 159, 154, .28); }
.btn.clin:hover { box-shadow: 0 6px 18px rgba(14, 159, 154, .4); }
.btn.dark { background: var(--grad); box-shadow: 0 4px 14px rgba(7, 26, 69, .28); }
.btn.ok { background: linear-gradient(135deg, #0E9F6E, #2DBE8A); box-shadow: 0 4px 14px rgba(14, 159, 110, .3); }
.btn.wa { background: #1FAF54; box-shadow: 0 4px 14px rgba(31, 175, 84, .28); }
.btn.bad { background: var(--surface); color: var(--bad); border-color: var(--bad-line); box-shadow: none; font-weight: 600; }
.btn.bad:hover { background: var(--bad-bg); box-shadow: none; }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.btn.lg { padding: 13px 20px; min-height: 52px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 7px; border-radius: 9px; color: var(--ink-2); display: inline-grid; place-items: center; position: relative; }
.icon-btn:hover { background: var(--pastel-1); color: var(--blue); }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.lg { width: 24px; height: 24px; }
svg.i.xl { width: 30px; height: 30px; stroke-width: 1.6; }

/* Ícono de especialidad: chip redondeado con el color propio de cada servicio */
.esp-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c, #005BFF) 13%, var(--surface)); color: var(--c, #005BFF); }
.esp-ic.sm { width: 28px; height: 28px; border-radius: 8px; }
.esp-ic.sm svg.i { width: 16px; height: 16px; }
.esp-ic.lg { width: 48px; height: 48px; border-radius: 14px; }
.esp-ic.lg svg.i { width: 26px; height: 26px; }
.esp-ic.xl { width: 64px; height: 64px; border-radius: 18px; }
.esp-ic.xl svg.i { width: 34px; height: 34px; stroke-width: 1.5; }
.cruz { width: 34px; height: 34px; border-radius: 10px; background: var(--grad-azul); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 4px 12px rgba(0, 91, 255, .28); }
.cruz svg.i { stroke-width: 2.4; }

/* ── Shell ── */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: var(--grad-v); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 22px 20px 16px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.side .brand .logo { width: 158px; }
.side .brand .app { margin-top: 16px; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 9px; color: #fff; }
.side .brand .empresa { font-size: 12px; color: #9DB8EE; margin-top: 3px; }
.nav { padding: 12px 10px; display: grid; gap: 3px; overflow-y: auto; flex: 1; align-content: start; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.nav .sec-t { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: #7FA2E6; padding: 12px 12px 4px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 11px; color: #C9D8F5; text-decoration: none; font-weight: 500; position: relative; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a.on { background: var(--grad-azul); color: #fff; font-weight: 700; box-shadow: 0 6px 16px rgba(0, 91, 255, .35); }
.nav a .badge { margin-left: auto; background: #fff; color: var(--marino-2); }
.side .yo { border-top: 1px solid rgba(255, 255, 255, .1); padding: 12px 14px; display: flex; align-items: center; gap: 8px; }
.side .yo .icon-btn { color: #C9D8F5; }
.side .yo .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.side .yo .avatar { background: rgba(255, 255, 255, .14); color: #fff; }
.side .yo .esp-ic { background: rgba(255, 255, 255, .14); color: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--pastel-2); color: var(--blue-700); display: grid; place-items: center; font-weight: 700; flex: none; font-size: 13px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.side .yo .who { flex: 1; min-width: 0; }
.side .yo .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.side .yo .who span { font-size: 11.5px; color: #9DB8EE; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 10px; padding: 16px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.top .titulo { flex: 1; min-width: 0; }
.top .titulo .crumb { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.top h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .menu-btn { display: none; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: 5px 11px; border-radius: 20px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--ok); animation: pulso 2s infinite; }
.dot.off { background: var(--bad); }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(14, 159, 110, .45); } 70% { box-shadow: 0 0 0 8px rgba(14, 159, 110, 0); } 100% { box-shadow: 0 0 0 0 rgba(14, 159, 110, 0); } }
.content { padding: 8px 28px 40px; display: grid; gap: 18px; align-content: start; grid-template-columns: minmax(0, 1fr); }
.content > * { min-width: 0; }
.bottom-nav { display: none; }

/* ── Tarjetas ── */
.card { background: var(--surface); border: 1px solid var(--line); overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card > .hd { display: flex; align-items: center; gap: 10px; padding: 15px 18px 0; flex-wrap: wrap; }
.card > .hd h2, .card > .hd h3 { flex: 1; min-width: 0; }
.card > .hd .sub { width: 100%; font-size: 12.5px; color: var(--muted); margin-top: -6px; }
.card > .bd { padding: 15px 18px 18px; }
.card.pastel { background: linear-gradient(180deg, var(--pastel-1), var(--surface) 70%); }
.card.pad0 > .bd { padding: 8px 0 0; }
.cols-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cols-2b { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 14px; box-shadow: var(--shadow); position: relative; overflow: hidden; min-width: 0; }
.kpi .lbl { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; gap: 6px; align-items: center; }
.kpi .val { color: var(--titulo); font-family: var(--font-title); font-size: clamp(19px, 1.5vw, 26px); font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.kpi .stripes { position: absolute; right: 14px; top: 16px; width: 44px; }
.kpi.azul { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 22px rgba(7, 26, 69, .28); }
.kpi.azul .lbl, .kpi.azul .sub { color: rgba(255, 255, 255, .85); }
.kpi.azul .val { color: #fff; }
.kpi.azul .lbl { padding-right: 50px; }
.kpi.azul .stripes i { background: rgba(255, 255, 255, .35); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 12px; padding: 1px 7px; border-radius: 10px; }
.delta.up { background: var(--ok-bg); color: var(--ok); }
.delta.down { background: var(--bad-bg); color: var(--bad); }
.kpi.azul .delta { background: rgba(255, 255, 255, .18); color: #fff; }

/* ── Tablas ── */
.tabla-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--pastel-1); }
table.t td.r, table.t th.r { text-align: right; }
table.t tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
.vacio { text-align: center; padding: 34px 16px; color: var(--muted); }
.vacio .stripes { width: 70px; margin: 0 auto 12px; }

/* ── Etiquetas ── */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.tag svg.i { width: 13px; height: 13px; }
.tag.azul { background: var(--pastel-1); color: var(--blue-700); border-color: var(--pastel-2); }
.tag.clin { background: var(--clin-bg); color: var(--clin); border-color: transparent; }
.tag.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.tag.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.tag.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.tag.dark { background: var(--marino); color: #fff; border-color: var(--marino); }
.tag.violeta { background: color-mix(in srgb, #6E56CF 14%, var(--surface)); color: #6E56CF; border-color: transparent; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--grad-azul); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.badge.bad { background: var(--bad); }
.alergia { display: inline-flex; gap: 6px; align-items: center; background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad-line); border-radius: 8px; padding: 4px 9px; font-weight: 600; font-size: 12.5px; }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; padding: 7px 13px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--ink-2); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button.on { background: var(--grad-azul); color: #fff; box-shadow: 0 3px 10px rgba(0, 91, 255, .3); }
.tabs button .badge { height: 18px; min-width: 18px; font-size: 10.5px; }

/* ── Modal ── */
.modal-bg { position: fixed; inset: 0; background: rgba(7, 26, 69, .5); z-index: 1000; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; animation: sube .2s ease-out; }
.modal.xl { max-width: 980px; }
.modal.lg { max-width: 780px; }
.modal .mh { display: flex; align-items: center; gap: 10px; padding: 18px 22px 12px; }
.modal .mh h2 { flex: 1; min-width: 0; }
.modal .mb { padding: 6px 22px 18px; overflow-y: auto; }
.modal .mf { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes sube { from { transform: translateY(14px); opacity: 0; } }

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 2000; display: grid; gap: 8px; max-width: calc(100vw - 36px); }
.toast { background: var(--marino); color: #fff; padding: 11px 15px; border-radius: 11px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; gap: 9px; align-items: center; animation: sube .2s; max-width: 400px; }
.toast.err { background: #C62F35; }
.toast.ok { background: #0B8A60; }
.toast.azul { background: var(--grad-azul); }
.toast.msj { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid #25D366; align-items: flex-start; }
.toast.msj.web { border-left-color: var(--blue); }
.toast.msj b { font-size: 13.5px; }
.toast.msj .msj-o { margin-left: 8px; font-size: 11px; color: var(--muted); }
.toast.msj .msj-ic { width: 30px; height: 30px; border-radius: 50%; background: #E8F9EE; color: #128C4B; display: grid; place-items: center; flex: none; }
.toast.msj.web .msj-ic { background: var(--pastel-1); color: var(--blue); }

.lista-busqueda { border: 1px solid var(--line); border-radius: 10px; max-height: 240px; overflow-y: auto; background: var(--surface); }
.lista-busqueda > div { padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13.5px; display: flex; gap: 10px; align-items: center; }
.lista-busqueda > div:last-child { border-bottom: 0; }
.lista-busqueda > div:hover, .lista-busqueda > div.on { background: var(--pastel-1); }

.alerta { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; cursor: pointer; }
.alerta svg.i { margin-top: 1px; }
.alerta.alto { background: var(--bad-bg); border-color: var(--bad-line); }
.alerta.alto svg.i { color: var(--bad); }
.alerta.medio { background: var(--warn-bg); border-color: var(--warn-line); }
.alerta.medio svg.i { color: var(--warn); }

.barra { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.barra > i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.barra.ok > i { background: var(--ok); }
.barra.warn > i { background: var(--warn); }
.barra.bad > i { background: var(--bad); }

/* ── Gráficos (SVG propio) ── */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-family: var(--font); font-size: 11px; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--blue); transition: opacity .12s; }
.chart .bar.hoy { fill: var(--marino-2); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .bar, .chart g.b:hover .bar { opacity: .75; }
.viz-tip { position: fixed; z-index: 3000; pointer-events: none; background: var(--ink); color: var(--bg); padding: 7px 10px; border-radius: 8px; font-size: 12.5px; box-shadow: var(--shadow-lg); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.viz-tip b { font-family: var(--font-title); }
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(0, 190px) 1fr auto; gap: 12px; align-items: center; font-size: 13px; }
.hbar .nm { display: flex; gap: 8px; align-items: center; min-width: 0; }
.hbar .nm span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .tr { height: 12px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.hbar .tr i { display: block; height: 100%; background: var(--blue); border-radius: 0 4px 4px 0; }
.hbar .v { font-family: var(--font-title); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 92px; text-align: right; }
.leyenda { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; }
.donut-wrap .leyenda { display: grid; gap: 8px; }
.donut-wrap .leyenda span { justify-content: space-between; gap: 14px; }
.donut-wrap .leyenda b { font-family: var(--font-title); font-variant-numeric: tabular-nums; }
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring .c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .c b { font-family: var(--font-title); font-size: 26px; display: block; line-height: 1; }
.ring .c span { font-size: 11px; color: var(--muted); }
.heat { display: grid; grid-template-columns: 34px repeat(13, minmax(0, 1fr)); gap: 3px; font-size: 11px; color: var(--muted); }
.heat .cell { aspect-ratio: 1.6; border-radius: 4px; background: var(--surface-3); }
.heat .h { text-align: center; }

/* ── Agenda ── */
.agenda-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.agenda-bar .fecha-t { font-family: var(--font-title); font-weight: 600; font-size: 17px; min-width: 210px; text-align: center; }
.agenda-scroll { overflow: auto; max-height: calc(100vh - 220px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.agenda { display: grid; position: relative; min-width: fit-content; }
.agenda .hcol { position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--line); }
.agenda .hcol div { height: 72px; font-size: 11px; color: var(--muted); text-align: right; padding: 2px 8px 0 0; border-top: 1px solid var(--line); font-family: var(--mono); }
.agenda .head { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 10px; display: flex; align-items: center; gap: 8px; min-height: 58px; border-left: 1px solid var(--line); }
.agenda .head.corner { left: 0; z-index: 5; border-left: 0; }
.agenda .head b { font-size: 12.5px; display: block; line-height: 1.2; }
.agenda .head span { font-size: 11px; color: var(--muted); }
.agenda .col { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 36px); }
.agenda .col .fuera { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface-3) 6px 8px); opacity: .9; }
.agenda .col .slot { position: absolute; left: 0; right: 0; cursor: pointer; z-index: 1; }
.agenda .col .slot:hover { background: var(--pastel-1); outline: 1px dashed var(--pastel-4); outline-offset: -1px; }
.agenda .col .slot:hover::after { content: '+ ' attr(data-h); position: absolute; left: 8px; top: 3px; font-size: 11px; color: var(--blue); font-weight: 600; }
.agenda .ahora { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 2; }
.agenda .ahora::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.cita { position: absolute; left: 3px; right: 3px; border-radius: 8px; padding: 4px 7px; font-size: 11.5px; overflow: hidden; cursor: pointer; z-index: 2; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--blue)); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); line-height: 1.25; transition: box-shadow .12s, transform .12s; }
.cita:hover { box-shadow: var(--shadow-lg); z-index: 3; transform: translateY(-1px); }
.cita b { display: block; padding-right: 34px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.cita .m { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cita .ics { position: absolute; right: 5px; top: 4px; display: flex; gap: 2px; color: var(--muted); background: inherit; }
.cita .ics svg.i { width: 13px; height: 13px; }
.cita.st-confirmada { background: color-mix(in srgb, var(--blue) 6%, var(--surface)); }
.cita.st-en_espera { background: var(--warn-bg); border-color: var(--warn-line); }
.cita.st-en_atencion { background: var(--clin-bg); border-color: color-mix(in srgb, var(--clin) 35%, transparent); }
.cita.st-atendida { background: var(--ok-bg); border-color: var(--ok-line); opacity: .85; }
.cita.st-no_asistio { background: var(--bad-bg); border-color: var(--bad-line); opacity: .75; }
.cita.st-no_asistio b { text-decoration: line-through; }
.cita.st-cancelada { opacity: .4; background: var(--surface-2); }
.cita.st-cancelada b { text-decoration: line-through; }
.st-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: var(--muted); }
.st-dot.agendada { background: var(--pastel-4); } .st-dot.confirmada { background: var(--blue); } .st-dot.en_espera { background: var(--warn); } .st-dot.en_atencion { background: var(--clin); } .st-dot.atendida { background: var(--ok); } .st-dot.no_asistio { background: var(--bad); } .st-dot.cancelada { background: var(--muted); }
.semana .agenda .head { }
.semana .agenda .head.hoy { background: var(--pastel-1); }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 7px; }
.slots button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 9px; padding: 8px 4px; font-weight: 600; cursor: pointer; font-family: var(--font-title); font-variant-numeric: tabular-nums; }
.slots button:hover { border-color: var(--pastel-4); }
.slots button.on { border-color: var(--blue); background: var(--pastel-1); color: var(--blue-700); }
.esp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.esp-op { border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px; display: flex; gap: 10px; align-items: center; cursor: pointer; text-align: left; font-weight: 600; font-size: 13px; line-height: 1.2; }
.esp-op:hover { border-color: var(--pastel-4); }
.esp-op.on { border-color: var(--c, var(--blue)); background: color-mix(in srgb, var(--c, #005BFF) 7%, var(--surface)); }

/* ── Sala de espera / recepción ── */
.cola { display: grid; gap: 8px; }
.cola-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cola-item .turno { font-family: var(--font-title); font-weight: 700; font-size: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px; min-width: 64px; text-align: center; }
.cola-item.espera .turno { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.cola-item.atencion .turno { background: var(--clin-bg); border-color: transparent; color: var(--clin); }
.cola-item .info { flex: 1; min-width: 0; }
.cola-item .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cola-item .info span { font-size: 12.5px; color: var(--muted); }
.espera-min { font-family: var(--font-title); font-weight: 600; font-size: 13px; }

/* ── Ficha del paciente ── */
.ficha-hd { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.ficha-hd .datos { flex: 1; min-width: 240px; }
.ficha-hd h2 { font-size: 22px; }
.ficha-hd .meta { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.ficha-hd .meta span { display: inline-flex; gap: 5px; align-items: center; }
.ficha-hd .meta svg.i { width: 14px; height: 14px; color: var(--muted); }
.timeline { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding-bottom: 14px; position: relative; }
.tl-item::before { content: ''; position: absolute; left: 21px; top: 44px; bottom: 0; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); cursor: pointer; }
.tl-card:hover { border-color: var(--pastel-4); }
.tl-card .dx { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.signos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.signo { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface-2); }
.signo span { font-size: 11px; color: var(--muted); display: block; }
.signo b { font-family: var(--font-title); font-size: 17px; }
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.foto { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); cursor: pointer; }
.foto img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.foto div { padding: 6px 9px; font-size: 12px; }
.antes-despues { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.antes-despues img { width: 100%; border-radius: 10px; }

/* ── Consulta (ficha clínica en edición) ── */
.consulta { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.consulta .lateral { position: sticky; top: 86px; display: grid; gap: 14px; }
.seccion-t { display: flex; align-items: center; gap: 8px; font-family: var(--font-title); font-weight: 600; font-size: 14px; margin: 4px 0 8px; color: var(--ink); }
.seccion-t svg.i { color: var(--blue); }
.dx-list { display: flex; flex-wrap: wrap; gap: 6px; }
.dx-chip { display: inline-flex; gap: 6px; align-items: center; background: var(--clin-bg); color: var(--clin); border-radius: 8px; padding: 5px 8px 5px 10px; font-size: 12.5px; font-weight: 600; }
.dx-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; display: grid; }
.dx-chip svg.i { width: 14px; height: 14px; }
.rx-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 36px; gap: 8px; align-items: center; }
.guardado { font-size: 12px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }

/* Odontograma (numeración FDI) */
.odonto { display: grid; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.odonto .arcada { display: flex; gap: 4px; justify-content: center; min-width: 640px; }
.odonto .sep { width: 12px; }
.diente { display: grid; justify-items: center; gap: 3px; cursor: pointer; }
.diente .n { font-size: 10.5px; color: var(--muted); font-family: var(--mono); }
.diente svg { width: 36px; height: 36px; display: block; }
.diente svg polygon, .diente svg rect { stroke: var(--ink-2); stroke-width: 1.2; fill: var(--surface); transition: fill .1s; }
.diente svg .caries { fill: #E5484D; }
.diente svg .obturado { fill: #3D84FF; }
.diente svg .sellante { fill: #46A758; }
.diente svg .fractura { fill: #F5A524; }
.diente.ausente svg { opacity: .25; }
.diente .marca { font-size: 10px; font-weight: 700; height: 12px; }
.diente.corona svg polygon, .diente.corona svg rect { stroke: #B8860B; stroke-width: 2.4; }
.diente.endodoncia .marca { color: #8E4EC6; }
.diente.extraccion .marca { color: var(--bad); }
.diente:hover svg polygon, .diente:hover svg rect { stroke: var(--blue); }
.herr-odonto { display: flex; gap: 6px; flex-wrap: wrap; }
.herr-odonto button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 9px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.herr-odonto button.on { border-color: var(--blue); background: var(--pastel-1); }
.herr-odonto i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0, 0, 0, .15); }

/* Firma digital */
.firma { border: 1.5px dashed var(--pastel-4); border-radius: 12px; background: #fff; touch-action: none; width: 100%; height: 170px; display: block; cursor: crosshair; }

/* ── Simulador ── */
.sim-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--pastel-3); background: var(--pastel-1); color: var(--blue-700); border-radius: 20px; padding: 6px 12px; font-weight: 600; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.sim-pill.on { background: var(--grad-azul); color: #fff; border-color: transparent; }
.sim-pill.on .dot { background: #fff; animation: pulsoB 1.4s infinite; }
@keyframes pulsoB { 50% { opacity: .35; } }
.vel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.vel button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 4px; font-weight: 700; cursor: pointer; font-family: var(--font-title); }
.vel button.on { border-color: var(--blue); background: var(--pastel-1); color: var(--blue-700); }
.reloj-sim { font-family: var(--font-title); font-size: 40px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }

/* ── Conexión / QR ── */
.qr-box { display: grid; justify-items: center; gap: 8px; text-align: center; }
.qr-box img { width: 190px; height: 190px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 6px; }
.url-box { font-family: var(--mono); font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; word-break: break-all; }

.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--pastel-1); color: var(--blue-700); font-weight: 600; }
.estrellas { color: #F5A524; letter-spacing: 1px; }
.horario-ed { display: grid; gap: 8px; }
.horario-ed .dia { display: grid; grid-template-columns: 90px 1fr; gap: 10px; align-items: center; }
.horario-ed .bloques { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.horario-ed input[type=time] { width: 110px; min-height: 36px; padding: 6px 8px; }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .consulta { grid-template-columns: 1fr; }
  .consulta .lateral { position: static; }
  .cols-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
  .g4, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-2, .cols-2b { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; z-index: 900; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .side.abierto { transform: none; }
  .velo { position: fixed; inset: 0; background: rgba(7, 26, 69, .45); z-index: 899; }
  .top { padding: 12px 16px; }
  .top .menu-btn { display: inline-grid; }
  .content { padding: 6px 16px 96px; }
  .g2, .g3, .g4, .g6, .cols-3 { grid-template-columns: 1fr; }
  .g2.keep { grid-template-columns: 1fr 1fr; }
  .span2, .span3 { grid-column: auto; }
  .modal { border-radius: 16px; }
  .modal .mh, .modal .mb, .modal .mf { padding-left: 16px; padding-right: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px 14px 12px; }
  .kpi .val { font-size: 21px; }
  .kpi .stripes { display: none; }
  .hbar { grid-template-columns: minmax(0, 120px) 1fr auto; gap: 8px; }
  .hbar .v { min-width: 70px; }
  .donut-wrap { grid-template-columns: 110px 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .rx-row { grid-template-columns: 1fr 1fr; }
  .rx-row > :first-child { grid-column: 1 / -1; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 800; padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 8px 2px 10px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; position: relative; border: 0; background: none; cursor: pointer; }
  .bottom-nav a svg.i { width: 22px; height: 22px; }
  .bottom-nav a.on { color: var(--blue); }
  .bottom-nav a.on::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--blue); }
  .bottom-nav .badge { position: absolute; top: 4px; left: calc(50% + 6px); height: 17px; min-width: 17px; font-size: 10px; }
  .toasts { bottom: 78px; }
  .agenda-scroll { max-height: none; }
}
@media (max-width: 640px) {
  .modal-bg { align-items: end; padding: 0; }
  .modal, .modal.xl, .modal.lg { max-width: 100%; border-radius: 20px 20px 0 0; max-height: 94vh; animation: subeHoja .22s ease-out; }
  .modal .mf { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modal .mf .btn { flex: 1; }
  .toasts { top: 12px; bottom: auto; left: 12px; right: 12px; justify-items: center; }
  .top { gap: 6px; padding: 10px 12px; }
  .top .crumb { display: none; }
  .top h1 { font-size: 19px; }
  .ocultar-movil, .sim-pill span.txt, .live span:last-child { display: none; }
  .agenda-bar .fecha-t { min-width: 0; flex: 1; font-size: 15px; }
  .ficha-hd h2 { font-size: 19px; }
  @keyframes subeHoja { from { transform: translateY(40%); } }
  .cola-item { flex-wrap: wrap; gap: 10px; }
  .cola-item .info { min-width: 150px; }
  .cola-item > .tag { font-size: 0; padding: 5px; gap: 0; }
  .rx-row { grid-template-columns: 1fr 1fr 1fr 36px; }
}

/* ── Impresión (recetas, órdenes, boletas) ── */
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
}
