/* ============================================
   Dashboard Stylesheet - Complete
   مؤسسة محمود الحفناوى للتنمية الخيرية
   ============================================ */

/* ============================================
   1. CSS Variables & Root
   ============================================ */
:root {
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --header-height: 70px;
    
    --primary: #1a5f7a;
    --primary-dark: #134b61;
    --primary-light: #e8f4f8;
    --primary-50: #e8f4f8;
    
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    
    --success: #22c55e;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50px;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.2);
    
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s ease;
    
    --font-primary: 'Cairo', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
}

/* ============================================
   2. Reset & Base
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: var(--gray-50);
    color: var(--gray-800);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   3. Dashboard Layout
   ============================================ */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar - أزرق بتدرج
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--sidebar-width, 280px);
    background: linear-gradient(180deg, #0a1628 0%, #0f1f3a 30%, #132844 60%, #0f1f3a 100%);
    color: #e2e8f0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-base, 0.3s ease);
    overflow-y: auto;
    overflow-x: hidden;
    border-left: 1px solid rgba(59, 130, 246, 0.15);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed, 80px);
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* ============================================
   Sidebar Header
   ============================================ */
.sidebar-header {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    flex-shrink: 0;
    background: rgba(0,0,0,0.15);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.logo-glow {
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    opacity: 0.25;
    filter: blur(12px);
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.4; }
}

.logo-text h3 {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
}

.logo-text span {
    font-size: 10px;
    color: #93c5fd;
    white-space: nowrap;
}

.sidebar-toggle-btn {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.06);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    transform: rotate(180deg);
}

/* ============================================
   Sidebar Search
   ============================================ */
.sidebar-search {
    padding: 12px 16px;
    flex-shrink: 0;
}

.search-box {
    position: relative;
}

.search-box .search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: 10px 36px 10px 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 13px;
    font-family: 'Cairo', sans-serif;
    transition: all 0.2s ease;
}

.search-box input::placeholder {
    color: #64748b;
}

.search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ============================================
   Sidebar Navigation
   ============================================ */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.nav-menu { list-style: none; padding: 0; margin: 0; }
.nav-item { margin: 2px 10px; position: relative; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.12);
}

.nav-link.active {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.2);
    border-right: 3px solid #3b82f6;
    font-weight: 600;
}

.nav-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.nav-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-arrow { font-size: 9px; color: #64748b; transition: transform 0.3s; }
.nav-item.open .dropdown-arrow { transform: rotate(180deg); color: #93c5fd; }

.nav-badge {
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ============================================
   Submenu (Dropdown)
   ============================================ */
.submenu {
    list-style: none;
    padding: 6px 0;
    margin: 2px 8px 4px 8px;
    display: none;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.nav-item.open .submenu {
    display: block;
    animation: submenuIn 0.2s ease;
}

@keyframes submenuIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.submenu-link {
    display: block;
    padding: 9px 16px;
    color: #94a3b8 !important;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 6px;
    margin: 1px 6px;
    white-space: nowrap;
}

.submenu-link:hover {
    color: #ffffff !important;
    background: rgba(59, 130, 246, 0.15);
}

.submenu-link.active {
    color: #ffffff !important;
    background: rgba(59, 130, 246, 0.2);
}

/* ============================================
   Sidebar Footer
   ============================================ */
.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(59, 130, 246, 0.15);
    flex-shrink: 0;
    background: rgba(0,0,0,0.15);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.04);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initials {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.user-status {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 11px;
    height: 11px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #0f1f3a;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 10px;
    color: #93c5fd;
}

.logout-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.sidebar-version {
    text-align: center;
    margin-top: 10px;
    font-size: 9px;
    color: #475569;
}

/* ============================================
   Sidebar Collapsed State
   ============================================ */
.sidebar.collapsed .logo-text,
.sidebar.collapsed .sidebar-search,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .dropdown-arrow,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .user-info,
.sidebar.collapsed .sidebar-version,
.sidebar.collapsed .logout-btn,
.sidebar.collapsed .submenu {
    display: none;
}

.sidebar.collapsed .logo-wrapper { justify-content: center; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 16px; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 12px; }
.sidebar.collapsed .nav-icon { font-size: 20px; width: auto; margin: 0; }
.sidebar.collapsed .user-card { justify-content: center; padding: 10px; }
.sidebar.collapsed .user-avatar { margin: 0; }

/* ============================================
   Mobile
   ============================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(100%);
        position: fixed;
        z-index: 1050;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }
}
/* ============================================
   5. Main Content Area
   ============================================ */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-right var(--transition-base);
    background: var(--gray-50);
}

/* ============================================
   6. Dashboard Header
   ============================================ */
.dashboard-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: var(--header-height);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mobile Sidebar Button */
.mobile-sidebar-btn {
    display: none !important;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--gray-600);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all var(--transition-fast);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

.mobile-sidebar-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
}

/* Sidebar Toggle Button (Desktop) */
.sidebar-toggle {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--gray-600);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all var(--transition-fast);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: var(--gray-100);
    color: var(--primary);
}

/* Header Search */
.header-search {
    position: relative;
    width: 300px;
}

.header-search .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    z-index: 1;
}

