/* ==========================================================================
   LULLO DASHBOARD TEMPLATE — Sistema de diseño
   1. Tokens (claro / oscuro)      6. Formularios         11. Apps
   2. Base y scroll                7. Datos (tabla/lista)  12. Animaciones (keyframes)
   3. Shell (sidebar/topbar/view)  8. Overlays             13. Utilidades de motion
   4. Player                       9. Feedback             14. Responsive
   5. Componentes base             10. Gráficas
   ========================================================================== */

/* 1. TOKENS --------------------------------------------------------------- */
:root {
  --bg: 250 234 219;          /* crema #FAEADB */
  --bg-2: 246 225 206;
  --surface: 253 243 234;     /* tarjetas */
  --surface-2: 247 231 216;   /* hover / campos */
  --surface-3: 241 222 205;
  --line: 236 215 196;
  --ink: 43 36 32;            /* texto principal */
  --muted: 128 112 100;
  --faint: 178 160 146;
  --side: 186 203 182;        /* salvia */
  --side-ink: 38 52 42;
  --side-active: 252 240 229;
  --brand: 47 94 74;          /* verde logo */
  --accent: 232 128 90;       /* coral */
  --accent-2: 244 165 125;
  --on-accent: 255 255 255;
  --sage: 218 220 194;        /* KPI pastel */
  --peach: 248 196 168;
  --butter: 249 223 163;
  --mist: 208 214 228;
  --rose: 242 196 196;
  --lav: 214 202 228;
  --c1: 236 130 90;           /* paleta gráficas */
  --c2: 242 176 136;
  --c3: 236 196 92;
  --c4: 150 178 140;
  --c5: 146 166 204;
  --c6: 214 150 172;
  --success: 84 150 108;
  --warning: 214 158 56;
  --danger: 212 88 78;
  --info: 96 138 196;
  --shadow: 120 76 44;
  --chart-line: 122 72 50;
  --chart-fill: 246 196 166;
  --radius: 22px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --sb-w: 248px;
  color-scheme: light;
}
.dark {
  --bg: 29 23 20;
  --bg-2: 34 27 23;
  --surface: 41 33 29;
  --surface-2: 51 41 36;
  --surface-3: 60 49 43;
  --line: 64 52 45;
  --ink: 245 234 223;
  --muted: 178 162 150;
  --faint: 122 108 98;
  --side: 37 47 40;
  --side-ink: 218 230 216;
  --side-active: 60 75 63;
  --brand: 118 176 148;
  --accent: 238 138 98;
  --accent-2: 246 168 130;
  --sage: 61 62 46;
  --peach: 82 50 40;
  --butter: 80 65 36;
  --mist: 42 51 70;
  --rose: 78 46 52;
  --lav: 58 50 74;
  --shadow: 0 0 0;
  --chart-line: 248 186 150;
  --chart-fill: 110 58 40;
  color-scheme: dark;
}

/* 2. BASE ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: rgb(var(--bg)); color: rgb(var(--ink)); font-family: Outfit, ui-sans-serif, system-ui, sans-serif; overflow: hidden; }
[data-lucide] { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0; }
::selection { background: rgb(var(--accent) / .25); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid rgb(var(--accent)); outline-offset: 2px; border-radius: 10px; }
.scroll-thin { scrollbar-width: thin; scrollbar-color: rgb(var(--faint) / .5) transparent; }
.scroll-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-thin::-webkit-scrollbar-thumb { background: rgb(var(--faint) / .45); border-radius: 8px; }
.muted { color: rgb(var(--muted)); }
.capitalize-first::first-letter { text-transform: uppercase; }
.tabular { font-variant-numeric: tabular-nums; }

/* 3. SHELL ----------------------------------------------------------------- */
.app-shell { display: flex; height: 100vh; height: 100dvh; padding: 10px; gap: 0; }
.sidebar {
  width: var(--sb-w); flex-shrink: 0; background: rgb(var(--side)); color: rgb(var(--side-ink));
  border-radius: 26px; display: flex; flex-direction: column; padding: 14px 12px 12px; position: relative;
  transition: width .45s var(--ease-out), background-color .4s, transform .45s var(--ease-out);
  z-index: 40;
}
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 14px; }
.sb-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sb-logo { width: 40px; height: 40px; border-radius: 13px; background: rgb(var(--brand)); color: rgb(var(--side-active)); display: grid; place-items: center; flex-shrink: 0; transition: transform .5s var(--ease-spring); }
.dark .sb-logo { color: rgb(var(--bg)); }
.sb-brand:hover .sb-logo { transform: rotate(-8deg) scale(1.06); }
.sb-logo svg { width: 22px; height: 22px; }
.sb-brand-text { display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; overflow: hidden; transition: opacity .3s; }
.sb-brand-text strong { font-size: 17px; font-weight: 600; }
.sb-brand-text small { font-size: 11px; opacity: .75; }
.sb-section { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; opacity: .7; padding: 14px 12px 6px; white-space: nowrap; overflow: hidden; }
.sb-nav { position: relative; flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px; }
.sb-pill {
  position: absolute; left: 4px; right: 4px; top: 0; height: 44px; border-radius: 14px;
  background: rgb(var(--side-active)); box-shadow: 0 1px 2px rgb(var(--shadow) / .06), 0 6px 16px -8px rgb(var(--shadow) / .25);
  pointer-events: none; opacity: 0; z-index: 0;
}
.nav-item {
  position: relative; z-index: 1; display: flex; width: 100%; text-align: left; align-items: center; gap: 12px; height: 44px; padding: 0 12px; margin: 2px 0;
  border-radius: 14px; font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden;
  transition: color .25s, background-color .25s;
}
.nav-item:hover { background: rgb(var(--side-active) / .35); }
.nav-item.is-active:hover { background: transparent; }
.nav-item .nav-ico { display: grid; place-items: center; width: 20px; }
.nav-item .nav-label { flex: 1; transition: opacity .25s; }
.nav-item .nav-caret { opacity: .7; transition: transform .3s var(--ease-out); }
.nav-item:hover .nav-caret { transform: translateX(2px); }
.nav-item .nav-badge { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: rgb(var(--accent)); color: #fff; font-weight: 600; }
.nav-item.is-loved .nav-ico { color: rgb(var(--accent)); }
.nav-group > .nav-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease-out); }
.nav-group.is-open > .nav-sub { grid-template-rows: 1fr; }
.nav-group.is-open > .nav-item .nav-caret { transform: rotate(90deg); }
.nav-sub > div { overflow: hidden; padding-left: 22px; }
.nav-sub .nav-item { height: 36px; font-size: 13.5px; font-weight: 400; }
.nav-sub .nav-item::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .4; margin-left: 4px; }
.nav-sub .nav-item.is-active::before { opacity: 1; background: rgb(var(--accent)); }

