/* ==========================================================================
   Ambiente, cristal y movimiento del tema oscuro (se carga después de solvik.css)
   ========================================================================== */

/* ── Luces ambientales difuminadas (gris humo arriba, óxido cálido abajo) ── */
.sv-ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.sv-ambient i { position: absolute; border-radius: 50%; opacity: 0.9; will-change: transform; background-clip: padding-box; }
.sv-ambient i:nth-child(1) {
  width: 62vw; height: 52vh; left: -8vw; top: -20vh;
  background: radial-gradient(closest-side, rgba(128, 138, 140, 0.42), rgba(128, 138, 140, 0) 100%);
  animation: sv-drift-a 28s ease-in-out infinite alternate;
}
.sv-ambient i:nth-child(2) {
  width: 72vw; height: 58vh; right: -18vw; bottom: -26vh;
  background: radial-gradient(closest-side, rgba(176, 82, 46, 0.46), rgba(176, 82, 46, 0) 100%);
  animation: sv-drift-b 34s ease-in-out infinite alternate;
}
.sv-ambient i:nth-child(3) {
  width: 42vw; height: 42vh; left: 18vw; bottom: -30vh;
  background: radial-gradient(closest-side, rgba(120, 66, 42, 0.42), rgba(120, 66, 42, 0) 100%);
  animation: sv-drift-c 40s ease-in-out infinite alternate;
}
/* viñeta: recoge los bordes para que el cristal destaque */
/* sin filtro: el color de cada luz ya es suave y difuminado por el propio degradado */
.sv-ambient::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 30%, transparent 40%, rgba(10, 12, 11, 0.55) 100%);
}
@keyframes sv-drift-a { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(9vw, 7vh, 0) scale(1.18); } }
@keyframes sv-drift-b { from { transform: translate3d(0, 0, 0) scale(1.05); } to { transform: translate3d(-12vw, -6vh, 0) scale(0.9); } }
@keyframes sv-drift-c { from { transform: translate3d(0, 0, 0) scale(0.95); } to { transform: translate3d(14vw, -5vh, 0) scale(1.15); } }

.sv-shell { position: relative; z-index: 1; }

/* ── Cristal ───────────────────────────────────────────────────────────────
   Sin backdrop-filter: cada panel con desenfoque propio obliga a repintar lo que hay detrás en cada frame
   y resulta lento. El cristal se consigue con un fondo translúcido con brillo y borde fino. */
.sv-panel,
.sv-root .card, .sv-root .stat-card, .sv-root .entity-card, .sv-root .kanban-column, .sv-root .pipeline-column {
  position: relative; isolation: isolate; background: transparent;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), 0 18px 44px rgba(0, 0, 0, 0.26);
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.sv-panel::before,
.sv-root .card::before, .sv-root .stat-card::before, .sv-root .entity-card::before,
.sv-root .kanban-column::before, .sv-root .pipeline-column::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: var(--glass-bg);
  
}
.sv-panel:hover, .sv-root .card:hover { border-color: rgba(255, 255, 255, 0.17); }

.sv-sidenav, .sv-capsule, .sv-icon-btn {
  background: rgba(28, 30, 29, 0.42); border: 1px solid var(--glass-border); box-shadow: var(--glass-highlight);

}
.sv-menu, .sv-tooltip, .sv-modal-card {
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), var(--shadow-lg);

}
.sv-segmented, .sv-tabs { background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.sv-search input { background: rgba(255, 255, 255, 0.05); transition: background 0.2s, border-color 0.2s, box-shadow 0.25s; }
.sv-search input:focus {
  background: rgba(255, 255, 255, 0.08); border-color: rgba(199, 243, 74, 0.5);
  box-shadow: 0 0 0 4px rgba(199, 243, 74, 0.10); outline: none;
}
.sv-aging-track { background: rgba(255, 255, 255, 0.05); }
.sv-metric-icon { background: rgba(255, 255, 255, 0.07); box-shadow: var(--glass-highlight); }
.sv-modal-backdrop { background: rgba(10, 11, 10, 0.6); }

/* ── Píldora deslizante (cápsula, pestañas, 6M/12M) ── */
.sv-slider { position: relative; }
.sv-slider > .sv-slide {
  position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 0; opacity: 0; pointer-events: none;
  border-radius: 999px; background: rgba(255, 255, 255, 0.14);
  box-shadow: var(--glass-highlight), 0 6px 16px rgba(0, 0, 0, 0.25);
}
.sv-slider.is-ready > .sv-slide {
  transition: transform 0.45s var(--ease-out), opacity 0.25s;
}
.sv-slider > :not(.sv-slide) { position: relative; z-index: 1; }
.sv-slider.is-ready .is-active { background: transparent !important; }

/* ── Micro-interacciones ── */
.sv-cta, .sv-ghost-btn, .sv-circle-btn, .sv-icon-btn, .sv-side-item, .sv-pager button, .sv-chip, .sv-capsule a {
  transition: transform 0.22s var(--ease-spring), background 0.2s, border-color 0.2s, color 0.2s, filter 0.2s, box-shadow 0.25s;
}
.sv-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(199, 243, 74, 0.22); }
.sv-cta:active, .sv-ghost-btn:active, .sv-circle-btn:active, .sv-icon-btn:active, .sv-pager button:active, .sv-chip:active {
  transform: scale(0.95);
}
.sv-side-item:hover { transform: scale(1.12); }
.sv-side-item:active { transform: scale(0.92); }
.sv-circle-btn:hover, .sv-icon-btn:hover { transform: translateY(-1px); }
.sv-capsule a:hover { transform: translateY(-1px); }
.sv-table tr.row-click td { transition: background 0.25s; }
.sv-aging-col, .sv-aging-row { transition: transform 0.25s var(--ease-spring), color 0.2s; }
.sv-aging-col:hover { transform: translateY(-3px); }
.sv-aging-row:hover { color: var(--text-primary); }
.sv-aging-track { transition: background 0.25s, border-color 0.25s; }

