/* ══════════════════════════════════════════════════════════════════════════
   Dentalia Extremadura · sistema de diseño (glassmorphism blanco + rosa)
   Tokens → base → cristal → componentes (botones, formularios, tablas, etiquetas)
   ══════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/fraunces-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/fraunces-latin-wght-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2");
}

:root {
  /* Rosa de marca */
  --rose-25: #fffafc;
  --rose-50: #fff5f8;
  --rose-100: #ffe6ee;
  --rose-200: #ffcfdf;
  --rose-300: #ffabc7;
  --rose-400: #f77ba5;
  --rose-500: #e5518a;
  --rose-600: #d0336e;
  --rose-700: #b3265e;
  --rose-800: #8c1d4a;
  /* Tinta (nunca negro puro: ciruela muy oscura) */
  --ink: #3b1e2c;
  --ink-soft: #6a4757;
  --muted: #86616f;
  --line: rgba(208, 51, 110, .14);
  --line-strong: rgba(208, 51, 110, .28);

  /* Estados */
  --ok: #17663a;        --ok-bg: #e0f5e8;
  --warn: #8a4b06;      --warn-bg: #fff0d6;
  --info: #0e5675;      --info-bg: #dff1f8;
  --danger: #a5183f;    --danger-bg: #fde2e9;
  --neutral: #6a4757;   --neutral-bg: #f4e7ed;

  /* Cristal */
  --glass-bg: linear-gradient(145deg, rgba(255,255,255,.74), rgba(255,255,255,.46));
  --glass-bg-strong: linear-gradient(145deg, rgba(255,255,255,.88), rgba(255,255,255,.66));
  --glass-border: rgba(255,255,255,.78);
  --glass-blur: blur(20px) saturate(1.5);
  --shadow-sm: 0 1px 2px rgba(120, 30, 70, .06), 0 4px 14px -4px rgba(190, 40, 100, .12);
  --shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 20px 50px -18px rgba(190, 40, 100, .28);
  --shadow-lg: 0 1px 0 rgba(255,255,255,.95) inset, 0 34px 80px -24px rgba(190, 40, 100, .38);

  --r-sm: 10px; --r: 16px; --r-lg: 24px; --r-xl: 34px;

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-ui: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease: cubic-bezier(.22, .8, .24, 1);
  --focus: 0 0 0 3px rgba(208, 51, 110, .32);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font: 500 16px/1.62 var(--font-ui);
  background: var(--rose-50);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* Fondo: masas de color desenfocadas, fijas, detrás de todo */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60vmax 44vmax at 8% -6%, #ffd2e2 0%, transparent 62%),
    radial-gradient(52vmax 42vmax at 100% 8%, #ffe4ee 0%, transparent 60%),
    radial-gradient(60vmax 48vmax at 88% 104%, #ffbdd3 0%, transparent 60%),
    radial-gradient(44vmax 36vmax at -4% 92%, #ffe0eb 0%, transparent 60%),
    linear-gradient(180deg, #fff9fb, #fff3f7);
}
img, svg { max-width: 100%; }
img { display: block; }
a { color: var(--rose-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--rose-800); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
::selection { background: var(--rose-200); color: var(--ink); }
h1, h2, h3, h4 { margin: 0 0 .5em; font-family: var(--font-display); font-weight: 560; letter-spacing: -.015em; line-height: 1.12; color: var(--ink); }
h1 { font-size: clamp(2.3rem, 5.4vw, 4.2rem); letter-spacing: -.025em; line-height: 1.04; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .86rem; }
.muted { color: var(--muted); }
.ink-soft { color: var(--ink-soft); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--rose-700); color: #fff; padding: 10px 16px; border-radius: 12px; transition: top .2s; }
.skip-link:focus { top: 12px; color: #fff; }
[hidden] { display: none !important; }

/* Iconos (sprite SVG) */
.i { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.2em; }
.i-lg { width: 1.6em; height: 1.6em; }
.i-xl { width: 2.2em; height: 2.2em; }

/* ── Cristal ────────────────────────────────────────────────────────────── */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.glass-strong { background: var(--glass-bg-strong); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(255,255,255,.93); }
}
.card { padding: clamp(18px, 2.4vw, 28px); }
.card > :last-child { margin-bottom: 0; }
.card-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 1rem; font: 700 1.05rem/1.3 var(--font-ui); letter-spacing: 0; }
.card-title .i { color: var(--rose-600); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 1rem; }
.card-head .card-title { margin: 0; }

/* ── Botones ────────────────────────────────────────────────────────────── */
.btn {
  --_bg: rgba(255,255,255,.7); --_fg: var(--rose-700); --_bd: var(--line-strong);
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 46px; padding: .7rem 1.35rem; border-radius: 999px;
  font: 700 .95rem/1 var(--font-ui); text-decoration: none; cursor: pointer; white-space: nowrap;
  color: var(--_fg); background: var(--_bg); border: 1px solid var(--_bd);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s, color .25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -12px rgba(190,40,100,.5); color: var(--_fg); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn-primary {
  --_fg: #fff; --_bd: transparent;
  background: linear-gradient(135deg, #d93b78 0%, #c22e69 55%, #a92258 100%);
  box-shadow: 0 10px 24px -10px rgba(179, 38, 94, .7), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-primary:hover { background: linear-gradient(135deg, #e04481 0%, #c93170 55%, #b3265e 100%); color: #fff; }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.34) 50%, transparent 70%);
  transition: transform .7s var(--ease);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-ghost { --_bg: transparent; --_bd: transparent; --_fg: var(--ink-soft); backdrop-filter: none; -webkit-backdrop-filter: none; }
.btn-ghost:hover { background: rgba(255,255,255,.7); box-shadow: none; transform: none; }
.btn-danger { --_fg: var(--danger); --_bd: rgba(165,24,63,.3); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-ok { --_fg: var(--ok); --_bd: rgba(23,102,58,.3); }
.btn-ok:hover { background: var(--ok); color: #fff; }
.btn-sm { min-height: 36px; padding: .45rem .95rem; font-size: .85rem; }
.btn-lg { min-height: 54px; padding: .9rem 1.8rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; border-radius: 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.btn-row.end { justify-content: flex-end; }
form.inline { display: inline; }

/* ── Formularios ────────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.2rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.field > label, .field > .label { font: 700 .86rem/1.3 var(--font-ui); color: var(--ink-soft); }
.field .req { color: var(--rose-600); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]), .field select, .field textarea, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: .7rem .95rem;
  font: 500 .98rem/1.4 var(--font-ui); color: var(--ink);
  background: rgba(255,255,255,.82); border: 1px solid var(--line-strong); border-radius: 14px;
  transition: border-color .2s, box-shadow .2s, background .2s;
  appearance: none; -webkit-appearance: none;
}
.field select, select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b3265e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 2.6rem;
}
.field textarea, textarea.input { min-height: 110px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #b39aa6; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--rose-400); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--rose-600); box-shadow: var(--focus); background: #fff; }
.field input[readonly] { background: rgba(255,240,245,.7); color: var(--muted); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); background: #fff8fa; }
.field-error { color: var(--danger); font-size: .84rem; font-weight: 600; display: flex; gap: .35rem; align-items: center; }
.field-help { color: var(--muted); font-size: .82rem; line-height: 1.4; }

/* Selectores con estilo propio: el <select> real sigue ahí (formulario, teclado, autocompletar); solo cambia la lista al abrirla */
.select-host { position: relative; }
.select-host select[aria-expanded="true"] { border-color: var(--rose-600); box-shadow: var(--focus); background: #fff; }
.select-host select[aria-expanded="true"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b3265e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 15l-6-6-6 6'/%3E%3C/svg%3E"); }
.select-list {
  position: absolute; z-index: 60; top: calc(100% + 8px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  max-height: 280px; overflow-y: auto; background: #fff; border: 1px solid var(--line-strong); border-radius: 16px;
  box-shadow: 0 26px 46px -20px rgba(179, 38, 94, .38), 0 6px 14px -6px rgba(179, 38, 94, .18);
  animation: select-pop .16s var(--ease) both;
}
.select-list.above { top: auto; bottom: calc(100% + 8px); }
.select-list li { padding: .62rem .85rem; margin: 1px 0; border-radius: 11px; font: 600 .94rem/1.35 var(--font-ui); color: var(--ink); cursor: pointer; scroll-margin: 6px; }
.select-list li.is-active, .select-list li:hover:not(.is-disabled) { background: var(--rose-100); color: var(--rose-700); }
.select-list li.is-sel { font-weight: 800; color: var(--rose-700); }
.select-list li.is-sel::after { content: "\2713"; float: right; margin-left: .6rem; }
.select-list li.is-disabled { opacity: .5; cursor: not-allowed; }
@keyframes select-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.app .select-list { background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(18px) saturate(1.7); backdrop-filter: blur(18px) saturate(1.7); border-color: rgba(214, 100, 150, .35); }
@media (max-width: 640px) { .select-list li { padding: .78rem .9rem; } }
input[type=color] { width: 56px; height: 46px; padding: 4px; border-radius: 14px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; }
input[type=file] { font: 500 .9rem var(--font-ui); color: var(--ink-soft); }
input[type=file]::file-selector-button {
  margin-right: 12px; padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.85); color: var(--rose-700); font: 700 .85rem var(--font-ui); cursor: pointer; transition: background .2s;
}
input[type=file]::file-selector-button:hover { background: var(--rose-100); }
.check { display: flex; gap: .7rem; align-items: flex-start; cursor: pointer; font-weight: 600; color: var(--ink-soft); font-size: .95rem; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box {
  flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px; border: 1.5px solid var(--rose-400);
  background: rgba(255,255,255,.9); display: grid; place-items: center; transition: all .2s var(--ease);
}
.check .box::after { content: ""; width: 10px; height: 6px; border-left: 2.4px solid #fff; border-bottom: 2.4px solid #fff; transform: rotate(-45deg) scale(0); margin-top: -2px; transition: transform .2s var(--ease); }
.check input:checked + .box { background: linear-gradient(135deg, #d93b78, #b3265e); border-color: transparent; }
.check input:checked + .box::after { transform: rotate(-45deg) scale(1); }
.check input:focus-visible + .box { box-shadow: var(--focus); }
.check .txt { line-height: 1.4; }
.check .txt small { display: block; color: var(--muted); font-weight: 500; margin-top: 2px; }
/* Interruptor (preferencias de avisos) */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 48px; height: 28px; border-radius: 999px; background: #e9d6de; transition: background .25s; position: relative; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .3s var(--ease); }
.switch input:checked + .track { background: linear-gradient(135deg, #e5518a, #b3265e); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }   /* honeypot */
.img-field { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.img-field .thumb { width: 92px; height: 92px; border-radius: 16px; object-fit: cover; border: 1px solid var(--line-strong); background: var(--rose-100); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 3rem; }
.pw-wrap .pw-toggle { position: absolute !important; right: 6px; top: 50% !important; transform: translateY(-50%) !important; z-index: 2; }
.pw-wrap .pw-toggle:active { transform: translateY(-50%) scale(.92) !important; }

/* ── Etiquetas de estado ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .7rem; border-radius: 999px;
  font: 700 .76rem/1.4 var(--font-ui); background: var(--neutral-bg); color: var(--neutral); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.st-pending, .st-new, .st-planned, .st-sending { background: var(--warn-bg); color: var(--warn); }
.st-confirmed, .st-sent, .st-in_progress, .st-contacted { background: var(--info-bg); color: var(--info); }
.st-completed, .st-delivered, .st-read, .st-converted, .st-active { background: var(--ok-bg); color: var(--ok); }
.st-cancelled, .st-discarded, .st-skipped, .st-inactive { background: var(--neutral-bg); color: var(--neutral); }
.st-no_show, .st-failed { background: var(--danger-bg); color: var(--danger); }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .8rem; border-radius: 999px; font: 700 .8rem var(--font-ui); background: rgba(255,255,255,.75); border: 1px solid var(--line); color: var(--ink-soft); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--dot, var(--rose-600)); vertical-align: middle; }

/* ── Avisos flash ──────────────────────────────────────────────────────── */
.flash-stack { position: fixed; z-index: 300; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 10px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.flash { pointer-events: auto; display: flex; gap: .7rem; align-items: flex-start; padding: .9rem 1rem; border-radius: 18px; font-weight: 600; font-size: .94rem; line-height: 1.4; animation: flash-in .5s var(--ease) both; }
.flash .i { margin-top: 2px; }
.flash.success { color: var(--ok); } .flash.error { color: var(--danger); } .flash.info, .flash.message { color: var(--info); } .flash.warning { color: var(--warn); }
.flash .flash-x { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; padding: 2px; opacity: .7; }
.flash .flash-x:hover { opacity: 1; }
.flash.out { animation: flash-out .35s var(--ease) forwards; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-12px) scale(.96); } }
@keyframes flash-out { to { opacity: 0; transform: translateX(24px); } }

/* ── Tablas ────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--r); -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; padding: .8rem 1rem; font: 700 .78rem/1.2 var(--font-ui); color: var(--muted); border-bottom: 1px solid var(--line-strong); white-space: nowrap; letter-spacing: .01em; }
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: rgba(255,255,255,.65); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { text-align: right; white-space: nowrap; }
.table .cell-main { font-weight: 700; color: var(--ink); text-decoration: none; }
.table a.cell-main:hover { color: var(--rose-700); text-decoration: underline; }
.table .cell-sub { display: block; font-size: .82rem; color: var(--muted); font-weight: 500; }
.table img.thumb-sm { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }

/* ── Vacíos, paginación, avatares ──────────────────────────────────────── */
.empty { text-align: center; padding: 2.4rem 1rem; color: var(--muted); }
.empty .i { width: 2.4rem; height: 2.4rem; color: var(--rose-300); margin-bottom: .6rem; }
.empty p { max-width: 42ch; margin: 0 auto .8rem; }
.pager { display: flex; justify-content: center; align-items: center; gap: .5rem; margin-top: 1.2rem; flex-wrap: wrap; }
.avatar { --sz: 40px; width: var(--sz); height: var(--sz); border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font: 700 calc(var(--sz) * .36)/1 var(--font-ui); color: #fff; background: linear-gradient(135deg, #f77ba5, #b3265e); object-fit: cover; box-shadow: 0 6px 14px -6px rgba(179,38,94,.6); }
.avatar-lg { --sz: 72px; }
.avatar-xl { --sz: 104px; }

/* ── Utilidades ────────────────────────────────────────────────────────── */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.6rem; }
.row { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; }
.hr { height: 1px; background: var(--line); border: 0; margin: 1.2rem 0; }
.kbd { font: 600 .8rem ui-monospace, monospace; padding: .1rem .4rem; border-radius: 6px; background: var(--rose-100); }
.text-right { text-align: right; }
.prose h3 { font-size: 1.35rem; margin-top: 1.6em; } .prose h4 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; } .prose li { margin-bottom: .35em; }

/* Aparición al hacer scroll (solo si hay JS) */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media print {
  body::before { display: none; }
  .glass { box-shadow: none; background: #fff; backdrop-filter: none; border-color: #ddd; }
  .no-print { display: none !important; }
}

/* ── Marca (compartida por web, panel y portal) ── */
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand img { width: 40px; height: 40px; filter: drop-shadow(0 6px 10px rgba(179, 38, 94, .25)); transition: transform .5s var(--ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font: 600 1.42rem/1 var(--font-display); letter-spacing: -.02em; }
.brand-sub { font: 700 .6rem/1 var(--font-ui); letter-spacing: .26em; color: var(--rose-600); margin-top: 5px; }

.badge.st-info { background: #e6f1fb; color: #1d5a94; }

/* Botones con texto largo: en móvil pueden partirse en varias líneas en vez de desbordar */
.btn { max-width: 100%; }
@media (max-width: 560px) { .btn { white-space: normal; text-align: center; line-height: 1.2; } }

/* ── Iconos de Font Awesome (<i class="i fa-…">): mismas cajas que los SVG, glifo ajustado por font-size ── */
i.i { display: inline-flex; align-items: center; justify-content: center; font-style: normal; line-height: 1; text-align: center; }
.empty i.i { font-size: 2rem; }
/* ══════════════ Web pública · landing ══════════════ */
:root { --gutter: clamp(18px, 4vw, 40px); --maxw: 1200px; }
.container { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }

/* Masas de color animadas detrás de la portada */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-orbs i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 26s ease-in-out infinite alternate; }
.bg-orbs i:nth-child(1) { width: 46vmax; height: 46vmax; left: -14vmax; top: 4vh; background: radial-gradient(circle, #ffb3cf, transparent 68%); }
.bg-orbs i:nth-child(2) { width: 38vmax; height: 38vmax; right: -12vmax; top: 30vh; background: radial-gradient(circle, #ff9cc0, transparent 68%); animation-duration: 32s; animation-delay: -8s; }
.bg-orbs i:nth-child(3) { width: 34vmax; height: 34vmax; left: 30vw; bottom: -18vmax; background: radial-gradient(circle, #ffd0e1, transparent 68%); animation-duration: 38s; animation-delay: -14s; }
@keyframes drift { to { transform: translate3d(6vmax, -4vmax, 0) scale(1.12); } }

/* Aviso superior */
.announce { text-align: center; padding: .55rem var(--gutter); font-size: .9rem; font-weight: 600; background: linear-gradient(90deg, rgba(255,230,238,.9), rgba(255,255,255,.9), rgba(255,230,238,.9)); border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.announce.important { background: linear-gradient(90deg, #b3265e, #d0336e); color: #fff; border: 0; }
.announce strong { margin-right: .4rem; }

/* Navegación flotante */
.site-nav { position: sticky; top: 12px; z-index: 100; margin-top: 12px; }
.nav-pill { display: flex; align-items: center; gap: 1rem; padding: 10px 12px 10px 20px; border-radius: 999px; }
.nav-links { display: flex; gap: .15rem; margin: 0 auto; padding: 0; list-style: none; }
.nav-links a { display: block; padding: .5rem .85rem; border-radius: 999px; font: 700 .9rem var(--font-ui); color: var(--ink-soft); text-decoration: none; transition: background .2s, color .2s; }
.nav-links a:hover, .nav-links a.active { background: rgba(255, 255, 255, .8); color: var(--rose-700); }
.nav-actions { display: flex; align-items: center; gap: .5rem; }
.nav-toggle { display: none; }
@media (max-width: 1040px) {
  .nav-links { position: absolute; left: 0; right: 0; top: calc(100% + 10px); flex-direction: column; padding: 12px; gap: 2px; margin: 0;
    background: var(--glass-bg-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border); border-radius: 24px; box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98); transition: all .3s var(--ease); }
  .nav-links a { padding: .8rem 1rem; }
  .site-nav.open .nav-links { opacity: 1; visibility: visible; transform: none; }
  .nav-toggle { display: inline-flex; }
  .nav-actions .btn-portal .lbl { display: none; }
  .nav-pill { margin-left: 0; }
  .nav-actions { margin-left: auto; }
}
@media (max-width: 480px) { .nav-actions .btn-cta { display: none; } .brand-sub { letter-spacing: .18em; } }

/* Secciones */
.section { padding-block: clamp(56px, 8vw, 112px); position: relative; scroll-margin-top: 90px; }
.section-head { max-width: 660px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head::before { content: ""; display: block; width: 46px; height: 5px; border-radius: 9px; background: linear-gradient(90deg, #ee5a94, #b3265e); margin-bottom: 1.1rem; }
.section-head .lead { color: var(--ink-soft); font-size: 1.08rem; margin: 0; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center::before { margin-inline: auto; }

/* Portada */
.hero { padding-top: clamp(28px, 5vw, 64px); padding-bottom: clamp(48px, 7vw, 96px); }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero h1 { margin-bottom: .45em; }
.hero h1 em { font-style: italic; color: var(--rose-600); }
.hero .lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-soft); max-width: 52ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.8rem 0 2rem; }
.hero-facts { display: flex; flex-wrap: wrap; gap: .7rem; }
.fact { display: inline-flex; align-items: center; gap: .6rem; padding: .6rem 1rem .6rem .7rem; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--ink-soft); text-decoration: none; }
.fact .i { width: 32px; height: 32px; padding: 7px; border-radius: 50%; background: linear-gradient(135deg, #ffd0e0, #ffb0cb); color: var(--rose-700); }
a.fact:hover { color: var(--rose-700); transform: translateY(-2px); }
.fact { transition: transform .25s var(--ease), color .2s; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { order: -1; max-width: 420px; margin-inline: auto; width: 100%; } }

.stage { position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 540px; margin-left: auto; display: grid; place-items: center; }
.stage .ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.9);
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.75), rgba(255,255,255,.12) 62%);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 30px 70px -30px rgba(190,40,100,.55), inset 0 0 40px rgba(255,255,255,.5); }
.stage .ring.r1 { inset: 4%; animation: breathe 9s ease-in-out infinite; }
.stage .ring.r2 { inset: 17%; background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.9), rgba(255,214,228,.35) 70%); animation: breathe 9s ease-in-out -3s infinite; }
.stage .ring.r3 { inset: 30%; background: radial-gradient(circle at 30% 25%, #fff, rgba(255,205,224,.55) 75%); animation: breathe 9s ease-in-out -6s infinite; }
.stage .tooth { position: relative; width: 38%; filter: drop-shadow(0 26px 34px rgba(179,38,94,.4)); animation: bob 7s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.035); } }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-1.5deg); } }
.float-chip { position: absolute; display: inline-flex; align-items: center; gap: .55rem; padding: .65rem 1rem .65rem .7rem; border-radius: 18px; font-weight: 700; font-size: .85rem; color: var(--ink); animation: bob 8s ease-in-out infinite; }
.float-chip .i { width: 30px; height: 30px; padding: 6px; border-radius: 10px; background: linear-gradient(135deg, #f77ba5, #c22e69); color: #fff; }
.float-chip.c1 { left: -4%; top: 14%; animation-delay: -1s; }
.float-chip.c2 { right: -6%; top: 46%; animation-delay: -3.5s; }
.float-chip.c3 { left: 6%; bottom: 8%; animation-delay: -5.5s; }
@media (max-width: 520px) { .float-chip { font-size: .76rem; padding: .5rem .8rem .5rem .55rem; } .float-chip.c1 { left: -2%; } .float-chip.c2 { right: -2%; } }
.hero-photo { position: relative; width: 100%; max-width: 560px; margin-left: auto; padding: 12px; border-radius: var(--r-xl); }
.hero-photo img { width: 100%; aspect-ratio: 4 / 4.4; object-fit: cover; border-radius: calc(var(--r-xl) - 10px); }
.hero-photo .float-chip { animation-duration: 9s; }

/* Clínica */
.clinic-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.clinic-grid.no-image { grid-template-columns: minmax(0, 820px); }
.clinic-card { padding: clamp(24px, 3.4vw, 44px); }
.clinic-card .prose { font-size: 1.06rem; color: var(--ink-soft); }
.clinic-photo { padding: 10px; border-radius: var(--r-xl); }
.clinic-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: calc(var(--r-xl) - 8px); }
@media (max-width: 860px) { .clinic-grid { grid-template-columns: 1fr; } }

/* Tratamientos */
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 1.3rem; }
.t-card { display: flex; flex-direction: column; overflow: hidden; transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.t-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.t-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, #ffe0ec, #ffc0d6); display: grid; place-items: center; color: rgba(255,255,255,.95); }
.t-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.t-card:hover .t-media img { transform: scale(1.06); }
.t-media .i { width: 64px; height: 64px; stroke-width: 1.5; filter: drop-shadow(0 8px 14px rgba(179,38,94,.35)); }
.t-body { display: flex; flex-direction: column; gap: .6rem; padding: 1.3rem 1.4rem 1.5rem; flex: 1; }
.t-body h3 { margin: 0; font-size: 1.32rem; }
.t-body p { margin: 0; color: var(--ink-soft); font-size: .96rem; }
.t-meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; padding-top: .4rem; }
.t-link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; font-size: .9rem; text-decoration: none; margin-top: .6rem; }
.t-link .i { transition: transform .25s var(--ease); }
.t-link:hover .i { transform: translateX(4px); }
.t-detail summary { cursor: pointer; font-weight: 700; font-size: .88rem; color: var(--rose-700); list-style: none; }
.t-detail summary::-webkit-details-marker { display: none; }
.t-detail[open] summary { margin-bottom: .5rem; }
.t-detail .prose { font-size: .93rem; color: var(--ink-soft); }

/* Servicios */
.s-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 1.2rem; }
.s-card { padding: 1.7rem 1.5rem; transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.s-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.s-icon { width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 1.1rem; color: #fff;
  background: linear-gradient(140deg, #f77ba5, #c22e69); box-shadow: 0 14px 24px -12px rgba(179,38,94,.7), inset 0 1px 0 rgba(255,255,255,.5); }
.s-icon .i { width: 28px; height: 28px; }
.s-card h3 { font-size: 1.22rem; margin-bottom: .4rem; }
.s-card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* Equipo */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 1.2rem; }
.m-card { text-align: center; padding: 1.8rem 1.2rem; }
.m-card .avatar { margin: 0 auto 1rem; --sz: 92px; }
.m-card h3 { font-size: 1.15rem; margin-bottom: .2rem; }
.m-card p { margin: 0; font-size: .9rem; color: var(--muted); }

/* Instalaciones */
.gallery { columns: 3 260px; column-gap: 1.1rem; }
.g-btn { all: unset; display: block; width: 100%; cursor: zoom-in; border-radius: calc(var(--r-lg) - 6px); }
.g-btn:focus-visible { box-shadow: var(--focus); }
.g-item { break-inside: avoid; margin: 0 0 1.1rem; padding: 8px; border-radius: var(--r-lg); cursor: zoom-in; display: block; width: 100%; border: 1px solid var(--glass-border); text-align: left; font: inherit; color: inherit; transition: transform .4s var(--ease), box-shadow .4s; }
.g-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.g-item img { width: 100%; border-radius: calc(var(--r-lg) - 6px); }
.g-item figcaption { padding: .7rem .5rem .3rem; font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: min(94vw, 1100px); max-height: 92vh; overflow: visible; }
dialog.lightbox::backdrop { background: rgba(60, 20, 40, .6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
dialog.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 22px; box-shadow: 0 40px 100px rgba(0,0,0,.4); margin-inline: auto; }
dialog.lightbox p { text-align: center; color: #fff; font-weight: 600; margin: 1rem 0 0; }
dialog.lightbox .lb-close { position: absolute; top: -14px; right: -14px; }

/* Empty state de sección */
.soft-empty { display: flex; gap: 1rem; align-items: center; padding: 1.6rem 1.8rem; color: var(--ink-soft); }
.soft-empty .i { width: 40px; height: 40px; color: var(--rose-400); }

/* Contacto */
.contact-info { max-width: 620px; margin: 0 auto; display: grid; gap: 1.4rem; }
.contact-cta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.contact-cta > div { flex: 1; min-width: 200px; }
.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.info-list li { display: flex; gap: .9rem; align-items: flex-start; }
.info-list .i { width: 42px; height: 42px; padding: 10px; border-radius: 14px; background: linear-gradient(135deg, #ffd6e4, #ffbcd2); color: var(--rose-700); }
.info-list b { display: block; font-size: .8rem; color: var(--muted); font-weight: 700; margin-bottom: 1px; }
.info-list a { font-weight: 700; }
.hours { width: 100%; border-collapse: collapse; font-size: .93rem; }
.hours td { padding: .38rem 0; border-bottom: 1px dashed var(--line); }
.hours td:last-child { text-align: right; font-weight: 700; }
.hours tr:last-child td { border: 0; }
.hours tr.today td { color: var(--rose-700); font-weight: 800; }
.social { display: flex; gap: .5rem; margin-top: 1.2rem; }

/* Ubicación */
.map-frame { padding: 10px; border-radius: var(--r-xl); overflow: hidden; }
.map-frame iframe { width: 100%; height: clamp(320px, 46vw, 460px); border: 0; border-radius: calc(var(--r-xl) - 8px); display: block; filter: saturate(.9) hue-rotate(-6deg); }
.location-grid { display: grid; grid-template-columns: 340px 1fr; gap: clamp(18px, 3vw, 32px); align-items: stretch; }
.location-grid.no-map { grid-template-columns: minmax(0, 520px); }
.addr-card { display: flex; flex-direction: column; gap: 1rem; justify-content: center; }
.addr-card address { font-style: normal; font: 600 1.4rem/1.35 var(--font-display); }
@media (max-width: 900px) { .location-grid { grid-template-columns: 1fr; } }

/* Solicitud de cita */
.appt-wrap { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
@media (max-width: 900px) { .appt-wrap { grid-template-columns: 1fr; } }
.steps { list-style: none; margin: 1.6rem 0 0; padding: 0; counter-reset: st; display: grid; gap: 1.1rem; }
.steps li { counter-increment: st; display: flex; gap: .9rem; align-items: flex-start; font-weight: 600; color: var(--ink-soft); }
.steps li::before { content: counter(st); flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 .95rem var(--font-ui); color: #fff; background: linear-gradient(135deg, #f77ba5, #b3265e); box-shadow: 0 8px 16px -8px rgba(179,38,94,.7); }
.form-card { padding: clamp(22px, 3.2vw, 40px); border-radius: var(--r-xl); }
.form-card h3 { margin-bottom: 1.2rem; }
.form-note { font-size: .82rem; color: var(--muted); margin-top: 1rem; }

/* Portal (CTA) */
.portal-cta { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: clamp(30px, 5vw, 64px); color: #fff; isolation: isolate;
  background: linear-gradient(135deg, rgba(217,59,120,.95), rgba(150,28,80,.96)); box-shadow: var(--shadow-lg); }
.portal-cta::before, .portal-cta::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.4), rgba(255,255,255,0) 70%); }
.portal-cta::before { width: 420px; height: 420px; right: -120px; top: -160px; }
.portal-cta::after { width: 300px; height: 300px; left: 30%; bottom: -190px; opacity: .7; }
.portal-cta h2, .portal-cta p { color: #fff; }
.portal-cta p { opacity: .94; max-width: 54ch; font-size: 1.08rem; }
.portal-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 2rem; align-items: center; }
@media (max-width: 860px) { .portal-grid { grid-template-columns: 1fr; } }
.portal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.portal-list li { display: flex; align-items: center; gap: .8rem; padding: .85rem 1.1rem; border-radius: 18px; font-weight: 700; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.32); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.portal-list .i { width: 1.4em; height: 1.4em; }
.btn-white { --_bg: #fff; --_fg: var(--rose-700); --_bd: transparent; box-shadow: 0 12px 26px -12px rgba(0,0,0,.4); }
.btn-outline-white { --_bg: rgba(255,255,255,.12); --_fg: #fff; --_bd: rgba(255,255,255,.55); }
.btn-outline-white:hover { background: rgba(255,255,255,.24); color: #fff; }

/* Pie */
.site-footer { margin-top: 2rem; padding: 2.4rem 0 3rem; }
.footer-card { padding: clamp(22px, 3vw, 36px); display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; }
@media (max-width: 800px) { .footer-card { grid-template-columns: 1fr; } }
.footer-card h4 { font: 800 .82rem var(--font-ui); color: var(--muted); margin-bottom: .8rem; letter-spacing: .02em; }
.footer-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.footer-card a { text-decoration: none; font-weight: 600; }
.footer-card a:hover { text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem; padding: 1.2rem .4rem 0; font-size: .85rem; color: var(--muted); }
.fab-wa { position: fixed; right: 18px; bottom: 18px; z-index: 90; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; color: #17803f; text-decoration: none; transition: transform .3s var(--ease); }
.fab-wa:hover { transform: scale(1.08) rotate(-6deg); color: #17803f; }
.fab-wa .i { width: 28px; height: 28px; }

/* Páginas legales */
.legal { padding-block: clamp(32px, 5vw, 64px); }
.legal-card { padding: clamp(24px, 4vw, 52px); max-width: 860px; margin-inline: auto; }
.legal-card h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.legal-card .prose { font-size: 1.02rem; color: var(--ink-soft); }

/* Font Awesome: tamaño del glifo dentro de cada caja de icono */
.fact i.i, .float-chip i.i { font-size: 15px; }
.t-media i.i { font-size: 44px; }
.s-icon i.i { font-size: 22px; }
.soft-empty i.i { font-size: 30px; }
.info-list i.i { font-size: 18px; }
.fab-wa i.i { font-size: 27px; }

/* ── Ventana emergente de WhatsApp ── */
.btn-wa { --_bg: linear-gradient(135deg, #2bd46d, #128c4a); --_fg: #fff; --_bd: transparent; box-shadow: 0 12px 24px -12px rgba(18, 140, 74, .7); }
.btn-wa:hover { --_fg: #fff; }
.wa-popup { position: fixed; right: 18px; bottom: 90px; z-index: 92; width: min(360px, calc(100vw - 24px)); border-radius: 24px; overflow: hidden; background: #efe6dc;
  box-shadow: 0 30px 70px -24px rgba(20, 70, 40, .55), 0 0 0 1px rgba(0,0,0,.05); opacity: 0; transform: translateY(14px) scale(.97); transform-origin: 100% 100%; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.wa-popup.on { opacity: 1; transform: none; }
.wa-popup[hidden] { display: none; }
.wa-head { display: flex; align-items: center; gap: .75rem; padding: 14px 14px 14px 16px; color: #fff; background: linear-gradient(135deg, #1fa855, #0e7a3f); }
.wa-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.2); font-size: 22px; flex: none; }
.wa-avatar .i { width: 24px; height: 24px; }
.wa-who { flex: 1; min-width: 0; line-height: 1.25; }
.wa-who b { display: block; font-size: 1rem; }
.wa-who small { opacity: .85; font-weight: 600; }
.wa-close { border: 0; background: rgba(255,255,255,.18); color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.wa-close:hover { background: rgba(255,255,255,.32); }
.wa-body { padding: 16px; display: grid; gap: .75rem; }
.wa-bubble { position: relative; margin: 0; padding: .75rem .95rem; background: #fff; border-radius: 4px 16px 16px 16px; font-size: .94rem; line-height: 1.45; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.wa-body textarea { width: 100%; resize: none; padding: .75rem .9rem; border-radius: 14px; border: 1px solid rgba(0,0,0,.12); background: #fff; font: 500 .95rem/1.4 var(--font-ui); color: var(--ink); }
.wa-body textarea:focus { outline: none; box-shadow: 0 0 0 3px rgba(37, 211, 102, .35); border-color: #1fa855; }
.wa-note { margin: 0; text-align: center; font-size: .78rem; color: #5f6b62; }
@media (max-width: 640px) { .wa-popup { right: 10px; left: 10px; width: auto; bottom: 88px; } }

/* ── Aviso de cookies ── */
.cookie-banner.glass { background: rgba(255, 250, 252, .97); backdrop-filter: blur(20px); }
.cookie-banner { position: fixed; left: 18px; bottom: 18px; z-index: 95; width: min(470px, calc(100vw - 36px)); padding: 18px 20px 16px; border-radius: 24px; box-shadow: var(--shadow-lg); animation: cb-in .4s var(--ease) both; }
.cookie-banner[hidden] { display: none; }
.cookie-banner .cb-head { display: flex; align-items: center; gap: .55rem; margin-bottom: .35rem; color: var(--rose-700); font-size: 1.02rem; }
.cookie-banner p { margin: 0 0 .9rem; font-size: .9rem; line-height: 1.5; color: var(--ink-soft); }
.cookie-banner p a { font-weight: 700; }
.cb-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.cb-actions .btn { flex: 1 1 auto; }
@keyframes cb-in { from { opacity: 0; transform: translateY(16px); } }
@media (max-width: 640px) {
  .cookie-banner { left: 10px; right: 10px; bottom: 10px; width: auto; }
  body.has-cookie-banner .fab-wa { bottom: calc(var(--cookie-h, 200px) + 26px); }
  body.has-cookie-banner .wa-popup { bottom: calc(var(--cookie-h, 200px) + 96px); }
}
dialog.cookie-dialog { border: 0; padding: 24px; border-radius: 26px; width: min(520px, calc(100vw - 24px)); box-shadow: var(--shadow-lg); color: var(--ink); background: rgba(255, 255, 255, .96); }
dialog.cookie-dialog::backdrop { background: rgba(59, 30, 44, .4); backdrop-filter: blur(4px); }
dialog.cookie-dialog h2 { font-size: 1.4rem; margin: 0 0 .8rem; }
.cd-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 0; border-top: 1px solid var(--line); }
.cd-row p { margin: .15rem 0 0; font-size: .86rem; color: var(--muted); }
dialog.cookie-dialog .btn-row { margin-top: 1rem; }
.linklike { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linklike:hover { color: var(--rose-700); }

/* ── Mapa: se carga solo con permiso ── */
.map-consent { min-height: clamp(280px, 40vw, 420px); display: grid; place-content: center; justify-items: center; gap: .55rem; text-align: center; padding: 1.5rem; }
.map-consent[hidden] { display: none; }
.map-consent h3 { margin: 0; font-size: 1.25rem; }
.map-consent p { margin: 0 0 .6rem; max-width: 42ch; color: var(--ink-soft); font-size: .93rem; }
/* ══════════════ Panel de administración · portal del paciente · acceso ══════════════ */
.shell { display: grid; grid-template-columns: 276px minmax(0, 1fr); min-height: 100vh; }

/* Barra lateral */
.sidebar { position: sticky; top: 0; height: 100vh; padding: 14px; z-index: 60; }
.sidebar-inner { height: 100%; display: flex; flex-direction: column; padding: 18px 14px 14px; border-radius: 28px; overflow: hidden; }
.sidebar .brand { padding: 4px 8px 16px; }
.sidebar .brand img { width: 38px; height: 38px; }
.side-scroll { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; scrollbar-color: var(--rose-300) transparent; }
.nav-group + .nav-group { margin-top: 1.1rem; }
.nav-group-title { padding: 0 .9rem .35rem; font: 800 .72rem/1.2 var(--font-ui); color: var(--muted); letter-spacing: .04em; }
.nav-item { position: relative; display: flex; align-items: center; gap: .75rem; padding: .62rem .9rem; margin-bottom: 2px; border-radius: 14px; font: 700 .92rem/1.2 var(--font-ui); color: var(--ink-soft); text-decoration: none; transition: background .2s, color .2s, transform .2s var(--ease); }
.nav-item .i { width: 1.15rem; height: 1.15rem; color: var(--rose-500); transition: color .2s; }
.nav-item:hover { background: rgba(255,255,255,.75); color: var(--rose-700); transform: translateX(2px); }
.nav-item.active { color: #fff; background: linear-gradient(135deg, #d93b78, #b3265e); box-shadow: 0 10px 20px -10px rgba(179,38,94,.75), inset 0 1px 0 rgba(255,255,255,.3); }
.nav-item.active .i { color: #fff; }
.nav-item .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; font-size: .74rem; font-weight: 800; color: #fff; background: var(--rose-600); }
.side-user { margin-top: 12px; padding: 10px; border-radius: 18px; display: flex; align-items: center; gap: .7rem; background: rgba(255,255,255,.6); border: 1px solid var(--line); }
.side-user .who { min-width: 0; flex: 1; line-height: 1.25; }
.side-user .who b { display: block; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who span { display: block; font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user { gap: .5rem; padding: 8px; }
.side-user .btn-icon { width: 34px; height: 34px; min-height: 34px; flex: none; }
.side-backdrop { display: none; }

/* Zona principal */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: .8rem; padding: 12px clamp(14px, 3vw, 32px); }
.topbar-inner { flex: 1; display: flex; align-items: center; gap: .8rem; padding: 8px 10px 8px 16px; border-radius: 20px; min-height: 58px; }
.topbar .menu-btn { display: none; }
.crumb { font: 700 .92rem var(--font-ui); color: var(--muted); display: flex; gap: .5rem; align-items: center; min-width: 0; }
.crumb b { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search { margin-left: auto; position: relative; width: min(340px, 34vw); }
.top-search input { width: 100%; min-height: 40px; padding: .5rem .9rem .5rem 2.4rem; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.75); font: 500 .92rem var(--font-ui); color: var(--ink); }
.top-search input:focus { outline: none; box-shadow: var(--focus); border-color: var(--rose-600); background: #fff; }
.top-search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--rose-500); pointer-events: none; }
.bell { position: relative; }
.bell .badge-n { position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center; border-radius: 999px; font: 800 .68rem var(--font-ui); color: #fff; background: var(--rose-600); border: 2px solid #fff; }
.content { padding: 6px clamp(14px, 3vw, 32px) 64px; flex: 1; }
.content-narrow { max-width: 880px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 12px 0 22px; }
.page-head h1 { font-size: clamp(1.7rem, 3vw, 2.35rem); margin: 0; letter-spacing: -.02em; }
.page-head p { margin: .35rem 0 0; color: var(--ink-soft); max-width: 62ch; }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(310px, 86vw); transform: translateX(-105%); transition: transform .4s var(--ease); padding: 10px; }
  .shell.nav-open .sidebar { transform: none; }
  .side-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(60,20,40,.4); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity .3s; }
  .shell.nav-open .side-backdrop { opacity: 1; visibility: visible; }
  .topbar .menu-btn { display: inline-flex; }
  .top-search { display: none; }
}

/* Tarjetas de resumen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stat { display: flex; align-items: center; gap: 1rem; padding: 1.2rem 1.3rem; text-decoration: none; color: inherit; transition: transform .3s var(--ease), box-shadow .3s; }
a.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: inherit; }
.stat .ico { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, #f77ba5, #c22e69); box-shadow: 0 12px 20px -12px rgba(179,38,94,.8); }
.stat .ico .i { width: 24px; height: 24px; }
.stat .val { font: 600 2rem/1 var(--font-display); letter-spacing: -.02em; }
.stat .lbl { font-size: .84rem; font-weight: 700; color: var(--muted); margin-top: 4px; }
.stat.alert .ico { background: linear-gradient(140deg, #ffb45c, #e07a10); }
.stat.danger .ico { background: linear-gradient(140deg, #f36a86, #b3163f); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; align-items: start; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
@media (max-width: 1100px) { .grid-main, .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) { .grid-2, .grid-3, .grid-main { grid-template-columns: 1fr; } }

/* Filtros y búsquedas */
.filters { display: flex; gap: .7rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1.1rem; }
.filters .field { min-width: 160px; flex: 1 1 160px; }
.filters .field.grow2 { flex: 2 1 240px; }
.filters .btn { min-height: 46px; }
.seg { display: inline-flex; max-width: 100%; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.7); border: 1px solid var(--line); gap: 4px; flex-wrap: wrap; }
.seg a { padding: .45rem 1rem; border-radius: 999px; font: 700 .85rem var(--font-ui); color: var(--ink-soft); text-decoration: none; transition: all .2s; white-space: nowrap; }
.seg a:hover { color: var(--rose-700); }
.seg a.on { background: linear-gradient(135deg, #d93b78, #b3265e); color: #fff; box-shadow: 0 6px 14px -6px rgba(179,38,94,.7); }
@media (max-width: 640px) {
  .seg { display: flex; flex-wrap: nowrap; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 6px; border-radius: 18px;
    -webkit-mask-image: linear-gradient(to right, #000 92%, transparent); mask-image: linear-gradient(to right, #000 92%, transparent); }
  .seg::-webkit-scrollbar { display: none; }
  .seg a { flex: 0 0 auto; padding: .5rem .85rem; }
}

/* Pestañas de ficha */
.tabs { display: flex; gap: .3rem; overflow-x: auto; padding: 5px; margin-bottom: 1.2rem; border-radius: 999px; scrollbar-width: none; max-width: 100%; width: fit-content; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; gap: .45rem; align-items: center; padding: .55rem 1.05rem; border-radius: 999px; font: 700 .88rem var(--font-ui); color: var(--ink-soft); text-decoration: none; white-space: nowrap; transition: all .2s; }
.tabs a:hover { background: rgba(255,255,255,.8); color: var(--rose-700); }
.tabs a.on { color: #fff; background: linear-gradient(135deg, #d93b78, #b3265e); box-shadow: 0 8px 16px -8px rgba(179,38,94,.7); }
.tabs .n { font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: rgba(0,0,0,.08); }
.tabs a.on .n { background: rgba(255,255,255,.28); }

/* Ficha de paciente */
.patient-head { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; padding: 1.3rem 1.5rem; margin-bottom: 1.1rem; }
.patient-head h1 { font-size: 1.7rem; margin: 0 0 .25rem; }
.patient-head .meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; color: var(--ink-soft); font-size: .9rem; font-weight: 600; }
.patient-head .meta span { display: inline-flex; align-items: center; gap: .35rem; }
.alert-strip { display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: 18px; background: var(--danger-bg); color: var(--danger); font-weight: 600; border: 1px solid rgba(165,24,63,.2); margin-bottom: 1.1rem; }
.alert-strip .i { margin-top: 2px; }
.notice { display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: 18px; background: var(--info-bg); color: var(--info); font-weight: 600; font-size: .92rem; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.danger { background: var(--danger-bg); color: var(--danger); }
.notice .i { margin-top: 2px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.3rem; margin: 0; font-size: .95rem; }
.kv dt { color: var(--muted); font-weight: 700; font-size: .84rem; padding-top: 1px; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dt { margin-top: .6rem; } }

/* Línea de tiempo (historial de cita / de la ficha) */
.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--rose-300), transparent); border-radius: 2px; }
.timeline li { position: relative; padding: 0 0 1.1rem 12px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--rose-500); }
.timeline .when { font-size: .78rem; color: var(--muted); font-weight: 700; }
.timeline .what { font-weight: 600; }
.record { padding: 1.1rem 1.3rem; }
.record + .record { margin-top: .9rem; }
.record-head { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.record-head h3 { font: 700 1.05rem var(--font-ui); margin: 0; letter-spacing: 0; }
.record .body { white-space: pre-wrap; color: var(--ink-soft); }
.note { padding: 1rem 1.2rem; border-radius: 18px; background: #fff9e8; border: 1px solid #f3e2ae; }
.note.pinned { background: #fff1f5; border-color: var(--rose-200); }
.note + .note { margin-top: .8rem; }
.note .by { font-size: .78rem; color: var(--muted); font-weight: 700; margin-top: .5rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.file-row { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; border-radius: 18px; background: rgba(255,255,255,.6); border: 1px solid var(--line); }
.file-row + .file-row { margin-top: .6rem; }
.file-row .fi { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #ffd6e4, #ffbcd2); color: var(--rose-700); flex: none; }

/* Selector de paciente (autocompletado) y huecos horarios */
.combo { position: relative; }
.combo-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); max-height: 280px; overflow-y: auto; padding: 6px; border-radius: 18px; background: rgba(255,255,255,.98); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); }
.combo-list button { display: flex; flex-direction: column; width: 100%; padding: .6rem .8rem; border: 0; border-radius: 12px; background: none; text-align: left; font: 700 .93rem var(--font-ui); color: var(--ink); cursor: pointer; }
.combo-list button small { color: var(--muted); font-weight: 500; }
.combo-list button:hover, .combo-list button.hl { background: var(--rose-100); }
.combo-list .none { padding: .8rem; color: var(--muted); font-size: .9rem; }
.selected-pill { display: flex; align-items: center; gap: .6rem; padding: .5rem .5rem .5rem .8rem; border-radius: 14px; background: var(--rose-100); font-weight: 700; }
.selected-pill button { margin-left: auto; }
.slots { display: flex; flex-wrap: wrap; gap: .5rem; }
.slot { padding: .5rem .95rem; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.85); font: 700 .9rem var(--font-ui); color: var(--rose-700); cursor: pointer; transition: all .2s var(--ease); }
.slot:hover { background: var(--rose-100); transform: translateY(-1px); }
.slot.on { background: linear-gradient(135deg, #d93b78, #b3265e); color: #fff; border-color: transparent; box-shadow: 0 8px 16px -8px rgba(179,38,94,.7); }
.slot small { font-weight: 600; opacity: .8; margin-left: .3rem; }
.slots-msg { color: var(--muted); font-size: .9rem; padding: .3rem 0; }
.conflict-box { padding: 1rem 1.2rem; border-radius: 18px; background: var(--warn-bg); color: var(--warn); border: 1px solid #f0cf94; font-weight: 600; }
.conflict-box ul { margin: .4rem 0 .7rem; padding-left: 1.2rem; }

/* Diálogos */
dialog.modal { border: 0; padding: 0; background: transparent; width: min(560px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow: visible; color: var(--ink); }
dialog.modal::backdrop { background: rgba(60,20,40,.45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
dialog.modal[open] { animation: pop .35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.modal-card { padding: 1.6rem; background: var(--glass-bg-strong); max-height: calc(100vh - 28px); overflow-y: auto; }
.modal-card h3 { margin-bottom: .8rem; }

/* Barras del dashboard */
.bars { display: flex; align-items: flex-end; gap: .7rem; height: 150px; padding-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; font-size: .74rem; font-weight: 700; color: var(--muted); }
.bars .bar i { display: block; width: 100%; max-width: 44px; min-height: 6px; border-radius: 12px 12px 6px 6px; background: linear-gradient(180deg, #f77ba5, #c22e69); box-shadow: 0 8px 14px -8px rgba(179,38,94,.7); transition: height .8s var(--ease); }
.bars .bar.today i { background: linear-gradient(180deg, #ffb45c, #e07a10); }
.bars .bar b { color: var(--ink); font-size: .82rem; }
.agenda-item { display: flex; gap: .9rem; align-items: center; padding: .75rem .3rem; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.agenda-item:last-child { border: 0; }
.agenda-item:hover { color: inherit; background: rgba(255,255,255,.5); }
.agenda-item .t { min-width: 54px; font: 600 1.15rem var(--font-display); }
.agenda-item .stripe { width: 5px; align-self: stretch; border-radius: 4px; background: var(--dot, var(--rose-500)); }
.agenda-item .who { min-width: 0; flex: 1; line-height: 1.3; }
.agenda-item .who b { display: block; }
.agenda-item .who span { font-size: .84rem; color: var(--muted); }

/* Horarios */
.day-row { display: grid; grid-template-columns: 110px 1fr; gap: .8rem; padding: .8rem 0; border-bottom: 1px solid var(--line); align-items: start; }
.day-row:last-child { border: 0; }
.day-row > b { padding-top: .7rem; font-size: .94rem; }
.ranges { display: grid; gap: .5rem; }
.range { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.range input[type=time] { width: 128px; min-height: 42px; padding: .5rem .7rem; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(255,255,255,.85); font: 600 .95rem var(--font-ui); color: var(--ink); }
.range input[type=time]:focus { outline: none; box-shadow: var(--focus); border-color: var(--rose-600); }
.range.closed-note { color: var(--muted); font-size: .9rem; }
@media (max-width: 560px) { .day-row { grid-template-columns: 1fr; gap: .2rem; } .day-row > b { padding-top: 0; } }

/* Plantillas de avisos */
.var-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0; }
.var-chips button { padding: .25rem .65rem; border-radius: 999px; border: 1px dashed var(--rose-400); background: rgba(255,255,255,.8); font: 700 .78rem ui-monospace, monospace; color: var(--rose-700); cursor: pointer; }
.var-chips button:hover { background: var(--rose-100); }
.preview-box { padding: 1rem 1.2rem; border-radius: 18px; background: #fff; border: 1px dashed var(--line-strong); white-space: pre-wrap; font-size: .93rem; }
.wa-bubble { padding: .9rem 1.1rem; border-radius: 6px 20px 20px 20px; background: #e9fbd9; color: #24331a; white-space: pre-wrap; max-width: 380px; box-shadow: 0 2px 6px rgba(0,0,0,.08); font-size: .93rem; }
.type-card { padding: 1.2rem 1.4rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.type-card + .type-card { margin-top: .8rem; }
.type-card .grow h3 { font: 700 1.05rem var(--font-ui); margin: 0 0 .15rem; letter-spacing: 0; }

/* Preferencias de avisos (portal) */
.channel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: .8rem; }
.channel { position: relative; }
.channel input { position: absolute; opacity: 0; }
.channel label { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; padding: 1rem 1.1rem; height: 100%; border-radius: 20px; cursor: pointer; background: rgba(255,255,255,.7); border: 1.5px solid var(--line-strong); font-weight: 700; transition: all .25s var(--ease); }
.channel label .i { width: 26px; height: 26px; color: var(--rose-500); }
.channel label small { font-weight: 500; color: var(--muted); }
.channel label:hover { border-color: var(--rose-400); transform: translateY(-2px); }
.channel input:checked + label { border-color: var(--rose-600); background: linear-gradient(145deg, #fff, #ffe9f1); box-shadow: 0 12px 26px -14px rgba(179,38,94,.7); }
.channel input:checked + label .i { color: var(--rose-700); }
.channel input:focus-visible + label { box-shadow: var(--focus); }
.pref-row { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.pref-row:last-child { border: 0; }
.pref-row .txt { flex: 1; min-width: 0; }
.pref-row .txt b { display: block; }
.pref-row .txt small { color: var(--muted); }

/* Portal */
.welcome { padding: clamp(22px, 3vw, 34px); position: relative; overflow: hidden; margin-bottom: 1.2rem; }
.welcome::after { content: ""; position: absolute; right: -60px; top: -70px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255,190,212,.7), transparent 70%); pointer-events: none; }
.welcome h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: .3rem; }
.next-appt { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.date-tile { width: 76px; text-align: center; padding: .6rem .3rem; border-radius: 20px; background: linear-gradient(160deg, #fff, #ffe0ea); border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm); flex: none; }
.date-tile b { display: block; font: 600 1.9rem/1 var(--font-display); color: var(--rose-700); }
.date-tile span { font: 800 .72rem/1.3 var(--font-ui); color: var(--muted); }
.appt-card { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.2rem; flex-wrap: wrap; }
.appt-card + .appt-card { margin-top: .8rem; }
.appt-card .info { flex: 1; min-width: 200px; }
.appt-card .info b { display: block; font-size: 1.02rem; }
.appt-card .info span { color: var(--muted); font-size: .9rem; }
.tabbar { display: none; }
@media (max-width: 1000px) {
  .tabbar { position: fixed; z-index: 70; left: 10px; right: 10px; bottom: 10px; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px; border-radius: 26px; box-shadow: var(--shadow-lg); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: .5rem .2rem; border: 0; background: none; border-radius: 20px; font: 700 .68rem var(--font-ui); color: var(--muted); text-decoration: none; cursor: pointer; }
  .tabbar .i { width: 22px; height: 22px; }
  .tabbar a.active, .tabbar button.active { color: var(--rose-700); background: rgba(255,255,255,.85); }
  .shell.has-tabbar .content { padding-bottom: 110px; }
}

/* Listado de notificaciones */
.notif { display: flex; gap: 1rem; padding: 1rem 1.1rem; border-radius: 18px; align-items: flex-start; text-decoration: none; color: inherit; }
.notif + .notif { margin-top: .6rem; }
.notif.unread { background: linear-gradient(145deg, #fff, #ffeaf1); border-color: var(--rose-200); }
.notif .ico { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #ffd6e4, #ffbcd2); color: var(--rose-700); flex: none; }
.notif b { display: block; }
.notif small { color: var(--muted); }

/* ── Acceso (login, recuperar…) ───────────────────────────────────────── */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(980px, 100%); display: grid; grid-template-columns: 1fr 1fr; padding: 0; overflow: hidden; border-radius: var(--r-xl); }
.auth-card.narrow { width: min(520px, 100%); grid-template-columns: 1fr; }
.auth-side { position: relative; padding: clamp(28px, 4vw, 48px); color: #fff; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; background: linear-gradient(150deg, #dd4a85, #a92258 70%); }
.auth-side::before, .auth-side::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.42), transparent 70%); }
.auth-side::before { width: 380px; height: 380px; right: -140px; top: -120px; }
.auth-side::after { width: 300px; height: 300px; left: -80px; bottom: -140px; opacity: .7; }
.auth-side h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.auth-side p { color: rgba(255,255,255,.92); margin: 0; }
.auth-side .brand { color: #fff; }
.auth-side .brand-sub { color: #ffd4e4; }
.auth-side ul { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .7rem; font-weight: 700; }
.auth-side li { display: flex; gap: .7rem; align-items: center; }
.auth-form { padding: clamp(28px, 4vw, 52px); background: rgba(255,255,255,.55); }
.auth-form h1 { font-size: 2rem; margin-bottom: .4rem; }
.auth-form .sub { color: var(--ink-soft); margin-bottom: 1.6rem; }
.auth-links { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.2rem; font-size: .9rem; font-weight: 600; }
.form-error { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 14px; background: var(--danger-bg); color: var(--danger); font-weight: 600; font-size: .92rem; margin-bottom: 1rem; }
@media (max-width: 800px) { .auth-card { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* Error */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.error-card { padding: clamp(32px, 6vw, 64px); max-width: 560px; }
.error-card .code { font: 600 clamp(4rem, 12vw, 7rem)/1 var(--font-display); background: linear-gradient(135deg, #f77ba5, #a92258); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Calendario (FullCalendar 6) ───────────────────────────────────────── */
.cal-card { padding: 14px; }
.cal-toolbar { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.cal-toolbar .field { min-width: 210px; }
.legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .82rem; font-weight: 700; color: var(--ink-soft); margin-left: auto; }
.legend span { display: inline-flex; gap: .4rem; align-items: center; }
#calendar { --fc-border-color: rgba(208,51,110,.14); --fc-page-bg-color: transparent; --fc-neutral-bg-color: rgba(255,240,245,.6);
  --fc-today-bg-color: rgba(255,208,225,.35); --fc-now-indicator-color: #d0336e; --fc-non-business-color: rgba(255,232,240,.5);
  --fc-button-bg-color: #fff; --fc-button-text-color: #b3265e; --fc-button-border-color: rgba(208,51,110,.28);
  --fc-button-hover-bg-color: #ffe6ee; --fc-button-hover-border-color: rgba(208,51,110,.4);
  --fc-button-active-bg-color: #c22e69; --fc-button-active-border-color: #c22e69;
  --fc-event-border-color: transparent; --fc-list-event-hover-bg-color: #fff0f5;
  font-family: var(--font-ui); font-size: .9rem; }
#calendar .fc-toolbar-title { font: 600 1.5rem var(--font-display); text-transform: capitalize; letter-spacing: -.01em; }
#calendar .fc-button { border-radius: 999px; font-weight: 700; padding: .45rem 1rem; text-transform: capitalize; box-shadow: none !important; }
#calendar .fc-button-primary:not(:disabled).fc-button-active, #calendar .fc-button-primary:not(:disabled):active { color: #fff; }
#calendar .fc-button-group > .fc-button { border-radius: 0; }
#calendar .fc-button-group > .fc-button:first-child { border-radius: 999px 0 0 999px; }
#calendar .fc-button-group > .fc-button:last-child { border-radius: 0 999px 999px 0; }
#calendar .fc-col-header-cell-cushion, #calendar .fc-daygrid-day-number { color: var(--ink-soft); font-weight: 700; text-decoration: none; text-transform: capitalize; }
#calendar .fc-timegrid-slot-label-cushion { color: var(--muted); font-weight: 600; font-size: .78rem; }
#calendar .fc-event { border-radius: 10px; padding: 1px 2px; cursor: pointer; box-shadow: 0 6px 12px -8px rgba(60,20,40,.6); transition: transform .2s, filter .2s; }
#calendar .fc-event:hover { filter: brightness(1.06); transform: scale(1.015); z-index: 5; }
#calendar .fc-event-main { padding: 2px 5px; }
#calendar .fc-event.ev-cancelled, #calendar .fc-event.ev-no_show { opacity: .5; text-decoration: line-through; }
#calendar .fc-event.ev-pending { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.28) 0 6px, transparent 6px 12px); }
#calendar .fc-event.ev-completed { filter: saturate(.55); }
#calendar .fc-timegrid-event .fc-event-time { font-weight: 800; }
#calendar .fc-list-event-title a { color: var(--ink); font-weight: 700; text-decoration: none; }
#calendar .fc-scrollgrid { border-radius: 16px; overflow: hidden; }
#calendar .fc-highlight { background: rgba(217,59,120,.16); }
@media (max-width: 700px) { #calendar .fc-toolbar { flex-direction: column; gap: .6rem; align-items: stretch; } #calendar .fc-toolbar-chunk { display: flex; justify-content: center; } }

/* ── Componentes añadidos: formularios y pantallas de sistema ── */
.section-title { font: 800 .78rem var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 1.4rem 0 .8rem; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: .5rem 1.2rem; }
.file-row-inline { display: inline-flex; align-items: center; gap: .55rem; }
.file-row-inline .i { color: var(--rose-500); }
.thumb-sm.round, .table img.thumb-sm.round { border-radius: 50%; width: 40px; height: 40px; object-fit: cover; }
.chip-btn { font: 700 .78rem var(--font-ui); padding: .35rem .7rem; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.85); color: var(--rose-700); cursor: pointer; transition: all .2s var(--ease); }
.chip-btn:hover { background: var(--rose-100); border-color: var(--rose-400); transform: translateY(-1px); }
.week-editor { display: block; }
.range-add { display: flex; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.check-row { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border-radius: 14px; background: rgba(255,255,255,.6); border: 1px solid var(--line); }
.check-row > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dot-status { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #c6b3bc; }
.dot-status.ok { background: #2f9e6b; box-shadow: 0 0 0 4px rgba(47,158,107,.18); }
.dot-status.warn { background: #e0942b; box-shadow: 0 0 0 4px rgba(224,148,43,.18); }
.dot-status.bad { background: #c9375a; box-shadow: 0 0 0 4px rgba(201,55,90,.16); }
.copy-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.copy-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; padding: .55rem .8rem; border-radius: 12px; background: rgba(255,255,255,.7); border: 1px solid var(--line); font-size: .85rem; }
.roles-table th.center, .roles-table td.center { text-align: center; }
.roles-table .group-row td { background: rgba(255, 224, 236, .55); color: var(--rose-700); font-size: .8rem; letter-spacing: .04em; }
.roles-table .tick { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); }
.roles-table .tick .i { width: 15px; height: 15px; }
code { font-size: .88em; background: rgba(255,255,255,.7); padding: .1em .4em; border-radius: 6px; border: 1px solid var(--line); }

#calendar .fc-timegrid-slot { height: 1.55rem; }
#calendar .fc-prev-button, #calendar .fc-next-button { font-size: 1.35rem; line-height: 1; padding-block: .1rem .25rem; min-width: 42px; }

/* Barra superior: nunca desborda en móvil (migas largas, p. ej. el nombre de un paciente) */
.topbar, .topbar-inner { min-width: 0; }
.crumb { flex: 1 1 0; overflow: hidden; }
.crumb > span, .crumb > .i { flex: none; }
@media (max-width: 560px) { .crumb > span:first-child, .crumb > .i:first-of-type { display: none; } }

/* Font Awesome: tamaño del glifo dentro de cada caja de icono */
.nav-item i.i { font-size: 1rem; }
.stat .ico i.i { font-size: 20px; }
.channel label i.i { font-size: 22px; }
.tabbar i.i { font-size: 20px; }
.roles-table .tick i.i { font-size: 11px; }

/* Hueco elegido: el nombre del profesional también debe leerse sobre el fondo rosa */
.slot.on small { color: rgba(255, 255, 255, .92); }

/* Configuración: 7 pestañas, que pasen a la línea siguiente en lugar de quedar cortadas */
.tabs { flex-wrap: wrap; overflow: visible; row-gap: .3rem; border-radius: 26px; }


/* ═══════════════════════════════════════════════════════════════════════════
   INTERIOR (panel del personal, portal del paciente y accesos): cristal, más iconos y movimiento
   Todo va bajo body.app, así la web pública no cambia. Respeta «reducir movimiento» del sistema.
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes sheen { 0%, 55% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
@keyframes ring { 0%, 86%, 100% { transform: rotate(0); } 89% { transform: rotate(16deg); } 92% { transform: rotate(-14deg); } 95% { transform: rotate(9deg); } 98% { transform: rotate(-5deg); } }
@keyframes pulse-soft { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.86); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(229, 81, 138, .55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(229, 81, 138, 0); } }
@keyframes grow { from { transform: scaleY(0); opacity: .3; } to { transform: scaleY(1); opacity: 1; } }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
@keyframes countdown { to { transform: scaleX(0); } }
@keyframes shift { from { background-position: 0% 30%; } to { background-position: 100% 70%; } }

.app { background: radial-gradient(1100px 700px at 6% -8%, rgba(255, 170, 202, .6), transparent 60%), radial-gradient(900px 620px at 104% 8%, rgba(190, 165, 255, .45), transparent 60%),
  radial-gradient(900px 700px at 58% 112%, rgba(255, 204, 168, .5), transparent 60%), #fff2f7; background-attachment: fixed; animation: page-in .5s ease both; }
.app.leaving { opacity: 0; transition: opacity .15s ease; }
.app .bg-orbs i { opacity: .72; }
.app .bg-orbs i:nth-child(1) { background: radial-gradient(circle, #ff86b3, transparent 68%); }
.app .bg-orbs i:nth-child(2) { background: radial-gradient(circle, #b49aff, transparent 68%); }
.app .bg-orbs i:nth-child(3) { background: radial-gradient(circle, #ffc19d, transparent 68%); }

/* Cristal */
.app .glass { background: radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, .8), transparent 58%), linear-gradient(145deg, rgba(255, 255, 255, .56), rgba(255, 255, 255, .22));
  -webkit-backdrop-filter: blur(28px) saturate(1.9); backdrop-filter: blur(28px) saturate(1.9); border: 1px solid rgba(255, 255, 255, .66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .2), 0 26px 50px -26px rgba(179, 38, 94, .45), 0 2px 6px rgba(179, 38, 94, .05); }
.app .glass-strong, .app .modal-card { background: radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, .92), transparent 60%), linear-gradient(145deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .5)); }
.app .sidebar-inner { background: radial-gradient(130% 70% at 0% 0%, rgba(255, 255, 255, .85), transparent 55%), linear-gradient(175deg, rgba(255, 255, 255, .6), rgba(255, 205, 225, .34)); }
.app .side-user { background: rgba(255, 255, 255, .5); backdrop-filter: blur(14px); border-color: rgba(255, 255, 255, .8); }
.app .notice { background: rgba(230, 244, 252, .6); backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, .8); }
.app .notice.warn { background: rgba(255, 240, 214, .68); }

/* Foco de luz que sigue al ratón sobre las tarjetas de cristal */
.app .spot { position: relative; }
.app .spot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .5), transparent 46%); }
.app .spot:hover::before { opacity: 1; }

/* Entrada escalonada */
.app .content > *, .app .stats > *, .app .quick > *, .app .grid-main > .stack > *, .app .grid-2 > .stack > *, .app .appt-card, .app .file-row, .app .patient-head { animation: rise .65s var(--ease) both; }
.app .content > :nth-child(1) { animation-delay: 0s; } .app .content > :nth-child(2) { animation-delay: .07s; } .app .content > :nth-child(3) { animation-delay: .14s; }
.app .content > :nth-child(4) { animation-delay: .21s; } .app .content > :nth-child(5) { animation-delay: .28s; } .app .content > :nth-child(n+6) { animation-delay: .34s; }
.app .stats > :nth-child(1), .app .quick > :nth-child(1) { animation-delay: .12s; } .app .stats > :nth-child(2), .app .quick > :nth-child(2) { animation-delay: .19s; }
.app .stats > :nth-child(3), .app .quick > :nth-child(3) { animation-delay: .26s; } .app .stats > :nth-child(4), .app .quick > :nth-child(4) { animation-delay: .33s; }
.app .stats > :nth-child(n+5), .app .quick > :nth-child(n+5) { animation-delay: .4s; }
.app .grid-main > .stack > :nth-child(2), .app .grid-2 > .stack > :nth-child(2) { animation-delay: .16s; } .app .grid-main > .stack > :nth-child(3), .app .grid-2 > .stack > :nth-child(3) { animation-delay: .24s; }
.app .appt-card:nth-of-type(2), .app .file-row:nth-of-type(2) { animation-delay: .08s; } .app .appt-card:nth-of-type(3), .app .file-row:nth-of-type(3) { animation-delay: .16s; }
.app .appt-card:nth-of-type(n+4), .app .file-row:nth-of-type(n+4) { animation-delay: .24s; }
.app .table tbody tr { animation: rise .5s var(--ease) both; }
.app .table tbody tr:nth-child(1) { animation-delay: .05s; } .app .table tbody tr:nth-child(2) { animation-delay: .09s; } .app .table tbody tr:nth-child(3) { animation-delay: .13s; }
.app .table tbody tr:nth-child(4) { animation-delay: .17s; } .app .table tbody tr:nth-child(5) { animation-delay: .21s; } .app .table tbody tr:nth-child(6) { animation-delay: .25s; }
.app .table tbody tr:nth-child(7) { animation-delay: .29s; } .app .table tbody tr:nth-child(8) { animation-delay: .33s; } .app .table tbody tr:nth-child(n+9) { animation-delay: .37s; }
.app .agenda-item { animation: rise .5s var(--ease) both; } .app .agenda-item:nth-of-type(2) { animation-delay: .07s; } .app .agenda-item:nth-of-type(3) { animation-delay: .14s; } .app .agenda-item:nth-of-type(n+4) { animation-delay: .2s; }

/* Títulos con icono */
.app .page-head h1 { display: flex; align-items: center; gap: .8rem; }
.h-ico { flex: none; display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 17px; color: #fff; font-size: 21px; background: linear-gradient(140deg, #f77ba5, #b3265e);
  box-shadow: 0 16px 26px -10px rgba(179, 38, 94, .8), inset 0 1px 0 rgba(255, 255, 255, .55), 0 0 0 5px rgba(255, 255, 255, .45); animation: float 5.5s ease-in-out infinite; }
.h-ico .i { width: 1em; height: 1em; }
.app .card-title .i { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; color: #fff; font-size: 15px; background: linear-gradient(140deg, #f77ba5, #c22e69); box-shadow: 0 8px 14px -8px rgba(179, 38, 94, .8); }

/* Barra lateral y menú */
.app .brand img { animation: float 6s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(179, 38, 94, .3)); }
.app .nav-item { overflow: hidden; }
.app .nav-item:hover { background: rgba(255, 255, 255, .62); transform: translateX(4px); color: var(--rose-700); }
.app .nav-item .i { transition: transform .4s var(--ease), color .2s; }
.app .nav-item:hover .i { transform: scale(1.22) rotate(-8deg); color: var(--rose-600); }
.app .nav-item.active { background: linear-gradient(135deg, #e5518a, #b3265e); color: #fff; box-shadow: 0 14px 26px -12px rgba(179, 38, 94, .8), inset 0 1px 0 rgba(255, 255, 255, .45); }
.app .nav-item.active .i { color: #fff; }
.app .nav-item.active::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%); animation: sheen 5s ease-in-out infinite; }
.app .nav-item .count { animation: pulse-ring 2.2s infinite; }
.app .nav-group-title { display: flex; align-items: center; gap: .5rem; }
.app .nav-group-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(179, 38, 94, .22), transparent); }

/* Barra superior */
.app .topbar-inner { transition: box-shadow .3s, background .3s; }
.app .topbar.scrolled .topbar-inner { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 22px 40px -22px rgba(179, 38, 94, .55); }
.clock-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .42rem .8rem; border-radius: 999px; font: 700 .82rem var(--font-ui); color: var(--rose-700); background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .85); white-space: nowrap; }
.clock-chip .i { animation: pulse-soft 2.4s ease-in-out infinite; }
.clock-chip b { font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .clock-chip { display: none; } }
.app .bell:has(.badge-n) > .i { animation: ring 5s ease-in-out infinite; transform-origin: 50% 8%; }
.app .bell .badge-n { animation: pulse-ring 2s infinite; }

/* Accesos rápidos */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 0 0 1.4rem; }
.quick a { display: flex; align-items: center; gap: .9rem; padding: .9rem 1.05rem; border-radius: 22px; text-decoration: none; color: var(--ink); font: 700 .96rem/1.2 var(--font-ui); transition: transform .35s var(--ease), box-shadow .35s; }
.quick a small { display: block; margin-top: .15rem; font-weight: 600; font-size: .76rem; color: var(--muted); }
.quick .q-ico { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px; color: #fff; font-size: 19px; background: linear-gradient(140deg, var(--c1, #f77ba5), var(--c2, #c22e69));
  box-shadow: 0 14px 22px -10px var(--c2, #c22e69), inset 0 1px 0 rgba(255, 255, 255, .5); transition: transform .45s var(--ease); }
.quick a:hover { transform: translateY(-6px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 30px 46px -22px rgba(179, 38, 94, .6); }
.quick a:hover .q-ico { transform: rotate(-10deg) scale(1.14); }

/* Tarjetas de cifras */
.app .stat:hover { transform: translateY(-6px) scale(1.012); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 34px 54px -24px rgba(179, 38, 94, .62); }
.app .stat .ico { box-shadow: 0 14px 24px -10px rgba(179, 38, 94, .85), inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 0 5px rgba(255, 255, 255, .4); animation: float 4.5s ease-in-out infinite; }
.app .stat:nth-child(2) .ico { animation-delay: -.8s; } .app .stat:nth-child(3) .ico { animation-delay: -1.6s; } .app .stat:nth-child(4) .ico { animation-delay: -2.4s; }
.app .stat .val { font-variant-numeric: tabular-nums; }
.app .stat:hover .ico .i { animation: pulse-soft .8s ease-in-out 2; }

/* Gráfico de barras y agenda */
.app .bar i { transform-origin: bottom; animation: grow .9s var(--ease) both; box-shadow: 0 10px 18px -8px rgba(179, 38, 94, .75), inset 0 1px 0 rgba(255, 255, 255, .45); }
.app .bar:nth-child(1) i { animation-delay: .35s; } .app .bar:nth-child(2) i { animation-delay: .43s; } .app .bar:nth-child(3) i { animation-delay: .51s; } .app .bar:nth-child(4) i { animation-delay: .59s; }
.app .bar:nth-child(5) i { animation-delay: .67s; } .app .bar:nth-child(6) i { animation-delay: .75s; } .app .bar:nth-child(7) i { animation-delay: .83s; }
.app .bar:hover i { filter: brightness(1.1) saturate(1.2); }
.app .agenda-item { border-radius: 16px; padding-inline: .7rem; margin-inline: -.4rem; transition: background .25s, transform .3s var(--ease); }
.app .agenda-item:hover { background: rgba(255, 255, 255, .62); transform: translateX(4px); }
.app .agenda-item .stripe { transition: transform .35s var(--ease); transform-origin: center; }
.app .agenda-item:hover .stripe { transform: scaleY(1.25); }
.app .who .i, .app .cell-sub .i, .app .info span .i { color: var(--rose-500); font-size: .85em; margin-right: .1rem; }

/* Etiquetas de estado con icono */
.badge { gap: .38rem; }
.badge .i { width: auto; height: auto; font-size: .82em; }
.badge:has(.i)::before { display: none; }
.st-pending .i, .st-new .i { animation: pulse-soft 1.8s ease-in-out infinite; }

/* Tablas y listados */
.app .table-wrap { border-radius: 18px; }
.app .table th .i { color: var(--rose-400); margin-right: .35rem; font-size: .9em; }
.app .table tbody tr { transition: background .2s; }
.app .table tbody tr:hover { background: rgba(255, 255, 255, .6); }
.app .table tbody tr:hover .cell-main { color: var(--rose-600); }
.who-cell { display: flex; align-items: center; gap: .75rem; }
.avatar.sm { --sz: 36px; }
.app .empty .i { animation: float 4s ease-in-out infinite; filter: drop-shadow(0 10px 14px rgba(229, 81, 138, .4)); }
.app .kv dt .i { color: var(--rose-500); margin-right: .3rem; }

/* Formularios: cristal */
.app .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .app .field select, .app .field textarea, .app .top-search input {
  background: rgba(255, 255, 255, .6); border-color: rgba(214, 100, 150, .3); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 3px rgba(179, 38, 94, .07), 0 1px 0 rgba(255, 255, 255, .8); transition: background .25s, box-shadow .25s, border-color .25s, transform .25s var(--ease); }
.app .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):focus, .app .field select:focus, .app .field textarea:focus, .app .top-search input:focus {
  background: rgba(255, 255, 255, .9); border-color: var(--rose-400); box-shadow: 0 0 0 4px rgba(229, 81, 138, .18), 0 14px 26px -14px rgba(179, 38, 94, .55); }
.app .field:focus-within > label { color: var(--rose-700); }

/* Botones */
.app .btn:not(.bell) { position: relative; overflow: hidden; }
.app .btn:not(.btn-primary):not(.btn-danger):not(.btn-ok):not(.btn-ghost):not(.btn-white):not(.btn-wa) { background: rgba(255, 255, 255, .56); border-color: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.app .btn:active { transform: translateY(0) scale(.96); }
.app .btn .i { transition: transform .4s var(--ease); }
.app .btn:hover .i { transform: translateX(2px) scale(1.15) rotate(-4deg); }
.ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .6); transform: scale(0); animation: ripple .65s ease-out forwards; pointer-events: none; }
.btn-primary .ripple { background: rgba(255, 255, 255, .45); }

/* Huecos, diálogos, avisos */
.app .slot { background: rgba(255, 255, 255, .6); backdrop-filter: blur(8px); }
.app .slot:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 12px 20px -10px rgba(179, 38, 94, .55); }
.app .slot.on { background: linear-gradient(135deg, #e5518a, #b3265e); color: #fff; box-shadow: 0 14px 22px -10px rgba(179, 38, 94, .8); }
.app .slots-msg::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: .5rem; border-radius: 50%; background: var(--rose-400); animation: pulse-soft 1.2s ease-in-out infinite; }
.app dialog.modal[open] .modal-card { animation: pop .4s var(--ease) both; }
.app dialog.modal::backdrop { background: rgba(80, 20, 55, .36); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); animation: page-in .3s ease both; }
.app .flash { position: relative; overflow: hidden; -webkit-backdrop-filter: blur(24px) saturate(1.9); backdrop-filter: blur(24px) saturate(1.9); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 24px 40px -20px rgba(120, 30, 70, .5); }
.app .flash::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: currentColor; opacity: .35; transform-origin: left; animation: countdown 6s linear forwards; }
.app .flash.error::after { animation-duration: 10s; }
.app .flash > .i:first-child { animation: pop .6s var(--ease) .15s both; }

/* Portal del paciente */
.app .welcome { overflow: hidden; }
.app .welcome h1 { display: flex; align-items: center; gap: .8rem; }
.app .date-tile { position: relative; background: linear-gradient(160deg, rgba(255, 255, 255, .95), rgba(255, 214, 229, .8)); transition: transform .4s var(--ease); }
.app .appt-card { transition: transform .35s var(--ease), box-shadow .35s; }
.app .appt-card:hover { transform: translateY(-5px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 32px 48px -24px rgba(179, 38, 94, .55); }
.app .appt-card:hover .date-tile { transform: rotate(-4deg) scale(1.06); }
.app .file-row { transition: transform .3s var(--ease); }
.app .file-row:hover { transform: translateX(6px); }
.app .file-row .fi { animation: float 5s ease-in-out infinite; }

/* Accesos (login y registro) */
.app .auth-card { animation: pop .8s var(--ease) both; }
.app .auth-side { background-size: 220% 220%; animation: shift 14s ease-in-out infinite alternate; }
.app .auth-side li .i { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: .5rem; border-radius: 12px; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .35); }
.app .error-card { animation: pop .7s var(--ease) both; }
.app .error-card .code { animation: float 4s ease-in-out infinite; }

@media (max-width: 820px) { .app .glass { -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6); } .h-ico { width: 42px; height: 42px; font-size: 18px; } }
@media (prefers-reduced-motion: reduce) {
  .app, .app *, .app *::before, .app *::after { animation: none !important; transition-duration: .01ms !important; }
  .app.leaving { opacity: 1; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Salud del paciente («LEER»), imágenes del historial, facturas y ventana de confirmación
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes alarm { 0%, 100% { box-shadow: 0 0 0 0 rgba(214, 40, 70, .55); } 60% { box-shadow: 0 0 0 10px rgba(214, 40, 70, 0); } }

/* Ventana de confirmación (sustituye a los cuadros nativos del navegador) */
.confirm-dialog .modal-card { width: min(440px, calc(100vw - 32px)); text-align: center; }
.confirm-dialog h3 { margin: .3rem 0 .4rem; font-size: 1.35rem; }
.confirm-dialog #dc-msg { white-space: pre-line; margin: 0 0 1.3rem; }
.confirm-dialog .btn-row { justify-content: center; }
.confirm-ico { display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; font: 800 1.8rem/1 var(--font-display, serif); color: #fff; background: linear-gradient(140deg, #f77ba5, #b3265e);
  box-shadow: 0 16px 26px -10px rgba(179, 38, 94, .8), 0 0 0 6px rgba(255, 255, 255, .5); animation: pop .5s var(--ease) both; }
.confirm-dialog.danger .confirm-ico { background: linear-gradient(140deg, #f36a86, #b3163f); }

/* Aviso LEER */
.leer-banner { display: flex; align-items: center; gap: .9rem; padding: .85rem 1.1rem; margin-bottom: 1rem; border-radius: 20px; text-decoration: none; color: var(--ink);
  background: linear-gradient(135deg, rgba(255, 236, 190, .8), rgba(255, 214, 150, .55)); border: 1px solid rgba(255, 255, 255, .8); backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 22px 36px -22px rgba(200, 120, 20, .6); transition: transform .3s var(--ease); }
.leer-banner:hover { transform: translateY(-3px); }
.leer-banner.danger { background: linear-gradient(135deg, rgba(255, 214, 222, .9), rgba(255, 176, 190, .6)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 22px 36px -22px rgba(190, 30, 70, .7); }
.leer-tag { flex: none; display: inline-grid; place-items: center; min-width: 58px; padding: .5rem .85rem; border-radius: 14px; font: 800 .92rem/1 var(--font-ui); letter-spacing: .12em; color: #fff;
  background: linear-gradient(140deg, #f36a86, #b3163f); animation: alarm 1.8s infinite; }
.leer-banner:not(.danger) .leer-tag { background: linear-gradient(140deg, #ffb45c, #e07a10); animation: none; }
.leer-tag.big { font-size: 1.05rem; padding: .6rem 1rem; }
.leer-text { flex: 1; min-width: 0; font-size: .96rem; line-height: 1.35; }
.leer-text small { display: block; margin-top: .15rem; font-weight: 600; color: var(--ink-soft); font-size: .82rem; }
.leer-dialog .modal-card { width: min(560px, calc(100vw - 28px)); }
.leer-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .6rem; }
.leer-head h3 { margin: 0; font-size: 1.25rem; }
.leer-sub { margin: 1rem 0 .3rem; font: 700 .82rem var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* Lista de salud */
.health-row { display: flex; align-items: flex-start; gap: .8rem; padding: .75rem .8rem; margin-bottom: .55rem; border-radius: 16px; background: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .85); }
.health-row.flagged { background: rgba(255, 226, 232, .7); border-color: rgba(243, 106, 134, .5); }
.health-row.gone { opacity: .6; } .health-row.gone .health-main b { text-decoration: line-through; }
.health-row.compact { padding: .4rem .7rem; margin-bottom: .3rem; }
.health-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; color: #fff; background: linear-gradient(140deg, #f77ba5, #c22e69); font-size: 16px; }
.health-row.flagged .health-ico { background: linear-gradient(140deg, #f36a86, #b3163f); }
.health-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.health-main .badge { align-self: flex-start; margin-top: .2rem; }
.health-card.danger { border-color: rgba(243, 106, 134, .6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 0 0 3px rgba(243, 106, 134, .22), 0 26px 50px -26px rgba(190, 30, 70, .55); }
.health-add { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
details.removed { margin: .5rem 0; } details.removed summary { cursor: pointer; font-weight: 700; color: var(--muted); font-size: .88rem; margin-bottom: .5rem; }
.health-empty { border-style: dashed; }

/* Imágenes del historial */
.record { border-top: 1px solid var(--line); padding: .9rem 0; }
.record-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin: .7rem 0 0; }
.img-grid.big { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.img-tile { position: relative; margin: 0; }
.img-tile > button { display: block; width: 100%; padding: 0; border: 0; border-radius: 16px; overflow: hidden; cursor: zoom-in; background: rgba(255, 255, 255, .6); box-shadow: 0 10px 20px -12px rgba(179, 38, 94, .6); transition: transform .3s var(--ease); }
.img-tile > button:hover { transform: translateY(-3px) scale(1.03); }
.img-tile img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.img-tile figcaption { text-align: center; margin-top: .3rem; font-size: .76rem; font-weight: 700; color: var(--muted); }
.img-x { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer; color: #fff; background: rgba(179, 22, 63, .85); opacity: 0; transition: opacity .2s; }
.img-tile:hover .img-x, .img-x:focus-visible { opacity: 1; }
.file-btn { cursor: pointer; }

/* Cobro: efectivo / tarjeta */
.pay-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-choice label { cursor: pointer; }
.pay-choice input { position: absolute; opacity: 0; pointer-events: none; }
.pay-choice span { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1.1rem .5rem; border-radius: 20px; font: 700 1rem var(--font-ui); color: var(--ink-soft); background: rgba(255, 255, 255, .6);
  border: 2px solid rgba(255, 255, 255, .9); transition: all .25s var(--ease); }
.pay-choice span .i { font-size: 1.7rem; color: var(--rose-500); }
.pay-choice label:hover span { transform: translateY(-3px); }
.pay-choice input:checked + span { color: #fff; background: linear-gradient(140deg, #e5518a, #b3265e); border-color: transparent; box-shadow: 0 16px 26px -12px rgba(179, 38, 94, .8); }
.pay-choice input:checked + span .i { color: #fff; }
.pay-choice input:focus-visible + span { outline: 3px solid var(--rose-400); outline-offset: 2px; }
.st-paid { background: #e0f6ec; color: #17805a; }
.stat .val.money { font-size: 1.55rem; }

/* Factura imprimible */
.doc-page { max-width: 860px; margin: 0 auto; padding: 24px 16px 60px; }
.doc-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.invoice { position: relative; padding: clamp(24px, 4vw, 48px); overflow: hidden; }
.inv-head { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.inv-head h1 { margin: 0; font-size: 2.2rem; } .inv-num { font: 700 1.15rem var(--font-ui); color: var(--rose-700); }
.inv-clinic { text-align: right; line-height: 1.55; font-size: .93rem; }
.inv-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; padding: 1rem 0; margin-bottom: 1rem; border-block: 1px solid var(--line-strong); font-size: .93rem; line-height: 1.5; }
.inv-meta span { display: block; font: 700 .72rem var(--font-ui); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.inv-lines { width: 100%; border-collapse: collapse; }
.inv-lines th, .inv-lines td { padding: .7rem .5rem; text-align: left; border-bottom: 1px solid var(--line); }
.inv-lines .num { text-align: right; white-space: nowrap; } .inv-lines tfoot td { border-bottom: 0; padding-block: .35rem; }
.inv-lines tfoot .total td { font: 800 1.25rem var(--font-ui); color: var(--rose-700); border-top: 2px solid var(--rose-300); padding-top: .8rem; }
.inv-notes { margin-top: 1.2rem; white-space: pre-wrap; font-size: .92rem; color: var(--ink-soft); }
.inv-foot { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); white-space: pre-wrap; }
.stamp { position: absolute; right: 8%; top: 34%; transform: rotate(-14deg); padding: .3rem 1.2rem; border: 4px solid; border-radius: 12px; font: 800 2rem var(--font-ui); letter-spacing: .1em; opacity: .28; pointer-events: none; }
.stamp.paid { color: #17805a; } .stamp.void { color: #b3163f; }
@media print {
  body.doc, body.doc.app { background: #fff !important; animation: none; }
  .no-print, .bg-orbs, .flash-stack, .cookie-banner { display: none !important; }
  .doc-page { max-width: none; padding: 0; }
  .invoice.glass { box-shadow: none; border: 0; background: #fff; backdrop-filter: none; padding: 0; }
  .stamp { opacity: .35; }
}

.health-flag { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: .3rem; border-radius: 50%; color: #fff; font-size: 12px; vertical-align: middle; background: linear-gradient(140deg, #f36a86, #b3163f); animation: alarm 1.8s infinite; }
.health-flag .i { width: auto; height: auto; }