.sb-promo {
  margin: 10px 2px; padding: 16px 14px; border-radius: 20px; background: rgb(var(--peach)); text-align: center;
  color: rgb(var(--ink)); display: flex; flex-direction: column; align-items: center; gap: 4px; overflow: hidden;
}
.sb-promo-crown { color: rgb(var(--warning)); animation: crown-bob 3.2s ease-in-out infinite; }
.sb-promo-crown svg { width: 26px; height: 26px; }
.sb-promo strong { font-size: 15px; }
.sb-promo p { margin: 0 0 8px; font-size: 11.5px; line-height: 1.35; color: rgb(var(--muted)); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; text-align: left; background: rgb(var(--side-active) / .55); transition: background-color .2s; }
.sb-user:hover { background: rgb(var(--side-active)); }
.sb-user-text { display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.sb-user-text strong { font-size: 13px; font-weight: 600; }
.sb-user-text small { font-size: 11px; opacity: .7; }
.sb-user-caret { opacity: .6; }
.sb-scrim { display: none; }

/* Sidebar contraído (rail) */
.sb-collapsed { --sb-w: 84px; }
.sb-collapsed .sb-brand-text, .sb-collapsed .nav-label, .sb-collapsed .nav-caret, .sb-collapsed .nav-badge,
.sb-collapsed .sb-user-text, .sb-collapsed .sb-user-caret, .sb-collapsed .sb-promo, .sb-collapsed .sb-section { opacity: 0; pointer-events: none; }
.sb-collapsed .sb-section { height: 10px; padding: 0; }
.sb-collapsed .sb-promo { display: none; }
.sb-collapsed .sb-head { flex-direction: column; }
.sb-collapsed .nav-item { justify-content: center; padding: 0; }
.sb-collapsed .nav-item .nav-label { display: none; }
.sb-collapsed .nav-sub { display: none !important; }
.sb-collapsed .sb-user { justify-content: center; }
.sb-collapsed .sb-collapse svg { transform: scaleX(-1); }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.topbar { display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 22px 0 32px; flex-shrink: 0; position: relative; z-index: 30; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgb(var(--muted)); min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs a:hover { color: rgb(var(--ink)); }
.crumbs .sep { opacity: .6; }
.crumbs .sep svg { width: 13px; height: 13px; }
.crumbs .cur { color: rgb(var(--ink)); font-weight: 500; }
.crumbs > * { animation: crumb-in .45s var(--ease-out) both; }
.crumbs > *:nth-child(2) { animation-delay: .04s; } .crumbs > *:nth-child(3) { animation-delay: .08s; }
.crumbs > *:nth-child(4) { animation-delay: .12s; } .crumbs > *:nth-child(5) { animation-delay: .16s; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px 0 14px; width: 250px; border-radius: 14px;
  background: rgb(var(--surface)); color: rgb(var(--muted)); font-size: 13px; box-shadow: 0 1px 2px rgb(var(--shadow) / .05), 0 6px 18px -10px rgb(var(--shadow) / .2);
  transition: width .4s var(--ease-out), box-shadow .3s;
}
.search-trigger:hover { width: 280px; box-shadow: 0 2px 4px rgb(var(--shadow) / .06), 0 10px 26px -12px rgb(var(--shadow) / .3); }
.search-trigger span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: 99px; background: rgb(var(--accent)); color: #fff; font-size: 9.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid rgb(var(--bg)); animation: dot-pulse 2.4s infinite; }
.notif-dot:empty, .notif-dot[data-count="0"] { display: none; }
.bell { transform-origin: 50% 2px; }
[data-dropdown]:hover .bell { animation: bell-ring .8s var(--ease-out); }
.theme-ico-sun { display: none; }
.dark .theme-ico-sun { display: block; }
.dark .theme-ico-moon { display: none; }
#themeBtn svg { transition: transform .6s var(--ease-spring); }
#themeBtn:hover svg { transform: rotate(-25deg); }

.view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 32px 130px; position: relative; scroll-behavior: smooth; outline: none; }
.view.is-blank { padding: 0; }
.page { width: 100%; max-width: var(--page-max, none); margin: 0 auto; } /* ocupa todo el ancho; para limitarlo: :root { --page-max: 1480px } */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 18px; }
.page-title { font-size: 36px; line-height: 1.1; font-weight: 500; letter-spacing: -.02em; margin: 0; }
.page-sub { font-size: 13.5px; color: rgb(var(--muted)); margin-top: 6px; }
.section-title { font-size: 17px; font-weight: 600; margin: 0; }
.section-sub { font-size: 12.5px; color: rgb(var(--muted)); margin-top: 2px; }

/* Layout en blanco (auth / errores) */
.layout-blank .sidebar, .layout-blank .sb-scrim, .layout-blank .topbar, .layout-blank .player { display: none !important; }
.layout-blank .app-shell { padding: 0; }
.layout-blank .view { padding: 0; }
.layout-blank .page { max-width: none; }

/* 4. PLAYER ---------------------------------------------------------------- */
.player {
  position: absolute; left: 24px; right: 22px; bottom: 6px; height: 76px; z-index: 25;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 16px;
  padding: 8px 18px 8px 10px; border-radius: 22px;
  background: rgb(var(--surface) / .82); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 1px 2px rgb(var(--shadow) / .06), 0 18px 40px -18px rgb(var(--shadow) / .35);
  border: 1px solid rgb(var(--line) / .6);
  animation: player-in .8s var(--ease-out) both .2s;
}
.player-track { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player-track strong { font-size: 14px; font-weight: 600; }
.player-track small { font-size: 12px; color: rgb(var(--muted)); }
.player-cover { width: 58px; height: 58px; border-radius: 14px; overflow: hidden; flex-shrink: 0; position: relative; background: rgb(var(--surface-2)); }
.player-cover .cover { border-radius: 0; }
.player-cover .eq { position: absolute; left: 6px; bottom: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.player-center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.player-controls { display: flex; align-items: center; gap: 14px; }
.pl-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; color: rgb(var(--ink) / .85); transition: background-color .2s, color .2s, transform .2s; }
.pl-btn:hover { background: rgb(var(--surface-2)); }
.pl-btn:active { transform: scale(.9); }
.pl-btn.is-on { color: rgb(var(--accent)); }
.pl-btn.is-on::after { content: ''; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: currentColor; transform: translateY(14px); }
.pl-btn { position: relative; }
.pl-play {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgb(var(--accent)); color: #fff;
  box-shadow: 0 8px 20px -8px rgb(var(--accent) / .8); transition: transform .3s var(--ease-spring), box-shadow .3s;
}
.pl-play:hover { transform: scale(1.08); box-shadow: 0 10px 26px -8px rgb(var(--accent) / .9); }
.pl-play:active { transform: scale(.94); }
.pl-play svg { width: 20px; height: 20px; fill: currentColor; }
.pl-play .ico-pause { display: none; }
.is-playing .pl-play .ico-pause { display: block; }
.is-playing .pl-play .ico-play { display: none; }
.player-progress { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 420px; font-size: 11px; color: rgb(var(--muted)); }
.player-progress small { width: 30px; text-align: center; font-variant-numeric: tabular-nums; }
.player-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.heart-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: rgb(var(--muted)); transition: color .2s, transform .3s var(--ease-spring); }
.heart-btn:hover { color: rgb(var(--accent)); }
.heart-btn.is-on { color: rgb(var(--accent)); }
.heart-btn.is-on svg { fill: currentColor; }
.heart-btn.pop { animation: heart-pop .5s var(--ease-spring); }

/* Slider genérico (seek, volumen, rangos) */
.slider { position: relative; flex: 1; height: 16px; cursor: pointer; --v: 0; touch-action: none; }
.slider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 5px; margin-top: -2.5px; border-radius: 9px; background: rgb(var(--surface-3)); }
.slider-fill { position: absolute; left: 0; top: 50%; height: 5px; margin-top: -2.5px; width: calc(var(--v) * 100%); border-radius: 9px; background: rgb(var(--accent)); }
.slider-thumb { position: absolute; top: 50%; left: calc(var(--v) * 100%); width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgb(var(--accent) / .9), 0 2px 6px rgba(0,0,0,.2); transform: scale(0); transition: transform .25s var(--ease-spring); }
.slider:hover .slider-thumb, .slider.is-drag .slider-thumb, .slider-sm .slider-thumb { transform: scale(1); }
.slider-sm { flex: none; width: 96px; }
.slider-sm .slider-fill { background: rgb(var(--ink) / .75); }
.slider-sm .slider-thumb { box-shadow: 0 0 0 2px rgb(var(--ink) / .6), 0 2px 6px rgba(0,0,0,.2); }

/* Equalizer animado (canción en reproducción) */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform-origin: bottom; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.4s; } .eq i:nth-child(3) { animation-delay: -.7s; }
.is-paused .eq i, body:not(.is-playing) .eq i { animation-play-state: paused; }

