/* ============================================
   PSD Portal - Complete Style System
   Version: 4.0 - ZOOM RESPONSIVE
   يتفاعل تلقائياً مع Zoom (50% → 200%)
   يتكيف مع أي حجم شاشة + تصغير/تكبير
   ============================================ */

/* ============= ROOT VARIABLES - ZOOM RESPONSIVE ============= */
:root {
    /* Primary Colors */
    --primary-blue: #2563eb;
    --primary-blue-hover: #1d4ed8;
    --primary-blue-light: #dbeafe;
    
    /* Secondary Colors */
    --secondary-green: #10b981;
    --secondary-green-hover: #059669;
    --secondary-green-light: #d1fae5;
    
    --secondary-red: #ef4444;
    --secondary-red-hover: #dc2626;
    --secondary-red-light: #fee2e2;
    
    --secondary-orange: #f59e0b;
    --secondary-orange-hover: #d97706;
    --secondary-orange-light: #fef3c7;
    
    --secondary-purple: #8b5cf6;
    --secondary-purple-hover: #7c3aed;
    --secondary-purple-light: #ede9fe;
    
    --secondary-cyan: #06b6d4;
    --secondary-cyan-hover: #0891b2;
    --secondary-cyan-light: #cffafe;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Shadows - Zoom Responsive */
    --shadow-sm: 0 0.0625rem 0.125rem 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 0.25rem 0.375rem -0.0625rem rgba(0, 0, 0, 0.1), 0 0.125rem 0.25rem -0.0625rem rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 0.625rem 0.9375rem -0.1875rem rgba(0, 0, 0, 0.1), 0 0.25rem 0.375rem -0.125rem rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 1.25rem 1.5625rem -0.3125rem rgba(0, 0, 0, 0.1), 0 0.625rem 0.625rem -0.3125rem rgba(0, 0, 0, 0.04);
    
    /* Spacing - Fluid & Zoom Responsive */
    --spacing-xs: clamp(0.125rem, 0.25vw, 0.25rem);
    --spacing-sm: clamp(0.25rem, 0.5vw, 0.5rem);
    --spacing-md: clamp(0.5rem, 1vw, 1rem);
    --spacing-lg: clamp(0.75rem, 1.5vw, 1.5rem);
    --spacing-xl: clamp(1rem, 2vw, 2rem);
    --spacing-2xl: clamp(1.5rem, 3vw, 3rem);
    
    /* Border Radius - Fluid */
    --radius-sm: clamp(0.125rem, 0.25vw, 0.25rem);
    --radius-md: clamp(0.25rem, 0.5vw, 0.5rem);
    --radius-lg: clamp(0.375rem, 0.75vw, 0.75rem);
    --radius-xl: clamp(0.5rem, 1vw, 1rem);
    --radius-2xl: clamp(0.75rem, 1.5vw, 1.5rem);
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Z-Index Layers - Unified Hierarchy */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-sidebar-desktop: 300;
    --z-modal-backdrop: 900;
    --z-modal: 1000;
    --z-sidebar-mobile: 1050;
    --z-mobile-menu: 1100;
    --z-notification: 1200;
    
    /* Component Sizes - Unified */
    --input-height: 48px;
    --button-height: 48px;
    --mobile-menu-size: 50px;
    
    /* Sidebar width - Fluid & Zoom Responsive */
    --sidebar-width: clamp(200px, 18vw, 280px);
}

/* ============= GLOBAL RESET ============= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Zoom detection: يتعرف تلقائياً على Zoom level */
    font-size: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    /* Fluid Typography: يتكيف مع Zoom (50% → 200%) + Screen Size */
    font-size: clamp(0.75rem, 0.7rem + 0.5vw, 1.25rem);
    line-height: clamp(1.4, 1.5, 1.7);
    color: var(--gray-900);
    background-color: var(--gray-50);
    min-height: 100vh;
    max-height: 100vh;
    /* ⚠️ CRITICAL: منع scroll على body - فقط main-content يسكرول */
    overflow: hidden !important;
    /* منع أي محتوى من الخروج - يعمل مع Zoom */
    width: 100%;
    max-width: 100vw;
}

/* Mobile viewport fix - استخدام dynamic viewport height للموبايل */
@supports (height: 100dvh) {
    @media (max-width: 768px) {
        body {
            min-height: 100dvh;
            max-height: 100dvh;
        }
    }
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-base);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    transition: all var(--transition-base);
}

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

ul, ol {
    list-style: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ============= LAYOUT STRUCTURE ============= */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    max-height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* ============= SIDEBAR - PROFESSIONAL WORLD-CLASS DESIGN ============= */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: white;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: var(--z-sidebar-desktop);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    /* منع أي scroll على الـ sidebar نفسه - ثابت تماماً */
    overflow: hidden !important;
    will-change: transform;
}

