/* =========================================================
   ALJOS STUDIO — Sistema de diseño
   Identidad: fondo índigo casi negro + vidrio + gradiente
   violeta→cian, acento ámbar. Motivo firma: borde perforado
   tipo boleto, referencia directa al producto (tickets).
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* --- Fondo --- */
    --void: #0a0c14;
    --void-soft: #0f1220;
    --surface: rgba(255, 255, 255, 0.045);
    --surface-strong: rgba(255, 255, 255, 0.07);
    --border-glass: rgba(255, 255, 255, 0.09);
    --border-glass-hover: rgba(255, 255, 255, 0.18);

    /* --- Acentos (basados en la identidad Aljos) --- */
    --violet: #8b31f0;
    --violet-light: #a855f7;
    --green: #10b981;
    --amber: #fbbf24;
    --gradient-signature: linear-gradient(120deg, #7c1ff0 0%, #8b31f0 50%, #a855f7 100%);
    --gradient-text: linear-gradient(120deg, #c9a5fb 0%, #a855f7 100%);

    /* --- Estado --- */
    --success: #10b981;
    --danger: #fb7185;
    --danger-strong: #f43f5e;

    /* --- Texto --- */
    --text: #f4f5f9;
    --text-muted: #9aa0b4;
    --text-faint: #666c82;

    /* --- Tipografía --- */
    --font-display: 'Sora', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;

    --shadow-glow: 0 8px 40px -12px rgba(139, 92, 246, 0.35);
    --shadow-soft: 0 4px 24px -8px rgba(0, 0, 0, 0.5);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--void);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--violet); color: white; }

:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
    border-radius: 4px;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; }

.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* =========================================================
   AMBIENTE DE FONDO — halo de aurora reutilizable
   ========================================================= */

.aurora-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.aurora-bg::before,
.aurora-bg::after {
    content: "";
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.28;
}
.aurora-bg::before {
    background: var(--violet);
    top: -20%;
    left: -10%;
}
.aurora-bg::after {
    background: var(--green);
    bottom: -25%;
    right: -10%;
}

/* =========================================================
   BOTONES
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 15px;
    padding: 13px 24px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    color: white;
    background: var(--gradient-signature);
    box-shadow: var(--shadow-glow);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn:active { transform: translateY(0); }

.btn.secondary {
    background: var(--surface);
    border: 1px solid var(--border-glass);
    box-shadow: none;
    color: var(--text);
    backdrop-filter: blur(12px);
}
.btn.secondary:hover { background: var(--surface-strong); border-color: var(--border-glass-hover); }

.btn.danger { background: var(--danger-strong); box-shadow: 0 8px 30px -10px rgba(244, 63, 94, .5); }

.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* =========================================================
   LANDING + LOGIN
   ========================================================= */

.landing {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 26px 6vw;
    position: relative;
    z-index: 2;
}
.landing-nav .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: .01em;
}
.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--void-soft);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }

.brand-word { font-weight: 700; }
.brand-word .accent { color: var(--violet-light); }

.landing-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 6vw 80px;
    position: relative;
    z-index: 2;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: .06em;
    color: var(--green);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.28);
    padding: 7px 14px;
    border-radius: 999px;
    margin-bottom: 26px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

.landing-hero h1 {
    font-size: clamp(2.4rem, 5.5vw, 4.2rem);
    line-height: 1.06;
    font-weight: 800;
    letter-spacing: -0.02em;
    max-width: 820px;
}

.landing-hero p.lead {
    margin-top: 22px;
    font-size: 18px;
    color: var(--text-muted);
    max-width: 560px;
    line-height: 1.6;
}

.landing-hero .cta-row {
    margin-top: 40px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.landing-hero .btn { font-size: 16px; padding: 15px 30px; }

/* --- ticket stub: motivo firma reutilizado como divisor --- */
.ticket-divider {
    position: relative;
    width: min(680px, 90vw);
    height: 1px;
    margin: 56px auto 0;
    background: repeating-linear-gradient(90deg, var(--border-glass-hover) 0 10px, transparent 10px 20px);
}
.ticket-divider::before,
.ticket-divider::after {
    content: "";
    position: absolute;
    top: -9px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--void);
    border: 1px solid var(--border-glass-hover);
}
.ticket-divider::before { left: -9px; }
.ticket-divider::after { right: -9px; }

.feature-row {
    margin-top: 56px;
    display: grid;
    grid-template-columns: repeat(3, minmax(200px, 260px));
    gap: 18px;
}
@media (max-width: 760px) {
    .feature-row { grid-template-columns: 1fr; width: 100%; max-width: 340px; }
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 22px 20px;
    text-align: left;
    backdrop-filter: blur(14px);
    transition: border-color .2s, transform .2s;
}
.feature-card:hover { border-color: var(--border-glass-hover); transform: translateY(-3px); }
.feature-card .icon { font-size: 20px; margin-bottom: 10px; display: block; }
.feature-card h3 { font-size: 14.5px; font-weight: 600; margin-bottom: 6px; }
.feature-card p { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 0; }

