/**
 * ═══════════════════════════════════════════════════════════════════════════
 * LA TROPA DEL INFIERNO — CYBER-VISION UI (Futuristic SaaS 2026/2027 Edition)
 * Obsidian Black & Hellfire Red — Dark Glassmorphism, Holographic HUD
 * ═══════════════════════════════════════════════════════════════════════════
 */

:root {
    /* ── Full Black Obsidian Canvas ── */
    --bg-base: #050000;
    --bg-sidebar: #080000;
    --bg-surface: #0d0000;
    --bg-surface-elevated: #120000;
    --bg-surface-hover: #1a0000;
    --bg-input: #0a0000;

    /* ── Hellfire Red Borders ── */
    --border-subtle: rgba(255, 255, 255, 0.04);
    --border-default: rgba(255, 255, 255, 0.07);
    --border-accent: rgba(220, 20, 20, 0.30);
    --border-cyan: rgba(255, 60, 60, 0.28);
    --border-focus: rgba(220, 20, 20, 0.65);

    /* ── Hellfire Palette ── */
    --primary: #dc1414;
    --primary-hover: #ff2020;
    --primary-light: #ff8080;
    --primary-glow: rgba(220, 20, 20, 0.38);
    --primary-gradient: linear-gradient(135deg, #dc1414 0%, #8b0000 100%);
    --primary-gradient-subtle: linear-gradient(135deg, rgba(220, 20, 20, 0.16) 0%, rgba(139, 0, 0, 0.04) 100%);

    /* ── Secondary Red Tones ── */
    --cyan: #ff4444;
    --cyan-glow: rgba(255, 68, 68, 0.35);
    --cyan-bg: rgba(255, 68, 68, 0.08);
    --cyan-border: rgba(255, 68, 68, 0.25);

    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.35);
    --success-bg: rgba(16, 185, 129, 0.08);
    --success-border: rgba(16, 185, 129, 0.25);

    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.08);
    --warning-border: rgba(245, 158, 11, 0.25);

    --danger: #ff1a1a;
    --danger-bg: rgba(255, 26, 26, 0.08);
    --danger-border: rgba(255, 26, 26, 0.25);

    /* ── Typography & Contrasts ── */
    --text-primary: #fff5f5;
    --text-secondary: #cc8888;
    --text-muted: #7a4444;
    --text-accent: #ff8080;

    /* ── Radii ── */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-pill: 9999px;

    /* ── Shadows & Depth ── */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.7);
    --shadow-cyber: 0 0 25px rgba(220, 20, 20, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.08);

    /* ── Fonts & Dimensions ── */
    --font-ui: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", monospace;
    --sidebar-width: 275px;
    --topbar-height: 64px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    outline: none;
    border: none;
    background: transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(220, 20, 20, 0.25); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ═══════════════════════════════════════════════════════════════════════════
   AUTHENTICATION (LOGIN & 2FA)
   ═══════════════════════════════════════════════════════════════════════════ */
#login-wrapper {
    display: none;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
    background: #050000;
}

/* ── Dark overlay so login card is readable ── */
#login-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(5, 0, 0, 0.55);
    z-index: 1;
}

/* ── Animated red rays ── */
#login-wrapper::after {
    content: '';
    position: absolute;
    inset: -50%;
    z-index: 2;
    pointer-events: none;
    background:
        conic-gradient(from 0deg at 50% 50%,
            transparent 0deg,
            rgba(220, 20, 20, 0.08) 15deg,
            transparent 30deg,
            transparent 60deg,
            rgba(255, 40, 40, 0.06) 75deg,
            transparent 90deg,
            transparent 120deg,
            rgba(220, 20, 20, 0.1) 140deg,
            transparent 160deg,
            transparent 200deg,
            rgba(180, 10, 10, 0.07) 220deg,
            transparent 240deg,
            transparent 280deg,
            rgba(255, 30, 30, 0.09) 300deg,
            transparent 320deg,
            transparent 360deg
        );
    animation: loginRaysRotate 25s linear infinite;
    mix-blend-mode: screen;
}