/* Sidebar Header */
.sidebar-header {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.sidebar-logo-icon {
    background: rgba(255,255,255,0.2);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.sidebar-logo-text h2 {
    font-size: 1.4rem;
    margin-bottom: 0.2rem;
    font-weight: 700;
}

.sidebar-logo-text p {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Sidebar Navigation - مع scroll داخلي */
.sidebar-nav {
    padding: 0.5rem 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align menu items to the left */
}

.sidebar-nav ul {
    width: 100%;
}

.sidebar-nav-item {
    margin: 0;
    width: 100%;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 0.65rem 1.25rem;
    color: rgba(255,255,255,0.8);
    transition: all var(--transition-base);
    white-space: nowrap;
    width: 100%;
    justify-content: flex-start; /* Ensure content starts from the left */
}

/* Logout Link - Red Style & Centered */
.sidebar-nav-link.logout-link {
    color: rgba(255, 255, 255, 0.9) !important;
    justify-content: center !important; /* Center logout button */
    margin-top: 0.5rem;
    border-radius: var(--radius-md);
    width: calc(100% - 2.5rem);
    margin-left: 1.25rem;
    margin-right: 1.25rem;
    background: var(--secondary-red);
}

.sidebar-nav-link.logout-link:hover {
    background: var(--secondary-red-hover) !important;
    color: white !important;
}

.sidebar-nav-link.logout-link .sidebar-nav-icon {
    color: white;
}

/* Sidebar Footer - No Scroll */
.sidebar-footer {
    padding: 0.7rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    margin-top: auto;
    overflow: hidden;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

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

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.8rem;
    opacity: 0.7;
    text-transform: capitalize;
}

/* ============= MAIN CONTENT - SCROLLABLE AREA ============= */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    padding-bottom: clamp(2rem, 4vw, 3rem);
    background: var(--gray-50);
    /* ⚠️ CRITICAL: main-content هو المنطقة الوحيدة اللي تسكرول */
    height: 100vh;
    max-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box;
    position: relative;
}

/* Page Header */
.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
    padding: clamp(1.25rem, 2.5vw, 1.75rem);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
}

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

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: 0.5rem;
}

.page-title i {
    color: var(--primary-blue);
    font-size: 1.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--gray-500);
    margin: 0;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.page-breadcrumb-separator {
    color: var(--gray-400);
}

/* ============= BUTTONS ============= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-base);
    cursor: pointer;
    white-space: nowrap;
    border: 2px solid transparent;
}

.btn-primary {
    background: #1e293b;
    color: white;
}

.btn-primary:hover {
    background: #0f172a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-danger {
    background: var(--secondary-red);
    color: white;
}

.btn-danger:hover {
    background: var(--secondary-red-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--secondary-green);
    color: white;
}

.btn-success:hover {
    background: var(--secondary-green-hover);
}

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

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

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

/* ============= RESPONSIVE DESIGN - MOBILE & TABLET ============= */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px !important;
        max-width: 85vw !important;
        position: fixed !important;
        left: 0 !important;
        z-index: var(--z-sidebar-mobile) !important;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding-top: 5rem !important;
    }

    .sidebar-toggle-btn {
        display: flex !important;
    }
}

/* Sidebar Backdrop for Mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1040;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.sidebar-backdrop.active {
    display: block;
}

/* Sidebar toggle button (Fixed top-left on mobile) */
.sidebar-toggle-btn {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1100;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.1);
}
/* ============================================
   PSD Portal - Complete Style System
   Version: 4.0 - ZOOM RESPONSIVE
   يتفاعل تلقائياً مع Zoom (50% → 200%)
   يتكيف مع أي حجم شاشة + تصغير/تكبير
   ============================================ */

