/* admin.css — panel web de Paru (desktop). SOLO variables de tokens.css (sin hex a mano fuera de tokens).
   Tipografía: Unbounded títulos/cifras, Inter el resto. Densidad de panel: filas de 40 px. */
:root {
  --side-w: 240px;
  --side-w-collapsed: 72px;
  --topbar-h: 56px;
  --drawer-w: 480px;
  --content-max: 1440px;
  --row-h: 40px;
  --chart-grid: var(--border-subtle);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--surface-0); color: var(--text-primary); font-family: var(--font-body); font-size: var(--fs-body-m); line-height: var(--lh-normal); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.mono { font-family: var(--font-mono); }
.ta-right { text-align: right; }
.ta-center { text-align: center; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns var(--dur-base) var(--ease); }
body.is-collapsed .shell { grid-template-columns: var(--side-w-collapsed) minmax(0, 1fr); }
body.is-login .shell { grid-template-columns: minmax(0, 1fr); }
body.is-login .side, body.is-login .topbar { display: none; }

.side { position: sticky; top: 0; height: 100vh; overflow: hidden auto; display: flex; flex-direction: column; background: var(--surface-1); border-right: 1px solid var(--border-subtle); padding: var(--sp-4) var(--sp-3); gap: var(--sp-3); scrollbar-width: thin; }
.side__brand { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-2); min-height: 40px; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-body-l); white-space: nowrap; }
.side__logo { width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--brand); color: var(--text-primary); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-body-m); box-shadow: var(--glow-brand); }
.side__brand small { font-family: var(--font-body); font-weight: 500; color: var(--text-tertiary); font-size: var(--fs-body-s); }
.side__brand .iconbtn { margin-left: auto; }
.cmdk { display: flex; align-items: center; gap: var(--sp-2); min-height: 40px; padding: 0 var(--sp-3); border-radius: var(--r-input); background: var(--surface-2); border: 1px solid var(--border-subtle); color: var(--text-tertiary); font-size: var(--fs-body-s); width: 100%; text-align: left; white-space: nowrap; }
.cmdk:hover { border-color: var(--border-strong); color: var(--text-secondary); }
.cmdk kbd { margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-overline); padding: 1px 6px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text-secondary); }
.nav { display: flex; flex-direction: column; gap: var(--sp-1); }
.nav__group { display: flex; flex-direction: column; gap: 2px; }
.nav__label { padding: var(--sp-4) var(--sp-3) var(--sp-1); font-size: var(--fs-overline); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-tertiary); white-space: nowrap; display: flex; align-items: center; gap: var(--sp-2); }
.nav__label::after { content: ''; flex: 1; height: 1px; background: var(--border-subtle); }
.nav__item { display: flex; align-items: center; gap: var(--sp-3); min-height: 40px; padding: 0 var(--sp-3); border-radius: var(--r-input); color: var(--text-secondary); font-weight: 500; font-size: var(--fs-body-s); white-space: nowrap; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.nav__item:hover { background: var(--surface-2); color: var(--text-primary); }
.nav__item[aria-current="page"] { background: var(--brand-soft); color: var(--text-primary); box-shadow: inset 2px 0 0 var(--brand); }
.nav__item[aria-current="page"] .icon { color: var(--brand); }
.nav__text { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav__count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-chip); background: var(--surface-3); color: var(--text-primary); font-size: var(--fs-overline); font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.nav__count--alert { background: var(--danger); }
.side__foot { margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid var(--border-subtle); }
.side__me { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; padding: 0 var(--sp-1); }
.side__me-text { display: grid; line-height: 1.2; min-width: 0; flex: 1; }
.side__me-text b { font-size: var(--fs-body-s); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side__me-text small { font-size: var(--fs-overline); color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side__hub { display: block; margin-top: var(--sp-2); font-size: var(--fs-overline); color: var(--text-tertiary); padding: 0 var(--sp-2); white-space: nowrap; }
.side__hub:hover { color: var(--text-secondary); }

body.is-collapsed .side { padding: var(--sp-4) var(--sp-2); }
body.is-collapsed .side__brand { justify-content: center; padding: 0; }
body.is-collapsed .side__brand span, body.is-collapsed .side__brand small, body.is-collapsed .cmdk span, body.is-collapsed .cmdk kbd,
body.is-collapsed .nav__text, body.is-collapsed .nav__label span, body.is-collapsed .side__me-text, body.is-collapsed .side__hub, body.is-collapsed [data-logout] { display: none; }
body.is-collapsed .side__brand .iconbtn { margin: 0; }
body.is-collapsed .cmdk { justify-content: center; padding: 0; }
body.is-collapsed .nav__item { justify-content: center; padding: 0; position: relative; }
body.is-collapsed .nav__count { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; font-size: 9px; padding: 0 4px; }
body.is-collapsed .side__me { justify-content: center; }
body.is-collapsed .nav__label { padding: var(--sp-3) 0 var(--sp-1); }
.side__collapse .icon { transition: transform var(--dur-base) var(--ease); }
body.is-collapsed .side__collapse .icon { transform: rotate(180deg); }

.iconbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-input); color: var(--text-secondary); position: relative; }
.iconbtn:hover { background: var(--surface-3); color: var(--text-primary); }
.iconbtn--sm { width: 32px; height: 32px; }

/* topbar */
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-6); background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-bottom: 1px solid var(--border-subtle); }
.topbar__title { display: flex; align-items: baseline; gap: var(--sp-2); font-family: var(--font-display); font-size: var(--fs-body-m); font-weight: 600; min-width: 0; }
.topbar__crumb { font-family: var(--font-body); font-size: var(--fs-body-s); color: var(--text-tertiary); text-transform: capitalize; }
.topbar__spacer { flex: 1; }
.city { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 36px; padding: 0 var(--sp-3); border-radius: var(--r-input); border: 1px solid var(--border-subtle); background: var(--surface-2); color: var(--text-secondary); font-size: var(--fs-body-s); font-weight: 500; cursor: not-allowed; opacity: .75; position: relative; }
.city:hover::after { content: attr(data-tooltip); position: absolute; top: calc(100% + 6px); right: 0; white-space: nowrap; padding: 6px 10px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text-primary); font-size: var(--fs-overline); box-shadow: var(--shadow-sheet); z-index: 5; }
.bell { position: relative; }
.bell__count { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-chip); background: var(--brand); color: var(--text-primary); font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface-1); }
.bellpop { position: absolute; top: calc(var(--topbar-h) - 6px); right: var(--sp-6); width: 380px; max-width: calc(100vw - 32px); background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-card); box-shadow: var(--shadow-sheet); padding: var(--sp-3); display: grid; gap: var(--sp-1); z-index: 40; }
.bellpop__head { font-family: var(--font-display); font-size: var(--fs-body-s); font-weight: 600; padding: var(--sp-1) var(--sp-2) var(--sp-2); display: flex; justify-content: space-between; }
.bellpop__all { padding: var(--sp-2); font-size: var(--fs-body-s); color: var(--brand); font-weight: 600; text-align: right; }
.rolechip { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-chip); background: var(--surface-2); border: 1px solid var(--border-subtle); }
.rolechip__btn { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 var(--sp-3); border-radius: var(--r-chip); font-size: var(--fs-body-s); font-weight: 600; color: var(--text-secondary); transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.rolechip__btn[aria-pressed="true"] { background: var(--surface-3); color: var(--text-primary); box-shadow: var(--elev-1); }
.rolechip__btn[data-role="host"][aria-pressed="true"] { color: var(--live); }
.rolechip__btn[data-role="admin"][aria-pressed="true"] { color: var(--brand); }
.nav-toggle { display: none; }
.nav-scrim { display: none; }

/* main */
.main { flex: 1; width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--sp-6) var(--sp-6) var(--sp-12); min-width: 0; transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease); }
.main.is-leaving { opacity: 0; transform: translateY(4px); }
.main.is-entering { opacity: 0; transform: translateY(6px); transition: none; }
.section { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
body.is-login .main { max-width: none; padding: 0; display: grid; place-items: center; min-height: 100vh; }

/* page header */
.phead { display: grid; gap: var(--sp-1); }
.phead__row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.phead__title { font-family: var(--font-display); font-size: var(--fs-display-l); font-weight: 700; line-height: var(--lh-tight); outline: none; }
.phead__sub { margin: var(--sp-1) 0 0; color: var(--text-secondary); font-size: var(--fs-body-s); }
.phead__actions { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.crumbs { font-size: var(--fs-body-s); color: var(--text-tertiary); display: flex; gap: var(--sp-2); }
.crumbs a:hover { color: var(--text-primary); }

/* buttons (reusa .btn de components.css) */
.btn--sm { min-height: 36px; padding: 0 var(--sp-3); font-size: var(--fs-body-s); border-radius: var(--r-input); }
.btn--default { background: var(--surface-2); }
.btn--danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 16%, transparent); }

