/* Copia de design/trion-bloque/components/bundle.css — no editar aquí: cambia la base y vuelve a copiar. */
@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@700;800;900&family=Inter:wght@400;500;600;700;800&display=swap");

/* TriON Bloque — clases de componentes. Solo usan variables de tokens.css. Prefijo tb- */

html, body { background: var(--bg); color: var(--text); font-family: var(--font-sans); }
body { margin: 0; -webkit-font-smoothing: antialiased; }
.tb-frame { padding: var(--space-5); display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-start; }
.tb-col { display: flex; flex-direction: column; gap: var(--space-3); }
.tb-row-flex { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.tb-ico { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tb-ico--sm { width: 16px; height: 16px; }
.tb-ico--lg { width: 24px; height: 24px; }
.tb-num { font-variant-numeric: tabular-nums; }
.tb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tb-display { font-family: var(--font-display); }

/* ---------- Botones ---------- */
.tb-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--control); padding: 0 22px; border: 0; border-radius: var(--radius-pill); font: 700 14px/18px var(--font-sans); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .15s; }
.tb-btn:focus-visible, .tb-iconbtn:focus-visible, .tb-fab:focus-visible, .tb-tab:focus-visible, .tb-rail__item:focus-visible, .tb-side__item:focus-visible, .tb-seg__opt:focus-visible, .tb-chip-btn:focus-visible, .tb-option:focus-visible, .tb-row--link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.tb-btn--primary { background: var(--lime); color: var(--ink); }
.tb-btn--primary:hover { background: var(--lime-soft); }
.tb-btn--secondary { background: var(--paper); color: var(--ink); }
.tb-btn--secondary:hover { background: #FFFFFF; }
.tb-btn--outline { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-control); }
.tb-btn--outline:hover { background: var(--block); }
.tb-btn--ghost { background: transparent; color: var(--lime); padding: 0 12px; }
.tb-btn--ghost:hover { color: var(--lime-soft); }
.tb-btn--danger { background: var(--coral); color: var(--ink); }
.tb-btn--sm { height: 40px; padding: 0 16px; font-size: 13px; }
.tb-btn--lg { height: 56px; padding: 0 28px; font-size: 16px; }
.tb-btn--block { width: 100%; }
.tb-btn[disabled], .tb-btn[aria-disabled="true"] { background: var(--block-2); color: var(--text-3); box-shadow: none; cursor: not-allowed; }

.tb-iconbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--touch); height: var(--touch); border-radius: var(--radius-pill); border: 0; background: var(--block); color: var(--text); cursor: pointer; }
.tb-iconbtn:hover { background: var(--block-2); }
.tb-iconbtn--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-control); }
.tb-iconbtn--lime { background: var(--lime); color: var(--ink); }
.tb-iconbtn--paper { background: var(--paper); color: var(--ink); }
.tb-dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 5px; background: var(--coral); box-shadow: 0 0 0 2px var(--bg); }
.tb-count { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; border-radius: 10px; background: var(--coral); color: var(--ink); font: 800 11px/20px var(--font-sans); text-align: center; }

.tb-fab { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 28px; border: 0; background: var(--lime); color: var(--ink); box-shadow: var(--shadow-float); cursor: pointer; }
.tb-fab--extended { width: auto; padding: 0 22px 0 18px; gap: var(--space-2); font: 800 15px var(--font-sans); }