/* ============= ROOT VARIABLES - ZOOM RESPONSIVE ============= */
:root {
    /* Primary Colors */
    --primary-blue: #2563eb;
    --primary-blue-hover: #1d4ed8;
    --primary-blue-light: #dbeafe;
    
    /* Secondary Colors */
    --secondary-green: #10b981;
    --secondary-green-hover: #059669;
    --secondary-green-light: #d1fae5;
    
    --secondary-red: #ef4444;
    --secondary-red-hover: #dc2626;
    --secondary-red-light: #fee2e2;
    
    --secondary-orange: #f59e0b;
    --secondary-orange-hover: #d97706;
    --secondary-orange-light: #fef3c7;
    
    --secondary-purple: #8b5cf6;
    --secondary-purple-hover: #7c3aed;
    --secondary-purple-light: #ede9fe;
    
    --secondary-cyan: #06b6d4;
    --secondary-cyan-hover: #0891b2;
    --secondary-cyan-light: #cffafe;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Shadows - Zoom Responsive */
    --shadow-sm: 0 0.0625rem 0.125rem 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 0.25rem 0.375rem -0.0625rem rgba(0, 0, 0, 0.1), 0 0.125rem 0.25rem -0.0625rem rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 0.625rem 0.9375rem -0.1875rem rgba(0, 0, 0, 0.1), 0 0.25rem 0.375rem -0.125rem rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 1.25rem 1.5625rem -0.3125rem rgba(0, 0, 0, 0.1), 0 0.625rem 0.625rem -0.3125rem rgba(0, 0, 0, 0.04);
    
    /* Spacing - Fluid & Zoom Responsive */
    --spacing-xs: clamp(0.125rem, 0.25vw, 0.25rem);
    --spacing-sm: clamp(0.25rem, 0.5vw, 0.5rem);
    --spacing-md: clamp(0.5rem, 1vw, 1rem);
    --spacing-lg: clamp(0.75rem, 1.5vw, 1.5rem);
    --spacing-xl: clamp(1rem, 2vw, 2rem);
    --spacing-2xl: clamp(1.5rem, 3vw, 3rem);
    
    /* Border Radius - Fluid */
    --radius-sm: clamp(0.125rem, 0.25vw, 0.25rem);
    --radius-md: clamp(0.25rem, 0.5vw, 0.5rem);
    --radius-lg: clamp(0.375rem, 0.75vw, 0.75rem);
    --radius-xl: clamp(0.5rem, 1vw, 1rem);
    --radius-2xl: clamp(0.75rem, 1.5vw, 1.5rem);
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Z-Index Layers - Unified Hierarchy */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-sidebar-desktop: 300;
    --z-modal-backdrop: 900;
    --z-modal: 1000;
    --z-sidebar-mobile: 1050;
    --z-mobile-menu: 1100;
    --z-notification: 1200;
    
    /* Component Sizes - Unified */
    --input-height: 48px;
    --button-height: 48px;
    --mobile-menu-size: 50px;
    
    /* Sidebar width - Fluid & Zoom Responsive */
    --sidebar-width: clamp(200px, 18vw, 280px);
}

/* ============= GLOBAL RESET ============= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Zoom detection: يتعرف تلقائياً على Zoom level */
    font-size: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    /* Fluid Typography: يتكيف مع Zoom (50% → 200%) + Screen Size */
    font-size: clamp(0.75rem, 0.7rem + 0.5vw, 1.25rem);
    line-height: clamp(1.4, 1.5, 1.7);
    color: var(--gray-900);
    background-color: var(--gray-50);
    min-height: 100vh;
    max-height: 100vh;
    /* ⚠️ CRITICAL: منع scroll على body - فقط main-content يسكرول */
    overflow: hidden !important;
    /* منع أي محتوى من الخروج - يعمل مع Zoom */
    width: 100%;
    max-width: 100vw;
}

/* Mobile viewport fix - استخدام dynamic viewport height للموبايل */
@supports (height: 100dvh) {
    @media (max-width: 768px) {
        body {
            min-height: 100dvh;
            max-height: 100dvh;
        }
    }
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-base);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    transition: all var(--transition-base);
}

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

ul, ol {
    list-style: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ============= LAYOUT STRUCTURE ============= */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    max-height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* ============= SIDEBAR - PROFESSIONAL WORLD-CLASS DESIGN ============= */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: white;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: var(--z-sidebar-desktop);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    /* منع أي scroll على الـ sidebar نفسه - ثابت تماماً */
    overflow: hidden !important;
    will-change: transform;
}

/* Sidebar Header */
.sidebar-header {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.sidebar-logo-icon {
    background: rgba(255,255,255,0.2);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.sidebar-logo-text h2 {
    font-size: 1.4rem;
    margin-bottom: 0.2rem;
    font-weight: 700;
}

.sidebar-logo-text p {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Sidebar Navigation - مع scroll داخلي */
.sidebar-nav {
    padding: 0.5rem 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align menu items to the left */
}

.sidebar-nav ul {
    width: 100%;
}

.sidebar-nav-item {
    margin: 0;
    width: 100%;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 0.65rem 1.25rem;
    color: rgba(255,255,255,0.8);
    transition: all var(--transition-base);
    white-space: nowrap;
    width: 100%;
    justify-content: flex-start; /* Ensure content starts from the left */
}

/* Logout Link - Red Style & Centered */
.sidebar-nav-link.logout-link {
    color: rgba(255, 255, 255, 0.9) !important;
    justify-content: center !important; /* Center logout button */
    margin-top: 0.5rem;
    border-radius: var(--radius-md);
    width: calc(100% - 2.5rem);
    margin-left: 1.25rem;
    margin-right: 1.25rem;
    background: var(--secondary-red);
}

.sidebar-nav-link.logout-link:hover {
    background: var(--secondary-red-hover) !important;
    color: white !important;
}

.sidebar-nav-link.logout-link .sidebar-nav-icon {
    color: white;
}

/* Sidebar Footer - No Scroll */
.sidebar-footer {
    padding: 0.7rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    margin-top: auto;
    overflow: hidden;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

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

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.8rem;
    opacity: 0.7;
    text-transform: capitalize;
}

/* ============= MAIN CONTENT - SCROLLABLE AREA ============= */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    padding-bottom: clamp(2rem, 4vw, 3rem);
    background: var(--gray-50);
    /* ⚠️ CRITICAL: main-content هو المنطقة الوحيدة اللي تسكرول */
    height: 100vh;
    max-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box;
    position: relative;
}

/* Page Header */
.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
    padding: clamp(1.25rem, 2.5vw, 1.75rem);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
}

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

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: 0.5rem;
}

