/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 LEGENDARY CSS FRAMEWORK - Comprehensive & Professional Design System */
/* 🚀 Optimized for Performance - Works with All Pages */
/* ═══════════════════════════════════════════════════════════════════════════ */
/* 
 * Features:
 * - Dynamic Colors from Settings (primary_color, secondary_color)
 * - Dark Mode Support (dark_mode setting)
 * - RTL Only (No LTR Support)
 * - Premium Animations & Transitions
 * - Glass Morphism Effects
 * - Solid Colors Only (No Shadows or Gradients)
 * - Responsive Design
 * - Performance Optimized (Lightweight)
 * - Works with All Pages
 */

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 CSS Variables - Dynamic Theme System (Synced with main.php) */
/* ═══════════════════════════════════════════════════════════════════════════ */
:root {
    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Primary Colors - From Settings (primary_color) */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --primary: var(--theme-primary, #00BCD4);
    --primary-dark: var(--theme-primary-dark, #0097a7);
    --primary-light: var(--theme-primary-light, #b2ebf2);

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Secondary Colors - From Settings (secondary_color) */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --dark-primary: var(--theme-secondary, #1E2A38);
    --dark-secondary: var(--theme-dark-secondary, #2d3a4a);
    --dark-tertiary: var(--theme-dark-tertiary, #4a5568);

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Status Colors */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --success: #10b981;
    --success-light: #d1fae5;
    --success-dark: #059669;

    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #d97706;

    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #dc2626;

    --info: #3b82f6;
    --info-light: #dbeafe;
    --info-dark: #2563eb;

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Background Colors */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --bg-main: #f0f2f5;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-gray: #e5e7eb;

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Text Colors */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --text-primary: #1e2a38;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --text-white: #ffffff;
    --text-muted: #64748b;

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Border Colors */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Shadows - Minimal (No Glow) */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --shadow-sm: none;
    --shadow: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-xl: none;
    --shadow-glow: none;
    --shadow-primary: none;

    /* Dynamic Shadow Colors - Disabled */
    --shadow-primary-sm: none;
    --shadow-primary-md: none;
    --shadow-primary-lg: none;

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Border Radius */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Spacing */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Layout */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --sidebar-width: 260px;
    --header-height: 64px;

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Transitions */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Z-Index Scale */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Card & Container Colors */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --bg-card: var(--bg-white);
    --bg-card-hover: var(--bg-light);
    --bg-card-active: var(--bg-gray);

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Gradients - Removed (Solid Colors Only) */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --gradient-primary: var(--primary);
    --gradient-primary-light: var(--primary);
    --gradient-success: var(--success);
    --gradient-warning: var(--warning);
    --gradient-danger: var(--danger);
    --gradient-info: var(--info);

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Page-Specific Variables - Admissions */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --adm-bg-card: var(--bg-white);
    --adm-border: var(--border-color);
    --adm-border-active: rgba(0, 188, 212, 0.3);
    --adm-shadow: var(--shadow);
    --adm-shadow-hover: var(--shadow-md);
    --adm-radius: var(--radius-md);
    --adm-pill-bg: var(--bg-white);
    --adm-pill-border: var(--border-color);
    --adm-pill-active-bg: rgba(0, 188, 212, 0.06);
    --adm-pill-active-border: rgba(0, 188, 212, 0.55);

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Page-Specific Variables - Student Affairs & Behavior */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --sa-bg-card: var(--bg-white);
    --sa-bg-light: var(--bg-light);
    --sa-text-dark: var(--text-primary);
    --sa-text-light: var(--text-muted);
    --sa-border: var(--border-color);
    --sa-radius: var(--radius-md);
    --sa-radius-lg: var(--radius-lg);
    --sa-shadow-sm: var(--shadow-sm);
    --sa-shadow-md: var(--shadow-md);
    --sa-shadow-lg: var(--shadow-lg);

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Behavior Page Specific - Severity Colors */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --severity-minor-bg: #dbeafe;
    --severity-minor-color: #1e40af;
    --severity-minor-border: #93c5fd;
    --severity-moderate-bg: #fef3c7;
    --severity-moderate-color: #92400e;
    --severity-moderate-border: #fde68a;
    --severity-major-bg: #fed7aa;
    --severity-major-color: #9a3412;
    --severity-major-border: #fdba74;
    --severity-severe-bg: var(--danger-light);
    --severity-severe-color: var(--danger-dark);
    --severity-severe-border: #fca5a5;

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Status Badge Colors - Unified */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --status-open-bg: var(--warning-light);
    --status-open-color: var(--warning-dark);
    --status-open-border: #fbbf24;
    --status-resolved-bg: var(--success-light);
    --status-resolved-color: var(--success-dark);
    --status-resolved-border: #34d399;
    --status-escalated-bg: #fce7f3;
    --status-escalated-color: #be185d;
    --status-escalated-border: #f9a8d4;

    /* ═══════════════════════════════════════════════════════════════════════ */
    /* 🎨 Typography Scale */
    /* ═══════════════════════════════════════════════════════════════════════ */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 0.95rem;
    --font-size-lg: 1.1rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.75rem;
    --font-size-4xl: 2rem;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    --font-weight-black: 900;

    /* ═══════════════════════════════════════════════════════════ */
    /* 🎨 Component-Specific Variables */
    /* ═══════════════════════════════════════════════════════════ */
    --card-padding: var(--spacing-md, 1.5rem);
    --card-padding-sm: var(--spacing, 1rem);
    --card-padding-lg: var(--spacing-lg, 2rem);

    --input-padding: 0.75rem 1rem;
    --input-border-radius: var(--radius, 8px);
    --input-focus-ring: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent);

    --button-padding: 0.75rem 1.5rem;
    --button-padding-sm: 0.5rem 1rem;
    --button-padding-lg: 1rem 2rem;
    --button-border-radius: var(--radius, 8px);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🌙 Dark Mode - Dynamic Theme Support */
/* ═══════════════════════════════════════════════════════════════════════════ */
[data-theme="dark"],
.dark-mode {
    --bg-main: #0f172a;
    --bg-white: #1e293b;
    --bg-light: #1e293b;
    --bg-gray: #334155;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-light: #94a3b8;
    --text-muted: #64748b;

    --border-color: #334155;
    --border-light: #475569;
    --border-dark: #64748b;

    --shadow: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-xl: none;

    color-scheme: dark;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Reset & Base Styles */
/* ═══════════════════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
    direction: rtl;
}

body {
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
    transition: background-color var(--transition), color var(--transition);
    direction: rtl;
}

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

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

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Layout Components */
/* ═══════════════════════════════════════════════════════════════════════════ */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Sidebar - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-primary);
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-fixed);
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition), width var(--transition);
    margin: 0;
    padding: 0;
    box-shadow: none;
    backdrop-filter: blur(10px);
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.sidebar-logo {
    width: 45px;
    height: 45px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    overflow: hidden;
    flex-shrink: 0;
    transition: all var(--transition);
    box-shadow: none;
    position: relative;
}

.sidebar-logo:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: none;
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    padding: 0;
    transition: transform var(--transition);
    border-radius: inherit;
}

.sidebar-brand {
    color: var(--text-white);
    flex: 1;
    min-width: 0;
}

.sidebar-brand h1 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand span {
    font-size: 0.75rem;
    color: var(--text-light);
    display: block;
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Navigation */
/* ═══════════════════════════════════════════════════════════════════════════ */
.sidebar-nav {
    padding: 15px 0;
    scroll-behavior: smooth;
}

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

.nav-section-title {
    padding: 10px 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
    position: relative;
    font-weight: 600;
    letter-spacing: 0.8px;
}

.nav-section-title:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    margin: 0 5px;
    padding: 10px 15px;
}

.nav-section-toggle {
    font-size: 0.65rem;
    transition: transform var(--transition);
    opacity: 0.6;
    margin-right: 5px;
}

.nav-section.collapsed .nav-section-toggle {
    transform: rotate(-90deg);
}

.nav-section-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height var(--transition), opacity var(--transition), padding var(--transition);
    opacity: 1;
    padding: 0;
}

.nav-section.collapsed .nav-section-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
}

.nav-item {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition);
    border-right: 3px solid transparent;
    position: relative;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-right: 8px;
    margin-left: 0;
    box-sizing: border-box;
    overflow: hidden;
    text-decoration: none;
}

.nav-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--primary);
    transition: width var(--transition);
    opacity: 0.1;
}

.nav-item:hover::before {
    width: 100%;
}

.nav-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
    transform: translateX(-2px);
}

