:root {
    --primary-color: #2563EB;
    --primary-hover: #1D4ED8;
    --secondary-color: #475569;
    --success-color: #16A34A;
    --danger-color: #DC2626;
    --warning-color: #D97706;
    --info-color: #0284C7;
    --bg-color: #F1F5F9;
    --sidebar-bg: #1E293B;
    --sidebar-color: #CBD5E1;
    --sidebar-hover: #334155;
    --sidebar-active: #0F172A;
    --sidebar-active-border: #3B82F6;
    --card-bg: #FFFFFF;
    --text-color: #334155;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --header-height: 60px;
    --sidebar-width: 260px;
    --font-family: 'Inter', sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: #0F172A;
}

/* Layout */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-wrapper.sidebar-collapsed {
    margin-left: 0;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-color);
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    border-radius: 12px;
    font-size: 24px;
    margin-bottom: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.sidebar-brand {
    color: white;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0;
}

.sidebar-subtitle {
    color: #94A3B8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    display: block;
    padding: 0 20px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--sidebar-color);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.nav-link i {
    font-size: 18px;
    margin-right: 12px;
    color: #94A3B8;
    transition: color 0.2s;
}

.nav-link:hover {
    background-color: var(--sidebar-hover);
    color: white;
}

.nav-link:hover i {
    color: white;
}

.nav-link.active {
    background-color: var(--sidebar-active);
    color: white;
    border-left-color: var(--sidebar-active-border);
    font-weight: 500;
}

.nav-link.active i {
    color: var(--sidebar-active-border);
}

/* Topbar */
.topbar {
    height: var(--header-height);
    background-color: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 999;
}

.sidebar-toggle {
    color: var(--text-color);
    padding: 0;
    text-decoration: none;
}

/* Content Area */
.content-area {
    padding: 24px;
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Stats Card */
.stat-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    height: 100%;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-right: 16px;
}

.stat-card-primary .stat-icon { background-color: #EFF6FF; color: var(--primary-color); }
.stat-card-success .stat-icon { background-color: #F0FDF4; color: var(--success-color); }
.stat-card-warning .stat-icon { background-color: #FFFBEB; color: var(--warning-color); }
.stat-card-danger .stat-icon { background-color: #FEF2F2; color: var(--danger-color); }
.stat-card-info .stat-icon { background-color: #F0F9FF; color: var(--info-color); }

.stat-info {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom-width: 1px;
    padding: 12px 16px;
}

.table td {
    padding: 12px 16px;
    vertical-align: middle;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.btn-primary { background-color: var(--primary-color); border-color: var(--primary-color); }
.btn-primary:hover { background-color: var(--primary-hover); border-color: var(--primary-hover); }

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border-color: #CBD5E1;
    padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.1);
}

.form-label {
    font-weight: 500;
    color: #334155;
    margin-bottom: 6px;
}

/* Badges */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 500;
    border-radius: 6px;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
    padding: 20px;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.login-brand {
    font-size: 24px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 5px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-muted);
}

/* Flash Messages */
.flash-container {
    margin-bottom: 24px;
}

/* Utilities */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info { color: var(--info-color) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }
}