.header-search .search-input {
    width: 100%;
    padding: 8px 36px 8px 12px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.header-search .search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

/* Header Icons */
.header-icon {
    position: relative;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.header-icon .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: #fff;
    border-radius: 10px;
    padding: 2px 6px;
    font-weight: 600;
}

/* Avatar */
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-sm {
    width: 30px;
    height: 30px;
}

.avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    border-radius: 50%;
}

/* ============================================
   7. Dropdowns
   ============================================ */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 1050;
    display: none;
    padding: 8px 0;
    animation: dropdownIn 0.2s ease;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu-end {
    right: 0;
    left: auto;
}

.dropdown-header {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 14px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.dropdown-item.text-danger {
    color: var(--danger);
}

.dropdown-item.text-danger:hover {
    background: var(--danger-light);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 6px 0;
}

/* ============================================
   8. Dashboard Content
   ============================================ */
.dashboard-content {
    flex: 1;
    padding: 24px;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-inner {
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   9. Page Header
   ============================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin: 0;
    color: var(--gray-800);
}

.page-subtitle {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin: 4px 0 0;
}

.page-actions {
    display: flex;
    gap: 12px;
}

/* ============================================
   10. Breadcrumb
   ============================================ */
.breadcrumb-nav {
    margin-bottom: 20px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: var(--font-size-sm);
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--gray-500);
}

.breadcrumb-item a {
    color: var(--gray-600);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--primary);
}

.breadcrumb-item.active {
    color: var(--primary);
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    padding: 0 8px;
    color: var(--gray-400);
}

/* ============================================
   11. Alerts
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: var(--font-size-sm);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.alert-success {
    background: var(--success-light);
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: var(--info-light);
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ============================================
   12. Stats Cards
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 2px;
}

.stat-card.primary::before { background: var(--primary); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.info::before { background: var(--info); }

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card.primary .stat-icon { background: var(--primary-50); color: var(--primary); }
.stat-card.success .stat-icon { background: var(--success-light); color: var(--success); }
.stat-card.warning .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-card.danger .stat-icon { background: var(--danger-light); color: var(--danger); }
.stat-card.info .stat-icon { background: var(--info-light); color: var(--info); }

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
    line-height: 1;
}

.stat-card .stat-label {
    color: var(--gray-500);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.stat-card .stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.stat-change.up {
    color: #166534;
    background: #dcfce7;
}

.stat-change.down {
    color: #991b1b;
    background: #fecaca;
}

/* ============================================
   13. Charts
   ============================================ */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.chart-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

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

.chart-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
}

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

.chart-body {
    position: relative;
    min-height: 300px;
}

/* ============================================
   14. Quick Actions
   ============================================ */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.quick-action-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    border: 1px solid var(--gray-200);
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    color: var(--gray-700);
    display: block;
}

.quick-action-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    color: var(--primary);
}