.page-title i {
    color: var(--primary-blue);
    font-size: 1.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--gray-500);
    margin: 0;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.page-breadcrumb-separator {
    color: var(--gray-400);
}

/* ============= BUTTONS ============= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-base);
    cursor: pointer;
    white-space: nowrap;
    border: 2px solid transparent;
}

.btn-primary {
    background: #1e293b;
    color: white;
}

.btn-primary:hover {
    background: #0f172a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-danger {
    background: var(--secondary-red);
    color: white;
}

.btn-danger:hover {
    background: var(--secondary-red-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--secondary-green);
    color: white;
}

.btn-success:hover {
    background: var(--secondary-green-hover);
}

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

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

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

/* ============= FORM ELEMENTS ============= */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-700);
}

/* ============= UNIFIED 48PX HEIGHT FOR ALL INPUTS ============= */
.form-input,
.form-select,
.form-control,
select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="search"] {
    height: var(--input-height) !important;
    min-height: var(--input-height) !important;
    max-height: var(--input-height) !important;
    line-height: normal !important;
    padding: 0 1rem !important;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: white;
    font-size: 1rem;
    width: 100%;
    outline: none;
    transition: all var(--transition-base);
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

/* Textarea Exception - Auto Height */
textarea,
textarea.form-input,
textarea.form-textarea,
.form-textarea {
    height: auto !important;
    min-height: 120px !important;
    max-height: 300px !important;
    line-height: 1.6 !important;
    padding: 0.75rem 1rem !important;
    resize: vertical;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: white;
    font-size: 1rem;
    width: 100%;
    outline: none;
    transition: all var(--transition-base);
}

/* Select Dropdowns - 48px with Proper Alignment */
select,
select.form-select,
select.form-input {
    height: var(--input-height) !important;
    line-height: var(--input-height) !important;
    padding: 0 2.5rem 0 1rem !important;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
}

/* Focus States */
.form-input:focus,
.form-select:focus,
select:focus,
input:focus,
textarea:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Disabled States */
.form-input:disabled,
select:disabled,
input:disabled,
textarea:disabled {
    background-color: var(--gray-100);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

/* ============= CARDS ============= */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-body {
    padding: var(--spacing-md);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    /* auto-fit: يتكيف تلقائياً مع حجم الشاشة */
    /* minmax: حد أدنى 220px، حد أقصى يملأ المساحة */
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    /* Gap متجاوب: يزيد/يقل حسب الشاشة */
    gap: clamp(1rem, 2vw, 2rem);
    margin-bottom: clamp(1.5rem, 3vw, 3rem);
}

.stat-card {
    background: white;
    border-radius: var(--radius-xl);
    /* Padding متجاوب */
    padding: clamp(1rem, 2vw, 2rem);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    /* منع الخروج من القالب */
    contain: layout style;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-blue);
    transition: all var(--transition-base);
}

.stat-card.blue::before { background: var(--primary-blue); }
.stat-card.green::before { background: var(--secondary-green); }
.stat-card.red::before { background: var(--secondary-red); }
.stat-card.orange::before { background: var(--secondary-orange); }
.stat-card.purple::before { background: var(--secondary-purple); }

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

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.stat-card-icon {
    font-size: 2rem;
    opacity: 0.3;
}

.stat-card.blue .stat-card-icon { color: var(--primary-blue); }
.stat-card.green .stat-card-icon { color: var(--secondary-green); }
.stat-card.red .stat-card-icon { color: var(--secondary-red); }
.stat-card.orange .stat-card-icon { color: var(--secondary-orange); }
.stat-card.purple .stat-card-icon { color: var(--secondary-purple); }

.stat-card-body {
    margin-bottom: var(--spacing-md);
}

.stat-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.stat-card-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-card-progress {
    margin-top: var(--spacing-md);
}

.stat-progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.stat-progress-fill {
    height: 100%;
    background: var(--primary-blue);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.stat-card.green .stat-progress-fill { background: var(--secondary-green); }
.stat-card.red .stat-progress-fill { background: var(--secondary-red); }

/* ============= TABLES - FIXED ============= */
.table-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    /* Scroll أفقي للجداول العريضة - يحافظ على القالب */
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-bottom: var(--spacing-xl);
    /* منع الخروج عن القالب */
    contain: layout;
}

.table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-md);
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-md);
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