/* ---------- Superficies ---------- */
.tb-block { background: var(--block); color: var(--text); border-radius: var(--radius-lg); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); box-sizing: border-box; }
.tb-block--paper { background: var(--paper); color: var(--ink); }
.tb-block--lime { background: var(--lime); color: var(--ink); }
.tb-block--sunken { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.tb-block__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.tb-block__title { margin: 0; font: 700 13px/16px var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.tb-block--paper .tb-block__title, .tb-block--lime .tb-block__title { color: var(--ink-2); }
.tb-link { color: var(--lime); font: 700 14px/18px var(--font-sans); text-decoration: none; }
.tb-link:hover { color: var(--lime-soft); text-decoration: underline; }

/* ---------- Bloque destacado (hero) ---------- */
.tb-hero { background: var(--lime); color: var(--ink); border-radius: var(--radius-xl); padding: var(--space-6); display: flex; flex-direction: column; gap: 14px; box-sizing: border-box; }
.tb-hero__head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.tb-hero__label { font: 700 14px/18px var(--font-display); letter-spacing: .04em; text-transform: uppercase; }
.tb-hero__value { font: 900 56px/1 var(--font-display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.tb-hero__meta { font: 600 14px/20px var(--font-sans); }
.tb-hero__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.tb-hero__stat { background: rgba(10,10,10,0.12); border-radius: var(--radius-md); padding: 10px 12px; display: flex; flex-direction: column; }
.tb-hero__stat b { font: 900 24px/1.1 var(--font-display); }
.tb-hero__stat span { font: 600 12px/16px var(--font-sans); }
.tb-hero--xl .tb-hero__value { font-size: 84px; letter-spacing: -0.045em; }
.tb-pill-dark { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); background: var(--ink); color: var(--lime); font: 800 12px/16px var(--font-sans); }
.tb-dots { display: flex; gap: 6px; justify-content: center; }
.tb-dots span { width: 8px; height: 8px; border-radius: 4px; background: var(--block-2); }
.tb-dots span.is-on { width: 22px; background: var(--lime); }

/* ---------- Dato (stat) ---------- */
.tb-stat { background: var(--block); color: var(--text); border-radius: var(--radius-lg); padding: var(--space-5); display: flex; flex-direction: column; gap: 4px; box-sizing: border-box; }
.tb-stat__label { font: 700 13px/16px var(--font-display); letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.tb-stat__value { font: 900 44px/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tb-stat__meta { font: 600 13px/18px var(--font-sans); color: var(--text-2); }
.tb-stat--sm .tb-stat__value { font-size: 26px; line-height: 30px; }
.tb-stat--paper { background: var(--paper); color: var(--ink); }
.tb-stat--paper .tb-stat__label, .tb-stat--paper .tb-stat__meta { color: var(--ink-2); }
.tb-stat--lime { background: var(--lime); color: var(--ink); }
.tb-stat--lime .tb-stat__label, .tb-stat--lime .tb-stat__meta { color: var(--ink-2); }
.tb-delta { font: 700 13px/18px var(--font-sans); }
.tb-delta--up { color: var(--lime); }
.tb-delta--down { color: var(--coral); }
.tb-stat--paper .tb-delta--up, .tb-stat--lime .tb-delta--up { color: var(--ink); }

/* ---------- Progreso ---------- */
.tb-progress { height: 12px; border-radius: var(--radius-pill); background: var(--block-2); overflow: hidden; }
.tb-progress__bar { height: 100%; border-radius: inherit; background: var(--lime); }
.tb-progress--sm { height: 6px; }
.tb-progress--on-lime { background: rgba(10,10,10,0.15); }
.tb-progress--on-lime .tb-progress__bar { background: var(--ink); }
.tb-segments { display: flex; gap: 6px; }
.tb-segments span { flex: 1; height: 10px; border-radius: 5px; background: var(--block-2); }
.tb-segments span.is-on { background: var(--paper); }
.tb-segments span.is-today { background: var(--lime); }
.tb-segments span.is-miss { background: var(--coral); }
.tb-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.tb-ring svg { transform: rotate(-90deg); }
.tb-ring__track { fill: none; stroke: var(--block-2); }
.tb-ring__bar { fill: none; stroke: var(--lime); stroke-linecap: round; }
.tb-ring__label { position: absolute; font: 900 22px/1 var(--font-display); }

/* ---------- Chips y etiquetas ---------- */
.tb-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); background: var(--block-2); color: var(--text); font: 600 12px/16px var(--font-sans); white-space: nowrap; }
.tb-chip--lima { background: var(--lime-tint); color: var(--lime); }
.tb-chip--turquesa { background: var(--turquesa-tint); color: var(--turquesa); }
.tb-chip--azul { background: var(--azul-tint); color: var(--azul); }
.tb-chip--violeta { background: var(--violeta-tint); color: var(--violeta); }
.tb-chip--naranja { background: var(--naranja-tint); color: var(--naranja); }
.tb-chip--coral { background: var(--coral-tint); color: var(--coral); }
.tb-chip--solid { background: var(--lime); color: var(--ink); }
.tb-chip--paper { background: var(--paper); color: var(--ink); }
.tb-chip--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-control); }
.tb-chip-btn { height: 36px; padding: 0 14px; border: 0; border-radius: var(--radius-pill); background: var(--block); color: var(--text); font: 700 13px var(--font-sans); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tb-chip-btn[aria-pressed="true"] { background: var(--paper); color: var(--ink); }

/* ---------- Avatar ---------- */
.tb-avatar { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--paper); color: var(--ink); font: 800 15px/1 var(--font-display); flex-shrink: 0; overflow: hidden; }
.tb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tb-avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.tb-avatar--lg { width: 64px; height: 64px; font-size: 22px; }
.tb-avatar--block { background: var(--block-2); color: var(--text); }
.tb-avatar--ring { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--lime); }