@keyframes loginRaysRotate {
    0%   { transform: rotate(0deg) scale(1.5); }
    50%  { transform: rotate(180deg) scale(1.8); }
    100% { transform: rotate(360deg) scale(1.5); }
}

/* ── Floating red glow orbs ── */
.login-glow-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(60px);
    opacity: 0;
    z-index: 2;
}
.login-glow-orb:nth-child(1) {
    width: 300px; height: 300px;
    background: rgba(220, 20, 20, 0.25);
    top: 10%; left: 15%;
    animation: orbFloat1 12s ease-in-out infinite;
}
.login-glow-orb:nth-child(2) {
    width: 200px; height: 200px;
    background: rgba(255, 50, 50, 0.2);
    bottom: 20%; right: 10%;
    animation: orbFloat2 15s ease-in-out infinite 3s;
}
.login-glow-orb:nth-child(3) {
    width: 250px; height: 250px;
    background: rgba(180, 10, 10, 0.18);
    top: 50%; left: 60%;
    animation: orbFloat3 18s ease-in-out infinite 6s;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0); opacity: 0.4; }
    25%  { transform: translate(40px, -30px); opacity: 0.7; }
    50%  { transform: translate(-20px, 20px); opacity: 0.5; }
    75%  { transform: translate(30px, 40px); opacity: 0.8; }
}
@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0); opacity: 0.3; }
    33%  { transform: translate(-50px, -40px); opacity: 0.6; }
    66%  { transform: translate(30px, 20px); opacity: 0.7; }
}
@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0); opacity: 0.3; }
    25%  { transform: translate(-30px, 50px); opacity: 0.5; }
    50%  { transform: translate(40px, -20px); opacity: 0.7; }
    75%  { transform: translate(-50px, -30px); opacity: 0.4; }
}

body.not-logged-in #login-wrapper { display: flex; }

.vision-auth-container {
    width: 100%;
    max-width: 430px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-cyber);
    padding: 2.75rem 2.2rem;
    position: relative;
    z-index: 10;
}

.vision-auth-logo-box {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.vision-auth-logo-img {
    width: 90px;
    height: 90px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    filter: drop-shadow(0 4px 20px rgba(220, 20, 20, 0.60));
}

.vision-auth-logo-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent !important;
}

.vision-auth-title {
    font-family: var(--font-ui), "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 2.2rem;
}

.vision-auth-sub { color: var(--text-secondary); font-size: 0.88rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD SHELL & HUD LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */
#dashboard {
    display: none;
    height: 100vh;
    overflow: hidden;
    width: 100%;
    background: var(--bg-base);
}

body.logged-in #dashboard { display: flex; }

/* ── SIDEBAR HUD ── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.25s var(--ease);
}

.sidebar-brand {
    padding: 1.35rem 1.25rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(220, 20, 20, 0.18);
    background: linear-gradient(180deg, rgba(220, 20, 20, 0.08) 0%, transparent 100%);
}

.brand-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    filter: drop-shadow(0 0 14px rgba(220, 20, 20, 0.65));
}
.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent !important;
}

.brand-text-wrap { display: flex; flex-direction: column; }

.brand-text {
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 1.28rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 35%, #ffb3b3 75%, #ff4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(220, 20, 20, 0.40));
    line-height: 1.15;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-badge {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(220, 20, 20, 0.2);
    border: 1px solid rgba(220, 20, 20, 0.45);
    color: #ff8080;
    font-family: "JetBrains Mono", monospace !important;
    -webkit-text-fill-color: #ff8080;
    box-shadow: 0 0 8px rgba(220, 20, 20, 0.30);
}

/* ── Next-Gen Cyber Energy / Quota Core ── */
.limit-card {
    margin: 14px 12px 6px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(220, 20, 20, 0.09) 0%, rgba(8, 0, 0, 0.7) 50%, rgba(255, 68, 68, 0.05) 100%);
    border: 1px solid rgba(220, 20, 20, 0.22);
    border-radius: var(--radius-lg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 8px 24px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}

