:root {
    /* Paleta inspirada en Kanade / 25-ji Nightcord de. — azules de medianoche,
       un acento helado tipo luz de luna, nada de morado genérico de SaaS. */
    --bg: #0a0f1a;
    --bg-glow: radial-gradient(ellipse 900px 500px at 50% -10%, rgba(122, 214, 255, 0.10), transparent 60%);
    --surface: #111826;
    --surface-raised: #182234;
    --border: #223047;
    --text: #eaf2fb;
    --text-muted: #7d8ba3;
    --accent: #7ad6ff;
    --accent-soft: rgba(122, 214, 255, 0.14);
    --accent-hover: #9be2ff;
    --accent-text: #071019;
    --moon: #cdeeff;
    --green: #74fc66;
    --purple: #a888ff;
    --orange: #f3ab3c;
    --pink: #f9b6ff;
    --danger: #ff6b7a;
    --radius: 16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg-glow), var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    min-height: 100vh;
}

h1, h2, h3 {
    font-family: 'Baloo 2', 'Inter', sans-serif;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: 0.2px;
}

p { color: var(--text-muted); line-height: 1.55; }
code {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.88em;
    color: var(--moon);
}

.hidden { display: none !important; }

.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    border: none;
    border-radius: 11px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn,
.btn:link,
.btn:visited,
.btn:hover,
.btn:active,
.btn:focus {
    text-decoration: none !important;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: linear-gradient(180deg, var(--accent-hover), var(--accent));
    color: var(--accent-text);
    box-shadow: 0 0 0 1px rgba(122, 214, 255, 0.35), 0 8px 24px -8px rgba(122, 214, 255, 0.55);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn-large { padding: 15px 30px; font-size: 1.05rem; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(255, 107, 122, 0.4); }
.btn-danger:hover { background: rgba(255, 107, 122, 0.1); border-color: var(--danger); }
.btn-small { padding: 6px 13px; font-size: 0.85rem; }

/* --- Login --- */
.view-login {
    /* Colores de Kanade (rosa) y de Nightcord (morado), aclarados para leerse sobre fondo oscuro */
    --kanade: #e58fb6;
    --nightcord: #a57ad8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #0b0d1f 0%, #0c1024 45%, var(--bg) 100%);
}

/* --- Fondo del login: cielo de las 25:00 --- */
.login-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.bg-aurora {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    animation: aurora-drift 26s ease-in-out infinite alternate;
}
.bg-aurora-1 { width: 620px; height: 420px; top: -160px; left: -120px; background: rgba(136, 68, 153, 0.55); }
.bg-aurora-2 { width: 560px; height: 380px; bottom: -180px; right: -100px; background: rgba(187, 102, 136, 0.4); animation-delay: -9s; }
.bg-aurora-3 { width: 480px; height: 320px; top: 30%; left: 38%; background: rgba(122, 214, 255, 0.14); animation-delay: -17s; }
@keyframes aurora-drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(60px, 40px) scale(1.15); }
}

.bg-stars { position: absolute; inset: 0; }
.bg-star {
    position: absolute;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 6px rgba(205, 238, 255, 0.8);
    animation: star-twinkle var(--tw, 4s) ease-in-out infinite;
    animation-delay: var(--tw-d, 0s);
}
@keyframes star-twinkle {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.9; }
}

.bg-shooting-star {
    position: absolute;
    top: 12%;
    left: 70%;
    width: 120px;
    height: 1.5px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), transparent);
    border-radius: 999px;
    transform: rotate(155deg);
    opacity: 0;
    animation: shooting-star 9s ease-in infinite;
    animation-delay: 3s;
}
.bg-shooting-star-2 { top: 34%; left: 30%; animation-delay: 7.5s; animation-duration: 13s; }
@keyframes shooting-star {
    0% { opacity: 0; translate: 0 0; }
    2% { opacity: 1; }
    8% { opacity: 0; translate: -260px 120px; }
    100% { opacity: 0; translate: -260px 120px; }
}