/* ---------- grid helpers ---------- */
.grid { display: grid; gap: var(--sp-4); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--map { grid-template-columns: minmax(0, 6fr) minmax(420px, 6fr); }
.grid--charts { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(300px, 3fr); }
.stack { display: grid; gap: var(--sp-4); align-content: start; }
@media (max-width: 1280px) { .grid--charts { grid-template-columns: 1fr 1fr; } .grid--charts > :last-child { grid-column: 1 / -1; } }
@media (max-width: 1100px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid--map, .grid--3 { grid-template-columns: 1fr; } }

/* ---------- stat tile ---------- */
.stat { display: grid; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5); background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: var(--r-card); box-shadow: var(--elev-1); min-width: 0; position: relative; }
a.stat:hover { border-color: var(--border-strong); }
.stat--brand { border-color: var(--brand); box-shadow: var(--elev-1), 0 0 0 1px var(--brand-soft), 0 0 24px color-mix(in srgb, var(--brand) 18%, transparent); }
.stat--live .stat__value { color: var(--live); }
.stat--danger .stat__value { color: var(--danger); }
.stat__top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.stat__label { font-size: var(--fs-body-s); color: var(--text-secondary); font-weight: 500; }
.stat--brand .stat__label { color: var(--text-primary); }
.stat__row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); min-width: 0; }
.stat__value { font-family: var(--font-display); font-size: var(--fs-display-xl); font-weight: 700; line-height: 1; letter-spacing: -.01em; white-space: nowrap; flex: none; }
.stat__value--long { font-size: var(--fs-display-l); }
.stat__spark { flex: 0 1 120px; min-width: 56px; color: var(--text-tertiary); }
.stat__spark svg { width: 100%; height: auto; }
.stat__foot { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-body-s); min-height: 18px; flex-wrap: wrap; }
.stat__delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.stat__delta.is-good { color: var(--success); }
.stat__delta.is-bad { color: var(--danger); }
.stat__delta.is-flat { color: var(--text-tertiary); }
.stat__hint { color: var(--text-tertiary); }