.limit-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(220, 20, 20, 0.6) 50%, transparent 100%);
}

.limit-card:hover {
    border-color: rgba(220, 20, 20, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 8px 30px rgba(220, 20, 20, 0.20);
    transform: translateY(-1px);
}

.limit-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.limit-core-brand { display: flex; align-items: center; gap: 7px; }

.limit-core-icon {
    width: 22px; height: 22px;
    border-radius: 6px;
    background: rgba(220, 20, 20, 0.18);
    border: 1px solid rgba(220, 20, 20, 0.35);
    color: var(--primary-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem;
    box-shadow: 0 0 8px rgba(220, 20, 20, 0.30);
}

.limit-core-title {
    font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--text-primary); font-family: var(--font-ui);
}

.limit-status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 7px; border-radius: var(--radius-pill);
    background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.62rem; color: var(--success); font-family: var(--font-mono);
    font-weight: 700; letter-spacing: 0.04em;
}

.limit-counter-wrap { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }

.limit-number-big {
    font-family: var(--font-mono); font-size: 1.25rem; font-weight: 800;
    color: #fff; letter-spacing: -0.02em;
    display: flex; align-items: baseline; gap: 4px;
}

.limit-number-big #dailyUsed { color: var(--primary-light); text-shadow: 0 0 10px rgba(220, 20, 20, 0.5); }
.limit-number-big .limit-slash { color: var(--text-muted); font-size: 0.95rem; font-weight: 400; }
.limit-number-big #dailyLimit { color: var(--cyan); font-size: 1rem; opacity: 0.9; }

.limit-unit-tag {
    font-size: 0.68rem; color: var(--text-muted); font-family: var(--font-mono);
    text-transform: uppercase; letter-spacing: 0.05em;
}

.limit-bar-bg {
    height: 5px; background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-pill); overflow: hidden;
    position: relative; border: 1px solid rgba(255, 255, 255, 0.04);
}

.limit-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc1414 0%, #ff4444 100%);
    border-radius: var(--radius-pill);
    box-shadow: 0 0 10px rgba(220, 20, 20, 0.7), 0 0 4px #ff4444;
    transition: width 0.4s var(--ease);
}

.limit-sub {
    font-size: 0.68rem; color: var(--text-muted); margin-top: 8px;
    display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono);
}
.limit-sub i { font-size: 0.65rem; color: var(--primary); }

/* Nav Menu */
.nav-section-label {
    font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-muted); font-weight: 800; padding: 0 16px;
    margin: 18px 0 6px; display: flex; align-items: center; gap: 6px;
}

.nav-menu { list-style: none; padding: 0 10px; margin-bottom: 2px; }

.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 0.88rem; font-weight: 500;
    cursor: pointer; transition: all 0.15s ease; user-select: none;
    margin-bottom: 2px; position: relative;
}

.nav-link i { width: 18px; text-align: center; font-size: 0.92rem; flex-shrink: 0; color: var(--text-muted); transition: color 0.15s ease; }
.nav-link:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.nav-link:hover i { color: var(--primary-light); }

.nav-link.active {
    background: var(--primary-gradient-subtle);
    color: var(--text-primary); font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.nav-link.active::before {
    content: '';
    position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
    background: var(--primary); border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
    box-shadow: 0 0 8px var(--primary);
}
.nav-link.active i { color: var(--primary); }

.nav-link .nav-badge {
    margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: var(--radius-pill); background: var(--primary); color: #fff;
    font-size: 0.65rem; font-weight: 800; display: none;
    align-items: center; justify-content: center; box-shadow: 0 0 6px var(--primary);
}
.nav-link .nav-badge.show { display: inline-flex; }

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto; padding: 14px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

.user-card {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border-subtle);
    margin-bottom: 8px;
}

