/* Rozier · componentes reutilizables (DESIGN.md §6): shell, botones, cards, listas y tablas */

/* ---------- Franja de beta (shell) ---------- */
.beta-strip {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  block-size: var(--beta-h); margin: 0; padding: 0 var(--s-4);
  background: var(--paper-sunk); border-bottom: 1px solid var(--line);
  text-align: center; overflow-wrap: anywhere;
}
.beta-strip::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--warn-600); }
.beta-strip__link {
  flex: none; margin-inline-start: var(--s-2); padding-inline-start: var(--s-3);
  border-inline-start: 1px solid var(--line); color: var(--cobalt-600); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
  transition: color var(--t-micro) var(--ease-out);
}
.beta-strip__link:hover { color: var(--ink-900); }
@media (max-width: 380px) {
  .beta-strip.mono { padding-inline: var(--s-3); gap: var(--s-1); letter-spacing: 0; }
  .beta-strip__link { margin-inline-start: var(--s-1); padding-inline-start: var(--s-2); }
}
body:has(> .beta-strip) .sidebar { top: var(--beta-h); height: calc(100vh - var(--beta-h)); }

/* ---------- Botones ---------- */
.icon-btn {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: var(--r-sm);
  color: var(--ink-500);
  transition: background var(--t-micro) var(--ease-out), color var(--t-micro);
}
.icon-btn:hover { background: var(--paper-sunk); color: var(--ink-900); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg.i { width: 16px; height: 16px; }
.icon-btn--lg svg.i { width: 18px; height: 18px; }
/* Botón de tema: muestra el ícono del estado actual (sistema / claro / oscuro) */
.theme-toggle .t-light, .theme-toggle .t-dark { display: none; }
.theme-toggle[data-state="light"] .t-system, .theme-toggle[data-state="dark"] .t-system { display: none; }
.theme-toggle[data-state="light"] .t-light, .theme-toggle[data-state="dark"] .t-dark { display: block; }
.brand__actions { display: flex; align-items: center; gap: 2px; }
.mobile-top .brand__actions { gap: 10px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--r-pill);
  background: var(--cobalt-grad);
  color: var(--on-accent); font-size: 13px; font-weight: 500; white-space: nowrap;
  box-shadow: var(--shadow-cta);
  transition: transform var(--t-micro) var(--ease-out), box-shadow var(--t-micro) var(--ease-out);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-cta-hover); }
.btn-primary:active { transform: translateY(1px); box-shadow: inset 0 1px 0 var(--accent-press); }
.btn-primary:focus-visible { box-shadow: var(--shadow-cta), var(--ring); }
/* Enlaces de marca / avatar */
.brand > a { border-radius: var(--r-sm); transition: opacity var(--t-micro); }
.brand > a:hover { opacity: .72; }
a.avatar { transition: transform var(--t-micro) var(--ease-out), box-shadow var(--t-micro) var(--ease-out); }
a.avatar:hover { transform: translateY(-1px); box-shadow: var(--shadow-3); }
a.avatar:active { transform: translateY(1px); }
a.avatar:focus-visible { border-radius: 50%; }

