/* css/clinico.css — sistema visual del modo clínico (v2: estilo dashboard verde + app móvil).
   Escritorio: menú lateral en píldoras, barra superior con buscador, tarjetas blancas suaves.
   Móvil (≤ 860 px): barra superior de app, navegación inferior con botón central y hojas deslizables.
   Las animaciones respetan prefers-reduced-motion. */

:root {
  --bg: #f2f6f4;
  --surface: #ffffff;
  --surface-2: #f6f9f8;
  --border: #e3ebe8;
  --border-strong: #cbd8d3;
  --text: #17241f;
  --text-2: #4a5a54;
  --muted: #74847e;

  --primary: #1d7d63;
  --primary-700: #146650;
  --primary-50: #eaf6f1;
  --primary-100: #cfeadf;
  --accent: #c9501f;
  --accent-50: #fdeee6;

  --serie-1: #139a74;
  --serie-2: #eb6834;

  --ok: #17784b;
  --ok-50: #e6f5ec;
  --warn: #8f5d06;
  --warn-50: #fdf3dc;
  --danger: #b42318;
  --danger-50: #fdecea;
  --info: #285ea8;
  --info-50: #e8f0fb;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 48, 38, .04), 0 6px 18px -10px rgba(16, 48, 38, .14);
  --shadow-lg: 0 18px 40px -16px rgba(16, 48, 38, .30);
  --side-w: 236px;
  --font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body.cc { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
.cc a { color: var(--primary); }
.cc h1, .cc h2, .cc h3, .cc h4 { margin: 0; line-height: 1.25; color: var(--text); letter-spacing: -.01em; }
.cc h2 { font-size: 1.02rem; font-weight: 700; }
.cc h3 { font-size: .94rem; font-weight: 700; }
.ico { width: 18px; height: 18px; flex-shrink: 0; }
.ico-sm { width: 15px; height: 15px; }
.ico-lg { width: 22px; height: 22px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Animación ---------- */
@keyframes cc-sube { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes cc-aparece { from { opacity: 0; } to { opacity: 1; } }
@keyframes cc-hoja { from { transform: translateY(100%); } to { transform: none; } }
@keyframes cc-pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes cc-barra { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.cc-content > *, .cc-content .grid > * { animation: cc-sube .45s var(--ease) backwards; }
.cc-content > *:nth-child(2), .cc-content .grid > *:nth-child(2) { animation-delay: .05s; }
.cc-content > *:nth-child(3), .cc-content .grid > *:nth-child(3) { animation-delay: .1s; }
.cc-content > *:nth-child(4), .cc-content .grid > *:nth-child(4) { animation-delay: .15s; }
.cc-content > *:nth-child(n+5), .cc-content .grid > *:nth-child(n+5) { animation-delay: .2s; }
body.saliendo .cc-content { opacity: 0; transform: translateY(6px); transition: opacity .15s, transform .15s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo svg { height: var(--logo-h, 28px); width: var(--logo-h, 28px); color: #0f3d31; flex: none; }
.logo-txt { font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; color: var(--text); }
.logo-txt b { color: var(--primary); font-weight: 800; }

/* ---------- Estructura ---------- */
.cc-shell { display: flex; min-height: 100vh; }
.cc-side { width: var(--side-w); background: var(--bg); display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 40; padding: 0 14px; }
.cc-side-top { display: flex; align-items: center; justify-content: space-between; padding: 22px 6px 18px; }
.cc-brand { text-decoration: none; }
.cc-nav { flex: 1; overflow-y: auto; padding: 4px 2px 12px; display: flex; flex-direction: column; gap: 8px; }
.cc-nav-sec { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 8px 0; }
.cc-nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-radius: 12px; color: var(--text-2) !important; text-decoration: none; font-weight: 600; font-size: .86rem;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(16, 48, 38, .04); transition: transform .15s var(--ease), background .15s, box-shadow .15s; }
.cc-nav-item:hover { box-shadow: var(--shadow); transform: translateX(2px); color: var(--text) !important; }
.cc-nav-item.activo { background: var(--primary); border-color: var(--primary); color: #fff !important; box-shadow: 0 8px 18px -8px rgba(29, 125, 99, .7); }
.cc-nav-item.activo .ico { color: #fff; }
.cc-side-foot { padding: 14px 2px 18px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); }
.cc-user { display: flex; gap: 10px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.cc-avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; font-size: .9rem; }
.cc-user-txt { display: flex; flex-direction: column; min-width: 0; }
.cc-user-txt strong { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-user-txt small { color: var(--muted); font-size: .72rem; }
.cc-salir { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px; border-radius: 12px; border: 1px solid #f3c9c4; color: var(--danger) !important; background: var(--surface); text-decoration: none; font-weight: 700; font-size: .84rem; }
.cc-salir:hover { background: var(--danger-50); }

.cc-main { flex: 1; margin-left: var(--side-w); display: flex; flex-direction: column; min-width: 0; padding-right: 14px; }
.cc-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 10px 12px 10px 18px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(140%) blur(8px); -webkit-backdrop-filter: saturate(140%) blur(8px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.cc-top-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cc-top h1 { font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-top-buscar { flex: 1; max-width: 560px; position: relative; }
.cc-top-buscar .input { height: 40px; border-radius: 12px; background: var(--surface-2); border-color: transparent; padding-left: 38px; }
.cc-top-buscar > .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); z-index: 1; }
.cc-back { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--text-2); background: var(--surface-2); }
.cc-back .ico { transform: rotate(180deg); }
.cc-top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; position: relative; }
.cc-sucursal { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: .8rem; padding: 0 8px; }
.cc-icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; text-decoration: none; transition: transform .15s var(--ease), background .15s; }
.cc-icon-btn:hover { background: var(--surface-2); }
.cc-icon-btn:active { transform: scale(.94); }
.cc-punto { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .62rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.cc-avatar-top { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), #2aa384); color: #fff !important; display: grid; place-items: center; font-weight: 700; text-decoration: none; }
.cc-content { padding: 22px 6px 40px 6px; width: 100%; max-width: 1440px; }
.cc-content-estrecho { max-width: 940px; }
.cc-foot { margin-top: auto; padding: 16px 6px; color: var(--muted); font-size: .74rem; }
.cc-only-mobile { display: none !important; }

/* Encabezado de página (título + acciones) */
.pag-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.pag-cab h2 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.pag-cab p { margin: 4px 0 0; color: var(--muted); }

/* Panel desplegable (notificaciones) */
.cc-pop { position: absolute; right: 0; top: calc(100% + 12px); width: 350px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 60; animation: cc-pop .18s var(--ease); overflow: hidden; }
.cc-pop-h { padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 11px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text) !important; font-size: .84rem; transition: background .12s; }
.aviso:last-child { border-bottom: 0; }
.aviso:hover { background: var(--surface-2); }
.aviso .ico { margin-top: 1px; color: var(--primary); }
.aviso.warn .ico { color: var(--warn); }
.aviso.danger .ico { color: var(--danger); }
.aviso.info .ico { color: var(--info); }
.aviso small { display: block; color: var(--muted); font-size: .74rem; }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; flex-wrap: wrap; }
.card-h p { margin: 2px 0 0; color: var(--muted); font-size: .8rem; }
.card-b { padding: 18px; }
.card-b.sin-pad { padding: 0; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 18px; }
.grid > .card + .card, .stack > .card + .card, .row > .card + .card { margin-top: 0; }

.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }
.g-side-izq { grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
@media (max-width: 1180px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-side, .g-side-izq { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .g-2, .g-3 { grid-template-columns: 1fr; } }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mb-16 { margin-bottom: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 600 .86rem var(--font); text-decoration: none !important; cursor: pointer; white-space: nowrap; transition: transform .12s var(--ease), background .15s, box-shadow .15s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff !important; box-shadow: 0 8px 16px -10px rgba(29, 125, 99, .9); }
.btn-primary:hover { background: var(--primary-700); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff !important; box-shadow: 0 8px 16px -10px rgba(201, 80, 31, .9); }
.btn-accent:hover { background: #ac4217; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger) !important; border-color: #f0c6c2; }
.btn-sm { height: 32px; padding: 0 11px; font-size: .8rem; border-radius: 10px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: .96rem; border-radius: 14px; }
.btn-block { width: 100%; }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .lbl { font-size: .8rem; font-weight: 600; color: var(--text-2); }
.field .req::after { content: ' *'; color: var(--danger); }
.field small { color: var(--muted); font-size: .76rem; }
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text); font: 500 .9rem var(--font); transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 88px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.input[readonly] { background: var(--surface-2); }
.input-unidad { position: relative; }
.input-unidad .input { padding-right: 52px; }
.input-unidad span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .78rem; pointer-events: none; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid .span-2 { grid-column: 1 / -1; } }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
fieldset.bloque { border: 0; margin: 0; padding: 0; }
fieldset.bloque legend { font-weight: 700; font-size: .9rem; margin-bottom: 10px; padding: 0; }
.seccion-form + .seccion-form { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border); }

.buscador { position: relative; }
.buscador > .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.buscador .input { padding-left: 38px; }
.sugerencias { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); max-height: 340px; overflow-y: auto; animation: cc-pop .15s var(--ease); }
.sugerencias button { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--border); background: none; font: inherit; color: inherit; cursor: pointer; }
.sugerencias button:last-child { border-bottom: 0; }
.sugerencias button:hover, .sugerencias button.activo { background: var(--primary-50); }
.sugerencias small { display: block; color: var(--muted); font-size: .76rem; }

/* Tablas */
.tabla-wrap { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tabla th { text-align: left; font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.tabla td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr { transition: background .12s; }
.tabla tbody tr:hover { background: var(--surface-2); }
.tabla .der { text-align: right; }
.tabla a.fila-link { color: var(--text); text-decoration: none; font-weight: 600; }
.tabla a.fila-link:hover { color: var(--primary); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge-demo { background: var(--warn-50); color: var(--warn); border-color: #f0dca6; }
.b-ok { background: var(--ok-50); color: var(--ok); border-color: #bfe3cd; }
.b-warn { background: var(--warn-50); color: var(--warn); border-color: #f0dca6; }
.b-danger { background: var(--danger-50); color: var(--danger); border-color: #f2c6c1; }
.b-info { background: var(--info-50); color: var(--info); border-color: #c9d9f1; }
.b-primary { background: var(--primary-50); color: var(--primary-700); border-color: var(--primary-100); }
.b-neutral { background: var(--surface-2); color: var(--text-2); }
.tendencia { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px; border-radius: 999px; font-size: .7rem; font-weight: 700; background: var(--ok-50); color: var(--ok); letter-spacing: 0; }
.tendencia.baja { background: var(--danger-50); color: var(--danger); }
.tendencia.igual { background: var(--surface-2); color: var(--muted); }

.alerta { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid; font-size: .86rem; }
.alerta .ico { margin-top: 1px; }
.alerta-danger { background: var(--danger-50); border-color: #f2c6c1; color: #7d1a12; }
.alerta-warn { background: var(--warn-50); border-color: #f0dca6; color: #6b4708; }
.alerta-info { background: var(--info-50); border-color: #c9d9f1; color: #20446f; }
.alerta-ok { background: var(--ok-50); border-color: #bfe3cd; color: #155535; }

/* KPIs */
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi-top { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: .8rem; font-weight: 600; }
.kpi-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.kpi-lbl { color: var(--muted); font-size: .8rem; font-weight: 600; }
.kpi-val { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; margin-top: 8px; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kpi-sub { color: var(--muted); font-size: .76rem; margin-top: 4px; }

/* Lista */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.lista li:last-child { border-bottom: 0; }
.lista .grow { flex: 1; min-width: 0; }
.lista .t1 { font-weight: 600; }
.lista .t2 { color: var(--muted); font-size: .78rem; }
.hora { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text-2); width: 48px; flex-shrink: 0; font-size: .84rem; }
.vacio { padding: 28px 18px; text-align: center; color: var(--muted); }
.avatar-ini { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .78rem; background: var(--primary-50); color: var(--primary-700); flex-shrink: 0; }

/* Segmentado (Semana / Mes / Año) */
.segmento { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.segmento button { border: 0; background: none; font: 600 .74rem var(--font); color: var(--muted); padding: 5px 10px; border-radius: 8px; cursor: pointer; transition: background .15s, color .15s; }
.segmento button.activo { background: var(--primary); color: #fff; box-shadow: 0 4px 10px -6px rgba(29, 125, 99, .8); }

/* Gráficas */
.grafica { position: relative; height: 230px; }
.leyenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: .76rem; color: var(--text-2); padding: 0 18px; }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.leyenda i.linea { width: 16px; height: 0; border-radius: 0; border-top: 2px dashed var(--serie-2); }
.ver-datos summary { cursor: pointer; color: var(--muted); font-size: .76rem; margin-top: 8px; }

/* Calendario */
.cal { user-select: none; }
.cal-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-grid .dow { font-size: .64rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.cal-dia { position: relative; display: grid; place-items: center; height: 34px; border-radius: 50%; font-size: .82rem; font-weight: 600; color: var(--text) !important; text-decoration: none; transition: background .15s; }
.cal-dia:hover { background: var(--primary-50); }
.cal-dia.fuera { color: var(--border-strong) !important; }
.cal-dia.hoy { background: var(--primary); color: #fff !important; box-shadow: 0 6px 14px -8px rgba(29, 125, 99, .9); }
.cal-dia.con-citas::after { content: ''; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--serie-2); }
.cal-dia.hoy.con-citas::after { background: #fff; }

/* Línea de tiempo verde (agenda del día) */
.tl-verde { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; }
.tl-verde::before { content: ''; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 2px; background: var(--primary-100); }
.tl-verde li { position: relative; margin-bottom: 12px; }
.tl-verde li:last-child { margin-bottom: 0; }
.tl-verde li::before { content: ''; position: absolute; left: -21px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.tl-tarjeta { display: block; background: linear-gradient(140deg, var(--primary) 0%, #2a9a7d 100%); color: #fff !important; border-radius: 14px; padding: 12px 14px; text-decoration: none; box-shadow: 0 10px 20px -14px rgba(29, 125, 99, .9); transition: transform .15s var(--ease); }
.tl-tarjeta:hover { transform: translateX(3px); }
.tl-tarjeta .tl-h { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: .86rem; }
.tl-tarjeta .tl-s { opacity: .88; font-size: .76rem; margin-top: 2px; }
.tl-tarjeta .tl-acc { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.tl-tarjeta .tl-acc .badge { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .35); color: #fff; }
.tl-tarjeta .tl-btn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 8px; background: #fff; color: var(--primary-700); font-size: .74rem; font-weight: 700; }
.tl-verde li.hecha .tl-tarjeta { background: var(--surface-2); color: var(--text) !important; border: 1px solid var(--border); box-shadow: none; }
.tl-verde li.hecha .tl-tarjeta .badge { background: var(--surface); border-color: var(--border); color: var(--muted); }
.tl-verde li.hecha::before { border-color: var(--border-strong); }

/* Pestañas */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; margin-bottom: 16px; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: none; font: 600 .86rem var(--font); color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs .activo { color: var(--primary-700); border-bottom-color: var(--primary); }

/* Ficha del paciente */
.paciente-cab { display: flex; gap: 16px; align-items: flex-start; }
.paciente-ini { width: 54px; height: 54px; border-radius: 16px; background: linear-gradient(135deg, var(--primary), #2aa384); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; flex-shrink: 0; }
.paciente-cab h2 { font-size: 1.15rem; }
.datos-def { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: .85rem; margin: 0; }
.datos-def dt { color: var(--muted); }
.datos-def dd { margin: 0; font-weight: 500; }

/* Línea de tiempo del expediente */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; display: flex; gap: 14px; padding: 0 0 18px; }
.tl-ico { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); flex-shrink: 0; }
.tl-ico.nota { color: var(--primary); border-color: var(--primary-100); background: var(--primary-50); }
.tl-ico.receta { color: var(--accent); border-color: #f4cdbb; background: var(--accent-50); }
.tl-ico.estudio { color: var(--info); border-color: #c9d9f1; background: var(--info-50); }
.tl-ico.pago { color: var(--ok); border-color: #bfe3cd; background: var(--ok-50); }
.tl-body { flex: 1; min-width: 0; padding-top: 2px; }
.tl-body .t1 { font-weight: 700; }
.tl-body .t2 { color: var(--muted); font-size: .8rem; }

/* Nota clínica */
.nota-doc { font-size: .9rem; }
.nota-doc h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 6px; }
.nota-doc h4:first-child { margin-top: 0; }
.nota-doc p { margin: 0; white-space: pre-wrap; }
.firma-sello { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--primary-100); background: var(--primary-50); border-radius: 12px; font-size: .82rem; }
.firma-sello .mono { word-break: break-all; }
.vitales { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.vital { border: 1px solid var(--border); border-radius: 12px; padding: 9px 11px; background: var(--surface-2); }
.vital span { display: block; font-size: .7rem; color: var(--muted); font-weight: 600; }
.vital strong { font-variant-numeric: tabular-nums; }

/* Receta */
.med-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); animation: cc-sube .3s var(--ease) backwards; }
.med-item + .med-item { margin-top: 12px; }
.med-item .med-nombre { font-weight: 700; }
.med-item .med-pres { color: var(--muted); font-size: .8rem; }
.med-campos { grid-column: 1 / -1; display: grid; gap: 10px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.med-campos .span-3 { grid-column: span 3; }
.med-campos .span-6 { grid-column: 1 / -1; }
@media (max-width: 900px) { .med-campos { grid-template-columns: repeat(2, minmax(0, 1fr)); } .med-campos .span-3, .med-campos .span-6 { grid-column: 1 / -1; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font: 600 .78rem var(--font); color: var(--text-2); cursor: pointer; transition: transform .12s, border-color .15s; }
.chip:hover { border-color: var(--primary); color: var(--primary-700); }
.chip:active { transform: scale(.95); }
.cronometro { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .82rem; font-weight: 600; }

/* Embudo */
.embudo { display: flex; flex-direction: column; gap: 10px; }
.embudo-paso { display: grid; grid-template-columns: 110px minmax(0, 1fr) 130px; align-items: center; gap: 12px; font-size: .86rem; }
.embudo-barra { height: 26px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.embudo-barra span { display: block; height: 100%; background: var(--serie-1); border-radius: 8px; transform-origin: left; animation: cc-barra .8s var(--ease) both; }
.embudo-paso:nth-child(n+4) .embudo-barra span { background: var(--serie-2); }
@media (max-width: 600px) { .embudo-paso { grid-template-columns: 80px minmax(0, 1fr) 76px; } }

.barras { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.barras .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.barras .b i { display: block; width: 100%; max-width: 36px; background: var(--serie-1); border-radius: 4px 4px 0 0; min-height: 2px; }
.barras .b small { font-size: .7rem; color: var(--muted); }

/* Modal (en móvil se vuelve hoja inferior) */
.modal { position: fixed; inset: 0; z-index: 70; display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px; background: rgba(15, 35, 29, .42); overflow-y: auto; }
.modal.abierto { display: flex; animation: cc-aparece .15s; }
.modal-caja { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; animation: cc-pop .2s var(--ease); }
.modal-caja.ancho { max-width: 840px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-b { padding: 20px; }
.modal-f { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 20px 20px; flex-wrap: wrap; }
/* Estructura v2: cuerpo con scroll propio y pie siempre visible */
.modal-caja { display: flex; flex-direction: column; max-height: 88vh; }
.modal-caja > .modal-b { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-t { display: flex; align-items: center; gap: 12px; min-width: 0; }
.modal-t h2 { margin: 0; font-size: 1.08rem; line-height: 1.25; }
.modal-t p { margin: 2px 0 0; color: var(--muted); font-size: .8rem; }
.modal-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.modal-ico .ico { width: 20px; height: 20px; }
.modal-norma { margin-right: auto; display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; line-height: 1.3; color: var(--muted); flex: 1 1 180px; min-width: 0; }
.modal-norma .ico { flex: none; }
.sec-t { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.form-grid > .sec-t { margin: 6px 0 -4px; }
.form-grid > .sec-t:first-child { margin-top: 0; }
.sec-t strong { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.sec-t span { font-size: .76rem; color: var(--muted); }
.opciones { display: flex; gap: 8px; flex-wrap: wrap; }
.opciones label { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font-size: .86rem; font-weight: 600; background: var(--surface); transition: border-color .15s, background .15s; }
.opciones input { position: absolute; opacity: 0; pointer-events: none; }
.opciones label:has(input:checked) { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.opciones label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.resumen-firma { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; padding: 14px; border-radius: 14px; background: var(--surface-2); font-size: .86rem; }
.resumen-firma dt { color: var(--muted); }
.resumen-firma dd { margin: 0; font-weight: 600; }
.chips-check { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-check label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: .8rem; cursor: pointer; }
.chips-check label:has(input:checked) { border-color: var(--danger); background: var(--danger-50); color: #7d1a12; }
.chips-check input { width: 14px; height: 14px; accent-color: var(--danger); }

/* Toasts */
.cc-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 240px; max-width: 360px; padding: 12px 16px; border-radius: 14px; background: var(--text); color: #fff; font-size: .86rem; font-weight: 600; box-shadow: var(--shadow-lg); animation: cc-pop .2s var(--ease); }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--primary); }
.toast.warn { background: var(--warn, #b26a00); }
.toast.info { background: #2c4a40; }

.firma-canvas { width: 100%; height: 170px; border: 1px dashed var(--border-strong); border-radius: 14px; background: var(--surface-2); touch-action: none; cursor: crosshair; }

/* Agenda */
.agenda-h { position: sticky; top: 0; background: var(--surface-2); padding: 10px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: .84rem; }
.cita-blq { display: block; height: 100%; border-radius: 10px; padding: 5px 9px; font-size: .76rem; text-decoration: none; color: var(--text) !important; background: var(--primary-50); border-left: 3px solid var(--primary); overflow: hidden; transition: transform .12s, box-shadow .15s; }
.cita-blq:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.cita-blq.pendiente { background: var(--warn-50); border-left-color: #d69a1a; }
.cita-blq.atendida { background: var(--surface-2); border-left-color: var(--border-strong); color: var(--muted) !important; }

/* Login */
.lg-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.lg-info { position: relative; overflow: hidden; background: radial-gradient(900px 500px at 0% 0%, #2aa384 0%, transparent 60%), linear-gradient(160deg, #1d7d63, #0f5643); color: #e6f6f0; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.lg-info::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .06); }
.lg-info .logo-txt { color: #fff; }
.lg-info .logo svg { color: #fff; --logo-a: #d9f1e8; --logo-b: #9fe3cb; }
.lg-info .logo-txt b { color: #9fe3cb; }
.lg-info h2 { color: #fff; font-size: 1.9rem; font-weight: 800; max-width: 440px; letter-spacing: -.02em; }
.lg-info ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; max-width: 440px; }
.lg-info li { display: flex; gap: 12px; align-items: flex-start; color: #d4efe5; }
.lg-info li .ico { color: #fff; margin-top: 2px; }
.lg-form { display: grid; place-items: center; padding: 32px 18px; }
.lg-card { width: 100%; max-width: 390px; animation: cc-sube .5s var(--ease) both; }
.lg-card h1 { font-size: 1.6rem; font-weight: 800; margin: 26px 0 6px; letter-spacing: -.02em; }

/* ---------- App móvil: navegación inferior y hojas ---------- */
.cc-tabbar { display: none; }
.cc-hoja { position: fixed; inset: 0; z-index: 80; display: none; align-items: flex-end; background: rgba(15, 35, 29, .42); }
.cc-hoja.abierta { display: flex; animation: cc-aparece .15s; }
.cc-hoja-caja { width: 100%; background: var(--surface); border-radius: 26px 26px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); animation: cc-hoja .3s var(--ease); max-height: 85vh; overflow-y: auto; }
.cc-hoja-caja::before { content: ''; display: block; width: 42px; height: 5px; border-radius: 99px; background: var(--border-strong); margin: 0 auto 14px; }
.cc-hoja-caja h3 { margin: 0 0 12px; }
.cc-acciones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cc-accion { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 18px; background: var(--surface-2); color: var(--text) !important; text-decoration: none; font-weight: 600; font-size: .78rem; text-align: center; transition: transform .12s; border: 1px solid var(--border); }
.cc-accion:active { transform: scale(.95); }
.cc-accion .ic { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.cc-accion.naranja .ic { background: var(--accent-50); color: var(--accent); }
.cc-accion.azul .ic { background: var(--info-50); color: var(--info); }
.cc-hoja .cc-nav { gap: 8px; padding: 0; }
.cc-hoja .cc-nav-sec { padding: 8px 4px 0; }

@media (max-width: 860px) {
  body.cc { background: linear-gradient(180deg, #d9efe6 0, #eef5f2 300px, var(--bg) 520px); }
  .cc-side { display: none; }
  .cc-main { margin-left: 0; padding-right: 0; }
  .cc-only-mobile { display: inline-grid !important; }
  .cc-solo-escritorio { display: none !important; }
  .cc-top { margin: 0; border-radius: 0; border: 0; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: rgba(217, 239, 230, .86); box-shadow: none; }
  .cc-top-buscar { display: none; }
  .cc-top h1 { font-size: 1.08rem; font-weight: 800; }
  .cc-sucursal, .cc-top .badge-demo { display: none; }
  .cc-icon-btn, .cc-avatar-top { width: 38px; height: 38px; }
  .cc-content { padding: 14px 14px calc(var(--nav-h) + 34px + env(safe-area-inset-bottom)); }
  .cc-foot { display: none; }
  .card { border-radius: 20px; }
  .card-h { padding: 16px 16px 10px; }
  .card-b { padding: 16px; }
  .pag-cab { margin-bottom: 14px; }
  .pag-cab h2 { font-size: 1.35rem; }
  .pag-cab > .row { width: 100%; }
  .pag-cab > .row .btn { flex: 1; }
  .kpi { padding: 14px; }
  .kpi-val { font-size: 1.4rem; }
  .grid { gap: 12px; }
  .card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 12px; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lista li { padding: 12px 16px; }
  .tabla th, .tabla td { padding: 10px 12px; }
  .grafica { height: 190px; }
  .leyenda { padding: 0 16px; }

  .cc-tabbar { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 50; height: var(--nav-h); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: 24px; box-shadow: 0 14px 30px -12px rgba(16, 48, 38, .35); animation: cc-hoja .35s var(--ease) both; }
  .cc-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted) !important; text-decoration: none; font-size: .64rem; font-weight: 700; padding: 6px 0; border: 0; background: none; cursor: pointer; font-family: var(--font); transition: color .15s, transform .12s; }
  .cc-tab:active { transform: scale(.9); }
  .cc-tab .ico { width: 22px; height: 22px; }
  .cc-tab.activo { color: var(--primary) !important; }
  .cc-fab { justify-self: center; width: 58px; height: 58px; margin-top: -30px; border-radius: 20px; border: 4px solid #fff; background: linear-gradient(140deg, var(--primary), #2aa384); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 22px -10px rgba(29, 125, 99, .9); cursor: pointer; transition: transform .25s var(--ease); }
  .cc-fab .ico { width: 26px; height: 26px; }
  .cc-fab[aria-expanded="true"] { transform: rotate(45deg); }

  .modal { align-items: flex-end; padding: 0; }
  .modal-caja, .modal-caja.ancho { max-width: none; border-radius: 26px 26px 0 0; max-height: 92vh; animation: cc-hoja .3s var(--ease); }
  .modal-norma { max-width: none; flex-basis: 100%; order: 3; }
  .modal-f .btn { flex: 1; }
  .modal-f { position: sticky; bottom: 0; border-radius: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .cc-toasts { left: 16px; right: 16px; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .btn { height: 44px; }
  .input, .select { height: 46px; font-size: 16px; }
  .textarea { font-size: 16px; }
  .cc-pop { position: fixed; left: 12px; right: 12px; top: calc(62px + env(safe-area-inset-top)); width: auto; }
  .lg-wrap { grid-template-columns: 1fr; }
  .lg-info { display: none; }
}

/* Impresión */
@media print {
  .cc-side, .cc-top, .cc-foot, .no-print, .cc-toasts, .cc-tabbar { display: none !important; }
  .cc-main { margin: 0; padding: 0; }
  .cc-content { padding: 0; max-width: none; }
  .cc-content > *, .cc-content .grid > * { animation: none; }
  body.cc { background: #fff; }
  .card { box-shadow: none; border: 0; }
}

/* Tablero */
.g-citas { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
@media (max-width: 1180px) { .g-citas { grid-template-columns: 1fr; } }
a.kpi:active { transform: scale(.98); }

/* Modo enfoque (capturas): sin barra de navegación y con barra de acción fija */
.cc-barra-accion { display: none; }
#alertas:empty, #items:empty { display: none; }
@media (max-width: 860px) {
  .cc-enfoque .cc-tabbar { display: none; }
  .cc-enfoque .cc-content { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .cc-enfoque .cc-toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .cc-barra-accion { display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 50; gap: 10px; align-items: center; padding: 10px 10px 10px 16px;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 14px 30px -12px rgba(16, 48, 38, .35); animation: cc-hoja .35s var(--ease) both; }
  .cc-barra-accion .btn { flex: 1; height: 48px; border-radius: 16px; }
  .cc-enfoque .nota-acciones { position: fixed !important; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)) !important; z-index: 50; border-radius: 22px; }
  .cc-enfoque .nota-acciones .card-b { padding: 10px 12px; }
  .cc-enfoque .nota-acciones .row-between > span { display: none; }
  .cc-enfoque .nota-acciones .row { width: 100%; }
  .cc-enfoque .nota-acciones .btn { flex: 1; }
  .receta-lateral { order: -1; position: static !important; }
  .receta-lateral .btn-accent, .receta-lateral .cronometro-fila { display: none; }
}

/* Bloque plegable de datos estadísticos (opcional) */
.datos-estadisticos > summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 4px 0; }
.datos-estadisticos > summary::-webkit-details-marker { display: none; }
.datos-estadisticos > summary::after { content: ''; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s var(--ease); margin-left: 2px; }
.datos-estadisticos[open] > summary::after { transform: rotate(225deg) translateY(-1px); }
.datos-estadisticos > summary:hover { color: var(--text-2); }
.datos-estadisticos > summary em { font-style: normal; font-weight: 500; font-size: .7rem; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); margin-left: 4px; }
.datos-estadisticos .nota-sutil { margin: 8px 0 14px; font-size: .76rem; color: var(--muted); }
.datos-estadisticos[open] .form-grid { animation: cc-sube .3s var(--ease); }

/* Foto de identificación del paciente */
.foto-pac { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.foto-pac-vista { position: relative; flex: none; width: 84px; height: 84px; border-radius: 22px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), #2aa384); color: #fff; font-weight: 800; font-size: 1.5rem; box-shadow: var(--shadow); }
.foto-pac-vista img, .foto-pac-vista video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.foto-pac-vista video { transform: scaleX(-1); }
.foto-pac-vista.foto-entra img { animation: cc-pop .35s var(--ease); }
.foto-pac-acc { display: grid; gap: 6px; min-width: 0; }
.paciente-ini { overflow: hidden; position: relative; }
.paciente-ini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Bandeja de mensajes del portal */
.bandeja { grid-template-columns: minmax(280px, 380px) 1fr; gap: 16px; align-items: start; }
.bandeja-lista { max-height: calc(100vh - 200px); overflow-y: auto; }
.bandeja-lista li.sel { background: var(--primary-50); }
.bandeja-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; color: inherit; text-decoration: none; }
.bandeja-item .grow { min-width: 0; display: grid; }
.bandeja-item .t2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bandeja-chat { padding: 16px; max-height: 52vh; overflow-y: auto; background: var(--surface-2); }
.bandeja-resp { position: static; margin: 12px; }
.segmento a { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 9px; font: 600 .74rem var(--font); color: var(--muted); text-decoration: none; }
.segmento a.activo { background: var(--primary); color: #fff; }
@media (max-width: 860px) { .bandeja { grid-template-columns: 1fr; } }
.portal-estado { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); color: var(--muted); }
.portal-estado > span { display: inline-flex; align-items: center; gap: 6px; }
.portal-reps { display: grid; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.portal-rep { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }

/* Mi perfil (médico) */
.perfil { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.perfil-vista { position: sticky; top: 96px; }
.perfil-cab { display: flex; gap: 18px; align-items: center; }
.perfil-foto { width: 96px; height: 96px; flex: none; border-radius: 26px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), #2aa384); color: #fff; font-size: 2rem; font-weight: 800; box-shadow: var(--shadow); }
.perfil-foto img, .perfil-logo img, .pr-logo img { width: 100%; height: 100%; object-fit: cover; }
.perfil-logo-fila { display: flex; gap: 16px; align-items: center; }
.perfil-logo { width: 150px; height: 70px; flex: none; border: 1px dashed var(--border-strong); border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: var(--surface-2); }
.perfil-logo img, .pr-logo img { object-fit: contain; padding: 6px; }
.perfil-firma { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.perfil-firma-actual { width: 180px; height: 90px; border: 1px solid var(--border); border-radius: 12px; display: grid; place-items: center; background: #fff; }
.perfil-firma-actual img { max-width: 100%; max-height: 100%; object-fit: contain; }
.perfil-receta { padding: 18px; font-size: .82rem; }
.pr-cab { display: flex; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--primary); }
.pr-cab strong { font-size: .98rem; }
.pr-cab .small { font-size: .74rem; }
.pr-logo { width: 64px; height: 64px; flex: none; border-radius: 10px; overflow: hidden; }
.pr-logo:empty { display: none; }
.pr-cuerpo { padding: 18px 0; display: grid; gap: 8px; }
.pr-linea { height: 8px; border-radius: 4px; background: var(--surface-2); }
.pr-linea.corta { width: 60%; }
.pr-firma { display: grid; justify-items: center; gap: 4px; border-top: 1px solid var(--border); padding-top: 8px; color: var(--muted); font-size: .72rem; }
.pr-firma img { height: 54px; max-width: 180px; object-fit: contain; }
.cc-avatar img, .cc-avatar-top img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.cc-avatar, .cc-avatar-top { overflow: hidden; }
@media (max-width: 960px) { .perfil { grid-template-columns: 1fr; } .perfil-vista { position: static; } }
.pub-medico { display: flex; gap: 12px; align-items: center; margin: 6px 0 16px; }
.pub-medico-foto { width: 52px; height: 52px; border-radius: 16px; object-fit: cover; flex: none; border: 1px solid var(--border); }

/* Globitos de pendientes en el menú */
.cc-nav-item { position: relative; }
.cc-globo { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: .7rem; font-weight: 800; font-style: normal; line-height: 1; color: #fff; background: var(--info, #2c6cb0); box-shadow: 0 0 0 2px var(--surface); animation: cc-pop .35s var(--spring, ease) both; }
.cc-globo.acento { background: var(--accent); }
.cc-globo.warn { background: #c98a0b; }
.cc-globo.peligro { background: var(--danger); }
.cc-nav-item.activo .cc-globo { background: #fff; color: var(--primary); box-shadow: none; }
.cc-tab { position: relative; }
.cc-tab .cc-globo { position: absolute; top: 2px; left: calc(50% + 4px); margin: 0; min-width: 18px; height: 18px; font-size: .64rem; padding: 0 5px; }

/* ===== Agenda v2 ===== */
.ico-xs { width: 13px; height: 13px; }
.ag-barra-in { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ag-vistas a { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 9px; font: 600 .78rem var(--font); color: var(--muted); text-decoration: none; }
.ag-vistas a.activo { background: var(--primary); color: #fff; }
.ag-nav { gap: 6px; align-items: center; }
.ag-periodo { margin: 0 6px; font-size: .98rem; white-space: nowrap; }
.ag-fecha { width: auto; height: 34px; }
.ag-filtro { width: auto; max-width: 230px; height: 36px; }
.ag-resumen { display: flex; gap: 8px 18px; flex-wrap: wrap; padding: 10px 20px 14px; border-top: 1px solid var(--border); font-size: .8rem; color: var(--muted); }
.ag-resumen b { color: var(--text); font-size: .92rem; }
.ag-resumen span { display: inline-flex; align-items: center; gap: 5px; }
.ag-resumen span[class^="r-"]::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.r-confirmada { --c: #1d7d63; } .r-pendiente { --c: #d9a21b; } .r-atendida { --c: #9aa5a1; } .r-falto { --c: var(--danger); }

.ag-cuerpo { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.ag-cuerpo.con-sala { grid-template-columns: minmax(0, 1fr) 320px; }
.ag-calendario { overflow: hidden; }
.ag-scroll { max-height: calc(100vh - 290px); min-height: 420px; overflow: auto; overscroll-behavior: contain; }
.ag-grid { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(170px, 1fr)); min-width: calc(56px + var(--cols) * 170px); }
.ag-cab { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); padding: 10px 12px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ag-cab strong { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-cab small { color: var(--muted); font-size: .72rem; }
.ag-esq { border-left: 0; left: 0; z-index: 6; }
.ag-punto { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-bottom: 3px; }
.ag-num-dia { font-size: 1.25rem; font-weight: 800; color: var(--text); text-decoration: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; margin-top: 2px; }
.ag-cab.hoy small { color: var(--primary); font-weight: 700; }
.ag-cab.hoy .ag-num-dia { background: var(--primary); color: #fff; }
.ag-horas { grid-column: 1; position: sticky; left: 0; z-index: 4; background: var(--surface); }
.ag-horas span { display: block; font-size: .7rem; color: var(--muted); text-align: right; padding: 0 8px 0 0; transform: translateY(-6px); }
.ag-col { position: relative; height: var(--alto); border-left: 1px solid var(--border);
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px);
  background-size: 100% var(--px-hora), 100% calc(var(--px-hora) / 2); }
.ag-col.hoy { background-color: color-mix(in srgb, var(--primary-50) 45%, transparent); }
.ag-col:hover { cursor: cell; }

.ag-cita { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 1px; padding: 4px 8px 4px 10px; border: 0; border-radius: 10px; text-align: left; font: inherit; font-size: .76rem; line-height: 1.25; cursor: pointer; overflow: hidden;
  color: #0f3d31; background: #e3f4ee; box-shadow: inset 3px 0 0 var(--med, var(--primary)), 0 1px 2px rgba(0, 0, 0, .06); transition: transform .15s var(--ease), box-shadow .15s; touch-action: none; }
.ag-cita:hover { transform: translateY(-1px); box-shadow: inset 3px 0 0 var(--med, var(--primary)), 0 8px 18px -10px rgba(0, 0, 0, .45); z-index: 3; }
.ag-l1 { display: flex; gap: 4px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ag-l1 b { font-weight: 800; }
.ag-l2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .75; }
.ag-cita.corta { flex-direction: row; align-items: center; padding-top: 1px; padding-bottom: 1px; }
.ag-cita.corta .ag-l2 { display: none; }
.ag-ic { margin-left: auto; display: inline-flex; gap: 3px; align-items: center; flex: none; }
.ag-1a, .ag-pago { font-size: .62rem; font-weight: 800; padding: 0 4px; border-radius: 4px; background: rgba(255, 255, 255, .7); }
.ag-cita.pendiente { background: #fff3d6; color: #6b4708; }
.ag-cita.confirmada { background: #dff3ea; }
.ag-cita.sala { background: #dce9fb; color: #1e3f6e; }
.ag-cita.consulta { background: #ece3fa; color: #46277a; }
.ag-cita.atendida { background: #eef1f0; color: #5b6b66; }
.ag-cita.falto { background: #fbe3e1; color: #7d1a12; text-decoration: line-through; }
.ag-cita.moviendo { opacity: .35; }
.ag-cita.fantasma { opacity: .9; z-index: 10; pointer-events: none; box-shadow: inset 3px 0 0 var(--med), 0 14px 30px -12px rgba(0, 0, 0, .55); outline: 2px dashed var(--primary); }
.ag-ahora { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 4; pointer-events: none; }
.ag-ahora::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.ag-ahora span { position: absolute; left: 6px; top: -18px; font-size: .64rem; font-weight: 800; color: var(--danger); background: var(--surface); padding: 0 4px; border-radius: 4px; }

/* Estados (píldoras) */
.ag-pill { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.ag-pill.pendiente { background: #fff3d6; color: #6b4708; } .ag-pill.confirmada { background: #dff3ea; color: #155535; }
.ag-pill.sala { background: #dce9fb; color: #1e3f6e; } .ag-pill.consulta { background: #ece3fa; color: #46277a; }
.ag-pill.atendida { background: #eef1f0; color: #5b6b66; } .ag-pill.falto { background: #fbe3e1; color: #7d1a12; }
.ag-leyenda { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }

/* Sala de espera */
.ag-sala { position: sticky; top: 96px; max-height: calc(100vh - 120px); display: flex; flex-direction: column; }
.ag-sala-lista { list-style: none; margin: 0; padding: 4px 10px 12px; overflow-y: auto; }
.ag-s { display: flex; gap: 10px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--border); }
.ag-s:last-child { border-bottom: 0; }
.ag-s.atendida, .ag-s.falto { opacity: .55; }
.ag-s.sala { background: linear-gradient(90deg, #dce9fb55, transparent); border-radius: 10px; }
.ag-s-hora { font-weight: 800; font-size: .82rem; width: 42px; flex: none; }
.ag-s-nombre { border: 0; background: none; padding: 0; font: 600 .86rem var(--font); color: var(--text); cursor: pointer; text-align: left; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-s-acc { display: flex; gap: 4px; flex: none; }
.ag-espera.larga { color: var(--danger); font-weight: 700; }

/* Mes */
.ag-mes { overflow: hidden; }
.ag-mes-cab, .ag-mes-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.ag-mes-cab span { padding: 10px; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
.ag-mes-dia { min-height: 108px; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: inherit; transition: background .15s; }
.ag-mes-dia:hover { background: var(--primary-50); }
.ag-mes-dia:nth-child(7n) { border-right: 0; }
.ag-mes-dia.fuera { opacity: .4; }
.ag-mes-num { font-weight: 800; font-size: .86rem; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.ag-mes-dia.hoy .ag-mes-num { background: var(--primary); color: #fff; }
.ag-mes-cita { font-size: .7rem; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: inset 2px 0 0 var(--med); background: #e3f4ee; }
.ag-mes-cita.pendiente { background: #fff3d6; } .ag-mes-cita.atendida { background: #eef1f0; color: #5b6b66; } .ag-mes-cita.falto { background: #fbe3e1; text-decoration: line-through; }
.ag-mes-mas { font-size: .7rem; color: var(--primary); font-weight: 700; }

/* Lista */
.ag-lista-item { padding: 0 !important; }
.ag-lista-btn { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px 16px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; box-shadow: inset 3px 0 0 var(--med); }
.ag-lista-btn:hover { background: var(--surface-2); }
.ag-lista-btn .grow { display: grid; }
.ag-lista-btn .t2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-lista-hora { display: grid; width: 48px; flex: none; }
.ag-lista-hora small { color: var(--muted); }

@media (max-width: 1100px) { .ag-cuerpo.con-sala { grid-template-columns: 1fr; } .ag-sala { position: static; max-height: none; } }
@media (max-width: 760px) {
  .ag-periodo { order: 5; width: 100%; margin: 4px 0 0; }
  .ag-fecha, .ag-barra-in > .grow { display: none; }
  .ag-filtro { max-width: none; flex: 1; }
  .ag-mes-dia { min-height: 64px; padding: 4px; }
  .ag-mes-cita { display: none; }
  .ag-mes-dia::after { content: attr(data-n); }
}
@media (max-width: 760px) { .ag-mes-dia::after { font-size: .62rem; color: var(--primary); font-weight: 700; } }

/* Cobros */
.cob-cat { display: grid; gap: 10px; }
.cob-cat-g { display: grid; gap: 6px; }
.cob-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cob-chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font: 600 .82rem var(--font); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s, transform .14s var(--ease); }
.cob-chip small { font-weight: 500; color: var(--muted); font-size: .72rem; }
.cob-chip:hover { border-color: var(--primary); background: var(--primary-50); }
.cob-chip:active { transform: scale(.96); }
.cob-chip.agregado { animation: cc-palomea .35s var(--spring, ease); border-color: var(--primary); }
.cob-lineas .input { height: 36px; }
.cob-linea { animation: cc-sube .25s var(--ease) backwards; }
.cob-pie { display: flex; gap: 18px; align-items: flex-start; margin-top: 16px; flex-wrap: wrap; }
.cob-total { width: 260px; padding: 16px; border-radius: 16px; background: var(--surface-2); display: grid; gap: 6px; position: sticky; top: 0; }
.cob-total-num { display: flex; justify-content: space-between; align-items: baseline; padding-top: 8px; border-top: 1px solid var(--border); }
.cob-total-num strong { font-size: 1.8rem; letter-spacing: -.03em; color: var(--primary); }
.cob-total-num strong.salta { animation: cc-palomea .35s var(--spring, ease); }
tr.inactivo { opacity: .5; }
@media (max-width: 760px) { .cob-total { width: 100%; } }
.modal-b > .sec-t { margin-top: 18px; }

/* ===== Punto de cobro ===== */
.modal.pos { padding: 2.5vh 16px; align-items: center; }
.pos-caja.modal-caja { max-width: 1240px; height: 94vh; max-height: 94vh; }
.pos-caja .modal-t p kbd { font: 700 .66rem var(--font); padding: 1px 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--text-2); }
.pos-cuerpo { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr); }
.pos-catalogo { min-height: 0; overflow-y: auto; padding: 16px 20px 20px; background: var(--surface-2); border-right: 1px solid var(--border); }
.pos-buscar { position: sticky; top: -16px; z-index: 2; margin: -16px -20px 0; padding: 16px 20px 10px; background: var(--surface-2); }
.pos-buscar .input { height: 46px; font-size: 1rem; border-radius: 14px; }
.pos-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 4px 0 14px; }
.pos-tabs button { flex: none; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 7px 14px; font: 600 .8rem var(--font); color: var(--text-2); cursor: pointer; transition: all .15s; }
.pos-tabs button.activo { background: var(--primary); border-color: var(--primary); color: #fff; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pos-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 112px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); text-align: left; font: inherit; color: var(--text); cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; }
.pos-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.pos-tile:active { transform: scale(.97); }
.pos-tile.pulso { animation: cc-palomea .35s var(--spring, ease); }
.pos-tile.en-ticket { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-50); }
.pos-tile-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.pos-tile-ico .ico { width: 18px; height: 18px; }
.cat-estudio .pos-tile-ico { background: #e7f0fb; color: #2c6cb0; }
.cat-procedimiento .pos-tile-ico { background: #f1eafb; color: #6b3fb0; }
.cat-curacion .pos-tile-ico { background: #fdeee6; color: #b4561f; }
.cat-documento .pos-tile-ico { background: #eef1f0; color: #5b6b66; }
.pos-tile-nom { font-weight: 700; font-size: .86rem; line-height: 1.25; }
.pos-tile-precio { margin-top: auto; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.pos-tile.libre { border-style: dashed; background: transparent; }
.pos-tile.libre .pos-tile-precio { color: var(--muted); font-weight: 600; font-size: .78rem; }
.pos-tile-cant { position: absolute; top: 10px; right: 10px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 800; font-size: .76rem; display: grid; place-items: center; animation: cc-pop .3s var(--spring, ease); }

.pos-ticket { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 16px 20px 0; }
.pos-paciente-sel { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--primary-50); animation: cc-sube .25s var(--ease); }
.pos-paciente-sel small { display: block; color: var(--muted); font-size: .74rem; }
.pos-lineas { margin: 12px 0; display: grid; gap: 8px; align-content: start; min-height: 120px; }
.pos-vacio { display: grid; justify-items: center; gap: 8px; padding: 26px 10px; border: 1px dashed var(--border-strong); border-radius: 16px; color: var(--muted); font-size: .84rem; }
.pos-vacio .ico { width: 28px; height: 28px; opacity: .6; }
.pos-linea { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); animation: cc-sube .25s var(--ease) backwards; }
.pos-linea-nom { display: grid; gap: 4px; min-width: 0; }
.pos-linea-nom strong { font-size: .88rem; }
.pos-linea-nom .input { height: 32px; }
.pos-precio-u { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .74rem; }
.pos-precio-u .input { width: 92px; height: 28px; padding: 0 8px; font-size: .8rem; }
.pos-cant { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pos-cant button { width: 30px; height: 30px; border: 0; background: var(--surface-2); font-size: 1rem; font-weight: 700; cursor: pointer; color: var(--text); }
.pos-cant button:active { background: var(--primary-50); }
.pos-cant span { min-width: 28px; text-align: center; font-weight: 700; }
.pos-imp { min-width: 84px; text-align: right; }
.pos-quitar { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .9rem; padding: 4px; border-radius: 8px; }
.pos-quitar:hover { color: var(--danger); background: var(--danger-50); }
.pos-totales { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--border); font-size: .88rem; color: var(--text-2); }
.pos-link { border: 0; background: none; padding: 0; font: 600 .84rem var(--font); color: var(--primary); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.pos-desc { display: grid; grid-template-columns: 140px 1fr; gap: 8px; animation: cc-sube .2s var(--ease); }
.pos-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 6px; }
.pos-total span { font-weight: 700; color: var(--text); }
.pos-total strong { font-size: 2.3rem; letter-spacing: -.04em; color: var(--text); line-height: 1; }
.pos-total strong.salta { animation: cc-palomea .35s var(--spring, ease); }
.pos-pago { display: grid; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.pos-metodos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pos-metodos label { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border: 1px solid var(--border); border-radius: 12px; font-size: .7rem; font-weight: 700; color: var(--text-2); cursor: pointer; text-align: center; transition: all .15s; }
.pos-metodos input { position: absolute; opacity: 0; pointer-events: none; }
.pos-metodos label:has(input:checked) { border-color: var(--primary); background: var(--primary-50); color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.pos-metodos label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.pos-efectivo { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.pos-recibido .input { height: 44px; font-size: 1.1rem; font-weight: 700; }
.pos-billetes { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.pos-billetes button { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 7px 12px; font: 700 .8rem var(--font); cursor: pointer; color: var(--text); }
.pos-billetes button:hover { border-color: var(--primary); background: var(--primary-50); }
.pos-cambio { grid-row: 1; grid-column: 2; text-align: right; display: grid; }
.pos-cambio span { font-size: .72rem; color: var(--muted); font-weight: 600; }
.pos-cambio strong { font-size: 1.4rem; color: var(--primary); }
.pos-cambio strong.falta { color: var(--danger); font-size: 1rem; }
.pos-nota { margin: 0; font-size: .8rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.pos-factura summary { cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
.pos-cobrar { position: sticky; bottom: 0; margin: 4px -20px 0; width: calc(100% + 40px); border-radius: 0; height: 64px; font-size: 1.15rem; box-shadow: 0 -10px 20px -14px rgba(0, 0, 0, .3); }
.pos-cobrar:disabled { opacity: .45; }
.pos-cobrar.cargando { pointer-events: none; opacity: .7; }

/* Pantalla de cobro terminado */
.pos-listo { flex: 1; display: grid; place-items: center; padding: 24px; animation: cc-aparece .25s; }
.pos-listo-caja { width: min(520px, 100%); text-align: center; display: grid; gap: 8px; }
.pos-listo-ico { width: 96px; height: 96px; justify-self: center; }
.pos-listo-ico .aro { fill: none; stroke: var(--primary); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 252; stroke-dashoffset: 252; animation: cc-trazo .55s .1s var(--ease) forwards; }
.pos-listo-ico .palomita { fill: none; stroke: var(--primary); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: cc-trazo .35s .55s var(--ease) forwards; }
.pos-listo-ico .relleno { fill: var(--primary-50); transform-origin: center; transform: scale(0); animation: cc-crece .45s .5s var(--spring, ease) forwards; }
.pos-listo h2 { margin: 6px 0 0; font-size: 1.8rem; letter-spacing: -.03em; }
.pos-listo-cambio { display: grid; gap: 2px; margin: 10px auto; padding: 14px 28px; border-radius: 18px; background: #fff3d6; color: #6b4708; animation: cc-modal-entra .4s .3s var(--spring, ease) backwards; }
.pos-listo-cambio strong { font-size: 2.4rem; letter-spacing: -.03em; }
.pos-listo-acc { display: grid; gap: 10px; margin-top: 12px; }
.pos-envio { display: grid; gap: 8px; }
.pos-envio .input-unidad { display: flex; }
.pos-envio .input-unidad .input { border-radius: 12px 0 0 12px; }
.pos-envio .input-unidad .btn { border-radius: 0 12px 12px 0; height: 42px; }
@media (prefers-reduced-motion: reduce) { .pos-listo-ico .aro, .pos-listo-ico .palomita { stroke-dashoffset: 0; } .pos-listo-ico .relleno { transform: none; } }

@media (max-width: 900px) {
  .modal.pos { padding: 0; }
  .pos-caja.modal-caja { height: 100vh; max-height: 100vh; border-radius: 0; }
  .pos-cuerpo { grid-template-columns: 1fr; overflow-y: auto; }
  .pos-catalogo, .pos-ticket { overflow: visible; }
  .pos-grid { grid-template-columns: repeat(2, 1fr); }
  .pos-tile { min-height: 96px; }
  .pos-metodos { grid-template-columns: repeat(3, 1fr); }
  .pos-cobrar { position: sticky; bottom: env(safe-area-inset-bottom); }
}
.pos-envio .input-unidad .input { padding-right: 12px; flex: 1; }
.pos-ticket > * { flex: none; }
.pos-buscar > .ico { left: 34px; top: calc(50% + 3px); }
.pos-buscar .input { padding-left: 42px; }
.pos-ticket .btn.pos-cobrar { position: sticky; bottom: 0; z-index: 3; }
