/* =====================================================================
   AnDental · hoja de estilos
   Sobre Bootstrap 5.3 (cargado antes). Aquí sólo va la identidad.
   ===================================================================== */

@font-face { font-family: "Atkinson Next"; src: url("../fonts/AtkinsonHyperlegibleNext-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("../fonts/AtkinsonHyperlegibleNext-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("../fonts/AtkinsonHyperlegibleNext-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("../fonts/AtkinsonHyperlegibleNext-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("../fonts/AtkinsonHyperlegibleNext-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* Paleta */
  --ink: #12302D;          /* verde quirúrgico profundo: menú, títulos */
  --ink-2: #1B403C;
  --scrub: #1D6B63;        /* verde campo: acciones principales */
  --scrub-hover: #175952;
  --scrub-soft: #E2EEEB;
  --enamel: #F4F6F5;       /* fondo porcelana */
  --surface: #FFFFFF;
  --line: #DCE3E1;
  --line-strong: #C5D0CD;
  --text: #1C2B29;
  --muted: #5D706C;
  --gum: #C9566C;          /* rosa gingival: acento de marca */
  --gum-soft: #F8E6EA;
  --alert: #B42B2B;
  --alert-soft: #FBE9E7;
  --warn: #B7740F;
  --warn-soft: #FDF1DC;
  --ok: #2B7A4B;
  --ok-soft: #E3F2E8;

  /* Estados del odontograma (convención clínica) */
  --st-planificado: #C8372D;
  --st-en_proceso: #D9921A;
  --st-finalizado: #2459C4;
  --st-preexistente: #64708A;

  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 7px;
  --sidebar-w: 248px;
  --shadow-card: 0 1px 0 rgba(18, 48, 45, .04), 0 1px 3px rgba(18, 48, 45, .06);

  /* Bootstrap */
  --bs-body-font-family: "Atkinson Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-color: var(--text);
  --bs-body-bg: var(--enamel);
  --bs-border-color: var(--line);
  --bs-primary: var(--scrub);
  --bs-primary-rgb: 29, 107, 99;
  --bs-link-color: var(--scrub);
  --bs-link-color-rgb: 29, 107, 99;
  --bs-link-hover-color: var(--scrub-hover);
  --bs-secondary-color: var(--muted);
  --bs-focus-ring-color: rgba(29, 107, 99, .28);
}

html { font-size: 15px; }
body { font-feature-settings: "tnum" 0; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 700; letter-spacing: -0.012em; }
h1 { font-size: 1.75rem; line-height: 1.2; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
.num, .table td.num, .tabular { font-variant-numeric: tabular-nums; }
.text-muted, .muted { color: var(--muted) !important; }
a { text-underline-offset: 2px; }

:focus-visible { outline: 3px solid rgba(29, 107, 99, .45); outline-offset: 2px; }

/* --- Botones ------------------------------------------------------- */
.btn { --bs-btn-font-weight: 600; --bs-btn-border-radius: var(--radius-sm); --bs-btn-padding-y: .5rem; --bs-btn-padding-x: 1rem; }
.btn-primary {
  --bs-btn-bg: var(--scrub); --bs-btn-border-color: var(--scrub);
  --bs-btn-hover-bg: var(--scrub-hover); --bs-btn-hover-border-color: var(--scrub-hover);
  --bs-btn-active-bg: var(--ink-2); --bs-btn-active-border-color: var(--ink-2);
  --bs-btn-disabled-bg: var(--scrub); --bs-btn-disabled-border-color: var(--scrub);
}
.btn-outline-primary {
  --bs-btn-color: var(--scrub); --bs-btn-border-color: var(--line-strong);
  --bs-btn-hover-bg: var(--scrub-soft); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--scrub);
  --bs-btn-active-bg: var(--scrub-soft); --bs-btn-active-color: var(--ink); --bs-btn-active-border-color: var(--scrub);
}
.btn-quiet { --bs-btn-color: var(--muted); --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--scrub-soft); }

.form-control, .form-select { border-color: var(--line-strong); border-radius: var(--radius-sm); padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--scrub); box-shadow: 0 0 0 .2rem rgba(29, 107, 99, .18); }
.form-label { font-weight: 600; font-size: .9rem; color: var(--ink); margin-bottom: .3rem; }
.form-text { color: var(--muted); }

/* =====================================================================
   Estructura: menú lateral + contenido
   ===================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--ink); color: #D6E3E0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: 1.35rem 1.25rem 1.1rem; color: #fff; text-decoration: none; }
.sidebar .brand svg { width: 30px; height: 30px; flex-shrink: 0; }
.sidebar .brand-name { font-size: 1.22rem; font-weight: 700; letter-spacing: -0.01em; }
.sidebar .brand-name span { color: #F2B6C2; }
.sidebar .clinic { font-size: .78rem; color: #8FAAA5; display: block; font-weight: 400; margin-top: -2px; }

.nav-scroll { flex: 1; overflow-y: auto; padding: .4rem .75rem 1rem; }
.nav-group { margin-top: 1.1rem; }
.nav-group-label { font-size: .78rem; color: #7E9C97; padding: 0 .65rem .35rem; }
.side-link {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: var(--radius-sm);
  color: #D6E3E0; text-decoration: none; font-weight: 500; position: relative;
}
.side-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; color: #9DB8B3; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.active { background: rgba(255, 255, 255, .09); color: #fff; }
.side-link.active i { color: #F2B6C2; }
.side-link.active::before {
  content: ""; position: absolute; left: -.75rem; top: .45rem; bottom: .45rem; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--gum);
}
.side-link .soon { margin-left: auto; font-size: .7rem; color: #7E9C97; border: 1px solid #355651; border-radius: 99px; padding: 0 .45rem; }

.sidebar-user { border-top: 1px solid rgba(255, 255, 255, .08); padding: .9rem 1rem; display: flex; align-items: center; gap: .65rem; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0;
  font-weight: 700; font-size: .82rem; color: #fff; background: var(--scrub);
}
.sidebar-user .who { line-height: 1.2; min-width: 0; }
.sidebar-user .who strong { display: block; color: #fff; font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .who small { color: #8FAAA5; }
.sidebar-user .btn-icon { margin-left: auto; color: #9DB8B3; border: 0; background: none; padding: .35rem; border-radius: 6px; }
.sidebar-user .btn-icon:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 1rem; padding: .8rem 2rem; background: rgba(244, 246, 245, .92);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar .menu-toggle { display: none; }
.quick-search { position: relative; flex: 1; max-width: 460px; }
.quick-search i.bi-search { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.quick-search input { padding-left: 2.3rem; background: var(--surface); }
.quick-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 10px 30px rgba(18, 48, 45, .12); overflow: hidden; display: none; z-index: 30;
}
.quick-results.show { display: block; }
.quick-results a { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem .9rem; text-decoration: none; color: var(--text); }
.quick-results a:hover, .quick-results a.focus { background: var(--scrub-soft); }
.quick-results small { color: var(--muted); }
.quick-results .empty { padding: .7rem .9rem; color: var(--muted); }
.topbar .today { margin-left: auto; color: var(--muted); font-size: .9rem; white-space: nowrap; }

.content { padding: 1.75rem 2rem 3rem; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin: .25rem 0 0; }

/* --- Tarjetas ------------------------------------------------------ */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem .25rem; }
.panel-head h2 { margin: 0; font-size: 1.02rem; }
.panel-head a { font-size: .88rem; font-weight: 600; text-decoration: none; }
.panel-body { padding: .75rem 1.25rem 1.25rem; }

