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

:root {
    --bg: #0f0f0f;
    --bg2: #1a1a1a;
    --bg3: #252525;
    --border: #333;
    --text: #fff;
    --text2: #999;
    --accent: #6366f1;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.header {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 { font-size: 20px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.header h1 span { font-size: 24px; }

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.header-center select {
    padding: 8px 16px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    min-width: 200px;
}

.header-center select:focus {
    outline: none;
    border-color: var(--accent);
}

.nav-tabs {
    display: flex;
    gap: 4px;
}

.nav-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text2);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.2s;
}

.nav-tab:hover { background: var(--bg3); color: var(--text); }
.nav-tab.active { background: var(--accent); color: white; }

.main { padding: 24px; max-width: 1200px; margin: 0 auto; }

.view { display: none; }
.view.active { display: block; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon { font-size: 28px; }
.stat-info h3 { font-size: 28px; font-weight: 700; }
.stat-info p { font-size: 13px; color: var(--text2); }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title { font-size: 18px; font-weight: 600; }

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #5558e3; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg3); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: 0.3s;
}

.card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }

.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.card-icon { font-size: 40px; }
.card-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-active { background: rgba(34,197,94,0.2); color: var(--success); }
.badge-inactive { background: rgba(239,68,68,0.2); color: var(--danger); }

.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { font-size: 13px; color: var(--text2); line-height: 1.5; margin-bottom: 16px; }

.card-actions { display: flex; gap: 8px; }

.table-container { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg2);
    border-radius: 12px;
    overflow: hidden;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg3);
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
    text-transform: uppercase;
}

td { font-size: 14px; }

tr:hover td { background: var(--bg3); }

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active { display: flex; }

.modal-content {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 18px; }
.modal-close { background: none; border: none; color: var(--text2); font-size: 24px; cursor: pointer; }

.modal-body { padding: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text2); margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

.chart-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.chart-box h3 { font-size: 16px; margin-bottom: 20px; }

.bar-chart { display: flex; align-items: flex-end; gap: 20px; height: 150px; padding-top: 20px; }
.bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bar { width: 100%; max-width: 60px; border-radius: 6px 6px 0 0; transition: 0.3s; }
.bar-label { font-size: 12px; color: var(--text2); }

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .nav-tabs { display: none; }
    .header { cursor: default; }
}