/* 5. COMPONENTES BASE ------------------------------------------------------ */
.card { background: rgb(var(--surface)); border-radius: var(--radius); box-shadow: 0 1px 2px rgb(var(--shadow) / .05), 0 10px 30px -18px rgb(var(--shadow) / .22); border: 1px solid rgb(var(--line) / .5); position: relative; }
.card-pad { padding: 20px; }
.card-hover { transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out); }
.card-hover:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgb(var(--shadow) / .06), 0 22px 44px -18px rgb(var(--shadow) / .35); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

/* KPI pastel (Stats) */
.kpi { border-radius: 20px; padding: 18px 20px; min-height: 96px; display: flex; flex-direction: column; gap: 6px; color: rgb(var(--ink)); box-shadow: 0 1px 2px rgb(var(--shadow) / .05), 0 10px 26px -16px rgb(var(--shadow) / .3); transition: transform .4s var(--ease-out); position: relative; overflow: hidden; }
.kpi:hover { transform: translateY(-3px); }
.kpi-label { font-size: 13px; font-weight: 500; opacity: .85; }
.kpi-value { font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-sage { background: rgb(var(--sage)); } .kpi-peach { background: rgb(var(--peach)); }
.kpi-butter { background: rgb(var(--butter)); } .kpi-mist { background: rgb(var(--mist)); }
.kpi-rose { background: rgb(var(--rose)); } .kpi-lav { background: rgb(var(--lav)); }
.kpi-trend { font-size: 12px; color: rgb(var(--muted)); }
.kpi-trend b { color: rgb(var(--success)); font-weight: 600; }
.kpi-trend b.down { color: rgb(var(--danger)); }

/* Stat card con icono (Home) */
.stat-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.stat-ico svg { width: 19px; height: 19px; }

/* Botones */
.btn {
  --b: var(--surface-2); --f: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 13px;
  font-size: 14px; font-weight: 500; white-space: nowrap; background: rgb(var(--b)); color: rgb(var(--f)); position: relative; overflow: hidden;
  transition: transform .25s var(--ease-spring), box-shadow .25s, background-color .2s, filter .2s; user-select: none;
}
.btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn:disabled, .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { --b: var(--accent); --f: var(--on-accent); box-shadow: 0 8px 18px -10px rgb(var(--accent) / .9); }
.btn-primary:hover { box-shadow: 0 12px 24px -10px rgb(var(--accent) / .95); }
.btn-dark { --b: var(--ink); --f: var(--bg); }
.btn-brand { --b: var(--brand); --f: var(--bg); }
.btn-soft { --b: var(--surface-2); }
.btn-surface { --b: var(--surface); box-shadow: 0 1px 2px rgb(var(--shadow) / .06), 0 6px 16px -10px rgb(var(--shadow) / .3); }
.btn-ghost { --b: var(--bg); background: transparent; }
.btn-ghost:hover { background: rgb(var(--surface-2)); }
.btn-outline { background: transparent; box-shadow: inset 0 0 0 1.5px rgb(var(--line)); }
.btn-outline:hover { box-shadow: inset 0 0 0 1.5px rgb(var(--faint)); }
.btn-success { --b: var(--success); --f: 255 255 255; }
.btn-danger { --b: var(--danger); --f: 255 255 255; }
.btn-warning { --b: var(--warning); --f: 255 255 255; }
.btn-info { --b: var(--info); --f: 255 255 255; }
.btn-soft-accent { background: rgb(var(--accent) / .14); color: rgb(var(--accent)); }
.btn-soft-success { background: rgb(var(--success) / .14); color: rgb(var(--success)); }
.btn-soft-danger { background: rgb(var(--danger) / .12); color: rgb(var(--danger)); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 15px; }
.btn-pill { border-radius: 999px; }
.btn-block { width: 100%; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgb(var(--f)); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn-icon { width: 40px; height: 40px; border-radius: 13px; display: inline-grid; place-items: center; color: rgb(var(--ink) / .85); transition: background-color .2s, transform .25s var(--ease-spring); position: relative; overflow: hidden; flex-shrink: 0; }
.btn-icon:hover { background: rgb(var(--surface)); }
.btn-icon:active { transform: scale(.92); }
.btn-icon-sm { width: 32px; height: 32px; border-radius: 10px; }
.btn-icon-sm svg { width: 16px; height: 16px; }
.sidebar .btn-icon:hover { background: rgb(var(--side-active) / .6); }
.btn-group { display: inline-flex; border-radius: 13px; overflow: hidden; box-shadow: inset 0 0 0 1.5px rgb(var(--line)); }
.btn-group .btn { border-radius: 0; background: transparent; }
.btn-group .btn + .btn { box-shadow: inset 1.5px 0 0 rgb(var(--line)); }
.btn-group .btn:hover { background: rgb(var(--surface-2)); transform: none; }

/* Ripple */
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .22; pointer-events: none; animation: ripple .6s var(--ease-out) forwards; }

/* Chips / filtros (Library) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 6px 0 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: rgb(var(--surface)); box-shadow: inset 0 0 0 1px rgb(var(--line)); transition: background-color .3s, color .3s, transform .25s var(--ease-spring), box-shadow .3s;
}
.chip:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgb(var(--faint)); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.chip .count { font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 99px; background: rgb(var(--surface-2)); color: rgb(var(--muted)); transition: inherit; }
.chip.is-active { background: rgb(var(--ink)); color: rgb(var(--bg)); box-shadow: none; }
.chip.is-active .count { background: rgb(var(--bg) / .18); color: rgb(var(--bg)); }
.chip-plain { padding: 0 12px; }

/* Badges / dots */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: rgb(var(--surface-2)); color: rgb(var(--muted)); white-space: nowrap; }
.badge svg { width: 12px; height: 12px; }
.badge-accent { background: rgb(var(--accent) / .15); color: rgb(var(--accent)); }
.badge-success { background: rgb(var(--success) / .15); color: rgb(var(--success)); }
.badge-warning { background: rgb(var(--warning) / .18); color: rgb(var(--warning)); }
.badge-danger { background: rgb(var(--danger) / .14); color: rgb(var(--danger)); }
.badge-info { background: rgb(var(--info) / .15); color: rgb(var(--info)); }
.badge-brand { background: rgb(var(--brand) / .15); color: rgb(var(--brand)); }
.badge-solid { background: rgb(var(--ink)); color: rgb(var(--bg)); }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dot-live { position: relative; }
.dot-live::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 1.6s var(--ease-out) infinite; }
.kbd { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 6px; font-size: 10.5px; font-weight: 600; font-family: inherit; background: rgb(var(--surface-2)); color: rgb(var(--muted)); box-shadow: inset 0 -1px 0 rgb(var(--line)); }

/* Avatares */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; font-weight: 600; background: rgb(var(--sage)); color: rgb(var(--ink)); flex-shrink: 0; overflow: hidden; position: relative; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 24px; height: 24px; font-size: 9.5px; }
.avatar-sm { width: 32px; height: 32px; font-size: 11px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 96px; height: 96px; font-size: 30px; }
.avatar-butter { background: rgb(var(--butter)); } .avatar-peach { background: rgb(var(--peach)); } .avatar-mist { background: rgb(var(--mist)); }
.avatar-rose { background: rgb(var(--rose)); } .avatar-lav { background: rgb(var(--lav)); } .avatar-sage { background: rgb(var(--sage)); }
.avatar-ring { box-shadow: 0 0 0 2.5px rgb(var(--bg)), 0 0 0 4.5px rgb(var(--brand) / .7); transition: box-shadow .3s, transform .3s var(--ease-spring); }
.avatar-ring:hover { transform: scale(1.05); }
.avatar-status::after { content: ''; position: absolute; right: 1px; bottom: 1px; width: 26%; height: 26%; border-radius: 50%; background: rgb(var(--success)); box-shadow: 0 0 0 2px rgb(var(--surface)); }
.avatar-status.is-away::after { background: rgb(var(--warning)); } .avatar-status.is-busy::after { background: rgb(var(--danger)); } .avatar-status.is-off::after { background: rgb(var(--faint)); }
.avatar-stack { display: flex; }
.avatar-stack > * { margin-left: -10px; box-shadow: 0 0 0 2.5px rgb(var(--surface)); transition: transform .3s var(--ease-spring); }
.avatar-stack > *:first-child { margin-left: 0; }
.avatar-stack > *:hover { transform: translateY(-4px); z-index: 2; }