.landing-footer {
    text-align: center;
    padding: 22px;
    font-size: 12.5px;
    color: var(--text-faint);
    position: relative;
    z-index: 2;
}

/* --- Footer completo estilo "producto SaaS" --- */
.site-footer {
    position: relative;
    z-index: 2;
    border-top: 1px solid var(--border-glass);
    padding: 56px 6vw 28px;
    margin-top: 40px;
}
.site-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
}
@media (max-width: 760px) {
    .site-footer-grid { grid-template-columns: 1fr; gap: 32px; }
}
.site-footer-brand .brand { margin-bottom: 14px; }
.site-footer-brand p {
    color: var(--text-muted);
    font-size: 13.5px;
    line-height: 1.6;
    max-width: 320px;
    margin: 0 0 16px;
}
.site-footer-social { display: flex; gap: 10px; }
.site-footer-social a {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
}
.site-footer-social a:hover { color: var(--text); border-color: var(--border-glass-hover); }

.site-footer-col h4 {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 0 0 16px;
    font-weight: 600;
}
.site-footer-col a {
    display: block;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 12px;
}
.site-footer-col a:hover { color: var(--text); }

.site-footer-bottom {
    max-width: 1100px;
    margin: 40px auto 0;
    padding-top: 20px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .03em;
    color: var(--text-faint);
}

.nav-support-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
}
.nav-support-btn:hover { color: var(--text); border-color: var(--border-glass-hover); background: var(--surface); }

/* =========================================================
   SECCIONES DE LA LANDING: Premium, Partners, Portafolio
   ========================================================= */

.landing-section {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    margin: 0 auto;
    padding: 70px 6vw 10px;
}

.section-head {
    text-align: center;
    margin-bottom: 36px;
}
.section-head h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.01em;
}
.section-head p {
    color: var(--text-muted);
    font-size: 14.5px;
    margin-top: 8px;
}

.premium-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.premium-item {
    background: var(--surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.premium-item .tick {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(16,185,129,.12);
    color: var(--green);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 1px;
}
.premium-item p { margin: 0; font-size: 13.5px; color: var(--text); line-height: 1.5; }

.partners-grid, .portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.partner-card, .portfolio-card {
    background: var(--surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 18px;
    text-align: left;
    transition: border-color .2s, transform .2s;
}
.partner-card:hover, .portfolio-card:hover { border-color: var(--border-glass-hover); transform: translateY(-2px); }
.partner-card img, .portfolio-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    background: var(--void-soft);
}
.partner-card h4, .portfolio-card h4 { font-size: 14.5px; margin: 0 0 6px; }
.partner-card p, .portfolio-card p { font-size: 13px; color: var(--text-muted); margin: 0 0 10px; line-height: 1.5; }
.partner-card a.visit, .portfolio-card a.visit { font-size: 12.5px; color: var(--violet-light); font-weight: 600; }

.empty-note {
    text-align: center;
    color: var(--text-faint);
    font-size: 13.5px;
    padding: 20px;
    border: 1px dashed var(--border-glass);
    border-radius: var(--radius);
}

/* =========================================================
   SHELL DEL DASHBOARD (sidebar + contenido)
   ========================================================= */

.app-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}
@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
}

.sidebar {
    background: rgba(15, 18, 32, 0.75);
    border-right: 1px solid var(--border-glass);
    backdrop-filter: blur(18px);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 0;
    height: 100vh;
}
@media (max-width: 900px) {
    .sidebar { position: relative; height: auto; flex-direction: row; align-items: center; justify-content: space-between; padding: 16px 18px; }
    .sidebar .sidebar-nav, .sidebar .sidebar-footer { display: none; }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    padding: 4px 6px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: background .15s, color .15s;
}
.sidebar-link .ic { font-size: 16px; width: 20px; text-align: center; }
.sidebar-link:hover { background: var(--surface); color: var(--text); }
.sidebar-link.active {
    background: linear-gradient(90deg, rgba(139,92,246,.18), rgba(16,185,129,.08));
    color: var(--text);
    border: 1px solid rgba(139,92,246,.28);
}
.sidebar-link.disabled { opacity: .4; cursor: default; pointer-events: none; }
.sidebar-link .soon {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: .04em;
    background: var(--surface-strong);
    padding: 2px 6px;
    border-radius: 5px;
    color: var(--text-faint);
}

