/* Estilos de la plataforma. Paleta tomada del sitio (assets/css/style.css). */
:root {
  --teal: #27aeb5;
  --teal-dark: #0a8f9c;
  --navy: #0b2049;
  --ink: #0c1f42;
  --muted: #5e6e8d;
  --soft: #f4fbfc;
  --line: #dcecef;
  --white: #fff;
  --error-bg: #fff0f0;
  --error-ink: #a04646;
  --ok-bg: #e8faf3;
  --ok-ink: #1c6f50;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(8, 53, 83, .10);
  --card-shadow: 0 1px 2px rgba(9, 75, 96, .04), 0 8px 24px rgba(9, 75, 96, .05);
  --bg: #f3f8fa;
  --sidebar-w: 270px;
  --ok: #16a34a;
  --warn-bg: #fff4e5;
  --warn-ink: #b45309;
  --info-bg: #e8f0ff;
  --info-ink: #2f5bd3;
  --violet-bg: #f1ecff;
  --violet-ink: #6d4ad6;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

h1, h2 { font-family: Manrope, sans-serif; color: var(--navy); line-height: 1.15; margin: 0 0 8px; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
.muted { color: var(--muted); }
a { color: inherit; text-decoration: none; }

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand span { font-family: Manrope, sans-serif; font-size: 22px; font-weight: 500; color: #0c5e80; }

label { display: block; font-size: 13px; font-weight: 700; color: #274265; margin: 14px 0 6px; }
input, select {
  width: 100%;
  border: 1px solid #cfe2e6;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #fbfeff;
  color: var(--ink);
}
input:focus, select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(39, 174, 181, .18); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 12px 22px;
  font: inherit;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .2s, box-shadow .2s;
}
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--teal); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--teal-dark); }
.btn-outline { background: var(--white); border-color: #84d3d8; color: var(--ink); }
.btn-full { width: 100%; margin-top: 20px; }
.btn:focus-visible { outline: 3px solid rgba(39, 174, 181, .45); outline-offset: 2px; }

.alert { padding: 11px 14px; border-radius: 10px; margin: 14px 0 0; font-size: 14px; }
.alert.error { background: var(--error-bg); color: var(--error-ink); }
.alert.success { background: var(--ok-bg); color: var(--ok-ink); }

/* Inicio de sesión */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: min(420px, 100%);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.auth-card .brand { margin-bottom: 24px; }

/* Panel: barra lateral con degradado, barra superior y contenido (diseño de assets/mockups_app_web). */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 22px 14px 18px; color: #fff; overflow-y: auto;
  background: linear-gradient(180deg, #23a9b3 0%, #1597a3 55%, #0f8795 100%);
}
.brand-light { padding: 0 10px 10px; }
.brand-light img { filter: brightness(0) invert(1); }
.brand-light span { color: #fff; font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.nav { display: grid; gap: 6px; }
.nav a { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 16px; color: rgba(255, 255, 255, .92); transition: background .15s; }
.nav a:hover { background: rgba(255, 255, 255, .10); }
.nav a.active { background: rgba(255, 255, 255, .22); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); }
.nav .count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: #fff; color: var(--teal-dark); font-size: 12px; font-weight: 800; text-align: center; }
.help-card { margin-top: auto; padding: 18px; border-radius: 18px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .18); }
.help-card strong { font-size: 16px; }
.help-card p { margin: 6px 0 14px; font-size: 14px; color: rgba(255, 255, 255, .88); }
.btn-white { width: 100%; background: #fff; color: var(--teal-dark); }
.btn-white:hover { background: #effbfc; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 14px 28px; background: rgba(243, 248, 250, .88); backdrop-filter: blur(10px); border-bottom: 1px solid transparent;
}
.global-search { position: relative; flex: 1; max-width: 480px; }
.global-search .search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.global-search input { padding: 12px 16px 12px 48px; border-radius: 14px; background: #fff; border-color: var(--line); }
.pill-select { display: flex; align-items: center; gap: 8px; padding: 0 6px 0 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--teal-dark); }
.pill-select select { border: 0; background: transparent; padding: 11px 8px; font-weight: 600; width: auto; max-width: 230px; color: var(--ink); }
.pill-select select:focus { box-shadow: none; }
.pill-select:first-of-type { margin-left: auto; }
#workspace-switch + #center-switch { margin-left: 0; }
.menu-anchor { position: relative; }
.icon-btn { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; border: 1px solid transparent; background: transparent; color: var(--navy); cursor: pointer; position: relative; }
.icon-btn:hover { background: #fff; border-color: var(--line); }
.bell-count { position: absolute; top: 5px; right: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.menu-toggle { display: none; }
.user-button { display: flex; align-items: center; gap: 12px; padding: 4px 6px 4px 4px; border: 0; background: transparent; font: inherit; color: var(--ink); cursor: pointer; border-radius: 16px; text-align: left; }
.user-button:hover { background: #fff; }
.user-text strong { display: block; font-size: 15px; }
.user-text span { display: block; font-size: 13px; color: var(--muted); }
.user-button .chev { color: var(--muted); }
.avatar { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: #dff4f5; color: var(--teal-dark); font-weight: 800; font-size: 15px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 240px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px rgba(8, 53, 83, .18); }
.dropdown-wide { width: 340px; }
.dropdown-head { display: grid; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 10px; font: inherit; font-size: 14px; color: var(--ink); text-align: left; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--soft); }
.dropdown a .icon, .dropdown button .icon { color: var(--teal-dark); flex: none; }
.dropdown .danger, .dropdown .danger .icon { color: var(--error-ink); }
.dropdown-empty { padding: 8px 12px; margin: 0; }
.scrim { position: fixed; inset: 0; z-index: 45; background: rgba(11, 32, 73, .35); }

.content { padding: 8px 28px 36px; display: grid; gap: 20px; align-content: start; width: 100%; max-width: 1480px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--card-shadow); }
.card form { max-width: 420px; }
.card form .btn { margin-top: 20px; }
.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 40px 0; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid #cdeef0; border-top-color: var(--teal); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .user-text { display: none; }
  .pill-select select { max-width: 160px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; width: min(290px, 84vw); transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .3); }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 10px 16px; gap: 8px; flex-wrap: wrap; }
  .global-search { order: 5; flex-basis: 100%; max-width: none; }
  .pill-select:first-of-type { margin-left: auto; }
  .content { padding: 8px 16px 28px; }
}
@media (max-width: 560px) {
  .pill-select { padding-left: 10px; }
  .pill-select select { max-width: 120px; padding: 9px 4px; }
  .pill-select .icon { display: none; }
  .dropdown-wide { width: min(340px, calc(100vw - 32px)); }
}