.user-avatar {
    width: 34px; height: 34px; border-radius: var(--radius-sm);
    background: var(--primary-gradient);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.8rem; color: #fff; flex-shrink: 0;
    box-shadow: 0 0 8px rgba(220, 20, 20, 0.40);
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.user-role { font-size: 0.7rem; color: var(--cyan); font-family: var(--font-mono); font-weight: 600; text-transform: uppercase; }

.btn-logout {
    width: 100%; padding: 8px; background: transparent;
    border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
    color: var(--text-muted); font-size: 0.8rem; font-weight: 600;
    cursor: pointer; transition: all 0.15s ease;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-logout:hover { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }

/* ── MAIN CONTENT (HUD DISPLAY) ── */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 0%, rgba(220, 20, 20, 0.05) 0%, transparent 45%),
        var(--bg-base);
    display: flex; flex-direction: column; position: relative;
    width: calc(100% - var(--sidebar-width)); flex: 1; overflow-y: auto;
}

/* ── TOPBAR HUD ── */
.topbar {
    position: sticky; top: 0;
    background: rgba(5, 0, 0, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 2rem;
    display: flex; align-items: center; justify-content: space-between;
    z-index: 500; height: var(--topbar-height);
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.topbar-toggle {
    display: none; background: transparent;
    border: 1px solid var(--border-subtle); color: var(--text-primary);
    padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer;
}

.topbar-breadcrumb {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.85rem; color: var(--text-muted);
}
.topbar-breadcrumb a { color: var(--text-secondary); display: flex; align-items: center; gap: 6px; transition: color 0.15s ease; }
.topbar-breadcrumb a:hover { color: var(--text-primary); }
.topbar-breadcrumb .cur-page { color: var(--text-primary); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.status-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 12px; border-radius: var(--radius-pill);
    background: var(--success-bg); border: 1px solid var(--success-border);
    font-size: 0.72rem; color: var(--success); font-family: var(--font-mono);
    font-weight: 600; box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.hud-clock {
    font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted);
    padding: 4px 8px; border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border-subtle);
}

.page {
    padding: 2rem; flex: 1; display: flex; flex-direction: column; justify-content: flex-start;
    width: 100%; box-sizing: border-box; max-width: 1400px; margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CYBER STATS MODULES
   ═══════════════════════════════════════════════════════════════════════════ */
.stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 1rem; margin-bottom: 1.5rem; width: 100%;
}

.stat-card {
    background: var(--bg-surface); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg); padding: 1.25rem 1.4rem;
    position: relative; overflow: hidden;
    display: flex !important; flex-direction: column; justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stat-label {
    font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.08em; font-weight: 700; margin-bottom: 8px; font-family: var(--font-mono);
}

.stat-value { font-size: 2.1rem; font-weight: 800; line-height: 1; color: var(--text-primary); letter-spacing: -0.02em; }

.stat-icon {
    position: absolute; top: 1.25rem; right: 1.25rem;
    width: 38px; height: 38px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.stat-icon.gold {
    background: rgba(220, 20, 20, 0.12); color: var(--primary-light);
    border: 1px solid rgba(220, 20, 20, 0.25); box-shadow: 0 0 12px rgba(220, 20, 20, 0.20);
}
.stat-icon.teal {
    background: var(--cyan-bg); color: var(--cyan);
    border: 1px solid var(--cyan-border); box-shadow: 0 0 12px rgba(255, 68, 68, 0.20);
}
.stat-icon.green {
    background: var(--success-bg); color: var(--success);
    border: 1px solid var(--success-border); box-shadow: 0 0 12px rgba(16, 185, 129, 0.20);
}
.stat-icon.red {
    background: var(--danger-bg); color: var(--danger);
    border: 1px solid var(--danger-border); box-shadow: 0 0 12px rgba(255, 26, 26, 0.20);
}

/* General Container Card */
.card {
    background: var(--bg-surface); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg); overflow: hidden; width: 100%;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.card-header {
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-subtle);
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; background: rgba(0, 0, 0, 0.15);
}

.card-title { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; color: var(--text-primary); }
.card-body { padding: 1.5rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   FORM CONTROLS & CYBER BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block; font-size: 0.74rem; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0.02em;
}

.form-input {
    width: 100%; padding: 11px 14px;
    background: var(--bg-input); border: 1px solid var(--border-default);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 0.92rem; font-family: inherit; transition: all 0.15s ease; outline: none;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(220, 20, 20, 0.20); }
.form-input::placeholder { color: var(--text-muted); }

.btn-gold {
    width: 100%; padding: 11px 18px;
    background: var(--primary-gradient); color: #fff;
    font-weight: 600; font-size: 0.9rem; border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.15s ease;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 2px 10px rgba(220, 20, 20, 0.35);
}
.btn-gold:hover { opacity: 0.95; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(220, 20, 20, 0.50); }
.btn-gold:active { transform: translateY(0); }

.btn-ghost {
    width: 100%; padding: 10px 16px; background: transparent;
    border: 1px solid var(--border-default); color: var(--text-secondary);
    border-radius: var(--radius-sm); cursor: pointer; font-size: 0.88rem; font-weight: 500;
    transition: all 0.15s ease; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--text-muted); color: var(--text-primary); }

