/* Hamilton Seguimiento · diseño 3.0 — producto moderno: neutro, aireado, un acento; azul y naranja Hamilton como detalle */

:root {
  --accent: #3355e6; --accent-2: #2643c9; --accent-soft: #eef2ff; --accent-ink: #1e3a8a;
  --brand-navy: #152250; --brand-orange: #ffa908; --orange-soft: #fff6e6;
  --bg: #f7f7f9; --surface: #ffffff; --surface-2: #fafafb; --hover: #f3f4f6;
  --text: #18181b; --text-2: #3f3f46; --muted: #71717a; --line: #e7e7eb; --line-2: #f0f0f3;
  --focus: #3355e6; --link: #2643c9;
  --ok: #15803d; --ok-bg: #ecfdf3; --ok-line: #bbf7d0; --warn: #a16207; --warn-bg: #fffbeb; --warn-line: #fde68a; --bad: #b91c1c; --bad-bg: #fef2f2; --bad-line: #fecaca;
  --c-activo: #16a34a; --c-riesgo: #d97706; --c-atascado: #7c3aed; --c-inactivo: #dc2626; --c-no_ingresa: #71717a; --c-completado: #2643c9; --c-sosp: #b45309;
  --s-vencido: #dc2626; --s-hoy: #d97706; --s-sin: #71717a; --s-prog: #3355e6; --s-comp: #16a34a;
  --radius: 12px; --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12), 0 2px 6px rgba(16, 24, 40, .06);
  --sidebar: 236px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #7c95ff; --accent-2: #9aadff; --accent-soft: #1c2340; --accent-ink: #c7d2fe;
    --orange-soft: #2e2410;
    --bg: #0e0f13; --surface: #16171c; --surface-2: #1b1c22; --hover: #22232a;
    --text: #ededf0; --text-2: #c9c9d1; --muted: #9a9aa6; --line: #2a2b33; --line-2: #222329;
    --focus: #7c95ff; --link: #9aadff;
    --ok: #4ade80; --ok-bg: #0f2a1a; --ok-line: #14532d; --warn: #fbbf24; --warn-bg: #2a2208; --warn-line: #713f12; --bad: #f87171; --bad-bg: #2d1212; --bad-line: #7f1d1d;
    --c-completado: #9aadff; --s-prog: #7c95ff;
    --shadow-sm: none; --shadow: 0 1px 2px rgba(0,0,0,.35); --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

/* Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.55 var(--font); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { color: var(--text); letter-spacing: -.015em; }
h1 { font-size: 1.55rem; font-weight: 700; margin: 0 0 1.1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
h2 { font-size: 1rem; font-weight: 650; margin: 0 0 .8rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
h3 { font-size: .92rem; font-weight: 650; margin: 0 0 .5rem; }
h1 small, h2 small, h3 small { color: var(--muted); font-weight: 450; font-size: .8rem; letter-spacing: 0; margin-left: .2rem; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .05rem .35rem; font-size: .85em; }
kbd { display: inline-grid; place-items: center; min-width: 1.35em; height: 1.35em; padding: 0 .3em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--muted); font: 600 .7rem/1 var(--font); }
.muted { color: var(--muted); } .small { font-size: .84rem; } .block { display: block; } .r { text-align: right; }
.sm { font-size: .95rem !important; }
.linkish { background: none; border: 0; padding: 0; color: var(--link); font: inherit; font-size: .82rem; cursor: pointer; }
.linkish:hover { text-decoration: underline; }

/* Estructura */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); padding: .9rem .7rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); padding: .25rem .45rem 1rem; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 9px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand b { font-weight: 750; font-size: .95rem; }
.brand em { font-style: normal; font-weight: 500; font-size: .76rem; color: var(--muted); }
.brand em::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-orange); margin-right: .35rem; vertical-align: 1px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-group { margin: 1rem .6rem .3rem; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.side-nav a { display: flex; align-items: center; gap: .65rem; padding: .48rem .6rem; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: .9rem; }
.side-nav a svg { width: 18px; height: 18px; color: var(--muted); }
.side-nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.side-nav a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.side-nav a.on svg { color: var(--accent); }
.side-user { display: flex; align-items: center; gap: .6rem; padding: .7rem .4rem .1rem; border-top: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-navy); color: #fff; font-weight: 700; font-size: .85rem; flex: none; }
.side-user .who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.side-user .who b { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who small { color: var(--muted); font-size: .75rem; }
.icon-btn { background: transparent; border: 0; color: var(--muted); padding: .4rem; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; padding: .65rem 2rem; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-search { position: relative; flex: 1; max-width: 560px; display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 .75rem; color: var(--muted); box-shadow: var(--shadow-sm); }
.top-search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 15%, transparent); }
.top-search input { flex: 1; border: 0; background: transparent; padding: .5rem 0; min-width: 0; color: var(--text); font: inherit; box-shadow: none !important; }
.top-search input:focus { outline: none; }
.top-search .sugerencias { top: calc(100% + 6px); }
.kbd-hint { flex: none; }
.page { width: 100%; max-width: 1400px; padding: 1.6rem 2rem 4rem; }
.guest-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(1200px 600px at 20% -10%, #e9edff 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #fff1d6 0%, transparent 55%), var(--bg); }

/* Encabezados */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.page-head h1 { margin: 0; }
.eyebrow { margin: 0 0 .15rem; color: var(--muted); font-size: .8rem; font-weight: 500; }
.pill { display: inline-flex; align-items: center; gap: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; font-size: .82rem; color: var(--muted); }
.pill b { color: var(--text); }
.section-title { margin: 2rem 0 .7rem; font-size: 1.05rem; scroll-margin-top: 80px; }
.crumbs { margin: 0 0 .2rem; font-size: .82rem; }
.crumbs a { color: var(--muted); }

/* Formularios */
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .65rem; width: 100%; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 15%, transparent); }
textarea { resize: vertical; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .84rem; font-weight: 550; color: var(--text-2); }
label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 450; }
label.check input, .checks input, input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
label.mini { font-size: .78rem; font-weight: 550; color: var(--muted); }
.inline-label { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; font-size: .84rem; color: var(--muted); }
.inline-label select { width: auto; padding: .35rem .5rem; }
.field-inline { flex-direction: row; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 500; color: var(--muted); }
.field-inline input { width: auto; padding: .38rem .5rem; }
.stack { display: flex; flex-direction: column; gap: .8rem; }
.row-inline { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.row-inline .grow, .row-inline input.grow { flex: 1; min-width: 200px; }
.row-form { display: flex; gap: .8rem; flex-wrap: wrap; align-items: flex-end; }
.row-form label { flex: 1 1 150px; }
.row-form.new { border-style: dashed; }
label.color input { padding: .2rem; height: 2.4rem; min-width: 64px; }
.checks { border: 1px solid var(--line); border-radius: var(--radius-sm); display: flex; gap: .5rem 1.2rem; flex-wrap: wrap; padding: .6rem .9rem; }
.checks legend { font-size: .8rem; font-weight: 600; color: var(--muted); padding: 0 .3rem; }
.checks label { flex-direction: row; align-items: center; gap: .45rem; font-weight: 450; }
input.tiny { width: 120px; padding: .28rem .45rem; font-size: .8rem; display: inline-block; }

/* Control segmentado (canal, tipo de contacto) */
.segmented { display: inline-flex; background: var(--hover); border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { flex-direction: row; padding: .3rem .7rem; border-radius: 7px; font-size: .8rem; font-weight: 550; color: var(--muted); cursor: pointer; white-space: nowrap; }
.segmented input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.segmented input:focus-visible + label { outline: 2px solid var(--focus); }
.segmented.wide { display: flex; }
.segmented.wide label { flex: 1; justify-content: center; text-align: center; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-weight: 600; font-size: .86rem; padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; white-space: nowrap; box-shadow: var(--shadow-sm); }
.btn:hover { text-decoration: none; background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.accent { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }
.btn.accent:hover { background: #1f2f6b; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); }
.btn.small { padding: .3rem .65rem; font-size: .8rem; border-radius: 7px; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok.soft { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.btn.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.btn.danger { color: var(--bad); }
.btn svg { width: 15px; height: 15px; }
.btn kbd { border-color: color-mix(in srgb, currentColor 30%, transparent); background: transparent; color: inherit; opacity: .75; }
.btn.primary kbd { border-color: rgba(255,255,255,.4); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0e0f13; } .btn.accent { background: #2a3f8f; border-color: #2a3f8f; } }

/* Botones de resultado */
.res { padding: .55rem .9rem; font-size: .86rem; }
.res kbd { margin-right: .1rem; }
.res-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.res-ok:hover { background: color-mix(in srgb, var(--ok) 88%, #000); }
.res-soft { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.res-soft:hover { background: color-mix(in srgb, var(--ok-bg) 70%, var(--ok-line)); }
.res-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.res-warn:hover { background: color-mix(in srgb, var(--warn-bg) 60%, var(--warn-line)); }
@media (prefers-color-scheme: dark) { .res-ok { color: #06240f; } }
details.mas { position: relative; display: inline-block; }
details.mas > summary { list-style: none; }
details.mas > summary::-webkit-details-marker { display: none; }
details.mas > summary span { margin-left: .2rem; font-size: .7rem; }
details.mas[open] > summary { background: var(--hover); }
.menu { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 25; min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: .3rem; display: flex; flex-direction: column; }
.menu-item { text-align: left; background: none; border: 0; padding: .5rem .65rem; border-radius: 7px; font: inherit; font-size: .86rem; color: var(--text); cursor: pointer; }
.menu-item:hover { background: var(--hover); }
.menu-item.danger { color: var(--bad); }
.menu-item small { color: var(--muted); }

/* Tarjetas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); margin-bottom: 1.1rem; }
.card.flush { padding: 0; overflow: hidden; }
.card.link { display: block; color: inherit; transition: border-color .15s, box-shadow .15s; }
.card.link:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow-lg); text-decoration: none; }
.card h3 { margin: 0 0 .3rem; display: flex; align-items: center; }
.big { font-size: 1.9rem; font-weight: 700; margin: .1rem 0; letter-spacing: -.02em; }
.big small { font-size: .82rem; font-weight: 450; color: var(--muted); letter-spacing: 0; }
.cards3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.cards3 .card { margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; align-items: start; }
.two > .card { margin-bottom: 0; }
.two + .two, .two + .card, .card + .two { margin-top: 1.1rem; }
@media (max-width: 980px) { .two { grid-template-columns: 1fr; } }

/* Avisos */
.flash { padding: .7rem 1rem; border-radius: 10px; margin: 0 0 1rem; display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; border: 1px solid transparent; font-weight: 500; font-size: .9rem; }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.flash.error { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.flash svg { width: 18px; height: 18px; flex: none; }
.empty { text-align: center; padding: 2.6rem 1rem; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty h2 { justify-content: center; }
.hint { margin: .15rem 0 0; font-size: .8rem; color: var(--muted); }
.note { margin: .45rem 0; font-size: .86rem; background: var(--orange-soft); border: 1px solid color-mix(in srgb, var(--brand-orange) 35%, transparent); padding: .45rem .7rem; border-radius: 8px; color: var(--text-2); }

/* Inicio de sesión */
.login { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 2rem; box-shadow: var(--shadow-lg); }
.login h1 { font-size: 1.35rem; margin-bottom: .2rem; }
.kicker { letter-spacing: .08em; font-size: .72rem; font-weight: 700; color: var(--muted); margin: 0; }
.login .btn.primary { padding: .65rem; }
.login .brand-login { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.login .brand-login img { border-radius: 12px; border: 1px solid var(--line); }
.login .brand-login h1 { margin: 0; }

/* Etiquetas */
.badge { display: inline-flex; align-items: center; gap: .32rem; font-size: .72rem; font-weight: 600; padding: .14rem .55rem; border-radius: 999px; white-space: nowrap; vertical-align: middle; color: var(--muted); background: var(--hover); border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-activo.badge { color: var(--c-activo); background: color-mix(in srgb, var(--c-activo) 10%, transparent); }
.st-riesgo.badge { color: var(--c-riesgo); background: color-mix(in srgb, var(--c-riesgo) 12%, transparent); }
.st-atascado.badge { color: var(--c-atascado); background: color-mix(in srgb, var(--c-atascado) 10%, transparent); }
.st-inactivo.badge { color: var(--c-inactivo); background: color-mix(in srgb, var(--c-inactivo) 9%, transparent); }
.st-no_ingresa.badge { color: var(--c-no_ingresa); background: color-mix(in srgb, var(--c-no_ingresa) 12%, transparent); }
.st-completado.badge { color: var(--c-completado); background: color-mix(in srgb, var(--c-completado) 10%, transparent); }
.st-sosp.badge { color: var(--c-sosp); background: transparent; border-color: currentColor; }
.st-off.badge { color: var(--muted); background: transparent; border-color: var(--line); }
.badge.sg-vencido { color: var(--s-vencido); background: color-mix(in srgb, var(--s-vencido) 9%, transparent); }
.badge.sg-hoy { color: var(--s-hoy); background: color-mix(in srgb, var(--s-hoy) 12%, transparent); }
.badge.sg-sin { color: var(--s-sin); background: color-mix(in srgb, var(--s-sin) 12%, transparent); }
.badge.sg-prog { color: var(--s-prog); background: color-mix(in srgb, var(--s-prog) 10%, transparent); }
.badge.sg-comp { color: var(--s-comp); background: color-mix(in srgb, var(--s-comp) 10%, transparent); }
.badge.sg-debe, .badge.pg-mitad { color: #0f766e; background: #e6f7f5; }
.badge.pg-completo { color: var(--ok); background: var(--ok-bg); }
.badge.pg-credito { color: #b45309; background: #fdf0e1; }
.badge.pg-otro { color: var(--muted); }
.badge.sl-nq { color: #fff; background: #dc2626; }
.badge.sl-nq::before { background: #fff; }
@media (prefers-color-scheme: dark) { .badge.sg-debe, .badge.pg-mitad { color: #5eead4; background: #0f2f2c; } .badge.pg-credito { color: #fdba74; background: #33210d; } }

/* Indicadores */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.kpis > div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; position: relative; }
.kpis > div::after { content: ""; position: absolute; left: .9rem; top: .78rem; width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.kpis small { display: block; color: var(--muted); font-size: .76rem; font-weight: 500; }
.kpis b { font-size: 1.3rem; display: flex; align-items: baseline; gap: .35rem; flex-wrap: wrap; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpis b a { color: inherit; }
.kpis b.sm { font-weight: 600; letter-spacing: 0; }
.kpis em { font-style: normal; color: var(--muted); font-size: .8rem; }
.kpis.big b { font-size: 1.7rem; }
.kpis .st-activo, .kpis .st-riesgo, .kpis .st-atascado, .kpis .st-inactivo, .kpis .st-no_ingresa, .kpis [class*="sg-k-"] { padding-left: 1.6rem; }
.kpis .st-activo::after { background: var(--c-activo); } .kpis .st-riesgo::after { background: var(--c-riesgo); } .kpis .st-atascado::after { background: var(--c-atascado); }
.kpis .st-inactivo::after { background: var(--c-inactivo); } .kpis .st-no_ingresa::after { background: var(--c-no_ingresa); }
.kpis .sg-k-vencido::after { background: var(--s-vencido); } .kpis .sg-k-hoy::after { background: var(--s-hoy); } .kpis .sg-k-sin::after { background: var(--s-sin); }
.kpis .sg-k-prog::after { background: var(--s-prog); } .kpis .sg-k-comp::after { background: var(--s-comp); }
.mini-kpis { grid-template-columns: 1fr 1fr; gap: .45rem; margin: 0; }
.mini-kpis > div { padding: .5rem .65rem; background: var(--surface-2); }
.mini-kpis small { font-size: .72rem; }
.mini-kpis b { font-size: 1.25rem; }
.delta { font-size: .72rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
.bar { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; width: var(--w, 0%); background: var(--accent); transition: width .3s; border-radius: 99px; }
.bar.thin { height: 5px; min-width: 80px; }

/* «Hoy» */
.hoy-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
.hoy-main { min-width: 0; }
.hoy-side .side-sticky { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 1rem; max-height: calc(100vh - 90px); overflow-y: auto; padding-bottom: .5rem; }
.hoy-side .card { margin: 0; }
.side-card h2 { margin-bottom: .7rem; }
.side-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin-bottom: .45rem; }
.side-stats div { background: var(--accent-soft); border-radius: 10px; padding: .6rem .75rem; }
.side-stats b { display: block; font-size: 1.6rem; font-weight: 700; color: var(--accent-ink); line-height: 1.1; letter-spacing: -.02em; }
.side-stats span { font-size: .75rem; color: var(--muted); }
@media (max-width: 1180px) { .hoy-grid { grid-template-columns: minmax(0, 1fr); } .hoy-side .side-sticky { position: static; max-height: none; } }
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin-bottom: 1.2rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .75rem .95rem; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.stat b { font-size: 1.55rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .8rem; display: flex; align-items: center; gap: .4rem; }
.stat span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.stat.s-vencido b { color: var(--s-vencido); } .stat.s-vencido span::before { background: var(--s-vencido); }
.stat.s-hoy b { color: var(--s-hoy); } .stat.s-hoy span::before { background: var(--s-hoy); }
.stat.s-sin span::before { background: var(--s-sin); }
.stat.s-libre span::before { background: var(--brand-orange); }
@media (max-width: 720px) { .stat-strip { grid-template-columns: 1fr 1fr; } }

/* Tomados por mí + modo enfoque */
.mine { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem 1.15rem; box-shadow: var(--shadow); }
.mine-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.mine-head h2 { margin: 0; }
.mine-empty { text-align: center; padding: 1.6rem 1rem; color: var(--muted); background: var(--surface-2); border-radius: 10px; border: 1px dashed var(--line); }
.mine-empty p { margin: 0; }
.mine-empty b { color: var(--text); }
.count { background: var(--brand-orange); color: var(--brand-navy); border-radius: 999px; font-size: .74rem; padding: .02rem .5rem; font-weight: 700; }
.take-next { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
form.inline { display: inline; }
.focus-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .55rem .2rem .8rem; }
.focus-progress { display: flex; align-items: center; gap: .8rem; flex: 1; min-width: 200px; font-size: .84rem; font-weight: 600; color: var(--text-2); }
.focus-progress .bar { flex: 1; max-width: 260px; }
.focus-nav { display: flex; gap: .3rem; }
.keys-hint { margin: -.3rem 0 .8rem .2rem; font-size: .78rem; color: var(--muted); }
.queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .9rem; }
body.enfoque .queue [data-card]:not(.activa) { display: none; }
body.enfoque .qcard.activa { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 7%, transparent); animation: entra .18s ease-out; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.05rem 1.15rem; transition: opacity .25s, transform .25s, border-color .15s; }
.qcard.copied .msg textarea { border-color: var(--ok-line); background: var(--ok-bg); }
.qcard.done { opacity: 0; transform: translateX(20px); }
.qhead { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.num { width: 28px; height: 28px; border-radius: 8px; background: var(--hover); color: var(--text-2); display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }
.who-doc { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.who-doc b { font-size: 1.05rem; font-weight: 650; color: var(--text); }
.who-doc a:hover { text-decoration: none; }
.who-doc a:hover b { color: var(--link); }
.who-doc small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
.qbadges { display: flex; gap: .35rem; }
.qmeta { display: flex; align-items: center; gap: .5rem .9rem; flex-wrap: wrap; margin: .75rem 0 .2rem; font-size: .84rem; color: var(--muted); }
.qmeta-item { display: inline-flex; align-items: center; gap: .35rem; }
.facts { margin: .3rem 0 .2rem; color: var(--muted); font-size: .84rem; }
.facts b { color: var(--text-2); font-weight: 600; }
.msg { margin: .8rem 0; }
.msg-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .35rem; font-size: .78rem; font-weight: 600; color: var(--muted); }
.msg textarea { background: var(--surface-2); font-size: .9rem; line-height: 1.55; border-color: var(--line-2); transition: background .2s, border-color .2s; }
.msg-actions { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.contacto { border-top: 1px solid var(--line-2); padding-top: .85rem; display: flex; flex-direction: column; gap: .55rem; }
.contacto-opciones { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.contacto-opciones .grow { flex: 1; min-width: 180px; }
.resultados { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.resultados details.mas { margin-left: auto; }

/* Casillas de seguimiento */
.seg-line { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .6rem 0 .2rem; font-size: .85rem; }
.seg-line.big { margin: 0 0 1rem; }
.slots { display: inline-flex; gap: 3px; }
.slot { min-width: 44px; padding: .2rem .3rem; border-radius: 6px; font-size: .74rem; font-weight: 600; text-align: center; color: #27272a; background: #ececf1; font-variant-numeric: tabular-nums; }
.slot.empty { background: transparent; color: var(--muted); border: 1px dashed var(--line); font-weight: 450; }
.slots.compact .slot { min-width: 38px; font-size: .7rem; padding: .12rem .2rem; }
.seg-line.big .slot { min-width: 64px; font-size: .88rem; padding: .38rem .45rem; }
.sl-nr { background: #fde047 !important; color: #422006 !important; }
.sl-nq { background: #ef4444 !important; color: #fff !important; }

/* Tablas */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: .875rem; }
.grid th, .grid td { padding: .62rem .75rem; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
.grid thead th { background: var(--surface-2); font-size: .74rem; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid th.r, .grid td.r { text-align: right; }
.grid td.r { font-variant-numeric: tabular-nums; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover { background: var(--hover); }
.grid.compact td, .grid.compact th { padding: .42rem .6rem; }
.card > .table-wrap:not(.flush) { margin: 0 -1.25rem; }
.card > .table-wrap:last-child { margin-bottom: -1.1rem; }
.card > .table-wrap table.grid th:first-child, .card > .table-wrap table.grid td:first-child { padding-left: 1.25rem; }
.card > .table-wrap table.grid th:last-child, .card > .table-wrap table.grid td:last-child { padding-right: 1.25rem; }
.table-wrap.card { padding: 0; }
.table-wrap.card table.grid td:first-child, .table-wrap.card table.grid th:first-child { padding-left: 1.1rem; }
.table-wrap.card table.grid td:last-child, .table-wrap.card table.grid th:last-child { padding-right: 1.1rem; }
.page > .table-wrap, .hoy-main > .table-wrap:not(.card) { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.1rem; }
.page > .table-wrap table.grid td:first-child, .page > .table-wrap table.grid th:first-child { padding-left: 1.1rem; }
.page > .table-wrap table.grid td:last-child, .page > .table-wrap table.grid th:last-child { padding-right: 1.1rem; }
table.pool td { padding-top: .5rem; padding-bottom: .5rem; }
table.pool tr.taken { opacity: .5; }
table.pool tr.mine-row { background: var(--accent-soft); }
table.pool tr[hidden] { display: none; }
table.excel td { vertical-align: middle; }
.grid.excel td:first-child { min-width: 230px; }
.grid.excel td:nth-child(2) { min-width: 290px; }
.late { color: var(--bad); font-weight: 600; }
.lock { font-size: .78rem; color: var(--muted); white-space: nowrap; margin-right: .3rem; }
h3.group { margin: 1.1rem 0 .5rem; display: flex; gap: .55rem; align-items: center; font-size: .9rem; }
h3.group span { color: var(--muted); font-weight: 500; font-size: .84rem; }
h2.group { margin: 1.2rem 0 .6rem; }
h3.sub { font-size: .9rem; margin: .8rem 0 .5rem; }
details.pool-group > summary { list-style: none; cursor: pointer; }
details.pool-group > summary::-webkit-details-marker { display: none; }
details.pool-group > summary h3.group::after { content: "›"; color: var(--muted); font-size: 1.1rem; line-height: 1; margin-left: .1rem; transform: rotate(90deg); transition: transform .15s; }
details.pool-group:not([open]) > summary h3.group::after { transform: none; }
details.pool-group[open] summary { margin-bottom: 0; }
.pool-filtros { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; margin: 0 0 .4rem; }
.pool-filtros input[type=search] { flex: 1 1 220px; max-width: 320px; }
.pool-filtros select { width: auto; max-width: 260px; }

/* Filtros de página y paginación */
.filters { display: flex; gap: .55rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; box-shadow: var(--shadow-sm); }
.filters input, .filters select { width: auto; flex: 1 1 170px; max-width: 300px; }
.filters label.mini { flex: 0 0 auto; }
.filters label input, .filters label select { flex: none; max-width: none; width: auto; }
.pager { display: flex; gap: .8rem; align-items: center; justify-content: center; margin: 1rem 0; color: var(--muted); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin: .2rem 0 .8rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; border: 1px solid rgba(0,0,0,.08); }
.legend .st-activo { background: var(--c-activo); } .legend .st-riesgo { background: var(--c-riesgo); } .legend .st-atascado { background: var(--c-atascado); }
.legend .st-inactivo { background: var(--c-inactivo); } .legend .st-no_ingresa { background: var(--c-no_ingresa); }
.dist { min-width: 200px; }
.distbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line-2); gap: 1px; }
.distbar span { display: block; height: 100%; width: var(--w, 0%); flex: none; }
.distbar .st-activo { background: var(--c-activo); } .distbar .st-riesgo { background: var(--c-riesgo); } .distbar .st-atascado { background: var(--c-atascado); }
.distbar .st-inactivo { background: var(--c-inactivo); } .distbar .st-no_ingresa { background: var(--c-no_ingresa); }
details summary { cursor: pointer; font-weight: 550; }
details[open] > summary { margin-bottom: .6rem; }
details .stack { margin-top: .8rem; }
summary.late { color: var(--bad); }

/* Panel: requiere atención */
.atencion h2 { margin-bottom: .6rem; }
.alertas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.alertas li { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--line-2); font-size: .9rem; }
.alertas li:last-child { border-bottom: 0; }
.alertas li > span:nth-child(2) { flex: 1; }
.al-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.al-alta .al-dot { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.al-media .al-dot { background: var(--s-hoy); }
.al-baja .al-dot { background: var(--muted); }

/* Ficha del docente */
.ficha-head { position: sticky; top: 57px; z-index: 20; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: -1.6rem -2rem 1.2rem; padding: 1.1rem 2rem .9rem; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 6px 12px -10px rgba(16,24,40,.25); }
.ficha-head h1 { margin: .1rem 0 .35rem; }
.ficha-badges { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.ficha-badges .muted { margin-left: .3rem; }
.ficha-acciones { display: flex; gap: .45rem; flex-wrap: wrap; }
#seguir, #registrar { scroll-margin-top: 190px; }

/* Historial y otros */
.timeline { list-style: none; padding: 0; margin: 0 0 .6rem; max-height: 440px; overflow: auto; }
.timeline li { padding: .55rem 0 .55rem 1rem; border-bottom: 1px solid var(--line-2); font-size: .88rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 1rem; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.timeline small { display: block; color: var(--muted); }
.seg-switch { display: inline-flex; background: var(--hover); border: 1px solid var(--line); border-radius: 9px; padding: 2px; margin-bottom: .9rem; }
.seg-switch a { padding: .3rem .8rem; color: var(--muted); font-weight: 550; font-size: .84rem; border-radius: 7px; }
.seg-switch a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.seg-switch a:hover { text-decoration: none; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .45rem; vertical-align: middle; border: 1px solid rgba(0,0,0,.1); }
.taken-list { list-style: none; margin: .5rem 0 0; padding: 0; font-size: .86rem; }
.taken-list li { display: flex; gap: .4rem; align-items: center; padding: .3rem 0; border-bottom: 1px solid var(--line-2); }
.taken-list li form { margin-left: auto; }
ol.pasos { padding-left: 1.3rem; display: flex; flex-direction: column; gap: .8rem; }
ol.pasos code { word-break: break-all; }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; background: var(--surface-2); }
.zip-step { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }

/* Registro de llamadas y soportes */
.act-panel h2 { margin-bottom: .7rem; }
.act-form { gap: .65rem; }
.act-form [hidden] { display: none !important; }
.buscar-persona { position: relative; }
.sugerencias { list-style: none; margin: .25rem 0 0; padding: .3rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); position: absolute; left: 0; right: 0; z-index: 40; box-shadow: var(--shadow-lg); max-height: 320px; overflow: auto; }
.sugerencias button, .sugerencias a { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .45rem .6rem; border-radius: 7px; color: var(--text); font: inherit; font-size: .87rem; cursor: pointer; }
.sugerencias a small, .sugerencias button small { color: var(--muted); }
.sugerencias button:hover, .sugerencias a:hover, .sugerencias .sel { background: var(--hover); text-decoration: none; }
.sugerencias li.small { padding: .35rem .6rem; color: var(--muted); }
input.elegido { border-color: var(--ok-line); background: var(--ok-bg); }

/* Notificaciones */
.toast-stack { position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 60; display: flex; flex-direction: column; gap: .5rem; align-items: flex-end; }
.toast { background: #18181b; color: #fafafa; padding: .65rem .8rem .65rem 1rem; border-radius: 10px; transition: opacity .3s, transform .3s; max-width: min(440px, calc(100vw - 2rem)); box-shadow: var(--shadow-lg); font-weight: 500; font-size: .88rem; display: flex; align-items: center; gap: .8rem; }
.toast.bad { background: #b91c1c; }
.toast.out { opacity: 0; transform: translateY(8px); }
.toast button { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 7px; padding: .3rem .65rem; font: inherit; font-weight: 600; font-size: .82rem; cursor: pointer; }
.toast button:hover { background: rgba(255,255,255,.22); }
.toast .t-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--brand-orange); border-radius: 0 0 10px 10px; animation: cuenta linear forwards; }
.toast { position: relative; overflow: hidden; }
@keyframes cuenta { from { width: 100%; } to { width: 0; } }
@media (prefers-color-scheme: dark) { .toast { background: #f4f4f5; color: #18181b; } .toast button { background: rgba(0,0,0,.08); color: #18181b; } }

/* Pantallas angostas (pensado para computador; esto evita que se rompa) */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; z-index: 40; height: auto; flex-direction: row; align-items: center; padding: .45rem .6rem; gap: .4rem; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; }
  .brand span, .nav-group, .side-user .who { display: none; }
  .side-nav { flex-direction: row; overflow-x: auto; }
  .side-nav a { padding: .4rem .55rem; }
  .side-nav a span { display: none; }
  .side-nav a.on span { display: inline; }
  .side-user { border: 0; padding: 0; }
  .topbar { top: 52px; padding: .55rem .9rem; }
  .kbd-hint, .keys-hint, .res kbd, .msg-head kbd { display: none; }
  .page { padding: 1rem .9rem 4rem; }
  .ficha-head { position: static; margin: -1rem -.9rem 1rem; padding: .9rem; }
  .slots { flex-wrap: wrap; }
  .resultados details.mas { margin-left: 0; }
}

/* ---------- Esperando respuesta (WhatsApp enviados) ---------- */
[hidden] { display: none !important; }
.esperando { margin-top: 20px; }
.esperando > summary { cursor: pointer; list-style: none; }
.esperando > summary::-webkit-details-marker { display: none; }
.esperando > summary h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.esperando-lista { list-style: none; margin: 8px 0 0; padding: 0; }
.esperando-lista li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line, #e5e7eb); }
.esperando-lista li.viejo { box-shadow: inset 3px 0 0 #eab308; padding-left: 10px; }
form.respuesta { display: inline-flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 640px) { .esperando-lista li { flex-direction: column; align-items: flex-start; } }