.table {
    width: 100%;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    table-layout: auto;
}

.table th {
    background: #f8fafc;
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    color: var(--gray-900);
    font-size: 0.95rem;
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow-x: auto;
    margin-bottom: var(--spacing-xl);
}

.action-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ============= REPORT TABLE - FLUID RESPONSIVE ============= */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    margin-bottom: var(--spacing-xl);
    /* منع الخروج من القالب */
    contain: layout;
}

.report-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.report-table thead {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
}

.report-table th {
    /* Padding متجاوب */
    padding: clamp(0.75rem, 1vw, 1.25rem);
    text-align: left;
    font-weight: 600;
    font-size: clamp(0.75rem, 0.9vw, 0.95rem);
    border-bottom: 2px solid #475569;
    white-space: nowrap;
}

.report-table td {
    /* Padding متجاوب */
    padding: clamp(0.6rem, 0.9vw, 1rem);
    border-bottom: 1px solid #e2e8f0;
    color: var(--gray-900);
    font-size: clamp(0.8rem, 0.85vw, 0.95rem);
    vertical-align: middle;
    /* منع كسر النصوص الطويلة */
    word-wrap: break-word;
    max-width: 100%;
}

.report-table tbody tr {
    transition: background-color var(--transition-base);
}

.report-table tbody tr:hover {
    background-color: #f8fafc;
}

.report-table tbody tr:last-child td {
    border-bottom: none;
}

/* Progress Bar داخل الجدول - متجاوب تلقائياً */
.report-table .progress-bar-container {
    background: #e5e7eb;
    border-radius: 4px;
    height: clamp(20px, 1.5vw, 24px);
    width: 100%;
    overflow: hidden;
    position: relative;
}

.report-table .progress-bar-fill {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 clamp(4px, 0.5vw, 8px);
    color: white;
    font-size: clamp(0.65rem, 0.7vw, 0.75rem);
    font-weight: 600;
    white-space: nowrap;
    transition: width 0.3s ease;
}

/* ============= BADGES ============= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: var(--secondary-green-light);
    color: var(--secondary-green);
}

.badge-warning {
    background: var(--secondary-orange-light);
    color: var(--secondary-orange);
}

.badge-danger {
    background: var(--secondary-red-light);
    color: var(--secondary-red);
}

.badge-info {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
}

.badge-purple {
    background: var(--secondary-purple-light);
    color: var(--secondary-purple);
}

/* ============= MODALS ============= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: all var(--transition-base);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    color: var(--gray-500);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-base);
}

.modal-close:hover {
    color: var(--gray-900);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
}

/* ============= PAGINATION ============= */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    color: var(--gray-700);
    font-weight: 600;
    transition: all var(--transition-base);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: var(--primary-blue-light);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* ============= EMPTY STATE ============= */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
    text-align: center;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    color: var(--gray-300);
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.empty-state-text {
    font-size: 1rem;
    margin: 0;
}

/* ============= UNIFIED FILTER BAR ============= */
.unified-filter-bar {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: var(--spacing-xl);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
}

.unified-filter-title {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: 1.25rem;
    color: var(--gray-800);
}

.unified-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.unified-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    padding-top: 0.5rem;
}

/* ============= CONTENT SECTION ============= */
.content-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: clamp(1.25rem, 2.5vw, 2rem);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--gray-200);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--gray-900);
}

/* ============= HAMBURGER MENU (MOBILE) - COMPLETELY FIXED ============= */
.hamburger-menu {
    position: fixed !important;
    top: 1rem !important;
    left: 1rem !important; /* Moved to Left */
    z-index: 1100 !important;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.hamburger-menu span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all var(--transition-base);
}

.hamburger-menu:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.hamburger-menu:active {
    transform: scale(0.95);
}

/* Hamburger Animation when Active */
.hamburger-menu.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Sidebar Overlay - FIXED */
.mobile-sidebar-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1049 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mobile-sidebar-overlay.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Mobile Sidebar Close Button (X) */
.mobile-sidebar-close {
    display: none !important;
    position: absolute;
    top: 1rem;
    left: 1rem; /* Moved to Left */
    width: 40px;
    height: 40px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    transition: all var(--transition-base);
    align-items: center;
    justify-content: center;
}

.mobile-sidebar-close:hover {
    background: #dc2626;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .mobile-sidebar-close {
        display: flex;
    }
}

/* ============= ANIMATIONS ============= */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

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

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

/* ============= ALERTS ============= */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-weight: 500;
}

.alert-success {
    background: var(--secondary-green-light);
    color: var(--secondary-green);
    border-left: 4px solid var(--secondary-green);
}