.btn-sm {
    padding: 7px 14px; background: var(--primary-gradient); color: #fff;
    font-weight: 600; font-size: 0.8rem; border-radius: var(--radius-xs);
    cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    transition: opacity 0.15s ease, transform 0.15s ease;
    text-decoration: none; box-shadow: 0 2px 8px rgba(220, 20, 20, 0.28);
}
.btn-sm:hover { opacity: 0.92; transform: translateY(-1px); }

.btn-icon {
    width: 32px; height: 32px; border-radius: var(--radius-xs);
    border: 1px solid var(--border-subtle); background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary); cursor: pointer; font-size: 0.8rem;
    transition: all 0.15s ease; display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--bg-surface-hover); color: var(--text-primary); border-color: var(--border-default); }
.btn-icon.danger { color: var(--danger); border-color: var(--danger-border); }
.btn-icon.danger:hover { background: var(--danger-bg); }
.btn-icon.success { color: var(--success); border-color: var(--success-border); }
.btn-icon.success:hover { background: var(--success-bg); }
.btn-icon.warn { color: var(--warning); border-color: var(--warning-border); }
.btn-icon.warn:hover { background: var(--warning-bg); }

/* ═══════════════════════════════════════════════════════════════════════════
   TABLES & CHIP BADGES
   ═══════════════════════════════════════════════════════════════════════════ */
.table-wrap {
    width: 100% !important; max-height: 600px !important;
    overflow-y: auto !important; overflow-x: auto !important;
    border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--bg-base);
}

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 720px; }

thead th {
    padding: 12px 16px; background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted); font-size: 0.68rem;
    text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
    font-family: var(--font-mono); text-align: left; border-bottom: 1px solid var(--border-subtle);
}

tbody tr { border-bottom: 1px solid var(--border-subtle); transition: background 0.15s ease; }
tbody tr:hover { background: rgba(220, 20, 20, 0.04); }
tbody td { padding: 12px 16px; color: var(--text-primary); vertical-align: middle; }

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: var(--radius-pill);
    font-size: 0.7rem; font-weight: 600; font-family: var(--font-mono);
    letter-spacing: 0.04em; text-transform: uppercase;
}
.badge.success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge.pending { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge.error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger-border); }
.badge.info    { background: rgba(220, 20, 20, 0.10); color: var(--primary-light); border: 1px solid rgba(220, 20, 20, 0.25); }

/* ═══════════════════════════════════════════════════════════════════════════
   BYPASS STUDIO & QUANTUM UPLOAD CHAMBER
   ═══════════════════════════════════════════════════════════════════════════ */
.upload-zone {
    border: 1.5px dashed var(--border-accent); border-radius: var(--radius-lg);
    padding: 3.5rem 2rem; text-align: center; cursor: pointer;
    transition: all 0.25s ease; background: rgba(220, 20, 20, 0.02);
    position: relative; overflow: hidden;
}
.upload-zone:hover, .upload-zone.drag {
    border-color: var(--primary); background: rgba(220, 20, 20, 0.06);
    box-shadow: 0 0 30px rgba(220, 20, 20, 0.15);
}

