/* =================================================================
   etste · Hoja de estilos (iteración 1)
   Dirección visual inicial: cálida, calmada, mobile-first.
   Todo color/espaciado sale de los tokens de :root.
   ================================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg: #F4F1EC;
  --surface: #FFFFFF;
  --surface-2: #FAF8F4;
  --surface-3: #F1EDE6;
  --line: #E8E2D8;
  --line-strong: #D8D0C3;

  --ink: #1F1C18;
  --ink-2: #57514A;
  --ink-3: #8C857B;

  --accent: #4F57C8;
  --accent-hover: #434BB6;
  --accent-ink: #FFFFFF;
  --accent-soft: #ECEDFA;
  --accent-text: #3E46AE;

  --principal: #3A6ED4;  --principal-soft: #E8EFFC;
  --externo:   #8A50C8;  --externo-soft:   #F3EAFC;
  --libre:     #2A8A68;  --libre-soft:     #E2F3EB;

  --alta: #D9534A;  --media: #D99A2B;  --baja: #A39D94;

  --ok: #2E9A66;     --ok-soft: #E3F4EA;
  --wait: #C2851A;   --wait-soft: #FBF0DC;
  --off: #857F77;    --off-soft: #EEEBE6;
  --danger: #C8443A; --danger-soft: #FBE7E4;

  --presence-a: #FFB892;
  --presence-b: #C9A3FF;
  --presence-ink: #2A2140;

  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  --shadow-sm: 0 1px 2px rgba(31, 28, 24, .05);
  --shadow: 0 1px 2px rgba(31, 28, 24, .04), 0 6px 20px rgba(31, 28, 24, .06);
  --shadow-lg: 0 10px 40px rgba(31, 28, 24, .16);

  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, serif;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --topbar-h: 56px;
  --bottomnav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --surface: #1F1E1B;
    --surface-2: #252320;
    --surface-3: #2C2A26;
    --line: #34312C;
    --line-strong: #45413A;

    --ink: #F2EEE8;
    --ink-2: #BDB6AC;
    --ink-3: #8A8379;

    --accent: #8C93F0;
    --accent-hover: #A0A6F5;
    --accent-ink: #14142B;
    --accent-soft: #2A2B45;
    --accent-text: #AEB3F7;

    --principal: #7DA4F0;  --principal-soft: #1F2A40;
    --externo:   #BE92EE;  --externo-soft:   #2F2340;
    --libre:     #6CCBA6;  --libre-soft:     #1A3229;

    --alta: #F07D72;  --media: #E8B455;  --baja: #8F897F;

    --ok: #5CC995;     --ok-soft: #1A3326;
    --wait: #E3AA4A;   --wait-soft: #3A2E17;
    --off: #9A938A;    --off-soft: #2B2926;
    --danger: #F07D72; --danger-soft: #3D211E;

    --presence-ink: #241B38;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, .5);

    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
code { font-size: .9em; background: var(--surface-3); padding: .1em .35em; border-radius: 6px; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.icon { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 2; }
i.icon { display: inline-block; } /* antes de que Lucide reemplace el <i> */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- Layout ---------- */
.app { min-height: 100dvh; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 0 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar__actions { display: flex; gap: 4px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: var(--ink);
}
.brand:hover { text-decoration: none; }

.main {
  padding: 8px 16px calc(var(--bottomnav-h) + var(--safe-b) + 32px);
}
.container { max-width: 760px; margin: 0 auto; }

.sidebar { display: none; }

/* Navegación inferior */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--bottomnav-h) + var(--safe-b));
  padding: 6px 8px var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
}
.bottomnav__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 100%; border: 0; background: none;
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  border-radius: var(--radius-sm);
  transition: color .15s, transform .15s var(--ease);
}
.bottomnav__item:hover { text-decoration: none; color: var(--ink-2); }
.bottomnav__item:active { transform: scale(.94); }
.bottomnav__item .icon { width: 22px; height: 22px; }
.bottomnav__item.is-active { color: var(--accent-text); }
.bottomnav__item.is-active .icon { stroke-width: 2.4; }
.bottomnav__icon { position: relative; display: inline-flex; }
.bottomnav__icon .count { position: absolute; top: -6px; right: -12px; }

.fab {
  justify-self: center;
  width: 54px; height: 54px; margin-top: -22px;
  display: grid; place-items: center;
  border: 0; border-radius: 18px;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 0 5px var(--bg);
  transition: transform .18s var(--ease), background .15s;
}
.fab .icon { width: 26px; height: 26px; stroke-width: 2.4; }
.fab:hover { background: var(--accent-hover); }
.fab:active { transform: scale(.92) rotate(90deg); }

.count {
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 800; line-height: 1;
  border-radius: 99px;
  background: var(--wait); color: #fff;
  box-shadow: 0 0 0 2px var(--surface);
  animation: pop .3s var(--ease);
}

/* Escritorio */
@media (min-width: 960px) {
  .topbar, .bottomnav { display: none; }
  .app { display: grid; grid-template-columns: 248px 1fr; }
  .sidebar {
    position: sticky; top: 0; height: 100dvh;
    display: flex; flex-direction: column; gap: 20px;
    padding: 22px 16px;
    border-right: 1px solid var(--line);
    background: var(--surface-2);
  }
  .sidebar .brand { padding: 0 8px; }
  .sidebar__qs { margin-top: 4px; }
  .sidenav { display: flex; flex-direction: column; gap: 2px; }
  .sidenav__label { margin: 18px 12px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
  .sidenav__item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    font-weight: 600; color: var(--ink-2);
    transition: background .15s, color .15s;
  }
  .sidenav__item span:not(.count) { flex: 1; }
  .sidenav__item:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
  .sidenav__item.is-active { background: var(--accent-soft); color: var(--accent-text); }
  .sidenav__item.is-disabled { color: var(--ink-3); opacity: .6; cursor: default; }
  .sidenav__item.is-disabled:hover { background: none; }
  .sidebar__foot {
    margin-top: auto; display: flex; align-items: center; justify-content: space-between;
    padding: 12px 8px 0; border-top: 1px solid var(--line);
  }
  .sidebar__user { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); }
  .main { padding: 36px 40px 64px; }
}