.alert-danger {
    background: var(--secondary-red-light);
    color: var(--secondary-red);
    border-left: 4px solid var(--secondary-red);
}

.alert-warning {
    background: var(--secondary-orange-light);
    color: var(--secondary-orange);
    border-left: 4px solid var(--secondary-orange);
}

.alert-info {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
    border-left: 4px solid var(--primary-blue);
}

/* ============= MOBILE MENU BUTTON - COMPLETELY FIXED ============= */
.mobile-menu-btn {
    position: fixed !important;
    top: 1rem !important;
    left: 1rem !important; /* Moved to Left */
    width: var(--mobile-menu-size);
    height: var(--mobile-menu-size);
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: var(--z-mobile-menu) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: scale(1.05);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.mobile-menu-btn i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-btn.active i {
    transform: rotate(90deg);
}

/* ============= RESPONSIVE DESIGN - TABLET ============= */
/* Tablet and iPad - Show Hamburger Menu */
@media (max-width: 1200px) {
    .hamburger-menu {
        display: flex;
    }
    
    .mobile-sidebar-overlay {
        display: block;
    }
    
    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh;
        width: 100%;
        max-width: 320px;
        z-index: var(--z-sidebar-mobile) !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
        box-shadow: none;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0) !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    .mobile-sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
        z-index: var(--z-modal-backdrop);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        padding: var(--spacing-lg);
        padding-top: calc(70px + var(--spacing-lg));
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: var(--spacing-lg);
    }
    
    .table-wrapper {
        margin: 0 -var(--spacing-lg);
        border-radius: 0;
    }
}

/* ============= RESPONSIVE DESIGN - MOBILE ============= */
@media (max-width: 768px) {
    /* Show Hamburger Menu */
    .hamburger-menu {
        display: flex !important;
    }
    
    /* Hide Sidebar by Default */
    .sidebar {
        position: fixed !important;
        transform: translateX(-100%) !important;
        z-index: var(--z-sidebar-mobile) !important;
        width: 100%;
        max-width: 100%;
        height: 100dvh !important;
        height: 100vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Show Sidebar when Mobile Open */
    .sidebar.mobile-open {
        transform: translateX(0) !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    /* Sidebar Header - أكبر على الموبايل */
    .sidebar-header {
        padding: 1.5rem 1.5rem;
        flex-shrink: 0;
    }
    
    .sidebar-logo {
        justify-content: center;
    }
    
    .sidebar-logo-icon {
        width: 54px;
        height: 54px;
        font-size: 1.6rem;
    }
    
    .sidebar-logo-text h2 {
        font-size: 1.6rem;
    }
    
    .sidebar-logo-text p {
        font-size: 0.95rem;
    }
    
    /* Sidebar Navigation - محتوى أكبر ومتمركز */
    .sidebar-nav {
        padding: 1rem 0;
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow-y: visible;
        overflow-x: hidden;
    }
    
    .sidebar-nav-link {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        justify-content: center;
        gap: 1rem;
    }
    
    .sidebar-nav-icon {
        font-size: 1.3rem;
        width: 26px;
    }
    
    .sidebar-nav-text {
        font-size: 1.1rem;
        font-weight: 500;
    }
    
    /* Sidebar Footer - أكبر وفي النص */
    .sidebar-footer {
        padding: 1.5rem 1.5rem;
        flex-shrink: 0;
    }
    
    .sidebar-user {
        justify-content: center;
        margin-bottom: 1rem;
        gap: 1rem;
    }
    
    .sidebar-user-avatar {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
    
    .sidebar-user-name {
        font-size: 1.1rem;
    }
    
    .sidebar-user-role {
        font-size: 0.95rem;
    }
    
    .sidebar-footer .sidebar-nav-link {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        justify-content: center;
        gap: 1rem;
    }
    
    .logout-link {
        margin-top: 0.5rem;
    }
    
    .logout-link i {
        font-size: 1.3rem;
    }
    
    /* Main Content - Full Width on Mobile */
    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        height: 100dvh;
        height: 100vh;
        padding: var(--spacing-md);
        padding-top: calc(var(--spacing-md) + 70px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    .page-header {
        padding: var(--spacing-lg);
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .page-title i {
        font-size: 1.25rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card-value {
        font-size: 1.75rem;
    }
    
    .unified-filter-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .table {
        min-width: 900px;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .modal-content {
        width: 95%;
        padding: var(--spacing-lg);
    }
}

/* ============= RESPONSIVE DESIGN - SMALL MOBILE ============= */
@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }
    
    .sidebar-logo-text h2 {
        font-size: 1.25rem;
    }
    
    .sidebar-logo-text p {
        font-size: 0.75rem;
    }
    
    .sidebar-nav-link {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 0.9rem;
    }
    
    .page-title {
        font-size: 1.1rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stat-card {
        padding: var(--spacing-lg);
    }
    
    .stat-card-value {
        font-size: 1.5rem;
    }
}

/* ============= MAP RESPONSIVE STYLES ============= */
#map {
    width: 100% !important;
    height: 600px !important;
    border-radius: 8px;
}

.map-legend-container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
}

#mapLegend {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-width: 220px;
    max-height: 600px;
    overflow-y: auto;
    height: fit-content;
}

/* Mobile and Tablet Map Responsive */
@media (max-width: 992px) {
    #map {
        height: 450px !important;
    }
    
    .map-legend-container {
        grid-template-columns: 1fr;
    }
    
    #mapLegend {
        max-height: none;
        width: 100%;
    }
}

@media (max-width: 768px) {
    #map {
        height: 350px !important;
    }
}