/* ---------- Navegación móvil ---------- */
.tb-tabbar { display: flex; align-items: center; justify-content: space-between; height: var(--tabbar); padding: 0 8px; box-sizing: border-box; border-radius: var(--radius-pill); background: var(--block); box-shadow: var(--shadow-float); }
.tb-tab { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 48px; min-width: 48px; border-radius: 24px; color: var(--text); text-decoration: none; font: 700 14px/18px var(--font-sans); }
.tb-tab__label { display: none; }
.tb-tab[aria-current="page"] { background: var(--lime); color: var(--ink); padding: 0 18px; }
.tb-tab[aria-current="page"] .tb-tab__label { display: inline; }
.tb-tab--add { background: var(--paper); color: var(--ink); }

.tb-topbar { display: flex; align-items: center; gap: var(--space-3); }
.tb-topbar__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tb-topbar__eyebrow { font: 700 13px/16px var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.tb-topbar__title { margin: 0; font: 900 26px/30px var(--font-display); letter-spacing: -0.02em; }
.tb-topbar--back .tb-topbar__title { font-size: 20px; line-height: 26px; font-weight: 800; }

/* ---------- Navegación escritorio ---------- */
.tb-rail { width: var(--rail); box-sizing: border-box; padding: 20px 0; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.tb-rail__logo { width: 48px; height: 48px; border-radius: 16px; background: var(--block); display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-3); }
.tb-rail__item { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 18px; color: var(--text); text-decoration: none; }
.tb-rail__item:hover { background: var(--block); }
.tb-rail__item[aria-current="page"] { background: var(--lime); color: var(--ink); }
.tb-side { width: 248px; box-sizing: border-box; padding: 20px 14px; display: flex; flex-direction: column; gap: var(--space-5); }
.tb-side__group { display: flex; flex-direction: column; gap: 2px; }
.tb-side__title { padding: 0 12px 6px; font: 700 12px/16px var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.tb-side__item { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: var(--radius-pill); color: var(--text); text-decoration: none; font: 600 14px/18px var(--font-sans); }
.tb-side__item:hover { background: var(--block); }
.tb-side__item[aria-current="page"] { background: var(--lime); color: var(--ink); font-weight: 800; }
.tb-side__item .tb-chip { margin-left: auto; }

.tb-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--radius-pill); background: var(--block); }
.tb-seg__opt { height: 40px; padding: 0 16px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--text); font: 700 14px/18px var(--font-sans); cursor: pointer; white-space: nowrap; }
.tb-seg__opt[aria-pressed="true"], .tb-seg__opt[aria-selected="true"] { background: var(--paper); color: var(--ink); }