.nav-item.active {
    background: rgba(0, 188, 212, 0.18) !important;
    color: var(--primary) !important;
    border: none !important;
    border-right: none !important;
    font-weight: 600 !important;
    position: relative;
    box-shadow: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-right: 8px;
    margin-left: 0;
    padding-right: 20px;
    overflow: hidden;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    box-shadow: none;
    z-index: 1;
    pointer-events: none;
}

.nav-item.active i {
    color: var(--primary) !important;
    transform: scale(1.15);
    transition: all var(--transition);
    filter: none;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-item span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    margin-right: auto;
    flex-shrink: 0;
    animation: pulse-badge 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Main Content */
/* ═══════════════════════════════════════════════════════════════════════════ */
.main-content {
    flex: 1;
    margin-right: calc(var(--sidebar-width) + 24px);
    margin-top: 0;
    margin-left: 0;
    margin-bottom: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-right var(--transition), width var(--transition);
    width: calc(100vw - var(--sidebar-width) - 24px);
    max-width: calc(100vw - var(--sidebar-width) - 24px);
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
    background: var(--bg-main);
    padding: 0;
}

.sidebar.collapsed~.main-content {
    margin-right: calc(80px + 24px);
    width: calc(100vw - 80px - 24px);
    max-width: calc(100vw - 80px - 24px);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Top Header - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.top-header {
    height: var(--header-height);
    backdrop-filter: blur(12px);
    background: var(--dark-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: var(--sidebar-width);
    z-index: var(--z-fixed);
    box-shadow: none;
    width: calc(100% - var(--sidebar-width));
    box-sizing: border-box;
    transition: right var(--transition), width var(--transition);
    overflow: visible;
    gap: 16px;
}

.top-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: transparent;
}

.sidebar.collapsed~.main-content .top-header {
    right: 80px;
    width: calc(100% - 80px);
}

.top-header__segment {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
    overflow: visible;
}

.top-header__segment--primary {
    flex: 1;
    min-width: 0;
    overflow: visible;
}

.top-header__segment--actions {
    flex-shrink: 0;
    gap: 8px;
    overflow: visible;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    overflow: visible;
    position: relative;
    flex-wrap: nowrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    overflow: visible;
    position: relative;
    flex-wrap: nowrap;
}

.header-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.header-btn .badge {
    position: absolute;
    top: -4px;
    left: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--danger);
    color: #fff;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    z-index: 1;
}

.header-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.header-btn:hover::before {
    width: 100%;
    height: 100%;
}

.header-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.header-btn i {
    font-size: 1rem;
}

.workspace-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    flex-shrink: 0;
    white-space: nowrap;
    transition: all var(--transition);
    box-shadow: none;
    overflow: visible;
    position: relative;
    min-width: 0;
    max-width: 100%;
}

.workspace-pill:hover {
    transform: translateY(-1px);
    box-shadow: none;
    background: rgba(255, 255, 255, 0.2);
}

.workspace-pill__initial {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: none;
}

.workspace-pill__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.workspace-pill__title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Quick Search */
.quick-search {
    position: relative;
    min-width: 200px;
    max-width: 400px;
    width: 400px;
    background: rgba(255, 255, 255, 0.12) !important;
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    outline: none !important;
    border-radius: 10px;
    padding: 0 12px 0 40px;
    display: flex;
    align-items: center;
    height: 40px;
    transition: all var(--transition);
    overflow: visible;
    z-index: 100;
    backdrop-filter: blur(8px);
    flex-shrink: 1;
    box-sizing: border-box;
    box-shadow: none !important;
}

.quick-search:hover {
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

.quick-search:focus,
.quick-search:focus-within {
    background: rgba(255, 255, 255, 0.18);
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    transform: scale(1.02);
}

.quick-search:active {
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

.quick-search__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    z-index: 1;
}

.quick-search:focus-within .quick-search__icon {
    color: var(--primary);
}

.quick-search__input {
    flex: 1;
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    background: transparent !important;
    outline: none !important;
    outline-width: 0 !important;
    outline-style: none !important;
    outline-color: transparent !important;
    color: #fff;
    font-size: 0.9rem;
    padding: 0;
    width: 100%;
    height: 100%;
    line-height: 40px;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
}

.quick-search__input:hover,
.quick-search__input:focus,
.quick-search__input:active,
.quick-search__input:visited {
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    outline: none !important;
    outline-width: 0 !important;
    outline-style: none !important;
    outline-color: transparent !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
}

.quick-search__input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.quick-search__results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    width: 480px;
    max-width: calc(100vw - 48px);
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: none;
    border: 1px solid var(--border-color);
    padding: 8px 0;
    display: none;
    direction: rtl;
    text-align: right;
    z-index: 1100;
    margin: 0;
}

.quick-search.quick-search--open .quick-search__results {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Page Content */
/* ═══════════════════════════════════════════════════════════════════════════ */
.page-content {
    flex: 1;
    padding: 32px 48px;
    margin: 0;
    margin-top: 88px;
    background: #f0f2f5;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
    animation: pageFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: transparent;
    pointer-events: none;
    z-index: 0;
}

.page-content>* {
    position: relative;
    z-index: 1;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Cards - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: none;
    overflow: visible !important;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    opacity: 0;
    transition: opacity var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: none;
    border-color: rgba(0, 188, 212, 0.2);
}

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

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 20px;
    overflow: visible !important;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Alerts - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.alert {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: none;
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: currentColor;
    opacity: 0.3;
}

.alert-success {
    background: rgba(16, 185, 129, 0.05);
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.05);
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.05);
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.05);
    color: #1e40af;
    border-left: 4px solid var(--info);
}

.alert-dismissible .btn-close,
.alert-dismissible .alert-close-btn {
    opacity: 0.9;
    padding: 0.5rem;
    width: 1.75rem;
    height: 1.75rem;
    background-color: rgba(0, 0, 0, 0.08);
    background-size: 1em;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.alert-dismissible .btn-close:hover,
.alert-dismissible .alert-close-btn:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.14);
    transform: scale(1.1);
}

/* وضوح زر الإغلاق على التنبيهات الفاتحة - لون X يتناسب مع نوع التنبيه */
.alert-success .alert-close-btn,
.alert-success .btn-close {
    filter: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23065f46'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414 1.707 15.707a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
}

.alert-danger .alert-close-btn,
.alert-danger .btn-close {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23991b1b'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414 1.707 15.707a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
}

.alert-warning .alert-close-btn,
.alert-warning .btn-close {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2392400e'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414 1.707 15.707a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
}

.alert-info .alert-close-btn,
.alert-info .btn-close {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%231e40af'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414 1.707 15.707a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Buttons - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: none;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: none;
}

.btn-outline-light {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: none;
}

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

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

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

.btn-info {
    background: var(--info);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Forms - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
select,
textarea {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: all var(--transition);
    background: var(--bg-white);
    color: var(--text-primary);
    width: 100%;
    font-family: inherit;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: none;
    transform: translateY(-1px);
}

.form-label,
label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Form Check & Checkboxes - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    margin-bottom: 0.75rem;
    min-height: auto;
}

.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    margin-top: 0;
    margin-right: 0;
    margin-left: 0;
    margin-bottom: 0;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: all var(--transition);
    accent-color: var(--primary);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

.form-check-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(0, 188, 212, 0.25);
    outline: none;
}

.form-check-label {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    user-select: none;
}

.form-check:hover .form-check-label {
    color: var(--primary);
}

/* Form Switch (Toggle) */
.form-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
    margin-bottom: 0.75rem;
    min-height: auto;
}

.form-switch .form-check-input {
    width: 3rem;
    height: 1.5rem;
    margin: 0;
    background-color: #e2e8f0;
    border: 2px solid #cbd5e1;
    border-radius: 2rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
    background-position: right center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
}

.form-switch .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
    background-position: left center;
}

.form-switch .form-check-label {
    margin: 0;
    padding: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Tables - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
}

.table thead {
    background: #f1f5f9;
}

.table th {
    padding: 1rem 1.5rem;
    text-align: right;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table tbody tr {
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border-light);
}

/* Removed hover effect for performance - table rows */

.table td {
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    vertical-align: middle;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Badges - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-dark);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-dark);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-dark);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-dark);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-primary {
    background: rgba(0, 188, 212, 0.1);
    color: var(--primary-dark);
    border: 1px solid rgba(0, 188, 212, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Dropdowns - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.user-dropdown,
.branch-dropdown,
.notifications-dropdown {
    position: relative;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 User Dropdown Toggle - Premium Hero Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    overflow: visible;
    position: relative;
    flex-shrink: 0;
    box-shadow: none;
    min-width: 0;
    max-width: 100%;
}

.user-dropdown-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: transparent;
    opacity: 0;
    transition: opacity var(--transition);
}

.user-dropdown-toggle:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: none;
}

