/* ==========================================================================
   MOVIMIENTO & PULIDO (v2): aurora, entradas escalonadas, micro-interacciones
   y estilos de la herramienta de sanciones (sx-*). Se carga tras apple.css.
   ========================================================================== */
@keyframes nthRise { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes nthFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes nthFloat { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(40px,-30px,0) scale(1.12); } }
@keyframes nthFloat2 { 0%,100% { transform: translate3d(0,0,0) scale(1.05); } 50% { transform: translate3d(-50px,36px,0) scale(0.95); } }
@keyframes nthShine { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes nthPulseRing { 0% { box-shadow: 0 0 0 0 rgba(48,209,88,.55); } 100% { box-shadow: 0 0 0 10px rgba(48,209,88,0); } }
@keyframes nthPop { 0% { opacity: 0; transform: scale(.94) translateY(10px); } 60% { transform: scale(1.012); } 100% { opacity: 1; transform: none; } }

/* Aurora de fondo (sustituye al canvas de estrellas) */
body::before, body::after { content: ''; position: fixed; z-index: 0; pointer-events: none; border-radius: 50%; filter: blur(110px); opacity: .22; }
body::before { width: 620px; height: 620px; top: -180px; right: -120px; background: radial-gradient(circle, #ffc83d, transparent 68%); animation: nthFloat 22s ease-in-out infinite; }
body::after { width: 560px; height: 560px; bottom: -200px; left: 18%; background: radial-gradient(circle, #5e5ce6, transparent 68%); animation: nthFloat2 28s ease-in-out infinite; }

/* Entradas escalonadas */
.tab-pane > * { animation: nthRise .55s var(--spring-ease) both; }
.tab-pane > *:nth-child(2) { animation-delay: .06s; }
.tab-pane > *:nth-child(3) { animation-delay: .12s; }
.tab-pane > *:nth-child(4) { animation-delay: .18s; }
.stats-grid > * { animation: nthRise .6s var(--spring-ease) both; }
.stats-grid > *:nth-child(2) { animation-delay: .08s; }
.stats-grid > *:nth-child(3) { animation-delay: .16s; }
.apple-table tbody tr { animation: nthFade .45s ease both; }
.apple-table tbody tr:nth-child(1) { animation-delay: .04s; }
.apple-table tbody tr:nth-child(2) { animation-delay: .08s; }
.apple-table tbody tr:nth-child(3) { animation-delay: .12s; }
.apple-table tbody tr:nth-child(4) { animation-delay: .16s; }
.apple-table tbody tr:nth-child(5) { animation-delay: .2s; }
.apple-table tbody tr:nth-child(n+6) { animation-delay: .24s; }

/* Tarjetas con elevación y brillo */
.glass-card, .stat-card, .tool-card { transition: transform .45s var(--spring-ease), border-color .3s, box-shadow .45s var(--spring-ease), background .3s; }
.stat-card:hover, .tool-card:not(.full-width-card):hover { transform: translateY(-4px); box-shadow: 0 22px 50px -18px rgba(0,0,0,.8), 0 0 0 1px rgba(255,200,61,.18); }
.stat-card::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.07) 50%, transparent 70%); background-size: 200% 100%; }
.stat-card:hover::after { opacity: 1; animation: nthShine 1.4s ease; }
.stat-icon-wrap { transition: transform .5s var(--spring-ease); }
.stat-card:hover .stat-icon-wrap { transform: scale(1.1) rotate(-6deg); }

/* Barra lateral */
.panel-tab-btn { position: relative; transition: background .2s, color .2s, transform .3s var(--spring-ease); }
.panel-tab-btn:hover { transform: translateX(3px); }
.panel-tab-btn.active::before { content: ''; position: absolute; left: -14px; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold-primary); box-shadow: 0 0 12px rgba(255,200,61,.7); animation: nthFade .3s ease; }
.panel-tab-btn svg { transition: transform .4s var(--spring-ease); }
.panel-tab-btn:hover svg, .panel-tab-btn.active svg { transform: scale(1.12) rotate(-4deg); }

/* Botones */
.btn-gold { background-image: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%); background-size: 250% 100%; background-position: 150% 0; background-color: var(--gold-primary); }
.btn-gold:hover { background-position: -50% 0; transition: background-position .8s ease, transform .25s var(--spring-ease), box-shadow .3s; }
.btn-secondary:hover, .btn-table-action:hover { transform: translateY(-1px); }