/* ---------- card ---------- */
.acard { background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: var(--r-card); box-shadow: var(--elev-1); min-width: 0; display: flex; flex-direction: column; }
.acard__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5) 0; }
.acard__title { font-family: var(--font-display); font-size: var(--fs-body-m); font-weight: 600; line-height: var(--lh-snug); }
.acard__sub { margin: 2px 0 0; font-size: var(--fs-body-s); color: var(--text-tertiary); }
.acard__actions { display: flex; gap: var(--sp-2); align-items: center; flex: none; }
.acard__body { padding: var(--sp-4) var(--sp-5) var(--sp-5); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acard__body > * { min-width: 0; }
.acard--flush .acard__body { padding: var(--sp-3) 0 0; }
.acard--flush .tbl-wrap { border: 0; border-radius: 0 0 var(--r-card) var(--r-card); }

/* ---------- table ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: var(--r-input); background: var(--surface-1); }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-body-s); }
.tbl caption { text-align: left; padding: var(--sp-3) var(--sp-4); font-family: var(--font-display); font-size: var(--fs-body-s); font-weight: 600; }
.tbl th, .tbl td { text-align: left; padding: 0 var(--sp-3); height: var(--row-h); border-bottom: 1px solid var(--border-subtle); white-space: nowrap; vertical-align: middle; }
.tbl th:first-child, .tbl td:first-child { padding-left: var(--sp-4); }
.tbl th:last-child, .tbl td:last-child { padding-right: var(--sp-4); }
.tbl th { position: sticky; top: 0; background: var(--surface-2); color: var(--text-secondary); font-weight: 600; font-size: var(--fs-overline); letter-spacing: .06em; text-transform: uppercase; height: 36px; z-index: 1; }
.tbl td { font-variant-numeric: tabular-nums; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tr.is-link { cursor: pointer; }
.tbl tr.is-link:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.tbl--dense th, .tbl--dense td { height: 36px; padding-left: var(--sp-2); padding-right: var(--sp-2); }
.tbl td .echip { max-width: 100%; }
.tbl td.col-main { max-width: 0; min-width: 160px; width: 34%; overflow: hidden; }
.tbl td.col-main .echip { width: 100%; }
.tbl__empty td { text-align: center; color: var(--text-tertiary); height: 80px !important; white-space: normal; }
.tbl .ta-right { text-align: right; }
.tbl td.ta-right { font-variant-numeric: tabular-nums; }
.tbl b { font-weight: 600; }
.tbl .sub { display: block; color: var(--text-tertiary); font-size: var(--fs-overline); line-height: 1.2; }
.tbl__strong { font-weight: 600; }

/* ---------- badge ---------- */
.abadge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 var(--sp-2); border-radius: var(--r-chip); font-size: var(--fs-overline); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; background: var(--surface-3); color: var(--text-secondary); border: 1px solid transparent; }
.abadge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.abadge--live { background: var(--live); color: var(--text-inverse); }
.abadge--live .abadge__dot { animation: pulse var(--dur-pulse) ease-in-out infinite; }
.abadge--soon { background: color-mix(in srgb, var(--state-soon) 18%, transparent); color: var(--state-soon); }
.abadge--ended { background: transparent; border-color: var(--border-subtle); color: var(--text-tertiary); }
.abadge--success { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.abadge--warning { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.abadge--danger { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.abadge--info { background: color-mix(in srgb, var(--info) 16%, transparent); color: var(--info); }
.abadge--brand { background: var(--brand-soft); color: var(--brand); }
.abadge--neutral { background: var(--surface-3); color: var(--text-secondary); }
.abadge--genre { background: var(--surface-3); color: var(--text-primary); text-transform: none; letter-spacing: 0; font-weight: 600; }
.abadge--genre .abadge__dot { background: var(--g); width: 8px; height: 8px; }

/* ---------- toolbar ---------- */
.tb { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.tb__search { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 36px; padding: 0 var(--sp-3); border-radius: var(--r-input); background: var(--surface-2); border: 1px solid var(--border-subtle); color: var(--text-tertiary); min-width: 240px; }
.tb__search:focus-within { border-color: var(--border-strong); }
.tb__search input { background: none; border: 0; outline: none; color: var(--text-primary); flex: 1; min-width: 0; font-size: var(--fs-body-s); }
.tb__search input::placeholder { color: var(--text-tertiary); }
.tb__filter { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-body-s); color: var(--text-tertiary); }
.tb__filter select, .aselect { min-height: 36px; padding: 0 var(--sp-3); border-radius: var(--r-input); background: var(--surface-2); border: 1px solid var(--border-subtle); color: var(--text-primary); font-size: var(--fs-body-s); }
.tb__actions { margin-left: auto; display: flex; gap: var(--sp-2); }

/* ---------- tabs ---------- */
.atabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--border-subtle); overflow-x: auto; scrollbar-width: none; }
.atabs__tab { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 40px; padding: 0 var(--sp-3); font-size: var(--fs-body-s); font-weight: 600; color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color var(--dur-fast) var(--ease); }
.atabs__tab:hover { color: var(--text-primary); }
.atabs__tab[aria-selected="true"] { color: var(--text-primary); border-bottom-color: var(--brand); }
.atabs__count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-chip); background: var(--surface-3); font-size: var(--fs-overline); display: grid; place-items: center; color: var(--text-secondary); }
.atabs__tab[aria-selected="true"] .atabs__count { background: var(--brand-soft); color: var(--text-primary); }