.user-dropdown-toggle:hover::before {
    opacity: 1;
}

.user-dropdown-toggle:active {
    transform: translateY(0);
    box-shadow: none;
}

.user-dropdown-toggle i.fa-chevron-down {
    font-size: 0.75rem;
    opacity: 0.8;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    margin-right: 2px;
}

.user-dropdown-toggle:hover i.fa-chevron-down {
    opacity: 1;
    transform: translateY(1px);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    max-width: 150px;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    max-width: 150px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: none;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.user-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    opacity: 0;
    transition: opacity var(--transition);
}

.user-dropdown-toggle:hover .user-avatar {
    transform: scale(1.05);
    box-shadow: none;
}

.user-dropdown-toggle:hover .user-avatar::before {
    opacity: 1;
}

.user-menu,
.branch-menu,
.notifications-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: auto;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: none;
    min-width: 200px;
    max-width: 320px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition);
    z-index: var(--z-dropdown);
    padding: 8px 0;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.user-menu {
    min-width: 240px;
}

.user-menu.active,
.branch-menu.active,
.notifications-menu.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}

.user-menu-item,
.branch-menu-item,
.notification-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
    border-radius: 8px;
    margin: 2px 8px;
    opacity: 1 !important;
    visibility: visible !important;
}

.user-menu-item:hover,
.branch-menu-item:hover,
.notification-item:hover {
    background: transparent;
    transform: translateX(-4px);
    padding-right: 20px;
    color: var(--primary);
}

.user-menu-item i,
.branch-menu-item i,
.notification-item i {
    width: 18px;
    text-align: center;
    color: var(--primary);
    flex-shrink: 0;
}

.user-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: calc(100% - 16px);
    margin-left: 8px;
    margin-right: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Branch Toggle & Notifications - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.branch-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: none;
    color: inherit;
    font-size: inherit;
    cursor: pointer;
}

.branch-toggle .branch-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.notifications-toggle {
    position: relative;
}

.notifications-toggle .badge {
    position: absolute;
    top: -4px;
    left: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--danger);
    color: #fff;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    z-index: 1;
    line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Hero Header - Additional Fixes */
/* ═══════════════════════════════════════════════════════════════════════════ */
.top-header__segment--primary .workspace-pill {
    max-width: calc(100% - 20px);
}

.top-header__segment--primary .quick-search {
    flex: 1;
    min-width: 200px;
}

/* Ensure no overflow issues */
.top-header>* {
    box-sizing: border-box;
}