.upload-icon {
    width: 64px; height: 64px; margin: 0 auto 1.25rem;
    background: rgba(220, 20, 20, 0.10); border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; color: var(--primary);
    border: 1px solid rgba(220, 20, 20, 0.25);
    box-shadow: 0 0 16px rgba(220, 20, 20, 0.20);
}

.upload-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.35rem; color: var(--text-primary); }
.upload-sub   { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 0.25rem; }
.upload-hint  { color: var(--text-muted); font-size: 0.78rem; }

/* Phone Mockup */
.phone-shell {
    margin: 0 auto; max-width: 270px; padding: 10px;
    border-radius: 28px; background: #020000;
    border: 1px solid var(--border-default);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(220, 20, 20, 0.12);
}

.phone-notch { width: 90px; height: 16px; border-radius: 0 0 12px 12px; background: #010000; margin: 0 auto 8px; }

.phone-screen {
    border-radius: 20px; overflow: hidden; background: #fff; color: #202124;
    min-height: 480px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT / SUPPORT ENCRYPTED STREAM
   ═══════════════════════════════════════════════════════════════════════════ */
.chat-layout {
    display: grid; grid-template-columns: 260px 1fr;
    height: min(72vh, 640px); min-height: 520px;
    border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
    overflow: hidden; background: var(--bg-surface);
}

.chat-threads { border-right: 1px solid var(--border-subtle); background: rgba(0, 0, 0, 0.25); display: flex; flex-direction: column; }
.chat-threads-head { padding: 12px 14px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); border-bottom: 1px solid var(--border-subtle); font-weight: 800; font-family: var(--font-mono); }
.chat-thread-list { flex: 1; overflow-y: auto; }

.chat-thread-item { display: block; width: 100%; text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); cursor: pointer; transition: background 0.15s ease; }
.chat-thread-item:hover { background: rgba(255, 255, 255, 0.02); }
.chat-thread-item.active { background: rgba(220, 20, 20, 0.12); border-left: 3px solid var(--primary); }

.chat-main { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.chat-main-head { padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; background: rgba(0, 0, 0, 0.15); }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 10px; }

.chat-bubble { max-width: 75%; padding: 10px 14px; border-radius: var(--radius-md); font-size: 0.88rem; line-height: 1.45; }
.chat-bubble.me { align-self: flex-end; background: rgba(220, 20, 20, 0.22); border: 1px solid rgba(220, 20, 20, 0.35); color: var(--text-primary); }
.chat-bubble.them { align-self: flex-start; background: var(--bg-surface-elevated); border: 1px solid var(--border-subtle); color: var(--text-primary); }
.chat-bubble .cb-meta { font-size: 0.68rem; color: var(--text-muted); margin-bottom: 4px; font-family: var(--font-mono); }

.chat-compose { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border-subtle); background: rgba(0, 0, 0, 0.15); }

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════════ */
.modal-backdrop {
    display: none; position: fixed; inset: 0; z-index: 2000;
    background: rgba(2, 0, 0, 0.90); backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px); align-items: center; justify-content: center; padding: 1rem;
}
.modal-backdrop.active { display: flex; }

.modal-box {
    background: var(--bg-surface); border: 1px solid var(--border-default);
    border-radius: var(--radius-xl); width: 100%; max-width: 460px;
    box-shadow: var(--shadow-cyber); animation: modalScale 0.2s var(--ease);
}

@keyframes modalScale {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 18px 22px; border-bottom: 1px solid var(--border-subtle);
    display: flex; align-items: center; justify-content: space-between; background: rgba(0, 0, 0, 0.15);
}
.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.modal-close {
    width: 28px; height: 28px; border-radius: var(--radius-xs);
    border: 1px solid var(--border-subtle); background: transparent;
    color: var(--text-muted); cursor: pointer; font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center; transition: all 0.15s ease;
}
.modal-close:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.modal-body { padding: 22px; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE QUERIES
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .topbar-toggle { display: block; }
    .page { padding: 1.25rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .chat-layout { grid-template-columns: 1fr; height: auto; }
}