.sidebar-footer {
    border-top: 1px solid var(--border-glass);
    padding-top: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-footer img {
    width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid var(--border-glass-hover);
}
.sidebar-footer .who { flex: 1; min-width: 0; }
.sidebar-footer .who .name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer .who .role { font-size: 11.5px; color: var(--text-faint); }
.sidebar-footer .logout-icon {
    color: var(--text-faint);
    font-size: 16px;
    padding: 6px;
    border-radius: 6px;
}
.sidebar-footer .logout-icon:hover { color: var(--danger); background: rgba(251,113,133,.1); }

.main-area { padding: 40px 5vw 80px; min-width: 0; }

.page-head { margin-bottom: 30px; }
.page-head h1 { font-size: 26px; font-weight: 700; }
.page-head p { color: var(--text-muted); margin-top: 6px; font-size: 14.5px; }

/* --- Grid de servidores --- */
.guild-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.guild-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    backdrop-filter: blur(14px);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    overflow: hidden;
}
.guild-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gradient-signature);
    opacity: 0;
    transition: opacity .2s;
    z-index: 0;
}
.guild-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glass-hover);
    box-shadow: var(--shadow-soft);
}
.guild-card:hover::before { opacity: 0.06; }
.guild-card > * { position: relative; z-index: 1; }

.guild-avatar-ring {
    width: 68px; height: 68px;
    border-radius: 50%;
    padding: 2.5px;
    background: var(--gradient-signature);
}
.guild-avatar-ring img,
.guild-avatar-ring .fallback-icon {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: var(--void-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
}

.guild-card .name { font-weight: 600; font-size: 14.5px; }
.guild-card .manage-hint {
    font-size: 12px;
    color: var(--text-faint);
    font-family: var(--font-mono);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 70px 20px;
    background: var(--surface);
    border: 1px dashed var(--border-glass-hover);
    border-radius: var(--radius);
    font-size: 14.5px;
    line-height: 1.6;
}

/* =========================================================
   COMPONENTES LEGADO (usados por el editor — Fase 2 los rediseña,
   por ahora heredan los mismos tokens para verse consistentes)
   ========================================================= */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: rgba(15, 18, 32, 0.7);
    border-bottom: 1px solid var(--border-glass);
    backdrop-filter: blur(14px);
    position: relative;
    z-index: 1;
}
.topbar .brand { font-family: var(--font-display); font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; }

.user-chip { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.user-chip img { width: 32px; height: 32px; border-radius: 50%; }

.logout-btn {
    color: var(--text-muted);
    font-size: 13px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
}
.logout-btn:hover { background: var(--surface); color: var(--text); }

.container { max-width: 960px; margin: 0 auto; padding: 32px 24px 80px; position: relative; z-index: 1; }

.editor-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
@media (max-width: 860px) { .editor-grid { grid-template-columns: 1fr; } }

.panel {
    background: var(--surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 18px;
    backdrop-filter: blur(14px);
}
.panel h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin: 0 0 16px; font-family: var(--font-body); font-weight: 700; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.field input[type=text], .field textarea, .field select {
    width: 100%;
    background: var(--void-soft);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--violet); }
.field input[type=color] { width: 48px; height: 36px; padding: 2px; border-radius: var(--radius-sm); border: 1px solid var(--border-glass); background: var(--void-soft); }
.color-row { display: flex; align-items: center; gap: 10px; }

.categoria-row { display: grid; grid-template-columns: 60px 1fr 32px; gap: 8px; margin-bottom: 8px; align-items: center; }
.categoria-row input { width: 100%; }
.remove-cat { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; }
.remove-cat:hover { color: var(--danger); }

.add-cat-btn { background: none; border: 1px dashed var(--border-glass-hover); color: var(--text-muted); padding: 8px; width: 100%; border-radius: var(--radius-sm); cursor: pointer; margin-top: 4px; }
.add-cat-btn:hover { border-color: var(--violet); color: var(--text); }

.discord-preview { background: #232530; border-radius: var(--radius-sm); padding: 16px; border-left: 4px solid var(--violet); }
.discord-preview .title { font-weight: 700; margin-bottom: 6px; word-break: break-word; }
.discord-preview .desc { color: #dbdee1; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.discord-preview img.embed-img { max-width: 100%; border-radius: var(--radius-sm); margin-top: 10px; }
.discord-preview img.embed-thumb { width: 80px; height: 80px; border-radius: var(--radius-sm); float: right; object-fit: cover; }

.preview-select { margin-top: 12px; background: #2b2d38; border: 1px solid #1e1f22; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; color: var(--text-muted); }

.status-msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.status-msg.ok { color: var(--success); }
.status-msg.err { color: var(--danger); }

.sticky-actions { position: sticky; top: 20px; }

.hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

.panel-intro {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: -4px 0 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-glass);
}
.panel-intro strong { color: var(--text); }
.preview-pointer {
    display: inline-block;
    color: var(--violet-light);
    font-weight: 700;
}

.mobile-preview-hint {
    display: none;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin: -6px 0 18px;
}
@media (max-width: 860px) {
    .mobile-preview-hint { display: block; }
    .preview-pointer { display: none; } /* en móvil la vista previa queda abajo, no a la derecha */
}

.section-tabs { display: none; } /* reemplazado por navegación en el sidebar */

/* =========================================================
   PÁGINAS LEGALES (Términos y Privacidad)
   ========================================================= */

.legal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 6vw;
    position: relative;
    z-index: 2;
}

.legal-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 6vw 100px;
    position: relative;
    z-index: 1;
}

.legal-wrap .eyebrow { margin-bottom: 18px; }

.legal-wrap h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}