/* Fix for RTL layout */
[dir="rtl"] .user-menu,
[dir="rtl"] .branch-menu,
[dir="rtl"] .notifications-menu {
    left: auto;
    right: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Scrollbars - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Responsive Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .top-header {
        padding: 0 16px;
        gap: 12px;
    }

    .workspace-pill__meta {
        display: none;
    }

    .quick-search {
        width: 200px;
        min-width: 150px;
        max-width: 250px;
    }

    .user-dropdown-toggle {
        padding: 6px 10px 6px 12px;
    }

    .user-name,
    .user-role {
        max-width: 120px;
    }

    .page-content {
        padding: 24px 32px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 📱 Mobile Revolutionary Enhancements */
/* ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* Sidebar Mobile Overlay - Closed by Default */
    .sidebar {
        width: 85vw;
        max-width: 320px;
        transform: translateX(100%);
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
        z-index: 9999;
        visibility: hidden;
        opacity: 0;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0.3s ease,
            opacity 0.3s ease;
    }

    /* Ensure sidebar is closed on mobile by default */
    .sidebar:not(.open) {
        transform: translateX(100%);
        visibility: hidden;
        opacity: 0;
    }

    .sidebar.open {
        transform: translateX(0);
        visibility: visible;
        opacity: 1;
    }

    /* Sidebar Backdrop Overlay */
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .sidebar-backdrop.active {
        opacity: 1;
        visibility: visible;
    }

    /* Ensure sidebar is closed on page load */
    .sidebar:not(.open) {
        transform: translateX(100%);
        visibility: hidden;
        opacity: 0;
    }

    /* Main Content - Full Width on Mobile */
    .main-content {
        margin-right: 0;
        width: 100vw;
        max-width: 100vw;
    }

    /* Header Mobile Optimizations - Clean & Professional */
    .main-content {
        margin-left: 0;
        margin-right: 0;
        width: 100vw;
        max-width: 100vw;
    }

    .top-header {
        padding: 0 10px;
        height: 52px;
        gap: 6px;
        position: sticky;
        top: 0;
        z-index: 1000;
        background: linear-gradient(135deg, var(--dark-primary) 0%, var(--dark-secondary) 100%);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        left: 0 !important;
        right: 0 !important;
        width: 100vw;
        max-width: 100vw;
    }

    .top-header__segment {
        gap: 6px;
    }

    /* Workspace Pill - Compact */
    .workspace-pill {
        padding: 5px 8px;
        min-width: auto;
        max-width: 120px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .workspace-pill__initial {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }

    .workspace-pill__title {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 80px;
        font-weight: 600;
    }

    .workspace-pill__meta {
        display: none;
    }

    /* Quick Search - Hidden on Mobile */
    .quick-search {
        display: none;
    }

    /* Header Buttons - Touch Friendly & Elegant */
    .header-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        transition: all 0.2s ease;
    }

    .header-btn:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.2);
        transform: scale(1.05);
    }

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

    .header-btn i {
        font-size: 1rem;
    }

    /* Notifications Badge - Smaller on Mobile */
    .notifications-toggle .badge {
        width: 16px;
        height: 16px;
        font-size: 0.65rem;
        top: -2px;
        left: -2px;
    }

    /* User Avatar - Compact */
    .user-avatar {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    /* Sidebar Toggle - Elegant Hamburger Menu */
    .sidebar-toggle {
        order: -1;
        position: relative;
        background: rgba(255, 255, 255, 0.15) !important;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 12px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .sidebar-toggle::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-toggle:hover {
        background: rgba(255, 255, 255, 0.25) !important;
        border-color: rgba(255, 255, 255, 0.3);
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .sidebar-toggle:hover::before {
        opacity: 1;
    }

    .sidebar-toggle:active {
        transform: scale(0.95);
    }

    .sidebar-toggle:focus {
        outline: 2px solid rgba(255, 255, 255, 0.5);
        outline-offset: 2px;
    }

    /* Hamburger Icon - Elegant Animated Lines */
    .sidebar-toggle .hamburger-icon {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 22px;
        height: 18px;
        position: relative;
    }

    .sidebar-toggle .hamburger-icon span {
        display: block;
        width: 100%;
        height: 2.5px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 3px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform-origin: center;
        position: absolute;
    }

    .sidebar-toggle .hamburger-icon span:nth-child(1) {
        top: 0;
    }

    .sidebar-toggle .hamburger-icon span:nth-child(2) {
        top: 50%;
        transform: translateY(-50%);
    }

    .sidebar-toggle .hamburger-icon span:nth-child(3) {
        bottom: 0;
    }

    /* Hamburger Animation when Sidebar is Open */
    .sidebar.open~.main-content .sidebar-toggle .hamburger-icon span:nth-child(1) {
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
    }

    .sidebar.open~.main-content .sidebar-toggle .hamburger-icon span:nth-child(2) {
        opacity: 0;
        transform: translateY(-50%) scaleX(0);
    }

    .sidebar.open~.main-content .sidebar-toggle .hamburger-icon span:nth-child(3) {
        bottom: 50%;
        transform: translateY(50%) rotate(-45deg);
    }

    /* Desktop: Show icon, hide hamburger */
    @media (min-width: 769px) {
        .sidebar-toggle .hamburger-icon {
            display: none !important;
        }

        .sidebar-toggle i {
            display: block !important;
            font-size: 1rem;
        }

        .sidebar-toggle {
            background: rgba(255, 255, 255, 0.12) !important;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 10px;
            order: 0;
        }
    }

    /* Branch Dropdown - Mobile Optimized */
    .branch-dropdown {
        position: relative;
    }

    .branch-toggle {
        padding: 6px 8px;
        gap: 4px;
        min-width: auto;
    }

    .branch-toggle .branch-name {
        display: none;
    }

    .branch-toggle .branch-icon {
        font-size: 1.1rem;
    }

    .branch-toggle .branch-chevron {
        display: none;
    }

    .branch-menu {
        position: fixed;
        top: 56px;
        right: 0;
        left: 0;
        width: 100vw;
        max-width: 100vw;
        max-height: calc(100vh - 56px);
        border-radius: 0;
        border-right: none;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    }

    .branch-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    /* Notifications Dropdown - Mobile Optimized */
    .notifications-dropdown {
        position: relative;
    }

    .notifications-toggle {
        position: relative;
    }

    .notifications-toggle .badge {
        position: absolute;
        top: -2px;
        left: -2px;
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .notifications-menu {
        position: fixed;
        top: 56px;
        right: 0;
        left: 0;
        width: 100vw;
        max-width: 100vw;
        max-height: calc(100vh - 56px);
        border-radius: 0;
        border-right: none;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    }

    .notifications-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    /* User Dropdown - Mobile Optimized */
    .user-dropdown {
        position: relative;
    }

    .user-dropdown-toggle {
        padding: 4px 6px;
        gap: 4px;
        min-width: auto;
    }

    .user-info {
        display: none;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
        border: 2px solid rgba(255, 255, 255, 0.2);
    }

    .user-dropdown-toggle i.fa-chevron-down {
        display: none;
    }

    .user-menu {
        position: fixed !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 80vh !important;
        border-radius: 20px 20px 0 0 !important;
        border-right: none !important;
        border-left: none !important;
        border-bottom: none !important;
        border-top: 1px solid var(--border-color) !important;
        transform: translateY(100%) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s ease !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        z-index: 2001 !important;
        padding: 0 !important;
        background: white !important;
    }

    .user-menu.active {
        transform: translateY(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: flex !important;
    }

    /* Ensure all menu items are visible */
    .user-menu>* {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: relative !important;
        z-index: 1 !important;
    }

    /* Force visibility for all children */
    .user-menu.active a,
    .user-menu.active .user-menu-item,
    .user-menu.active .user-menu-divider {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }

    .user-menu.active .user-menu-divider {
        display: block !important;
    }

    .user-menu-item {
        padding: 16px 20px !important;
        font-size: 1rem !important;
        min-height: 56px !important;
        touch-action: manipulation;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        width: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
        opacity: 1 !important;
        visibility: visible !important;
        color: var(--text-primary) !important;
        background: transparent !important;
    }

    .user-menu-item:hover {
        background: var(--bg-light) !important;
        transform: none !important;
        padding-right: 20px !important;
    }

    .user-menu-item:last-child {
        border-bottom: none !important;
    }

    .user-menu-item i {
        font-size: 1.1rem !important;
        width: 20px !important;
        color: var(--primary) !important;
    }

    .user-menu-item span {
        flex: 1;
        text-align: right;
    }

    .user-menu-divider {
        height: 1px !important;
        background: var(--border-color) !important;
        margin: 0 !important;
        width: 100% !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
        border: none !important;
    }

    /* Page Content - Mobile Optimized */
    .page-content {
        padding: 16px 12px;
        margin-top: 56px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Sidebar Header - Mobile */
    .sidebar-header {
        padding: 16px;
        min-height: 64px;
    }

    .sidebar-logo {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    .sidebar-brand h1 {
        font-size: 1.1rem;
    }

    .sidebar-brand span {
        font-size: 0.75rem;
    }

    /* Navigation Sections - Mobile */
    .nav-section {
        margin-bottom: 8px;
    }

    .nav-section-title {
        padding: 14px 16px;
        font-size: 0.9rem;
        touch-action: manipulation;
        min-height: 48px;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
        border-radius: 0;
        margin: 0;
    }

    .nav-section-title:hover {
        margin: 0;
        padding: 14px 16px;
    }

    .nav-section-toggle {
        font-size: 0.75rem;
        margin-right: 8px;
    }

    .nav-section-content {
        padding: 4px 0;
    }

    .nav-item {
        padding: 14px 16px 14px 20px;
        font-size: 0.9rem;
        min-height: 48px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0, 188, 212, 0.1);
        border-radius: 0;
        margin-right: 0;
        margin-left: 0;
    }

    .nav-item::before {
        display: none;
    }

    .nav-item.active {
        margin-right: 0;
        padding-right: 20px;
        border-radius: 0;
    }

    .nav-item.active::after {
        width: 3px;
        border-radius: 0;
    }

    .nav-item i {
        width: 24px;
        font-size: 1.15rem;
        text-align: center;
    }

    .nav-item span {
        font-weight: 500;
    }

    /* Cards - Mobile Optimized */
    .card {
        border-radius: 16px;
        margin-bottom: 16px;
    }

    .card-header {
        padding: 16px;
        font-size: 1rem;
    }

    .card-body {
        padding: 16px;
    }

    /* Buttons - Touch Friendly */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 0.95rem;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .btn-sm {
        min-height: 36px;
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    /* Forms - Mobile Optimized */
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 12px 16px;
    }

    .form-label {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    /* Tables - Mobile Scroll */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    /* Alerts - Mobile */
    .alert {
        padding: 14px 16px;
        font-size: 0.9rem;
        border-radius: 12px;
        margin-bottom: 16px;
    }
}

/* Fix native search input white UI (Safari/Chrome) */
.quick-search__input[type="search"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent !important;
}

.quick-search__input[type="search"]::-webkit-search-decoration,
.quick-search__input[type="search"]::-webkit-search-cancel-button,
.quick-search__input[type="search"]::-webkit-search-results-button,
.quick-search__input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Performance Optimizations */
/* ═══════════════════════════════════════════════════════════════════════════ */
.sidebar,
.top-header,
.page-content,
.card,
.btn {
    will-change: transform;
    transform: translateZ(0);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Accessibility */
/* ═══════════════════════════════════════════════════════════════════════════ */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Print Styles */
/* ═══════════════════════════════════════════════════════════════════════════ */
@media print {

    .sidebar,
    .top-header,
    .btn,
    .header-btn {
        display: none !important;
    }

    .main-content {
        margin-right: 0;
        width: 100%;
    }

    .page-content {
        padding: 0;
        margin-top: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Utility Classes */
/* ═══════════════════════════════════════════════════════════════════════════ */
.text-primary {
    color: var(--primary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-info {
    color: var(--info) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.bg-success {
    background-color: var(--success) !important;
}

.bg-danger {
    background-color: var(--danger) !important;
}

.bg-warning {
    background-color: var(--warning) !important;
}

.bg-info {
    background-color: var(--info) !important;
}

.mt-1 {
    margin-top: 0.25rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.mb-1 {
    margin-bottom: 0.25rem !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.p-1 {
    padding: 0.25rem !important;
}

.p-2 {
    padding: 0.5rem !important;
}

.p-3 {
    padding: 1rem !important;
}

.p-4 {
    padding: 1.5rem !important;
}

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-left {
    text-align: left !important;
}

.d-flex {
    display: flex !important;
}

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-inline {
    display: inline !important;
}

.d-inline-block {
    display: inline-block !important;
}

.d-grid {
    display: grid !important;
}

.flex-row {
    flex-direction: row !important;
}

.flex-column {
    flex-direction: column !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.flex-nowrap {
    flex-wrap: nowrap !important;
}

.align-items-start {
    align-items: flex-start !important;
}

.align-items-center {
    align-items: center !important;
}

.align-items-end {
    align-items: flex-end !important;
}

.justify-content-start {
    justify-content: flex-start !important;
}

.justify-content-center {
    justify-content: center !important;
}

.justify-content-end {
    justify-content: flex-end !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.justify-content-around {
    justify-content: space-around !important;
}

.gap-1 {
    gap: 0.25rem !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 1rem !important;
}

.gap-4 {
    gap: 1.5rem !important;
}

.w-100 {
    width: 100% !important;
}

.w-50 {
    width: 50% !important;
}

.w-25 {
    width: 25% !important;
}

.w-auto {
    width: auto !important;
}

.h-100 {
    height: 100% !important;
}

.h-auto {
    height: auto !important;
}

.rounded {
    border-radius: var(--radius) !important;
}

.rounded-sm {
    border-radius: var(--radius-sm) !important;
}

.rounded-md {
    border-radius: var(--radius-md) !important;
}

.rounded-lg {
    border-radius: var(--radius-lg) !important;
}

.rounded-full {
    border-radius: var(--radius-full) !important;
}

.shadow-sm {
    box-shadow: none !important;
}

.shadow {
    box-shadow: none !important;
}

.shadow-md {
    box-shadow: none !important;
}

.shadow-lg {
    box-shadow: none !important;
}

.shadow-none {
    box-shadow: none !important;
}

.border {
    border: 1px solid var(--border-color) !important;
}

.border-top {
    border-top: 1px solid var(--border-color) !important;
}

.border-bottom {
    border-bottom: 1px solid var(--border-color) !important;
}

.border-right {
    border-right: 1px solid var(--border-color) !important;
}

.border-left {
    border-left: 1px solid var(--border-color) !important;
}

.border-none {
    border: none !important;
}

.position-relative {
    position: relative !important;
}

.position-absolute {
    position: absolute !important;
}

.position-fixed {
    position: fixed !important;
}

.position-sticky {
    position: sticky !important;
}

.overflow-hidden {
    overflow: hidden !important;
}

.overflow-auto {
    overflow: auto !important;
}

.overflow-scroll {
    overflow: scroll !important;
}

.overflow-visible {
    overflow: visible !important;
}

.opacity-0 {
    opacity: 0 !important;
}

.opacity-50 {
    opacity: 0.5 !important;
}

.opacity-100 {
    opacity: 1 !important;
}

.cursor-pointer {
    cursor: pointer !important;
}

.cursor-not-allowed {
    cursor: not-allowed !important;
}

.user-select-none {
    user-select: none !important;
}

.user-select-all {
    user-select: all !important;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Loading States & Spinners */
/* ═══════════════════════════════════════════════════════════════════════════ */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Modals - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    transition: opacity var(--transition);
}

.modal-backdrop.show {
    opacity: 1;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    display: none !important;
    align-items: center;
    justify-content: center;
    z-index: 2000 !important;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    direction: rtl;
    opacity: 0;
    visibility: hidden;
}

.modal.active,
.modal.show {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    animation: modalFadeIn 0.4s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: none;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    width: 100%;
    max-width: 600px;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.modal.active .modal-content,
.modal.show .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-gray);
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Tooltips - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    position: absolute;
    background: var(--dark-primary);
    color: var(--text-white);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all var(--transition-fast);
    z-index: var(--z-tooltip);
    box-shadow: none;
    pointer-events: none;
}

.tooltip:hover .tooltip-content,
.tooltip.active .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tooltip-content::after {
    content: '';
    position: absolute;
    border: 6px solid transparent;
    border-top-color: var(--dark-primary);
    bottom: -12px;
    right: 50%;
    transform: translateX(50%);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Progress Bars - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.progress {
    width: 100%;
    height: 8px;
    background: var(--bg-gray);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: transparent;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-sm {
    height: 4px;
}

.progress-lg {
    height: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Tabs - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Tabs Container - Universal Design for All Pages */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Tabs Container */
.tabs-container {
    margin-bottom: 1.5rem;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.tabs-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.tabs-wrapper::-webkit-scrollbar {
    height: 4px;
}

.tabs-wrapper::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 2px;
}

.tabs-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.tabs-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--border-dark);
}

/* Tabs Navigation */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-light);
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tab Button */
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.tab-btn i {
    font-size: 1rem;
    opacity: 0.7;
    transition: all var(--transition);
}

.tab-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(0, 188, 212, 0.05);
    transform: translateY(-2px);
}

.tab-btn:hover i {
    opacity: 1;
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    color: var(--text-white);
    border-color: var(--primary);
    box-shadow: none;
}

.tab-btn.active::before {
    transform: scaleX(1);
}

.tab-btn.active i {
    opacity: 1;
    color: var(--text-white);
}

.tab-btn span {
    display: inline-block;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 1.5rem;
    animation: fadeInTab 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design for Tabs */
@media (max-width: 768px) {
    .tabs-container {
        border-radius: var(--radius-md);
        margin-bottom: 1rem;
    }

    .tabs {
        gap: 0.375rem;
        padding: 0.625rem 0.75rem;
    }

    .tab-btn {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
        gap: 0.375rem;
    }

    .tab-btn i {
        font-size: 0.9rem;
    }

    /* Hide text on mobile, show only icons */
    .tab-btn span {
        display: none;
    }

    .tab-btn.active span {
        display: inline;
    }

    .tab-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .tabs {
        gap: 0.25rem;
        padding: 0.5rem;
    }

    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-width: 44px;
        justify-content: center;
    }

    .tab-btn span {
        display: none !important;
    }

    .tab-content {
        padding: 0.875rem;
    }
}

/* Legacy Support */
.tab-item {
    padding: 12px 24px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    white-space: nowrap;
    font-weight: 500;
    position: relative;
}

.tab-item:hover {
    color: var(--text-primary);
    background: var(--bg-light);
}

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

/* Tab content styles are now defined above in the new tabs section */

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Pagination - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-link {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: var(--radius);
    color: var(--text-primary);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all var(--transition);
    font-weight: 500;
}

.page-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: none;
}

.page-item.active .page-link {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: none;
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Breadcrumbs - Premium Design */
/* ═══════════════════════════════════════════════════════════════════════════ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin-right: 8px;
    color: var(--text-light);
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

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

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Additional Animations */
/* ═══════════════════════════════════════════════════════════════════════════ */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-in-left {
    animation: slideInLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-up {
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.animate-bounce {
    animation: bounce 1s infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Stats Grid & Cards - Universal Design for All Pages */
/* ═══════════════════════════════════════════════════════════════════════════ */
.stats-grid,
.stats-grid-all {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

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

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    text-decoration: none;
    color: inherit;
}

.stat-card.active {
    border-color: var(--primary);
    border-width: 2px;
}

.stat-card.active::before {
    width: 6px;
}

.stat-card.warning::before {
    background: var(--warning);
}

.stat-card.success::before {
    background: var(--success);
}

.stat-card.info::before {
    background: var(--info);
}

.stat-card.danger::before {
    background: var(--danger);
}

.stat-card.secondary::before {
    background: var(--text-secondary);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    background: var(--bg-light);
    color: var(--primary);
    transition: all var(--transition);
}

.stat-icon.primary {
    background: rgba(0, 188, 212, 0.1);
    color: var(--primary);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-icon.info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.stat-icon.secondary {
    background: var(--bg-light);
    color: var(--text-secondary);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
}

.stat-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Stat Badges - For additional info in stat cards */
.stat-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.stat-badges .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    border-radius: var(--radius);
}

/* Transport Stats Grid - Specific enhancements */
.transport-stats-grid {
    margin-bottom: 2rem;
}

.transport-stats-grid .stat-card {
    min-height: 140px;
}

.transport-stats-grid .stat-card:hover {
    transform: translateY(-4px);
}

.transport-stats-grid .stat-icon {
    width: 64px;
    height: 64px;
    font-size: 1.75rem;
}

.transport-stats-grid .stat-value {
    font-size: 2.25rem;
}

.transport-stats-grid .stat-label {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

/* Finance Stats Grid - Specific enhancements */
.finance-stats-grid {
    margin-bottom: 2rem;
}

.finance-stats-grid .stat-card {
    min-height: 130px;
    padding: 1.5rem;
}

.finance-stats-grid .stat-card:hover {
    transform: translateY(-3px);
}

.finance-stats-grid .stat-icon {
    width: 60px;
    height: 60px;
    font-size: 1.6rem;
}

.finance-stats-grid .stat-value {
    font-size: 2rem;
    font-weight: 900;
}

.finance-stats-grid .stat-label {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* Responsive Stats Grid */
@media (max-width: 1024px) {

    .stats-grid,
    .stats-grid-all,
    .transport-stats-grid,
    .finance-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {

    .stats-grid,
    .stats-grid-all,
    .transport-stats-grid,
    .finance-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.875rem;
    }

    .stat-card {
        padding: 1.25rem;
        min-height: 120px;
    }

    .stat-icon {
        width: 56px;
        height: 56px;
        font-size: 1.4rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .transport-stats-grid .stat-card {
        min-height: 120px;
    }

    .transport-stats-grid .stat-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }

    .transport-stats-grid .stat-value {
        font-size: 2rem;
    }

    .finance-stats-grid .stat-card {
        min-height: 110px;
        padding: 1.25rem;
    }

    .finance-stats-grid .stat-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }

    .finance-stats-grid .stat-value {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {

    .stats-grid,
    .stats-grid-all,
    .transport-stats-grid,
    .finance-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
        min-height: 100px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .stat-badges {
        gap: 0.375rem;
    }

    .stat-badges .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }

    .finance-stats-grid .stat-card {
        min-height: 100px;
        padding: 1rem;
    }

    .finance-stats-grid .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }

    .finance-stats-grid .stat-value {
        font-size: 1.5rem;
    }

    .finance-stats-grid .stat-label {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {

    .stats-grid,
    .stats-grid-all {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {

    .stats-grid,
    .stats-grid-all {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Page Header - Universal Hero Design for All Pages */
/* ═══════════════════════════════════════════════════════════════════════════ */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    position: relative;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 100;
    isolation: isolate;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 50%;
    height: 200%;
    background: rgba(255, 255, 255, 0.08);
    transform: rotate(-15deg);
    pointer-events: none;
    z-index: 0;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -10%;
    width: 40%;
    height: 180%;
    background: rgba(255, 255, 255, 0.06);
    transform: rotate(15deg);
    pointer-events: none;
    z-index: 0;
}

/* Header Content */
.page-header .header-content,
.page-header>div:first-child {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.page-header .header-icon,
.page-header .page-title i {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.page-header .header-icon:hover {
    transform: scale(1.05);
}

.page-header .header-text,
.page-header .page-title {
    flex: 1;
    min-width: 0;
}

.page-header .page-title,
.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-white);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    line-height: 1.3;
}

.page-header .page-title i,
.page-header h1 i {
    opacity: 0.95;
    font-size: 1.4rem;
}

.page-header .page-subtitle,
.page-header p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.5;
}

/* Header Actions */
.page-header .header-actions,
.page-header .page-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex-shrink: 0;
    position: relative;
    z-index: 101;
    isolation: isolate;
}

.page-header .header-actions .btn,
.page-header .page-actions .btn {
    white-space: nowrap;
    font-weight: 600;
    transition: all 0.3s ease;
}

.page-header .btn-primary {
    background: var(--text-white) !important;
    color: var(--primary-dark) !important;
    border: none !important;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    z-index: 102;
    pointer-events: auto;
    isolation: isolate;
}

.page-header .btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 188, 212, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
}

.page-header .btn-primary:hover {
    background: rgba(255, 255, 255, 0.98) !important;
    color: var(--primary-dark) !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.page-header .btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.page-header .btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.page-header .btn-primary:focus {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.page-header .btn-primary i {
    transition: transform 0.3s ease;
}

.page-header .btn-primary:hover i {
    transform: scale(1.1);
}

.page-header .btn-outline,
.page-header .btn-outline-secondary {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-white);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    z-index: 102;
    pointer-events: auto;
    isolation: isolate;
}

.page-header .btn-outline:hover,
.page-header .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    border-color: rgba(255, 255, 255, 0.55) !important;
    color: var(--text-white) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.page-header .btn-outline:active,
.page-header .btn-outline-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.page-header .btn-outline:focus,
.page-header .btn-outline-secondary:focus {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* Academics Header Specific */
.page-header.academics-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Dropdown Styles in Page Header - Organized & Clean */
.page-header .dropdown {
    position: relative;
    display: inline-block;
    z-index: 103;
}

.page-header .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.page-header .dropdown-toggle::after {
    margin-right: 0.5rem;
    margin-left: 0;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
    transition: transform 0.3s ease;
}

.page-header .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.page-header .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 220px;
    max-width: 280px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    margin: 0;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    pointer-events: none;
}

.page-header .dropdown-menu.show,
.page-header .dropdown-menu[data-bs-popper] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

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

.page-header .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: right;
    white-space: nowrap;
}

.page-header .dropdown-item:hover,
.page-header .dropdown-item:focus {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
    color: var(--primary);
    transform: translateX(-4px);
    outline: none;
}

.page-header .dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--primary);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.page-header .dropdown-divider,
.page-header .dropdown-menu hr.dropdown-divider {
    height: 1px;
    margin: 0.5rem 0;
    overflow: hidden;
    background: var(--border-color);
    border: none;
    opacity: 1;
}

.page-header .dropdown-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Ensure page-actions are properly aligned */
.page-header .page-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.page-header .page-actions .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Special Variants */
.page-header.d-flex {
    display: flex;
}

.page-header.justify-between {
    justify-content: space-between;
}

.page-header.align-center {
    align-items: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-header {
        padding: 1.5rem 1.75rem;
    }

    .page-header .page-title,
    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header .header-icon,
    .page-header .page-title i {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem 1.5rem;
        gap: 1rem;
    }

    .page-header .header-content,
    .page-header>div:first-child {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        width: 100%;
    }

    .page-header .header-text,
    .page-header .page-title {
        width: 100%;
    }

    .page-header .page-title,
    .page-header h1 {
        font-size: 1.35rem;
        flex-wrap: wrap;
    }

    .page-header .page-subtitle,
    .page-header p {
        font-size: 0.9rem;
    }

    .page-header .header-actions,
    .page-header .page-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .page-header .header-actions .btn,
    .page-header .page-actions .btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }

    .page-header .header-icon,
    .page-header .page-title i {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 1rem 1.25rem;
        border-radius: var(--radius-md);
    }

    .page-header .page-title,
    .page-header h1 {
        font-size: 1.2rem;
    }

    .page-header .page-subtitle,
    .page-header p {
        font-size: 0.85rem;
    }

    .page-header .header-icon,
    .page-header .page-title i {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .page-header .header-actions .btn,
    .page-header .page-actions .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
        min-height: 40px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Additional Responsive Utilities */
/* ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .d-lg-none {
        display: none !important;
    }

    .d-lg-block {
        display: block !important;
    }

    .d-lg-flex {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .d-md-none {
        display: none !important;
    }

    .d-md-block {
        display: block !important;
    }

    .d-md-flex {
        display: flex !important;
    }

    .w-md-100 {
        width: 100% !important;
    }

    .p-md-2 {
        padding: 0.5rem !important;
    }

    .m-md-0 {
        margin: 0 !important;
    }
}

@media (max-width: 576px) {
    .d-sm-none {
        display: none !important;
    }

    .d-sm-block {
        display: block !important;
    }

    .d-sm-flex {
        display: flex !important;
    }

    .w-sm-100 {
        width: 100% !important;
    }

    .p-sm-1 {
        padding: 0.25rem !important;
    }

    .m-sm-0 {
        margin: 0 !important;
    }

    /* Extra Small Screens - Further Optimizations */
    .sidebar {
        width: 90vw;
        max-width: 300px;
    }

    .top-header {
        padding: 0 10px;
        height: 52px;
    }

    .workspace-pill {
        max-width: 120px;
        padding: 5px 8px;
    }

    .workspace-pill__title {
        max-width: 70px;
        font-size: 0.75rem;
    }

    .header-btn {
        width: 36px;
        height: 36px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .page-content {
        padding: 12px 10px;
        margin-top: 52px;
    }

    .card {
        border-radius: 12px;
        margin-bottom: 12px;
    }

    .card-header,
    .card-body {
        padding: 12px;
    }

    .btn {
        min-height: 40px;
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .nav-item {
        padding: 12px 14px 12px 18px;
        font-size: 0.85rem;
        min-height: 44px;
    }

    .nav-item i {
        width: 22px;
        font-size: 1.1rem;
    }

    .nav-section-title {
        padding: 12px 14px;
        font-size: 0.85rem;
        min-height: 44px;
    }

    .nav-section-toggle {
        font-size: 0.7rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Add New Button - Floating Left Corner Button (Universal) */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Floating Add New Button - Left Corner */
.add-new-btn,
.floating-add-btn,
.btn-add-new {
    position: fixed;
    bottom: 2rem;
    left: calc(var(--sidebar-width) + 2rem);
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.75rem;
    background: var(--primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 16px rgba(0, 188, 212, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    isolation: isolate;
}

.add-new-btn::before,
.floating-add-btn::before,
.btn-add-new::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
}

.add-new-btn:hover,
.floating-add-btn:hover,
.btn-add-new:hover {
    background: var(--primary-dark);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 188, 212, 0.4);
    color: var(--text-white);
    text-decoration: none;
}

.add-new-btn:hover::before,
.floating-add-btn:hover::before,
.btn-add-new:hover::before {
    width: 300px;
    height: 300px;
}

.add-new-btn:active,
.floating-add-btn:active,
.btn-add-new:active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

.add-new-btn i,
.floating-add-btn i,
.btn-add-new i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.add-new-btn:hover i,
.floating-add-btn:hover i,
.btn-add-new:hover i {
    transform: scale(1.2) rotate(90deg);
}

/* Icon-only variant (compact) */
.add-new-btn.icon-only,
.floating-add-btn.icon-only,
.btn-add-new.icon-only {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
}

.add-new-btn.icon-only span,
.floating-add-btn.icon-only span,
.btn-add-new.icon-only span {
    display: none;
}

.add-new-btn.icon-only i,
.floating-add-btn.icon-only i,
.btn-add-new.icon-only i {
    font-size: 1.5rem;
}

/* RTL Support */
[dir="rtl"] .add-new-btn,
[dir="rtl"] .floating-add-btn,
[dir="rtl"] .btn-add-new {
    left: auto;
    right: calc(var(--sidebar-width) + 2rem);
}

/* Sidebar Collapsed State */
.sidebar.collapsed~.main-content .add-new-btn,
.sidebar.collapsed~.main-content .floating-add-btn,
.sidebar.collapsed~.main-content .btn-add-new {
    left: calc(80px + 2rem);
}

[dir="rtl"] .sidebar.collapsed~.main-content .add-new-btn,
[dir="rtl"] .sidebar.collapsed~.main-content .floating-add-btn,
[dir="rtl"] .sidebar.collapsed~.main-content .btn-add-new {
    right: calc(80px + 2rem);
    left: auto;
}

/* Responsive Design */
@media (max-width: 1024px) {

    .add-new-btn,
    .floating-add-btn,
    .btn-add-new {
        left: 1rem;
        bottom: 1.5rem;
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    [dir="rtl"] .add-new-btn,
    [dir="rtl"] .floating-add-btn,
    [dir="rtl"] .btn-add-new {
        right: 1rem;
        left: auto;
    }

    .sidebar.collapsed~.main-content .add-new-btn,
    .sidebar.collapsed~.main-content .floating-add-btn,
    .sidebar.collapsed~.main-content .btn-add-new {
        left: 1rem;
    }

    [dir="rtl"] .sidebar.collapsed~.main-content .add-new-btn,
    [dir="rtl"] .sidebar.collapsed~.main-content .floating-add-btn,
    [dir="rtl"] .sidebar.collapsed~.main-content .btn-add-new {
        right: 1rem;
        left: auto;
    }
}

@media (max-width: 768px) {

    .add-new-btn,
    .floating-add-btn,
    .btn-add-new {
        bottom: 1rem;
        left: 1rem;
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
        gap: 0.5rem;
    }

    [dir="rtl"] .add-new-btn,
    [dir="rtl"] .floating-add-btn,
    [dir="rtl"] .btn-add-new {
        right: 1rem;
        left: auto;
    }

    /* On mobile, show icon-only by default if text is long */
    .add-new-btn.mobile-compact,
    .floating-add-btn.mobile-compact,
    .btn-add-new.mobile-compact {
        width: 56px;
        height: 56px;
        padding: 0;
        border-radius: 50%;
    }

    .add-new-btn.mobile-compact span,
    .floating-add-btn.mobile-compact span,
    .btn-add-new.mobile-compact span {
        display: none;
    }

    .add-new-btn.mobile-compact i,
    .floating-add-btn.mobile-compact i,
    .btn-add-new.mobile-compact i {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {

    .add-new-btn,
    .floating-add-btn,
    .btn-add-new {
        width: 56px;
        height: 56px;
        padding: 0;
        border-radius: 50%;
        bottom: 1rem;
        left: 1rem;
    }

    [dir="rtl"] .add-new-btn,
    [dir="rtl"] .floating-add-btn,
    [dir="rtl"] .btn-add-new {
        right: 1rem;
        left: auto;
    }

    .add-new-btn span,
    .floating-add-btn span,
    .btn-add-new span {
        display: none;
    }

    .add-new-btn i,
    .floating-add-btn i,
    .btn-add-new i {
        font-size: 1.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Content Area - Universal Design for All Pages */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Content Card - General container for content below search/filters */
.content-card,
.assignments-table-card,
.table-card,
.data-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: none;
    transition: all var(--transition);
}

.content-card:hover,
.assignments-table-card:hover,
.table-card:hover,
.data-card:hover {
    border-color: var(--border-dark);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Enhanced Content Headers & Table Headers - Professional Design */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Table Header / Card Header - Enhanced Professional Design */
.table-header,
.content-card .card-header,
.assignments-table-card .table-header,
.table-card .table-header,
.card .table-header,
.card .card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    transition: all var(--transition);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* إزالة أي تأثيرات خلفية/خط ملون عند الهوفر على ترويسات البطاقات والجداول */
.table-header,
.content-card .card-header,
.assignments-table-card .table-header,
.table-card .table-header,
.card .table-header,
.card .card-header {
    background-image: none;
    box-shadow: none;
}

.table-header::before,
.content-card .card-header::before,
.assignments-table-card .table-header::before,
.card .table-header::before {
    content: none;
}

/* Header Title with Icon */
.table-header h3,
.content-card .card-header h3,
.assignments-table-card .table-header h3,
.card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex: 1;
    min-width: 0;
    line-height: 1.4;
}

/* Icon Container - Elegant White Box with Icon */
.table-header h3 i,
.content-card .card-header h3 i,
.assignments-table-card .table-header h3 i,
.card-header h3 i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-white);
    color: var(--primary);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all var(--transition);
    position: relative;
}

.table-header h3:hover i,
.content-card .card-header h3:hover i,
.assignments-table-card .table-header h3:hover i,
.card-header h3:hover i {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    background: var(--primary);
    color: white;
}

/* Badge Count - Enhanced Elegant Design */
.badge-count,
.table-header .badge,
.content-card .card-header .badge,
.card-header .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.875rem;
    background: var(--bg-white);
    color: var(--primary);
    border: 2px solid rgba(0, 188, 212, 0.2);
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 188, 212, 0.1);
    transition: all var(--transition);
    position: relative;
}

.badge-count::before,
.table-header .badge::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-full);
    padding: 2px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition);
}

.badge-count:hover,
.table-header .badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.2);
    border-color: var(--primary);
}

.badge-count:hover::before,
.table-header .badge:hover::before {
    opacity: 1;
}

/* Header Actions */
.table-header>.btn,
.table-header>a,
.content-card .card-header>.btn,
.card-header>.btn {
    flex-shrink: 0;
}

/* Header with Icon and Badge Combination */
.table-header>div:first-child,
.content-card .card-header>div:first-child {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

/* Enhanced Card Header Styles */
.card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid var(--border-light);
}

/* Table Header with Dark Background Variant */
.table-header.dark,
.card-header.dark {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.table-header.dark h3,
.card-header.dark h3 {
    color: white;
}

.table-header.dark h3 i,
.card-header.dark h3 i {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.table-header.dark h3:hover i,
.card-header.dark h3:hover i {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.table-header.dark .badge-count,
.card-header.dark .badge-count {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Card Body - Content area */
.content-card .card-body,
.assignments-table-card .card-body,
.table-card .card-body,
.data-card .card-body {
    padding: 1.5rem;
    overflow: visible;
}

/* Empty State - Elegant & Professional Design */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    min-height: 300px;
    background: var(--bg-white);
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    opacity: 0.5;
    margin-bottom: 1.5rem;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.empty-state:hover i {
    opacity: 0.7;
    transform: scale(1.05);
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.empty-state p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0 1.5rem 0;
    max-width: 400px;
    line-height: 1.6;
}

.empty-state .btn {
    margin-top: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.empty-state .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: 0;
}

.empty-state .btn:hover {
    transform: translateY(-2px) scale(1.02);
}

.empty-state .btn:hover::before {
    width: 300px;
    height: 300px;
}

.empty-state .btn i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.empty-state .btn:hover i {
    transform: scale(1.15) rotate(90deg);
}

/* Table Responsive Container */
.table-responsive,
.content-card .table-responsive,
.assignments-table-card .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    width: 100%;
    min-width: 600px;
}

/* Responsive Design for Content Area */
@media (max-width: 768px) {

    .content-card,
    .assignments-table-card,
    .table-card,
    .data-card {
        border-radius: var(--radius-md);
        margin-bottom: 1rem;
    }

    .table-header,
    .content-card .card-header,
    .assignments-table-card .table-header,
    .card-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .table-header h3,
    .content-card .card-header h3,
    .card-header h3 {
        font-size: 1rem;
        width: 100%;
    }

    .table-header h3 i,
    .content-card .card-header h3 i,
    .card-header h3 i {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .badge-count,
    .table-header .badge,
    .card-header .badge {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
        padding: 0 10px;
    }

    .content-card .card-body,
    .assignments-table-card .card-body,
    .table-card .card-body {
        padding: 1rem;
    }

    .empty-state {
        padding: 3rem 1.5rem;
        min-height: 250px;
    }

    .empty-state i {
        font-size: 3rem;
        margin-bottom: 1rem;
    }

    .empty-state h3 {
        font-size: 1.25rem;
    }

    .empty-state p {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
    }

    .empty-state .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {

    .table-header,
    .content-card .card-header,
    .card-header {
        padding: 0.875rem;
    }

    .table-header h3 i,
    .content-card .card-header h3 i,
    .card-header h3 i {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }

    .badge-count,
    .table-header .badge,
    .card-header .badge {
        min-width: 28px;
        height: 28px;
        font-size: 0.75rem;
        padding: 0 8px;
    }

    .empty-state {
        padding: 2.5rem 1rem;
        min-height: 200px;
    }

    .empty-state i {
        font-size: 2.5rem;
    }

    .empty-state h3 {
        font-size: 1.1rem;
    }

    .empty-state p {
        font-size: 0.9rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Form Tabs - Universal Design for All Forms */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Form Tabs Container */
.form-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.form-tabs::-webkit-scrollbar {
    height: 4px;
}

.form-tabs::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 2px;
}

.form-tabs::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.form-tabs::-webkit-scrollbar-thumb:hover {
    background: var(--border-dark);
}

/* Form Tab Button */
.form-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    position: relative;
    margin-bottom: -0.5rem;
}

.form-tab-btn i {
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.form-tab-btn:hover {
    color: var(--primary);
    background: rgba(0, 188, 212, 0.05);
    border-radius: var(--radius) var(--radius) 0 0;
}

.form-tab-btn:hover i {
    opacity: 1;
}

.form-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(0, 188, 212, 0.08);
    border-radius: var(--radius) var(--radius) 0 0;
}

.form-tab-btn.active i {
    opacity: 1;
    color: var(--primary);
}

/* Form Tab Content */
.form-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.form-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Actions Sticky Bar */
.form-actions-sticky {
    position: sticky;
    bottom: 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    margin: 2rem -1.5rem -1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    align-items: center;
    z-index: 10;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.form-actions-sticky .btn {
    min-width: 120px;
    justify-content: center;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

/* Form Card Enhancements */
.form-tab-content .card {
    margin-bottom: 1.5rem;
}

.form-tab-content .card-header {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
}

.form-tab-content .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-tab-content .card-title i {
    color: var(--primary);
    font-size: 1rem;
}

/* Form Group Enhancements */
.form-tab-content .form-group {
    margin-bottom: 1.25rem;
}

.form-tab-content .form-group:last-child {
    margin-bottom: 0;
}

.form-tab-content .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-tab-content .form-group label .text-danger {
    color: var(--danger);
    margin-right: 0.25rem;
}

.form-tab-content .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: all var(--transition);
    background: var(--bg-white);
    color: var(--text-primary);
}

.form-tab-content .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

.form-tab-content .form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* Responsive Design for Form Tabs */
@media (max-width: 768px) {
    .form-tabs {
        gap: 0.25rem;
        margin-bottom: 1rem;
    }

    .form-tab-btn {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
        gap: 0.375rem;
    }

    .form-tab-btn i {
        font-size: 0.9rem;
    }

    .form-tab-btn span {
        display: none;
    }

    .form-tab-btn.active span {
        display: inline;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-actions-sticky {
        flex-direction: column-reverse;
        padding: 1rem;
        margin: 1.5rem -1rem -1rem;
    }

    .form-actions-sticky .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .form-tabs {
        padding-bottom: 0.25rem;
    }

    .form-tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .form-tab-content .card {
        margin-bottom: 1rem;
    }

    .form-tab-content .card-header {
        padding: 0.875rem 1rem;
    }

    .form-tab-content .card-body {
        padding: 1rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 Header Enhancements - Integrated from hero-modern.css */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Quick Search - Enhanced Styles - Force Remove All Borders */
.quick-search,
.quick-search:hover,
.quick-search:focus,
.quick-search:focus-within,
.quick-search:active,
.quick-search:visited {
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-left: none !important;
    outline: none !important;
    outline-width: 0 !important;
    outline-style: none !important;
    outline-color: transparent !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
}

.quick-search::before,
.quick-search::after,
.quick-search *::before,
.quick-search *::after {
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Force remove border from input inside quick-search */
.quick-search .quick-search__input,
.quick-search .quick-search__input:hover,
.quick-search .quick-search__input:focus,
.quick-search .quick-search__input:active {
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Quick Search Results - Enhanced Dropdown */
.quick-search__group {
    padding: 0 12px;
    margin-bottom: 8px;
}

.quick-search__group:last-child {
    margin-bottom: 0;
}

.quick-search__group-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px 6px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 6px;
}

.quick-search__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.quick-search__item:hover,
.quick-search__item.is-active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(0, 188, 212, 0.08) 100%);
    color: var(--primary);
}

.quick-search__item i {
    width: 20px;
    text-align: center;
    color: var(--primary);
    font-size: 0.95rem;
}

.quick-search__item-title {
    font-weight: 500;
    font-size: 0.9rem;
}

.quick-search__item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-right: auto;
}

.quick-search__empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* User Dropdown - Enhanced Styles */
.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 14px 7px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    overflow: visible;
    position: relative;
    flex-shrink: 0;
    min-width: 0;
    max-width: 100%;
}

.user-dropdown-toggle:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.1) 100%);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-align: right;
    position: relative;
    z-index: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    max-width: 140px;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    max-width: 140px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
    transition: var(--transition);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.user-dropdown-toggle:hover .user-avatar {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 188, 212, 0.4);
}

.user-dropdown-toggle i.fa-chevron-down {
    font-size: 0.7rem;
    opacity: 0.7;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-right: 4px;
    position: relative;
    z-index: 1;
}

.user-dropdown-toggle:hover i.fa-chevron-down {
    opacity: 1;
    transform: translateY(2px);
}

/* Dropdown Containers */
.user-dropdown,
.branch-dropdown,
.notifications-dropdown {
    position: relative;
    overflow: visible;
    flex-shrink: 0;
}

/* Dropdown Menus */
.user-menu,
.branch-menu,
.notifications-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: auto;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    max-width: 340px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
    padding: 10px 0;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    pointer-events: none;
}

.user-menu {
    min-width: 260px;
}

.notifications-menu {
    min-width: 320px;
    max-width: 380px;
}

/* Active State for All Dropdowns */
.user-menu.active,
.branch-menu.active,
.notifications-menu.active,
.user-dropdown .user-menu.active,
.branch-dropdown .branch-menu.active,
.notifications-dropdown .notifications-menu.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
    display: block !important;
    pointer-events: auto !important;
    z-index: 1050 !important;
}

/* Dropdown Header */
.notifications-header,
.branch-menu-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--bg-light) 0%, transparent 100%);
}

.notifications-header h4,
.branch-menu-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mark-all-read:hover {
    background: rgba(99, 102, 241, 0.1);
}

/* Menu Items */
.user-menu-item,
.branch-menu-item,
.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    border-radius: 10px;
    margin: 4px 10px;
    position: relative;
}

.user-menu-item:hover,
.branch-menu-item:hover,
.notification-item:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(0, 188, 212, 0.06) 100%);
    transform: translateX(-4px);
    color: var(--primary);
}

.user-menu-item i,
.branch-menu-item i,
.notification-item i {
    width: 20px;
    text-align: center;
    color: var(--primary);
    flex-shrink: 0;
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

.user-menu-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 8px 18px;
}

/* Branch Menu Specific */
.branch-menu-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px 0;
}

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

.branch-menu-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.branch-menu-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(0, 188, 212, 0.08) 100%);
}

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

.branch-menu-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-light);
    background: linear-gradient(135deg, var(--bg-light) 0%, transparent 100%);
}

.branch-menu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.branch-menu-link:hover {
    transform: translateX(-4px);
}

/* Notifications Menu Specific */
.notifications-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 0;
}

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

.notification-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.notifications-footer {
    padding: 12px 18px;
    text-align: center;
    border-top: 1px solid var(--border-light);
    background: linear-gradient(135deg, var(--bg-light) 0%, transparent 100%);
}

.notifications-footer a {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.notifications-footer a:hover {
    text-decoration: underline;
}

/* Branch Toggle Button - تصميم نظيف ومتناسق مع الهيدر */
.branch-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    min-height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.branch-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.branch-toggle .branch-icon {
    font-size: 1rem;
    opacity: 0.95;
}

.branch-toggle .branch-name {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-toggle .branch-chevron {
    font-size: 0.6rem;
    opacity: 0.75;
    transition: transform 0.2s ease;
}

.branch-toggle:hover .branch-chevron {
    transform: translateY(1px);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎨 End of Framework */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ========================================================================== */
/* Global override: disable any horizontal highlight line on hover for        */
/* content/table headers and cards across the system                          */
/* ========================================================================== */
.table-header,
.content-card .card-header,
.assignments-table-card .table-header,
.table-card .table-header,
.card .table-header,
.card .card-header {
    border-top: 0 !important;
}

.table-header::before,
.content-card .card-header::before,
.assignments-table-card .table-header::before,
.table-card .table-header::before,
.card .table-header::before,
.card .card-header::before,
.table-header::after,
.content-card .card-header::after,
.assignments-table-card .table-header::after,
.table-card .table-header::after,
.card .table-header::after,
.card .card-header::after {
    content: none !important;
    display: none !important;
}