/* ---------- drawer ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: var(--drawer-w); max-width: 100vw; z-index: 60; background: var(--surface-1); border-left: 1px solid var(--border-strong); box-shadow: var(--shadow-sheet); display: flex; flex-direction: column; transform: translateX(100%); transition: transform var(--dur-base) var(--ease); }
.drawer.is-open { transform: none; }
.drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-5) var(--sp-5) var(--sp-3); border-bottom: 1px solid var(--border-subtle); }
.drawer__title { font-family: var(--font-display); font-size: var(--fs-display-m); font-weight: 700; line-height: var(--lh-snug); }
.drawer__sub { margin: var(--sp-1) 0 0; color: var(--text-secondary); font-size: var(--fs-body-s); }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--sp-4) var(--sp-5); display: grid; gap: var(--sp-4); align-content: start; }
.drawer__foot { display: flex; gap: var(--sp-2); justify-content: flex-end; padding: var(--sp-3) var(--sp-5) var(--sp-5); border-top: 1px solid var(--border-subtle); flex-wrap: wrap; }
.scrim { position: fixed; inset: 0; z-index: 55; background: color-mix(in srgb, var(--surface-0) 55%, transparent); opacity: 0; transition: opacity var(--dur-base) var(--ease); }
.scrim.is-open { opacity: 1; }
.dsec { display: grid; gap: var(--sp-2); }
.dsec__title { font-size: var(--fs-overline); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-tertiary); }
.breakdown { display: grid; gap: 6px; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-input); background: var(--surface-2); font-size: var(--fs-body-s); }
.breakdown div { display: flex; justify-content: space-between; gap: var(--sp-3); }
.breakdown .is-total { border-top: 1px solid var(--border-strong); padding-top: 6px; font-weight: 700; font-family: var(--font-display); }
.breakdown .is-neg { color: var(--danger); }

/* ---------- kv ---------- */
.akv { margin: 0; display: grid; }
.akv__row { display: grid; grid-template-columns: 150px 1fr; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-body-s); align-items: center; }
.akv__row:last-child { border-bottom: 0; }
.akv dt { color: var(--text-tertiary); margin: 0; }
.akv dd { margin: 0; min-width: 0; }

