:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --sidebar-width: 260px;
    --bg: #f1f5f9;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: #1e293b;
}

.wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #cbd5e1;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    transition: transform 0.3s;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-header h4 { margin: 0; color: #fff; font-weight: 700; }
.sidebar-header small { color: #64748b; }

.sidebar-nav { padding: 16px 12px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-size: 0.95rem;
}
.sidebar-nav a:hover {
    background: rgba(99,102,241,0.15);
    color: #fff;
}
.sidebar-nav a.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}
.sidebar-nav a i { font-size: 1.1rem; }
.nav-section {
    padding: 20px 16px 8px;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    color: #64748b;
    text-transform: uppercase;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    padding: 12px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.stat-card {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border-radius: 14px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}
.stat-card.green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.stat-card.orange { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.stat-card.pink { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); }
.stat-card .icon {
    position: absolute;
    right: -10px; bottom: -10px;
    font-size: 5rem;
    opacity: 0.15;
}
.stat-card h3 { margin: 0; font-weight: 700; font-size: 2rem; }
.stat-card .label { opacity: 0.85; font-size: 0.9rem; }

.table { margin: 0; }
.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table td { vertical-align: middle; }

.badge { font-weight: 500; padding: 6px 10px; }

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-label { font-weight: 500; color: #475569; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}
.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.2);
}
.login-card h2 { font-weight: 700; color: #1e293b; }

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
}