/* ---------- Card (nivel 1) ---------- */
.card {
  background: var(--paper-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card-head { display: flex; align-items: center; gap: 8px; padding: 0 12px 18px; flex-wrap: wrap; }
.card-head h2 { flex: 1; font-size: var(--fs-section); font-weight: 500; line-height: 1.2; letter-spacing: -.015em; }

/* ---------- Puntos, chips y badges ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-300)); flex: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--paper-sunk); border: 1px solid var(--line);
  font-size: 11px; color: var(--ink-700); white-space: nowrap;
  transition: background var(--t-micro), box-shadow var(--t-micro), color var(--t-micro);
}
.chip .dot { width: 6px; height: 6px; }
button.chip { position: relative; min-height: 26px; }
button.chip::after { content: ""; position: absolute; inset: -9px -3px; }
/* área táctil de 44px sin cambiar el tamaño visual */
button.chip:hover { color: var(--ink-900); border-color: var(--line-strong); }
button.chip:active { transform: scale(.97); }
button.chip[aria-pressed="true"] { background: var(--paper-2); color: var(--ink-900); font-weight: 500; box-shadow: var(--shadow-1); }
.badge {
  font: 500 11px/1 var(--font-mono);
  padding: 4px 7px; border-radius: var(--r-pill);
  background: var(--paper-sunk); color: var(--ink-500);
}
.badge--alert { background: var(--signal-100); color: var(--signal-600); }
.chip-risk {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 12px; border-radius: 12px;
  background: var(--signal-100); color: var(--signal-600);
  white-space: nowrap;
}
.chip-risk svg.i { width: 16px; height: 16px; stroke-width: 2; }

/* ---------- Sidebar (nivel 1) ---------- */
.sidebar {
  position: sticky; top: 0;
  width: 256px; height: 100vh; flex: none;
  display: flex; flex-direction: column; gap: 22px;
  padding: 32px 14px 20px;
  background: var(--paper-1);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 0 8px; }
.brand b { font: 700 26px/1 var(--font-brand); letter-spacing: -.01em; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav :is(a, button) {
  display: flex; align-items: center; gap: 14px;
  min-height: 52px; padding: 6px 16px 6px 6px;
  border-radius: var(--r-pill);
  color: var(--ink-700);
  transition: background var(--t-micro) var(--ease-out), transform var(--t-micro) var(--ease-out);
}
.nav .ico {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: var(--r-pill);
  background: var(--paper-sunk);
  box-shadow: var(--shadow-sunk);
  transition: background var(--t-micro), color var(--t-micro);
}
.nav .label { flex: 1; }
.nav :is(a, button):hover { background: var(--paper-sunk); }
.nav :is(a, button):hover .ico { background: var(--paper-2); box-shadow: var(--shadow-1); }
.nav :is(a, button):active { transform: scale(.98); }
.nav :is(a, button)[aria-current="page"] {
  background: var(--cobalt-grad);
  color: var(--on-accent); font-weight: 500;
  box-shadow: var(--shadow-cta);
}
.nav :is(a, button)[aria-current="page"] .ico { background: var(--paper-2); color: var(--cobalt-600); box-shadow: var(--shadow-chip); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; flex: none; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 0 12px; }
.user { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 8px; text-align: center; }
.user strong { font-weight: 500; }
.user small { font-size: 12px; color: var(--ink-500); }
.avatar {
  position: relative;
  display: grid; place-items: center;
  width: 64px; height: 64px; margin-bottom: 8px;
  border-radius: 50%;
  border: 3px solid var(--paper-2);
  background: linear-gradient(180deg, var(--avatar-from), var(--avatar-to));
  color: var(--avatar-ink); font-size: 22px; font-weight: 500;
  box-shadow: var(--shadow-2);
}
.avatar .count {
  position: absolute; top: -6px; left: 42px;
  font: 500 11px/1 var(--font-mono);
  padding: 4px 7px; border-radius: var(--r-pill);
  background: var(--ink-900); color: var(--paper-1);
  border: 2px solid var(--paper-1);
}

/* ---------- Topbar + nav segmentado ---------- */
.topbar { display: flex; align-items: center; gap: var(--s-5); }
.topbar__start, .topbar__end { flex: 1; }
.topbar__end { display: flex; justify-content: flex-end; align-items: center; gap: 16px; }
.segmented {
  display: flex; gap: 2px; padding: 4px;
  border-radius: var(--r-pill);
  background: var(--paper-sunk);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sunk);
}
.segmented :is(a, button) {
  padding: 8px 16px; border-radius: var(--r-pill);
  font-size: 13px; color: var(--ink-500); white-space: nowrap;
  transition: color var(--t-micro), background var(--t-elem) var(--ease-out), box-shadow var(--t-elem) var(--ease-out);
}
.segmented :is(a, button):hover { color: var(--ink-900); }
.segmented :is(a, button):active { transform: scale(.97); }
.segmented :is(a, button)[aria-current="page"] {
  color: var(--ink-900); font-weight: 500;
  background: var(--paper-2);
  box-shadow: var(--shadow-1), 0 0 0 1px var(--line);
}
.mobile-top { display: none; }

/* ---------- Saludo + línea de estado (DESIGN §3) ---------- */
.greeting h1 {
  margin-bottom: 8px;
  font-size: var(--fs-greeting); font-weight: 450;
  line-height: 1.1; letter-spacing: var(--track-tight);
}
.status-line {
  font-size: 15px; line-height: 1.5; color: var(--ink-700);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.status-line .skeleton { --w: 22em; display: inline-block; width: 100%; vertical-align: middle; }

/* ---------- Tabla de cuentas ---------- */
.accounts { padding: 20px 12px 12px; }
.accounts table, .accounts thead, .accounts tbody { display: block; width: 100%; }
.accounts tr {
  display: grid; align-items: center; column-gap: 12px;
  grid-template-columns: 48px minmax(170px, 2.4fr) minmax(96px, 1.3fr) minmax(110px, 1.3fr) minmax(80px, 1.1fr) minmax(70px, 1fr) minmax(170px, 2fr) 76px;
  padding: 0 20px;
}
.accounts thead tr { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.accounts th { text-align: left; font-weight: 500; padding: 0; }
.accounts td { padding: 0; }
.accounts tbody tr {
  position: relative;
  padding-block: 22px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: background var(--t-micro) var(--ease-out), box-shadow var(--t-micro) var(--ease-out), border-color var(--t-micro);
}
.accounts tbody tr + tr::before {
  content: ""; position: absolute; top: -1px; left: 20px; right: 20px;
  height: 1px; background: var(--line);
  transition: opacity var(--t-micro);
}
/* Fila en hover: nivel 2 sobre la card de nivel 1 */
.accounts tbody tr:hover, .accounts tbody tr:focus-within {
  background: var(--paper-2);
  border-color: var(--line);
  box-shadow: var(--shadow-2);
  z-index: 1;
}
.accounts tbody tr:hover::before, .accounts tbody tr:hover + tr::before,
.accounts tbody tr:focus-within::before, .accounts tbody tr:focus-within + tr::before { opacity: 0; }
.accounts .name { font-weight: 400; }
.accounts .name .big { display: block; margin-bottom: 4px; }
.big { font-size: var(--fs-row); line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.accounts .is-error td, .accounts .is-empty td { grid-column: 1 / -1; color: var(--ink-500); }
.days { display: flex; gap: 6px; }
.days li {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--dot-off);
  box-shadow: var(--shadow-sunk);
}
.days li.on { background: var(--cobalt-600); box-shadow: 0 0 4px var(--cobalt-glow); }
.open {
  justify-self: end;
  display: inline-flex; gap: 4px; align-items: center;
  font-weight: 500; color: var(--cobalt-600); white-space: nowrap;
  padding: 4px 6px; border-radius: var(--r-sm);
}
.open span { display: inline-block; transition: transform var(--t-micro) var(--ease-out); }
.open::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-md); }
tr:hover .open span, .open:focus-visible span { transform: translateX(4px); }
.open:focus-visible { outline: none; }
.open:focus-visible::after { outline: var(--focus-w) solid var(--focus); outline-offset: -2px; }

/* ---------- Timeline ---------- */
.week-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s-5); align-items: stretch; }
.timeline { padding: 28px 20px; }
.step {
  display: grid; grid-template-columns: 76px 20px minmax(0, 1fr) auto; gap: 20px; align-items: center;
  padding: 0 12px; border-radius: 12px; min-height: 52px;
}
.step time { color: var(--ink-500); white-space: nowrap; }
.step .task { font-size: 17px; }
.step[hidden] { display: none; }
.steps-empty { padding: 12px; color: var(--ink-500); }
.node { position: relative; align-self: stretch; display: grid; place-items: center; }
.node::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px;
  transform: translateX(-50%); background: var(--line-strong);
}
.step.is-first .node::before { top: 50%; }
.step.is-last .node::before { bottom: 50%; }
.node i {
  position: relative;
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-1);
  border: 1.5px solid var(--ink-300);
}
.step.done .node::before { background: linear-gradient(var(--cobalt-600) 50%, var(--line-strong) 50%); }
.step.done .node i { background: var(--cobalt-600); border-color: var(--cobalt-600); color: var(--on-accent); box-shadow: 0 2px 3px var(--cobalt-glow); }
.step.done .node svg.i { width: 12px; height: 12px; stroke-width: 2.4; }
.step.done .task { color: var(--ink-500); text-decoration: line-through; }
.step.today { background: color-mix(in srgb, var(--cobalt-100) 40%, transparent); }
.step.today time { color: var(--cobalt-600); }
.step.today .task { font-weight: 500; }
.step.today .node i { border: 2px solid var(--cobalt-600); background: var(--paper-2); animation: pulse var(--t-pulse) var(--ease-soft) infinite; }
.step.today .node i::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cobalt-600); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--cobalt-glow); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