/* ---------- avatar / chips ---------- */
.aavatar { --sz: 28px; --avatar-color: var(--surface-3); position: relative; width: var(--sz); height: var(--sz); border-radius: 50%; display: inline-grid; place-items: center; background: var(--avatar-color); color: var(--text-inverse); font-weight: 700; font-size: calc(var(--sz) * .36); overflow: hidden; flex: none; vertical-align: middle; }
.aavatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.uchip { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.uchip__text { display: grid; line-height: 1.15; min-width: 0; }
.uchip__text b { font-weight: 600; font-size: var(--fs-body-s); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uchip__text small { color: var(--text-tertiary); font-size: var(--fs-overline); }
.echip { --g: var(--genre-otro); display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; max-width: 100%; }
.echip:hover b { color: var(--brand); }
.echip__emoji { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; font-size: 15px; background: color-mix(in srgb, var(--g) 22%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--g) 45%, transparent); }
.echip__text { display: grid; line-height: 1.15; min-width: 0; }
.echip__text b { font-weight: 600; font-size: var(--fs-body-s); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.echip__text small { color: var(--text-tertiary); font-size: var(--fs-overline); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- alerts ---------- */
.alerts { display: grid; gap: var(--sp-1); }
.alert { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-input); border: 1px solid var(--border-subtle); background: var(--surface-2); color: var(--text-secondary); transition: border-color var(--dur-fast) var(--ease); }
.alert:hover { border-color: var(--border-strong); }
.alert__ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.alert--danger .alert__ic { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.alert--warning .alert__ic { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.alert--info .alert__ic { background: color-mix(in srgb, var(--info) 16%, transparent); color: var(--info); }
.alert--success .alert__ic { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.alert__text { display: grid; flex: 1; min-width: 0; line-height: 1.2; }
.alert__text b { color: var(--text-primary); font-weight: 600; font-size: var(--fs-body-s); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert__text small { font-size: var(--fs-overline); color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- meter ---------- */
.ameter { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 88px; }
.ameter__track { flex: 1; height: 6px; border-radius: var(--r-chip); background: var(--surface-3); overflow: hidden; }
.ameter__fill { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.ameter--live .ameter__fill { background: var(--live); }
.ameter--warning .ameter__fill { background: var(--warning); }
.ameter--danger .ameter__fill { background: var(--danger); }
.ameter__val { font-size: var(--fs-overline); color: var(--text-secondary); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* ---------- empty / skeleton ---------- */
.aempty { display: grid; justify-items: center; text-align: center; gap: var(--sp-2); padding: var(--sp-8) var(--sp-4); }
.aempty--compact { padding: var(--sp-5) var(--sp-4); }
.aempty__art { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: var(--surface-2); border: 1px solid var(--border-subtle); }
.aempty h3 { font-family: var(--font-display); font-size: var(--fs-body-l); font-weight: 600; }
.aempty p { margin: 0; color: var(--text-secondary); font-size: var(--fs-body-s); max-width: 40ch; }
.aempty__cta { margin-top: var(--sp-2); }
.ask-wrap { display: grid; gap: var(--sp-3); padding: var(--sp-2) 0; }
.ask { position: relative; overflow: hidden; height: 14px; border-radius: 6px; background: var(--surface-2); }
.ask::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--border-strong), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.error-banner { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-input); background: color-mix(in srgb, var(--danger) 16%, var(--surface-1)); border: 1px solid var(--danger); color: var(--text-primary); font-size: var(--fs-body-s); }

/* ---------- charts (SVG) ---------- */
.chart { width: 100%; height: auto; display: block; font-family: var(--font-body); overflow: visible; }
.chart--donut { width: auto; }
.chart__grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart__axis { stroke: var(--border-strong); stroke-width: 1; }
.chart__goal { stroke: var(--text-tertiary); stroke-width: 1; stroke-dasharray: 3 4; }
.chart__tick, .chart__xlabel, .chart__ylabel { fill: var(--text-tertiary); font-size: 11px; }
.chart__ylabel { fill: var(--text-secondary); }
.chart__xlabel.is-strong { fill: var(--text-primary); font-weight: 600; }
.chart__vlabel { fill: var(--text-primary); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart__cellv { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart__hero { fill: var(--text-primary); font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.chart__hit { fill: transparent; }
.chart__bar path, .chart__bar rect:not(.chart__hit) { transition: opacity var(--dur-fast) var(--ease); }
.chart__bar.is-hot path, .chart__bar.is-hot rect:not(.chart__hit) { opacity: .8; }
.chart__bar.is-hot .chart__hit { fill: color-mix(in srgb, var(--text-primary) 4%, transparent); }
.chart__cross { stroke: var(--text-secondary); stroke-width: 1; opacity: 0; }
.chart__col.is-hot .chart__cross { opacity: .6; }
.chart__seg { transition: opacity var(--dur-fast) var(--ease); }
.chart__seg.is-hot { opacity: .8; }
.chart__cell.is-hot, g.is-hot .chart__cell { stroke: var(--text-primary); stroke-width: 1; }
.ctip { position: fixed; top: 0; left: 0; z-index: 90; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text-primary); font-size: var(--fs-overline); font-weight: 500; box-shadow: var(--shadow-sheet); max-width: 320px; white-space: normal; }
.clegend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); font-size: var(--fs-body-s); color: var(--text-secondary); }
.clegend li { display: inline-flex; align-items: center; gap: var(--sp-2); }
.clegend b { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.clegend__key { --c: var(--brand); display: inline-block; flex: none; }
.clegend__key--rect { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.clegend__key--line { width: 16px; height: 2px; border-radius: 2px; background: var(--c); }
.clegend__key--dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.clegend--col { flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.clegend--col li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; width: 100%; }
.clegend--col li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clegend--col li b { white-space: nowrap; }
.chart-row { display: flex; align-items: center; gap: var(--sp-4); }
.chart-row--donut { flex-direction: column; align-items: center; gap: var(--sp-4); }
.chart-row--donut .clegend { justify-content: center; }
.chart-row > svg { flex: none; }
.chart-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-2); font-size: var(--fs-overline); color: var(--text-tertiary); flex-wrap: wrap; }
.spark { display: block; overflow: visible; }
.goalbar { display: grid; gap: 6px; }
.goalbar__row { display: flex; justify-content: space-between; font-size: var(--fs-body-s); }
.goalbar__row b { font-family: var(--font-display); }
.rangesel { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-chip); background: var(--surface-2); border: 1px solid var(--border-subtle); }
.rangesel button { min-height: 30px; padding: 0 var(--sp-3); border-radius: var(--r-chip); font-size: var(--fs-body-s); font-weight: 600; color: var(--text-secondary); }
.rangesel button[aria-pressed="true"] { background: var(--surface-3); color: var(--text-primary); }

/* ---------- mapa de calor ---------- */
.heat { position: relative; flex: 1; min-height: 420px; border-radius: var(--r-input); overflow: hidden; background: var(--surface-2); }
.heat__map { position: absolute; inset: 0; }
.heat__legend { position: absolute; left: var(--sp-3); bottom: var(--sp-3); z-index: 2; display: grid; gap: 4px; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-input); background: var(--glass-bg); backdrop-filter: var(--glass-blur); border: 1px solid var(--border-subtle); font-size: var(--fs-overline); color: var(--text-secondary); }
.heat__ramp { height: 8px; width: 140px; border-radius: var(--r-chip); background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 25%, transparent), var(--brand), var(--warning), var(--live)); }
.heat__legend div { display: flex; justify-content: space-between; }
.heat__fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-tertiary); font-size: var(--fs-body-s); text-align: center; padding: var(--sp-4); }
.heat .maplibregl-ctrl-attrib { font-size: 10px; background: var(--glass-bg); color: var(--text-tertiary); }
.heat .maplibregl-ctrl-attrib a { color: var(--text-secondary); }
.heat .maplibregl-ctrl-group { background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: none; }
.heat .maplibregl-ctrl-group button { background: transparent; }
.heat .maplibregl-ctrl-group button + button { border-top-color: var(--border-subtle); }
.heat .maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1) brightness(1.4); }