.bg-item {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--s);
    height: var(--s);
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.26;
    filter: drop-shadow(0 0 10px currentColor);
    animation: bg-float var(--t, 16s) ease-in-out infinite;
    animation-delay: var(--d, 0s);
}
.bg-item .bg-fill { fill: currentColor; }
.bg-pink { color: var(--kanade); }
.bg-purple { color: var(--nightcord); }
.bg-ice { color: var(--accent); }
.bg-noodle { opacity: 0.34; }
.bg-steam { animation: steam-rise 3.2s ease-in-out infinite; }
.bg-steam-2 { animation-delay: -1.1s; }
.bg-steam-3 { animation-delay: -2.2s; }
@keyframes steam-rise {
    0% { opacity: 0; transform: translateY(4px); }
    40% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-7px); }
}
.bg-clock {
    height: auto;
    width: auto;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 800;
    font-size: 2.6rem;
    letter-spacing: 2px;
    color: var(--nightcord);
    opacity: 0.22;
}
@keyframes bg-float {
    0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
    50% { transform: translateY(-18px) rotate(calc(var(--r, 0deg) * -1)); }
}

.view-login::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse 75% 65% at 50% 45%, transparent 45%, rgba(10, 15, 26, 0.85) 100%);
    pointer-events: none;
}
.login-topbar {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    padding: 18px 120px 0 24px;
}
.login-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    width: 100%;
    max-width: 1120px;
    padding: 8px 8px 8px 16px;
    background: rgba(17, 24, 38, 0.72);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.login-brand { display: flex; align-items: center; gap: 10px; }
.login-brand-name { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 1.15rem; color: var(--moon); }
.bot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    box-shadow: 0 0 14px rgba(122, 214, 255, 0.45);
}
.login-mascot {
    font-size: 22px;
    filter: drop-shadow(0 0 10px rgba(122, 214, 255, 0.5));
}
.login-nav-links { display: flex; gap: 4px; margin-right: auto; }
.nav-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font: 600 0.92rem 'Inter', sans-serif;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
}
.nav-link:hover { color: var(--text); background: var(--accent-soft); }
.login-nav .btn-small { border-radius: 999px; padding: 8px 20px; }

.login-hero {
    position: relative;
    z-index: 1;
    flex: 1;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    gap: 40px;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 24px;
}
.hero-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(122, 214, 255, 0.25);
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 18px;
}
.hero-title {
    display: flex;
    flex-direction: column;
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.02;
    margin-bottom: 18px;
}
.hero-title-accent {
    /* El degradado se repite (empieza y termina en el mismo color) y se desliza
       un ancho completo por ciclo, así el color va recorriendo las letras sin saltos. */
    background: linear-gradient(90deg, var(--moon), var(--accent), var(--purple), var(--accent), var(--moon));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: title-shimmer 6s linear infinite;
}
@keyframes title-shimmer {
    from { background-position: 0% 50%; }
    to { background-position: 200% 50%; }
}
.hero-sub { font-size: 1.05rem; max-width: 460px; margin: 0 0 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions .btn-ghost { color: var(--text); background: rgba(17, 24, 38, 0.6); }
.hero-stats { display: flex; gap: 28px; margin-top: 38px; }
.hero-stat + .hero-stat { padding-left: 28px; border-left: 1px solid var(--border); }
.hero-stat-value { font-variant-numeric: tabular-nums; font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 1.9rem; line-height: 1.1; color: var(--text); }
.hero-stat-label { font-size: 0.82rem; color: var(--text-muted); }

/* --- Escenario del personaje (Kanade + tarjetas flotantes) --- */
.hero-stage {
    position: relative;
    height: min(78vh, 640px);
    min-height: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-glow {
    position: absolute;
    width: 70%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(122, 214, 255, 0.32), rgba(168, 136, 255, 0.12) 45%, transparent 70%);
    filter: blur(20px);
    animation: glow-pulse 6s ease-in-out infinite;
}
.hero-character {
    position: relative;
    z-index: 2;
    height: 88%;
    width: auto;
    filter: drop-shadow(0 0 24px rgba(122, 214, 255, 0.28)) drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5));
    animation: character-float 7s ease-in-out infinite;
    user-select: none;
    -webkit-user-drag: none;
}
.hero-spark {
    position: absolute;
    z-index: 1;
    color: var(--accent);
    filter: drop-shadow(0 0 8px rgba(122, 214, 255, 0.7));
    animation: avatar-twinkle 3s ease-in-out infinite;
}
.hero-spark-1 { top: 12%; left: 22%; font-size: 1.4rem; }
.hero-spark-2 { top: 30%; right: 18%; font-size: 1rem; animation-delay: 1s; }
.hero-spark-3 { bottom: 20%; left: 14%; font-size: 1.5rem; animation-delay: 2s; }