/* ---------- Alertas ---------- */
.alerts-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line-strong); }
.alerts-head h2 { font-size: var(--fs-section); font-weight: 500; line-height: 1.2; letter-spacing: -.015em; }
.alert-list li { border-bottom: 1px solid var(--line); }
.alert-row {
  display: grid; grid-template-columns: 28px 14px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 52px; padding: 0 8px; margin-inline: -8px; border-radius: var(--r-sm);
  transition: background var(--t-micro) var(--ease-out);
}
.alert-row:hover, .alert-row:focus-visible { background: var(--paper-1); box-shadow: var(--shadow-1); }
.alert-text { font-size: 16px; }
.alert-go { color: var(--ink-500); transition: transform var(--t-micro) var(--ease-out); }
.alert-row:hover .alert-go { transform: translateX(4px); color: var(--ink-900); }
.dot--alta { --c: var(--signal-600); }
.dot--media { --c: var(--warn-600); }
.dot--info { --c: var(--cobalt-600); }

/* ---------- Índice de pantallas ---------- */
.main--index { margin-inline: auto; width: 100%; }
.page-groups { display: grid; gap: var(--s-4); }
.page-list { padding: 12px; }
.page-list > h2 { padding: 8px 20px 4px; color: var(--ink-500); }
.page-list :is(a, button) {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto 24px; align-items: center; gap: 12px;
  padding: 22px 20px; border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: background var(--t-micro) var(--ease-out), box-shadow var(--t-micro) var(--ease-out), border-color var(--t-micro);
}
.page-list :is(a, button):hover, .page-list :is(a, button):focus-visible { background: var(--paper-2); border-color: var(--line); box-shadow: var(--shadow-2); }
.page-list :is(a, button):active { transform: translateY(1px); }
.page-list__name { font-size: var(--fs-row); line-height: 1.1; letter-spacing: -.02em; }
.page-list__go { color: var(--cobalt-600); font-weight: 500; transition: transform var(--t-micro) var(--ease-out); }
.page-list :is(a, button):hover .page-list__go { transform: translateX(4px); }