.tb-tabs { display: flex; gap: var(--space-2); overflow-x: auto; }
.tb-tabs__item { height: 40px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: var(--radius-pill); color: var(--text); text-decoration: none; font: 700 14px/18px var(--font-sans); white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line); }
.tb-tabs__item[aria-current="page"] { background: var(--paper); color: var(--ink); box-shadow: none; }

/* ---------- Listas ---------- */
.tb-list { background: var(--block); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.tb-row { display: flex; align-items: center; gap: var(--space-3); min-height: var(--row); padding: 10px 16px; box-sizing: border-box; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.tb-row:last-child { border-bottom: 0; }
.tb-row--link:hover { background: rgba(255,255,255,0.04); }
.tb-row__lead { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tb-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tb-row__title { font: 700 15px/20px var(--font-sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-row__sub { font: 500 13px/18px var(--font-sans); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-row__time { width: 46px; flex-shrink: 0; font: 800 14px/18px var(--font-display); font-variant-numeric: tabular-nums; }
.tb-row__meta { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font: 800 15px/18px var(--font-display); }
.tb-tint-turquesa { background: var(--turquesa-tint); color: var(--turquesa); }
.tb-tint-azul { background: var(--azul-tint); color: var(--azul); }
.tb-tint-violeta { background: var(--violeta-tint); color: var(--violeta); }
.tb-tint-naranja { background: var(--naranja-tint); color: var(--naranja); }
.tb-tint-coral { background: var(--coral-tint); color: var(--coral); }
.tb-tint-lima { background: var(--lime-tint); color: var(--lime); }
.tb-swipe { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--block-2); }
.tb-swipe__actions { position: absolute; inset: 0 0 0 auto; display: flex; }
.tb-swipe__actions button { width: 76px; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 700 12px var(--font-sans); color: var(--ink); cursor: pointer; }
.tb-swipe__front { position: relative; transform: translateX(-228px); background: var(--block); }

/* ---------- Tarjetas ---------- */
.tb-card { background: var(--block); color: var(--text); border-radius: var(--radius-lg); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); box-sizing: border-box; }
.tb-card__head { display: flex; align-items: flex-start; gap: var(--space-3); }
.tb-card__title { margin: 0; font: 800 18px/24px var(--font-display); }
.tb-card__sub { font: 500 13px/18px var(--font-sans); color: var(--text-2); }
.tb-card__actions { display: flex; gap: var(--space-2); }
.tb-card__actions .tb-btn { flex: 1; }
.tb-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.tb-kv div { background: var(--block-2); border-radius: var(--radius-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.tb-kv dt, .tb-kv .k { font: 600 12px/16px var(--font-sans); color: var(--text-3); }
.tb-kv dd, .tb-kv .v { margin: 0; font: 800 16px/20px var(--font-display); }

/* ---------- Embudo ---------- */
.tb-funnel { display: flex; flex-direction: column; gap: 12px; }
.tb-funnel__row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 40px; align-items: center; gap: 10px; }
.tb-funnel__name { font: 600 14px/18px var(--font-sans); }
.tb-funnel__track { height: 14px; border-radius: var(--radius-pill); background: var(--block-2); }
.tb-funnel__fill { height: 100%; border-radius: inherit; }
.tb-funnel__n { text-align: right; font: 900 18px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.tb-funnel__conv { grid-column: 2 / 4; margin-top: -8px; font: 600 12px/16px var(--font-sans); color: var(--text-3); }
.tb-funnel-cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: end; height: 170px; }
.tb-funnel-cols > div { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; height: 100%; }
.tb-funnel-cols b { font: 900 22px/1 var(--font-display); }
.tb-funnel-cols i { display: block; border-radius: 12px; }
.tb-funnel-cols span { font: 600 12px/16px var(--font-sans); color: var(--text-2); }
.tb-pills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.tb-pills a { border-radius: var(--radius-md); padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); }
.tb-pills b { font: 900 24px/1.1 var(--font-display); }
.tb-pills span { font: 700 12px/16px var(--font-sans); }

/* ---------- Semana del plan ---------- */
.tb-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2); }
.tb-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 0; border-radius: 18px; background: var(--block-2); color: var(--text); }
.tb-day small { font: 700 12px/16px var(--font-sans); }
.tb-day b { font: 900 20px/1.1 var(--font-display); }
.tb-day.is-done { background: var(--paper); color: var(--ink); }
.tb-day.is-today { background: var(--lime); color: var(--ink); }
.tb-day.is-miss { background: transparent; box-shadow: inset 0 0 0 2px var(--coral); }

/* ---------- Liga ---------- */
.tb-rank { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 8px 14px; border-radius: var(--radius-md); color: var(--text); }
.tb-rank__pos { width: 28px; font: 900 18px/1 var(--font-display); text-align: center; font-variant-numeric: tabular-nums; }
.tb-rank__name { flex: 1; min-width: 0; font: 700 15px/20px var(--font-sans); }
.tb-rank__pts { font: 900 17px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.tb-rank__move { font: 700 12px/16px var(--font-sans); width: 30px; text-align: right; }
.tb-rank.is-me { background: var(--lime); color: var(--ink); }
.tb-medal { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 14px; color: var(--ink); font: 900 14px/1 var(--font-display); }
.tb-medal--oro { background: var(--oro); }
.tb-medal--plata { background: var(--plata); }
.tb-medal--bronce { background: var(--bronce); }
.tb-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); align-items: end; }
.tb-podium > div { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tb-podium i { display: flex; align-items: flex-start; justify-content: center; width: 100%; border-radius: 18px 18px 6px 6px; padding-top: 10px; font: 900 22px/1 var(--font-display); font-style: normal; color: var(--ink); }

/* ---------- Formularios ---------- */
.tb-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tb-field__label { font: 700 13px/16px var(--font-sans); color: var(--text-2); }
.tb-input, .tb-select, .tb-textarea { box-sizing: border-box; width: 100%; height: var(--control); padding: 0 16px; border-radius: var(--radius-md); border: 1px solid transparent; background: var(--block-2); color: var(--text); font: 500 16px/22px var(--font-sans); outline: none; }
.tb-textarea { height: auto; min-height: 96px; padding: 12px 16px; resize: vertical; }
.tb-select { appearance: none; padding-right: 44px; background-image: linear-gradient(45deg, transparent 50%, #FFFFFF 50%), linear-gradient(135deg, #FFFFFF 50%, transparent 50%); background-position: calc(100% - 22px) 21px, calc(100% - 16px) 21px; background-size: 6px 6px; background-repeat: no-repeat; }
.tb-input::placeholder, .tb-textarea::placeholder { color: var(--placeholder); }
.tb-input:focus, .tb-select:focus, .tb-textarea:focus { border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime-tint); }
.tb-input[aria-invalid="true"] { border-color: var(--coral); }
.tb-field__help { font: 500 13px/18px var(--font-sans); color: var(--text-2); }
.tb-field__error { font: 600 13px/18px var(--font-sans); color: var(--coral); }
.tb-search { display: flex; align-items: center; gap: 10px; height: var(--control); padding: 0 18px; border-radius: var(--radius-pill); background: var(--block); color: var(--text-2); box-sizing: border-box; }
.tb-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font: 500 15px var(--font-sans); }
.tb-search input::placeholder { color: var(--placeholder); }
.tb-search:focus-within { box-shadow: 0 0 0 2px var(--lime); }
.tb-switch { position: relative; display: inline-flex; width: 52px; height: 32px; flex-shrink: 0; }
.tb-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tb-switch span { width: 100%; height: 100%; border-radius: 16px; background: var(--block-2); box-shadow: inset 0 0 0 1px var(--line-control); transition: background .15s; }
.tb-switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 12px; background: var(--paper); transition: transform .15s; }
.tb-switch input:checked + span { background: var(--lime); box-shadow: none; }
.tb-switch input:checked + span::after { transform: translateX(20px); background: var(--ink); }
.tb-switch input:focus-visible + span { box-shadow: var(--focus-ring); }
.tb-check { display: inline-flex; align-items: center; gap: 10px; font: 600 15px var(--font-sans); cursor: pointer; }
.tb-check input { appearance: none; width: 24px; height: 24px; margin: 0; border-radius: 8px; box-shadow: inset 0 0 0 2px var(--line-control); background: transparent; display: grid; place-content: center; cursor: pointer; }
.tb-check input:checked { background: var(--lime); box-shadow: none; }
.tb-check input:checked::after { content: ""; width: 10px; height: 6px; border-left: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: translateY(-2px) rotate(-45deg); }
.tb-check input:focus-visible { box-shadow: var(--focus-ring); }
.tb-option { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--block-2); color: var(--text); border: 2px solid transparent; font: 700 15px/20px var(--font-sans); cursor: pointer; text-align: left; }
.tb-option[aria-pressed="true"], .tb-option[aria-checked="true"] { background: var(--lime-tint); border-color: var(--lime); }
.tb-stepper { display: flex; align-items: center; gap: 4px; }
.tb-stepper button { width: 44px; height: 44px; border: 0; border-radius: 22px; background: var(--block-2); color: var(--text); font: 800 20px var(--font-sans); cursor: pointer; }
.tb-stepper output { min-width: 48px; text-align: center; font: 900 22px var(--font-display); }
.tb-sign { height: 160px; border-radius: var(--radius-md); background: var(--paper); color: var(--ink-2); display: flex; align-items: flex-end; padding: 14px; box-sizing: border-box; font: 600 13px var(--font-sans); }