/* ---------- toasts en el panel (sobrescribe components.css que los ancla al teléfono) ---------- */
.toasts { position: fixed; left: auto; right: var(--sp-6); bottom: var(--sp-6); width: 360px; max-width: calc(100vw - 32px); z-index: 95; }

/* ---------- panel de estados (tecla S), replicado de app.css ---------- */
.state-fab { position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 100; width: var(--touch); height: var(--touch); border-radius: var(--r-pin); background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border-strong); display: grid; place-items: center; }
.state-fab:hover { color: var(--text-primary); }
.state-panel { position: fixed; right: var(--sp-4); bottom: calc(var(--sp-4) + var(--touch) + var(--sp-2)); z-index: 100; width: 260px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-card); padding: var(--sp-4); display: grid; gap: var(--sp-3); box-shadow: var(--shadow-sheet); }
.state-panel[hidden] { display: none; }
.state-panel h2 { font-family: var(--font-display); font-size: var(--fs-body-m); margin: 0; display: flex; justify-content: space-between; align-items: center; }
.state-panel label { display: grid; gap: var(--sp-1); font-size: var(--fs-body-s); color: var(--text-secondary); }
.state-panel select, .state-panel input { min-height: 40px; padding: 0 var(--sp-3); border-radius: var(--r-input); background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border-strong); }
.state-panel .btn { min-height: 40px; }
.state-panel kbd { font-family: var(--font-mono); font-size: var(--fs-overline); padding: 2px 6px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border-strong); }
.state-panel__meta { font-size: var(--fs-overline); color: var(--text-tertiary); font-family: var(--font-mono); }

