:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --dark: #0f172a;
    --sidebar-bg: rgba(15, 23, 42, 0.95);
    --sidebar-width: 260px;
    --header-height: 65px;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* { box-sizing: border-box; }

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    background-color: #f8fafc;
    color: #334155;
    overflow-x: hidden;
}

#wrapper {
    display: flex;
    min-height: 100vh;
}

#sidebar-wrapper {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: sticky;
    top: 0;
    right: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

#sidebar-wrapper .list-group-item {
    border: none;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-right: 4px solid transparent;
    margin: 2px 10px;
    border-radius: 8px;
    color: #cbd5e1;
    background: transparent;
}

#sidebar-wrapper .list-group-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateX(-5px);
    color: #fff;
}

#sidebar-wrapper .list-group-item.active-sidebar {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark)) !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.sidebar-group-label small {
    font-size: 12px;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: #94a3b8;
    padding-right: 15px;
}

#page-content-wrapper {
    flex: 1;
    min-width: 0;
}

#top-navbar {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--glass-bg) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    height: var(--header-height);
}

.card {
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

.stat-card {
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(45deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.stat-card .stat-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.85;
}

.btn { 
    border-radius: 8px; 
    font-size: 14px; 
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.2s;
}

.btn:active { transform: scale(0.97); }

.btn-sm { font-size: 12px; }

.table th {
    font-weight: 700;
    font-size: 14px;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    background-color: #f8fafc;
    padding: 12px 16px;
}

.table td {
    font-size: 14px;
    vertical-align: middle;
    padding: 12px 16px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.table-hover tbody tr {
    transition: all 0.2s;
}

.badge { 
    font-size: 12px; 
    padding: 6px 10px; 
    border-radius: 6px;
    font-weight: 600;
}

.form-label { font-size: 14px; font-weight: 600; color: #475569; }

.form-control, .form-select {
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 10px 14px;
    transition: all 0.2s;
}

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

.pagination .page-link {
    font-size: 13px;
    padding: 5px 12px;
    color: var(--primary);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

.modal-header { border-bottom: 1px solid #f0f0f0; }

.modal-footer { border-top: 1px solid #f0f0f0; }

.alert { font-size: 14px; border: none; border-radius: 8px; }

.search-box { position: relative; }

.search-box .form-control {
    padding-right: 35px;
}

.search-box .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

@media (max-width: 992px) {
    #sidebar-wrapper {
        margin-right: calc(-1 * var(--sidebar-width));
        position: fixed;
    }
    #sidebar-wrapper.toggled {
        margin-right: 0;
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
}

.login-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-icon i { color: #fff; }

.action-btns .btn {
    padding: 3px 8px;
    font-size: 12px;
}

@media print {
    #sidebar-wrapper, #top-navbar, .no-print { display: none !important; }
    #page-content-wrapper { margin: 0 !important; padding: 0 !important; }
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #aaa;
}

.empty-state i { font-size: 50px; margin-bottom: 15px; }

.dropdown-menu { font-size: 14px; }

.nav-tabs .nav-link {
    font-size: 13px;
    color: #555;
}

.nav-tabs .nav-link.active {
    font-weight: 600;
    color: var(--primary);
}

.progress { height: 8px; }

.table-hover tbody tr:hover {
    background-color: rgba(26,115,232,0.03);
}