.quick-action-card .action-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-50);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.3rem;
    transition: all var(--transition-fast);
}

.quick-action-card:hover .action-icon {
    background: var(--primary);
    color: #fff;
}

.quick-action-card .action-title {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

/* ============================================
   15. Activity List
   ============================================ */
.activity-list {
    list-style: none;
    padding: 0;
}

.activity-item {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: var(--font-size-sm);
    margin-bottom: 2px;
}

.activity-time {
    font-size: var(--font-size-xs);
    color: var(--gray-400);
}

/* ============================================
   16. Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-300);
    color: var(--gray-600);
}

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

.btn-sm {
    padding: 6px 14px;
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: 14px 28px;
    font-size: var(--font-size-md);
}

/* ============================================
   17. Tables
   ============================================ */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.table th {
    padding: 12px 16px;
    text-align: right;
    font-weight: 600;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* ============================================
   18. Cards
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
    overflow: hidden;
}

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

.card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* ============================================
   19. Forms
   ============================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    background: var(--white);
    cursor: pointer;
}

/* ============================================
   20. Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.badge-primary { background: var(--primary-50); color: var(--primary); }
.badge-success { background: var(--success-light); color: #166534; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-info { background: var(--info-light); color: #1e40af; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ============================================
   21. Footer
   ============================================ */
.dashboard-footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 16px 24px;
    margin-top: auto;
    flex-shrink: 0;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

/* ============================================
   22. Sidebar Overlay (Mobile)
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1035;
}

.sidebar-overlay.show {
    display: block;
}

/* ============================================
   23. Scrollbar Customization
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ============================================
   24. Utilities
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

.mt-0 { margin-top: 0; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.bg-white { background: var(--white); }
.bg-gray { background: var(--gray-50); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

.cursor-pointer { cursor: pointer; }

.d-none { display: none; }

.small { font-size: var(--font-size-xs); }
.fw-bold { font-weight: 700; }

/* ============================================
   25. Responsive
   ============================================ */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .header-search {
        width: 200px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0 !important;
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    .mobile-sidebar-btn {
        display: flex !important;
    }
    
    .header-search {
        width: 150px;
    }
    
    .dashboard-content {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .header-search {
        display: none;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-title {
        font-size: var(--font-size-xl);
    }
    
    .dashboard-header {
        padding: 0 12px;
    }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-right {
        gap: 4px;
    }
    
    .header-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   26. Dark Mode
   ============================================ */
[data-theme="dark"] body {
    background: #0f172a;
    color: #e2e8f0;
}

[data-theme="dark"] .main-content {
    background: #0f172a;
}

[data-theme="dark"] .dashboard-header {
    background: #1e293b;
    border-bottom-color: #334155;
}

[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .chart-container,
[data-theme="dark"] .quick-action-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .card-header {
    border-bottom-color: #334155;
}

[data-theme="dark"] .card-footer {
    background: #1a2234;
    border-top-color: #334155;
}

[data-theme="dark"] .table th {
    background: #1a2234;
    border-bottom-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .table td {
    border-bottom-color: #1e293b;
    color: #cbd5e1;
}

[data-theme="dark"] .table tbody tr:hover {
    background: #1a2234;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .form-control:focus {
    border-color: #8b5cf6;
}

[data-theme="dark"] .dropdown-menu {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .dropdown-item {
    color: #cbd5e1;
}

[data-theme="dark"] .dropdown-item:hover {
    background: #334155;
}

[data-theme="dark"] .dropdown-divider {
    background: #334155;
}

[data-theme="dark"] .dashboard-footer {
    background: #1e293b;
    border-top-color: #334155;
}

[data-theme="dark"] .page-title {
    color: #f1f5f9;
}

[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

/* ============================================
   27. Print Styles
   ============================================ */
@media print {
    .sidebar,
    .dashboard-header,
    .dashboard-footer,
    .sidebar-overlay,
    .mobile-sidebar-btn,
    .sidebar-toggle {
        display: none !important;
    }
    
    .main-content {
        margin-right: 0 !important;
    }
    
    .dashboard-content {
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}