:root {
  --pri: #0f766e; --pri-d: #0b5f58; --pri-l: #e6f4f2;
  --bg: #f4f6f8; --card: #fff; --tx: #1c2430; --mut: #5d6b7a; --bd: #dde3ea;
  --ok: #15803d; --ok-l: #e8f6ec; --warn: #a15c07; --warn-l: #fff5e0; --dan: #b42318; --dan-l: #fdecea;
  --info: #1d4ed8; --info-l: #e8efff;
  --r: 12px; --sh: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --pri-h: #0b5f58; --tx-2: #3b4652; --line: #eef1f4; --input-bd: #c5ced8; --hover: #f1f4f7; --hover-2: #e9edf1;
  --surface-2: #f7f8fa; --surface-3: #eff2f5; --topbar: rgba(244,246,248,.92);
  --info-tx: #173b8f; --warn-tx: #6e3f02; --ok-tx: #0f5a2b; --dan-tx: #7a1a11; --dan-fg: var(--dan);
  --demo-bg: #fff1c2; --demo-tx: #6b4b00; --toast: #12352f;
  --tinta: #33506b; --tinta-h: #253d54;
  color-scheme: light;
  font-size: 16px;
}
/* Modo oscuro */
:root[data-tema="oscuro"] {
  --pri: #0f766e; --pri-h: #13998e; --pri-d: #5eead4; --pri-l: #10302d;
  --bg: #0f1419; --card: #182028; --tx: #e6edf3; --tx-2: #c4cfda; --mut: #9aa8b6; --bd: #2c3742;
  --line: #232d37; --input-bd: #3d4956; --hover: #212b35; --hover-2: #27323d; --surface-2: #1c252e; --surface-3: #222c36;
  --ok: #4ade80; --ok-l: #12301f; --warn: #fbbf24; --warn-l: #332709; --dan: #d23c3c; --dan-l: #3a1818; --dan-fg: #fca5a5;
  --info: #93b4ff; --info-l: #17233f;
  --info-tx: #c7d7ff; --warn-tx: #fde68a; --ok-tx: #bbf7d0; --dan-tx: #fecaca;
  --topbar: rgba(15,20,25,.92); --demo-bg: #3a2f0b; --demo-tx: #fde68a; --toast: #0b3b35;
  --tinta: #3f6488; --tinta-h: #4c76a0;
  --sh: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.35);
  color-scheme: dark;
}
:root[data-tema="oscuro"] .req, :root[data-tema="oscuro"] .field-error, :root[data-tema="oscuro"] .form-msg,
:root[data-tema="oscuro"] .danger-text, :root[data-tema="oscuro"] .st-no_asistio { color: var(--dan-fg) !important; }
:root[data-tema="oscuro"] .btn.danger { color: #fff; }
:root[data-tema="oscuro"] #camVideo { border: 1px solid var(--bd); }
body { transition: background-color .2s, color .2s; }

/* Interruptor de tema */
.theme-switch { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: 0 .5rem; border: 0; background: none; color: var(--tx); font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px; }
.theme-switch:hover { background: var(--hover); }
.theme-switch:focus-visible { outline: 3px solid #7cc4bc; outline-offset: 2px; }
.ts-track { position: relative; width: 44px; height: 24px; border-radius: 999px; background: var(--input-bd); transition: background .2s; flex: none; }
.ts-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; display: grid; place-items: center; font-size: .7rem; color: #555; }
.theme-switch[aria-checked="true"] .ts-track { background: var(--pri); }
.theme-switch[aria-checked="true"] .ts-thumb { transform: translateX(20px); color: var(--pri); }
.ts-auto { font-size: .7rem; font-weight: 700; color: var(--mut); border: 1px solid var(--bd); border-radius: 999px; padding: 0 .4rem; }
.auth { position: relative; }
.auth-tools { position: absolute; top: .8rem; right: .8rem; }
.tema-opts { display: flex; flex-direction: column; gap: .6rem; }
.tema-opt { display: flex; gap: .7rem; align-items: flex-start; border: 1px solid var(--bd); border-radius: 10px; padding: .8rem 1rem; cursor: pointer; }
.tema-opt:has(input:checked) { border-color: var(--pri); background: var(--pri-l); }
.tema-opt input { margin-top: .2rem; }
.tema-opt small { display: block; color: var(--mut); font-weight: 400; }
.tema-horas { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .6rem; }
.tema-horas input { width: 160px; }
@media (max-width: 640px) { .theme-switch .ts-text { display: none; } }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--tx); line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: var(--pri-d); }
h1 { font-size: 1.6rem; margin: 0 0 .2rem; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 0; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
code { background: var(--line); padding: .05rem .35rem; border-radius: 4px; font-size: .9em; word-break: break-all; }
blockquote { margin: .5rem 0; padding: .6rem .8rem; border-left: 4px solid var(--pri); background: var(--pri-l); border-radius: 6px; white-space: pre-wrap; }
[hidden] { display: none !important; }
.muted { color: var(--mut); }
.small { font-size: .85rem; }
.center { text-align: center; }
.cap::first-letter { text-transform: uppercase; }
.mt { margin-top: 1.4rem; } .mt-s { margin-top: .5rem; }
.ok-text { color: var(--ok); font-weight: 600; } .danger-text { color: var(--dan) !important; }
.boot { padding: 3rem; text-align: center; color: var(--mut); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 44px; padding: .55rem 1rem; border-radius: 10px;
  border: 1px solid var(--bd); background: var(--card); color: var(--tx); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn:focus-visible, .icon-btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .row-btn:focus-visible { outline: 3px solid #7cc4bc; outline-offset: 2px; }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.primary:hover { background: var(--pri-h); border-color: var(--pri-h); }
/* Botón de impresión: tono "tinta" (azul pizarra) que combina con el verde azulado principal */
.btn.print { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.btn.print:hover { background: var(--tinta-h); border-color: var(--tinta-h); }
.btn.print svg { flex: none; }
.btn.danger { background: var(--dan); border-color: var(--dan); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover-2); }
.btn.sm { min-height: 36px; padding: .3rem .7rem; font-size: .9rem; }
.btn.lg { min-height: 50px; padding: .7rem 1.3rem; font-size: 1.02rem; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.icon-btn { min-width: 44px; min-height: 44px; border: 1px solid var(--bd); background: var(--card); border-radius: 10px; font-size: 1.2rem; cursor: pointer; color: var(--tx); }
.icon-btn.sm { min-width: 32px; min-height: 32px; font-size: 1rem; }

/* Formularios */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form.grid2, .step-panel.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
.full, .grid2 > .callout, .grid2 > h3 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field label, fieldset legend { font-weight: 600; font-size: .95rem; }
.req { color: var(--dan); }
input, select, textarea { font: inherit; color: inherit; width: 100%; min-height: 44px; padding: .55rem .7rem; border: 1px solid var(--input-bd); border-radius: 9px; background: var(--card); }
textarea { resize: vertical; min-height: 64px; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--pri); flex: none; }
[aria-invalid="true"] { border-color: var(--dan); background: var(--dan-l); }
.field-error { color: var(--dan); font-size: .87rem; font-weight: 600; }
.hint { color: var(--mut); font-size: .85rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { margin-top: .15rem; }
.form-msg { color: var(--dan); font-weight: 600; min-height: 1.2em; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.form-bar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--bd); padding-top: 1rem; margin-top: .5rem; }
.spacer { flex: 1; }
h3.sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); margin: .6rem 0 0; border-bottom: 1px solid var(--bd); padding-bottom: .3rem; }
fieldset.antec { border: 1px solid var(--bd); border-radius: 10px; padding: .8rem 1rem 1rem; margin: 0 0 .8rem; }
.seg { display: inline-flex; border: 1px solid var(--input-bd); border-radius: 10px; overflow: hidden; flex-wrap: wrap; background: var(--card); }
.seg label, .seg button { position: relative; cursor: pointer; border: 0; background: none; font: inherit; padding: 0; }
.seg label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span, .seg button { display: inline-flex; align-items: center; min-height: 42px; padding: .4rem 1rem; border-right: 1px solid var(--input-bd); font-weight: 600; }
.seg label:last-child span, .seg button:last-child { border-right: 0; }
.seg input:checked + span, .seg button.on { background: var(--pri); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid #7cc4bc; outline-offset: -3px; }
.antec-det { margin-top: .7rem; }

/* Autenticación */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.2rem; background: linear-gradient(160deg, var(--pri-l), var(--bg) 55%); }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 16px; box-shadow: 0 10px 30px rgba(16,24,40,.08); padding: 2rem; }
.auth-card.wide { max-width: 720px; }
.auth-card h1 { text-align: center; }
.auth-card > p.muted { text-align: center; margin-top: 0; }
.auth-logo { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 14px; background: var(--pri); color: #fff; display: grid; place-items: center; font-size: 1.8rem; }
.divider { display: flex; align-items: center; gap: .8rem; color: var(--mut); margin: 1.6rem 0 1rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--bd); }
.demo-box { text-align: center; }