.float-card {
    position: absolute;
    z-index: 3;
    width: 230px;
    padding: 14px 16px;
    background: rgba(17, 24, 38, 0.82);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(122, 214, 255, 0.22);
    border-radius: 16px;
    box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.7), 0 0 30px -12px rgba(122, 214, 255, 0.35);
    animation: card-float 6s ease-in-out infinite;
}
.float-card-body { transition: opacity 0.35s ease, transform 0.35s ease; }
.float-card.is-swapping .float-card-body { opacity: 0; transform: translateY(6px); }
.rotating-card { min-height: 128px; display: flex; flex-direction: column; }
.rotating-card .float-card-body { flex: 1; }
.float-card-dots { display: flex; justify-content: flex-end; gap: 4px; margin-top: 10px; }
.float-card-dot { width: 5px; height: 5px; border-radius: 999px; background: var(--border); transition: width 0.3s ease, background 0.3s ease; }
.float-card-dot.active { width: 16px; background: var(--accent); }
.float-card p { margin: 0; font-size: 0.82rem; line-height: 1.45; color: #b6c3d6; }
.float-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.float-card-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid rgba(122, 214, 255, 0.3);
    font-size: 0.95rem;
}
.float-card-title { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 0.98rem; color: var(--text); }
.float-card-1 { top: 4%; left: calc(50% + 70px); }
.float-card-2 { top: 60%; right: calc(50% + 100px); animation-delay: -2s; }
.float-card-3 { bottom: 4%; left: calc(50% + 90px); animation-delay: -4s; }
.float-card.mini-widget { background: rgba(17, 24, 38, 0.82); }

@keyframes character-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
@keyframes card-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes glow-pulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.06); }
}
@keyframes avatar-twinkle {
    0%, 100% { opacity: 0.5; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
}

@media (max-width: 900px) {
    .login-hero { grid-template-columns: 1fr; text-align: center; padding-top: 28px; }
    .hero-sub { margin-left: auto; margin-right: auto; }
    .hero-actions, .hero-stats { justify-content: center; }
    .hero-stage { height: 520px; min-height: 0; }
}
@media (max-width: 600px) {
    .login-topbar { padding: 70px 16px 0; }
    .login-nav { gap: 10px; }
    .login-nav-links .nav-link { padding: 8px; font-size: 0.85rem; }
    .login-brand-name { display: none; }
    .hero-stage { height: 440px; }
    .float-card { width: 200px; padding: 11px 12px; }
    .float-card-1, .float-card-2 { display: none; }
    .bg-desktop-only { display: none; }
    .bg-item:not(.bg-clock) { width: 44px; height: 44px; }
    .bg-clock { font-size: 1.8rem; }
    .float-card-3 { left: calc(50% - 100px); bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-character, .float-card, .hero-glow, .hero-spark, .hero-title-accent,
    .bg-aurora, .bg-star, .bg-item, .bg-steam { animation: none; }
    .bg-shooting-star { display: none; }
}

/* --- Language switcher --- */
.lang-switcher {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 200;
}
.lang-current {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 14px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}
.lang-current:hover { border-color: var(--accent); }
.lang-chevron { color: var(--text-muted); font-size: 0.7rem; margin-left: 2px; }
.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    min-width: 160px;
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
}
.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.88rem;
    text-align: left;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
}
.lang-option:hover { background: var(--accent-soft); }
.lang-option.active { color: var(--accent); font-weight: 700; }

