*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #0f1117;
    --bg2:       #1a1d27;
    --bg3:       #22263a;
    --border:    #2e3250;
    --primary:   #6c63ff;
    --primary-h: #574fd6;
    --success:   #22c55e;
    --danger:    #ef4444;
    --warning:   #f59e0b;
    --text:      #e2e8f0;
    --text-muted:#8892a4;
    --radius:    12px;
    --radius-sm: 8px;
    --shadow:    0 4px 24px rgba(0,0,0,.4);
    --font:      'Inter', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 15px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.flash {
    position: fixed; top: 16px; right: 16px; z-index: 999;
    padding: 12px 20px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; max-width: 360px;
    animation: slideIn .3s ease;
}
.flash--success { background: #14532d; color: #86efac; border: 1px solid #22c55e33; }
.flash--error   { background: #450a0a; color: #fca5a5; border: 1px solid #ef444433; }
.flash--info    { background: #1e3a5f; color: #93c5fd; border: 1px solid #3b82f633; }
@keyframes slideIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: none; } }

.auth-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px 16px;
    background: radial-gradient(ellipse at 60% 20%, #1e1b4b55 0%, transparent 60%),
                radial-gradient(ellipse at 20% 80%, #312e8133 0%, transparent 50%),
                var(--bg);
}

.auth-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 36px;
    width: 100%; max-width: 420px;
    box-shadow: var(--shadow);
}

.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-icon {
    width: 52px; height: 52px; border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #a78bfa);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 24px; margin-bottom: 10px;
}
.auth-logo h1 { font-size: 20px; font-weight: 700; color: var(--text); }
.auth-logo p  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 500;
    color: var(--text-muted); margin-bottom: 7px;
}
.form-control {
    width: 100%; padding: 11px 14px;
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-size: 15px; font-family: var(--font);
    transition: border-color .2s; outline: none;
}
.form-control:focus { border-color: var(--primary); }
.form-control::placeholder { color: var(--text-muted); }

.input-icon { position: relative; }
.input-icon .form-control { padding-left: 42px; }
.input-icon .icon {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 17px; pointer-events: none;
}
.input-icon .toggle-pass {
    position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); cursor: pointer; font-size: 17px;
    background: none; border: none;
}

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 12px 20px; border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 600; font-family: var(--font);
    cursor: pointer; border: none; transition: all .2s; width: 100%;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); transform: translateY(-1px); }
.btn-primary:active { transform: none; }

.form-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 20px; font-size: 13px; color: var(--text-muted);
}

.divider {
    display: flex; align-items: center; gap: 12px;
    margin: 22px 0; color: var(--text-muted); font-size: 13px;
}
.divider::before, .divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

.otp-wrap {
    display: flex; gap: 10px; justify-content: center; margin: 20px 0;
}
.otp-input {
    width: 48px; height: 56px; text-align: center;
    font-size: 22px; font-weight: 700;
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    outline: none; transition: border-color .2s;
}
.otp-input:focus { border-color: var(--primary); }

.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px; background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 20px 0; flex-shrink: 0;
    transition: transform .3s;
}
.sidebar-logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 16px; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-logo .s-icon {
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--primary); display: flex;
    align-items: center; justify-content: center; font-size: 16px;
}
.sidebar-nav { padding: 16px 12px; flex: 1; }
.nav-section {
    font-size: 11px; color: var(--text-muted);
    padding: 10px 8px 4px; text-transform: uppercase; letter-spacing: .08em;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-size: 14px; font-weight: 500;
    cursor: pointer; transition: all .15s; margin-bottom: 2px;
    text-decoration: none;
}
.nav-item:hover { background: var(--bg3); color: var(--text); text-decoration: none; }
.nav-item.active { background: #6c63ff22; color: var(--primary); }
.nav-item .ni { font-size: 18px; }

.main-content { flex: 1; overflow-y: auto; padding: 28px; background: var(--bg); }
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 22px; font-weight: 700; }
.page-header p  { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.card {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.stat-card {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    display: flex; align-items: center; gap: 14px;
}
.stat-icon {
    width: 44px; height: 44px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.stat-icon.purple { background: #6c63ff22; color: var(--primary); }
.stat-icon.green  { background: #22c55e22; color: var(--success); }
.stat-icon.red    { background: #ef444422; color: var(--danger);  }
.stat-icon.amber  { background: #f59e0b22; color: var(--warning); }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
    text-align: left; padding: 10px 14px; font-size: 12px;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: .06em; border-bottom: 1px solid var(--border);
}
td { padding: 13px 14px; border-bottom: 1px solid #2e325055; }
tr:last-child td { border: none; }
tr:hover td { background: #22263a88; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-active    { background: #14532d; color: #86efac; }
.badge-suspended { background: #450a0a; color: #fca5a5; }
.badge-pending   { background: #451a03; color: #fcd34d; }

.topbar {
    display: none; background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 14px 16px; align-items: center; gap: 14px;
}
.hamburger { background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; }
.topbar-title { font-size: 16px; font-weight: 700; flex: 1; }
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.6); z-index: 99;
}

@media (max-width: 768px) {
    .topbar { display: flex; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0;
        z-index: 100; transform: translateX(-100%);
    }
    .sidebar.open { transform: none; }
    .sidebar-overlay.open { display: block; }
    .main-content { padding: 16px; }
    .auth-card { padding: 28px 20px; }
    .otp-input { width: 40px; height: 50px; font-size: 18px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
    .stats-grid { grid-template-columns: 1fr; }
    .form-footer { flex-direction: column; gap: 8px; text-align: center; }
}

.footer {
    text-align: center; padding: 20px; font-size: 12px;
    color: var(--text-muted); border-top: 1px solid var(--border);
    margin-top: auto;
}

.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; margin-bottom: 18px;
    line-height: 1.5;
}
.alert--error   { background: #450a0a; color: #fca5a5; border: 1px solid #ef444433; }
.alert--success { background: #14532d; color: #86efac; border: 1px solid #22c55e33; }
.alert--info    { background: #1e3a5f; color: #93c5fd; border: 1px solid #3b82f633; }