/* ---------- Pasos (asistentes) ---------- */
.tb-steps { display: flex; flex-direction: column; gap: 8px; }
.tb-steps__bar { display: flex; gap: 6px; }
.tb-steps__bar span { flex: 1; height: 6px; border-radius: 3px; background: var(--block-2); }
.tb-steps__bar span.is-done { background: var(--paper); }
.tb-steps__bar span.is-now { background: var(--lime); }
.tb-steps__text { font: 700 13px/16px var(--font-sans); color: var(--text-2); }

/* ---------- Hoja inferior y modal ---------- */
.tb-sheet { background: var(--block); color: var(--text); border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 10px var(--space-5) var(--space-6); box-shadow: var(--shadow-float); display: flex; flex-direction: column; gap: var(--space-4); box-sizing: border-box; }
.tb-sheet__grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-control); align-self: center; }
.tb-sheet__title { margin: 0; font: 900 22px/28px var(--font-display); }
.tb-actions-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.tb-action { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: var(--radius-md); background: var(--block-2); color: var(--text); text-decoration: none; font: 700 14px/18px var(--font-sans); }
.tb-action i { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.tb-scrim { background: rgba(0,0,0,0.72); }
.tb-modal { background: var(--block); color: var(--text); border-radius: var(--radius-xl); padding: var(--space-6); box-shadow: var(--shadow-float); display: flex; flex-direction: column; gap: var(--space-4); max-width: 520px; box-sizing: border-box; }
.tb-modal__title { margin: 0; font: 900 24px/30px var(--font-display); }
.tb-modal__foot { display: flex; justify-content: flex-end; gap: var(--space-2); }
.tb-menu { background: var(--block); border-radius: var(--radius-md); padding: 6px; box-shadow: var(--shadow-float), inset 0 0 0 1px var(--line); display: flex; flex-direction: column; min-width: 220px; }
.tb-menu a, .tb-menu button { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: 600 14px var(--font-sans); text-decoration: none; text-align: left; cursor: pointer; }
.tb-menu a:hover, .tb-menu button:hover { background: var(--block-2); }
.tb-menu .is-danger { color: var(--coral); }
.tb-menu hr { border: 0; height: 1px; background: var(--line); margin: 6px 0; }

/* ---------- Avisos ---------- */
.tb-toast { display: inline-flex; align-items: center; gap: var(--space-3); min-height: 48px; padding: 6px 6px 6px 18px; box-sizing: border-box; border-radius: var(--radius-pill); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-float); font: 700 14px/18px var(--font-sans); }
.tb-toast button { height: 36px; padding: 0 14px; border: 0; border-radius: 18px; background: var(--ink); color: var(--lime); font: 800 13px var(--font-sans); cursor: pointer; }
.tb-toast--ok { background: var(--lime); }
.tb-toast--error { background: var(--coral); }
.tb-alert { display: flex; gap: var(--space-3); align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-md); background: var(--block); color: var(--text); font: 500 14px/20px var(--font-sans); }
.tb-alert b { display: block; font-weight: 800; }
.tb-alert__ico { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tb-alert--error { background: var(--coral-tint); }
.tb-alert--error .tb-alert__ico { background: var(--coral); color: var(--ink); }
.tb-alert--info { background: var(--azul-tint); }
.tb-alert--info .tb-alert__ico { background: var(--azul); color: var(--ink); }
.tb-alert--ok { background: var(--lime-tint); }
.tb-alert--ok .tb-alert__ico { background: var(--lime); color: var(--ink); }
.tb-alert--pending { background: transparent; box-shadow: inset 0 0 0 1px var(--line-control); }
.tb-alert--pending .tb-alert__ico { background: var(--block-2); color: var(--text); }
.tb-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: var(--space-7) var(--space-5); border-radius: var(--radius-lg); background: var(--block); }
.tb-empty__ico { width: 64px; height: 64px; border-radius: 22px; background: var(--block-2); color: var(--lime); display: flex; align-items: center; justify-content: center; }
.tb-empty h3 { margin: 0; font: 900 20px/26px var(--font-display); }
.tb-empty p { margin: 0; max-width: 300px; font: 500 14px/20px var(--font-sans); color: var(--text-2); }
.tb-skel { background: var(--block-2); border-radius: var(--radius-md); animation: tb-pulse 1.4s ease-in-out infinite; }
@keyframes tb-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .tb-skel { animation: none; } * { transition: none !important; } }