/* ---- v2: registro, invitaciones y panel por perfil ---- */
input[aria-invalid="true"] { border-color: var(--error-ink); box-shadow: 0 0 0 3px rgba(160, 70, 70, .12); }
input[readonly] { background: #eef5f6; color: var(--muted); }
small, .small { font-size: 13px; }
.optional { font-weight: 500; color: var(--muted); }
.stack { display: grid; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-2.top { align-items: start; gap: 16px; margin-top: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.card-head .actions { margin-top: 0; }
.card.empty { color: var(--muted); text-align: center; }
.card.archived { opacity: .7; }
.card form { max-width: none; }
.card > form .btn, .card form .actions .btn { margin-top: 0; }
.card form > .btn { margin-top: 20px; }

.auth-card-wide { width: min(620px, 100%); }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; font-size: 14px; }
.auth-links a { color: var(--teal-dark); font-weight: 600; }
.auth-card .actions .btn { flex: 1; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #eef7f8; border-radius: 999px; margin: 16px 0 8px; }
.tabs button { border: 0; background: transparent; padding: 10px; border-radius: 999px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--white); color: var(--navy); box-shadow: 0 2px 8px rgba(9, 75, 96, .12); }
.banner { background: #e6f7f8; color: #0b6f7c; padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.banner.warn { background: #fff7e6; color: #8a5a00; }

.btn-small { padding: 7px 14px; font-size: 14px; }
.btn-link { background: none; border: 0; color: var(--teal-dark); padding: 7px 8px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--error-ink); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e6f7f8; color: #0b6f7c; vertical-align: middle; }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge.warn { background: #fff7e6; color: #8a5a00; }
.badge.muted { background: #eef1f5; color: var(--muted); }


fieldset.checks { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 0; }
fieldset.checks legend { font-size: 13px; font-weight: 700; color: #274265; padding: 0 6px; }
.checks.nested { border: 0; padding: 4px 0 0 26px; }
label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; font-size: 14px; color: var(--ink); margin: 8px 0; cursor: pointer; }
label.check input { width: auto; margin: 3px 0 0; accent-color: var(--teal); }
label.check.inline { margin-top: 12px; }

.perm-list { margin: 8px 0; padding-left: 20px; }
.perm-list li { margin: 4px 0; }
.list { display: grid; gap: 12px; }
.list-item { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.list-item p { margin: 6px 0 0; }

.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.stat { flex: 1; min-width: 140px; padding: 14px 16px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); }
.stat strong { display: block; font-family: Manrope, sans-serif; font-size: 28px; color: var(--navy); }
.stat span { font-size: 13px; color: var(--muted); }
.steps { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 10px; }
.steps li > * { vertical-align: middle; }
.steps li { padding-left: 4px; }
.steps li span:first-child { margin-right: 10px; }
.steps li.done span:first-child { color: var(--muted); text-decoration: line-through; }

.schedule-summary { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 14px 0 0; font-size: 14px; }
.schedule-summary dt { font-weight: 700; }
.schedule-summary dd { margin: 0; color: var(--muted); }
.schedule-editor { display: grid; gap: 8px; margin: 16px 0; }
.schedule-row { display: grid; grid-template-columns: 100px 1fr auto; gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.schedule-row > strong { padding-top: 8px; }
.blocks { display: grid; gap: 6px; }
.block { display: flex; align-items: center; gap: 8px; }
.block input { width: 130px; padding: 8px 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 12px 0 0; }
.kv dt { font-weight: 700; color: #274265; }
.kv dd { margin: 0; }

@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
  .schedule-row { grid-template-columns: 1fr; }
  .schedule-row > strong { padding-top: 0; }
  .block input { width: 110px; }
}

/* ---- v4: pacientes ---- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.upper { text-transform: uppercase; }
.search-bar { display: flex; gap: 8px; margin-top: 16px; }
.search-bar input { flex: 1; }
.search-bar .btn { margin: 0; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover, .table tbody tr:focus { background: var(--soft); outline: none; }
.table td a { font-weight: 600; color: var(--navy); }
.table .num { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty-inline { text-align: center; padding: 20px 0; margin: 0; }
label.check.consent { margin-top: 18px; padding: 12px 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.muted-card { background: #f8fbfc; border-style: dashed; }
.link-item { display: block; color: inherit; }
.link-item:hover { border-color: var(--teal); }
.alert .btn { margin-top: 8px; }
.card > p:first-child { margin-top: 0; }

@media (max-width: 760px) {
  .grid-3 { grid-template-columns: 1fr; }
  .search-bar { flex-direction: column; }
  .table th:nth-child(4), .table td:nth-child(4), .table th:nth-child(5), .table td:nth-child(5) { display: none; }
}

/* ---- v5: agenda ---- */
.badge.info { background: #e8efff; color: #3553a8; }
.agenda-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 16px; }
.agenda-toolbar .actions { margin: 0; }
.agenda-toolbar select { width: auto; min-width: 200px; }
.small-tabs { margin: 0; width: 200px; }
.small-tabs button { padding: 7px; }
.inline-field { display: flex; align-items: center; gap: 10px; }
.inline-field select { width: auto; }

.appt-list { display: grid; gap: 8px; margin-top: 14px; }
.appt { --type-color: var(--teal); display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; font: inherit; color: inherit;
  background: var(--white); border: 1px solid var(--line); border-left: 5px solid var(--type-color); border-radius: 12px; padding: 10px 14px; cursor: pointer; }
.appt:hover, .appt:focus-visible { border-color: var(--type-color); box-shadow: 0 4px 14px rgba(9, 75, 96, .08); outline: none; }
.appt-time { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.appt-main { display: grid; }
.appt-main strong { font-size: 15px; }
.appt-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.appt-cancelled { opacity: .55; }
.appt-cancelled .appt-main strong { text-decoration: line-through; }

.slots { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.slot { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; border: 1px solid #84d3d8; background: var(--soft); color: #0b6f7c; cursor: pointer; }
.slot:hover, .slot:focus-visible { background: var(--teal); color: var(--white); outline: none; }
.block-item { display: block; width: 100%; text-align: left; font: inherit; font-size: 13px; margin-top: 8px; padding: 8px 12px; border-radius: 10px; border: 1px dashed #b9c4d3;
  background: repeating-linear-gradient(45deg, #f3f5f8, #f3f5f8 6px, #eceff4 6px, #eceff4 12px); color: var(--muted); cursor: pointer; }

.week { padding: 12px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-day { display: grid; gap: 6px; align-content: start; min-height: 160px; padding: 6px; border-radius: 12px; background: var(--soft); }
.week-day.today { background: #e6f7f8; box-shadow: inset 0 0 0 2px #84d3d8; }
.week-day-head { font: inherit; font-size: 13px; background: none; border: 0; text-align: left; padding: 4px; cursor: pointer; color: var(--navy); }
.week-day .appt { grid-template-columns: 1fr; gap: 2px; padding: 8px 10px; }
.week-day .appt-time { font-size: 12px; }
.week-day .appt-main strong { font-size: 13px; }
.week-day .appt-badges { justify-content: flex-start; }
.week-day .block-item { margin: 0; }

dialog.modal { width: min(620px, calc(100% - 32px)); max-height: calc(100vh - 48px); overflow: auto; border: 0; border-radius: 20px; padding: 28px; box-shadow: 0 30px 80px rgba(8, 53, 83, .3); color: var(--ink); }
dialog.modal::backdrop { background: rgba(11, 32, 73, .35); }
.modal-close { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
dialog.modal h2 { padding-right: 32px; }
dialog.modal .alert ul { margin: 6px 0; padding-left: 18px; }
textarea { width: 100%; border: 1px solid #cfe2e6; border-radius: 12px; padding: 12px 14px; font: inherit; background: #fbfeff; color: var(--ink); resize: vertical; }
textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(39, 174, 181, .18); }
.patient-picker .search-bar { margin-top: 0; }
.picker-results { display: grid; gap: 4px; margin-top: 8px; }
.picker-item { font: inherit; text-align: left; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); cursor: pointer; }
.picker-item:hover { border-color: var(--teal); }
.picked { padding: 10px 12px; border: 1px solid #84d3d8; border-radius: 12px; background: var(--soft); }
.cancel-box { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--error-bg); }
.danger-bg { background: var(--error-ink); }
.danger-bg:hover:not(:disabled) { background: #7d3434; }

.type-list { display: grid; gap: 8px; margin-top: 12px; }
.type-row { display: grid; grid-template-columns: 44px 1fr 120px auto auto; gap: 8px; align-items: center; }
.type-row.archived { opacity: .55; }
.type-row input[type="color"] { width: 44px; height: 40px; padding: 2px; border-radius: 10px; }
.type-row .btn { margin: 0; }
.with-unit { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.with-unit input { width: 80px; }

@media (max-width: 900px) {
  .week-grid { grid-template-columns: 1fr; }
  .week-day { min-height: 0; }
}
@media (max-width: 760px) {
  .appt { grid-template-columns: 1fr; gap: 4px; }
  .appt-badges { justify-content: flex-start; }
  .small-tabs { width: 100%; }
  .agenda-toolbar select { width: 100%; }
  .type-row { grid-template-columns: 44px 1fr; }
  dialog.modal { padding: 20px; }
}

/* ---- v6: confirmaciones ---- */
fieldset.inline-checks { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 12px; }
fieldset.inline-checks legend { width: 100%; }
fieldset:disabled { opacity: .5; }
.card-head > select { width: auto; }
.alert:not(.error):not(.success) { background: #eef1f5; color: var(--muted); }

/* ---- v7: expediente ---- */
.badge.danger { background: var(--error-bg); color: var(--error-ink); }
.pre { white-space: pre-wrap; }
h3 { font-family: Manrope, sans-serif; font-size: 16px; color: var(--navy); margin: 18px 0 6px; }
.record-alerts { display: grid; gap: 8px; margin-top: 14px; }
.record-alert { padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.danger-alert { background: var(--error-bg); color: var(--error-ink); border: 1px solid #f3cccc; }
.ok-alert { background: var(--ok-bg); color: var(--ok-ink); }
.info-alert { background: #eef4ff; color: #334f8f; }
.muted-alert { background: #fff7e6; color: #8a5a00; margin-top: 14px; }
.wide-tabs { width: min(420px, 100%); }
.kv-wide { grid-template-columns: minmax(160px, 260px) 1fr; }
.versions { margin-top: 16px; }
.version-item { font: inherit; text-align: left; cursor: pointer; background: var(--white); }

.rows { display: grid; gap: 8px; margin: 8px 0; }
.row { display: grid; gap: 6px; align-items: center; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)) 32px; }
.row.cols-2 { --cols: 2; }
.row.cols-2 input.code { max-width: 140px; }
.row.cols-2 { grid-template-columns: 140px 1fr 32px; }
.row.cols-3 { --cols: 3; }
.row.cols-7 { grid-template-columns: 2fr 1.4fr 1fr .8fr 1.2fr 1fr 1.8fr 32px; }
.row input, .row select { padding: 9px 10px; font-size: 14px; }
.rows-field { margin-top: 16px; }
.rows-field > .btn { margin-top: 4px; }

.vitals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.vital { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); margin: 0; font-weight: 500; }
.vital input { padding: 8px 10px; background: var(--white); }
.vital strong, .bmi { font-size: 18px; font-family: Manrope, sans-serif; color: var(--navy); }
.consult-form h2 { margin-top: 22px; }
.consult-form textarea { margin-bottom: 4px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--white); padding: 12px 0; border-top: 1px solid var(--line); z-index: 2; }
.save-state { margin-left: auto; }
.save-state.dirty { color: #8a5a00; font-weight: 600; }
.addendum { border-left: 3px solid #84d3d8; padding: 4px 0 4px 12px; margin: 8px 0; }
.addendum-form { margin-top: 18px; }
.rx-list { padding-left: 22px; }
.rx-list li { margin: 8px 0; }

.rx-sheet { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 36px 40px; max-width: 800px; color: #111; }
.rx-head { display: flex; justify-content: space-between; gap: 24px; border-bottom: 2px solid var(--teal); padding-bottom: 14px; }
.rx-head h1 { font-size: 24px; margin: 0 0 4px; }
.rx-head p, .rx-meta p, .rx-patient p, .rx-sign p { margin: 2px 0; }
.rx-meta { text-align: right; }
.rx-patient { padding: 14px 0; border-bottom: 1px solid var(--line); }
.rx-body { min-height: 300px; padding-top: 12px; }
.rx-symbol { font-family: Georgia, serif; font-size: 28px; font-style: italic; font-weight: 700; color: var(--teal-dark); margin: 0; }
.rx-sign { margin-top: 60px; text-align: center; }
.sign-line { width: 260px; margin: 0 auto 6px; border-top: 1px solid #333; }

@media print {
  body { background: #fff; }
  .topbar, .sidebar, .no-print, .scrim { display: none !important; }
  .shell { display: block; min-height: 0; }
  .content { padding: 0; max-width: none; }
  .rx-sheet { border: 0; border-radius: 0; padding: 0; max-width: none; }
}
@media (max-width: 760px) {
  .row, .row.cols-2, .row.cols-3, .row.cols-7 { grid-template-columns: 1fr 32px; }
  .row > :not(button) { grid-column: 1; }
  .row > button { grid-column: 2; grid-row: 1; }
  .kv-wide { grid-template-columns: 1fr; }
  .rx-sheet { padding: 20px; }
  .rx-head { flex-direction: column; }
  .rx-meta { text-align: left; }
}

/* ---- v8: estudios ---- */
.upload-form { padding: 16px; margin: 12px 0 16px; border: 1px dashed #84d3d8; border-radius: 14px; background: var(--soft); }
.upload-form input[type="file"] { padding: 9px; background: var(--white); }
.upload-form .btn { margin-top: 14px; }
.study-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; }
.study-item .actions { margin: 0; }
.study-main p { margin: 4px 0 0; }
.file-kind { display: grid; place-items: center; width: 48px; height: 56px; border-radius: 8px; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.file-kind.pdf { background: #fdecec; color: #b3261e; }
.file-kind.img { background: #e8efff; color: #3553a8; }
dialog.viewer { width: min(960px, calc(100% - 32px)); }
.viewer-img { max-width: 100%; max-height: 75vh; margin: 0 auto; border-radius: 12px; }
@media (max-width: 760px) {
  .study-item { grid-template-columns: 40px 1fr; }
  .study-item .actions { grid-column: 1 / -1; }
  .file-kind { width: 40px; height: 48px; }
}
.wide-tabs { width: min(560px, 100%); grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }

/* ---- v10: CIE-10 ---- */
.dx-row { grid-template-columns: 110px 1fr 32px; }
.dx-search { position: relative; }
.suggestions { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; overflow: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(8, 53, 83, .16); }
.suggestions li { padding: 8px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.suggestions li:hover, .suggestions li[aria-selected="true"] { background: #e6f7f8; }
.suggestions strong { display: inline-block; min-width: 52px; color: var(--teal-dark); }
@media (max-width: 760px) { .dx-row { grid-template-columns: 1fr 32px; } }

/* ---- v11: apoyo con IA ---- */
.btn-ai { background: linear-gradient(135deg, #5b5bd6, #27aeb5); color: var(--white); border: 0; }
.btn-ai:hover:not(:disabled) { filter: brightness(1.05); }
.ai-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.ai-panel { margin-top: 16px; padding: 18px; border-radius: 16px; border: 1px solid #d6d6f5; background: linear-gradient(180deg, #f7f7ff, #f4fbfc); }
.ai-panel h2 { margin-top: 0; }
.ai-panel .list-item { background: var(--white); }
.ai-panel .list-item p { margin: 6px 0 0; }
.ai-footer { margin-top: 14px; padding-top: 10px; border-top: 1px dashed #d6d6f5; }
.ai-footer .actions { margin-top: 6px; }
.sent-context { max-height: 320px; overflow: auto; font-size: 12px; background: #0b2049; color: #e6f7f8; padding: 12px; border-radius: 10px; white-space: pre-wrap; }
.notice { padding: 14px 16px; border-left: 4px solid var(--teal); background: var(--soft); border-radius: 10px; color: #3e5270; font-size: 14px; }

/* ---- v12: perfil público y mapas ---- */
.map { height: 280px; border-radius: 14px; border: 1px solid var(--line); background: #eef3f5; z-index: 0; }
.map-box { margin-top: 14px; }
.profile-photo img, .photo-placeholder { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid #e6f7f8; }
.photo-placeholder { display: grid; place-items: center; background: var(--soft); color: var(--muted); font-size: 13px; }
.photo-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.span-2 { grid-column: span 2; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 16px; max-height: 320px; overflow: auto; margin-top: 10px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; }
.spec-grid label.check { margin: 6px 0; }
.warn-list { margin: 14px 0 0; padding-left: 32px; }
code { background: var(--soft); padding: 2px 6px; border-radius: 6px; font-size: 13px; word-break: break-all; }
@media (max-width: 760px) { .span-2 { grid-column: auto; } }

/* ---- v13: rediseño (tablero, citas, ficha del paciente, diagnóstico IA, reportes) ---- */
.icon { flex: none; vertical-align: middle; }
.btn { gap: 8px; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-block { display: flex; width: 100%; margin-top: 14px; }
.btn-soft { background: #e8f7f8; color: var(--teal-dark); border-color: #cdeef0; }
.btn-soft:hover { background: #d9f1f3; }
.btn-outline { border-color: #bfe6e9; color: var(--teal-dark); }
.btn-outline:hover { background: #f1fbfc; }
.icon-btn.bordered { width: 40px; height: 40px; border-color: var(--line); background: #fff; }
h1 { font-size: 32px; letter-spacing: -.02em; }
h2 { font-size: 18px; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--teal); color: #fff; font-size: 12px; font-weight: 800; text-align: center; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.page-head h1 { font-size: 38px; margin: 0; }
.page-head .actions { margin: 0; }
.page-sub { margin: 6px 0 0; color: var(--muted); font-size: 16px; }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--teal-dark); font-weight: 600; margin-top: 6px; }
.sub-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.sub-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 600; color: var(--muted); }
.sub-tabs a.active { color: var(--teal-dark); border-bottom-color: var(--teal); }
.segmented { display: inline-flex; padding: 4px; gap: 2px; background: #eef5f7; border-radius: 12px; }
.segmented button { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.segmented button[aria-selected="true"] { background: var(--teal); color: #fff; box-shadow: 0 2px 8px rgba(39, 174, 181, .3); }

.card-title { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; width: 100%; }
.card-title h2 { margin: 0; font-size: 19px; }
.card-title.as-link { border: 0; background: none; padding: 0; font: inherit; text-align: left; cursor: pointer; color: inherit; }
.card-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #e8f7f8; color: var(--teal-dark); flex: none; }
.card-icon.violet, .icon.violet { color: var(--violet-ink); }
.card-icon.violet { background: var(--violet-bg); }
.card-icon.danger { background: var(--error-bg); color: #dc2626; }
.card-link { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--teal-dark); white-space: nowrap; }
.card-meta { margin-left: auto; font-size: 13px; color: var(--muted); }
.chev { margin-left: auto; color: #9fb0c3; }
.empty-note { color: var(--muted); font-size: 14px; margin: 8px 0; }
.empty-state { display: grid; justify-items: center; gap: 10px; padding: 36px 16px; text-align: center; color: var(--muted); }
.empty-state .icon { color: #9fd9dc; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; background: #eef1f5; color: var(--muted); }
.pill.ok { background: var(--ok-bg); color: #15803d; }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.info { background: var(--info-bg); color: var(--info-ink); }
.pill.violet { background: var(--violet-bg); color: var(--violet-ink); }
.pill.danger { background: var(--error-bg); color: #c02626; }
.pill + .pill { margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: #eef5f7; color: #3e5270; font-size: 12.5px; font-weight: 500; }
.chip button { display: inline-grid; place-items: center; border: 0; background: none; padding: 0; color: inherit; cursor: pointer; }
.chips.editable .chip { background: #e3f4f6; color: #0b6f7c; font-size: 14px; padding: 6px 10px; }
.code-chip { display: inline-block; margin-left: auto; padding: 2px 8px; border-radius: 8px; background: #eef1f5; color: var(--muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.code-chip.unverified { background: var(--warn-bg); color: var(--warn-ink); }

.avatar-sm { width: 36px; height: 36px; font-size: 13px; }
.avatar-md { width: 44px; height: 44px; }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; }
.avatar-xl { width: 112px; height: 112px; font-size: 38px; border-radius: 24px; }
.tone-teal { background: #dff4f5; color: #0b7d88; }
.tone-blue { background: #e3ecff; color: #2f5bd3; }
.tone-violet { background: #eee8ff; color: #6d4ad6; }
.tone-amber { background: #fff1dc; color: #b45309; }
.tone-rose { background: #ffe6e8; color: #d12e3e; }
.tone-green { background: #dcf6e6; color: #15803d; }

/* Inicio */
.hello { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 520px); gap: 20px; align-items: center; margin-top: 8px; }
.hello-title { font-size: 42px; margin: 0; }
.hello-card { display: flex; align-items: center; gap: 16px; padding: 20px 24px; border-radius: 20px; background: linear-gradient(120deg, #fff8e8 0%, #eaf7f8 60%, #d8f0f2 100%); }
.hello-card strong { font-size: 18px; color: var(--navy); }
.hello-card p { margin: 4px 0 0; color: #3e5270; font-size: 14px; }
.hello-sun { color: #f5a524; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat-card { display: flex; align-items: center; gap: 16px; padding: 20px; }
.link-card:hover { border-color: #9fd9dc; }
.stat-icon { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; flex: none; }
.stat-body { display: grid; min-width: 0; }
.stat-label { font-weight: 600; color: var(--navy); font-size: 15px; }
.stat-value { font-family: Manrope, sans-serif; font-size: 32px; font-weight: 800; color: var(--navy); line-height: 1.15; }
.stat-sub { font-size: 13px; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 20px; align-items: start; }
.dash-col { display: grid; gap: 20px; }
.day-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 14px; }
.day-tabs button { display: grid; justify-items: center; gap: 1px; padding: 8px 4px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; position: relative; }
.day-tabs button strong { color: var(--ink); font-size: 14px; }
.day-tabs button em { position: absolute; top: 4px; right: 6px; font-style: normal; font-size: 11px; font-weight: 800; color: var(--teal-dark); }
.day-tabs button[aria-selected="true"] { background: var(--teal); color: #e6fbfc; }
.day-tabs button[aria-selected="true"] strong, .day-tabs button[aria-selected="true"] em { color: #fff; }
.appt-rows { display: grid; }
.appt-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border: 0; border-bottom: 1px solid #edf3f5; background: none; font: inherit; color: inherit; text-align: left; width: 100%; cursor: pointer; }
.appt-row:last-child { border-bottom: 0; }
.appt-row:hover { background: #f7fbfc; }
.appt-row-time { font-weight: 700; font-variant-numeric: tabular-nums; width: 48px; flex: none; }
.appt-row-main { display: grid; min-width: 0; flex: 1; }
.appt-row-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-row-main span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #b8c4d3; }
.dot.confirmed { background: #22c55e; }
.dot.scheduled { background: #f59e0b; }
.dot.completed { background: #3b82f6; }
.dot.live { background: #8b5cf6; box-shadow: 0 0 0 4px rgba(139, 92, 246, .18); }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quick-tile { display: grid; justify-items: center; gap: 10px; padding: 18px 8px; border-radius: 14px; background: #f5fafb; border: 1px solid #e6f1f3; text-align: center; font-size: 14px; color: #3e5270; transition: border-color .15s, background .15s; }
.quick-tile .icon { color: var(--teal-dark); }
.quick-tile:hover { border-color: #9fd9dc; background: #effafb; }
.suggest-box { border-radius: 16px; background: linear-gradient(180deg, #f5f3ff, #f6fbfc); padding: 6px 14px 8px; }
.suggest-head { display: flex; gap: 12px; align-items: center; padding: 10px 0; color: var(--violet-ink); }
.suggest-head div { display: grid; }
.suggest-head strong { color: var(--navy); }
.suggest-head span { font-size: 13px; color: var(--muted); }
.suggest-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #e7e4f7; font-size: 14px; color: #3e5270; }
.suggest-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #fff; color: var(--teal-dark); flex: none; }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.activity li { display: flex; gap: 12px; padding: 8px 0; }
.activity-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #e8f7f8; color: var(--teal-dark); flex: none; }
.activity li > div { display: grid; flex: 1; min-width: 0; }
.activity-top { display: flex; justify-content: space-between; gap: 8px; }
.activity-top strong { font-size: 14px; }
.follow-list { display: grid; }
.follow-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf3f5; }
.follow-item:last-child { border-bottom: 0; }
.follow-main { display: grid; flex: 1; min-width: 0; }
.follow-main span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.follow-item .chev { margin-left: 0; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.check-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.check-list .icon { color: #16a34a; margin-top: 3px; }

/* Citas */
.agenda-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.agenda-main { display: grid; gap: 16px; min-width: 0; }
.agenda-side { display: grid; gap: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px 20px; }
.filter { display: grid; gap: 6px; flex: 1; min-width: 180px; }
.filter-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.filter-box { display: flex; align-items: center; gap: 8px; padding-left: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--teal-dark); }
.filter-box select { border: 0; background: transparent; padding: 10px 10px 10px 0; }
.filter-box select:focus { box-shadow: none; }
.agenda-card { padding: 16px; }
.agenda-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.toolbar-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agenda-date-wrap { display: inline-flex; align-items: center; gap: 10px; margin-left: 10px; color: var(--teal-dark); }
.agenda-date { margin: 0; font-size: 20px; }
.time-grid-wrap { overflow-x: auto; }
.time-grid { min-width: calc(64px + var(--cols) * 200px); }
.grid-head, .grid-body { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(200px, 1fr)); }
.grid-head { position: sticky; top: 0; z-index: 3; background: #fff; }
.grid-col-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.grid-col-head:first-of-type { background: #f0fafb; border-radius: 12px 12px 0 0; }
.grid-col-head > span:last-child { display: grid; min-width: 0; }
.grid-col-head strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-col-head small { color: var(--muted); font-size: 12px; }
.col-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #e8f7f8; color: var(--teal-dark); flex: none; }
.grid-ruler { position: relative; }
.grid-ruler span { position: absolute; right: 10px; transform: translateY(-50%); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.grid-ruler span:first-child { transform: none; }
.grid-col { position: relative; border-left: 1px solid var(--line); cursor: default;
  background: repeating-linear-gradient(135deg, #f7f9fb, #f7f9fb 6px, #f1f4f7 6px, #f1f4f7 12px); }
.grid-open { position: absolute; left: 0; right: 0; background: #fff;
  background-image: repeating-linear-gradient(180deg, transparent 0, transparent calc(60 * 1.7px - 1px), #eef3f5 calc(60 * 1.7px - 1px), #eef3f5 calc(60 * 1.7px)); }
.grid-block { position: absolute; left: 4px; right: 4px; z-index: 1; display: flex; align-items: flex-start; gap: 6px; padding: 6px 8px; border: 1px dashed #b9c4d3; border-radius: 10px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer;
  background: repeating-linear-gradient(45deg, #f3f5f8, #f3f5f8 6px, #eceff4 6px, #eceff4 12px); }
.grid-event { position: absolute; z-index: 2; display: grid; align-content: start; gap: 1px; padding: 6px 10px; overflow: hidden; border: 0; border-left: 4px solid var(--ev); border-radius: 10px; background: var(--ev-bg); font: inherit; text-align: left; color: var(--navy); cursor: pointer; box-shadow: 0 1px 2px rgba(9, 75, 96, .06); }
.grid-event:hover { box-shadow: 0 6px 16px rgba(9, 75, 96, .14); z-index: 4; }
.grid-event strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-time { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: #3e5270; }
.ev-icons { display: inline-flex; gap: 4px; color: var(--ev); }
.ev-type { font-size: 12px; color: #52637f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-event.tone-green { --ev: #22a559; --ev-bg: #ecfaf1; }
.grid-event.tone-amber { --ev: #e89612; --ev-bg: #fff6e6; }
.grid-event.tone-blue { --ev: #3b76e8; --ev-bg: #edf3ff; }
.grid-event.tone-red { --ev: #e0464f; --ev-bg: #fdeeee; opacity: .75; }
.grid-event.tone-red strong { text-decoration: line-through; }
.grid-event, .grid-block, .grid-open { background-clip: padding-box; }
.grid-col, .grid-open { cursor: pointer; }
.now-line { position: absolute; left: 0; right: 0; z-index: 3; height: 2px; background: #ef4444; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ef4444; }
.grid-hint { margin: 10px 0 0; }
.week-day-head { display: flex; gap: 6px; align-items: baseline; }
.week-day-head span { color: var(--muted); text-transform: uppercase; font-size: 12px; font-weight: 700; }
.week-day-head strong { font-size: 18px; }
.month-head, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.month-head span { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding-bottom: 6px; }
.month-day { display: grid; align-content: start; gap: 3px; min-height: 108px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.month-day:hover { border-color: #9fd9dc; }
.month-day.other { background: #f8fafb; color: #9fb0c3; }
.month-day.today { box-shadow: inset 0 0 0 2px var(--teal); }
.month-day.blocked { background: repeating-linear-gradient(45deg, #f7f9fb, #f7f9fb 6px, #f0f3f6 6px, #f0f3f6 12px); }
.month-num { font-weight: 700; font-size: 14px; }
.month-chip { display: block; padding: 2px 6px; border-radius: 6px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--ev); background: var(--ev-bg); color: var(--navy); }
.month-chip.tone-green { --ev: #22a559; --ev-bg: #ecfaf1; }
.month-chip.tone-amber { --ev: #e89612; --ev-bg: #fff6e6; }
.month-chip.tone-blue { --ev: #3b76e8; --ev-bg: #edf3ff; }
.month-more { font-size: 11.5px; color: var(--muted); }
.appt-rows.compact .appt-row { padding: 10px 0; }
.channels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.channel { display: grid; justify-items: start; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); }
.channel.on { color: #15803d; }
.channel span { display: grid; }
.channel strong { color: var(--navy); font-size: 14px; }
.channel small { font-size: 12px; }
.switch { justify-self: end; width: 38px; height: 22px; border-radius: 999px; background: #d5dde6; position: relative; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: #22c55e; }
.switch.on::after { left: 19px; }
.free-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.free-slot { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.free-slot:hover { border-color: var(--teal); background: #f1fbfc; }
.free-slot span:last-child { display: grid; min-width: 0; }
.free-slot small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Listas y búsqueda */
.search-field { position: relative; flex: 1; display: flex; align-items: center; }
.search-field > .icon { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 44px; }
.search-bar { margin-top: 0; }
.list-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 6px; }
.list-toolbar .check { margin: 0; }
.table-people td { vertical-align: middle; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person > span:last-child { display: grid; min-width: 0; }
.person small { color: var(--muted); font-size: 12.5px; }
.row-chev { color: #9fb0c3; width: 30px; }
.nowrap { white-space: nowrap; }
.cell-title { display: block; }

/* Ficha del paciente */
.patient-head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.patient-id { display: grid; gap: 6px; min-width: 220px; }
.patient-id h1 { margin: 0; font-size: 30px; }
.patient-meta { display: flex; flex-wrap: wrap; gap: 0; margin: 0; color: var(--muted); }
.patient-meta span + span::before { content: "|"; margin: 0 12px; color: #cfd9e3; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badges .pill + .pill { margin-left: 0; }
.alert-pill { display: inline-flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; border: 0; font: inherit; text-align: left; cursor: pointer; }
.alert-pill span { display: grid; }
.alert-pill small { font-size: 13px; opacity: .9; }
.alert-pill.danger { background: #fdecec; color: #c02626; }
.alert-pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.alert-pill.ok { background: var(--ok-bg); color: #15803d; cursor: default; }
.alert-pill.muted { background: #eef1f5; color: var(--muted); }
.patient-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.patient-actions .dropdown { min-width: 240px; }
.patient-extra { flex-basis: 100%; }
.patient-extra:empty { display: none; }
.line-tabs { display: flex; gap: 4px; overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 4px 8px; }
.line-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border: 0; border-bottom: 3px solid transparent; background: none; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.line-tabs button[aria-selected="true"] { color: var(--teal-dark); border-bottom-color: var(--teal); }
.line-tabs em { font-style: normal; font-size: 12px; padding: 0 7px; border-radius: 999px; background: #eef5f7; }
.patient-grid { display: grid; grid-template-columns: minmax(260px, 330px) minmax(0, 1fr); gap: 20px; align-items: start; }
.patient-cards { display: grid; gap: 20px; min-width: 0; }
.grid-cards-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-cards-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid #edf3f5; }
.info-list li:last-child { border-bottom: 0; }
.info-list .icon { color: var(--teal-dark); margin-top: 2px; }
.info-list div { display: grid; min-width: 0; }
.info-k { font-weight: 600; font-size: 14px; }
.info-v { color: #3e5270; font-size: 14px; overflow-wrap: anywhere; }
.card-danger { background: linear-gradient(180deg, #fff5f5, #fff); border-color: #f6d6d6; }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mini-list li > span:first-child { display: grid; }
.mini-list small { color: var(--muted); font-size: 12.5px; }
.dx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dx-list li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.dx-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #1d98c9; color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.vital-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.vital-tile { display: grid; justify-items: center; padding: 10px 6px; border-radius: 12px; background: #f3f9fb; }
.vital-tile span { font-size: 12px; color: var(--muted); }
.vital-tile strong { font-family: Manrope, sans-serif; font-size: 22px; color: var(--teal-dark); }
.vital-tile small { font-size: 11px; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; position: relative; padding-bottom: 14px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 0; width: 2px; background: #d9eef0; }
.timeline li:last-child::before { display: none; }
.tl-date { display: grid; padding-left: 20px; position: relative; font-size: 13px; color: var(--muted); }
.tl-date::before { content: ""; position: absolute; left: 0; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #1d98c9; box-shadow: 0 0 0 3px #e3f3fa; }
.tl-date strong { color: var(--navy); font-size: 15px; }
.tl-body { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 1px solid #edf3f5; }
.tl-body:hover { border-color: #9fd9dc; }
.tl-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.tl-text { margin: 4px 0 0; font-size: 14px; color: #3e5270; }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.file-list li { display: flex; gap: 12px; align-items: flex-start; }
.file-list li > span:last-child { display: grid; gap: 2px; justify-items: start; min-width: 0; }
.file-list strong { font-size: 14px; overflow-wrap: anywhere; }
.file-list small { color: var(--muted); font-size: 12.5px; }
.rx-rows { list-style: none; margin: 0; padding: 0; }
.rx-rows li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf3f5; flex-wrap: wrap; }
.rx-rows li:last-child { border-bottom: 0; }
.rx-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #e8f7f8; color: var(--teal-dark); flex: none; }
.rx-main { display: grid; flex: 1; min-width: 200px; }
.rx-main small { color: var(--muted); }
.rx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.rx-card { display: grid; gap: 10px; align-content: start; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.rx-card-head { display: flex; justify-content: space-between; align-items: center; }
.folio { font-weight: 800; color: var(--teal-dark); letter-spacing: .02em; }
.rx-dx { margin: 0; }
.rx-meds { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.rx-meds li { display: flex; gap: 8px; }
.rx-meds .icon { color: var(--teal-dark); margin-top: 3px; }
.rx-card .actions { margin-top: 4px; }

/* Diagnóstico IA */
.ai-notice { display: flex; align-items: center; gap: 10px; max-width: 560px; padding: 12px 16px; border-radius: 14px; background: #eef4ff; color: #334f8f; font-size: 14px; }
.ai-notice .icon { color: #2f5bd3; }
.ai-patient { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ai-patient-id { display: grid; min-width: 180px; }
.ai-patient-id strong { font-size: 20px; }
.ai-patient-id span, .ai-patient-id small { color: var(--muted); }
.ai-patient-col { display: grid; gap: 4px; padding-left: 22px; border-left: 1px solid var(--line); min-width: 150px; }
.ai-patient-col > span { font-size: 13px; font-weight: 600; color: var(--navy); }
.ai-patient-col > strong { font-weight: 500; color: #3e5270; }
.ai-patient-col .chips { margin: 0; }
.ai-patient-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.ai-patient-note { flex-basis: 100%; margin: 0; }
.ai-patient.picker { align-items: flex-start; }
.grow { flex: 1; min-width: 240px; }
.picker-item.person { display: flex; }
.ai-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, .95fr); gap: 20px; align-items: start; }
.ai-col { display: grid; gap: 20px; min-width: 0; }
.ai-step { min-width: 0; }
.ai-step.card form, form.ai-step { max-width: none; }
.step-title { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.step-title h2 { margin: 0; font-size: 18px; }
.step-title p { margin: 2px 0 0; }
.step-title > .btn { margin: 0 0 0 auto !important; }
.req { color: #dc2626; }
.chip-input .chips { margin-top: 8px; }
.vitals-inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.vital-input { display: grid; gap: 4px; }
.vital-input > span { font-size: 12.5px; color: var(--muted); }
.with-suffix { position: relative; }
.with-suffix input { padding-right: 52px; }
.with-suffix small { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; }
.textarea-wrap { position: relative; }
.counter { position: absolute; right: 12px; bottom: 10px; font-size: 12px; color: var(--muted); }
form.ai-step .btn-block { margin-top: 16px; }
.ai-empty { display: grid; justify-items: center; gap: 8px; padding: 24px 8px; text-align: center; color: var(--muted); font-size: 14px; }
.ai-empty .icon { color: #b8b0ee; }
.ai-empty p { margin: 0; }
.ai-dx { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ai-dx li { display: grid; grid-template-columns: 28px minmax(0, 1fr) 110px; gap: 12px; align-items: start; }
.ai-dx-main { display: grid; gap: 2px; }
.ai-dx-main strong { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ai-dx-main .code-chip { margin-left: 0; }
.ai-dx-main small { color: var(--muted); font-size: 12.5px; }
.ai-dx-prob { display: grid; gap: 4px; }
.bar { display: block; height: 8px; border-radius: 999px; background: #e6eef2; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: #1d98c9; }
.priority { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; }
.priority div { display: grid; }
.priority strong { font-size: 17px; }
.priority small { font-size: 13px; color: #3e5270; }
.priority-dot { width: 18px; height: 18px; border-radius: 50%; margin-top: 3px; flex: none; }
.priority.ok { background: var(--ok-bg); color: #15803d; }
.priority.ok .priority-dot { background: #22c55e; }
.priority.warn { background: var(--warn-bg); color: var(--warn-ink); }
.priority.warn .priority-dot { background: #f59e0b; }
.priority.danger { background: #fdecec; color: #c02626; }
.priority.danger .priority-dot { background: #ef4444; }
.alarm-box { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: #fdf0f0; color: #b42323; }
.alarm-box strong { display: flex; gap: 8px; align-items: center; }
.alarm-box ul { margin: 8px 0 0; padding-left: 20px; color: #3e5270; font-size: 14px; }
.study-checks { list-style: none; margin: 0; padding: 0; }
.study-checks li { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid #edf3f5; }
.study-checks label.check { margin: 0; }
.study-checks label.check > span { display: grid; }
.study-checks small { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.insight { padding: 12px 14px; border-radius: 14px; background: #f1f8ff; margin-bottom: 10px; }
.insight strong { display: flex; gap: 8px; align-items: center; color: #1d5fa8; font-size: 14px; }
.insight ul { margin: 6px 0 0; padding-left: 20px; font-size: 13.5px; color: #3e5270; }

/* Reportes y configuración */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; }
.hbars { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 12px; }
.hbars li { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr) 40px; gap: 12px; align-items: center; font-size: 14px; }
.hbar-label { display: flex; gap: 6px; align-items: center; color: #3e5270; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 14px; }
.hbar-fill { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: #27aeb5; }
.hbar-fill.st-blue { background: #3b76e8; }
.hbar-fill.st-green { background: #22a559; }
.hbar-fill.st-amber { background: #e89612; }
.hbar-fill.st-gray { background: #9aa8bd; }
.hbar-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.vbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 200px; margin-top: 12px; }
.vbar { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 4px; min-width: 0; }
.vbar-value { font-size: 13px; font-weight: 700; }
.vbar-track { display: flex; align-items: flex-end; width: 100%; max-width: 44px; }
.vbar-fill { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: #27aeb5; }
.vbar-label { font-size: 12.5px; color: var(--muted); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.mini-stat { display: grid; padding: 14px; border-radius: 14px; background: #f3f9fb; }
.mini-stat strong { font-family: Manrope, sans-serif; font-size: 26px; color: var(--navy); }
.mini-stat span { font-size: 13px; color: var(--muted); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.settings-tile { display: flex; align-items: center; gap: 16px; }
.settings-tile:hover { border-color: #9fd9dc; }
.settings-text { display: grid; gap: 4px; }
.settings-text small { color: var(--muted); font-size: 13.5px; }

@media (max-width: 1400px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-col:first-child { grid-column: 1 / -1; }
  .ai-grid { grid-template-columns: 1fr 1fr; }
  .ai-grid > form { grid-column: 1 / -1; }
}
@media (max-width: 1200px) {
  .agenda-layout { grid-template-columns: 1fr; }
  .agenda-side { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
  .grid-cards-3 { grid-template-columns: 1fr 1fr; }
  .patient-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .hello { grid-template-columns: 1fr; }
  .hello-title, .page-head h1 { font-size: 30px; }
  .dash-grid, .ai-grid, .grid-cards-2 { grid-template-columns: 1fr; }
  .patient-actions { margin-left: 0; }
  .ai-patient-col { padding-left: 0; border-left: 0; }
  .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid-cards-3 { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: 1fr; }
  .free-slots, .mini-stats { grid-template-columns: 1fr 1fr; }
  .channel { padding: 10px 8px; }
  .ai-dx li { grid-template-columns: 28px minmax(0, 1fr); }
  .ai-dx-prob { grid-column: 2; }
  .month-day { min-height: 64px; }
  .month-chip { display: none; }
  .month-day:has(.month-chip)::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
  .settings-grid, .rx-cards { grid-template-columns: 1fr; }
  .hbars li { grid-template-columns: 1fr 40px; }
  .hbar-track { grid-column: 1 / -1; grid-row: 2; }
  .agenda-toolbar { flex-direction: column; align-items: stretch; }
  .timeline li { grid-template-columns: 1fr; }
}
.follow-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title { flex-wrap: wrap; row-gap: 4px; }
.card-title h2 { white-space: nowrap; }
.grid-event.short { display: flex; align-items: center; gap: 8px; padding: 2px 10px; }
.grid-event.short .ev-time { font-weight: 700; flex: none; }
.grid-event.short strong { flex: 1; min-width: 0; font-size: 13px; }
.tl-date { align-content: start; }
.patient-actions .btn-ai { padding: 12px 22px; font-size: inherit; }
.patient-extra:not(:has(.ai-panel:not([hidden]), .alert:not([hidden]))) { display: none; }
.card .search-bar .btn, .card form.search-bar .btn { margin: 0; }
.step-title > .btn { white-space: nowrap; }
.hbars.stacked li { grid-template-columns: minmax(0, 1fr) 40px; row-gap: 4px; }
.hbars.stacked .hbar-label { grid-column: 1 / -1; white-space: normal; }
.card form .type-row .btn { margin-top: 0; }
.appt-row.static { cursor: default; }
.appt-row.static:hover { background: none; }
.collab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.collab-card { display: grid; gap: 6px; align-content: start; position: relative; }
.collab-card.current { border-color: #9fd9dc; box-shadow: 0 0 0 3px rgba(39, 174, 181, .12); }
.collab-card h3 { margin: 12px 0 4px; font-size: 14px; }
.collab-current { position: absolute; top: 20px; right: 20px; }
.collab-current { position: static; justify-self: start; }
@media (max-width: 560px) {
  #center-switch { display: none; }
  .pill-select select { max-width: 150px; }
}

/* ---- v16: acceso (iniciar sesión y registro en una sola vista animada) ---- */
body.auth-split { margin: 0; background: #fff; }
body.auth-split:not(.ready) *, body.auth-split:not(.ready) *::before { transition: none !important; }
.auth-shell { display: flex; min-height: 100vh; }
.auth-visual { position: sticky; top: 0; align-self: flex-start; height: 100vh; flex: 0 1 80%; overflow: hidden; background: #dceff1;
  transition: flex-basis .85s cubic-bezier(.65, 0, .35, 1); }
body[data-mode="register"] .auth-visual { flex-basis: 20%; }
.visual { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .8s ease, transform 1.4s ease; }
.visual-login { object-position: 15% center; }
.visual-register { object-position: 42% center; opacity: 0; transform: scale(1.06); }
body[data-mode="register"] .visual-login { opacity: 0; transform: scale(1.06); }
body[data-mode="register"] .visual-register { opacity: 1; transform: none; }
.visual-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 40, 58, 0) 45%, rgba(6, 48, 66, .82) 100%); }
.visual-caption { position: absolute; left: 56px; right: 56px; bottom: 52px; max-width: 620px; color: #fff; transition: opacity .5s ease, transform .6s ease; }
.visual-eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: #bff0f3; }
.visual-caption h2 { margin: 0 0 18px; font-size: clamp(30px, 3vw, 44px); line-height: 1.08; letter-spacing: -.02em; color: #fff; }
.visual-caption ul { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.visual-caption li { padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(8px); font-size: 14px; font-weight: 600; }
.visual-caption-mini { position: absolute; left: 22px; right: 22px; bottom: 28px; display: grid; gap: 4px; color: #fff; opacity: 0; transform: translateY(16px); transition: opacity .5s ease .35s, transform .6s ease .35s; }
.visual-caption-mini strong { font-family: Manrope, sans-serif; font-size: 20px; line-height: 1.15; }
.visual-caption-mini span { font-size: 13px; color: #d7f3f5; }
body[data-mode="register"] .visual-caption { opacity: 0; transform: translateY(20px); }
body[data-mode="register"] .visual-caption-mini { opacity: 1; transform: none; }

.auth-panel { flex: 1 1 20%; min-width: 420px; display: flex; align-items: center; justify-content: center; padding: 48px 44px; background: #fff; }
.auth-view { width: 100%; max-width: 380px; }
#register-view { max-width: 860px; }
.auth-view.leaving { opacity: 0; transform: translateX(24px); transition: opacity .25s ease, transform .25s ease; }
.auth-view.entering { animation: auth-in .6s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes auth-in { from { opacity: 0; transform: translateY(18px); } }
.auth-brand { margin-bottom: 44px; }
.auth-view h1 { font-size: 32px; margin: 0 0 6px; }
.auth-view > .muted, .register-head .muted { margin: 0 0 8px; }
.input-icon, .input-wrap { position: relative; }
.input-icon > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #8fa0b5; pointer-events: none; }
.input-icon input { padding-left: 44px; }
.has-toggle input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; padding: 6px; border: 0; border-radius: 8px; background: none; color: #8fa0b5; cursor: pointer; }
.pw-toggle:hover, .pw-toggle.on { color: var(--teal-dark); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.small-link { font-size: 13px; font-weight: 600; color: var(--teal-dark); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 28px 0 14px; color: var(--muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-view .btn-outline.btn-full { margin-top: 0; }
.auth-foot { margin: 24px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.auth-foot a, .auth-switch a { color: var(--teal-dark); font-weight: 700; }
.register-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.auth-switch { margin: 8px 0 0; font-size: 14px; }
.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0 6px; }
.type-cards button { display: grid; gap: 2px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; font: inherit; text-align: left; cursor: pointer; transition: border-color .2s, box-shadow .2s, background .2s; }
.type-cards button strong { font-size: 16px; color: var(--navy); }
.type-cards button span { font-size: 13px; color: var(--muted); }
.type-cards button[aria-selected="true"] { border-color: var(--teal); background: #f0fbfc; box-shadow: 0 0 0 3px rgba(39, 174, 181, .15); }
.register-submit { margin-top: 24px; min-width: 240px; }
#register-form .auth-foot { text-align: left; margin-top: 14px; }
.done-box { text-align: center; max-width: 520px; margin: 0 auto; }
.done-icon { display: inline-grid; place-items: center; width: 76px; height: 76px; margin-bottom: 16px; border-radius: 50%; background: #e3f6f7; color: var(--teal-dark); }

@media (max-width: 900px) {
  .auth-shell { flex-direction: column; }
  .auth-visual, body[data-mode="register"] .auth-visual { position: relative; flex: none; width: 100%; height: 190px; }
  body[data-mode="register"] .auth-visual { height: 130px; }
  .visual-caption { left: 20px; right: 20px; bottom: 18px; }
  .visual-caption h2 { font-size: 24px; margin: 0; }
  .visual-caption ul, .visual-eyebrow { display: none; }
  .visual-caption-mini { bottom: 16px; left: 20px; }
  .auth-panel { min-width: 0; padding: 28px 20px 40px; align-items: flex-start; }
  .auth-brand { margin-bottom: 24px; }
}
@media (max-width: 520px) {
  .type-cards { grid-template-columns: 1fr; }
  .register-submit { width: 100%; }
}
/* Formulario a la izquierda e imagen a la derecha (login 20/80, registro 80/20) */
.auth-panel { order: 0; }
.auth-visual { order: 1; }
.auth-view.leaving { transform: translateX(-24px); }
@media (max-width: 900px) {
  .auth-visual { order: 0; }
  .auth-panel { order: 1; }
}
.visual-login { object-position: 30% center; }
.visual-register { object-position: 72% center; }

/* ---- v23: logotipo (assets/brand) con proporción fija ---- */
.brand-logo { display: block; height: 40px; width: auto; max-width: 100%; }
.brand-light img.brand-logo { filter: none; height: 40px; }
.brand-light { padding: 2px 10px 12px; }
.auth-card .brand-logo { height: 38px; }
@media (max-width: 560px) { .brand-logo { height: 34px; } }

/* ---- v24: planes y cobros ---- */
.billing-banner { display: flex; align-items: center; gap: 10px; margin: 0 28px 8px; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; background: var(--info-bg); color: var(--info-ink); }
.billing-banner.warn { background: var(--warn-bg); color: var(--warn-ink); }
.billing-banner.danger { background: var(--error-bg); color: #b42323; }
.billing-banner a { margin-left: auto; font-weight: 700; white-space: nowrap; color: inherit; text-decoration: underline; }
.plan-current-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.plan-current-head h2 { font-size: 26px; margin: 2px 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-dark); }
.usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 18px; }
.usage { display: grid; gap: 6px; }
.usage-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.usage-track { height: 8px; border-radius: 999px; background: #e6eef2; overflow: hidden; }
.usage-fill { display: block; height: 100%; border-radius: 999px; background: var(--teal); }
.usage-fill.high { background: #f59e0b; }
.usage-fill.full { background: #ef4444; }
.plan-head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.plan-head-row .card-title { width: auto; margin: 0; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 18px; align-items: start; }
.plan-card { position: relative; display: grid; gap: 8px; padding: 22px; border: 1.5px solid var(--line); border-radius: 18px; background: #fff; }
.plan-card.recommended { border-color: var(--teal); box-shadow: 0 12px 30px rgba(39, 174, 181, .15); }
.plan-card.current { background: #f3fbfc; }
.plan-card h3 { margin: 0; font-size: 20px; }
.plan-badge { position: absolute; top: -12px; right: 18px; padding: 4px 12px; border-radius: 999px; background: var(--teal); color: #fff; font-size: 12px; font-weight: 700; }
.plan-price { margin: 4px 0 0; }
.plan-price strong { font-family: Manrope, sans-serif; font-size: 34px; color: var(--navy); }
.plan-price span { color: var(--muted); }
.plan-note { margin: 0 0 6px; font-size: 13px; color: var(--teal-dark); font-weight: 600; }
.plan-features { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.plan-features li { display: flex; gap: 8px; align-items: flex-start; }
.plan-features .icon { color: #16a34a; margin-top: 3px; }
.addon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.addon { padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.addon p { margin: 4px 0 10px; }
.addon-row { display: flex; gap: 8px; align-items: center; }
.addon-row input { width: 90px; }
.addon-row select { width: auto; flex: 1; }
@media (max-width: 900px) { .billing-banner { margin: 0 16px 8px; } }
.upsell { display: grid; justify-items: start; gap: 8px; background: linear-gradient(135deg, #f0fbfc, #f5f3ff); }
.upsell .icon { color: var(--teal-dark); }
/* Apartados en línea sin confirmar */
.grid-event.hold { --ev: #7c5ce0; --ev-bg: #f4f0ff; border: 1.5px dashed #9b83ec; border-left: 4px solid #7c5ce0; }
.grid-event.hold.expired { --ev: #d97706; --ev-bg: #fff7ea; border-color: #f0b35e; border-left-color: #d97706; opacity: .9; }
.appt.hold { border-style: dashed; --type-color: #7c5ce0; background: #faf8ff; }
.appt.hold.expired { --type-color: #d97706; background: #fffaf2; }
.month-chip.hold { --ev: #7c5ce0; --ev-bg: #f4f0ff; }

/* ---- v26: receta personalizable ---- */
.rx-stage { overflow-x: auto; }
.rx-sheet { --rx-accent: #27aeb5; position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 10px 30px rgba(9, 75, 96, .08); padding: 44px 48px; color: #111; font-size: 14.5px; line-height: 1.45; width: 816px; max-width: none; min-height: 1056px; margin: 0 auto; }
.rx-sheet.paper-half_letter { width: 528px; min-height: 816px; padding: 30px 32px; font-size: 13px; }
.rx-sheet.paper-a4 { width: 794px; min-height: 1123px; }
.rx-sheet.rx-font-small { font-size: 13px; }
.rx-sheet.rx-font-large { font-size: 16px; }
.rx-sheet.paper-half_letter.rx-font-small { font-size: 12px; }
.rx-sheet.paper-half_letter.rx-font-large { font-size: 14px; }
.rx-sheet p { margin: 2px 0; }
.rx-head { display: flex; align-items: flex-start; gap: 20px; border-bottom: 2px solid var(--rx-accent); padding-bottom: 14px; }
.rx-logo { max-height: 72px; max-width: 170px; object-fit: contain; flex: none; }
.paper-half_letter .rx-logo { max-height: 52px; max-width: 120px; }
.rx-doctor { flex: 1; min-width: 0; }
.rx-doctor h1 { margin: 0 0 4px; font-size: 1.65em; line-height: 1.15; color: var(--rx-accent); font-family: Manrope, sans-serif; }
.rx-doctor p { color: #333; }
.rx-license { font-weight: 600; }
.rx-meta { text-align: right; flex: none; max-width: 38%; }
.rx-folio { font-weight: 800; color: var(--rx-accent); }
.rx-center { font-weight: 600; }
.rx-meta .small { font-size: .85em; color: #444; }
.rx-layout-centered .rx-head { flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.rx-layout-centered .rx-meta { text-align: center; max-width: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 14px; }
.rx-layout-band .rx-head { margin: -44px -48px 0; padding: 26px 48px 18px; background: var(--rx-accent); border-bottom: 0; color: #fff; border-radius: 6px 6px 0 0; }
.paper-half_letter.rx-layout-band .rx-head { margin: -30px -32px 0; padding: 18px 32px 14px; }
.rx-layout-band .rx-doctor h1, .rx-layout-band .rx-doctor p, .rx-layout-band .rx-folio, .rx-layout-band .rx-meta .small { color: #fff; }
.rx-layout-band .rx-logo { background: #fff; border-radius: 8px; padding: 6px; }
.rx-patient { padding: 12px 0; border-bottom: 1px solid #e3e7eb; }
.rx-body { flex: 1; min-height: 220px; padding-top: 10px; }
.rx-symbol { font-family: Georgia, serif; font-size: 2em; font-style: italic; font-weight: 700; color: var(--rx-accent); margin: 0; }
.rx-list { padding-left: 22px; }
.rx-list li { margin: 8px 0; }
.rx-body h3 { color: var(--rx-accent); font-size: 1.05em; }
.rx-sign { margin-top: 30px; text-align: center; }
.rx-signature { display: block; max-height: 78px; max-width: 240px; margin: 0 auto -8px; object-fit: contain; }
.paper-half_letter .rx-signature { max-height: 56px; }
.rx-signature-space { height: 56px; }
.sign-line { width: 260px; max-width: 70%; margin: 0 auto 6px; border-top: 1px solid #333; }
.rx-foot { margin-top: 18px; padding-top: 10px; border-top: 1px solid #e3e7eb; font-size: .82em; color: #555; text-align: center; white-space: pre-line; }

.rx-settings { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
.rx-preview-wrap { position: sticky; top: 90px; }
.rx-preview { overflow: hidden; border-radius: 12px; background: #e9eef1; padding: 16px; }
.rx-preview .rx-sheet { zoom: .62; }
.rx-preview .rx-sheet.paper-half_letter { zoom: .9; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--navy); }
.color-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.color-row input[type="color"] { width: 44px; height: 36px; padding: 2px; border-radius: 10px; }
.toggle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 16px; }
.rx-image-box { padding: 14px; border: 1px dashed #b7dfe3; border-radius: 14px; background: #f8fcfd; }
.rx-image-thumb { display: grid; place-items: center; height: 90px; margin: 8px 0; border-radius: 10px;
  background: repeating-conic-gradient(#eef2f4 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.rx-image-thumb img { max-height: 80px; max-width: 90%; object-fit: contain; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
@media (max-width: 1200px) {
  .rx-settings { grid-template-columns: 1fr; }
  .rx-preview-wrap { position: static; }
}
@media (max-width: 760px) {
  .rx-preview .rx-sheet { zoom: .42; }
  .rx-stage .rx-sheet { zoom: .45; }
}

@page { margin: 12mm; }
@page half { size: 5.5in 8.5in; margin: 8mm; }
@page a4 { size: A4; margin: 12mm; }
@page letter { size: letter; margin: 12mm; }
@media print {
  .rx-stage { overflow: visible; }
  .rx-sheet { box-shadow: none; border: 0; border-radius: 0; width: auto; min-height: 0; padding: 0; zoom: 1 !important; }
  .rx-sheet.paper-letter { page: letter; min-height: calc(11in - 24mm); }
  .rx-sheet.paper-half_letter { page: half; min-height: calc(8.5in - 16mm); }
  .rx-sheet.paper-a4 { page: a4; min-height: calc(297mm - 24mm); }
  .rx-layout-band .rx-head { margin: 0; border-radius: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rx-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .billing-banner, .back-link { display: none !important; }
}

/* ---- v27: varias recetas y tamaños de papel dinámicos ---- */
.rx-sheet { width: var(--rx-w, 21.59cm); min-height: var(--rx-h, 27.94cm); padding: var(--rx-pad, 1.2cm); }
.rx-sheet.rx-compact { font-size: 12.5px; }
.rx-sheet.rx-compact.rx-font-small { font-size: 11.5px; }
.rx-sheet.rx-compact.rx-font-large { font-size: 14px; }
.rx-compact .rx-logo { max-height: 50px; max-width: 110px; }
.rx-compact .rx-signature { max-height: 54px; }
.rx-compact .rx-head { gap: 12px; }
.rx-compact .rx-body { min-height: 120px; }
.rx-layout-band .rx-head { margin: calc(var(--rx-pad, 1.2cm) * -1) calc(var(--rx-pad, 1.2cm) * -1) 0; padding: calc(var(--rx-pad, 1.2cm) * .6) var(--rx-pad, 1.2cm) 14px; }
.rx-preview { display: flex; justify-content: center; }
.rx-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.rx-tab { display: grid; gap: 2px; min-width: 160px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.rx-tab small { color: var(--muted); font-size: 12.5px; }
.rx-tab.active { border-color: var(--teal); background: #f0fbfc; box-shadow: 0 0 0 3px rgba(39, 174, 181, .15); }
.rx-tab.add { display: flex; align-items: center; gap: 8px; border-style: dashed; color: var(--teal-dark); font-weight: 700; }
.checks-list { display: grid; gap: 2px; }
@media print {
  .rx-sheet { page: rxpage; width: var(--rx-w) !important; min-height: calc(var(--rx-h) - 1mm) !important; padding: var(--rx-pad) !important; }
  .rx-layout-band .rx-head { margin: calc(var(--rx-pad) * -1) calc(var(--rx-pad) * -1) 0 !important; }
}
.rx-quick-head { margin-top: 18px; align-items: center; }
.rx-quick-head h2 { margin: 0; }
.folio .pill { margin-left: 8px; font-size: 11px; padding: 3px 8px; }

/* ---- v29: bandeja ---- */
.inbox-list { display: grid; }
.inbox-item { display: flex; align-items: flex-start; gap: 14px; padding: 14px 8px; border-bottom: 1px solid #edf3f5; border-radius: 10px; position: relative; }
.inbox-item:hover { background: #f7fbfc; }
.inbox-item:last-child { border-bottom: 0; }
.inbox-item.unread { background: #f3fbfc; }
.inbox-item.unread strong { color: var(--navy); }
.inbox-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #e8f7f8; color: var(--teal-dark); flex: none; }
.inbox-icon.type-team_alert, .inbox-icon.type-appointment_cancelled, .inbox-icon.type-appointment_cancelled_by_patient { background: #fdecec; color: #c02626; }
.inbox-icon.type-task_assigned, .inbox-icon.type-task_due { background: var(--violet-bg); color: var(--violet-ink); }
.inbox-icon.type-appointment_confirmed_by_patient, .inbox-icon.type-task_completed { background: var(--ok-bg); color: #15803d; }
.inbox-icon.type-appointment_online_requested, .inbox-icon.type-appointment_online_confirmed { background: var(--info-bg); color: var(--info-ink); }
.inbox-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.inbox-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.inbox-body { font-size: 14px; color: #3e5270; }
.inbox-time { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.unread-dot { position: absolute; left: -2px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--teal); }
.task-list { display: grid; gap: 10px; }
.task { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.task.overdue { border-color: #f3c6c6; background: #fffafa; }
.task.done { opacity: .7; }
.task.done strong { text-decoration: line-through; }
.task-check { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; margin-top: 1px; border: 2px solid #b7c7d3; border-radius: 8px; background: #fff; color: transparent; cursor: pointer; }
.task-check:hover { border-color: var(--teal); color: #9fd9dc; }
.task-check.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.task-main { display: grid; gap: 4px; flex: 1; min-width: 0; }
.task-notes { margin: 0; font-size: 14px; color: #3e5270; white-space: pre-line; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.task-meta .pill { padding: 3px 10px; font-size: 12px; }
.task-meta .pill + .pill { margin-left: 0; }
.dropdown-head.row { display: flex; justify-content: space-between; align-items: center; }
.dropdown-action { width: auto !important; padding: 4px 8px !important; font-size: 12.5px !important; color: var(--teal-dark) !important; }
.dropdown .dd-text { display: grid; min-width: 0; }
.dropdown .dd-text small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown a.unread { background: #f3fbfc; }
.dropdown a.unread strong { color: var(--navy); }
.dropdown a.read strong { font-weight: 500; }
.dropdown .dd-section { border-top: 1px solid var(--line); border-radius: 0; }
.dropdown .dropdown-footer { justify-content: center; font-weight: 700; color: var(--teal-dark); border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }

/* ---- Colores por doctor (agenda unificada y recepción) ---- */
.doc-c0 { --doc: #0f9aa6; }
.doc-c1 { --doc: #7c5ce0; }
.doc-c2 { --doc: #d98a0b; }
.doc-c3 { --doc: #3b6fe0; }
.doc-c4 { --doc: #d6457a; }
.doc-c5 { --doc: #1f9d55; }
.doc-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--doc, var(--teal)); flex: none; }
.doctor-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.doctor-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: 14px; font-weight: 600; color: var(--navy); cursor: pointer; }
.doctor-chip[aria-pressed="true"] { border-color: var(--doc); background: color-mix(in srgb, var(--doc) 9%, #fff); }
.doctor-chip.off { color: var(--muted); }
.doctor-chip.off .doc-dot { background: #c9d4dc; }
.doc-tag { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.multi-filters { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px; }
.grid-event[class*="doc-c"] { --ev: var(--doc); }
.grid-col-head[class*="doc-c"] .col-icon { background: color-mix(in srgb, var(--doc) 14%, #fff); color: var(--doc); }
.grid-col-head[class*="doc-c"] { border-bottom: 3px solid var(--doc); }
.appt[class*="doc-c"] { border-left: 4px solid var(--doc); }
.appt[class*="doc-c"] .appt-time { display: inline-flex; align-items: center; gap: 6px; }

/* ---- Recepción y sala de espera ---- */
.reception-top { display: grid; gap: 14px; }
.reception-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.reception-stat { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--soft); color: var(--muted); }
.reception-stat svg { grid-row: span 2; }
.reception-stat strong { font-size: 26px; line-height: 1; color: var(--navy); }
.reception-stat span { font-size: 13px; font-weight: 600; }
.tone-amber.reception-stat, .reception-col.tone-amber .reception-col-head svg { color: var(--warn-ink); }
.tone-violet.reception-stat, .reception-col.tone-violet .reception-col-head svg { color: var(--violet-ink); }
.tone-blue.reception-stat, .reception-col.tone-blue .reception-col-head svg { color: var(--info-ink); }
.reception-stat.tone-amber { background: var(--warn-bg); }
.reception-stat.tone-violet { background: var(--violet-bg); }
.reception-stat.tone-blue { background: var(--info-bg); }
.reception-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.reception-col { display: grid; gap: 10px; padding: 16px; }
.reception-col-head { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.reception-col-head h2 { margin: 0; font-size: 16px; color: var(--navy); }
.reception-col-head .count { margin-left: auto; min-width: 28px; padding: 2px 9px; border-radius: 999px; background: var(--soft); text-align: center; font-weight: 700; color: var(--navy); }
.reception-list { display: grid; gap: 10px; }
.reception-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--doc, var(--line)); border-radius: 12px; background: #fff; }
.reception-card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.reception-card-head .appt-row-main { min-width: 0; }
.reception-card-head .appt-row-main { flex: 1; }
.reception-card-head .appt-row-main strong { display: block; line-height: 1.25; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.reception-card-head .appt-row-main span { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reception-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.reception-card .actions { margin: 0; gap: 6px; }
.reception-card .actions:empty { display: none; }
.reception-card a.small { display: inline-flex; align-items: center; gap: 4px; }
.wait { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.wait.long { color: var(--warn-ink); }

/* ---- Cola de llamadas de confirmación ---- */
.call-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.call-stat { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--soft); color: var(--teal-dark); }
.call-stat strong { font-size: 22px; color: var(--navy); }
.call-stat span { font-size: 13px; font-weight: 600; color: var(--muted); }
.call-list { display: grid; gap: 12px; }
.call-item { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.call-main { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.call-main p { margin: 2px 0 0; }
.call-contact { display: flex; flex-wrap: wrap; align-items: start; gap: 8px; }
.call-outcomes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
.call-outcomes > span { margin-right: 4px; }
.contact-log { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.contact-log li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); }

@media (max-width: 1200px) {
  .reception-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .reception-board, .reception-stats { grid-template-columns: 1fr 1fr; }
  .reception-board { grid-template-columns: 1fr; }
  .call-stats { grid-template-columns: 1fr; }
}

/* ---- Personas del equipo: foto en tareas, avisos y bitácoras ---- */
.avatar-xs { width: 22px; height: 22px; font-size: 9px; }
.avatar.has-photo { background: #e9f1f3; }
.person { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; font-weight: 600; color: var(--navy); }
.person .avatar-xs { font-weight: 700; }
.muted .person, .small .person { font-size: inherit; }
.inbox-label .person { margin-left: 2px; }

/* ---- Mi perfil ---- */
.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-head .avatar-xl img { border-radius: 24px; }
.profile-head .photo-actions { display: grid; gap: 8px; }
.schedule-editor { display: grid; gap: 8px; }
.schedule-row { display: grid; grid-template-columns: minmax(110px, 150px) 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; }
.schedule-row .day { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin: 0; font-weight: 600; color: var(--navy); }
.schedule-row .day input { width: auto; margin: 0; }
.schedule-blocks { display: grid; gap: 6px; }
.schedule-block { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.schedule-block input[type="time"] { width: auto; }
.schedule-row.off .schedule-blocks { color: var(--muted); }
.team-member { display: flex; align-items: center; gap: 14px; }
.team-schedule { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.team-schedule li { padding: 3px 9px; border-radius: 999px; background: var(--soft); font-size: 12px; color: var(--muted); }
@media (max-width: 560px) {
  .schedule-row { grid-template-columns: 1fr; }
}

/* ---- Centro de ayuda (panel y /ayuda/) ---- */
.help-button { color: var(--teal-dark); }
.help-card .btn + .help-card-link { display: block; margin-top: 10px; text-align: center; font-size: 13px; color: rgba(255, 255, 255, .9); text-decoration: underline; }
.help-search { display: grid; gap: 14px; }
.help-search-bar { align-items: center; margin-top: 0; padding: 4px 6px 4px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--muted); }
.help-search-bar input { min-width: 0; border: 0; background: transparent; font-size: 17px; padding: 12px 6px; box-shadow: none; }
.help-filters .segmented { max-width: 100%; overflow-x: auto; }
.help-filters .segmented button { flex: none; }
.help, .help-public, .help-tool, .help-result-main { min-width: 0; }
.help-search-bar input:focus { box-shadow: none; }
.help-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.help-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.help-tool { display: grid; gap: 10px; }
.help-tool-head { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.help-tool-head strong { display: block; color: var(--navy); font-size: 17px; }
.help-tool-head small { display: block; line-height: 1.4; }
.help-tool-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.help-tool-list a { color: var(--ink); }
.help-tool-list a:hover { color: var(--teal-dark); }
.help-extra { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.help-results { display: grid; gap: 8px; }
.help-result { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: inherit; text-decoration: none; }
.help-result:hover { border-color: var(--teal); box-shadow: var(--card-shadow); }
.help-result-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: #e6f6f7; color: var(--teal-dark); }
.help-result-main { display: grid; gap: 4px; flex: 1; min-width: 0; }
.help-result-main strong { color: var(--navy); }
.help-result .chev { color: var(--muted); flex: none; }
.help-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.help-tags .pill + .pill { margin-left: 0; }
.help mark { background: #fff1b8; color: inherit; border-radius: 3px; padding: 0 1px; }
.help-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.help-crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--teal-dark); font-weight: 600; }
.help-article { max-width: 860px; }
.help-article h1 { margin: 0 0 8px; font-size: clamp(26px, 3vw, 34px); color: var(--navy); }
.help-summary { margin: 0 0 12px; font-size: 18px; color: var(--muted); line-height: 1.5; }
.help-content { font-size: 16px; line-height: 1.7; color: var(--ink); }
.help-content h2 { margin: 28px 0 8px; font-size: 21px; color: var(--navy); }
.help-content h3 { margin: 20px 0 6px; font-size: 17px; color: var(--navy); }
.help-content p { margin: 0 0 12px; }
.help-content ul, .help-content ol { margin: 0 0 14px; padding-left: 24px; display: grid; gap: 6px; }
.help-content a { color: var(--teal-dark); font-weight: 600; }
.help-ui { display: inline-block; padding: 0 7px; border: 1px solid #cfe6ea; border-radius: 7px; background: #f2fafb; font-size: .92em; font-weight: 600; color: var(--navy); white-space: nowrap; }
.help-callout { margin: 16px 0; padding: 14px 16px; border-radius: 12px; border-left: 4px solid var(--teal); background: #eef9fa; }
.help-callout.warn { border-left-color: #e89612; background: var(--warn-bg); }
.help-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 12px 0; }
.help-plan { display: grid; align-content: start; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.help-plan.recommended { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(39, 174, 181, .18); }
.help-plan strong { font-size: 18px; color: var(--navy); }
.help-plan-price { font-weight: 700; color: var(--teal-dark); }
.help-plan ul { margin: 4px 0 0; padding-left: 18px; font-size: 14px; gap: 3px; }
.help-go { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.help-letters { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.help-letters a { display: grid; place-items: center; min-width: 32px; height: 32px; border-radius: 8px; background: var(--soft); color: var(--teal-dark); font-weight: 700; text-decoration: none; }
.help-glossary { margin: 0; }
.help-glossary dt { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 700; color: var(--navy); scroll-margin-top: 90px; }
.help-glossary dt:first-child { border-top: 0; margin-top: 0; }
.help-glossary dt.focus, .help-glossary dt:target { color: var(--teal-dark); }
.help-glossary dd { margin: 6px 0 0; line-height: 1.6; }
.help-glossary dd p { margin: 0 0 6px; }
.help-news h2 { margin: 2px 0 8px; }
.help-version { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0 0; }
.help-public { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.help-public .help-tool-head { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
@media (max-width: 760px) {
  .help-search-bar { flex-direction: row; }
  .help-tools, .help-extra { grid-template-columns: 1fr; }
  .help-ui { white-space: normal; }
  .help-search-bar input { font-size: 16px; }
  .help-search-bar .btn { padding-left: 14px; padding-right: 14px; }
  .help-filters .segmented button { padding: 8px 12px; }
}