/* Estructura */
.demo-banner { background: var(--demo-bg); color: var(--demo-tx); text-align: center; font-weight: 600; padding: .35rem; font-size: .9rem; }
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 260px; flex: none; background: var(--card); border-right: 1px solid var(--bd); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.brand { display: flex; gap: .7rem; align-items: center; padding: 1.1rem 1rem; border-bottom: 1px solid var(--bd); }
.brand strong { display: block; font-size: .98rem; line-height: 1.2; }
.brand small { color: var(--mut); }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; background: var(--pri); color: #fff; display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.sidebar nav { flex: 1; overflow-y: auto; padding: .6rem; display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border-radius: 10px; color: var(--tx); text-decoration: none; font-weight: 500; min-height: 44px; }
.sidebar nav a:hover { background: var(--hover); }
.sidebar nav a.active { background: var(--pri-l); color: var(--pri-d); font-weight: 700; }
.ni { width: 1.4rem; text-align: center; }
.nbadge { margin-left: auto; background: var(--dan); color: #fff; border-radius: 999px; font-size: .75rem; font-weight: 700; padding: .05rem .45rem; min-width: 1.3rem; text-align: center; }
.side-user { border-top: 1px solid var(--bd); padding: .9rem 1rem; display: flex; flex-direction: column; gap: .5rem; }
.side-user small { display: block; color: var(--mut); }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--topbar); backdrop-filter: blur(6px); display: flex; align-items: center; gap: .7rem; padding: .7rem 1.4rem; border-bottom: 1px solid var(--bd); }
.top-title { font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: .5rem; }
.menu-btn { display: none; }
main { padding: 1.4rem; max-width: 1280px; width: 100%; margin: 0 auto; outline: none; padding-bottom: 3rem; }
.scrim { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 35; }
.bottomnav { display: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-head p { margin: 0; }
.quick { display: flex; gap: .6rem; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: .6rem; text-decoration: none; font-weight: 600; padding: .3rem 0; }
.card { background: var(--card); border: 1px solid var(--bd); border-radius: var(--r); box-shadow: var(--sh); padding: 1.2rem; margin-bottom: 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .8rem; flex-wrap: wrap; }
.inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.callout { border-radius: 10px; padding: .75rem .95rem; background: var(--line); margin: 0 0 1rem; }
.callout p { margin: .2rem 0 .6rem; }
.callout.info { background: var(--info-l); color: var(--info-tx); }
.callout.warn { background: var(--warn-l); color: var(--warn-tx); }
.callout.ok { background: var(--ok-l); color: var(--ok-tx); }
.callout.danger { background: var(--dan-l); color: var(--dan-tx); }
.callout.small { padding: .45rem .7rem; font-size: .9rem; margin: .5rem 0; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: .12rem .6rem; font-size: .78rem; font-weight: 700; background: var(--line); color: var(--tx-2); white-space: nowrap; }
.badge.ok { background: var(--ok-l); color: var(--ok); } .badge.warn { background: var(--warn-l); color: var(--warn); } .badge.info { background: var(--info-l); color: var(--info); }
.st-pendiente { background: var(--warn-l); color: var(--warn); }
.st-confirmada { background: var(--info-l); color: var(--info); }
.st-atendida { background: var(--ok-l); color: var(--ok); }
.st-cancelada { background: var(--line); color: var(--mut); text-decoration: line-through; }
.st-no_asistio { background: var(--dan-l); color: var(--dan); }
.empty { text-align: center; padding: 2.5rem 1rem; background: var(--card); border: 1px dashed var(--input-bd); border-radius: var(--r); margin: 1rem 0; }
.empty h2 { margin-bottom: .4rem; }
.empty p { color: var(--mut); max-width: 520px; margin: 0 auto 1rem; }
.empty-inline { color: var(--mut); padding: .6rem 0; margin: 0; }
.status-line { font-weight: 600; }
.status-line.ok { color: var(--ok); } .status-line.warn { color: var(--warn); }
.doc { background: var(--surface-2); border: 1px solid var(--bd); border-radius: 10px; padding: .9rem 1.1rem; margin-top: .8rem; }
.doc ol, .doc ul { padding-left: 1.2rem; margin: .3rem 0; } .doc li { margin: .3rem 0; }
details > summary { cursor: pointer; font-weight: 600; padding: .4rem 0; }

/* Panel */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: .8rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--bd); border-radius: var(--r); padding: 1rem; text-decoration: none; color: var(--tx); box-shadow: var(--sh); display: flex; flex-direction: column; }
.stat:hover { border-color: var(--pri); }
.stat-n { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat-t { color: var(--mut); font-size: .9rem; font-weight: 600; }
.stat.warn .stat-n { color: var(--warn); } .stat.info .stat-n { color: var(--info); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { border-bottom: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 0; }
.row-btn { display: flex; gap: .8rem; align-items: center; width: 100%; padding: .65rem .3rem; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; text-decoration: none; border-radius: 8px; min-height: 52px; }
.row-btn:hover { background: var(--hover); }
.row-time { font-weight: 700; min-width: 3.6rem; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.row-time small { font-weight: 500; color: var(--mut); font-size: .78rem; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-main small { color: var(--mut); overflow: hidden; text-overflow: ellipsis; }
.rem, .urow { display: flex; gap: .8rem; align-items: center; padding: .75rem .3rem; flex-wrap: wrap; }
.rem-act { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

/* Pacientes */
.toolbar { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; }
.toolbar .grow { flex: 1 1 260px; }
.toolbar .field { flex: 0 1 220px; }
.plist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: .7rem; }
.pcard { display: flex; gap: .9rem; align-items: center; background: var(--card); border: 1px solid var(--bd); border-radius: var(--r); padding: .9rem; text-decoration: none; color: var(--tx); box-shadow: var(--sh); height: 100%; }
.pcard:hover { border-color: var(--pri); }
.pc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pc-main small { color: var(--mut); }
.pc-badges { display: flex; gap: .3rem; flex-wrap: wrap; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--pri-l); color: var(--pri-d); display: inline-grid; place-items: center; font-weight: 800; flex: none; object-fit: cover; }
.avatar.sm { width: 36px; height: 36px; font-size: .85rem; }
.avatar.xl { width: 104px; height: 104px; font-size: 2rem; }
.exp-head { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.exp-info { flex: 1; min-width: 220px; }
.exp-info p { margin: .15rem 0; }
.exp-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.photo { border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .3rem; font: inherit; color: var(--pri-d); }
.photo-edit { font-size: .82rem; font-weight: 700; }
.tabs { display: flex; gap: .3rem; overflow-x: auto; overflow-y: hidden; padding-bottom: 2px;margin: 0 0 .8rem; border-bottom: 2px solid var(--bd); scrollbar-width: thin; }
.tabs a { padding: .7rem 1rem; text-decoration: none; color: var(--mut); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a.active { color: var(--pri-d); border-bottom-color: var(--pri); }
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem 1.2rem; margin: 0; }
.dl dt { font-size: .8rem; color: var(--mut); font-weight: 600; }
.dl dd { margin: .1rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.antec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; }
.antec-view { border: 1px solid var(--bd); border-radius: 10px; padding: .8rem; }
.antec-view p { margin: .5rem 0 0; white-space: pre-wrap; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 3px solid var(--pri-l); }
.timeline > li { position: relative; padding: 0 0 .8rem 1.1rem; }
.timeline > li::before { content: ""; position: absolute; left: -8px; top: .85rem; width: 13px; height: 13px; border-radius: 50%; background: var(--pri); border: 2px solid var(--card); }
.timeline summary { display: flex; flex-wrap: wrap; gap: .2rem .7rem; align-items: baseline; padding: .5rem 0; }
.timeline summary small { color: var(--mut); font-weight: 500; flex-basis: 100%; }
.tl-date { color: var(--pri-d); font-weight: 800; }
.timeline details > .dl { padding: .4rem 0 .8rem; }
.audit { list-style: none; padding: 0; margin: 0; } .audit li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.steps { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0 0 1rem; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: .5rem; color: var(--mut); font-weight: 600; padding: .4rem .8rem .4rem .4rem; border-radius: 999px; background: var(--card); border: 1px solid var(--bd); }
.steps li span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--line); }
.steps li.active { color: var(--pri-d); border-color: var(--pri); } .steps li.active span { background: var(--pri); color: #fff; }
.steps li.done span { background: var(--ok-l); color: var(--ok); }
.foto-actual { text-align: center; } .foto-actual img, #prevImg { max-width: 100%; max-height: 300px; border-radius: 12px; }
#camVideo { width: 100%; max-height: 360px; background: #000; border-radius: 12px; }
.foto-btns { display: flex; gap: .5rem; flex-wrap: wrap; margin: .6rem 0; }
#prevBox { text-align: center; } #prevBox .foto-btns { justify-content: center; }

/* Agenda */
.agenda-bar { justify-content: space-between; align-items: center; }
.agenda-bar input[type=date] { width: auto; }
.slot.closed { background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 8px, var(--surface-3) 8px, var(--surface-3) 16px); }
.day-hours { margin: 0 0 .5rem; }
.wday.closed { background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 8px, var(--surface-3) 8px, var(--surface-3) 16px); }
.wh { margin: 0; padding: .25rem .6rem; font-size: .76rem; color: var(--mut); border-bottom: 1px solid var(--line); }
.mcell.closed { background: var(--surface-2); }
.mcell.closed .md { color: var(--mut); }
.sched { display: flex; flex-direction: column; border: 1px solid var(--bd); border-radius: 10px; overflow: hidden; }
.sched-row { display: flex; gap: 1rem; align-items: flex-start; padding: .7rem .9rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sched-row.off { background: var(--surface-2); }
.sched-day { width: 130px; flex: none; padding-top: .6rem; font-weight: 700; }
.sched-turnos { flex: 1; display: flex; flex-direction: column; gap: .45rem; align-items: flex-start; min-width: 230px; }
.sched-row.off .sched-turnos { padding-top: .6rem; }
.sched-turno { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sched-turno input[type=time] { width: 160px; }
.sched-turno .field-error { flex-basis: 100%; }
.sched-tools { padding: .7rem .9rem; background: var(--surface-2); }
/* Marca */
img.brand-logo { width: 54px; height: 54px; border-radius: 12px; background: #000; object-fit: cover; display: block; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
img.auth-logo { width: 128px; height: 128px; border-radius: 26px; background: #000; object-fit: cover; display: block; margin: 0 auto 1rem; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
/* Recomendaciones rápidas */
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .2rem; }
.chip { border: 1px solid var(--bd); background: var(--surface-2); color: var(--tx); border-radius: 999px; padding: .3rem .7rem; font: inherit; font-size: .82rem; cursor: pointer; text-align: left; min-height: 32px; }
.chip:hover { border-color: var(--pri); }
/* Escala EVA (consulta recurrente) */
fieldset.eva { border: 1px solid var(--bd); border-radius: 12px; padding: .9rem 1rem 1rem; margin: 0 0 .6rem; grid-column: 1 / -1; min-width: 0; }
fieldset.eva legend { padding: 0 .3rem; line-height: 1.4; }
.eva-escala { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: .3rem; margin-top: .6rem; }
.eva-op { position: relative; display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .45rem .1rem .4rem; border-radius: 10px;
  border: 2px solid transparent; background: color-mix(in srgb, var(--eva) 13%, var(--card)); color: var(--eva); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.eva-op input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.eva-op:hover { transform: translateY(-2px); }
.eva-op:has(input:focus-visible) { outline: 3px solid var(--pri); outline-offset: 2px; }
.eva-op:has(input:checked) { background: var(--eva); color: #fff; border-color: var(--eva); transform: translateY(-3px) scale(1.06); box-shadow: 0 6px 14px rgba(0,0,0,.18); }
.eva-num { font-weight: 800; font-size: 1.15rem; line-height: 1; }
.eva-cara { line-height: 0; }
.eva-niveles { display: grid; grid-template-columns: 1fr 3fr 3fr 3fr 1fr; gap: .3rem; margin-top: .35rem; font-size: .74rem; color: var(--mut); text-align: center; }
.eva-niveles span { border-top: 3px solid var(--bd); padding-top: .2rem; }
.eva-niveles span:nth-child(1) { border-color: hsl(135,68%,40%); } .eva-niveles span:nth-child(2) { border-color: hsl(100,68%,40%); }
.eva-niveles span:nth-child(3) { border-color: hsl(60,68%,38%); } .eva-niveles span:nth-child(4) { border-color: hsl(20,68%,40%); }
.eva-niveles span:nth-child(5) { border-color: hsl(0,68%,40%); }
.eva-res { margin: .7rem 0 0; min-height: 1.4em; }
.eva-hist { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .45rem; margin: 0 0 1rem; padding: .6rem .8rem; border-radius: 10px; background: var(--surface-2, var(--line)); }
.eva-chip { display: inline-flex; flex-direction: column; align-items: center; min-width: 2.6rem; padding: .2rem .45rem; border-radius: 8px; background: var(--eva); color: #fff; font-weight: 800; line-height: 1.1; }
.eva-chip small { font-weight: 500; font-size: .68rem; opacity: .92; }
.eva-chip.sm { flex-direction: row; min-width: 0; font-size: .8rem; padding: .1rem .45rem; }
.timeline > li.tl-seg::before { background: var(--card); border-color: var(--pri); }
.seg-resumen { line-height: 1.5; }
@media (max-width: 640px) {
  .eva-escala { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .eva-niveles { display: none; }
}
/* Dispositivo recordado (inicio de sesión) */
.recordado { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; margin: .4rem 0 1rem; border: 1px solid var(--bd); border-radius: 12px; background: var(--surface-2, var(--line)); text-align: left; }
.recordado strong { display: block; font-size: 1.05rem; }
.recordado small { color: var(--mut); }
.avatar.lg { width: 54px; height: 54px; font-size: 1.15rem; }
.recordado-links { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
/* Seguimiento programado */
fieldset.seg-prog { grid-column: 1 / -1; border: 1px solid var(--bd); border-left: 4px solid var(--pri); border-radius: 12px; padding: .8rem 1rem .6rem; margin: .4rem 0 .2rem; min-width: 0; }
fieldset.seg-prog legend { padding: 0 .3rem; }
fieldset.seg-prog.off { border-left-color: var(--bd); }
.seg-plazo { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .45rem; }
.seg-plazo input[type=number] { width: 5.5rem; }
.seg-plazo select { width: auto; min-width: 8rem; }
.seg-rapidos { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.seg-fecha { margin: .55rem 0 0; }
.seg-avisos { margin-top: 1rem; }
.badge.dan { background: var(--dan-l); color: var(--dan-fg); }
.rem.seg-vencido, .rem.seg-hoy, .rem.seg-proximo { padding-left: .7rem; }
.rem.seg-vencido { border-left: 4px solid var(--dan); }
.rem.seg-hoy, .rem.seg-proximo { border-left: 4px solid var(--warn); }
.mt-s { margin-top: .5rem; }
a.badge { text-decoration: none; }
/* Vista previa de la nota */
.nota-preview { margin-top: 1rem; display: flex; flex-direction: column; gap: 1rem; align-items: center; background: var(--surface-3); border-radius: 10px; padding: 1rem; max-height: 60vh; overflow-y: auto; }
.nota-preview img { width: 100%; max-width: 640px; box-shadow: 0 4px 16px rgba(0,0,0,.18); border-radius: 2px; background: #fff; }
.legend { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.day { padding: 0; overflow: hidden; }
.slot { display: flex; border-bottom: 1px solid var(--line); min-height: 64px; }
.slot:last-child { border-bottom: 0; }
.slot-h { width: 72px; flex: none; padding: .7rem; color: var(--mut); font-weight: 700; font-variant-numeric: tabular-nums; border-right: 1px solid var(--line); }
.slot-c { flex: 1; padding: .45rem; display: flex; flex-direction: column; gap: .35rem; }
.slot-add { align-self: flex-start; border: 1px dashed var(--input-bd); background: none; color: var(--mut); border-radius: 8px; padding: .3rem .8rem; cursor: pointer; font: inherit; font-size: .88rem; min-height: 36px; }
.slot-add:hover { border-color: var(--pri); color: var(--pri-d); }
.slot-libres { display: flex; flex-wrap: wrap; gap: .35rem; }
.slot-libres:empty { display: none; }
.appt { display: grid; grid-template-columns: auto 1fr auto; gap: 0 .7rem; align-items: center; text-align: left; border: 1px solid var(--bd); border-left: 5px solid var(--pri); background: var(--card); border-radius: 8px; padding: .5rem .7rem; cursor: pointer; font: inherit; color: inherit; width: 100%; }
.appt:hover { box-shadow: var(--sh); }
.appt small { grid-column: 2; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt .badge { grid-row: 1 / span 2; grid-column: 3; }
.appt-t { font-weight: 700; font-variant-numeric: tabular-nums; grid-row: 1 / span 2; font-size: .9rem; }
.st-b-pendiente { border-left-color: #e2a03f; } .st-b-confirmada { border-left-color: #3b6fe0; } .st-b-atendida { border-left-color: #2f9e5a; }
.st-b-cancelada { border-left-color: #a8b3be; opacity: .7; } .st-b-no_asistio { border-left-color: #d9534f; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.wday { background: var(--card); border: 1px solid var(--bd); border-radius: var(--r); min-height: 220px; display: flex; flex-direction: column; }
.wday.today { border-color: var(--pri); box-shadow: 0 0 0 2px var(--pri-l); }
.wday header { display: flex; justify-content: space-between; align-items: center; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
.wday header a { font-weight: 700; text-decoration: none; text-transform: capitalize; padding: .3rem; }
.wlist { padding: .4rem; display: flex; flex-direction: column; gap: .35rem; }
.wlist .appt { grid-template-columns: 1fr; padding: .4rem .5rem; }
.wlist .appt > * { grid-column: 1 !important; grid-row: auto !important; }
.wlist .appt .badge { justify-self: start; }
.wlist .appt strong { font-size: .88rem; overflow-wrap: anywhere; line-height: 1.25; }
.wlist .appt small { white-space: normal; }
.month { padding: .5rem; }
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mh { text-align: center; font-weight: 700; color: var(--mut); font-size: .8rem; text-transform: uppercase; padding: .3rem; }
.mcell { min-height: 96px; border: 1px solid var(--line); border-radius: 8px; padding: .3rem; text-decoration: none; color: var(--tx); display: flex; flex-direction: column; gap: 2px; position: relative; }
.mcell:hover { border-color: var(--pri); }
.mcell.out { opacity: .45; }
.mcell.today .md { background: var(--pri); color: #fff; border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; }
.md { font-weight: 700; font-size: .9rem; }
.mchip { font-size: .74rem; border-left: 3px solid var(--pri); background: var(--hover); padding: 1px 4px; border-radius: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mmore { font-size: .72rem; color: var(--mut); }
.mcount { display: none; }
.pac-sel { display: flex; align-items: center; gap: .7rem; border: 1px solid var(--pri); background: var(--pri-l); border-radius: 10px; padding: .5rem .7rem; }
.pac-sel > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; } .pac-sel small { color: var(--mut); }
.pac-res { display: flex; flex-direction: column; margin-top: .3rem; }
.pac-res button { display: flex; justify-content: space-between; gap: .5rem; border: 1px solid var(--bd); border-top: 0; background: var(--card); padding: .6rem .8rem; cursor: pointer; font: inherit; text-align: left; min-height: 44px; align-items: center; }
.pac-res button:first-child { border-top: 1px solid var(--bd); border-radius: 8px 8px 0 0; }
.pac-res button:last-child { border-radius: 0 0 8px 8px; } .pac-res button:only-child { border-radius: 8px; }
.pac-res button:hover { background: var(--pri-l); }
.appt-detail .big { font-size: 1.15rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 0; }
.state-btns { display: flex; gap: .5rem; flex-wrap: wrap; margin: .4rem 0 .8rem; align-items: center; }
.sol-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 1rem; }
.sol header { margin-bottom: .6rem; display: flex; flex-direction: column; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--mut); font-size: .8rem; text-transform: uppercase; }

/* Modales y avisos */
.modal-back { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; overflow-y: auto; }
.modal { background: var(--card); border-radius: 14px; width: 100%; max-width: 520px; box-shadow: 0 20px 50px rgba(0,0,0,.25); display: flex; flex-direction: column; max-height: 92vh; }
.modal.wide { max-width: 820px; }
.modal header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--bd); }
.modal header .icon-btn { border: 0; }
.modal-body { padding: 1.1rem 1.2rem; overflow-y: auto; }
.modal footer { display: flex; justify-content: flex-end; gap: .6rem; padding: .9rem 1.2rem; border-top: 1px solid var(--bd); flex-wrap: wrap; }
.confirm-msg p:first-child { margin-top: 0; }
#toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: .5rem; align-items: center; width: min(94vw, 480px); pointer-events: none; }
.toast { background: var(--toast); color: #fff; padding: .8rem 1.1rem; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-weight: 600; transition: opacity .3s, transform .3s; width: 100%; text-align: center; }
.toast.error { background: var(--dan); } .toast.info { background: #334155; }
.toast.out { opacity: 0; transform: translateY(10px); }
#print-area { display: none; }

/* Tableta */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wday { min-height: 0; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-105%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-block; }
  .cols { grid-template-columns: 1fr; }
  main { padding: 1rem 1rem 6rem; }
  .topbar { padding: .6rem 1rem; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--bd); padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav a, .bottomnav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 58px; text-decoration: none; color: var(--mut); font: inherit; font-size: .74rem; font-weight: 600; background: none; border: 0; position: relative; cursor: pointer; }
  .bottomnav a span:first-child, .bottomnav button span { font-size: 1.25rem; }
  .bottomnav a.active { color: var(--pri-d); }
  .bottomnav .nbadge { position: absolute; top: 4px; left: 55%; margin: 0; }
  #toasts { bottom: 5rem; }
}
/* Teléfono */
@media (max-width: 640px) {
  :root { font-size: 15.5px; }
  h1 { font-size: 1.35rem; }
  .form.grid2, .step-panel.grid2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .top-actions .btn:first-child { display: none; }
  .quick { width: 100%; } .quick .btn { flex: 1; }
  .week { grid-template-columns: 1fr; }
  .month { padding: .3rem; }
  .mgrid { gap: 2px; }
  .mh { font-size: .68rem; padding: .2rem 0; }
  .mcell { min-height: 64px; padding: 2px; gap: 1px; border-radius: 6px; }
  .md { font-size: .8rem; }
  .mcell.today .md { width: 22px; height: 22px; }
  .mchip { font-size: .6rem; line-height: 1.25; padding: 0 2px; border-left-width: 2px; border-radius: 3px; }
  .mchip-h { display: none; }
  .mmore { font-size: .6rem; }
  .plist, .sol-list { grid-template-columns: 1fr; }
  .card { padding: 1rem; }
  .exp-head { flex-direction: column; text-align: center; }
  .exp-head .pc-badges { justify-content: center; }
  .exp-actions { width: 100%; } .exp-actions .btn { flex: 1; }
  .modal-back { padding: 0; align-items: stretch; }
  .modal, .modal.wide { max-width: none; max-height: none; min-height: 100%; border-radius: 0; }
  .modal-body { flex: 1; }
  .modal footer { position: sticky; bottom: 0; background: var(--card); }
  .modal footer .btn { flex: 1; }
  .form-bar .btn { flex: 1; } .form-bar .spacer { display: none; }
  .toolbar .field { flex: 1 1 140px; }
  .agenda-bar { flex-direction: column; align-items: stretch; }
  .slot-h { width: 56px; padding: .6rem .4rem; }
  .appt { grid-template-columns: 1fr auto; } .appt-t { grid-row: auto; } .appt small { grid-column: 1; } .appt .badge { grid-row: 1 / span 3; grid-column: 2; }
  .auth-card { padding: 1.4rem; }
}

/* Impresión */
@page { size: letter; margin: 0; }
@media print {
  html, body { background: #fff !important; margin: 0; padding: 0; }
  #app, #toasts, .modal-back, .demo-banner { display: none !important; }
  #print-area { display: block !important; }
  #print-area img.pr-page { display: block; width: 8.5in; height: 10.98in; page-break-after: always; break-after: page; }
  #print-area img.pr-page:last-child { page-break-after: auto; break-after: auto; }
}

/* ================= Perfil del consultorio, logotipo y registro ================= */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.auth-logo.gen, .brand-logo.logo-ini, .auth-logo.logo-ini { background: var(--pri); color: #fff; }
.logo-ini { font-weight: 800; letter-spacing: .5px; }
.auth-logo.logo-ini { font-size: 1.6rem; }
.brand-logo.logo-ini { font-size: 1rem; }
img.auth-logo { width: auto; height: auto; max-width: 180px; max-height: 128px; object-fit: contain; background: none; box-shadow: none; border-radius: 14px; }
img.brand-logo { width: 54px; height: 54px; object-fit: contain; background: none; box-shadow: none; }
.auth-card.setup { max-width: 780px; }
.logo-box { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.logo-prev { width: 112px; height: 112px; border: 1px dashed var(--input-bd); border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); overflow: hidden; flex: none; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-acc { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; flex: 1; min-width: 200px; }
.logo-acc .hint { flex-basis: 100%; }
label.btn:focus-within { outline: 3px solid #7cc4bc; outline-offset: 2px; }
.doc-list li { align-items: center; }
.acepta { border: 1px solid var(--bd); border-radius: 10px; padding: .8rem 1rem; margin: .8rem 0 0; display: flex; flex-direction: column; gap: .6rem; }

/* Cuestionario de funciones */
.cuestionario { display: flex; flex-direction: column; gap: 1rem; }
.q-grupo { border: 1px solid var(--bd); border-radius: 12px; padding: .6rem 1rem .9rem; margin: 0; }
.q-grupo legend { font-weight: 700; padding: 0 .4rem; }
.q-item { display: flex; gap: .8rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.q-item:last-of-type { border-bottom: 0; }
.q-item input { position: absolute; opacity: 0; width: 44px; height: 24px; margin: .1rem 0 0; cursor: pointer; }
.q-sw { flex: none; width: 44px; height: 24px; border-radius: 999px; background: var(--input-bd); position: relative; transition: background .2s; margin-top: .1rem; }
.q-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.q-item input:checked + .q-sw { background: var(--pri); }
.q-item input:checked + .q-sw::after { transform: translateX(20px); }
.q-item input:focus-visible + .q-sw { outline: 3px solid #7cc4bc; outline-offset: 2px; }
.q-txt strong { display: block; }
.q-txt small { display: block; color: var(--mut); }
.q-item.off { opacity: .5; cursor: not-allowed; }
.q-plazo { padding: .6rem 0 0; }
.q-ant { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem 1rem; }
.q-dur { max-width: 320px; }

/* Signos, medidas y cobro */
.med-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem .9rem; }
.imc-box { display: flex; flex-direction: column; justify-content: center; background: var(--surface-2); border-radius: 10px; padding: .5rem .8rem; }
.imc-box strong { font-size: 1.05rem; }
.peso-chip small { display: block; font-weight: 500; }

/* Documentos legales */
.legal-doc { line-height: 1.55; }
.legal-doc h2 { font-size: 1.25rem; margin: 0 0 .2rem; }
.legal-doc h3 { font-size: 1rem; margin: 1.1rem 0 .3rem; }
.legal-doc p, .legal-doc li { margin: .35rem 0; }
.legal-ver { color: var(--mut); font-size: .88rem; margin-top: 0; }
.legal-nota { background: var(--warn-l); color: var(--warn-tx); border-radius: 8px; padding: .45rem .7rem; font-size: .88rem; }
mark.falta { background: #ffe9a8; color: #5a3c00; border-radius: 4px; padding: 0 .25rem; }
code.huella { font-size: .78em; }
.firma-img { max-width: 320px; width: 100%; border: 1px solid var(--bd); border-radius: 8px; background: #fff; }

/* Pantalla del paciente (consentimiento en el dispositivo) */
body.pmode-on { overflow: hidden; }
.pmode { position: fixed; inset: 0; z-index: 150; background: var(--bg); overflow-y: auto; display: flex; justify-content: center; align-items: flex-start; padding: 1.2rem 1rem 0; }
.pmode-card { width: 100%; max-width: 760px; background: var(--card); border-radius: 16px; box-shadow: 0 10px 30px rgba(16,24,40,.1); display: flex; flex-direction: column; margin-bottom: 1.2rem; }
.pmode-head { display: flex; gap: .9rem; align-items: center; padding: 1rem 1.3rem; border-bottom: 1px solid var(--bd); }
.pmode-head small { display: block; color: var(--mut); }
.pm-logo { width: 52px; height: 52px; border-radius: 12px; flex: none; display: grid; place-items: center; object-fit: contain; }
span.pm-logo { background: var(--pri); color: #fff; font-weight: 800; }
.pmode-body { padding: 1.1rem 1.3rem; display: flex; flex-direction: column; gap: 1rem; font-size: 1.05rem; }
.pm-hola { margin: 0; font-size: 1.1rem; }
.pm-hola:focus { outline: none; }
.pm-sec { border: 1px solid var(--bd); border-radius: 12px; padding: .9rem 1rem; }
.pm-sec h3 { display: flex; align-items: center; gap: .55rem; font-size: 1.08rem; margin: 0 0 .5rem; }
.pm-sec h3 span { width: 28px; height: 28px; border-radius: 50%; background: var(--pri); color: #fff; display: grid; place-items: center; font-size: .9rem; flex: none; }
.pm-sec details { margin-top: .6rem; }
.pm-sec summary { cursor: pointer; font-weight: 600; color: var(--pri-d); min-height: 44px; display: flex; align-items: center; }
.pm-sec .legal-doc { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; font-size: .95rem; }
.pm-check { padding: .7rem .8rem; border: 1px solid var(--bd); border-radius: 10px; margin: .5rem 0; }
.pm-check input { width: 22px; height: 22px; flex: none; }
.pm-check:has(input:checked) { border-color: var(--pri); background: var(--pri-l); }
.pm-tutor { margin-bottom: .5rem; }
.pm-firma { margin-top: .8rem; }
.firma-pad { width: 100%; height: auto; aspect-ratio: 900 / 260; border: 1px solid var(--input-bd); border-radius: 10px; background: #fff; touch-action: none; display: block; margin: .4rem 0; }
.pmode-foot { display: flex; justify-content: space-between; gap: .7rem; padding: 1rem 1.3rem; border-top: 1px solid var(--bd); position: sticky; bottom: 0; background: var(--card); border-radius: 0 0 16px 16px; flex-wrap: wrap; }
.pm-gracias { padding: 3rem 1.5rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.pm-gracias .pm-logo { width: 88px; height: 88px; }
@media (max-width: 640px) {
  .pmode { padding: 0; }
  .pmode-card { border-radius: 0; min-height: 100%; }
  .pmode-foot { border-radius: 0; }
  .pmode-foot .btn { flex: 1; }
}

/* Consentimientos en el expediente */
.cons-list .cons-row { display: flex; gap: .8rem; align-items: center; }
.cons-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--mut); font-weight: 800; flex: none; }
.cons-ico.ok { background: var(--ok-l); color: var(--ok); }
.cons-ico.warn { background: var(--warn-l); color: var(--warn); }
.cons-paso { display: flex; flex-direction: column; gap: .7rem; }

/* Fotografías clínicas */
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem; }
.foto-c { border: 1px solid var(--bd); border-radius: 12px; background: var(--card); padding: 0; overflow: hidden; cursor: pointer; text-align: left; font: inherit; color: inherit; display: flex; flex-direction: column; }
.foto-c:hover { border-color: var(--pri); }
.foto-img { aspect-ratio: 4 / 3; background: var(--surface-3); display: block; }
.foto-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-pie { padding: .5rem .7rem; }
.foto-pie small { display: block; color: var(--mut); }
.foto-grande, #fcImg, #fcVideo { width: 100%; max-height: 65vh; object-fit: contain; border-radius: 10px; background: #000; display: block; }

/* Odontograma */
.odo-wrap { overflow-x: auto; padding-bottom: .4rem; }
.odo { min-width: 640px; display: flex; flex-direction: column; gap: .35rem; }
.odo-lado { display: flex; justify-content: space-between; color: var(--mut); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.odo-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.odo-fila .odo-medio:first-child { border-right: 2px solid var(--bd); padding-right: 1rem; justify-content: flex-end; }
.odo-medio { display: flex; gap: .3rem; }
.odo-sep { height: 2px; background: var(--bd); margin: .2rem 0; }
.diente { --d-bg: #fff; --d-fg: #5d6b7a; width: 36px; min-height: 52px; border: 2px solid var(--d-fg); background: var(--d-bg); color: #1c2430; border-radius: 8px 8px 12px 12px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: .2rem 0; cursor: pointer; font: inherit; }
.diente.e-sano { border-color: var(--input-bd); }
.diente.e-ausente { border-style: dashed; opacity: .7; }
.diente:hover { transform: translateY(-1px); box-shadow: var(--sh); }
.diente:focus-visible { outline: 3px solid #7cc4bc; outline-offset: 2px; }
.d-num { font-size: .78rem; font-weight: 700; }
.d-ico { color: var(--d-fg); font-size: .95rem; line-height: 1; min-height: 1rem; }
.odo-leyenda { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: .8rem 0; font-size: .85rem; }
.odo-leyenda span { display: inline-flex; align-items: center; gap: .35rem; }
.odo-leyenda i, .odo-op i { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--d-fg); background: var(--d-bg); display: inline-block; flex: none; }
.odo-opciones { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .4rem; margin-bottom: .8rem; }
.odo-op { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--bd); border-radius: 8px; padding: .5rem .6rem; cursor: pointer; min-height: 44px; }
.odo-op:has(input:checked) { border-color: var(--pri); background: var(--pri-l); }

/* Impresión de documentos legales y constancias */
@media print {
  body.pmode-on .pmode { display: none !important; }
  #print-area .doc-print { display: block; padding: .7in; color: #000; font-size: 11pt; line-height: 1.45; }
  #print-area .doc-print mark.falta { background: none; border-bottom: 1px dashed #000; }
  #print-area .doc-print .legal-nota { background: none; border: 1px solid #999; }
  #print-area .doc-print h3 { break-after: avoid; }
}

/* Pantalla de bienvenida */
.bienv { display: flex; flex-direction: column; gap: .7rem; margin: 1rem 0; }
.bienv-op { display: flex; gap: .9rem; align-items: center; text-align: left; width: 100%; border: 1px solid var(--bd); border-radius: 12px; padding: .85rem 1rem; background: var(--card); color: var(--tx); font: inherit; cursor: pointer; min-height: 64px; }
.bienv-op:hover { border-color: var(--pri); background: var(--pri-l); }
.bienv-op:focus-visible, .bienv-op:focus-within { outline: 3px solid #7cc4bc; outline-offset: 2px; }
.bienv-op strong { display: block; }
.bienv-op small { display: block; color: var(--mut); }
.bienv-op img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; flex: none; }
.bienv-op.prep { border-color: var(--pri); border-width: 2px; }
.bienv-ico { width: 56px; height: 56px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; font-size: 1.5rem; flex: none; color: var(--pri-d); }
.volver-ini { margin: 0 0 .5rem; font-size: .9rem; }

/* ================= Vitaliax: portada, acceso y "Mis consultorios" ================= */
.vx { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.vx-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem clamp(1rem, 4vw, 3rem); background: var(--topbar); backdrop-filter: blur(8px); border-bottom: 1px solid var(--bd); }
.vx-home { text-decoration: none; color: var(--tx); border-radius: 10px; }
.vx-home:focus-visible { outline: 3px solid #7cc4bc; outline-offset: 3px; }
.vx-marca { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.35rem; letter-spacing: -.3px; }
.vx-ico { width: 38px; height: 38px; border-radius: 11px; background: var(--pri); color: #fff; display: grid; place-items: center; }
.vx-ico svg { width: 26px; height: 26px; }
.vx-acc { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.vx-user { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; }
.vx-main { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem); }
.vx-main:focus { outline: none; }
.vx-form-wrap { display: flex; justify-content: center; align-items: flex-start; padding-top: 2rem; padding-bottom: 3rem; }
.vx-form-wrap .auth-card { box-shadow: 0 10px 30px rgba(16,24,40,.08); }
.vx-form-wrap .auth-card h1 { text-align: center; }
.vx-form-wrap .auth-card > p.muted { text-align: center; }

.vx-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2rem, 5vw, 4rem); }
.vx-eyebrow { color: var(--pri-d); font-weight: 700; text-transform: uppercase; letter-spacing: .8px; font-size: .82rem; margin: 0 0 .6rem; }
.vx-hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.1; letter-spacing: -.8px; margin: 0 0 1rem; }
.vx-lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--tx-2); max-width: 38em; margin: 0 0 1.6rem; }
.vx-cta { display: flex; gap: .7rem; flex-wrap: wrap; }
.vx-mock { background: var(--card); border: 1px solid var(--bd); border-radius: 18px; box-shadow: 0 24px 60px rgba(15,118,110,.18); overflow: hidden; transform: rotate(-1.2deg); }
.vx-mock-h { display: flex; gap: .35rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.vx-mock-h span { width: 10px; height: 10px; border-radius: 50%; background: var(--bd); }
.vx-mock-b { display: grid; grid-template-columns: 70px 1fr; min-height: 250px; }
.vx-mock-side { background: var(--surface-2); padding: 1rem .7rem; display: flex; flex-direction: column; gap: .7rem; }
.vx-mock-side i { height: 10px; border-radius: 6px; background: var(--bd); }
.vx-mock-side i:first-child { background: var(--pri); opacity: .7; }
.vx-mock-main { padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.vx-mock-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .4rem; }
.vx-mock-cards b { font-size: .72rem; font-weight: 700; color: var(--pri-d); background: var(--pri-l); border-radius: 10px; padding: .9rem .5rem 1.4rem; }
.vx-mock-row { display: flex; gap: .6rem; align-items: center; padding: .55rem; border: 1px solid var(--line); border-radius: 10px; }
.vx-mock-row em { width: 26px; height: 26px; border-radius: 50%; background: var(--pri-l); flex: none; }
.vx-mock-row span { height: 9px; border-radius: 6px; background: var(--bd); flex: 1; max-width: 70%; }

.vx-sec { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.vx-sec h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); letter-spacing: -.4px; margin: 0 0 1.3rem; text-align: center; }
.vx-alt { position: relative; }
.vx-alt::before { content: ''; position: absolute; inset: 0 calc(50% - 50vw); background: var(--surface-2); z-index: -1; border-block: 1px solid var(--line); }
.vx-sub { text-align: center; color: var(--tx-2); max-width: 46em; margin: -.5rem auto 1.3rem; }
.vx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.vx-card { background: var(--card); border: 1px solid var(--bd); border-radius: 16px; padding: 1.3rem 1.3rem 1.1rem; }
.vx-card h3 { font-size: 1.08rem; margin: .7rem 0 .35rem; }
.vx-card p { margin: 0; color: var(--tx-2); }
.vx-card-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--pri-l); display: grid; place-items: center; font-size: 1.3rem; }
.vx-mejoras { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.vx-mejoras li { background: var(--card); border-radius: 14px; border-left: 4px solid var(--pri); padding: 1rem 1.1rem; box-shadow: var(--sh); }
.vx-mejoras strong { display: block; margin-bottom: .25rem; }
.vx-mejoras span { color: var(--tx-2); }
.vx-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.vx-chips li { border: 1px solid var(--bd); background: var(--card); border-radius: 999px; padding: .4rem .9rem; font-weight: 600; font-size: .92rem; }
.vx-pasos { list-style: none; counter-reset: p; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.vx-pasos li { counter-increment: p; background: var(--card); border: 1px solid var(--bd); border-radius: 16px; padding: 1.2rem; position: relative; }
.vx-pasos li::before { content: counter(p); width: 34px; height: 34px; border-radius: 50%; background: var(--pri); color: #fff; font-weight: 800; display: grid; place-items: center; margin-bottom: .6rem; }
.vx-pasos strong { display: block; }
.vx-pasos span { color: var(--tx-2); }
.vx-banda { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; background: linear-gradient(120deg, var(--pri), #115e59); color: #fff; border-radius: 20px; padding: clamp(1.4rem, 4vw, 2.4rem); }
.vx-banda h2 { text-align: left; margin: 0 0 .4rem; }
.vx-banda p { margin: 0; max-width: 40em; opacity: .92; }
.vx-banda .btn.primary { background: #fff; color: #0b5f58; border-color: #fff; }
.vx-priv { padding-top: 0; }
.vx-foot { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; justify-content: center; padding: 1.4rem 1rem; border-top: 1px solid var(--bd); font-size: .9rem; color: var(--mut); }

/* Mis consultorios */
.vx-cuenta { max-width: 720px; padding-top: 2.2rem; padding-bottom: 3rem; }
.vx-cuenta h1 { margin-bottom: .2rem; }
.mc-list { list-style: none; padding: 0; margin: 1.2rem 0 1rem; display: flex; flex-direction: column; gap: .7rem; }
.mc-card { width: 100%; display: flex; align-items: center; gap: 1rem; text-align: left; background: var(--card); border: 1px solid var(--bd); border-radius: 16px; padding: 1rem 1.1rem; font: inherit; color: var(--tx); cursor: pointer; box-shadow: var(--sh); }
.mc-card:hover { border-color: var(--pri); }
.mc-card:focus-visible, .mc-nuevo:focus-visible { outline: 3px solid #7cc4bc; outline-offset: 2px; }
.mc-logo { width: 60px; height: 60px; border-radius: 14px; object-fit: contain; flex: none; display: grid; place-items: center; }
span.mc-logo { background: var(--pri); color: #fff; font-weight: 800; font-size: 1.2rem; }
.mc-txt { flex: 1; min-width: 0; }
.mc-txt strong { display: block; font-size: 1.1rem; }
.mc-txt small { color: var(--mut); }
.mc-ir { color: var(--pri-d); font-weight: 700; white-space: nowrap; }
.mc-nuevo { width: 100%; display: flex; align-items: center; gap: 1rem; text-align: left; background: transparent; border: 2px dashed var(--input-bd); border-radius: 16px; padding: 1rem 1.1rem; font: inherit; color: var(--tx); cursor: pointer; }
.mc-nuevo:hover { border-color: var(--pri); background: var(--pri-l); }
.mc-nuevo > span:first-child { width: 60px; height: 60px; border-radius: 14px; background: var(--surface-3); display: grid; place-items: center; font-size: 1.6rem; color: var(--pri-d); flex: none; }
.mc-nuevo strong { display: block; }
.mc-nuevo small { color: var(--mut); }
.side-btns { display: flex; gap: .3rem; flex-wrap: wrap; }

@media (max-width: 820px) {
  .vx-hero { grid-template-columns: 1fr; }
  .vx-hero-vis { display: none; }
}
@media (max-width: 560px) {
  .vx-top { padding: .55rem .8rem; }
  .vx-marca { font-size: 1.15rem; }
  .vx-ico { width: 32px; height: 32px; }
  .vx-acc { gap: .25rem; }
  .vx-acc .btn.primary { display: none; }
  .vx-acc .btn { padding-inline: .6rem; }
  .vx-user > span:last-child { display: none; }
  .mc-ir { display: none; }
}

/* ---------- Clave de recuperación ---------- */
.rk-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: clamp(1.05rem, 4.2vw, 1.45rem); font-weight: 700; letter-spacing: .08em; text-align: center; padding: 1rem .75rem; margin: 1rem 0 .75rem; border: 2px dashed var(--pri); border-radius: 12px; background: var(--pri-l); user-select: all; }
.rk-g { display: inline-block; white-space: nowrap; }
.rk-btns { justify-content: center; margin-bottom: .75rem; }
.rk-tips { margin: 0 0 1rem; padding-left: 1.2rem; display: grid; gap: .4rem; font-size: .95rem; }
.rk-ok { margin: .5rem 0 1rem; font-weight: 600; }
.rk-aviso { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.rk-aviso p { margin: 0; flex: 1 1 18rem; }

/* ---------- Nube ---------- */
.nube-estado { display: flex; align-items: center; gap: .4rem; width: 100%; margin-bottom: .5rem; padding: .35rem .6rem; border: 1px solid var(--bd); border-radius: 999px; background: var(--card); color: var(--mut); font: inherit; font-size: .8rem; cursor: pointer; text-align: left; }
.nube-estado span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nube-estado[data-fase="lista"] { color: var(--ok); border-color: var(--ok); }
.nube-estado[data-fase="pend"], .nube-estado[data-fase="sincronizando"] { color: var(--info); }
.nube-estado[data-fase="sinred"] { color: var(--warn); border-color: var(--warn); }
.nube-estado[data-fase="error"] { color: var(--dan-fg); border-color: var(--dan); }
.nube-cuenta { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .9rem; margin-bottom: 1rem; border: 1px solid var(--bd); border-radius: var(--r); background: var(--card); color: var(--tx-2); }
.nube-ico { font-size: 1.2rem; line-height: 1.2; color: var(--pri); }

/* ---------- Importar desde Google Keep ---------- */
.imp-pasos { padding-left: 1.2rem; display: grid; gap: .45rem; margin: 0 0 1rem; }
.imp-lista { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .5rem; }
.imp-fila { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem .9rem; border: 1px solid var(--bd); border-radius: var(--r); background: var(--card); }
.imp-fila.con-aviso { border-left: 4px solid var(--warn); }
.imp-sel { margin-top: .15rem; }
.imp-orto { align-self: center; }
.imp-main { flex: 1; min-width: 0; }
.imp-main > small { display: block; color: var(--mut); margin: .15rem 0 .35rem; }
.imp-avisos { margin: .25rem 0 .4rem; padding-left: 1.1rem; color: var(--warn-tx); font-size: .88rem; }
.imp-det { margin-top: .5rem; padding: .6rem .8rem; border-radius: 8px; background: var(--surface-2); }
.imp-det h4 { margin: .6rem 0 .3rem; font-size: .95rem; }
.imp-det h4:first-child { margin-top: 0; }
.imp-dl { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: .2rem .8rem; margin: 0; font-size: .92rem; }
.imp-dl dt { color: var(--mut); }
.imp-dl dd { margin: 0; overflow-wrap: anywhere; }
.imp-progreso { max-width: 40rem; margin: 2rem auto; }
.imp-barra { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: .8rem 0; }
.imp-barra span { display: block; height: 100%; width: 0; background: var(--pri); transition: width .2s; }
.badge.warn { background: var(--warn-l); color: var(--warn-tx); }
@media (max-width: 560px) { .imp-dl { grid-template-columns: 1fr; } .imp-dl dt { margin-top: .3rem; } }
.gcal-aviso { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.tr-pac { max-width: 420px; margin: .35rem 0 0; }
.appt.con-tipo, .mchip.con-tipo { border-left-color: var(--tipo); background: color-mix(in srgb, var(--tipo) 13%, var(--card)); }
.appt.con-tipo:hover { background: color-mix(in srgb, var(--tipo) 20%, var(--card)); }
.tag-nuevo { display: inline-block; font-size: .7rem; font-weight: 700; padding: 0 .35rem; border-radius: 6px; background: var(--tipo); color: #fff; vertical-align: 1px; margin-left: .25rem; }
.ley-tipo { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 600; }
.ley-tipo::before { content: ''; width: .9rem; height: .9rem; border-radius: 3px; background: var(--tipo); }

/* ---------- Panel de Vitaliax (panel.html) ---------- */
.pn { max-width: 1200px; margin: 0 auto; padding: 1rem; }
.pn-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.pn-top h1 { margin: 0; font-size: 1.4rem; }
.pn-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pn-card h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.pn-emb { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .5rem; }
.pn-emb li { display: grid; grid-template-columns: 11rem 1fr 2.5rem; align-items: center; gap: .6rem; }
.pn-bar { background: var(--line); border-radius: 999px; height: .7rem; overflow: hidden; }
.pn-bar span { display: block; height: 100%; background: var(--pri); border-radius: 999px; }
.pn-emb strong { text-align: right; }
.pn-lista { list-style: none; padding: 0; margin: 0; }
.pn-lista li { display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.pn-bus input { width: 100%; max-width: 28rem; margin-bottom: .6rem; }
.pn-inc { margin-bottom: .6rem; }
.pn-t .num { text-align: right; }
.pn-pie { margin-top: 1.5rem; }
@media (max-width: 760px) { .pn-2 { grid-template-columns: 1fr; } .pn-emb li { grid-template-columns: 8rem 1fr 2rem; } }

/* ---------- Ingresos: lo que se le dio en la consulta ---------- */
.cg { display: grid; gap: .5rem; }
.cg-add { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.cg-sel { flex: 1 1 16rem; min-width: 0; }
.cg-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.cg-lista:empty { display: none; }
.cg-lista li { display: grid; grid-template-columns: 1fr 4.5rem 6.5rem 6rem 2.4rem; gap: .5rem; align-items: center; padding: .5rem .6rem; border: 1px solid var(--bd); border-radius: var(--r); background: var(--surface-2); }
.cg-nom small { display: block; color: var(--mut); font-size: .78rem; }
input.cg-nom { width: 100%; }
.cg-c, .cg-p { display: flex; flex-direction: column; font-size: .75rem; color: var(--mut); }
.cg-c input, .cg-p input { width: 100%; }
.cg-imp { text-align: right; }
.cg-total { margin: 0; text-align: right; font-size: 1.05rem; }
input[readonly][name=cobroMonto] { background: var(--surface-2); font-weight: 700; }
@media (max-width: 600px) {
  .cg-lista li { grid-template-columns: 1fr 1fr 2.4rem; }
  .cg-nom { grid-column: 1 / 3; }
  .cg-x { grid-row: 1; grid-column: 3; }
  .cg-imp { grid-column: 1 / 4; }
}
/* ---------- Ingresos: pantalla ---------- */
.ing-per { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.ing-per .seg { display: flex; gap: .3rem; flex-wrap: wrap; }
.ing-nav { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ing-rango { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; }
.ing-rango label { display: flex; flex-direction: column; font-size: .85rem; color: var(--mut); }
.ing-stats { grid-template-columns: repeat(5, 1fr); margin-bottom: 0; }
.stat.ok .stat-n { color: var(--ok); }
.ing-lista { list-style: none; padding: 0; margin: 0; }
.ing-lista li { display: flex; justify-content: space-between; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.ing-dias { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; font-size: .88rem; }
.ing-dias li { display: grid; grid-template-columns: 5.5rem 1fr 5.5rem; gap: .5rem; align-items: center; }
.ing-dias li.cero { color: var(--mut); }
.ing-dias strong { text-align: right; }
.ing-bar { background: var(--line); border-radius: 999px; height: .55rem; overflow: hidden; }
.ing-bar span { display: block; height: 100%; background: var(--pri); border-radius: 999px; }
.ing-movs li { display: flex; align-items: center; gap: .5rem; }
.ing-movs .row-btn { flex: 1; }
.ing-monto { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; }
.table .num { text-align: right; }
.table tfoot td { font-weight: 700; color: var(--tx-2); }
.cat-form { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .6rem; align-items: end; }
.cat-btn { padding-bottom: .2rem; }
.cat-lista li { display: flex; align-items: center; gap: .6rem; }
.cat-precio { min-width: 5rem; text-align: right; }
.cat-off { opacity: .6; }
@media (max-width: 760px) { .ing-stats { grid-template-columns: repeat(2, 1fr); } .cat-form { grid-template-columns: 1fr 1fr; } .cat-form .field:first-child { grid-column: 1 / 3; } }

/* Enlace discreto al panel de Vitaliax en el pie de la portada */
.vx-foot a.vx-dev { color: var(--mut); text-decoration: none; font-size: .8rem; opacity: .7; }
.vx-foot a.vx-dev:hover, .vx-foot a.vx-dev:focus-visible { opacity: 1; text-decoration: underline; }