@media (max-width: 480px) {
    #map {
        height: 300px !important;
    }
}

/* ============= PRINT STYLES ============= */
@media print {
    .sidebar,
    .hamburger-menu,
    .mobile-menu-btn,
    .mobile-sidebar-overlay,
    .btn,
    .action-buttons {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .table-wrapper {
        overflow: visible;
        box-shadow: none;
    }
    
    .table {
        min-width: 100%;
    }
}

/* ============= ACCESSIBILITY ============= */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* ============= UTILITY CLASSES ============= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* ============================================
   MAP MARKER BLINK ANIMATIONS
   ============================================ */

/* Red Blink - New Emergency */
@keyframes blink-red {
    0%, 100% { 
        opacity: 1;
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.8), 0 0 20px rgba(239, 68, 68, 0.5);
    }
    50% { 
        opacity: 0.5;
        box-shadow: 0 0 20px rgba(239, 68, 68, 1), 0 0 30px rgba(239, 68, 68, 0.8);
    }
}

/* Yellow Blink - In Progress */
@keyframes blink-yellow {
    0%, 100% { 
        opacity: 1;
        box-shadow: 0 0 10px rgba(245, 158, 11, 0.8), 0 0 20px rgba(245, 158, 11, 0.5);
    }
    50% { 
        opacity: 0.5;
        box-shadow: 0 0 20px rgba(245, 158, 11, 1), 0 0 30px rgba(245, 158, 11, 0.8);
    }
}

/* Green - Completed (No Blink) */
.marker-completed {
    background-color: #10b981 !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

/* Apply blink animations */
.marker-new {
    background-color: #ef4444 !important;
    animation: blink-red 1s infinite;
}

.marker-in-progress {
    background-color: #f59e0b !important;
    animation: blink-yellow 1.2s infinite;
}

/* Leaflet marker custom styles */
.leaflet-marker-icon.emergency-marker-new {
    animation: blink-red 1s infinite !important;
}

.leaflet-marker-icon.emergency-marker-in-progress {
    animation: blink-yellow 1.2s infinite !important;
}

.leaflet-marker-icon.emergency-marker-completed {
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6) !important;
}

/* Pulsing ring effect for active emergencies */
@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Blinking/Pulse Animation for Map Markers */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.marker-pulse::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid currentColor;
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* ============================================
   CUSTOM MAP POPUP STYLES
   ============================================ */

.custom-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.custom-popup .leaflet-popup-content {
    margin: 10px;
}

.custom-popup .leaflet-popup-tip {
    display: none;
}

/* Updated Form Inputs - Government Official Style - UNIFIED 48px HEIGHT */
.form-input,
.form-select,
.form-textarea,
.form-control,
select.form-input,
textarea.form-input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="url"],
select,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
    width: 100%;
    /* Height متجاوب مع Zoom: 44px → 48px → 52px */
    height: clamp(2.75rem, 3vw, 3.25rem) !important;
    /* Padding متجاوب */
    padding: 0 clamp(0.75rem, 1vw, 1rem) !important;
    /* Border متجاوب */
    border: clamp(1px, 0.1vw, 1.5px) solid #d1d5db !important;
    /* Border radius متجاوب */
    border-radius: clamp(0.25rem, 0.5vw, 0.5rem) !important;
    /* Font size متجاوب */
    font-size: clamp(0.8rem, 0.9vw, 0.95rem) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    /* Line height متجاوب */
    line-height: clamp(2.75rem, 3vw, 3.25rem) !important;
    transition: all 0.2s ease !important;
    background-color: #ffffff !important;
    color: #1f2937 !important;
    box-sizing: border-box !important;
}

/* Select dropdowns - Unified 48px height */
select.form-input,
select {
    /* Height متجاوب مع Zoom: 44px → 48px → 52px */
    height: clamp(2.75rem, 3vw, 3.25rem) !important;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right clamp(0.5rem, 0.75vw, 0.75rem) center;
    background-size: clamp(1rem, 1.25vw, 1.25rem);
    padding-right: clamp(2rem, 2.5vw, 2.5rem) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 48px !important;
}