/* Tabs con indicador deslizante */
.tabs { display: flex; gap: 4px; position: relative; border-bottom: 1px solid rgb(var(--line)); overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; height: 40px; padding: 0 10px; font-size: 14px; font-weight: 500; color: rgb(var(--muted)); white-space: nowrap; transition: color .25s; }
.tab:hover { color: rgb(var(--ink)); }
.tab.is-active { color: rgb(var(--ink)); }
.tabs-ink { position: absolute; bottom: -1px; height: 2.5px; border-radius: 3px; background: rgb(var(--accent)); left: 0; width: 0; transition: left .45s var(--ease-out), width .45s var(--ease-out); }
.tabs-pills { border: 0; background: rgb(var(--surface-2)); padding: 4px; border-radius: 14px; display: inline-flex; }
.tabs-pills .tab { height: 34px; padding: 0 14px; border-radius: 10px; z-index: 1; }
.tabs-pills .tabs-ink { top: 4px; bottom: 4px; height: auto; border-radius: 10px; background: rgb(var(--surface)); box-shadow: 0 1px 3px rgb(var(--shadow) / .12); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: panel-in .5s var(--ease-out) both; }

/* Segmented control (Minutes / Songs, Recent / Title…) */
.seg { display: inline-flex; position: relative; padding: 3px; border-radius: 12px; background: rgb(var(--surface-2)); box-shadow: inset 0 0 0 1px rgb(var(--line) / .7); }
.seg-btn { position: relative; z-index: 1; height: 28px; padding: 0 11px; border-radius: 9px; font-size: 12.5px; font-weight: 500; color: rgb(var(--muted)); transition: color .25s; white-space: nowrap; }
.seg-btn.is-active { color: rgb(var(--ink)); }
.seg-pill { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 9px; background: rgb(var(--surface)); box-shadow: 0 1px 3px rgb(var(--shadow) / .14); transition: left .4s var(--ease-out), width .4s var(--ease-out); }
.dark .seg-pill { background: rgb(var(--surface-3)); }

/* Progreso */
.progress { height: 8px; border-radius: 99px; background: rgb(var(--surface-3)); overflow: hidden; }
.progress-bar { height: 100%; border-radius: inherit; background: rgb(var(--accent)); width: var(--p, 0%); transition: width 1.2s var(--ease-out); }
.progress-sm { height: 5px; }
.progress-striped .progress-bar { background-image: linear-gradient(45deg, rgba(255,255,255,.22) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.22) 50%, rgba(255,255,255,.22) 75%, transparent 75%); background-size: 16px 16px; animation: stripes 1s linear infinite; }
.progress-indeterminate .progress-bar { width: 40%; animation: indeterminate 1.4s var(--ease-in-out) infinite; }

/* Spinners / skeleton */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgb(var(--accent) / .25); border-top-color: rgb(var(--accent)); animation: spin .8s linear infinite; display: inline-block; }
.spinner-dots { display: inline-flex; gap: 5px; }
.spinner-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--accent)); animation: bounce-dot 1.2s infinite var(--ease-in-out); }
.spinner-dots i:nth-child(2) { animation-delay: .15s; } .spinner-dots i:nth-child(3) { animation-delay: .3s; }
.skeleton { position: relative; overflow: hidden; background: rgb(var(--surface-2)); border-radius: 10px; }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgb(var(--surface) / .8), transparent); animation: shimmer 1.4s infinite; }

/* Tooltip CSS ([data-tip]) */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 8px); transform: translate(-50%, -4px); z-index: 80;
  padding: 5px 9px; border-radius: 8px; background: rgb(var(--ink)); color: rgb(var(--bg)); font-size: 11.5px; font-weight: 500; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease-out); transition-delay: 0s;
}
[data-tip]:hover::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .35s; }
[data-tip][data-tip-pos="top"]::after { top: auto; bottom: calc(100% + 8px); transform: translate(-50%, 4px); }
[data-tip][data-tip-pos="top"]:hover::after { transform: translate(-50%, 0); }
[data-tip][data-tip-pos="right"]::after { left: calc(100% + 10px); top: 50%; transform: translate(-4px, -50%); }
[data-tip][data-tip-pos="right"]:hover::after { transform: translate(0, -50%); }
[data-tip][data-tip-pos="left"]::after { left: auto; right: calc(100% + 10px); top: 50%; transform: translate(4px, -50%); }
[data-tip][data-tip-pos="left"]:hover::after { transform: translate(0, -50%); }
.player [data-tip]::after { top: auto; bottom: calc(100% + 8px); }
.sidebar:not(.sb-show-tips) .nav-item[data-tip]::after { display: none; }
.sb-collapsed .sidebar .nav-item[data-tip]::after { display: block; left: calc(100% + 12px); top: 50%; transform: translate(-4px, -50%); }
.sb-collapsed .sidebar .nav-item[data-tip]:hover::after { transform: translate(0, -50%); }
.btn-icon[data-tip]::after, .avatar[data-tip]::after { overflow: visible; }
.btn-icon[data-tip], .pl-btn[data-tip], .btn[data-tip], .avatar[data-tip] { overflow: visible; }

/* Dropdown / menú */
.menu {
  position: fixed; z-index: 90; min-width: 220px; padding: 6px; border-radius: 16px; background: rgb(var(--surface)); border: 1px solid rgb(var(--line) / .7);
  box-shadow: 0 2px 6px rgb(var(--shadow) / .08), 0 24px 48px -20px rgb(var(--shadow) / .45); display: none; transform-origin: var(--origin, top right);
}
.menu.is-open { display: block; animation: menu-in .28s var(--ease-out) both; }
.menu.is-closing { display: block; animation: menu-out .16s ease-in both; }
.menu-lg { width: 360px; padding: 0; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; font-size: 13.5px; text-align: left; color: rgb(var(--ink)); transition: background-color .15s, padding .2s; }
.menu-item:hover { background: rgb(var(--surface-2)); padding-left: 13px; }
.menu-item svg { width: 16px; height: 16px; opacity: .8; }
.menu-item-danger { color: rgb(var(--danger)); }
.menu-sep { height: 1px; background: rgb(var(--line)); margin: 6px 4px; }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; line-height: 1.2; }
.menu-head strong { display: block; font-size: 14px; } .menu-head small { font-size: 12px; color: rgb(var(--muted)); }
.menu-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: rgb(var(--faint)); padding: 8px 10px 4px; font-weight: 600; }

