:root {
    --bg-dark: #0D0D1A;
    --bg-card: #1A1A2E;
    --bg-surface: #16213E;
    --purple-dark: #2D1B69;
    --purple-primary: #7C3AED;
    --purple-neon: #A855F7;
    --purple-light: #C084FC;
    --gold-accent: #F59E0B;
    --gold-light: #FCD34D;
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-hint: #6B7280;
    --success: #10B981;
    --error: #EF4444;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
}

a { color: var(--purple-light); text-decoration: none; }

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

/* Sidebar */
.sidebar {
    width: 230px;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.05);
}
.brand {
    font-size: 22px;
    font-weight: 700;
    padding: 0 24px 24px;
    color: var(--text-primary);
}
.brand span { color: var(--gold-accent); }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar nav a {
    color: var(--text-secondary);
    padding: 12px 24px;
    font-size: 15px;
    border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: rgba(124,58,237,0.1); color: var(--text-primary); }
.sidebar nav a.active {
    background: rgba(124,58,237,0.18);
    color: var(--purple-light);
    border-left-color: var(--purple-neon);
    font-weight: 600;
}
.sidebar-footer {
    padding: 16px 24px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}
.sidebar-footer a { color: var(--error); }

/* Content */
.content { flex: 1; padding: 32px 40px; }
h1 { margin-top: 0; }
h1, h2, h3 { color: var(--text-primary); }

/* Cards */
.cards { display: flex; gap: 20px; margin-bottom: 32px; flex-wrap: wrap; }
.card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 14px;
    padding: 20px 28px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.card-label { color: var(--text-secondary); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.card-value { font-size: 32px; font-weight: 700; color: var(--purple-light); }
.card-value.gold { color: var(--gold-light); }

/* Tables */
table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: 12px; overflow: hidden; }
thead { background: var(--bg-surface); }
th, td { text-align: left; padding: 12px 16px; font-size: 14px; }
th { color: var(--text-secondary); font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: .5px; }
tbody tr { border-top: 1px solid rgba(255,255,255,0.05); }
tbody tr:hover { background: rgba(255,255,255,0.02); }

/* Badges */
.badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-error { background: rgba(239,68,68,0.15); color: var(--error); }
.badge-purple { background: rgba(168,85,247,0.15); color: var(--purple-light); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--purple-primary);
}
.btn:hover { background: var(--purple-neon); }
.btn-danger { background: var(--error); }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: var(--bg-surface); color: var(--text-primary); }
.btn-secondary:hover { background: #1f2c4d; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Forms */
.form-box {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 24px;
    max-width: 480px;
    margin-bottom: 24px;
}
label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-secondary); }
input, select {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 14px;
}
input:focus, select:focus { outline: 1px solid var(--purple-neon); }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.search-box input { margin-bottom: 0; width: 260px; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-error { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.alert-success { background: rgba(16,185,129,0.12); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }

/* Login screen */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, var(--purple-dark), var(--bg-dark) 70%);
}
.login-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-card h1 { text-align: center; margin-bottom: 4px; font-size: 24px; }
.login-card h1 span { color: var(--gold-accent); }
.login-card p.subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 24px; font-size: 13px; }
.login-card .btn { width: 100%; padding: 12px; font-size: 14px; }

.hint { color: var(--text-hint); font-size: 12px; margin-top: -8px; margin-bottom: 16px; }

@media (max-width: 768px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 12px 16px; overflow-x: auto; }
    .sidebar nav { flex-direction: row; }
    .sidebar-footer { display: none; }
    .content { padding: 20px; }
}