/* Multi-select keeps auto height */
select[multiple] {
    height: auto !important;
    min-height: 150px !important;
    line-height: 1.6 !important;
    padding: 0.5rem !important;
}

/* Textarea keeps auto height */
textarea.form-input,
textarea {
    height: auto !important;
    /* Min-height متجاوب مع Zoom */
    min-height: clamp(6rem, 7.5vw, 7.5rem) !important;
    resize: vertical;
    line-height: 1.6 !important;
    /* Padding متجاوب */
    padding: clamp(0.5rem, 0.75vw, 0.75rem) clamp(0.75rem, 1vw, 1rem) !important;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
select:focus,
textarea:focus,
input:focus {
    outline: none !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.form-input:disabled,
select:disabled,
textarea:disabled {
    background-color: #f3f4f6 !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.01em;
}

.form-group {
    margin-bottom: 1.25rem;
}

/* Buttons - Government Style */
.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* Button height متجاوب مع Zoom */
    min-height: clamp(2.75rem, 3vw, 3.25rem) !important;
    height: clamp(2.75rem, 3vw, 3.25rem) !important;
    /* Padding متجاوب */
    padding: clamp(0.5rem, 0.75vw, 0.75rem) clamp(1rem, 1.5vw, 1.5rem) !important;
    /* Font size متجاوب */
    font-size: clamp(0.8rem, 0.9vw, 0.95rem) !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
    /* Border radius متجاوب */
    border-radius: clamp(0.25rem, 0.5vw, 0.5rem) !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
}

.btn-sm {
    min-height: 36px !important;
    height: 36px !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
}

.btn-lg {
    min-height: 52px !important;
    height: 52px !important;
    padding: 1rem 2rem !important;
    font-size: 1rem !important;
}

/* ============= EMERGENCY PAGE INPUTS OVERRIDE - 48px UNIFIED ============= */
.emergency-input,
.emergency-select {
    height: 48px !important;
    line-height: 48px !important;
}

/* User Management - Multiple Sectors Select */
#responsible_sectors[multiple] {
    height: auto !important;
    min-height: 150px !important;
    line-height: 1.6 !important;
}

/* ENSURE ALL PAGES HAVE SAME INPUT HEIGHT */
.modal .form-input,
.modal .form-select,
.modal select,
.modal input[type="text"],
.modal input[type="email"],
.modal input[type="tel"],
.modal input[type="password"],
.modal input[type="number"] {
    /* Height متجاوب مع Zoom */
    height: clamp(2.75rem, 3vw, 3.25rem) !important;
    line-height: clamp(2.75rem, 3vw, 3.25rem) !important;
}

/* ============= FULLSCREEN MODE - HIDE SIDEBAR ============= */
/* For create/execution pages - better content visibility */

/* Toggle Sidebar Button */
.sidebar-toggle-btn {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 900;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.sidebar-toggle-btn:hover {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.sidebar-toggle-btn i {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

/* Fullscreen Mode Class */
body.fullscreen-mode .sidebar {
    transform: translateX(-100%);
}

body.fullscreen-mode .main-content {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
}

body.fullscreen-mode .sidebar-toggle-btn {
    left: 1rem;
}

body.fullscreen-mode .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

/* Show toggle button on create/execute pages */
.page-with-toggle .sidebar-toggle-btn {
    display: flex;
}

/* Add padding to page header when toggle button is visible */
.page-with-toggle .page-header {
    padding-left: 4rem;
}

/* Smooth transitions */
.sidebar,
.main-content {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile - Keep existing behavior */
@media (max-width: 768px) {
    .sidebar-toggle-btn {
        display: none !important;
    }
    
    body.fullscreen-mode .sidebar {
        transform: translateX(-100%);
    }
    
    body.fullscreen-mode .main-content {
        margin-left: 0;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    body.fullscreen-mode .main-content {
        padding: 1.5rem;
    }
}


/* ============= REPORTS PAGE FIXES ============= */

/* Fix Charts - Prevent them from moving down */
.charts-grid .content-section {
    position: relative;
}

.charts-grid canvas {
    max-height: 300px !important;
    width: 100% !important;
    height: auto !important;
}

/* Wrapper for canvas to maintain aspect ratio */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Fix Table Horizontal Scroll - Enhanced */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 0;
}

.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-md);
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-md);
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Table Styles */
.data-table {
    width: 100%;
    min-width: 900px; /* Ensure minimum width for scroll */
    border-collapse: collapse;
    background: white;
}

.data-table thead {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background-color: #f9fafb;
    transition: background-color 0.2s ease;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Print Styles */
@media print {
    .sidebar,
    .page-header button,
    .filters-form {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .charts-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .table-responsive {
        overflow: visible !important;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr !important;
    }
    
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}