.live-dot, .pulse-dot, .status-pulse-dot { animation: nthPulseRing 1.8s ease-out infinite; }
.input-group:focus-within > label { color: var(--gold-primary); transition: color .2s; }
.modal-card { animation: nthPop .5s var(--spring-ease) both; }
.modal-overlay { animation: nthFade .3s ease both; }
.toast { animation: nthRise .5s var(--spring-ease) both; }
.login-card { animation: nthPop .8s var(--spring-ease) both; }
.login-brand-logo { animation: nthFloat 9s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ==========================================================================
   HERRAMIENTA DE SANCIONES
   ========================================================================== */
.sx-app { --k-aviso: #f4b6a4; --k-warn: #ffe600; --k-mute: #6d9eeb; --k-ban: #ea9999; --k-ipban: #e06666; --k-black: #7a0f0f; --k-otro: #8fd6a8; }
.sx-tabs { display: inline-flex; gap: 2px; padding: 3px; margin: 4px 0 18px; border-radius: 12px; background: rgba(118,118,128,.18); flex-wrap: wrap; }
.sx-tab { border: 0; background: transparent; color: var(--text-secondary); font: 600 .85rem var(--font-ui); padding: 8px 16px; border-radius: 9px; cursor: pointer; transition: background .25s, color .25s; }
.sx-tab:hover { color: var(--text-primary); }
.sx-tab.active { background: rgba(99,99,102,.7); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.sx-view { animation: nthRise .45s var(--spring-ease) both; }

.sx-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.sx-search { position: relative; }
.sx-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.sx-search input { width: 100%; padding: 12px 14px 12px 40px; border: 1px solid transparent; border-radius: 12px; background: var(--bg-input); color: var(--text-primary); font: 500 .92rem var(--font-ui); transition: .2s; }
.sx-search input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 4px rgba(255,200,61,.16); }
.sx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.sx-chip { border: 0; padding: 7px 13px; border-radius: 980px; background: rgba(118,118,128,.2); color: var(--text-secondary); font: 600 .78rem var(--font-ui); cursor: pointer; transition: transform .25s var(--spring-ease), background .2s, color .2s; }
.sx-chip:hover { background: rgba(118,118,128,.34); transform: translateY(-1px); }
.sx-chip.active { background: var(--gold-primary); color: #1a1400; }
.sx-list { max-height: 560px; overflow-y: auto; padding-right: 4px; display: flex; flex-direction: column; gap: 6px; }
.sx-group { margin: 12px 4px 2px; font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-dim); position: sticky; top: 0; background: var(--bg-card); padding: 4px 0; z-index: 1; }
.sx-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid transparent; border-radius: 12px; background: rgba(118,118,128,.1); color: var(--text-primary); text-align: left; cursor: pointer; font: 500 .88rem var(--font-ui); animation: nthRise .4s var(--spring-ease) both; animation-delay: calc(var(--i) * 28ms); transition: background .2s, transform .3s var(--spring-ease), border-color .2s; }
.sx-item:hover { background: rgba(118,118,128,.22); transform: translateX(4px); }
.sx-item.selected { background: rgba(255,200,61,.1); border-color: rgba(255,200,61,.45); }
.sx-item-name { flex: 1; }
.sx-item-meta { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sx-steps-count { font-size: .7rem; color: var(--text-muted); }
.sx-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--k-otro); }
.sx-dot.k-AVISO { background: var(--k-aviso); }
.sx-dot.k-WARN { background: var(--k-warn); }
.sx-dot.k-MUTE { background: var(--k-mute); }
.sx-dot.k-BAN { background: var(--k-ban); }
.sx-dot.k-IPBAN { background: var(--k-ipban); }
.sx-dot.k-BLACKLIST { background: var(--k-black); }
.sx-type { font-size: .66rem; font-weight: 700; padding: 3px 8px; border-radius: 980px; letter-spacing: .02em; }
.sx-type.t-escala { background: rgba(100,210,255,.15); color: #64d2ff; }
.sx-type.t-gravedad { background: rgba(255,159,10,.15); color: #ffb340; }
.sx-type.t-unica { background: rgba(191,90,242,.16); color: #d28bff; }
.sx-empty { padding: 30px; text-align: center; color: var(--text-muted); }

.sx-right { position: sticky; top: 74px; }
.sx-placeholder { padding: 34px 26px; text-align: center; border-radius: 20px; border: 1.5px dashed rgba(255,255,255,.14); color: var(--text-secondary); }
.sx-placeholder-icon { font-size: 2.4rem; margin-bottom: 8px; animation: nthFloat 7s ease-in-out infinite; }
.sx-placeholder h4 { color: var(--text-primary); font-size: 1.1rem; margin-bottom: 6px; }
.sx-checklist-mini { list-style: none; margin-top: 14px; display: grid; gap: 6px; font-size: .84rem; }
.sx-detail-card { padding: 22px; border-radius: 20px; background: var(--bg-surface-elevated); border: 1px solid var(--border-medium); box-shadow: var(--shadow-card); }
.sx-detail-card.pop { animation: nthPop .5s var(--spring-ease) both; }
.sx-detail-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sx-cat-label { font-size: .75rem; color: var(--text-muted); font-weight: 600; }
.sx-detail-title { margin: 8px 0 4px; font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; }
.sx-type-hint { color: var(--text-muted); font-size: .8rem; margin-bottom: 14px; }
.sx-stepper { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 12px; background: rgba(118,118,128,.14); margin-bottom: 12px; }
.sx-stepper-label { font-size: .82rem; font-weight: 600; color: var(--text-secondary); }
.sx-stepper-ctrl { display: inline-flex; align-items: center; gap: 14px; }
.sx-stepper-ctrl button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(118,118,128,.3); color: #fff; font-size: 1.1rem; cursor: pointer; transition: transform .2s var(--spring-ease), background .2s; }
.sx-stepper-ctrl button:hover { background: var(--gold-primary); color: #1a1400; transform: scale(1.1); }
.sx-stepper-ctrl strong { min-width: 22px; text-align: center; font-size: 1.1rem; }

.sx-ladder { display: grid; gap: 6px; margin-bottom: 14px; }
.sx-rung { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid transparent; background: rgba(118,118,128,.1); color: var(--text-secondary); cursor: pointer; font: 600 .82rem var(--font-ui); text-align: left; opacity: .62; animation: nthRise .4s var(--spring-ease) both; animation-delay: var(--d); transition: opacity .2s, transform .3s var(--spring-ease), background .2s; }
.sx-rung:hover { opacity: 1; transform: translateX(3px); }
.sx-rung.past { opacity: .8; }
.sx-rung-n { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; background: rgba(255,255,255,.1); flex-shrink: 0; }
.sx-rung.active { opacity: 1; color: #111; transform: scale(1.02); box-shadow: 0 8px 22px -8px rgba(0,0,0,.7); }
.sx-rung.active .sx-rung-n { background: rgba(0,0,0,.18); }
.sx-rung.active.k-AVISO { background: var(--k-aviso); }
.sx-rung.active.k-WARN { background: var(--k-warn); }
.sx-rung.active.k-MUTE { background: var(--k-mute); }
.sx-rung.active.k-BAN { background: var(--k-ban); }
.sx-rung.active.k-IPBAN { background: var(--k-ipban); color: #fff; }
.sx-rung.active.k-BLACKLIST { background: var(--k-black); color: #fff; }
.sx-rung.active.k-OTRO { background: var(--k-otro); }
.sx-note.warn { padding: 10px 12px; border-radius: 10px; font-size: .8rem; background: rgba(255,159,10,.14); color: #ffb340; margin-bottom: 12px; }

.sx-result { padding: 16px; border-radius: 16px; margin-bottom: 14px; border-left: 5px solid var(--k-otro); background: rgba(118,118,128,.14); animation: nthPop .45s var(--spring-ease) both; }
.sx-result.k-AVISO { border-color: var(--k-aviso); }
.sx-result.k-WARN { border-color: var(--k-warn); }
.sx-result.k-MUTE { border-color: var(--k-mute); }
.sx-result.k-BAN { border-color: var(--k-ban); }
.sx-result.k-IPBAN { border-color: var(--k-ipban); }
.sx-result.k-BLACKLIST { border-color: #c0392b; }
.sx-result-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); font-weight: 700; }
.sx-result-main { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.sx-result-sub { font-size: .8rem; color: var(--text-secondary); margin-top: 4px; }
.sx-nick { margin-bottom: 10px; }
.sx-nick label { display: block; font-size: .76rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
.sx-nick input { width: 100%; padding: 11px 13px; border-radius: 11px; border: 1px solid transparent; background: var(--bg-input); color: var(--text-primary); font: 500 .9rem var(--font-ui); transition: .2s; }
.sx-nick input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 4px rgba(255,200,61,.16); }
.sx-cmd { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 12px; background: #000; border: 1px solid var(--border-subtle); margin-bottom: 12px; }
.sx-cmd code { flex: 1; font: 500 .8rem var(--font-mono); color: #9be9a8; word-break: break-word; }
.sx-copy { border: 0; padding: 8px 14px; border-radius: 980px; background: var(--gold-primary); color: #1a1400; font: 700 .78rem var(--font-ui); cursor: pointer; transition: transform .2s var(--spring-ease); }
.sx-copy:hover { transform: scale(1.06); }
.sx-copy:active { transform: scale(.95); }
.sx-checks { display: grid; gap: 6px; font-size: .8rem; color: var(--text-secondary); }
.sx-checks label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.sx-checks input { accent-color: var(--gold-primary); }

.sx-staff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.sx-warn-card { padding: 18px; border-radius: 18px; background: var(--bg-surface-elevated); border: 1px solid var(--border-subtle); border-top: 4px solid var(--c); animation: nthRise .5s var(--spring-ease) both; animation-delay: calc(var(--i) * 80ms); transition: transform .35s var(--spring-ease), box-shadow .35s; }
.sx-warn-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -16px var(--c); }
.sx-warn-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sx-warn-level { font-weight: 800; font-size: 1.02rem; }
.sx-warn-sev { font-size: .7rem; font-weight: 700; padding: 3px 10px; border-radius: 980px; background: var(--c); color: #111; }
.sx-warn-card p { color: var(--text-secondary); font-size: .86rem; }
.sx-rules-intro { padding: 18px 20px; border-radius: 18px; background: rgba(100,160,255,.09); border: 1px solid rgba(100,160,255,.22); margin-bottom: 14px; }
.sx-rules-intro h4 { margin-bottom: 6px; }
.sx-rules-intro p { color: var(--text-secondary); font-size: .88rem; }
.sx-rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.sx-rule { display: flex; gap: 12px; padding: 16px; border-radius: 16px; background: var(--bg-surface-elevated); border: 1px solid var(--border-subtle); animation: nthRise .45s var(--spring-ease) both; animation-delay: calc(var(--i) * 60ms); transition: transform .3s var(--spring-ease); }
.sx-rule:hover { transform: translateY(-3px); }
.sx-rule-ico { font-size: 1.5rem; }
.sx-rule h5 { font-size: .95rem; margin-bottom: 3px; }
.sx-rule p { font-size: .82rem; color: var(--text-secondary); }

@media (max-width: 980px) {
  .sx-layout { grid-template-columns: 1fr; }
  .sx-right { position: static; }
  .sx-list { max-height: 360px; }
}