/* 6. FORMULARIOS ----------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; font-weight: 500; color: rgb(var(--ink)); }
.label .req { color: rgb(var(--danger)); }
.help { font-size: 12px; color: rgb(var(--muted)); }
.error-msg { font-size: 12px; color: rgb(var(--danger)); display: none; align-items: center; gap: 4px; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 13px; font: inherit; font-size: 14px; color: rgb(var(--ink));
  background: rgb(var(--surface-2)); border: 1.5px solid transparent; outline: none; transition: border-color .2s, background-color .2s, box-shadow .25s;
}
.input::placeholder, .textarea::placeholder { color: rgb(var(--faint)); }
.input:hover, .select:hover, .textarea:hover { border-color: rgb(var(--line)); }
.input:focus, .select:focus, .textarea:focus { background: rgb(var(--surface)); border-color: rgb(var(--accent) / .7); box-shadow: 0 0 0 4px rgb(var(--accent) / .14); }
.textarea { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23807064' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input-sm { height: 34px; font-size: 13px; border-radius: 11px; }
.input-lg { height: 50px; font-size: 15px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > svg, .input-group > .ig-icon { position: absolute; z-index: 1; left: 13px; color: rgb(var(--faint)); pointer-events: none; width: 17px; height: 17px; }
.input-group > .input { padding-left: 40px; }
.input-group > .ig-end { position: absolute; right: 6px; }
.input-addon { display: flex; }
.input-addon > span { display: grid; place-items: center; padding: 0 12px; background: rgb(var(--surface-3)); color: rgb(var(--muted)); font-size: 13px; border-radius: 13px 0 0 13px; }
.input-addon > .input { border-radius: 0 13px 13px 0; }
.is-invalid .input, .is-invalid .select, .is-invalid .textarea, .input.is-invalid { border-color: rgb(var(--danger) / .8); box-shadow: 0 0 0 4px rgb(var(--danger) / .1); animation: shake .4s; }
.is-invalid .error-msg { display: flex; }
.is-valid .input { border-color: rgb(var(--success) / .7); }
.check, .radio { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.check input, .radio input { appearance: none; width: 20px; height: 20px; margin: 0; flex-shrink: 0; border: 1.8px solid rgb(var(--faint)); background: rgb(var(--surface)); display: grid; place-items: center; cursor: pointer; transition: all .2s var(--ease-out); }
.check input { border-radius: 7px; }
.radio input { border-radius: 50%; }
.check input::after { content: ''; width: 10px; height: 6px; border: 2.2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) scale(0); margin-top: -2px; transition: transform .25s var(--ease-spring); }
.radio input::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; transform: scale(0); transition: transform .25s var(--ease-spring); }
.check input:checked, .radio input:checked { background: rgb(var(--accent)); border-color: rgb(var(--accent)); }
.check input:checked::after { transform: rotate(-45deg) scale(1); }
.radio input:checked::after { transform: scale(1); }
.check input:indeterminate { background: rgb(var(--accent)); border-color: rgb(var(--accent)); }
.check input:indeterminate::after { width: 10px; height: 0; border-left: 0; transform: none; margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: rgb(var(--surface-3)); position: relative; cursor: pointer; transition: background-color .3s; flex-shrink: 0; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .35s var(--ease-spring), width .2s; }
.switch input:active::after { width: 22px; }
.switch input:checked { background: rgb(var(--accent)); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:checked:active::after { transform: translateX(14px); }
.range { appearance: none; width: 100%; height: 6px; border-radius: 9px; background: linear-gradient(rgb(var(--accent)), rgb(var(--accent))) 0 / var(--p, 50%) 100% no-repeat, rgb(var(--surface-3)); outline: none; }
.range::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2.5px rgb(var(--accent)), 0 2px 6px rgba(0,0,0,.2); cursor: pointer; transition: transform .2s var(--ease-spring); }
.range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2.5px solid rgb(var(--accent)); cursor: pointer; }
.dropzone { border: 2px dashed rgb(var(--line)); border-radius: 18px; padding: 28px; text-align: center; color: rgb(var(--muted)); transition: border-color .25s, background-color .25s, transform .3s var(--ease-spring); cursor: pointer; }
.dropzone:hover, .dropzone.is-over { border-color: rgb(var(--accent)); background: rgb(var(--accent) / .06); }
.dropzone.is-over { transform: scale(1.01); }
.dropzone-ico { width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 10px; display: grid; place-items: center; background: rgb(var(--accent) / .12); color: rgb(var(--accent)); transition: transform .4s var(--ease-spring); }
.dropzone.is-over .dropzone-ico { transform: translateY(-4px) scale(1.08); }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgb(var(--surface-2)); animation: rise-in .4s var(--ease-out) both; }
.otp { display: flex; gap: 10px; }
.otp input { width: 48px; height: 56px; text-align: center; font-size: 22px; font-weight: 600; padding: 0; }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; min-height: 42px; border-radius: 13px; background: rgb(var(--surface-2)); border: 1.5px solid transparent; }
.tag-input:focus-within { border-color: rgb(var(--accent) / .7); background: rgb(var(--surface)); box-shadow: 0 0 0 4px rgb(var(--accent) / .14); }
.tag-input input { flex: 1; min-width: 80px; border: 0; background: transparent; outline: none; font: inherit; font-size: 14px; color: rgb(var(--ink)); padding: 0 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 6px 0 10px; border-radius: 9px; background: rgb(var(--accent) / .15); color: rgb(var(--accent)); font-size: 12.5px; font-weight: 500; animation: pop-in .3s var(--ease-spring); }
.tag button { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; }
.tag button:hover { background: rgb(var(--accent) / .2); }
.tag svg { width: 12px; height: 12px; }
.rating { display: inline-flex; gap: 2px; color: rgb(var(--warning)); }
.rating button svg { width: 22px; height: 22px; transition: transform .25s var(--ease-spring); }
.rating button:hover svg { transform: scale(1.2); }
.rating button.is-on svg { fill: currentColor; }

/* Stepper / wizard */
.steps { display: flex; align-items: center; gap: 0; counter-reset: step; }
.step { display: flex; align-items: center; gap: 10px; flex: 1; position: relative; font-size: 13px; color: rgb(var(--muted)); }
.step:last-child { flex: none; }
.step-dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; background: rgb(var(--surface-2)); color: rgb(var(--muted)); flex-shrink: 0; transition: all .4s var(--ease-spring); position: relative; }
.step-dot svg { width: 16px; height: 16px; display: none; }
.step-line { flex: 1; height: 3px; border-radius: 3px; background: rgb(var(--surface-3)); margin: 0 12px; position: relative; overflow: hidden; }
.step-line::after { content: ''; position: absolute; inset: 0; background: rgb(var(--accent)); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease-out); }
.step.is-done .step-line::after { transform: scaleX(1); }
.step.is-active .step-dot { background: rgb(var(--accent)); color: #fff; box-shadow: 0 0 0 5px rgb(var(--accent) / .18); transform: scale(1.06); }
.step.is-active { color: rgb(var(--ink)); font-weight: 500; }
.step.is-done .step-dot { background: rgb(var(--success)); color: #fff; }
.step.is-done .step-dot span { display: none; }
.step.is-done .step-dot svg { display: block; animation: pop-in .4s var(--ease-spring); }
.step-panel { display: none; }
.step-panel.is-active { display: block; animation: step-in .5s var(--ease-out) both; }
.step-panel.is-back { animation-name: step-in-back; }

/* 7. DATOS ----------------------------------------------------------------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 500; font-size: 12.5px; color: rgb(var(--muted)); padding: 12px 14px; border-bottom: 1px solid rgb(var(--line)); white-space: nowrap; user-select: none; }
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: rgb(var(--ink)); }
.tbl th .sort-ico { display: inline-block; opacity: .35; transition: transform .3s, opacity .2s; vertical-align: -3px; }
.tbl th.is-asc .sort-ico, .tbl th.is-desc .sort-ico { opacity: 1; color: rgb(var(--accent)); }
.tbl th.is-desc .sort-ico { transform: rotate(180deg); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid rgb(var(--line) / .55); vertical-align: middle; }
.tbl tbody tr { transition: background-color .2s; }
.tbl tbody tr:hover { background: rgb(var(--surface-2) / .7); }
.tbl tbody tr.is-selected { background: rgb(var(--accent) / .08); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-compact td { padding: 7px 12px; }
.tbl-striped tbody tr:nth-child(even) { background: rgb(var(--surface-2) / .45); }
.row-actions { opacity: 0; transition: opacity .2s; }
tr:hover .row-actions { opacity: 1; }
.song-row.is-current .song-title { color: rgb(var(--accent)); }
.song-row .idx { width: 28px; color: rgb(var(--muted)); font-variant-numeric: tabular-nums; }
.song-row .idx .eq { color: rgb(var(--accent)); }
.song-row .idx-play { display: none; }
.song-row:hover .idx-num { display: none; }
.song-row:hover .idx-play { display: inline-grid; }
.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 10px; font-size: 13px; font-weight: 500; display: inline-grid; place-items: center; color: rgb(var(--muted)); transition: background-color .2s, color .2s; }
.page-btn:hover { background: rgb(var(--surface-2)); color: rgb(var(--ink)); }
.page-btn.is-active { background: rgb(var(--ink)); color: rgb(var(--bg)); }
.page-btn:disabled { opacity: .35; pointer-events: none; }
.list { display: flex; flex-direction: column; }
.list-item, .list-item.list-item { display: flex; /* doble clase: gana a la utilidad `list-item` de Tailwind */ align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; transition: background-color .2s, transform .3s var(--ease-out); }
.list-item:hover { background: rgb(var(--surface-2)); }
.list-divided .list-item { border-radius: 0; border-bottom: 1px solid rgb(var(--line) / .6); }
.list-divided .list-item:last-child { border-bottom: 0; }

/* Cover generativo (portadas) */
.cover { position: relative; width: 100%; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: rgb(var(--surface-2)); display: block; }
.cover svg, .cover img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .8s var(--ease-out); }
.album-card:hover .cover img { transform: scale(1.06); }
.album-card { display: block; }
.album-card .cover { box-shadow: 0 10px 26px -16px rgb(var(--shadow) / .5); }
.album-card:hover .cover svg { transform: scale(1.06); }
.album-card .cover-play { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; border-radius: 50%; background: rgb(var(--accent)); color: #fff; display: grid; place-items: center; opacity: 0; transform: translateY(10px) scale(.8); transition: all .4s var(--ease-spring); box-shadow: 0 10px 20px -8px rgba(0,0,0,.5); }
.album-card .cover-play svg { fill: currentColor; width: 18px; height: 18px; }
.album-card:hover .cover-play { opacity: 1; transform: none; }
.album-card h4 { margin: 10px 0 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-card p { margin: 2px 0 0; font-size: 12px; color: rgb(var(--muted)); }
.thumb { width: 40px; height: 40px; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.thumb .cover { border-radius: 0; }

/* Timeline */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: rgb(var(--line)); border-radius: 2px; }
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -26px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgb(var(--surface)); border: 3px solid rgb(var(--accent)); }
.tl-item time { font-size: 12px; color: rgb(var(--muted)); }

/* Acordeón */
.acc { display: flex; flex-direction: column; gap: 10px; }
.acc-item { border-radius: 18px; background: rgb(var(--surface)); border: 1px solid rgb(var(--line) / .6); overflow: hidden; transition: box-shadow .3s; }
.acc-item.is-open { box-shadow: 0 12px 30px -20px rgb(var(--shadow) / .4); }
.acc-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; font-size: 14.5px; font-weight: 500; text-align: left; }
.acc-head .acc-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: rgb(var(--surface-2)); transition: transform .4s var(--ease-out), background-color .3s, color .3s; flex-shrink: 0; }
.acc-item.is-open .acc-ico { transform: rotate(45deg); background: rgb(var(--accent)); color: #fff; }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease-out); }
.acc-item.is-open .acc-body { grid-template-rows: 1fr; }
.acc-body > div { overflow: hidden; }
.acc-body > div > div { padding: 0 18px 18px; font-size: 13.5px; line-height: 1.6; color: rgb(var(--muted)); opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .4s var(--ease-out); }
.acc-item.is-open .acc-body > div > div { opacity: 1; transform: none; transition-delay: .08s; }

/* 8. OVERLAYS -------------------------------------------------------------- */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgb(var(--ink) / .28); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade-in .3s both; }
.dark .modal-backdrop { background: rgb(0 0 0 / .55); }
.modal { position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: auto; border-radius: 26px; background: rgb(var(--surface)); box-shadow: 0 30px 80px -20px rgb(var(--shadow) / .55), 0 0 0 1px rgb(var(--line) / .6); animation: modal-in .5s var(--ease-spring) both; }
.modal-sm { max-width: 400px; } .modal-lg { max-width: 760px; } .modal-xl { max-width: 1040px; }
.modal-full { max-width: none; width: calc(100vw - 40px); height: calc(100vh - 40px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 22px 6px; }
.modal-head h3 { margin: 0; font-size: 19px; font-weight: 600; }
.modal-body { padding: 10px 22px 18px; font-size: 14px; color: rgb(var(--muted)); line-height: 1.55; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 22px; }
.modal-root.is-closing .modal-backdrop { animation: fade-out .25s both; }
.modal-root.is-closing .modal { animation: modal-out .25s ease-in both; }
.modal-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 12px; animation: pop-in .6s var(--ease-spring) .1s both; }
.modal-ico svg { width: 24px; height: 24px; }
.drawer-root { position: fixed; inset: 0; z-index: 100; }
.drawer { position: absolute; top: 10px; bottom: 10px; right: 10px; width: 420px; max-width: calc(100vw - 20px); border-radius: 26px; background: rgb(var(--surface)); box-shadow: 0 30px 80px -20px rgb(var(--shadow) / .55); display: flex; flex-direction: column; animation: drawer-in .55s var(--ease-out) both; }
.drawer-left { right: auto; left: 10px; animation-name: drawer-in-left; }
.drawer-bottom { top: auto; left: 10px; width: auto; max-width: none; height: 60vh; animation-name: sheet-in; }
.drawer-root.is-closing .drawer { animation: drawer-out .3s ease-in both; }
.drawer-root.is-closing .drawer-left { animation-name: drawer-out-left; }
.drawer-root.is-closing .drawer-bottom { animation-name: sheet-out; }
.drawer-root.is-closing .modal-backdrop { animation: fade-out .3s both; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px; }
.drawer-head h3 { margin: 0; font-size: 18px; font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 20px 20px; }
.popover { position: fixed; z-index: 95; width: 280px; padding: 16px; border-radius: 18px; background: rgb(var(--surface)); border: 1px solid rgb(var(--line) / .7); box-shadow: 0 24px 48px -20px rgb(var(--shadow) / .45); display: none; }
.popover.is-open { display: block; animation: menu-in .3s var(--ease-out) both; }