/* ---------- Footer ---------- */
.foot { display: flex; align-items: flex-end; gap: 40px; padding-top: 28px; border-top: 1px solid var(--line-strong); }
.foot b { font: 700 72px/.85 var(--font-brand); letter-spacing: -.02em; }

/* ---------- Skeleton ---------- */
.skeleton {
  display: block; height: 1em; max-width: var(--w, 100%); border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--paper-sunk) 0%, var(--paper-1) 50%, var(--paper-sunk) 100%) 0 0 / 200% 100%;
  animation: shimmer var(--t-shimmer) linear infinite;
}
.skeleton--sm { --w: 40%; }
.skeleton--md { --w: 70%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Nav inferior flotante (nivel 3, DESIGN §8) ---------- */
.tabbar {
  display: none; justify-content: space-between;
  position: fixed; z-index: 50;
  left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom));
  max-width: 480px; margin-inline: auto;
  padding: 8px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--paper-2) 82%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
}
.tabbar li { flex: 1; }
.tabbar :is(a, button) {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 52px; padding: 8px 4px 10px; border-radius: var(--r-pill);
  font-size: 11px; color: var(--ink-500);
}
.tabbar :is(a, button):hover { color: var(--ink-900); }
.tabbar :is(a, button):active { transform: scale(.95); }
.tabbar :is(a, button):focus-visible { outline-offset: -2px; }
.tabbar :is(a, button)[aria-current="page"] { color: var(--ink-900); font-weight: 500; }
.tabbar :is(a, button)[aria-current="page"]::after {
  content: ""; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--cobalt-600); box-shadow: 0 0 4px var(--cobalt-glow);
}
.tabbar--phone { display: flex; }
.tabbar li.tabbar__cta { flex: none; display: grid; place-items: center; margin-top: -18px; }
.tabbar__cta :is(a, button) {
  display: grid; place-items: center; width: 56px; height: 56px; min-height: 0; padding: 0; border-radius: 50%;
  background: var(--cobalt-grad); color: var(--on-accent); box-shadow: var(--shadow-cta);
  transition: transform var(--t-micro) var(--ease-out), box-shadow var(--t-micro) var(--ease-out);
}
.tabbar__cta :is(a, button):hover { color: var(--on-accent); transform: translateY(-1px); box-shadow: var(--shadow-cta-hover); }
.tabbar__cta :is(a, button):active { transform: translateY(1px); box-shadow: inset 0 1px 0 var(--accent-press); }
.tabbar__cta svg.i { width: 24px; height: 24px; stroke-width: 2; }


/* ---------- Publicaciones: filtros, lista y matriz ---------- */
.status-line--wrap { white-space: normal; overflow: visible; text-overflow: clip; }
.filters { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.filters__end { display: flex; gap: 8px; flex-wrap: wrap; }
.select-chip { position: relative; display: inline-flex; }
.select-chip select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  min-height: 26px; padding: 4px 26px 4px 10px; border-radius: var(--r-pill);
  background: var(--paper-sunk); border: 1px solid var(--line);
  font: inherit; font-size: 11px; color: var(--ink-700);
  transition: border-color var(--t-micro), color var(--t-micro);
}
.select-chip select:hover { color: var(--ink-900); border-color: var(--line-strong); }
.select-chip::after {
  content: ""; position: absolute; right: 11px; top: 50%; width: 5px; height: 5px; pointer-events: none;
  border-right: 1.5px solid var(--ink-500); border-bottom: 1.5px solid var(--ink-500); transform: translateY(-70%) rotate(45deg);
}
.accounts.pub tr { grid-template-columns: 72px minmax(190px, 3fr) 64px minmax(100px, 1.4fr) repeat(4, minmax(64px, 1fr)); }
.accounts.pub .num, .accounts.pub th.num { text-align: right; }
.accounts.pub .big { font-size: 20px; }
.pub-date { color: var(--ink-500); }
.pub-tier { color: var(--ink-500); }
.pub-tier.is-hero { color: var(--cobalt-600); font-weight: 500; }
.pub-pilar { color: var(--ink-500); }
.split-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.howto h2 { padding-bottom: 14px; font-size: var(--fs-section); font-weight: 500; line-height: 1.2; letter-spacing: -.015em; }
.howto__list { border-top: 1px solid var(--line-strong); }
.howto__list li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }

/* ---------- Material grabado: sync, pipeline, recordatorios ---------- */
.sync { border-top: 1px solid var(--line-strong); }
.sync__row {
  display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--line-strong);
}
.sync__row p { font-size: 17px; }
.link-go { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--cobalt-600); font-weight: 500; }
.link-go span { display: inline-block; transition: transform var(--t-micro) var(--ease-out); }
.link-go:hover span { transform: translateX(4px); }
.local { display: grid; gap: var(--s-3); padding: var(--s-4) 0; border-bottom: 1px solid var(--line-strong); }
.local__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-5); }
.local__row h2 { font-size: 15px; font-weight: 500; }
.local__row p { flex: 1 1 240px; min-width: 0; font-size: 15px; color: var(--ink-700); }
.btn-line { min-height: 44px; padding: 10px 18px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-size: 13px; font-weight: 500; white-space: nowrap; transition: background var(--t-micro) var(--ease-out); }
.btn-line:hover:not(:disabled) { background: var(--paper-sunk); }
.btn-line--danger { color: var(--signal-600); border-color: var(--signal-600); }
.btn-line--danger:hover:not(:disabled) { background: var(--signal-100); }
.confirm { display: grid; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--signal-600); border-left-width: 3px; border-radius: var(--r-md); background: var(--signal-100); }
.confirm p { font-size: 15px; color: var(--ink-900); }
.confirm__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.local__msg { font-size: 14px; color: var(--ink-700); }
.local__msg.is-error { color: var(--signal-600); }
.pipe { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-5); align-items: start; }
.pipe__head { display: flex; align-items: flex-end; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line-strong); }
.pipe__count { font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.pipe__list li { padding: 14px 0; border-bottom: 1px solid var(--line-strong); }
.pipe__list .pipe__empty { color: var(--ink-500); }
.clip { display: grid; gap: 2px; }
.clip__name { font-size: 17px; line-height: 1.25; }
.clip__meta { font-size: 10px; text-transform: none; letter-spacing: .02em; overflow-wrap: anywhere; }
.clip__tag { justify-self: start; padding: 2px 8px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--paper-sunk); color: var(--ink-700); font-size: 10px; }
.clip__st { font-size: 14px; color: var(--ink-500); }
.clip__st.is-alert { color: var(--signal-600); }
.remind { padding: 28px 20px 24px; }
.remind .step { grid-template-columns: 96px 20px minmax(0, 1fr); }

/* ---------- Pilares: barras real vs meta ---------- */
.pillars, .pillars thead, .pillars tbody { display: block; width: 100%; }
.pillars tr {
  display: grid; align-items: center; column-gap: 24px;
  grid-template-columns: minmax(180px, 1.5fr) minmax(200px, 2fr) 96px 120px minmax(160px, 1.5fr);
}
.pillars thead tr { padding-bottom: 12px; }
.pillars th { text-align: left; font-weight: 500; padding: 0; }
.pillars tbody tr { padding: 20px 0; border-top: 1px solid var(--line-strong); }
.pillars tbody tr:last-child { border-bottom: 1px solid var(--line-strong); }
.pillars td { padding: 0; min-width: 0; }
.pillars .num, .pillars th.num { text-align: left; }
.pillars .big { font-size: var(--fs-row); }
.pillar-name { display: grid; gap: 2px; }
.pillar-desc { font-size: 13px; color: var(--ink-500); }
.pillars td.is-low .big { color: var(--signal-600); }
.pillar-meta { display: grid; gap: 2px; }
.pillar-meta .big { color: var(--ink-500); font-size: 22px; }
.pillar-diff { font-size: 10px; }
.pillar-diff.is-low { color: var(--signal-600); }
.pillar-best { font-size: 15px; }
.note { display: flex; gap: 16px; align-items: baseline; padding-top: 24px; font-size: 14px; color: var(--ink-500); }
.note .mono { flex: none; }

/* ---------- Ideas: tablero y referencias ---------- */
.board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s-4); align-items: start; }
.board__list { display: grid; gap: var(--s-3); padding-top: 12px; }
.idea {
  display: grid; gap: 4px; padding: 14px;
  background: var(--paper-1); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow-1);
}
.idea__thumb { aspect-ratio: 16 / 10; margin-bottom: 8px; border-radius: var(--r-sm); background: var(--placeholder); }
.idea__name { font-size: 16px; line-height: 1.25; }
.idea__meta { font-size: 10px; }
.idea__late { justify-self: start; margin-top: 8px; padding: 4px 10px; font-size: 12px; }
.refs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 16px; }
.refs-head h2 { font-size: var(--fs-section); font-weight: 500; line-height: 1.2; letter-spacing: -.015em; }
.empty { display: grid; justify-items: start; gap: 4px; padding: 28px 24px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty__phrase { font-size: 20px; line-height: 1.3; letter-spacing: -.01em; }
.refs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s-4); }
.ref { aspect-ratio: 1 / 1.05; border-radius: var(--r-md); background: var(--placeholder); }

