/* ============================================================
   Invision MuWeb — Global Design System (v2.0)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --bg:          #080810;
    --bg-2:        #0d0d1a;
    --card:        rgba(255, 255, 255, 0.04);
    --sidebar:     #080810;
    --primary:     #7c3aed;
    --primary-glow:#9d5cf6;
    --primary-gradient: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    --accent:      #f97316;
    --text:        #f1f1f5;
    --text-dim:    #8b8ba7;
    --border:      rgba(255, 255, 255, 0.08);
    --danger:      #ef4444;
    --success:     #22c55e;
    --radius:      18px;
    --radius-lg:   24px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ---------- Noise overlay ---------- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: .5;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -0.02em; }
.text-dim { color: var(--text-dim); }

/* ---------- Layout Wrapper ---------- */
.layout-wrapper { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ---------- Sidebar ---------- */
.sidebar {
    width: 280px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    margin-bottom: 40px;
    padding: 0 10px;
}

.sidebar .logo i {
    font-size: 28px;
    color: var(--primary-glow);
    text-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
}

.sidebar nav { display: flex; flex-direction: column; gap: 6px; }

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.menu-item i { font-size: 20px; }

.menu-item:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.menu-item.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(124, 58, 237, 0.05));
    color: var(--primary-glow);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

/* ---------- Main Content ---------- */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 40px 60px;
    max-width: 1400px;
    transition: 0.3s;
    position: relative;
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* ---------- Cards ---------- */
.card {
    background: var(--card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* ---------- Stats Cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    padding: 24px;
}

.stat-card .label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(180deg, #fff, #8b8ba7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
    margin-bottom: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.45);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    transition: 0.2s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-glow);
    background: rgba(124, 58, 237, 0.05);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

/* ---------- Input Group ---------- */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 16px;
    font-size: 18px;
    color: var(--text-dim);
    pointer-events: none;
}

.input-group .form-control {
    padding-left: 46px;
}

/* ---------- Table ---------- */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 16px 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 18px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

tr:last-child td { border-bottom: none; }

/* ---------- Auth Pages ---------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 800px; height: 800px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 48px;
    background: linear-gradient(145deg, rgba(20, 20, 35, 0.9), rgba(10, 10, 20, 0.95));
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 10;
}

.auth-logo {
    width: 56px; height: 56px;
    background: var(--primary-gradient);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 32px;
    font-size: 28px;
    color: #fff;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.4);
}

.auth-card h1 { text-align: center; font-size: 28px; margin-bottom: 10px; }
.auth-card p { text-align: center; color: var(--text-dim); margin-bottom: 36px; font-size: 15px; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-active { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.badge-suspended { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* ---------- Avatar ---------- */
.avatar-circle {
    width: 42px; height: 42px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
}

/* ---------- Mobile Layout ---------- */
.mobile-header {
    display: none;
    background: var(--bg);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.mobile-header .logo {
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-toggle {
    background: var(--card);
    border: 1px solid var(--border);
    color: #fff;
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    cursor: pointer;
}

@media (max-width: 992px) {
    .sidebar { 
        transform: translateX(-100%); 
        background: #0f0f18 !important; 
        z-index: 9999 !important; 
        box-shadow: 20px 0 50px rgba(0,0,0,0.9);
    }
    .sidebar.active { 
        transform: translateX(0) !important; 
    }
    .sidebar .menu-item {
        color: #e2e8f0 !important;
    }
    .sidebar .menu-item:hover, .sidebar .menu-item.active {
        color: #ffffff !important;
    }
    .main-content { margin-left: 0; padding: 32px 20px; }
    .mobile-header { display: flex; z-index: 1000; }
    .sidebar-overlay {
        position: fixed; inset: 0;
        background: rgba(0, 0, 0, 0.85);
        backdrop-filter: blur(8px);
        z-index: 9998 !important;
        display: none;
    }
    .sidebar-overlay.active { display: contents !important; }
}

/* ---------- Utility ---------- */
.success-msg {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    padding: 12px; border-radius: 10px;
    margin-bottom: 24px; text-align: center;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.error-msg {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 12px; border-radius: 10px;
    margin-bottom: 24px; text-align: center;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