/* ---------- responsive ≤ 1024 / ≤ 768 ---------- */
@media (max-width: 1024px) {
  .shell, body.is-collapsed .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w); z-index: 70; transform: translateX(-100%); transition: transform var(--dur-base) var(--ease); box-shadow: var(--shadow-sheet); }
  body.is-nav-open .side { transform: none; }
  body.is-collapsed .side { padding: var(--sp-4) var(--sp-3); }
  body.is-collapsed .side__brand span, body.is-collapsed .side__brand small, body.is-collapsed .nav__text, body.is-collapsed .nav__label span, body.is-collapsed .side__me-text, body.is-collapsed .cmdk span, body.is-collapsed .cmdk kbd, body.is-collapsed .side__hub, body.is-collapsed [data-logout] { display: initial; }
  body.is-collapsed .nav__item { justify-content: flex-start; padding: 0 var(--sp-3); }
  body.is-collapsed .nav__count { position: static; }
  .side__collapse { display: none; }
  .nav-toggle { display: inline-grid; }
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 65; background: color-mix(in srgb, var(--surface-0) 55%, transparent); opacity: 0; pointer-events: none; transition: opacity var(--dur-base) var(--ease); }
  body.is-nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 var(--sp-4); }
  .main { padding: var(--sp-4) var(--sp-4) var(--sp-12); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--charts { grid-template-columns: 1fr; }
  .grid--charts > :last-child { grid-column: auto; }
}
@media (max-width: 768px) {
  .grid--4, .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .city, .topbar__crumb { display: none; }
  .drawer { width: 100vw; }
  .stat__value { font-size: var(--fs-display-l); }
  .akv__row { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .main, .drawer, .scrim, .side, .shell { transition: none; }
  .ask::after, .abadge--live .abadge__dot { animation: none; }
}