/* --- Picker --- */
.view-picker { display: flex; min-height: 100vh; align-items: flex-start; }
.stats-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    min-height: 100vh;
    padding: 56px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.stats-sidebar h2 { font-size: 1.05rem; margin-bottom: 6px; }
.stat-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
}
.stat-icon { font-size: 1.3rem; }
.stat-value { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--moon); line-height: 1.2; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); }
.picker-main { flex: 1; max-width: 780px; margin: 0 auto; padding: 56px 24px; }
.picker-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.guild-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.guild-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, transform 0.1s ease, background 0.15s ease;
}
.guild-card:hover {
    border-color: var(--accent);
    background: var(--surface-raised);
    transform: translateY(-1px);
}
.guild-icon { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; background: var(--surface-raised); object-fit: cover; border: 1px solid var(--border); }
.empty-note { text-align: center; margin-top: 24px; }

/* --- Dashboard shell --- */
.view-dashboard { display: flex; min-height: 100vh; }
.sidebar {
    width: 264px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 26px 18px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.back-link {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    text-align: left;
    padding: 0;
}
.back-link:hover { color: var(--accent); }
.current-guild { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.current-guild span { font-family: 'Baloo 2', sans-serif; font-weight: 600; }
.system-nav { display: flex; flex-direction: column; gap: 6px; }
.system-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: left;
    padding: 11px 13px;
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.system-btn:hover { background: var(--surface-raised); color: var(--text); }
.system-btn.active {
    background: var(--accent-soft);
    color: var(--moon);
    box-shadow: inset 0 0 0 1px rgba(122, 214, 255, 0.35);
}
.system-icon { font-size: 1.1rem; }

.content { flex: 1; padding: 44px; max-width: 780px; }
.panel-header { margin-bottom: 30px; }
.panel-sub { font-size: 0.9rem; }

/* --- Issue banners (falta de permisos, jerarquía de roles, etc) --- */
.issue-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(255, 107, 122, 0.1);
    border: 1px solid var(--danger);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 0.88rem;
    line-height: 1.5;
}
.issue-banner-icon { font-size: 1.1rem; flex-shrink: 0; }
.issue-banner strong { color: var(--danger); }
.room-issue-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 107, 122, 0.18);
    color: var(--danger);
    margin-top: 6px;
}

/* --- Cards --- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    margin-bottom: 20px;
}
.card h3 { font-size: 1.12rem; }
.card label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 15px 0 6px;
}
.card textarea, .card input[type="text"] {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px 12px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.15s ease;
}
.card textarea:focus, .card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.card .btn { margin-top: 18px; }

/* --- Phone rooms --- */
.room-list { display: flex; flex-direction: column; gap: 14px; }
.room-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}
.room-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.room-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tag {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    color: #0a0f1a;
    letter-spacing: 0.2px;
}
.tag-general { background: var(--moon); }
.tag-gaming { background: var(--green); }
.tag-roleplay { background: var(--purple); color: #fff; }
.tag-community { background: var(--orange); }
.tag-anime { background: var(--pink); }
.tag-status-on { background: var(--green); }
.tag-status-off { background: var(--danger); color: #fff; }
.room-meta { font-size: 0.85rem; color: var(--text-muted); margin: 4px 0; }
.room-actions { display: flex; gap: 10px; flex-shrink: 0; align-items: flex-start; }
.room-bans { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.ban-row { display: flex; gap: 8px; align-items: center; font-size: 0.85rem; margin-bottom: 6px; }
.ban-row code { flex: 1; }

/* --- Toggle switch --- */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--border); border-radius: 999px; transition: 0.15s;
}
.switch-slider::before {
    content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
    background: white; border-radius: 50%; transition: 0.15s;
}
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* --- Transición entre páginas --- */
.page-transition-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}
.page-transition-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.page-transition-spinner {
    font-size: 2.4rem;
    filter: drop-shadow(0 0 20px rgba(122, 214, 255, 0.6));
    animation: page-transition-spin 1.1s ease-in-out infinite;
}
@keyframes page-transition-spin {
    0%, 100% { transform: scale(0.85) rotate(-8deg); opacity: 0.7; }
    50% { transform: scale(1.05) rotate(8deg); opacity: 1; }
}