/* ---------- Reporte mensual: documento ---------- */
.btn-ink {
  margin-left: auto; min-height: 36px; padding: 8px 18px; border-radius: var(--r-pill);
  background: var(--ink-900); color: var(--paper-0); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: transform var(--t-micro) var(--ease-out), box-shadow var(--t-micro) var(--ease-out);
}
.btn-ink:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn-ink:active { transform: translateY(1px); box-shadow: none; }
.report { display: grid; gap: var(--s-6); padding: var(--s-6) var(--s-6) var(--s-5); }
.report__head { display: flex; align-items: center; gap: var(--s-5); flex-wrap: wrap; }
.report__head h2 { font-size: 15px; font-weight: 500; color: var(--cobalt-600); }
.report__lede { padding-bottom: var(--s-5); border-bottom: 1px solid var(--line-strong); font-size: 18px; font-weight: 400; line-height: 1.5; }
.report__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--line-strong); }
.report__cols .howto h2 { font-size: 20px; }
.report__extras { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5); }
.extra { display: grid; gap: 4px; padding-left: var(--s-5); border-left: 1px solid var(--line); }
.extra:first-child { padding-left: 0; border-left: 0; }
.extra__val { font-size: 28px; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.extra__note { font-size: 13px; color: var(--ink-500); }
.report__sub { padding-bottom: 12px; font-size: var(--fs-section); font-weight: 500; line-height: 1.2; letter-spacing: -.015em; }
.tasks { border-top: 1px solid var(--line-strong); }
.tasks li { border-bottom: 1px solid var(--line); }
.task-check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.task-check input { width: 18px; height: 18px; flex: none; accent-color: var(--cobalt-600); }
.task-check input:checked + span { color: var(--ink-500); text-decoration: line-through; }
.report__foot { display: flex; align-items: flex-end; gap: var(--s-5); padding-top: var(--s-3); }
.report__foot b { font: 700 40px/.9 var(--font-brand); letter-spacing: -.02em; }


/* ---------- Responsive ---------- */
@media print {
  .sidebar, .topbar, .mobile-top, .tabbar, .btn-ink, .greeting, .foot { display: none !important; }
  .main { padding: 0; max-width: none; }
  body::before, body::after { display: none; }
}
/* Desktop bajo: sidebar compacto para que el perfil quepa sin scroll (1440x900) */
@media (min-width: 1101px) and (max-height: 1100px) {
  .sidebar { gap: 12px; padding: 20px 14px 12px; }
  .nav { gap: 2px; }
  .nav :is(a, button) { min-height: 44px; }
  .nav .ico { width: 34px; height: 34px; }
  .user { padding-top: 0; }
  .avatar { width: 52px; height: 52px; margin-bottom: 4px; font-size: 18px; }
  .avatar .count { left: 34px; }
}
@media (max-width: 1240px) {
  .week-grid { grid-template-columns: 1fr; }
  .accounts tr { grid-template-columns: 28px minmax(130px, 2fr) minmax(80px, 1.1fr) minmax(96px, 1.2fr) minmax(56px, .8fr) minmax(52px, .8fr) 164px 56px; column-gap: 8px; padding-inline: 12px; }
  .days { gap: 4px; }
  .accounts th.mono { white-space: nowrap; }
  .topbar__start { white-space: nowrap; }
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: var(--s-6); }
  .refs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pillars tr { column-gap: 16px; grid-template-columns: minmax(150px, 1.4fr) minmax(120px, 1.6fr) 80px 100px minmax(120px, 1.2fr); }
  .pipe { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: var(--s-6); }
  .accounts.pub tr { grid-template-columns: 60px minmax(150px, 2.6fr) 52px minmax(80px, 1.2fr) repeat(4, minmax(48px, 1fr)); }
}
@media (max-width: 1100px) {
  .sidebar { display: none; }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; }
  .mobile-top b { font: 700 24px/1 var(--font-brand); }
  .mobile-top .avatar { width: 44px; height: 44px; margin: 0; font-size: 16px; border-width: 2px; }
  .mobile-top .avatar .count { left: 28px; }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .topbar__start { flex: 1 1 auto; }
  .topbar__end { flex: none; }
  .topbar__end .mono { display: none; }
  .btn-primary, .btn-ink { min-height: 44px; padding-inline: 18px; }
  .week-card__title a { display: inline-flex; align-items: center; min-height: 44px; }
  .segmented { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .segmented :is(a, button) { flex: 1; text-align: center; min-height: 44px; padding: 12px; }
  .icon-btn { width: 44px; height: 44px; }
  .card { border-radius: 20px; }
  .accounts { padding: 8px; }
  .accounts thead { display: none; }
  .accounts tbody tr {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas:
      "name name name num"
      "f l e a"
      "days days days open";
    row-gap: 16px; column-gap: 8px;
    align-items: end;
    padding: 18px 14px;
  }
  .accounts tbody tr + tr::before { left: 14px; right: 14px; }
  .accounts tbody tr > :nth-child(1) { grid-area: num; justify-self: end; align-self: start; }
  .accounts tbody tr > :nth-child(2) { grid-area: name; align-self: start; }
  .accounts tbody tr > :nth-child(3) { grid-area: f; }
  .accounts tbody tr > :nth-child(4) { grid-area: l; }
  .accounts tbody tr > :nth-child(5) { grid-area: e; }
  .accounts tbody tr > :nth-child(6) { grid-area: a; }
  .accounts tbody tr > :nth-child(7) { grid-area: days; align-self: center; }
  .accounts tbody tr > :nth-child(8) { grid-area: open; justify-self: end; align-self: center; }
  .accounts td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 6px;
    font: 500 10px/1.3 var(--font-mono); letter-spacing: var(--track-mono); text-transform: uppercase; color: var(--ink-500);
  }
  .accounts td[data-label] .big { font-size: 20px; }
  .accounts .name .big { font-size: 24px; white-space: nowrap; }
  .chip-risk { padding-inline: 6px; margin-left: -6px; }
  .chip-risk svg.i { display: none; }
  .open { min-height: 44px; padding-inline: 8px; }
  .days { gap: 5px; }
  .timeline { padding: 20px 8px; }
  .card-head { padding: 0 8px 14px; }
  .card-head h2 { flex-basis: 100%; }
  .step { grid-template-columns: 20px minmax(0, 1fr) auto; grid-template-areas: "node time chip" "node task task"; column-gap: 14px; row-gap: 2px; padding: 10px 8px; min-height: 64px; }
  .step .node { grid-area: node; margin-block: -10px; }
  .step time { grid-area: time; font-size: 13px; }
  .step .task { grid-area: task; font-size: 16px; }
  .step .chip { grid-area: chip; justify-self: end; }
  .alert-row { min-height: 56px; }
  .filters__end { width: 100%; }
  .select-chip { min-height: 44px; align-items: center; }
  .select-chip select { min-height: 44px; padding-inline: 14px 30px; }
  .select-chip::after { right: 14px; }
  .accounts.pub tbody tr {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas: "name name name vs" "v e c f" "tier tier pilar pilar";
    row-gap: 14px;
  }
  .accounts.pub tbody tr > :nth-child(1) { grid-area: f; justify-self: start; align-self: end; }
  .accounts.pub tbody tr > :nth-child(2) { grid-area: name; align-self: start; }
  .accounts.pub tbody tr > :nth-child(3) { grid-area: tier; }
  .accounts.pub tbody tr > :nth-child(4) { grid-area: pilar; }
  .accounts.pub tbody tr > :nth-child(5) { grid-area: v; }
  .accounts.pub tbody tr > :nth-child(6) { grid-area: e; }
  .accounts.pub tbody tr > :nth-child(7) { grid-area: c; }
  .accounts.pub tbody tr > :nth-child(8) { grid-area: vs; justify-self: end; align-self: start; }
  .accounts.pub td[data-label="Fecha"]::before, .accounts.pub td[data-label="Pieza"]::before, .accounts.pub td[data-label="vs mediana"]::before { display: none; }
  .accounts.pub .num { text-align: left; }
  .accounts.pub td[data-label="vs mediana"] { text-align: right; }
  .accounts.pub .name .big { white-space: normal; font-size: 22px; }
  .accounts.pub td[data-label] .big { font-size: 20px; }
  .accounts.pub td[data-label="Tier"]::before, .accounts.pub td[data-label="Pilar"]::before { display: inline; margin: 0 6px 0 0; }
  .split-grid { grid-template-columns: 1fr; gap: var(--s-5); }
  .sync__row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; padding: 12px 0; }
  .sync__row .mono { grid-column: 1 / -1; }
  .sync__row p { font-size: 16px; }
  .pipe { grid-template-columns: 1fr; gap: var(--s-6); }
  .pipe__count { font-size: 32px; }
  .pipe__list li { padding: 12px 0; min-height: 44px; }
  .remind { padding: 20px 8px; }
  .pillars thead { display: none; }
  .pillars tbody tr {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "name real meta" "bar bar bar" "best best best";
    row-gap: 12px; column-gap: 16px; padding: 18px 0;
  }
  .pillars tbody tr > :nth-child(1) { grid-area: name; }
  .pillars tbody tr > :nth-child(2) { grid-area: bar; }
  .pillars tbody tr > :nth-child(3) { grid-area: real; text-align: right; }
  .pillars tbody tr > :nth-child(4) { grid-area: meta; text-align: right; }
  .pillars tbody tr > :nth-child(5) { grid-area: best; }
  .pillars .big { font-size: 22px; }
  .pillars td[data-label]::before {
    content: attr(data-label); display: block; font: 500 10px/1.3 var(--font-mono); letter-spacing: var(--track-mono); text-transform: uppercase; color: var(--ink-500);
  }
  .pillars td.pillar-best::before { display: inline; margin-right: 8px; }
  .note { flex-direction: column; gap: 6px; }
  .board { grid-template-columns: 1fr; gap: var(--s-6); }
  .idea { grid-template-columns: 88px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; padding: 12px; align-content: center; }
  .idea__thumb { grid-row: 1 / span 3; align-self: center; aspect-ratio: 1; margin: 0; }
  .refs-head { flex-wrap: wrap; }
  .refs-head h2 { font-size: 20px; }
  .link-go { white-space: nowrap; }
  .idea__late { min-height: 28px; }
  .refs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
  .report { padding: var(--s-5) var(--s-4); gap: var(--s-5); }
  .report__head { gap: var(--s-3); }
  .report__cols { grid-template-columns: 1fr; gap: var(--s-5); }
  .report__extras { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s-5); }
  .extra:nth-child(odd) { padding-left: 0; border-left: 0; }
  .extra__val { font-size: 22px; }
  .page-list :is(a, button) { grid-template-columns: 28px minmax(0, 1fr) 20px; padding: 18px 12px; }
  .page-list__meta { display: none; }
  .page-list__name { font-size: 22px; }
  .main--index { padding-top: 20px; }
  .foot { gap: 16px; flex-direction: column; align-items: flex-start; padding-bottom: 8px; }
  .foot b { font-size: 56px; }
  .tabbar { display: flex; }
}