/* ---------- Tablas (escritorio) ---------- */
.tb-table-wrap { background: var(--block); border-radius: var(--radius-lg); overflow: auto; }
.tb-table { width: 100%; border-collapse: collapse; color: var(--text); font: 500 14px/20px var(--font-sans); }
.tb-table th { position: sticky; top: 0; background: var(--block); padding: 14px 16px; text-align: left; white-space: nowrap; font: 700 12px/16px var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--line); }
.tb-table th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.tb-table th[aria-sort] { color: var(--lime); }
.tb-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tb-table tr:last-child td { border-bottom: 0; }
.tb-table tbody tr:hover td { background: rgba(255,255,255,0.04); }
.tb-table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.tb-table tr.is-me td { background: var(--lime-tint); }
.tb-pager { display: flex; align-items: center; gap: 6px; }
.tb-pager a, .tb-pager span { min-width: 40px; height: 40px; padding: 0 8px; box-sizing: border-box; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); text-decoration: none; font: 700 14px var(--font-sans); }
.tb-pager a:hover { background: var(--block); }
.tb-pager [aria-current="page"] { background: var(--paper); color: var(--ink); }
.tb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

/* ---------- Fechas ---------- */
.tb-range { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border: 0; border-radius: var(--radius-pill); background: var(--block); color: var(--text); font: 700 14px var(--font-sans); cursor: pointer; }
.tb-pop { background: var(--block); border-radius: var(--radius-lg); box-shadow: var(--shadow-float), inset 0 0 0 1px var(--line); padding: var(--space-4); display: flex; gap: var(--space-4); }
.tb-presets { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.tb-presets button { height: 40px; padding: 0 12px; border: 0; border-radius: 20px; background: transparent; color: var(--text); font: 600 14px var(--font-sans); text-align: left; cursor: pointer; }
.tb-presets button[aria-pressed="true"] { background: var(--paper); color: var(--ink); font-weight: 800; }
.tb-cal { display: grid; grid-template-columns: repeat(7, 40px); gap: 2px; }
.tb-cal span { height: 40px; display: flex; align-items: center; justify-content: center; font: 600 14px var(--font-sans); color: var(--text); border-radius: 20px; }
.tb-cal .h { font: 700 12px var(--font-sans); color: var(--text-3); }
.tb-cal .in { background: var(--lime-tint); border-radius: 0; }
.tb-cal .end { background: var(--lime); color: var(--ink); font-weight: 800; }
.tb-cal .out { color: var(--placeholder); }

/* ---------- Historial ---------- */
.tb-timeline { display: flex; flex-direction: column; }
.tb-tl { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--space-3); padding-bottom: var(--space-4); position: relative; }
.tb-tl::before { content: ""; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: var(--line); }
.tb-tl:last-child::before { display: none; }
.tb-tl i { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.tb-tl b { display: block; font: 700 15px/20px var(--font-sans); }
.tb-tl span { font: 500 13px/18px var(--font-sans); color: var(--text-2); }

/* ---------- Gráficos ---------- */
.tb-bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; }
.tb-bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.tb-bars i { width: 100%; border-radius: 8px 8px 4px 4px; background: var(--block-2); }
.tb-bars i.is-now { background: var(--lime); }
.tb-bars span { font: 600 12px/16px var(--font-sans); color: var(--text-2); }