/* ---------- Presencia de etste (placeholder) ---------- */
.presence {
  --size: 44px;
  width: var(--size); height: var(--size);
  flex-shrink: 0;
  display: inline-grid; place-items: center;
  border-radius: 36%;
  background: linear-gradient(140deg, var(--presence-a), var(--presence-b));
  color: var(--presence-ink);
  box-shadow: inset 0 -3px 8px rgba(255, 255, 255, .25), 0 4px 14px color-mix(in srgb, var(--presence-b) 35%, transparent);
}
.presence svg { width: 78%; height: 78%; }
.presence .eye { fill: currentColor; stroke: none; transform-origin: center 29px; animation: blink 6s infinite; }
.presence--xs { --size: 28px; }
.presence--sm { --size: 34px; }
.presence--md { --size: 56px; }
.presence--lg { --size: 64px; }
.presence--atencion { background: linear-gradient(140deg, #FFC27A, #FF9F9F); }
.presence--descanso { background: linear-gradient(140deg, #B9C4F5, #C9A3FF); }
.presence--celebracion { background: linear-gradient(140deg, #9EE2B8, #FFD27A); }

@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@media (prefers-reduced-motion: reduce) {
  .presence .eye { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 14px;
  font-weight: 700; font-size: 14.5px; letter-spacing: -.005em;
  background: var(--surface-3); color: var(--ink);
  transition: background .15s, border-color .15s, transform .12s var(--ease), box-shadow .15s;
  white-space: nowrap; text-decoration: none !important; user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 28%, transparent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--soft { background: var(--accent-soft); color: var(--accent-text); }
.btn--soft:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent) 12%); }
.btn--ghost { background: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn--ok { background: var(--ok); color: #fff; }
.btn--ok:hover { background: color-mix(in srgb, var(--ok) 88%, #000); }
.btn--wait { background: var(--wait); color: #fff; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { min-height: 36px; padding: 0 13px; font-size: 13.5px; border-radius: 11px; }
.btn--sm .icon { width: 16px; height: 16px; }
.btn--lg { min-height: 52px; font-size: 16px; }
.btn--icon { width: 44px; padding: 0; }
.btn--icon.btn--xs { width: 32px; min-height: 32px; border-radius: 9px; }
.btn--icon.btn--xs .icon { width: 16px; height: 16px; }
.btn--block { width: 100%; }

.link-muted { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.link-muted .icon { width: 15px; height: 15px; }
.link-muted:hover { color: var(--accent-text); text-decoration: none; }

/* ---------- Encabezados de página ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin: 12px 0 18px;
}
.page-head__actions { display: flex; gap: 6px; flex-shrink: 0; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; display: flex; align-items: center; gap: 10px; }
.page-sub { margin-top: 4px; color: var(--ink-3); font-size: 14px; }
.title-bolt { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--wait-soft); color: var(--wait); }
.title-bolt .icon { width: 20px; height: 20px; }

.page-top { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
.back { display: inline-flex; align-items: center; gap: 2px; margin-left: -6px; padding: 6px 8px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.back:hover { background: var(--surface-3); text-decoration: none; }

/* ---------- Cards y bloques ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.section { padding: 18px; margin-bottom: 14px; }
.section__title {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 14px;
  font-size: 15px; font-weight: 800; letter-spacing: -.01em;
}
.section__title .icon { color: var(--ink-3); }
.section__count { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--ink-3); }

.block { margin-top: 28px; }
.block__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.block__title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.block__title .icon { width: 16px; height: 16px; }

/* ---------- Chips, badges, meta ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px 0 8px; border-radius: 99px;
  font-size: 12.5px; font-weight: 700;
  background: var(--surface-3); color: var(--ink-2);
}
.chip .icon { width: 14px; height: 14px; }
.chip--principal { background: var(--principal-soft); color: var(--principal); }
.chip--externo { background: var(--externo-soft); color: var(--externo); }
.chip--libre { background: var(--libre-soft); color: var(--libre); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px 0 7px; border-radius: 8px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge .icon { width: 14px; height: 14px; }
.badge--activo { background: var(--accent-soft); color: var(--accent-text); }
.badge--espera { background: var(--wait-soft); color: var(--wait); }
.badge--completado { background: var(--ok-soft); color: var(--ok); }
.badge--descartado { background: var(--off-soft); color: var(--off); }
.badge--captura { background: var(--wait-soft); color: var(--wait); }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--ink-2); }
.meta__item { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.meta__item .icon { width: 15px; height: 15px; color: var(--ink-3); }
.meta--lg { font-size: 14px; gap: 8px 16px; }
.prio__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--baja); }
.prio--alta .prio__dot { background: var(--alta); box-shadow: 0 0 0 3px color-mix(in srgb, var(--alta) 20%, transparent); }
.prio--media .prio__dot { background: var(--media); }

.deadline { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 12.5px; padding: 2px 8px; border-radius: 7px; background: var(--surface-3); color: var(--ink-2); }
.deadline .icon { width: 14px; height: 14px; }
.deadline--pronto, .deadline--hoy { background: var(--wait-soft); color: var(--wait); }
.deadline--vencido { background: var(--danger-soft); color: var(--danger); }

.tag { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 8px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.tag--vencido { background: var(--danger-soft); color: var(--danger); }
.tag--pronto { background: var(--wait-soft); color: var(--wait); }
.tag--quieto { background: var(--accent-soft); color: var(--accent-text); }
.tag--espera { background: var(--wait-soft); color: var(--wait); }

/* ---------- Progreso ---------- */
.progress { position: relative; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress span {
  position: absolute; inset: 0 auto 0 0; width: var(--p); border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--presence-b)));
  animation: grow .8s var(--ease) both;
}
.progress--lg { height: 10px; }
.progress--ok span { background: var(--ok); }
@keyframes grow { from { width: 0; } }

/* ---------- Tarjeta de pendiente ---------- */
.cards { display: grid; gap: 12px; }
.p-card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 16px 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s, border-color .18s;
  overflow: hidden;
}
.p-card::before {
  content: ''; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--line-strong);
}
.p-card--principal::before { background: var(--principal); }
.p-card--externo::before { background: var(--externo); }
.p-card--libre::before { background: var(--libre); }
.p-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.p-card:active { transform: scale(.985); }
.p-card.is-completado, .p-card.is-descartado { background: var(--surface-2); }
.p-card.is-completado .p-card__title a { color: var(--ink-2); }
.p-card.is-descartado { opacity: .85; }
.p-card__top { display: flex; align-items: center; gap: 6px; min-height: 30px; }
.p-card__spacer { flex: 1; }
.p-card__title { font-size: 16.5px; font-weight: 700; letter-spacing: -.015em; line-height: 1.35; }
.p-card__title a { color: var(--ink); }
.p-card__title a:hover { text-decoration: none; }
.stretched::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.p-card__pin, .p-card .pin-form { position: relative; z-index: 2; }
.p-card__note { display: flex; gap: 7px; font-size: 13px; color: var(--ink-2); }
.p-card__note .icon { width: 15px; height: 15px; margin-top: 2px; color: var(--ink-3); }
.p-card__progress { display: flex; align-items: center; gap: 10px; }
.p-card__progress .progress { flex: 1; }
.p-card__count { font-size: 12px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.pin-form { margin: 0; }
.pin {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--line-strong);
  transition: color .15s, background .15s, transform .2s var(--ease);
}
.pin:hover { background: var(--surface-3); color: var(--ink-3); }
.pin:active { transform: scale(.85); }
.pin.is-on { color: #E7A817; }
.pin.is-on svg { fill: currentColor; }

/* ---------- Inicio / Secretaria ---------- */
.hello {
  position: relative;
  margin-top: 8px;
  padding: 20px 18px 18px;
  border-radius: 26px;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--presence-b) 22%, transparent), transparent 60%),
    radial-gradient(90% 80% at 0% 100%, color-mix(in srgb, var(--presence-a) 20%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.eyebrow { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.eyebrow .icon { width: 16px; height: 16px; }
/* Móvil: cara + saludo en una fila, mensaje a todo el ancho. Escritorio: mensaje junto al saludo. */
.hello__body {
  display: grid; grid-template-columns: auto 1fr; align-items: center;
  column-gap: 14px; margin-top: 16px;
}
.hello__body .bubble { grid-column: 1 / -1; }
@media (min-width: 640px) {
  .hello__body { align-items: start; }
  .hello__body .presence { grid-row: span 2; }
  .hello__body .bubble { grid-column: 2; }
}
.hello__greet {
  font-family: var(--font-display); font-weight: 600;
  font-size: 27px; line-height: 1.15; letter-spacing: -.02em;
  font-variation-settings: 'opsz' 72;
}
.bubble {
  position: relative; margin-top: 12px;
  padding: 12px 14px;
  border-radius: 4px 18px 18px 18px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--line);
  display: grid; gap: 4px;
  font-size: 15px; color: var(--ink-2);
}
.bubble p:first-child { color: var(--ink); font-weight: 600; }
.hello__actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }

.action {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 12px; min-height: 92px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); color: var(--ink); text-align: left;
  transition: transform .15s var(--ease), border-color .15s, box-shadow .15s;
}
.action:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.action:active:not(:disabled) { transform: scale(.97); }
.action__icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--surface-3); color: var(--ink-2); }
.action__text { display: grid; line-height: 1.25; }
.action__text strong { font-size: 13.5px; font-weight: 800; }
.action__text small { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.action--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.action--accent .action__icon { background: rgba(255, 255, 255, .18); color: inherit; }
.action--accent .action__text small { color: inherit; opacity: .8; }
.action--soon { cursor: default; background: var(--surface-2); }
.action--soon .action__text strong { color: var(--ink-2); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stat {
  display: grid; gap: 2px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  color: var(--ink); transition: border-color .15s, transform .15s var(--ease);
}
.stat:hover { text-decoration: none; border-color: var(--line-strong); }
.stat:active { transform: scale(.97); }
.stat__icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; margin-bottom: 6px; }
.stat__icon .icon { width: 16px; height: 16px; }
.stat__icon--accent { background: var(--accent-soft); color: var(--accent-text); }
.stat__icon--wait { background: var(--wait-soft); color: var(--wait); }
.stat__icon--alert { background: var(--danger-soft); color: var(--danger); }
.stat__num { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }

.rows { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 14px 16px; color: var(--ink);
  transition: background .15s;
}
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background: var(--surface-2); text-decoration: none; }
.row:active { background: var(--surface-3); }
.row__dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--line-strong); }
.row__dot--principal { background: var(--principal); }
.row__dot--externo { background: var(--externo); }
.row__dot--libre { background: var(--libre); }
.row__main { flex: 1; min-width: 0; display: grid; }
.row__title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__sub { font-size: 12.5px; color: var(--ink-3); }
.row__chev { width: 16px; height: 16px; color: var(--ink-3); }
.rows--compact .row { padding-block: 11px; }

.hscroll {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 82%);
  gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 -16px; padding: 2px 16px 8px;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; }
@media (min-width: 960px) {
  .hscroll { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); grid-auto-columns: auto; margin: 0; padding: 0; overflow: visible; }
}