/* Entrada suave del contenido de cada página una vez que se muestra. */
.view.view-animate-in {
    animation: view-fade-in 0.35s ease both;
}
@keyframes view-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-raised);
    border: 1px solid var(--accent);
    color: var(--text);
    padding: 12px 22px;
    border-radius: 11px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 12px 30px -10px rgba(122, 214, 255, 0.35);
    z-index: 100;
}

@media (max-width: 720px) {
    .view-dashboard { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
    .content { padding: 26px; }
    .view-picker { flex-direction: column; }
    .stats-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); min-height: auto; padding: 24px 22px; }
    .view-commands { flex-direction: column; }
    .commands-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); min-height: auto; }
}

/* --- Commands browser page --- */
.view-commands { display: flex; min-height: 100vh; }
.commands-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    min-height: 100vh;
    padding: 26px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.commands-sidebar h2 { font-size: 1rem; margin: 4px 0 0; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; }
.command-search-wrap { position: relative; }
.command-search {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
}
.command-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.category-nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.category-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: left;
    padding: 9px 12px;
    border-radius: 9px;
    cursor: pointer;
}
.category-btn:hover { background: var(--surface-raised); color: var(--text); }
.category-btn.active { background: var(--accent-soft); color: var(--moon); box-shadow: inset 0 0 0 1px rgba(122, 214, 255, 0.35); }
.category-count {
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--surface-raised);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 999px;
    flex-shrink: 0;
}
.category-btn.active .category-count { background: rgba(122, 214, 255, 0.25); color: var(--moon); }

.commands-main { flex: 1; padding: 44px; max-width: 860px; }
.commands-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 26px; flex-wrap: wrap; }
.commands-count { color: var(--text-muted); font-size: 0.9rem; }
.command-list { display: flex; flex-direction: column; gap: 10px; }
.command-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.15s ease;
}
.command-card:hover { border-color: var(--accent); }
.command-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    cursor: pointer;
}
.command-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.command-card-info { flex: 1; min-width: 0; }
.command-name { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.command-desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.vote-tag {
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(249, 182, 255, 0.18);
    color: var(--pink);
    padding: 2px 8px;
    border-radius: 999px;
}
.command-chevron { color: var(--text-muted); transition: transform 0.15s ease; flex-shrink: 0; }
.command-card.expanded .command-chevron { transform: rotate(180deg); }
.command-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
}
.command-card.expanded .command-card-body { max-height: 600px; }
.command-card-body-inner {
    padding: 0 18px 18px 70px;
    font-size: 0.87rem;
    color: var(--text-muted);
    line-height: 1.6;
    white-space: pre-line;
}
.command-card-body-inner code {
    background: var(--surface-raised);
    color: var(--moon);
}

/* --- Mini widget (servidor: en línea / miembros) --- */
.mini-widget {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
}
.mini-widget-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mini-widget-icon {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--border);
    object-fit: cover; flex-shrink: 0;
}
.mini-widget-name { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 0.92rem; }
.mini-widget-stats { display: flex; gap: 8px; }
.mini-widget-stat {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 8px 6px;
    text-align: center;
}
.mini-widget-stat-value { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 1rem; }
.mini-widget-stat-label { font-size: 0.65rem; color: var(--text-muted); margin-top: 1px; }
.mini-widget-loading, .mini-widget-error { font-size: 0.78rem; color: var(--text-muted); text-align: center; padding: 6px 0; }
.online-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 4px; box-shadow: 0 0 7px var(--green); }