/* Indicadores */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem 1.15rem 1.05rem; box-shadow: var(--shadow-card); }
.kpi .label { color: var(--muted); font-size: .88rem; font-weight: 500; display: flex; align-items: center; gap: .4rem; }
.kpi .label i { color: var(--scrub); }
.kpi .value { font-size: 1.85rem; font-weight: 700; color: var(--ink); line-height: 1.15; margin-top: .35rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi .foot { font-size: .84rem; color: var(--muted); margin-top: .2rem; }
.kpi .up { color: var(--ok); font-weight: 600; }
.kpi .down { color: var(--alert); font-weight: 600; }
.kpi.lead { background: var(--ink); border-color: var(--ink); }
.kpi.lead .label, .kpi.lead .foot { color: #A9C2BD; }
.kpi.lead .label i { color: #F2B6C2; }
.kpi.lead .value { color: #fff; }

/* =====================================================================
   Jornada de hoy (línea de tiempo por dentista)
   ===================================================================== */
.jornada { padding: 1.1rem 1.25rem 1.2rem; margin-bottom: 1.25rem; }
.jornada-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.jornada-top h2 { margin: 0; font-size: 1.05rem; }
.jornada-top .resumen { color: var(--muted); font-size: .9rem; }
.jornada-grid { --name-w: 150px; position: relative; display: grid; grid-template-columns: var(--name-w) 1fr; row-gap: .5rem; }
.now-wrap { position: absolute; left: var(--name-w); right: 0; top: 0; bottom: 0; pointer-events: none; }
.jornada-hours { grid-column: 2; position: relative; height: 20px; font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.jornada-hours span { position: absolute; transform: translateX(-50%); }
.jornada-name { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--ink); font-size: .9rem; padding-right: .75rem; min-width: 0; }
.jornada-name .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.jornada-name span.n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jornada-track {
  position: relative; height: 46px; border-radius: 8px; background-color: #F7F9F8;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: var(--hour-w) 100%; border: 1px solid var(--line);
}
.slot {
  position: absolute; top: 4px; bottom: 4px; border-radius: 6px; padding: 3px 7px; font-size: .76rem; line-height: 1.25;
  color: #fff; overflow: hidden; text-decoration: none; white-space: nowrap; min-width: 6px;
  background: var(--c, var(--scrub)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.slot strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.slot small { opacity: .85; font-variant-numeric: tabular-nums; }
.slot:hover { color: #fff; filter: brightness(1.08); }
.slot.st-atendida { opacity: .55; }
.slot.st-no_asistio { background: repeating-linear-gradient(-45deg, #e7ecea, #e7ecea 5px, #f3f6f5 5px, #f3f6f5 10px); color: var(--muted); }
.slot.st-en_sala { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c, var(--scrub)); }
.slot.bloqueo { background: repeating-linear-gradient(-45deg, #DCE3E1, #DCE3E1 5px, #EEF2F1 5px, #EEF2F1 10px); color: var(--muted); }
.now-line { position: absolute; top: 18px; bottom: -4px; width: 2px; background: var(--gum); z-index: 3; pointer-events: none; }
.now-line::before { content: attr(data-label); position: absolute; top: -18px; left: 50%; transform: translateX(-50%); background: var(--gum); color: #fff; font-size: .7rem; font-weight: 700; padding: 0 .35rem; border-radius: 4px; font-variant-numeric: tabular-nums; }
.jornada-empty { grid-column: 1 / -1; color: var(--muted); padding: .6rem 0 .2rem; }

/* Listas compactas */
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain > li { display: flex; gap: .8rem; align-items: flex-start; padding: .7rem 0; border-top: 1px solid var(--line); }
.list-plain > li:first-child { border-top: 0; padding-top: .2rem; }
.time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); min-width: 3rem; }
.who-line { font-weight: 600; color: var(--text); text-decoration: none; }
.who-line:hover { color: var(--scrub); }
.meta { font-size: .84rem; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; font-weight: 600; padding: .12rem .55rem; border-radius: 99px; background: var(--scrub-soft); color: var(--ink); white-space: nowrap; }
.pill.alert { background: var(--alert-soft); color: var(--alert); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.gum { background: var(--gum-soft); color: #9A3248; }
.pill.ghost { background: #EEF2F1; color: var(--muted); }

/* Gráficas SVG */
.bars-svg { width: 100%; height: auto; display: block; }
.bars-svg .bar { fill: #BFD8D2; }
.bars-svg .bar.current { fill: var(--scrub); }
.bars-svg .lbl { font-size: 12px; fill: var(--muted); }
.bars-svg .val { font-size: 12px; fill: var(--ink); font-weight: 700; }
.bars-svg .grid { stroke: var(--line); stroke-dasharray: 2 4; }
.hbar { display: grid; grid-template-columns: 110px 1fr 2.5rem; align-items: center; gap: .6rem; margin: .45rem 0; font-size: .88rem; }
.hbar .track { height: 10px; background: #EEF3F1; border-radius: 99px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--scrub); border-radius: 99px; }
.hbar .n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.empty-state { color: var(--muted); padding: .5rem 0; }
.empty-state a { font-weight: 600; }

/* Tablas */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: #F3F7F6; margin: 0; }
.table > :not(caption) > * > * { padding: .7rem .9rem; border-bottom-color: var(--line); }
.table thead th { font-size: .82rem; color: var(--muted); font-weight: 600; background: #F8FAF9; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* Alertas flash */
.flash { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1.2rem; border: 1px solid; }
.flash i { font-size: 1.1rem; margin-top: 1px; }
.flash.success { background: var(--ok-soft); border-color: #BFE0CB; color: #1E5A37; }
.flash.error { background: var(--alert-soft); border-color: #F1C6C1; color: #8E1F1F; }
.flash.info { background: var(--scrub-soft); border-color: #C3DCD6; color: var(--ink); }
.flash .btn-close { margin-left: auto; font-size: .7rem; }

/* =====================================================================
   Pantallas de acceso
   ===================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-art { background: var(--ink); color: #CFE0DC; padding: 3rem 3.25rem; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-art .brand { display: flex; align-items: center; gap: .65rem; color: #fff; font-size: 1.3rem; font-weight: 700; }
.auth-art .brand svg { width: 34px; height: 34px; }
.auth-art .brand span { color: #F2B6C2; }
.auth-art .arcada { flex: 1; display: grid; place-items: center; padding: 2rem 0; }
.auth-art .arcada svg { width: min(100%, 460px); height: auto; }
.auth-art blockquote { font-size: 1.35rem; line-height: 1.4; color: #fff; max-width: 26ch; margin: 0; font-weight: 500; letter-spacing: -0.01em; }
.auth-art .foot { margin-top: 1.25rem; font-size: .85rem; color: #8FAAA5; }
.auth-form { display: grid; place-items: center; padding: 2.5rem 1.5rem; }
.auth-card { width: 100%; max-width: 390px; }
.auth-card h1 { font-size: 1.65rem; margin-bottom: .35rem; }
.auth-card .lead-text { color: var(--muted); margin-bottom: 1.75rem; }
.auth-card .form-control { padding: .7rem .9rem; font-size: 1rem; }
.auth-card .btn-primary { padding: .72rem 1rem; font-size: 1rem; width: 100%; }
.pass-wrap { position: relative; }
.pass-wrap .toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: .35rem .5rem; border-radius: 6px; }
.pass-wrap .toggle:hover { color: var(--ink); background: var(--scrub-soft); }
.secure-note { display: flex; gap: .5rem; align-items: flex-start; font-size: .84rem; color: var(--muted); margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }

/* =====================================================================
   Ficha del paciente
   ===================================================================== */
.patient-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; }
.patient-head .avatar { width: 52px; height: 52px; font-size: 1.05rem; background: var(--gum); }
.patient-head h1 { margin: 0; font-size: 1.55rem; }
.patient-head .meta { font-size: .9rem; }
.patient-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: .5rem 0 1.4rem; overflow-x: auto; }
.patient-tabs a { padding: .6rem .9rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.patient-tabs a:hover { color: var(--ink); }
.patient-tabs a.active { color: var(--ink); border-bottom-color: var(--gum); }
.patient-tabs a.disabled { pointer-events: none; opacity: .55; }
.medical-alert { display: flex; gap: .6rem; align-items: center; background: var(--alert-soft); color: #8E1F1F; border: 1px solid #F1C6C1; border-radius: var(--radius); padding: .6rem .9rem; font-weight: 600; margin-bottom: 1rem; }
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.5rem; margin: 0; }
.dl-grid dt { font-size: .8rem; color: var(--muted); font-weight: 500; }
.dl-grid dd { margin: .1rem 0 0; font-weight: 500; }

.form-section { padding: 1.25rem; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section h2 { font-size: 1rem; margin-bottom: 1rem; }

/* =====================================================================
   Odontograma
   ===================================================================== */
.odo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.odo-toolbar { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; padding: .9rem 1.25rem; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; background: #EEF2F1; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: .32rem .75rem; border-radius: 7px; font-weight: 600; color: var(--muted); font-size: .88rem; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.odo-stats { display: flex; gap: 1rem; margin-left: auto; font-size: .86rem; color: var(--muted); flex-wrap: wrap; }
.odo-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }

.odo-canvas { padding: 1rem .75rem 1.25rem; overflow-x: auto; }
.odo-svg { width: 100%; min-width: 720px; height: auto; display: block; user-select: none; }
.odo-svg .arch-label { font-size: 11px; fill: var(--muted); }
.odo-svg .midline { stroke: var(--line-strong); stroke-dasharray: 3 4; }
.odo-svg .tooth { cursor: pointer; }
.odo-svg .tooth .root { fill: #FBFCFC; stroke: #B6C3C0; stroke-width: 1; }
.odo-svg .tooth .face { fill: #fff; stroke: #93A5A1; stroke-width: 1; transition: fill .12s; }
.odo-svg .tooth .face:hover { fill: #E2EEEB; }
.odo-svg .tooth .face:focus { outline: none; stroke: var(--scrub); stroke-width: 2.4; }
.odo-svg .tooth .face.sel { fill: #CDE4DE; stroke: var(--scrub); stroke-width: 2; }
.odo-svg .tooth .num { font-size: 12px; font-weight: 700; fill: var(--ink); text-anchor: middle; font-variant-numeric: tabular-nums; }
.odo-svg .tooth .num-hit { fill: transparent; }
.odo-svg .tooth.selected .num-bg { fill: var(--ink); }
.odo-svg .tooth.selected .num { fill: #fff; }
.odo-svg .tooth .num-bg { fill: transparent; }
.odo-svg .tooth.absent .face, .odo-svg .tooth.absent .root { opacity: .35; }
.odo-svg .tooth .badge-txt { font-size: 8.5px; font-weight: 700; text-anchor: middle; }
.odo-svg .tooth .face.st-planificado { fill: var(--st-planificado); }
.odo-svg .tooth .face.st-en_proceso { fill: var(--st-en_proceso); }
.odo-svg .tooth .face.st-finalizado { fill: var(--st-finalizado); }
.odo-svg .tooth .face.st-preexistente { fill: url(#hatch-pre); }
.odo-svg .tooth .face.sel.st-planificado, .odo-svg .tooth .face.sel.st-en_proceso,
.odo-svg .tooth .face.sel.st-finalizado, .odo-svg .tooth .face.sel.st-preexistente { stroke: var(--ink); stroke-width: 2.6; }

.odo-side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; overscroll-behavior: contain; border-radius: var(--radius-lg); scrollbar-width: thin; }
.odo-side .panel + .panel { margin-top: 1rem; }
.sel-title { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin: 0; }
.sel-sub { color: var(--muted); font-size: .86rem; }
.cond-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.cond-btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: .32rem .5rem; text-align: left; font-size: .85rem; font-weight: 500; color: var(--text); display: flex; gap: .45rem; align-items: center; line-height: 1.2; }
.cond-btn .code { font-size: .7rem; font-weight: 700; color: var(--muted); min-width: 1.9rem; }
.cond-btn:hover:not(:disabled) { border-color: var(--scrub); background: var(--scrub-soft); }
.cond-btn[aria-pressed="true"] { border-color: var(--scrub); background: var(--scrub); color: #fff; }
.cond-btn[aria-pressed="true"] .code { color: #CFE5E0; }
.cond-btn[aria-pressed="true"]:hover:not(:disabled) { background: var(--scrub-hover); border-color: var(--scrub-hover); color: #fff; }
.cond-btn:disabled { opacity: .4; cursor: not-allowed; }
.cond-section-label { font-size: .8rem; color: var(--muted); margin: .9rem 0 .4rem; font-weight: 600; }
.estado-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.estado-pick label { display: flex; align-items: center; gap: .45rem; border: 1px solid var(--line-strong); border-radius: 8px; padding: .4rem .55rem; font-size: .85rem; cursor: pointer; font-weight: 500; }
.estado-pick input { accent-color: var(--scrub); }
.estado-pick label:has(input:checked) { border-color: var(--ink); background: #F3F7F6; }

.reg-list { list-style: none; margin: 0; padding: 0; }
.reg-list li { border-top: 1px solid var(--line); padding: .7rem 0; }
.reg-list li:first-child { border-top: 0; }
.reg-list .top { display: flex; align-items: center; gap: .5rem; }
.reg-list .top strong { font-size: .92rem; }
.reg-list .top .caras { font-size: .78rem; color: var(--muted); font-weight: 700; }
.reg-list .actions { display: flex; gap: .4rem; margin-top: .45rem; align-items: center; }
.reg-list .actions .form-select { padding: .25rem 2rem .25rem .55rem; font-size: .82rem; width: auto; }
.reg-list .meta { margin-top: .25rem; }
.st-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 700; padding: .1rem .5rem; border-radius: 99px; color: #fff; }
.st-chip.planificado { background: var(--st-planificado); }
.st-chip.en_proceso { background: var(--st-en_proceso); }
.st-chip.finalizado { background: var(--st-finalizado); }
.st-chip.preexistente { background: var(--st-preexistente); }
.odo-hint { font-size: .86rem; color: var(--muted); }
.kbd { font-size: .78rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 .3rem; background: #fff; }

.odo-table td .st-chip { font-size: .72rem; }

/* Bitácora */
.diff { font-size: .82rem; margin-top: .4rem; }
.diff table { width: 100%; border-collapse: collapse; }
.diff td, .diff th { padding: .3rem .5rem; border: 1px solid var(--line); vertical-align: top; word-break: break-word; }
.diff th { background: #F8FAF9; font-weight: 600; color: var(--muted); }
.diff .old { color: #8E1F1F; background: #FDF3F2; }
.diff .new { color: #1E5A37; background: #F1F8F3; }
.chain-ok { border-color: #BFE0CB; }

/* Módulos en construcción */
.soon-panel { max-width: 760px; }
.soon-panel code { background: #EEF2F1; color: var(--ink); padding: .1rem .4rem; border-radius: 4px; font-size: .85rem; }

/* Selector de color de agenda */
.color-swatch { display: block; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.color-pick:checked + .color-swatch { box-shadow: 0 0 0 2px var(--ink); }
.color-pick:focus-visible + .color-swatch { outline: 3px solid rgba(29, 107, 99, .45); outline-offset: 2px; }

/* Toast de guardado */
.toast-lite {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translate(-50%, 20px); opacity: 0; z-index: 1100;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 9px; font-weight: 600; font-size: .9rem;
  transition: opacity .18s, transform .18s; pointer-events: none; box-shadow: 0 8px 24px rgba(18, 48, 45, .25);
}
.toast-lite.show { opacity: 1; transform: translate(-50%, 0); }
.toast-lite.error { background: var(--alert); }

/* =====================================================================
   Responsivo
   ===================================================================== */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .odo-layout { grid-template-columns: 1fr; }
  .odo-side { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 1045; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(18, 48, 45, .4); }
  .topbar { padding: .7rem 1rem; }
  .topbar .menu-toggle { display: inline-flex; }
  .topbar .today { display: none; }
  .content { padding: 1.25rem 1rem 2.5rem; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 1.5rem; }
  .auth-art .arcada, .auth-art blockquote, .auth-art .foot { display: none; }
  .jornada-grid { --name-w: 96px; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .value { font-size: 1.5rem; }
  .dl-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.45rem; }
  .jornada-scroll { overflow-x: auto; }
  .jornada-grid { min-width: 620px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* =====================================================================
   Historia clínica
   ===================================================================== */
.hc-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.hc-index { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; display: flex; flex-direction: column; gap: 1px; font-size: .86rem; padding-right: .25rem; }
.hc-index a { color: var(--muted); text-decoration: none; padding: .32rem .6rem; border-radius: 6px; border-left: 2px solid transparent; }
.hc-index a:hover { color: var(--ink); background: var(--scrub-soft); }
.hc-index a.active { color: var(--ink); font-weight: 600; border-left-color: var(--gum); background: var(--surface); }
.hc-section { scroll-margin-top: 84px; }
.ant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem; }
.ant-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .65rem; background: #FBFCFC; }
.ant-item.on { border-color: #E8B4AE; background: var(--alert-soft); }
.ant-item label { cursor: pointer; font-weight: 500; }
.chip-check { display: inline-flex; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { border: 1px solid var(--line-strong); border-radius: 99px; padding: .3rem .8rem; font-size: .88rem; font-weight: 500; background: var(--surface); }
.chip-check input:checked + span { background: var(--scrub); border-color: var(--scrub); color: #fff; }
.chip-check input:focus-visible + span { outline: 3px solid rgba(29, 107, 99, .45); outline-offset: 2px; }
.seg-opt { margin: 0; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: inline-block; padding: .32rem .75rem; border-radius: 7px; font-weight: 600; color: var(--muted); font-size: .88rem; }
.seg-opt input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg-opt input:focus-visible + span { outline: 3px solid rgba(29, 107, 99, .45); }
.anest { border-top: 1px dashed var(--line-strong); padding-top: 1rem; }
.save-bar { position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: rgba(244, 246, 245, .95); backdrop-filter: blur(4px); border-top: 1px solid var(--line); padding: .8rem 0; margin-top: .5rem; }
.hc-alertas { border-color: #F1C6C1; }

/* Evolución */
.soap { display: grid; grid-template-columns: 150px 1fr; gap: .75rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.soap:first-child { border-top: 0; }
.soap-k { font-weight: 700; color: var(--ink); font-size: .88rem; }
.adenda { margin-top: .75rem; padding: .6rem .8rem; border-left: 3px solid var(--gum); background: var(--gum-soft); border-radius: 0 6px 6px 0; font-size: .92rem; }
.nota { scroll-margin-top: 90px; }

/* =====================================================================
   Periodontograma
   ===================================================================== */
.perio-toolbar { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.perio-stats { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; }
.perio-stats > div { padding: .7rem 1rem; border-right: 1px solid var(--line); }
.perio-stats > div:last-child { border-right: 0; }
.perio-stats span { display: block; font-size: .78rem; color: var(--muted); }
.perio-stats b { font-size: 1.25rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.perio-stats .bad b { color: var(--alert); }
.perio-help { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; padding: .7rem 1rem; font-size: .84rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.perio-scroll { overflow-x: auto; padding: .5rem .75rem 1rem; }
.perio-chart { min-width: 1080px; }
.pr-arch { margin-bottom: 1.5rem; }
.pr-block { margin: .2rem 0; }
.pr-title { font-size: .8rem; font-weight: 700; color: var(--ink); padding: .35rem 0 .15rem 0; }
.pr-row { display: grid; grid-template-columns: 104px repeat(16, minmax(0, 1fr)); align-items: center; }
.pr-lab { font-size: .74rem; color: var(--muted); padding-right: .4rem; text-align: right; }
.pr-tooth { display: flex; justify-content: space-around; align-items: center; gap: 1px; padding: 1px 2px; border-left: 1px solid var(--line); min-height: 22px; }
.pr-tooth:nth-child(10) { border-left: 2px solid var(--line-strong); }
.pr-tooth.is-aus { background: repeating-linear-gradient(-45deg, #F3F5F4, #F3F5F4 4px, #fff 4px, #fff 8px); }
.pr-in { width: 100%; min-width: 0; border: 1px solid transparent; background: #F6F8F7; border-radius: 4px; text-align: center; font-size: .82rem;
  font-variant-numeric: tabular-nums; padding: 1px 0; color: var(--ink); font-weight: 600; }
.pr-in:focus { outline: none; border-color: var(--scrub); background: #fff; box-shadow: 0 0 0 2px rgba(29, 107, 99, .2); }
.pr-in.d4 { background: #FCEBD0; color: #8A5300; }
.pr-in.d6 { background: #F8D3D0; color: #8E1F1F; }
.pr-in.sup { box-shadow: inset 0 -3px 0 #D9B300; }
.pr-val { font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; flex: 1; text-align: center; }
.pr-val.d4 { color: #A26200; } .pr-val.d6 { color: var(--alert); }
.pr-nic { flex: 1; text-align: center; font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pr-sel { width: 100%; border: 1px solid var(--line); border-radius: 4px; font-size: .78rem; padding: 0 2px; background: #fff; text-align: center; }
.pr-dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #C5D0CD; background: #fff; padding: 0; }
.pr-dot.pl { border-radius: 3px; }
.pr-dot.bop.on { background: #D8342C; border-color: #D8342C; }
.pr-dot.pl.on { background: #3B4A57; border-color: #3B4A57; }
.pr-dot:disabled { opacity: .35; }
.pr-num { width: 100%; border: 0; background: transparent; font-weight: 700; color: var(--ink); font-size: .88rem; padding: 3px 0; border-radius: 5px; font-variant-numeric: tabular-nums; }
.pr-num:hover:not(:disabled) { background: var(--scrub-soft); }
.pr-num.aus { color: #9AA8A5; text-decoration: line-through; }
.pr-num.imp { background: #E6ECF8; color: #2459C4; }
.pr-head { margin: .2rem 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.pr-ch .pr-tooth { padding: 0; }
.pch { width: 100%; height: 64px; display: block; }
.pch .grid { stroke: #EEF2F1; stroke-width: 1; }
.pch .cej { stroke: #9AA8A5; stroke-width: 1; stroke-dasharray: 3 3; }
.pch .raiz { fill: #FBFAF6; stroke: #D9D3C3; stroke-width: 1; }
.pch .raiz.imp { fill: #E6ECF8; stroke: #8DA6D8; stroke-dasharray: 2 2; }
.pch .mg { fill: none; stroke: #2459C4; stroke-width: 2; stroke-linejoin: round; }
.pch .fondo { fill: none; stroke: #D8342C; stroke-width: 2; stroke-linejoin: round; }
.pch .fondo-pt { fill: #D8342C; }
.pch .prev { fill: none; stroke: #8A9894; stroke-width: 1.4; stroke-dasharray: 2 2; }
.pch .bolsa4 { fill: rgba(217, 146, 26, .22); }
.pch .bolsa6 { fill: rgba(216, 52, 44, .25); }
.pch .imp-txt { font-size: 9px; font-weight: 700; fill: #2459C4; text-anchor: middle; }
.pch.aus path { stroke: #B9C4C1; stroke-width: 2; }

/* =====================================================================
   Documentos imprimibles
   ===================================================================== */
.print-body { background: #E9EDEC; }
.print-toolbar { max-width: 210mm; margin: 1rem auto 0; display: flex; gap: 1rem; align-items: center; }
.doc { max-width: 210mm; margin: 1rem auto 2rem; background: #fff; padding: 16mm 16mm 14mm; box-shadow: 0 2px 12px rgba(18, 48, 45, .12); color: #1a1a1a; font-size: 10.5pt; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: .6rem; margin-bottom: 1rem; }
.doc-clinic { font-size: 15pt; font-weight: 700; color: var(--ink); }
.doc-meta { font-size: 9pt; color: #555; }
.doc-logo svg { width: 38px; height: 38px; }
.doc-logo svg path { stroke: var(--gum); }
.doc-title { font-size: 14pt; text-align: center; margin: 0 0 .8rem; letter-spacing: .01em; }
.doc-sec { margin-top: .9rem; break-inside: avoid-page; }
.doc-sec h2 { font-size: 10.5pt; font-weight: 700; border-bottom: 1px solid #ccc; padding-bottom: 2px; margin-bottom: .4rem; color: var(--ink); }
.doc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem 1rem; margin: 0; }
.doc-grid > div.wide { grid-column: 1 / -1; }
.doc-grid dt { font-size: 8pt; color: #666; font-weight: 500; }
.doc-grid dd { margin: 0; font-size: 10pt; }
.doc-alert { color: #9b1c1c; font-weight: 700; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 9pt; margin-top: .3rem; }
.doc-table th, .doc-table td { border: 1px solid #ccc; padding: 3px 6px; text-align: left; }
.doc-table th { background: #f2f4f3; }
.doc-table td.num, .doc-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.doc-firmas { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 3rem; font-size: 9pt; text-align: center; color: #444; }
.doc-firmas span { display: block; border-top: 1px solid #333; padding-top: .3rem; margin-bottom: .1rem; color: #111; font-size: 10pt; min-height: 1.4em; }
.doc-foot { font-size: 8pt; color: #888; margin-top: 1.2rem; text-align: right; }
.doc-text { white-space: pre-line; line-height: 1.6; font-size: 11pt; }
.doc .perio-chart { min-width: 0; }
.doc .perio-stats { grid-template-columns: repeat(7, 1fr); border: 1px solid #ddd; margin: .5rem 0; }
.doc .perio-stats b { font-size: 11pt; }
.doc .pch { height: 46px; }
.doc .pr-row { grid-template-columns: 70px repeat(16, minmax(0, 1fr)); }
.doc .pr-lab { font-size: 6.5pt; }
.doc .pr-val, .doc .pr-nic { font-size: 7pt; }
.doc .pr-title { font-size: 7.5pt; padding: .1rem 0; }
.doc .pr-num { font-size: 7.5pt; padding: 0; }
.doc .pr-dot { width: 8px; height: 8px; }
.doc .pr-tooth { min-height: 14px; }
.doc .pr-arch { margin-bottom: .6rem; }

@media print {
  @page { size: letter; margin: 10mm; }
  .no-print, .print-toolbar { display: none !important; }
  .print-body { background: #fff; }
  .doc { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .pr-dot.bop.on, .pr-dot.pl.on, .pr-in.d4, .pr-in.d6, .pch * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 991.98px) {
  .hc-layout { grid-template-columns: 1fr; }
  .hc-index { position: static; flex-direction: row; flex-wrap: wrap; max-height: none; }
  .perio-stats { grid-template-columns: repeat(3, 1fr); }
  .soap { grid-template-columns: 1fr; gap: .1rem; }
}
.pr-dot:disabled { opacity: 1; cursor: default; }
.is-aus .pr-dot { opacity: .25; }

/* =====================================================================
   Agenda
   ===================================================================== */
.ag-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-bottom: .75rem; }
.ag-title { font-size: 1.35rem; margin: 0 .5rem; min-width: 14ch; }
.ag-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .84rem; color: var(--muted); margin-bottom: .6rem; }
.ag-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .35rem; vertical-align: -1px; }
.ag-panel { overflow: hidden; }
.ag-body { max-height: calc(100vh - 230px); overflow: auto; position: relative; }
.ag-grid { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(130px, 1fr)); }
.ag-corner, .ag-colhead { position: sticky; top: 0; z-index: 4; background: #F8FAF9; border-bottom: 1px solid var(--line); }
.ag-colhead { padding: .55rem .5rem; text-align: center; font-weight: 600; color: var(--ink); border-left: 1px solid var(--line); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-colhead span { display: block; font-size: .76rem; color: var(--muted); font-weight: 500; }
.ag-colhead b { font-size: 1.15rem; }
.ag-colhead.hoy b { background: var(--gum); color: #fff; border-radius: 99px; padding: 0 .45rem; }
.ag-colhead .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .35rem; }
.ag-times { position: relative; border-right: 1px solid var(--line); }
.ag-times span { position: absolute; right: 6px; transform: translateY(-50%); font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ag-times span:first-child { transform: none; }
.ag-col { position: relative; border-left: 1px solid var(--line); cursor: copy;
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px), linear-gradient(to bottom, #F1F4F3 1px, transparent 1px);
  background-size: 100% calc(var(--slot) * 4), 100% calc(var(--slot) * 2); }
.ag-col.hoy { background-color: #FBFDFC; }
.ag-col.drop { background-color: var(--scrub-soft); }
#agenda[data-edit="0"] .ag-col { cursor: default; }
.ag-ev { position: absolute; border: 0; text-align: left; padding: 2px 6px; border-radius: 6px; overflow: hidden; font-size: .76rem; line-height: 1.25;
  color: var(--ink); background: color-mix(in srgb, var(--c) 16%, #fff); border-left: 3px solid var(--c); cursor: pointer; z-index: 2; }
.ag-ev:hover { background: color-mix(in srgb, var(--c) 26%, #fff); z-index: 3; }
.ag-ev .t { display: block; font-weight: 700; font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--c) 70%, #000); }
.ag-ev .n { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ev .m { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ev .al { color: var(--alert); }
.ag-ev.bloqueo { background: repeating-linear-gradient(-45deg, #E4E9E7, #E4E9E7 5px, #F2F5F4 5px, #F2F5F4 10px); border-left-color: #9AA8A5; color: var(--muted); }
.ag-ev.st-atendida { opacity: .6; }
.ag-ev.st-cancelada, .ag-ev.st-no_asistio { opacity: .5; text-decoration: line-through; background: #F3F5F4; z-index: 1; }
.ag-ev.st-en_sala { box-shadow: 0 0 0 2px var(--c); }
.ag-ev.dragging { opacity: .4; }
.ag-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--gum); z-index: 5; pointer-events: none; }
.ag-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--gum); }
.ag-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ag-mhead { padding: .5rem; font-size: .8rem; color: var(--muted); font-weight: 600; text-align: center; border-bottom: 1px solid var(--line); background: #F8FAF9; }
.ag-day { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .3rem; display: flex; flex-direction: column; gap: 2px; }
.ag-day.fuera { background: #FAFBFB; }
.ag-day.fuera .ag-dnum { color: #A9B5B2; }
.ag-dnum { align-self: flex-start; border: 0; background: none; font-weight: 700; font-size: .85rem; color: var(--ink); border-radius: 99px; padding: 0 .4rem; }
.ag-dnum:hover { background: var(--scrub-soft); }
.ag-day.hoy .ag-dnum { background: var(--gum); color: #fff; }
.ag-mev { border: 0; text-align: left; font-size: .74rem; padding: 1px 5px; border-radius: 4px; background: color-mix(in srgb, var(--c) 16%, #fff); border-left: 3px solid var(--c);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.ag-more { border: 0; background: none; font-size: .74rem; color: var(--scrub); font-weight: 600; text-align: left; padding: 0 5px; }
.ag-info { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .75rem; }
.chip-state { border: 1px solid var(--line-strong); background: #fff; border-radius: 99px; padding: .25rem .75rem; font-size: .84rem; font-weight: 600; color: var(--text); }
.chip-state:hover { border-color: var(--scrub); }
.chip-state[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-state.st-cancelada:not([aria-pressed="true"]):hover, .chip-state.st-no_asistio:not([aria-pressed="true"]):hover { border-color: var(--alert); color: var(--alert); }
.modal-content { border-radius: var(--radius-lg); border: 0; }
.modal .quick-results { z-index: 1060; }
@media (max-width: 640px) { .ag-title { font-size: 1.1rem; width: 100%; order: -1; margin: 0; } .ag-day { min-height: 70px; } .ag-mev { display: none; } }

/* =====================================================================
   Presupuestos, estado de cuenta y caja
   ===================================================================== */
.tot-list { margin: 0; }
.tot-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-top: 1px solid var(--line); font-size: .92rem; }
.tot-list > div:first-child { border-top: 0; }
.tot-list dt { font-weight: 500; color: var(--muted); }
.tot-list dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.tot-list .big dt { color: var(--ink); font-weight: 700; }
.tot-list .big dd { font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.pres-table .fase-row td { background: #F3F7F6; border-top: 2px solid var(--line-strong); padding-top: .55rem; padding-bottom: .55rem; }
.table tr.anulado td { color: #9AA8A5; }
.table tr.anulado td:not(:last-child) { text-decoration: line-through; }
.anular { position: relative; }
.anular summary { list-style: none; }
.anular summary::-webkit-details-marker { display: none; }
.anular-pop { position: absolute; right: 0; top: 110%; z-index: 20; width: 240px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; box-shadow: 0 10px 30px rgba(18, 48, 45, .15); }
.cuotas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem; }
.cuota { border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; font-size: .84rem; display: flex; flex-direction: column; }
.cuota span { color: var(--muted); font-size: .78rem; }
.cuota b { font-variant-numeric: tabular-nums; }
.cuota small { font-size: .74rem; color: var(--muted); }
.cuota.pagada { background: var(--ok-soft); border-color: #BFE0CB; }
.cuota.pagada small { color: var(--ok); font-weight: 600; }
.cuota.parcial { background: var(--warn-soft); border-color: #F0D49B; }
.cuota.vencida { border-color: #F1C6C1; background: var(--alert-soft); }
.cuota.vencida small { color: var(--alert); font-weight: 700; }
.recibo-monto { margin: 1.2rem 0; padding: 1rem 1.2rem; border: 2px solid var(--ink); border-radius: 10px; }
.recibo-monto > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.recibo-monto span { color: #555; }
.recibo-monto strong { font-size: 22pt; font-variant-numeric: tabular-nums; color: var(--ink); }
.recibo-monto p { margin: .2rem 0 0; font-weight: 600; letter-spacing: .01em; font-size: 10pt; }

/* =====================================================================
   Documentos y laboratorio
   ===================================================================== */
.doc-grid-ui { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem; }
.doc-card { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.doc-thumb { aspect-ratio: 4 / 3; background: #1E2B29; display: grid; place-items: center; overflow: hidden; color: #fff; text-decoration: none; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-thumb i { font-size: 2.2rem; color: #F2B6C2; }
.doc-thumb span { font-size: .72rem; font-weight: 700; letter-spacing: .04em; margin-top: -1.2rem; color: #CFE0DC; }
.doc-card figcaption { padding: .5rem .6rem; display: flex; flex-direction: column; min-width: 0; }
.doc-card figcaption strong { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-card .meta { font-size: .76rem; }
.drop { display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center; border: 2px dashed var(--line-strong); border-radius: var(--radius);
  padding: 1.3rem 1rem; cursor: pointer; position: relative; background: #FAFBFB; }
.drop:hover, .drop.over { border-color: var(--scrub); background: var(--scrub-soft); }
.drop i { font-size: 1.8rem; color: var(--scrub); }
.drop span { font-weight: 600; color: var(--ink); word-break: break-all; }
.drop small { color: var(--muted); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
details.panel > summary { list-style: none; padding-bottom: 1rem; }
details.panel > summary::-webkit-details-marker { display: none; }
.seg a.btn { border: 0; border-radius: 7px; }
.hc-layout > * { min-width: 0; }
.pres-table { min-width: 940px; }
.pres-table td:nth-child(2) { min-width: 230px; }
.pres-table td:nth-child(2) input { min-width: 210px; }
@media (max-width: 991.98px) {
  .hc-index { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .4rem; gap: .25rem; }
  .hc-index a { white-space: nowrap; border: 1px solid var(--line); border-radius: 99px; border-left-width: 1px; background: var(--surface); }
}