/* ---------- Tabs y filtros ---------- */
.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface-3); border-radius: 14px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs__item {
  flex: 1 0 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 12px; border-radius: 11px;
  font-size: 13.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.tabs__item:hover { text-decoration: none; color: var(--ink); }
.tabs__item.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.tabs__count { font-size: 11.5px; font-weight: 800; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.filters {
  display: flex; gap: 6px; align-items: center;
  margin: 12px -16px 16px; padding: 0 16px 2px;
  overflow-x: auto; scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filters__sep { width: 1px; height: 20px; background: var(--line-strong); flex-shrink: 0; margin: 0 2px; }
.filter {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  transition: background .15s, color .15s, border-color .15s;
}
.filter .icon { width: 14px; height: 14px; }
.filter:hover { text-decoration: none; border-color: var(--line-strong); }
.filter.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
@media (min-width: 960px) { .filters { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; } }

.hint {
  display: flex; align-items: center; gap: 12px;
  margin-top: 22px; padding: 14px 16px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  font-size: 13.5px; color: var(--ink-2);
}
.hint:hover { text-decoration: none; background: var(--surface); }
.hint > .icon { color: var(--ink-3); }
.hint__icon { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: var(--wait-soft); color: var(--wait); }
.hint__icon .icon { width: 16px; height: 16px; }

/* ---------- Estados vacíos ---------- */
.empty { display: grid; justify-items: center; gap: 8px; padding: 44px 20px; text-align: center; }
.empty .presence { margin-bottom: 8px; }
.empty__title { font-size: 17px; font-weight: 800; }
.empty__text { max-width: 320px; color: var(--ink-3); font-size: 14px; }
.empty .btn { margin-top: 10px; }

/* ---------- Formularios ---------- */
.form { padding: 20px 18px; display: grid; gap: 20px; }
.form__grid { display: grid; gap: 20px; }
.form__foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.form__aside { margin-top: 12px; font-size: 13px; color: var(--ink-3); text-align: center; }
.stack { display: grid; gap: 16px; }

.field { display: grid; gap: 8px; }
.field--narrow { max-width: 260px; }
.field__label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field__label em { color: var(--alta); font-style: normal; }
.field__help { font-size: 12.5px; color: var(--ink-3); }
.field__error { font-size: 12.5px; font-weight: 600; color: var(--danger); }

.input {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border: 1px solid var(--line-strong); border-radius: 13px;
  background: var(--surface); color: var(--ink);
  font-size: 16px; /* evita zoom en iOS */
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.input--lg { min-height: 52px; font-size: 17px; font-weight: 600; }
textarea.input { resize: vertical; line-height: 1.5; min-height: 64px; }

.input-wrap { position: relative; }
.input-wrap .input { padding-right: 48px; }
.input-wrap__btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--ink-3); border-radius: 10px; }

/* Selector segmentado */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg__input { position: absolute; opacity: 0; pointer-events: none; }
.seg__opt {
  flex: 1 1 0; min-width: max-content;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface);
  font-size: 14px; font-weight: 700; color: var(--ink-2);
  cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, color .15s, transform .12s var(--ease);
}
.seg__opt .icon { width: 16px; height: 16px; }
.seg__opt:hover { border-color: var(--ink-3); }
.seg__opt:active { transform: scale(.96); }
.seg__input:focus-visible + .seg__opt { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg__input:checked + .seg__opt { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.seg--tipo .seg__input[value="principal"]:checked + .seg__opt { background: var(--principal-soft); border-color: var(--principal); color: var(--principal); }
.seg--tipo .seg__input[value="externo"]:checked + .seg__opt { background: var(--externo-soft); border-color: var(--externo); color: var(--externo); }
.seg--tipo .seg__input[value="libre"]:checked + .seg__opt { background: var(--libre-soft); border-color: var(--libre); color: var(--libre); }
.seg--prio .seg__input[value="alta"]:checked + .seg__opt { background: var(--danger-soft); border-color: var(--alta); color: var(--alta); }
.seg--prio .seg__input[value="media"]:checked + .seg__opt { background: var(--wait-soft); border-color: var(--media); color: var(--wait); }
.seg--sm .seg__opt { min-height: 36px; padding: 0 10px; font-size: 13px; }

/* Desplegables */
.more { border-top: 1px solid var(--line); padding-top: 14px; }
.more__sum {
  display: inline-flex; align-items: center; gap: 6px;
  list-style: none; cursor: pointer;
  font-size: 14px; font-weight: 700; color: var(--ink-2);
}
.more__sum::-webkit-details-marker { display: none; }
.more__sum .icon { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.more[open] > .more__sum .icon { transform: rotate(180deg); }
.more__body { display: grid; gap: 18px; margin-top: 16px; }
.more--inline { border: 0; padding-top: 10px; }
.more--inline .more__sum { font-size: 13px; color: var(--ink-3); }

@media (min-width: 640px) {
  .form { padding: 26px; }
}

/* ---------- Avisos ---------- */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 14px 16px; margin-bottom: 14px;
  border-radius: var(--radius); font-size: 14px;
}
.notice > .icon { margin-top: 1px; }
.notice--block { display: grid; gap: 8px; }
.notice__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notice--captura { background: var(--wait-soft); color: color-mix(in srgb, var(--wait) 70%, var(--ink)); }
.notice--espera { background: var(--wait-soft); color: color-mix(in srgb, var(--wait) 60%, var(--ink)); }
.notice--descartado { background: var(--off-soft); color: var(--ink-2); }
.notice .muted { color: inherit; opacity: .75; }

/* ---------- Expediente ---------- */
.exp { position: relative; padding: 20px 18px; margin-bottom: 14px; overflow: hidden; }
.exp::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--line-strong); }
.exp--principal::before { background: var(--principal); }
.exp--externo::before { background: var(--externo); }
.exp--libre::before { background: var(--libre); }
.exp__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.exp__row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.exp__title { flex: 1; font-size: 24px; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }
.exp__pin { margin-top: -2px; }
.exp__progress { display: grid; gap: 7px; margin-top: 18px; }
.exp__progress-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.exp__progress-top strong { font-size: 20px; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.exp__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.exp__actions form { margin: 0; }

.times { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.time { display: grid; gap: 1px; padding: 13px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.time__label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.time__value { font-size: 16.5px; font-weight: 800; letter-spacing: -.015em; }
.time__sub { font-size: 12px; color: var(--ink-3); }
@media (min-width: 640px) { .times { grid-template-columns: repeat(4, 1fr); } }

.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 12px; margin: 0; }
.kv div { display: grid; gap: 1px; }
.kv dt { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 800; font-size: 15.5px; }
@media (min-width: 640px) { .kv { grid-template-columns: repeat(4, 1fr); } }
.closing { background: linear-gradient(180deg, var(--ok-soft), var(--surface) 70%); }

.exp-grid { display: grid; gap: 0; }
@media (min-width: 1180px) {
  .container:has(.exp-grid) { max-width: 1080px; }
  .exp-grid { grid-template-columns: 1.35fr 1fr; gap: 14px; align-items: start; }
}

.prose-plain { color: var(--ink-2); white-space: normal; overflow-wrap: anywhere; }

/* Subtareas */
.subtasks { display: grid; }
.st { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; }
.st + .st { border-top: 1px solid var(--line); }
.st form { margin: 0; }
.st__body { flex: 1; min-width: 0; display: grid; gap: 2px; padding-top: 3px; }
.st__title { font-weight: 600; overflow-wrap: anywhere; transition: color .2s; }
.st.is-done .st__title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.st__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--ink-3); }
.st__meta .icon { width: 13px; height: 13px; margin-right: 3px; vertical-align: -2px; }
.st__del { opacity: .55; }
.st:hover .st__del { opacity: 1; }

.check {
  width: 28px; height: 28px; margin-top: 1px;
  display: grid; place-items: center;
  border: 2px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); color: transparent;
  transition: background .18s, border-color .18s, color .18s, transform .15s var(--ease);
}
.check .icon { width: 16px; height: 16px; stroke-width: 3; }
.check:hover:not(:disabled) { border-color: var(--ok); }
.check:active:not(:disabled) { transform: scale(.88); }
.check.is-on { background: var(--ok); border-color: var(--ok); color: #fff; }
.check:disabled { cursor: not-allowed; opacity: .6; }

.st-add { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.st-add__row { display: flex; gap: 8px; }
.st-add__opts { display: grid; gap: 8px; margin-top: 10px; }

/* Notas */
.note-add { display: grid; gap: 8px; justify-items: end; margin-bottom: 14px; }
.notes { display: grid; gap: 10px; }
.note { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.note__date { display: block; font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 4px; }
.note__text { color: var(--ink); overflow-wrap: anywhere; }

/* Archivo MD */
.file { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.file__icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); flex-shrink: 0; }
.file__main { display: grid; min-width: 0; }
.file__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file__meta { font-size: 12.5px; color: var(--ink-3); }
.file__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.file__actions form { margin: 0; }
.upload label { cursor: pointer; }
.dropzone {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 12px; padding: 18px;
  border: 1.5px dashed var(--line-strong); border-radius: 14px;
  font-weight: 700; color: var(--ink-2);
  transition: border-color .15s, background .15s, color .15s;
}
.dropzone:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }

/* Enlaces */
.links { display: grid; gap: 6px; }
.link-item { display: flex; align-items: center; gap: 6px; }
.link-item form { margin: 0; }
.link-item__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px; margin: 0 -8px; border-radius: 12px; color: var(--ink); }
.link-item__main:hover { background: var(--surface-2); text-decoration: none; }
.link-item__main > span:last-child { display: grid; min-width: 0; }
.link-item__icon { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); }
.link-item__icon .icon { width: 16px; height: 16px; }
.link-item__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-item__host { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-add { display: grid; gap: 8px; margin-top: 10px; justify-items: start; }

/* Historial */
.timeline { position: relative; display: grid; gap: 2px; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line); border-radius: 2px; }
.tl { position: relative; display: flex; gap: 12px; padding: 6px 0; }
.tl__icon {
  position: relative; z-index: 1;
  width: 32px; height: 32px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%; border: 3px solid var(--surface);
  background: var(--surface-3); color: var(--ink-3);
}
.tl__icon .icon { width: 14px; height: 14px; }
.tl--accent .tl__icon { background: var(--accent-soft); color: var(--accent-text); }
.tl--ok .tl__icon { background: var(--ok-soft); color: var(--ok); }
.tl--wait .tl__icon { background: var(--wait-soft); color: var(--wait); }
.tl--off .tl__icon { background: var(--off-soft); color: var(--off); }
.tl__body { display: grid; gap: 1px; padding-top: 5px; min-width: 0; }
.tl__date { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.tl__text { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.tl__detail { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }

/* Markdown renderizado */
.prose { font-size: 15px; line-height: 1.65; color: var(--ink-2); overflow-wrap: anywhere; }
.prose h1, .prose h2, .prose h3 { color: var(--ink); line-height: 1.3; margin: 1.2em 0 .4em; letter-spacing: -.015em; }
.prose h1 { font-size: 1.45em; } .prose h2 { font-size: 1.25em; } .prose h3 { font-size: 1.08em; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote, .prose table { margin: 0 0 .9em; }
.prose ul { list-style: disc; padding-left: 1.3em; }
.prose ol { list-style: decimal; padding-left: 1.3em; }
.prose li { margin: .2em 0; }
.prose pre { padding: 12px 14px; border-radius: 12px; background: var(--surface-3); overflow-x: auto; font-size: 13px; white-space: pre-wrap; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { padding-left: 14px; border-left: 3px solid var(--line-strong); color: var(--ink-3); }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }

/* ---------- Capturas ---------- */
.cap { position: relative; padding: 16px 16px 16px 18px; overflow: hidden; }
.cap::before { content: ''; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 0 4px 4px 0; background: var(--line-strong); }
.cap.p-card--principal::before { background: var(--principal); }
.cap.p-card--externo::before { background: var(--externo); }
.cap.p-card--libre::before { background: var(--libre); }
.cap__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cap__title { margin: 10px 0 12px; font-size: 16.5px; font-weight: 700; letter-spacing: -.015em; }
.cap__title a { color: var(--ink); }
.cap__toggle { list-style: none; }
.cap__toggle::-webkit-details-marker { display: none; }
.cap__process[open] .cap__toggle { display: none; }
.incorporar { display: grid; gap: 8px; margin-top: 4px; }
.incorporar .field__label { margin-top: 6px; }
.incorporar .btn--block { margin-top: 10px; }
.incorporar__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- Estoy libre ---------- */
.title-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); }
.title-icon .icon { width: 20px; height: 20px; }
.libre-form { display: grid; gap: 18px; }
.seg--libre .seg__opt { flex: 1 1 auto; justify-content: center; }

.libre-end { margin: 0 0 14px; }
.libre-end__btn { width: 100%; margin-top: 0; background: transparent; text-align: left; cursor: pointer; }
.libre-end__icon { background: var(--accent-soft); color: var(--accent-text); }
.libre-end__text { flex: 1; display: grid; line-height: 1.3; }
.libre-end__text strong { color: var(--ink); font-size: 14.5px; }
.libre-end__text small { color: var(--ink-3); font-size: 12.5px; }

.libre-closed { display: grid; justify-items: start; gap: 14px; }
.libre-closed .bubble { margin-top: 0; width: 100%; }
.libre-try { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }

.libre-intro { display: flex; align-items: flex-start; gap: 12px; margin: 8px 0 14px; }
.libre-intro .bubble { flex: 1; margin-top: 0; }

.reco {
  position: relative; overflow: hidden;
  display: grid; gap: 10px; padding: 18px 18px 18px 20px;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: var(--shadow);
}
.reco::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 0 4px 4px 0; background: var(--line-strong); }
.reco--principal::before { background: var(--principal); }
.reco--externo::before { background: var(--externo); }
.reco--libre::before { background: var(--libre); }
.reco__label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--accent-text); }
.reco__label .icon { width: 15px; height: 15px; }
.reco__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.reco__title { font-size: 19px; font-weight: 800; letter-spacing: -.02em; line-height: 1.3; }
.reco__title a { color: var(--ink); }
.reco__title a:hover { text-decoration: none; }
.reco__parent { display: flex; align-items: center; gap: 6px; margin-top: -4px; font-size: 13px; color: var(--ink-3); }
.reco__parent .icon { width: 15px; height: 15px; }
.reco__why { display: flex; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-text); font-size: 13.5px; font-weight: 600; }
.reco__why .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.reco__go { justify-self: end; }