/* Command palette */
.palette { max-width: 620px; padding: 0; align-self: start; margin-top: 12vh; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid rgb(var(--line)); }
.palette-input input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: rgb(var(--ink)); }
.palette-list { max-height: 380px; overflow-y: auto; padding: 8px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 14px; cursor: pointer; color: rgb(var(--ink)); }
.palette-item.is-active { background: rgb(var(--surface-2)); }
.palette-item .pi-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgb(var(--surface-2)); flex-shrink: 0; overflow: hidden; }
.palette-item.is-active .pi-ico { background: rgb(var(--accent)); color: #fff; }
.palette-item small { color: rgb(var(--muted)); margin-left: auto; font-size: 12px; }
.palette-foot { display: flex; gap: 14px; padding: 10px 18px; border-top: 1px solid rgb(var(--line)); font-size: 12px; color: rgb(var(--muted)); }

/* Lock screen */
.lock-screen { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgb(var(--bg) / .55); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); animation: fade-in .6s both; }
.lock-screen.is-closing { animation: lock-out .6s var(--ease-in-out) both; }
.lock-card { text-align: center; width: 340px; animation: rise-in .8s var(--ease-out) .15s both; }
.lock-clock { font-size: 72px; font-weight: 300; letter-spacing: -.04em; line-height: 1; }
.lock-date { color: rgb(var(--muted)); margin: 6px 0 30px; }