.legal-updated {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-faint);
    margin-bottom: 40px;
}

.legal-panel {
    background: var(--surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 8px 36px;
    backdrop-filter: blur(14px);
}

.legal-panel h2 {
    font-size: 17px;
    font-weight: 700;
    margin-top: 34px;
    margin-bottom: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-glass);
}
.legal-panel > h2:first-child { border-top: none; padding-top: 26px; margin-top: 26px; }

.legal-panel p, .legal-panel li {
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.75;
}
.legal-panel p { margin-bottom: 14px; }
.legal-panel ul { padding-left: 20px; margin-bottom: 14px; }
.legal-panel li { margin-bottom: 6px; }
.legal-panel strong { color: var(--text); font-weight: 600; }
.legal-panel a { color: var(--violet-light); border-bottom: 1px solid rgba(168,85,247,.35); }
.legal-panel a:hover { border-color: var(--violet-light); }

.legal-panel .legal-disclaimer {
    margin: 26px 0 6px;
    padding: 14px 16px;
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #fcd34d;
}

.legal-footer-links {
    display: flex;
    gap: 18px;
    justify-content: center;
    margin-top: 14px;
    font-size: 12.5px;
    color: var(--text-faint);
}
.legal-footer-links a:hover { color: var(--text-muted); }

/* =========================================================
   PÁGINA DE INVITACIONES (ranking + configuración)
   ========================================================= */

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.toggle-row .toggle-label { font-size: 14px; font-weight: 600; }
.toggle-row .toggle-sub { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }

.switch { position: relative; width: 44px; height: 25px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
    position: absolute; inset: 0; cursor: pointer;
    background: var(--surface-strong);
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    transition: background .15s, border-color .15s;
}
.switch .track::before {
    content: "";
    position: absolute;
    height: 19px; width: 19px;
    left: 2px; top: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform .15s, background .15s;
}
.switch input:checked + .track { background: rgba(139,49,240,.25); border-color: var(--violet); }
.switch input:checked + .track::before { transform: translateX(19px); background: var(--violet-light); }

.placeholder-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.placeholder-chip {
    font-family: var(--font-mono);
    font-size: 11px;
    background: var(--surface-strong);
    border: 1px solid var(--border-glass);
    padding: 3px 8px;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
}
.placeholder-chip:hover { border-color: var(--violet); color: var(--text); }

.leaderboard-table { width: 100%; border-collapse: collapse; }
.leaderboard-table th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-faint);
    padding: 0 10px 10px;
    font-weight: 600;
}
.leaderboard-table td { padding: 10px; border-top: 1px solid var(--border-glass); font-size: 14px; vertical-align: middle; }
.leaderboard-table tr:first-child td { border-top: none; }

.lb-rank { font-family: var(--font-mono); color: var(--text-faint); width: 34px; }
.lb-user { display: flex; align-items: center; gap: 10px; }
.lb-user img, .lb-user .fallback-icon {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--void-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
}
.lb-total { font-weight: 700; color: var(--violet-light); }
.lb-sub { color: var(--text-faint); font-size: 12px; }

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--surface-strong);
    border: 1px solid var(--border-glass);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}
.rank-badge.top {
    background: linear-gradient(135deg, rgba(139,49,240,.18), rgba(16,185,129,.1));
    border-color: rgba(139,49,240,.35);
    color: var(--text);
}

.live-badge {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: .04em;
    background: rgba(16,185,129,.12);
    color: var(--green);
    border: 1px solid rgba(16,185,129,.3);
    padding: 2px 7px;
    border-radius: 5px;
    text-transform: none;
}

.feature-index {
    display: block;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--violet-light);
    margin-bottom: 10px;
    opacity: .85;
}

/* --- Contexto de servidor dentro del sidebar (editor / invitaciones) --- */
.guild-context {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    margin: -6px 0 4px;
    background: var(--surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
}
.guild-context img, .guild-context .fallback-icon {
    width: 26px; height: 26px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--void-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    flex-shrink: 0;
}
.guild-context-name {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