.row__meta { margin-top: 3px; font-size: 12.5px; gap: 4px 12px; }
.row__why { margin-top: 3px; font-size: 12.5px; color: var(--accent-text); font-weight: 600; }

/* ---------- Rutinas ---------- */
.btn.is-disabled { opacity: .3; pointer-events: none; }

.daynav { display: flex; align-items: center; gap: 8px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.daynav__mid { flex: 1; display: grid; justify-items: center; line-height: 1.25; }
.daynav__label { font-size: 16px; font-weight: 800; }
.daynav__date { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.daynav__chips { display: flex; gap: 6px; margin: 10px 0 4px; }

.rt-progress { display: grid; gap: 8px; margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.rt-progress strong { color: var(--ink); font-size: 16px; }
.rt-group { margin-top: 20px; }
.rt-list { display: grid; gap: 8px; }
.rt-form { margin: 0; }
.rt {
  width: 100%; display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  text-align: left; transition: border-color .15s, background .15s, transform .12s var(--ease);
}
.rt:hover { border-color: var(--line-strong); }
.rt:active { transform: scale(.985); }
.rt .check { flex-shrink: 0; width: 30px; height: 30px; }
.rt.is-on { background: color-mix(in srgb, var(--ok-soft) 70%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.rt.is-on .rt__name { color: var(--ink-2); }
.rt__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rt__name { font-weight: 700; font-size: 15.5px; overflow-wrap: anywhere; }
.rt__sub { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.rt__streak { display: inline-flex; align-items: center; gap: 4px; color: var(--alta); }
.rt__streak .icon { width: 14px; height: 14px; }

.rt-card { position: relative; display: grid; gap: 10px; padding: 16px; }
.rt-card.is-off { background: var(--surface-2); }
.rt-card__top { display: flex; align-items: center; gap: 8px; }
.rt-card__name { flex: 1; font-size: 16.5px; font-weight: 700; }
.rt-card__name a { color: var(--ink); }
.rt-card__name a:hover { text-decoration: none; }
.rt-card__actions { position: relative; z-index: 2; display: flex; gap: 4px; justify-content: flex-end; }
.rt-card__actions form { margin: 0; }

.rt-meta { margin-top: 8px; }
.rt-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 640px) { .rt-kpis { grid-template-columns: repeat(4, 1fr); } }
.rt-toggle { display: flex; justify-content: center; margin: 4px 0 20px; }

.seg--dias { flex-wrap: nowrap; }
.seg--dias .seg__opt { flex: 1 1 0; min-width: 0; justify-content: center; padding: 0; }
.dias-presets { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.dias-presets button { border: 0; background: none; padding: 2px 0; }

/* Heatmap: columnas = semanas (lunes arriba). */
.hm-wrap { overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.hm { display: flex; gap: 6px; width: max-content; }
.hm__days { display: grid; grid-template-rows: 14px repeat(7, 12px); row-gap: 3px; font-size: 10px; font-weight: 700; color: var(--ink-3); }
.hm__days::before { content: ""; } /* ocupa la fila de los meses: L…D quedan alineadas con sus celdas */
.hm__grid { display: flex; gap: 3px; }
.hm__col { display: grid; grid-template-rows: 14px repeat(7, 12px); row-gap: 3px; }
.hm__month { font-size: 10px; font-weight: 700; color: var(--ink-3); white-space: nowrap; width: 12px; overflow: visible; }
.hm__cell { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.hm__cell--hecha { background: var(--ok); }
.hm__cell--incumplida { background: color-mix(in srgb, var(--danger) 45%, var(--surface)); }
.hm__cell--pendiente { box-shadow: inset 0 0 0 2px var(--ok); }
.hm__cell--neutral { background: var(--surface-3); }
.hm__cell--futuro { background: transparent; }
.hm-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.hm-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Inicio: rachas arriba (§31.1). */
.streaks { display: flex; gap: 8px; overflow-x: auto; margin: 8px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
.streaks::-webkit-scrollbar { display: none; }
@media (min-width: 960px) { .streaks { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; } }
.streak {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px 0 11px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  font-size: 13px; font-weight: 600;
}
.streak:hover { text-decoration: none; border-color: var(--line-strong); }
.streak .icon { width: 17px; height: 17px; color: var(--alta); }
.streak strong { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.streak__name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.streak.is-done .icon { color: var(--ok); }
.streak.is-off { opacity: .6; }
.streak--today .icon { color: var(--accent-text); }
.streaks-empty { margin-top: 8px; }
.streaks-empty__icon { background: var(--danger-soft); color: var(--alta); }

/* ---------- Calendario (solo lectura) ---------- */
.sync { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.sync form { margin: 0; }
.sync__info { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sync__info .icon { width: 15px; height: 15px; }
.sync__err { color: var(--wait); }
.weeknav { margin-top: 12px; }

.agenda-day { margin-top: 20px; }
.agenda-day.is-today .block__title { color: var(--accent-text); }
.agenda-day__date { margin-left: 8px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink-3); }
.agenda-day__empty { padding: 10px 14px; font-size: 13.5px; color: var(--ink-3); border: 1px dashed var(--line); border-radius: var(--radius); }
.agenda-more { margin-top: 8px; }

.evs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ev {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 12px 12px 16px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.ev::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--cal); }
.ev.is-past { opacity: .55; }
.ev.is-now { border-color: color-mix(in srgb, var(--cal) 55%, var(--line)); box-shadow: var(--shadow-sm); }
.ev__time { flex-shrink: 0; width: 92px; padding-top: 1px; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.ev__time--all { font-weight: 700; color: var(--ink-2); }
.ev__main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.ev__title { font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; }
.ev__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.ev__cal { display: inline-flex; align-items: center; gap: 5px; }
.ev__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cal); flex-shrink: 0; }
.ev__tag { display: inline-flex; align-items: center; gap: 3px; }
.ev__tag .icon { width: 12px; height: 12px; }
.ev__tag--now { padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); }
.ev__link { flex-shrink: 0; display: grid; place-items: center; width: 32px; height: 32px; margin: -4px -4px 0 0; border-radius: 9px; color: var(--ink-3); }
.ev__link:hover { background: var(--surface-3); color: var(--ink); }
.ev__link .icon { width: 16px; height: 16px; }
@media (max-width: 380px) { .ev { flex-wrap: wrap; } .ev__time { width: 100%; } }

.cal-help { margin-bottom: 12px; }
.cal-uri { display: inline-block; margin-top: 4px; overflow-wrap: anywhere; }
.cal-kv { margin-bottom: 0; }
.cal-list { display: grid; gap: 6px; }
.cal-opt { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.cal-opt:hover { border-color: var(--line-strong); }
.cal-opt input { width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; }
.cal-opt__main { flex: 1; min-width: 0; display: grid; }
.cal-opt__name { font-weight: 700; overflow-wrap: anywhere; }
.cal-opt__role { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.cal-refresh { margin-top: 12px; }

/* ---------- Inicio: resumen de la secretaria (primer viewport) ---------- */
/* Móvil: saludo → próximo evento → avisos → acciones. Escritorio: agenda a la derecha. */
.hero { display: grid; gap: 16px; grid-template-areas: "greet" "cal" "alerts" "actions"; margin-top: 12px; }
.hero__greet { grid-area: greet; min-width: 0; }
.hero__cal { grid-area: cal; min-width: 0; }
.hero__alerts { grid-area: alerts; min-width: 0; display: grid; gap: 10px; align-content: start; }
.hero__actions { grid-area: actions; margin-top: 0; grid-template-columns: repeat(2, 1fr); align-self: end; }
.hero .hello__body { margin-top: 12px; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto; grid-template-areas: "greet cal" "alerts cal" "actions cal"; column-gap: 22px; }
  .hero--sin-agenda { grid-template-columns: minmax(0, 1fr); grid-template-areas: "greet" "alerts" "actions"; }
}

.alerts { display: flex; flex-wrap: wrap; gap: 8px; }
.alert {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 13px 0 10px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: 13.5px; font-weight: 700; cursor: pointer;
  transition: border-color .15s, transform .12s var(--ease);
}
.alert:hover { border-color: var(--line-strong); text-decoration: none; }
.alert:active { transform: scale(.97); }
.alert .icon { width: 16px; height: 16px; }
.alert strong { font-size: 15px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.alert--vencido { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.alert--vencido strong { color: var(--danger); }
.alert--pronto, .alert--espera { background: var(--wait-soft); border-color: transparent; color: var(--wait); }
.alert--pronto strong, .alert--espera strong { color: var(--wait); }
.alert--quieto { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.alert--quieto strong { color: var(--accent-text); }
.alert--rutina .icon { color: var(--alta); }
.alerts__calm { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.alerts__calm .icon { width: 17px; height: 17px; color: var(--ok); }
.hero__notes { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.hero__notes span { display: inline-flex; align-items: center; gap: 5px; }
.hero__notes .icon { width: 14px; height: 14px; }

.cal-next {
  height: 100%; display: grid; gap: 10px; align-content: start;
  padding: 14px; border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 75%, transparent); border: 1px solid var(--line);
}
.cal-next__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-next__label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.cal-next__label .icon { width: 15px; height: 15px; }
.cal-next__main { position: relative; display: grid; gap: 2px; padding: 10px 12px 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.cal-next__main::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--cal); }
.cal-next__main.is-now { border-color: color-mix(in srgb, var(--cal) 55%, var(--line)); }
.cal-next__when { font-size: 12px; font-weight: 800; color: var(--accent-text); }
.cal-next__time { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cal-next__title { font-size: 15.5px; font-weight: 700; overflow-wrap: anywhere; }
.cal-next__main .ev__cal { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.cal-next__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cal-next__list li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-width: 0; }
.cal-next__t { flex-shrink: 0; width: 72px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; }
.cal-next__n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-next__empty { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.cal-next__more, .cal-next__tomorrow { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.cal-next__tomorrow { color: var(--ink-2); }
.cal-next__more .icon, .cal-next__tomorrow .icon { width: 14px; height: 14px; flex-shrink: 0; }
.cal-next__hint { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.cal-next__hint .icon { width: 16px; height: 16px; color: var(--wait); }
.aviso-rows { margin-top: 4px; max-height: 60vh; overflow-y: auto; }

/* ---------- Progreso ---------- */
.prog-tabs { margin-bottom: 16px; }
.prog-emoji { font-size: 1.15em; line-height: 1; }
.prog-h { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }

.prog-resumen {
  padding: 16px 18px; margin-bottom: 14px;
  background:
    radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--presence-b) 18%, transparent), transparent 60%),
    radial-gradient(90% 90% at 0% 100%, color-mix(in srgb, var(--presence-a) 16%, transparent), transparent 60%),
    var(--surface);
}
.prog-obs { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.prog-obs li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.prog-obs__vacio { display: flex; gap: 10px; margin-top: 10px; font-size: 14.5px; color: var(--ink-2); }

.prog-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .prog-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }
.prog-card { padding: 16px 18px; display: grid; gap: 14px; min-width: 0; }
.prog-card__head { display: flex; align-items: center; justify-content: space-between; }

.prog-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.prog-kpi {
  display: grid; gap: 2px; align-content: start; padding: 12px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  transition: border-color .15s, transform .12s var(--ease);
}
.prog-kpi:hover { text-decoration: none; border-color: var(--line-strong); }
.prog-kpi:active { transform: scale(.98); }
.prog-kpi__num { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.prog-kpi__label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.prog-kpi--ok { background: color-mix(in srgb, var(--ok-soft) 70%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 25%, var(--line)); }
.prog-kpi--ok .prog-kpi__num { color: var(--ok); }
.prog-delta { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.prog-delta.is-up { color: var(--ok); }

.prog-chart { width: 100%; height: 170px; }
.prog-note { margin-top: -8px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.prog-empty { font-size: 14px; color: var(--ink-2); padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--radius); }
.prog-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.prog-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 600;
}
.prog-chip:hover { text-decoration: none; border-color: var(--line-strong); }
.prog-chip strong { color: var(--ink); font-weight: 800; }

.prog-rut { display: flex; align-items: center; gap: 16px; }
.prog-ring {
  --pct: 0; flex-shrink: 0; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--ok) calc(var(--pct) * 1%), var(--surface-3) 0);
}
.prog-ring::before { content: ''; grid-area: 1 / 1; width: 74px; height: 74px; border-radius: 50%; background: var(--surface); }
.prog-ring__num { grid-area: 1 / 1; position: relative; font-size: 24px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.prog-ring__num small { font-size: 13px; font-weight: 700; color: var(--ink-3); margin-left: 1px; }
.prog-rut__txt { display: grid; gap: 2px; font-size: 13.5px; color: var(--ink-2); }
.prog-rut__txt strong { font-size: 15px; color: var(--ink); }

/* Heatmap de cumplimiento diario (niveles por proporción de rutinas hechas). */
.prog-hm .hm__col { grid-template-rows: 4px repeat(7, 14px); }
.prog-hm .hm__days { grid-template-rows: 4px repeat(7, 14px); }
.prog-hm .hm__cell { width: 14px; height: 14px; }
.hm__cell--n0 { background: color-mix(in srgb, var(--danger) 40%, var(--surface)); }
.hm__cell--n1 { background: color-mix(in srgb, var(--ok) 30%, var(--surface)); }
.hm__cell--n2 { background: color-mix(in srgb, var(--ok) 55%, var(--surface)); }
.hm__cell--n3 { background: color-mix(in srgb, var(--ok) 78%, var(--surface)); }
.hm__cell--n4 { background: var(--ok); }
.hm__cell--fuera { background: transparent; }
.prog-hm .hm__cell--futuro { box-shadow: inset 0 0 0 1px var(--line); }

/* Al abrir una subtarea recomendada se resalta en el expediente. */
.st:target { margin: 0 -10px; padding-inline: 10px; border-radius: var(--radius-sm); background: var(--accent-soft); scroll-margin-top: calc(var(--topbar-h) + 24px); }

/* ---------- Búsqueda ---------- */
.search {
  position: relative; display: flex; align-items: center;
}
.search__icon { position: absolute; left: 16px; color: var(--ink-3); pointer-events: none; }
.search__input {
  width: 100%; height: 54px; padding: 0 16px 0 46px;
  border: 1px solid var(--line-strong); border-radius: 16px;
  background: var(--surface); font-size: 17px; font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.search__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.search__hint { margin: 8px 4px 18px; font-size: 12.5px; color: var(--ink-3); }
[data-search-results] { transition: opacity .15s; }
[data-search-results].is-loading { opacity: .5; }
.results__count { margin-bottom: 10px; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.results { display: grid; gap: 10px; }
.result {
  display: grid; gap: 8px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  color: var(--ink); transition: border-color .15s, transform .15s var(--ease);
}
.result:hover { text-decoration: none; border-color: var(--line-strong); }
.result:active { transform: scale(.985); }
.result__top { display: flex; gap: 6px; flex-wrap: wrap; }
.result__title { font-weight: 700; font-size: 15.5px; }
.result__match { font-size: 13px; color: var(--ink-2); }
.result__where { display: inline-block; margin-right: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
mark { background: color-mix(in srgb, var(--media) 32%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }

/* ---------- Modales ---------- */
.modal {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 20px;
  border: 1px solid var(--line); border-radius: 24px;
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}
.modal::backdrop { background: rgba(20, 17, 14, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in .24s var(--ease); }
.modal[open]::backdrop { animation: fade-in .2s ease; }
.modal--small { width: min(400px, calc(100vw - 32px)); }
.modal--wide { width: min(760px, calc(100vw - 32px)); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -6px -8px 14px 0; }
.modal__title { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 800; letter-spacing: -.015em; min-width: 0; overflow-wrap: anywhere; }
.modal__title .icon { color: var(--ink-3); }
.modal__text { color: var(--ink-2); font-size: 14px; margin-bottom: 14px; }
.modal__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; }
.modal__foot--end { justify-content: flex-end; }
.modal .field__label { margin-bottom: 8px; }

/* En móvil, los modales "sheet" salen desde abajo */
@media (max-width: 639px) {
  .modal--sheet {
    width: 100%; max-width: 100%;
    margin: auto 0 0; padding-bottom: calc(20px + var(--safe-b));
    border-radius: 26px 26px 0 0; border-bottom: 0;
    max-height: 92dvh;
  }
  .modal--sheet[open] { animation: sheet-in .3s var(--ease); }
  .modal--sheet::before {
    content: ''; display: block; width: 40px; height: 5px; margin: -8px auto 14px;
    border-radius: 99px; background: var(--line-strong);
  }
  .modal--wide { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
}

@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

/* Quick Submit */
.qs { display: grid; gap: 12px; }
.qs .field__label { margin: 6px 0 0; }
.qs__bolt { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--wait-soft); color: var(--wait) !important; }
.qs__bolt .icon { width: 17px; height: 17px; color: inherit; }
.qs__error { font-size: 13px; font-weight: 600; color: var(--danger); }
.qs .modal__foot { margin-top: 8px; }

/* Menú "Más" */
.menu-list { display: grid; gap: 2px; }
.menu-list form { margin: 0; }
.menu-list__item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 14px 12px; border: 0; border-radius: 14px; background: none;
  font-size: 15px; font-weight: 600; color: var(--ink); text-align: left;
}
.menu-list__item:hover { background: var(--surface-3); text-decoration: none; }
.menu-list__item .icon { color: var(--ink-3); }
.menu-list__item.is-disabled { color: var(--ink-3); cursor: default; }
.menu-list__item.is-disabled:hover { background: none; }
.soon { margin-left: auto; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 6px; background: var(--surface-3); color: var(--ink-3); }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; z-index: 100;
  left: 16px; right: 16px; bottom: calc(var(--bottomnav-h) + var(--safe-b) + 14px);
  display: grid; gap: 8px; justify-items: center; pointer-events: none;
}
@media (min-width: 960px) { .toasts { left: auto; right: 24px; bottom: 24px; justify-items: end; } }
.auth-body .toasts { bottom: 24px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  max-width: 440px; padding: 12px 16px;
  border-radius: 14px;
  background: var(--ink); color: var(--bg);
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in .3s var(--ease);
  transition: opacity .3s, transform .3s var(--ease);
}
.toast.is-leaving { opacity: 0; transform: translateY(8px); }
.toast--ok .icon { color: var(--ok); }
.toast--error { background: var(--danger); color: #fff; }
.toast--celebrar { background: linear-gradient(120deg, var(--ok), color-mix(in srgb, var(--ok) 60%, var(--accent))); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }

/* ---------- Login ---------- */
.auth-body {
  min-height: 100dvh;
  background:
    radial-gradient(60% 50% at 85% 10%, color-mix(in srgb, var(--presence-b) 28%, transparent), transparent 70%),
    radial-gradient(60% 50% at 10% 90%, color-mix(in srgb, var(--presence-a) 26%, transparent), transparent 70%),
    var(--bg);
}
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth__card {
  width: min(400px, 100%);
  padding: 32px 24px;
  border-radius: 28px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.auth__card.center { display: grid; justify-items: center; gap: 10px; }
.auth__brand { display: grid; justify-items: center; gap: 6px; margin-bottom: 26px; text-align: center; }
.auth__brand .presence { margin-bottom: 8px; }
.auth__title { font-size: 30px; font-weight: 800; letter-spacing: -.035em; }
.auth__sub { color: var(--ink-3); font-family: var(--font-display); font-size: 16px; }
.error-detail { max-width: 100%; max-height: 260px; overflow: auto; font-size: 11px; text-align: left; background: var(--surface-3); padding: 10px; border-radius: 10px; }

/* ---------- Ajustes de escritorio/tablet ---------- */
@media (min-width: 640px) {
  .hello { padding: 26px 26px 22px; }
  .hello__greet { font-size: 32px; }
  .action { flex-direction: row; align-items: center; min-height: 64px; }
  .page-title { font-size: 32px; }
  .exp { padding: 24px 26px; }
  .exp__title { font-size: 28px; }
  .section { padding: 20px 22px; }
}
@media (max-width: 380px) {
  .hello__actions { grid-template-columns: 1fr; }
  .action { flex-direction: row; align-items: center; min-height: 0; }
}