/* ---------- Cajón lateral (escritorio) ---------- */
.tb-drawer { width: 420px; max-width: 100%; box-sizing: border-box; background: var(--block); color: var(--text); border-radius: var(--radius-xl) 0 0 var(--radius-xl); box-shadow: var(--shadow-float); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.tb-drawer__head { display: flex; align-items: center; gap: var(--space-3); }
.tb-drawer__title { flex: 1; margin: 0; font: 900 22px/28px var(--font-display); }
.tb-drawer__foot { margin-top: auto; display: flex; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--line); }

/* ---------- Tablero (escritorio) ---------- */
.tb-kanban { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: var(--space-3); overflow-x: auto; }
.tb-kcol { background: var(--block); border-radius: var(--radius-lg); padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }
.tb-kcol__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 6px; }
.tb-kcard { background: var(--block-2); border-radius: var(--radius-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.tb-kcard b { font: 700 14px/20px var(--font-sans); }
.tb-kcard.is-drag { box-shadow: var(--shadow-float), 0 0 0 2px var(--lime); transform: rotate(-1.5deg); }

/* ---------- Plegables ---------- */
.tb-acc { background: var(--block); border-radius: var(--radius-lg); overflow: hidden; }
.tb-acc details { border-bottom: 1px solid var(--line); }
.tb-acc details:last-child { border-bottom: 0; }
.tb-acc summary { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; cursor: pointer; font: 700 15px/20px var(--font-sans); }
.tb-acc summary::-webkit-details-marker { display: none; }
.tb-acc summary::after { content: "+"; margin-left: auto; font: 800 20px var(--font-sans); color: var(--lime); }
.tb-acc details[open] summary::after { content: "−"; }
.tb-acc .tb-acc__body { padding: 0 16px 16px; font: 500 14px/20px var(--font-sans); color: var(--text-2); }
.tb-upload { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: var(--space-6); border-radius: var(--radius-md); background: var(--block-2); box-shadow: inset 0 0 0 2px var(--line-control); text-align: center; font: 600 14px/20px var(--font-sans); }