/* 9. FEEDBACK -------------------------------------------------------------- */
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px; font-size: 13.5px; line-height: 1.5; background: rgb(var(--surface-2)); color: rgb(var(--ink)); position: relative; overflow: hidden; }
.alert > svg { margin-top: 1px; flex-shrink: 0; }
.alert strong { display: block; font-weight: 600; }
.alert p { margin: 0; color: rgb(var(--muted)); }
.alert-success { background: rgb(var(--success) / .12); } .alert-success > svg { color: rgb(var(--success)); }
.alert-warning { background: rgb(var(--warning) / .14); } .alert-warning > svg { color: rgb(var(--warning)); }
.alert-danger { background: rgb(var(--danger) / .11); } .alert-danger > svg { color: rgb(var(--danger)); }
.alert-info { background: rgb(var(--info) / .12); } .alert-info > svg { color: rgb(var(--info)); }
.alert-accent { background: rgb(var(--accent) / .12); } .alert-accent > svg { color: rgb(var(--accent)); }
.alert-solid.alert-success { background: rgb(var(--success)); color: #fff; } .alert-solid.alert-danger { background: rgb(var(--danger)); color: #fff; }
.alert-solid.alert-info { background: rgb(var(--info)); color: #fff; } .alert-solid.alert-warning { background: rgb(var(--warning)); color: #fff; }
.alert-solid > svg, .alert-solid p { color: inherit !important; opacity: .95; }
.alert-border { border-left: 4px solid currentColor; }
.alert-close { margin-left: auto; align-self: flex-start; opacity: .6; }
.alert-close:hover { opacity: 1; }
.alert.is-leaving { animation: collapse-out .4s var(--ease-in-out) forwards; }
.toasts { position: fixed; z-index: 150; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 10px; width: 360px; max-width: calc(100vw - 32px); pointer-events: none; }
.toasts.pos-bottom-right { top: auto; bottom: 100px; } .toasts.pos-top-left { right: auto; left: 16px; } .toasts.pos-bottom-left { top: auto; bottom: 100px; right: auto; left: 16px; }
.toasts.pos-top-center { right: auto; left: 50%; transform: translateX(-50%); } .toasts.pos-bottom-center { top: auto; bottom: 100px; right: auto; left: 50%; transform: translateX(-50%); }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 16px; border-radius: 18px; background: rgb(var(--surface)); border: 1px solid rgb(var(--line) / .7); box-shadow: 0 20px 40px -18px rgb(var(--shadow) / .5); position: relative; overflow: hidden; animation: toast-in .55s var(--ease-spring) both; }
.toast.is-leaving { animation: toast-out .35s var(--ease-in-out) forwards; }
.toast-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.toast-ico svg { width: 17px; height: 17px; }
.toast strong { display: block; font-size: 14px; font-weight: 600; }
.toast p { margin: 2px 0 0; font-size: 12.5px; color: rgb(var(--muted)); line-height: 1.45; }
.toast-timer { position: absolute; left: 0; bottom: 0; height: 3px; background: currentColor; opacity: .5; animation: timer linear forwards; transform-origin: left; width: 100%; }
.tone-success { color: rgb(var(--success)); } .tone-danger { color: rgb(var(--danger)); } .tone-warning { color: rgb(var(--warning)); } .tone-info { color: rgb(var(--info)); } .tone-accent { color: rgb(var(--accent)); } .tone-brand { color: rgb(var(--brand)); }
.bg-tone-success { background: rgb(var(--success) / .14); color: rgb(var(--success)); } .bg-tone-danger { background: rgb(var(--danger) / .12); color: rgb(var(--danger)); }
.bg-tone-warning { background: rgb(var(--warning) / .16); color: rgb(var(--warning)); } .bg-tone-info { background: rgb(var(--info) / .14); color: rgb(var(--info)); }
.bg-tone-accent { background: rgb(var(--accent) / .14); color: rgb(var(--accent)); } .bg-tone-brand { background: rgb(var(--brand) / .14); color: rgb(var(--brand)); }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; transition: background-color .2s; position: relative; }
.notif-item:hover { background: rgb(var(--surface-2)); }
.notif-item.is-unread::before { content: ''; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: rgb(var(--accent)); }
.notif-item p { margin: 0; font-size: 13px; line-height: 1.4; }
.notif-item time { font-size: 11.5px; color: rgb(var(--muted)); }
.empty { text-align: center; padding: 40px 20px; color: rgb(var(--muted)); }
.empty-ico { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px; display: grid; place-items: center; background: rgb(var(--surface-2)); color: rgb(var(--faint)); animation: float 4s ease-in-out infinite; }
.empty-ico svg { width: 28px; height: 28px; }