/* ── Entradas (página, paneles, KPIs, filas) ── */
@keyframes sv-enter {
  from { opacity: 0; transform: translateY(14px); }
  /* filter: none al final: un filtro residual convertiría el elemento en contenedor de los menús fijos */
  to { opacity: 1; transform: none; }
}
@keyframes sv-row { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sv-pop { from { opacity: 0; transform: scale(0.94) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes sv-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sv-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes sv-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 -3% 0 0); } }

.sv-page > *:not(.sv-grid), .sv-grid > * { animation: sv-enter 0.75s var(--ease-out) backwards; }
.sv-page > *:nth-child(2) { animation-delay: 0.06s; }
.sv-page > *:nth-child(3) { animation-delay: 0.14s; }
.sv-page > *:nth-child(4) { animation-delay: 0.22s; }
.sv-page > *:nth-child(n + 5) { animation-delay: 0.3s; }
.sv-grid > *:nth-child(1) { animation-delay: 0.10s; }
.sv-grid > *:nth-child(2) { animation-delay: 0.18s; }
.sv-metrics > * { animation: sv-enter 0.7s var(--ease-out) backwards; }
.sv-metrics > *:nth-child(1) { animation-delay: 0.10s; }
.sv-metrics > *:nth-child(2) { animation-delay: 0.18s; }
.sv-metrics > *:nth-child(3) { animation-delay: 0.26s; }

.sv-table tbody tr { animation: sv-row 0.5s var(--ease-out) backwards; }
.sv-table tbody tr:nth-child(1) { animation-delay: 0.02s; }
.sv-table tbody tr:nth-child(2) { animation-delay: 0.06s; }
.sv-table tbody tr:nth-child(3) { animation-delay: 0.10s; }
.sv-table tbody tr:nth-child(4) { animation-delay: 0.14s; }
.sv-table tbody tr:nth-child(5) { animation-delay: 0.18s; }
.sv-table tbody tr:nth-child(6) { animation-delay: 0.22s; }
.sv-table tbody tr:nth-child(7) { animation-delay: 0.26s; }
.sv-table tbody tr:nth-child(8) { animation-delay: 0.30s; }
.sv-table tbody tr:nth-child(9) { animation-delay: 0.34s; }
.sv-table tbody tr:nth-child(n + 10) { animation-delay: 0.38s; }

.sv-chart .plot { animation: sv-reveal 1.4s var(--ease-out) 0.25s backwards; }
.sv-chart .plot .area { animation: sv-fade 1.2s ease 0.7s backwards; }
.sv-aging-bar { transform-origin: bottom; animation: sv-grow 0.9s var(--ease-out) calc(0.35s + var(--i, 0) * 0.09s) backwards; }

.sv-menu { transform-origin: top right; animation: sv-pop 0.18s var(--ease-out) backwards; }
.sv-tooltip { animation: sv-fade 0.15s ease backwards; }
.sv-modal-card { animation: sv-enter 0.45s var(--ease-out) backwards; }
.sv-modal-backdrop { animation: sv-fade 0.3s ease backwards; }
.sv-empty { animation: sv-fade 0.5s ease backwards; }
.sv-badge { animation: sv-fade 0.4s ease backwards; }

/* ── Sin movimiento si el usuario lo prefiere ── */
@media (prefers-reduced-motion: reduce) {
  .sv-root *, .sv-root *::before, .sv-root *::after { animation: none !important; transition: none !important; }
  .sv-ambient i { animation: none !important; }
}