/* Próximamente: aria-disabled + aviso (toast). Sigue enfocable y pulsable; el aviso explica por qué no hace nada */
:is(a, button).is-disabled, button:disabled { opacity: .45; cursor: not-allowed; }
.toast {
  position: fixed; left: 50%; bottom: var(--s-5); z-index: 20;
  max-width: min(420px, calc(100vw - 2 * var(--s-4))); margin: 0;
  padding: var(--s-3) var(--s-4); border-radius: var(--r-pill);
  background: var(--ink-900); color: var(--paper-1);
  box-shadow: var(--shadow-3); font-size: 14px; text-align: center;
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none;
  transition: opacity var(--t-elem) var(--ease-out), transform var(--t-elem) var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 1100px) { .toast { bottom: calc(96px + env(safe-area-inset-bottom)); } }
.pipe__more { margin-top: var(--s-3); }
.nav button { width: 100%; text-align: left; }
.btn-primary:disabled:hover { transform: none; box-shadow: var(--shadow-cta); }

/* ---------- Estados de error y vacíos (aviso de carga fallida, listas sin elementos) ---------- */
.load-error {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3) var(--s-4);
  margin: var(--s-3) 0 var(--s-5); padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line-strong); border-left: 3px solid var(--signal-600); border-radius: var(--r-md);
  background: var(--signal-100); color: var(--ink-900);
}
.load-error .i { flex: none; width: 20px; height: 20px; color: var(--signal-600); }
.load-error__text { flex: 1 1 240px; min-width: 0; font-size: var(--fs-body); line-height: 1.5; }
.load-error__retry {
  min-height: 44px; padding: 8px 20px; border-radius: var(--r-pill);
  background: var(--ink-900); color: var(--paper-0); font-size: 13px; font-weight: 500;
  transition: transform var(--t-micro) var(--ease-out), box-shadow var(--t-micro) var(--ease-out);
}
.load-error__retry:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.load-error__retry:active { transform: translateY(1px); box-shadow: none; }
.load-error__retry:focus-visible { outline: 2px solid var(--signal-600); outline-offset: 2px; }
.alert-list__empty, .tasks__empty, .board__empty { padding: var(--s-4) var(--s-3); font-size: var(--fs-body); color: var(--ink-500); }
.board__empty { border: 1px dashed var(--line-strong); border-radius: var(--r-md); }

/* ---------- Franja de pendientes: fija bajo la cabecera mobile ---------- */
.franja { position: sticky; top: calc(var(--s-2) + env(safe-area-inset-top)); z-index: 4; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s-2); min-height: 44px; padding: var(--s-2) var(--s-4); border-radius: var(--r-pill); background: var(--paper-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow-1); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink-900); }
.franja[hidden] { display: none; }
.franja__sep { color: var(--ink-500); }
.franja__dato--risk { color: var(--signal-600); }