/* 10. GRÁFICAS ------------------------------------------------------------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-family: inherit; font-size: 11px; fill: rgb(var(--muted)); }
.chart .grid-line { stroke: rgb(var(--line)); stroke-dasharray: 3 5; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; padding: 7px 10px; border-radius: 10px; background: rgb(var(--ink)); color: rgb(var(--bg)); font-size: 12px; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .2s, left .15s var(--ease-out), top .15s var(--ease-out); }
.chart-tip.is-on { opacity: 1; }
.chart-tip b { font-weight: 600; }
.chart-cursor { stroke: rgb(var(--ink) / .25); stroke-dasharray: 3 3; opacity: 0; transition: opacity .2s; }
.chart-dot { fill: rgb(var(--surface)); stroke: rgb(var(--chart-line)); stroke-width: 2.5; opacity: 0; transition: opacity .2s; }
.chart:hover .chart-cursor, .chart:hover .chart-dot { opacity: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: rgb(var(--muted)); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.radial-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.radial-center strong { display: block; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.radial-center small { font-size: 11px; color: rgb(var(--muted)); }
.hbar { height: 8px; border-radius: 99px; background: rgb(var(--surface-3)); overflow: hidden; }
.hbar > i { display: block; height: 100%; border-radius: inherit; width: 0; transition: width 1.3s var(--ease-out); }
.stack-bar { display: flex; gap: 6px; height: 12px; }
.stack-bar > i { display: block; height: 100%; border-radius: 99px; transform: scaleX(0); transform-origin: left; transition: transform 1s var(--ease-out); }
.stack-bar.is-in > i { transform: scaleX(1); }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 4px; }
.heatmap i { width: 100%; aspect-ratio: 1; border-radius: 4px; background: rgb(var(--surface-3)); opacity: 0; transform: scale(.4); transition: opacity .4s, transform .5s var(--ease-spring); }
.heatmap.is-in i { opacity: 1; transform: none; }
.heatmap i[data-l="1"] { background: rgb(var(--accent) / .3); } .heatmap i[data-l="2"] { background: rgb(var(--accent) / .55); }
.heatmap i[data-l="3"] { background: rgb(var(--accent) / .8); } .heatmap i[data-l="4"] { background: rgb(var(--accent)); }

/* Vinilo (Home hero) */
.vinyl-wrap { position: relative; width: 230px; height: 230px; flex-shrink: 0; }
.vinyl { position: absolute; inset: 0; border-radius: 50%; background:
  radial-gradient(circle, transparent 0 31%, rgba(255,255,255,.05) 31.5% 32%, transparent 32.5%),
  repeating-radial-gradient(circle, #1d1a18 0 2px, #262220 2px 3px), #1d1a18;
  box-shadow: 0 20px 40px -14px rgba(0,0,0,.6), inset 0 0 0 2px rgba(255,255,255,.03);
  animation: spin 6s linear infinite; animation-play-state: paused; }
.vinyl::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 30deg, transparent 0 10%, rgba(255,255,255,.09) 14%, transparent 20% 55%, rgba(255,255,255,.07) 60%, transparent 66%); }
.vinyl-label { position: absolute; inset: 31%; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 3px #141110; }
.vinyl-label .cover { border-radius: 50%; height: 100%; }
.vinyl-label::after { content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: rgb(var(--bg)); box-shadow: inset 0 1px 2px rgba(0,0,0,.4); }
.is-playing .vinyl { animation-play-state: running; }
.tonearm { position: absolute; right: -6px; top: -8px; width: 90px; height: 170px; transform-origin: 74px 16px; transform: rotate(-26deg); transition: transform 1s var(--ease-spring); z-index: 2; }
.is-playing .tonearm { transform: rotate(0deg); }
.tonearm .pivot { position: absolute; right: 6px; top: 4px; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(145deg, #e9e2da, #b8aea5); box-shadow: 0 4px 10px rgba(0,0,0,.3); }
.tonearm .arm { position: absolute; right: 17px; top: 18px; width: 5px; height: 130px; border-radius: 4px; background: linear-gradient(90deg, #d8d0c8, #a89e95); transform: rotate(14deg); transform-origin: top center; }
.tonearm .head { position: absolute; left: 20px; bottom: 4px; width: 16px; height: 26px; border-radius: 4px; background: rgb(var(--accent)); transform: rotate(14deg); box-shadow: 0 4px 8px rgba(0,0,0,.3); }

/* 11. APPS ----------------------------------------------------------------- */
.chat-bubble { max-width: 72%; padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.45; background: rgb(var(--surface-2)); animation: bubble-in .45s var(--ease-spring) both; }
.chat-bubble.me { background: rgb(var(--accent)); color: #fff; border-bottom-right-radius: 6px; margin-left: auto; transform-origin: bottom right; }
.chat-bubble.them { border-bottom-left-radius: 6px; transform-origin: bottom left; }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 18px; background: rgb(var(--surface-2)); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--muted)); animation: bounce-dot 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.kanban-col { background: rgb(var(--surface-2) / .6); border-radius: 22px; padding: 12px; min-height: 200px; transition: background-color .25s; }
.kanban-col.is-over { background: rgb(var(--accent) / .09); }
.kanban-card { background: rgb(var(--surface)); border-radius: 16px; padding: 14px; box-shadow: 0 1px 2px rgb(var(--shadow) / .06), 0 8px 20px -14px rgb(var(--shadow) / .35); cursor: grab; transition: transform .25s var(--ease-out), box-shadow .25s, opacity .2s; }
.kanban-card:hover { transform: translateY(-2px); }
.kanban-card.is-dragging { opacity: .4; transform: rotate(2deg) scale(.98); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-day { min-height: 96px; border-radius: 14px; padding: 8px; background: rgb(var(--surface)); border: 1px solid rgb(var(--line) / .5); font-size: 12.5px; transition: background-color .2s, transform .3s var(--ease-out); cursor: pointer; }
.cal-day:hover { background: rgb(var(--surface-2)); }
.cal-day.is-muted { opacity: .45; }
.cal-day.is-today .cal-num { background: rgb(var(--accent)); color: #fff; }
.cal-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 600; }
.cal-ev { display: block; margin-top: 4px; padding: 3px 7px; border-radius: 7px; font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: pop-in .4s var(--ease-spring) both; }

/* 12. KEYFRAMES ------------------------------------------------------------ */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
@keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }
@keyframes dot-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgb(var(--accent) / .5); } 60% { box-shadow: 0 0 0 6px rgb(var(--accent) / 0); } }
@keyframes bell-ring { 0% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } 100% { transform: rotate(0); } }
@keyframes crown-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-4deg); } }
@keyframes crumb-in { from { opacity: 0; transform: translateX(-6px); filter: blur(4px); } }
@keyframes player-in { from { opacity: 0; transform: translateY(30px); } }
@keyframes heart-pop { 0% { transform: scale(1); } 35% { transform: scale(1.4); } 60% { transform: scale(.9); } 100% { transform: scale(1); } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.96); filter: blur(4px); } }
@keyframes menu-out { to { opacity: 0; transform: translateY(-4px) scale(.97); } }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); filter: blur(6px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(.94); filter: blur(6px); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes drawer-in { from { transform: translateX(110%); } }
@keyframes drawer-out { to { transform: translateX(110%); } }
@keyframes drawer-in-left { from { transform: translateX(-110%); } }
@keyframes drawer-out-left { to { transform: translateX(-110%); } }
@keyframes sheet-in { from { transform: translateY(110%); } }
@keyframes sheet-out { to { transform: translateY(110%); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px) scale(.9); margin-top: -70px; } }
@keyframes timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes stripes { to { background-position: 16px 0; } }
@keyframes indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@keyframes bounce-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-6px); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.5); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }
@keyframes step-in { from { opacity: 0; transform: translateX(30px); filter: blur(6px); } }
@keyframes step-in-back { from { opacity: 0; transform: translateX(-30px); filter: blur(6px); } }
@keyframes collapse-out { to { opacity: 0; transform: scale(.96); max-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes bubble-in { from { opacity: 0; transform: scale(.6) translateY(10px); } }
@keyframes lock-out { to { opacity: 0; backdrop-filter: blur(0); transform: scale(1.04); } }
@keyframes char-in { from { opacity: 0; transform: translateY(.35em); filter: blur(8px); } }
@keyframes page-out { to { opacity: 0; filter: blur(10px); transform: translateY(-6px); } }
@keyframes underline-in { from { transform: scaleX(0); } }

/* 13. MOTION: entrada de página escalonada --------------------------------- */
[data-anim] { opacity: 0; transform: translateY(16px) scale(.985); filter: blur(10px); }
.is-in[data-anim], [data-anim].is-in { opacity: 1; transform: none; filter: blur(0); transition: opacity .7s var(--ease-out), transform .8s var(--ease-out), filter .7s var(--ease-out); transition-delay: var(--d, 0ms); }
[data-anim="fade"] { transform: none; }
[data-anim="left"] { transform: translateX(-20px); }
[data-anim="scale"] { transform: scale(.92); }
.view.is-leaving > .page { animation: page-out .22s ease-in forwards; }
.split-char { display: inline-block; animation: char-in .6s var(--ease-out) both; animation-delay: calc(var(--i) * 32ms + var(--base, 0ms)); white-space: pre; }
.title-underline { display: block; height: 3px; width: 72px; border-radius: 3px; background: rgb(var(--brand)); margin-top: 6px; transform-origin: left; animation: underline-in .8s var(--ease-out) .25s both; }

/* View Transitions (cambio de tema con revelado circular) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }
.no-trans .sidebar, .no-trans .card, .no-trans .btn, .no-trans .btn-icon, .no-trans .chip, .no-trans .nav-item, .no-trans .input, .no-trans .seg-btn, .no-trans .tab { transition: none !important; }
::view-transition-old(root) { z-index: 1; }

/* Las animaciones están SIEMPRE activas. Solo se reducen si App.config.respectReducedMotion = true
   (añade la clase .respect-motion al <html>) y el sistema operativo pide menos movimiento. */
@media (prefers-reduced-motion: reduce) {
  .respect-motion *, .respect-motion *::before, .respect-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .respect-motion [data-anim] { opacity: 1; transform: none; filter: none; }
}

/* 14. RESPONSIVE ----------------------------------------------------------- */
@media (max-height: 760px) { .sb-promo { display: none; } }
@media (max-width: 1279px) {
  .search-trigger { width: 44px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger .kbd { display: none; }
  .search-trigger:hover { width: 44px; }
}
@media (max-width: 1023px) {
  .app-shell { padding: 0; }
  .sidebar { position: fixed; top: 10px; bottom: 10px; left: 10px; transform: translateX(calc(-100% - 20px)); box-shadow: 0 30px 80px -20px rgba(0,0,0,.4); --sb-w: 268px; width: 268px; }
  .sb-open .sidebar { transform: none; }
  .sb-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgb(var(--ink) / .25); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .35s; }
  .sb-open .sb-scrim { opacity: 1; pointer-events: auto; }
  .sb-collapse { display: none; }
  .topbar { padding: 0 14px; }
  .view { padding: 4px 16px 130px; }
  .player { left: 10px; right: 10px; bottom: 10px; grid-template-columns: 1fr auto; height: 70px; }
  .player-center .player-progress, .player-right { display: none; }
  .player-controls { gap: 4px; }
  .player-controls [data-player="shuffle"], .player-controls [data-player="repeat"] { display: none; }
  .page-title { font-size: 30px; }
}
@media (max-width: 640px) {
  .crumbs { display: none; }
  .vinyl-wrap { width: 180px; height: 180px; }
  .modal-root { padding: 10px; align-items: end; }
  .modal { border-radius: 24px; }
  .menu-lg { width: calc(100vw - 20px); }
}
