* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00d4ff;
    --primary-dark: #00a8cc;
    --secondary: #667eea;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1a1d29;
    --darker: #13161f;
    --sidebar: #1e2130;
    --card-bg: #252836;
    --text-light: #e5e7eb;
    --text-muted: #9ca3af;
    --border: #2d3142;
    --hover: #2d3142;
}

/* ========== BODY & LAYOUT ========== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark);
    color: var(--text-light);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 260px;
    background: var(--sidebar);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    overflow-y: auto;
    border-right: 1px solid var(--border);
}

.sidebar-header {
    padding: 20px 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
    font-size: 1.5em;
    color: var(--primary);
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 0.85em;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section-title {
    font-size: 0.75em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 10px;
    padding: 0 10px;
    letter-spacing: 1px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav a {
    color: var(--text-light);
    text-decoration: none;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
    border-radius: 8px;
    font-size: 0.95em;
}

.nav a:hover {
    background: var(--hover);
    color: var(--primary);
}

.nav a.active {
    background: var(--primary);
    color: var(--dark);
    font-weight: 600;
}

.nav a::before {
    content: '';
    width: 20px;
    height: 20px;
    display: inline-block;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--dark);
}

.user-info {
    flex: 1;
}

.user-info .name {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text-light);
}

.user-info .role {
    font-size: 0.8em;
    color: var(--text-muted);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    margin-left: 260px;
    background: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== HEADER ========== */
.header {
    background: var(--darker);
    padding: 20px 40px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left h2 {
    color: var(--text-light);
    font-size: 1.8em;
    margin-bottom: 5px;
}

.header-breadcrumb {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.85em;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-item {
    background: var(--card-bg);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.9em;
    color: var(--text-light);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
}

.filter-item:hover {
    border-color: var(--primary);
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* ========== CONTENT AREA ========== */
.content {
    padding: 0;
    flex: 1;
}

/* ========== CARDS ========== */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    color: var(--text-light);
    font-size: 1.2em;
    font-weight: 600;
}

/* ========== STATISTICS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.stat-title {
    font-size: 0.85em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    font-size: 1.5em;
    opacity: 0.3;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 10px;
}

.stat-chart {
    height: 50px;
    margin-top: 10px;
    position: relative;
}

.mini-chart {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, var(--primary), transparent);
    border-radius: 2px;
    opacity: 0.6;
    transition: all 0.3s;
}

.stat-card:hover .chart-bar {
    opacity: 1;
}

/* ========== CHART CONTAINER ========== */
.chart-container {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 25px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-light);
}

.chart-subtitle {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 5px;
}

.chart-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: var(--text-muted);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: var(--dark);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--hover);
    border-color: var(--primary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85em;
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9em;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95em;
    background: var(--darker);
    color: var(--text-light);
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card-bg);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
}

/* ========== TABLES ========== */
.table-responsive {
    overflow-x: auto;
    margin-top: 15px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table thead {
    background: transparent;
}

table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75em;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

table td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-light);
    font-size: 0.9em;
}

table tbody tr {
    transition: all 0.3s;
}

table tbody tr:hover {
    background: var(--hover);
}

/* ========== BADGES ========== */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ========== ALERTS ========== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    border-left: 3px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: #10b981;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content {
        padding: 20px;
    }
    
    .header {
        padding: 15px 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--darker);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}