/* =============================================================================
   Modern Custom Styles for ASAS Global System
   Bootstrap 5.3.8 Compatible | RTL Arabic Support | Universal Module Support
   ============================================================================= */

/* Import comprehensive modern Arabic font collection - MUST be at top of CSS file */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700;900&family=Tajawal:wght@200;300;400;500;700;800;900&family=El+Messiri:wght@400;500;600;700&family=Amiri:wght@400;700&display=swap');

/* CSS Custom Properties for consistent theming */
:root {
    /* Comprehensive Arabic Font Stack - Tajawal primary with modern Arabic fallbacks */
    --font-primary: 'Tajawal', 'Cairo', 'El Messiri', 'Amiri', 'Droid Arabic Kufi', 'Al Bayan', 'Geeza Pro', 'Arabic Typesetting', 'Traditional Arabic', 'Simplified Arabic', 'Tahoma', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', system-ui, sans-serif;
    --font-secondary: 'Tajawal', 'Cairo', 'Open Sans', 'Helvetica Neue', Arial, 'Tahoma', sans-serif;
    
    /* Spacing */
    --navbar-height: 56px;
    --header-height: var(--navbar-height);
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 3rem;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s ease;
    
    /* Shadows */
    --shadow-soft: 0 2px 4px -1px rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-medium: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-strong: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 0 1px rgb(59 130 246 / 0.5);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Typography - Tajawal font weights */
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --line-height-tight: 1.25;
    --line-height-relaxed: 1.625;
    
    /* =============================================================================
       Universal Data Visualization Color Palette
       ============================================================================= */
    
    /* Status/Quality Level Colors - Universal 6-level system */
    --color-level-5: #198754;        /* Green - Optimal/Excellent level */
    --color-level-5-light: #d1e7dd;
    --color-level-5-dark: #146c43;
    --color-level-4: #20c997;        /* Teal - High level */
    --color-level-4-light: #d2f4ea;
    --color-level-4-dark: #0f5132;
    --color-level-3: #0dcaf0;        /* Cyan - Medium level */
    --color-level-3-light: #cff4fc;
    --color-level-3-dark: #087990;
    --color-level-2: #ffc107;        /* Yellow - Low level */
    --color-level-2-light: #fff3cd;
    --color-level-2-dark: #997404;
    --color-level-1: #fd7e14;        /* Orange - Minimal level */
    --color-level-1-light: #ffe5d0;
    --color-level-1-dark: #bf5b04;
    --color-level-0: #dc3545;        /* Red - Critical/Failed level */
    --color-level-0-light: #f8d7da;
    --color-level-0-dark: #b02a37;
    
    /* Semantic aliases for backward compatibility and clarity */
    --color-optimal: var(--color-level-5);
    --color-high: var(--color-level-4);
    --color-medium: var(--color-level-3);
    --color-low: var(--color-level-2);
    --color-minimal: var(--color-level-1);
    --color-critical: var(--color-level-0);
    
    /* Chart Series Colors - 8-color accessibility-friendly palette */
    --chart-color-1: #0d6efd;        /* Primary Blue */
    --chart-color-2: #198754;        /* Success Green */
    --chart-color-3: #fd7e14;        /* Warning Orange */
    --chart-color-4: #dc3545;        /* Danger Red */
    --chart-color-5: #6f42c1;        /* Purple */
    --chart-color-6: #20c997;        /* Teal */
    --chart-color-7: #ffc107;        /* Yellow */
    --chart-color-8: #6c757d;        /* Gray */
    
    /* Extended Chart Series for Complex Data */
    --chart-color-9: #e83e8c;        /* Pink */
    --chart-color-10: #17a2b8;       /* Info Blue */
    --chart-color-11: #28a745;       /* Alternative Green */
    --chart-color-12: #007bff;       /* Light Blue */
    
    /* Category/Module Colors for Universal Context */
    --category-1: #6f42c1;           /* Purple - Primary category */
    --category-2: #198754;           /* Green - Secondary category */
    --category-3: #fd7e14;           /* Orange - Tertiary category */
    --category-4: #dc3545;           /* Red - Fourth category */
    --category-5: #e83e8c;           /* Pink - Fifth category */
    --category-6: #20c997;           /* Teal - Sixth category */
    --category-7: #6c757d;           /* Gray - Seventh category */
    --category-8: #0dcaf0;           /* Cyan - Eighth category */
    
    /* Module-specific aliases for common business areas */
    --module-primary: var(--category-1);    /* Finance, Accounting, Core */
    --module-secondary: var(--category-2);  /* Operations, Production */
    --module-tertiary: var(--category-3);   /* HR, Human Resources */
    --module-quaternary: var(--category-4); /* Sales, Marketing */
    --module-creative: var(--category-5);   /* Design, Creative, R&D */
    --module-logistics: var(--category-6);  /* Logistics, Supply Chain */
    --module-technical: var(--category-7);  /* IT, Technical, Support */
    --module-compliance: var(--category-8); /* Legal, Compliance, Quality */
    
    /* Statistical Ranges - Mapped to universal levels */
    --stat-range-1: var(--color-level-5);  /* 90-100% - Optimal */
    --stat-range-2: var(--color-level-4);  /* 80-89% - High */
    --stat-range-3: var(--color-level-3);  /* 70-79% - Medium */
    --stat-range-4: var(--color-level-2);  /* 60-69% - Low */
    --stat-range-5: var(--color-level-1);  /* 50-59% - Minimal */
    --stat-range-6: var(--color-level-0);  /* Below 50% - Critical */
    
    /* Progress Status Indicators */
    --progress-complete: var(--color-level-5);    /* Complete/Success */
    --progress-in-progress: var(--color-level-3); /* In Progress */
    --progress-pending: #6c757d;                  /* Pending/Neutral */
    --progress-overdue: var(--color-level-0);     /* Overdue/Critical */
    --progress-cancelled: #495057;                /* Cancelled/Disabled */
    
    /* Background Variations for Cards and Panels */
    --bg-data-primary: rgba(13, 110, 253, 0.1);
    --bg-data-success: rgba(25, 135, 84, 0.1);
    --bg-data-warning: rgba(255, 193, 7, 0.1);
    --bg-data-danger: rgba(220, 53, 69, 0.1);
    --bg-data-info: rgba(13, 202, 240, 0.1);
}

/* Fallback font handled by system fonts in font stack - no external dependencies needed */

/* Base Layout - Apply Tajawal font globally */
body {
    font-family: var(--font-primary);
    padding-top: var(--header-height);
    background-color: var(--bs-gray-50);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-weight: var(--font-weight-regular);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    margin: 0;
    padding-bottom: 0;
}

/* Ensure form maintains flex layout */
#form1 {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Flexbox layout for sticky footer */
main {
    flex: 1 0 auto;
    padding-bottom: 2rem;
}

/* Footer styling to ensure it stays at bottom */
footer,
.site-footer {
    margin-top: auto !important;
    flex-shrink: 0;
    width: 100%;
    position: relative;
    z-index: 10;
}

/* Focus management for accessibility */
*:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    box-shadow: var(--shadow-glow);
}

/* Remove default focus styles from buttons when not keyboard focused */
*:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

/* Ensure focus styles are visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    box-shadow: var(--shadow-glow);
}

/* =============================================================================
   Login Form Styling Enhancements
   ============================================================================= */

/* Login form container improvements */
#loginForm {
    max-width: 400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* Login form textbox width synchronization */
#loginForm .form-control,
#loginForm .dxeTextBox_Metropolis,
#loginForm .dx-textbox {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

/* Login form group styling */
#loginForm .form-group {
    margin-bottom: var(--spacing-md);
}

/* Remove Bootstrap grid constraints for login form */
#loginForm .col-md-10,
#loginForm .col-md-offset-2 {
    width: 100% !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Label styling for login form */
#loginForm .control-label {
    display: block;
    width: 100%;
    margin-bottom: var(--spacing-xs);
    font-weight: var(--font-weight-medium);
    text-align: right;
}

/* DevExpress controls in login form - Enhanced targeting */
#loginForm .dxeButtonEditSys_Metropolis,
#loginForm .dxeEditArea_Metropolis,
#loginForm .dxeTextBox_Metropolis,
#loginForm .dxeTextBoxSys,
#loginForm .dxeTextBox,
#loginForm .dxeRoot,
#loginForm table.dxeTextBoxSys,
#loginForm table.dxeTextBox {
    width: 100% !important;
    margin-bottom: var(--spacing-sm);
}

/* Target DevExpress textbox tables specifically */
#loginForm table[id*="txtUser"],
#loginForm table[id*="Password"] {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* DevExpress input area targeting */
#loginForm .dxeEditArea,
#loginForm .dxeEditAreaSys {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* DevExpress default width override */
#loginForm .dxeTextBoxDefaultWidthSys {
    width: 100% !important;
}

/* Login button styling */
#loginForm .btn {
    width: 100%;
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
}

/* Checkbox alignment in login form */
#loginForm .checkbox,
#loginForm .form-check {
    margin-bottom: var(--spacing-sm);
    text-align: right;
}

/* Login form responsive adjustments */
@media (max-width: 768px) {
    #loginForm {
        max-width: none;
        margin: 0;
        padding: var(--spacing-md);
    }

    .container .col-md-6 {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }
}

/* Simple login form improvements */
#PLoginStatus .form-control,
#PLoginStatus .dxeTextBox_Metropolis,
#PLoginStatus .dxeTextBoxSys,
#PLoginStatus .dxeRoot,
#PLoginStatus table.dxeTextBoxSys,
#PLoginStatus table.dxeTextBox {
    width: 100% !important;
    margin-bottom: var(--spacing-sm);
}

#PLoginStatus table {
    width: 100%;
}

#PLoginStatus table td {
    padding: var(--spacing-xs);
}

/* Card body login form adjustments */
.card-body #loginForm,
.card-body section[id*="loginForm"] {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Card-specific DevExpress control width fixes */
.card-body .dxeTextBoxSys,
.card-body .dxeTextBox,
.card-body .dxeRoot,
.card-body table.dxeTextBoxSys,
.card-body table.dxeTextBox {
    width: 100% !important;
}

/* Target specific DevExpress IDs in card */
.card-body table[id*="txtUser"],
.card-body table[id*="Password"],
.card-body table[id*="RememberMe"] {
    width: 100% !important;
}

/* Button width in card */
.card-body .btn {
    width: 100% !important;
    margin-top: var(--spacing-sm);
}

/* =============================================================================
   Component Styles
   ============================================================================= */

/* DevExpress TreeView hiding */
.RootNodeMenu {
    display: none;
}

/* Enhanced Card Components with modern styling */
.card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--bs-border-color);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-strong);
    border-color: var(--bs-primary-border-subtle);
}

.card-header {
    font-family: var(--font-primary) !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: 1px solid var(--bs-border-color-translucent);
    font-weight: var(--font-weight-semibold);
    background: linear-gradient(135deg, var(--bs-light), var(--bs-gray-100));
    padding: var(--spacing-lg);
}

/* Ensure primary background headers have strong contrast */
.card-header.bg-primary {
    background: linear-gradient(135deg, #0d6efd, #0056b3) !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-header.bg-primary h1,
.card-header.bg-primary h2,
.card-header.bg-primary h3,
.card-header.bg-primary h4,
.card-header.bg-primary h5,
.card-header.bg-primary h6 {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    margin-bottom: 0;
}

.card-header.bg-primary .card-title {
    color: #ffffff !important;
    font-weight: var(--font-weight-semibold);
}

.card-header.bg-primary i {
    color: #ffffff !important;
    opacity: 0.9;
}

/* Additional contrast improvements for form headers */
.card-header.bg-primary {
    min-height: 60px;
    display: flex;
    align-items: center;
}

.card-header.bg-primary .bi {
    font-size: 1.2rem;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

/* Enhanced text contrast for card headers */
.card-header.bg-primary,
.card-header.bg-primary * {
    color: #ffffff !important;
}

/* Fallback for any missed elements */
.bg-primary .card-title,
.bg-primary h1, .bg-primary h2, .bg-primary h3, 
.bg-primary h4, .bg-primary h5, .bg-primary h6,
.bg-primary span, .bg-primary i, .bg-primary small {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    background-color: var(--bs-gray-50);
    border-top: 1px solid var(--bs-border-color-translucent);
    padding: var(--spacing-md) var(--spacing-lg);
}

/* Navigation Bar Enhancements */
.navbar {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-medium);
    transition: var(--transition-normal);
}

.navbar-brand {
    font-family: var(--font-primary) !important;
    font-weight: var(--font-weight-semibold);
    font-size: 1.25rem;
    transition: var(--transition-fast);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

/* Improved navbar toggler */
.navbar-toggler {
    border: none;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.navbar-toggler:hover,
.navbar-toggler:focus {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* Modern Navigation Links */
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: var(--font-weight-medium);
    padding: var(--spacing-sm) var(--spacing-md);
    margin: 0 var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.navbar-dark .navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-fast);
    z-index: -1;
}

.navbar-dark .navbar-nav .nav-link:hover::before,
.navbar-dark .navbar-nav .nav-link:focus::before {
    transform: scaleX(1);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: #ffffff !important;
    transform: translateY(-1px);
}

.navbar-dark .navbar-nav .nav-link.active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.2);
    font-weight: var(--font-weight-semibold);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Fix any regular links in navbar */
.navbar-dark a:not(.nav-link):not(.btn) {
    color: rgba(255, 255, 255, 0.95) !important;
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    margin: 0 0.25rem;
}

    .navbar-dark a:not(.nav-link):not(.btn):hover {
        color: #ffffff !important;
        background-color: rgba(255, 255, 255, 0.1);
        text-decoration: none;
    }

/* Ensure navbar list items without proper nav-item class still look good */
.navbar-dark .navbar-nav li > a:not(.nav-link) {
    color: rgba(255, 255, 255, 0.95) !important;
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

    .navbar-dark .navbar-nav li > a:not(.nav-link):hover {
        color: #ffffff !important;
        background-color: rgba(255, 255, 255, 0.1);
        transform: translateY(-1px);
    }

.social-links img {
    width: 24px;
    height: 24px;
    margin: 0 4px;
    transition: transform 0.2s ease;
}

    .social-links img:hover {
        transform: scale(1.1);
    }

/* DevExpress TreeView improvements */
.dxtvControl_Metropolis {
    border-radius: 0.5rem;
    border: 1px none #dee2e6;
    background: white;
}

.dxtv-nd {
    padding: 8px 12px;
    border-radius: 4px;
    margin: 2px 0;
    transition: all 0.2s ease;
}

    .dxtv-nd:hover {
        background-color: #e9ecef;
    }

.dxtv-ndTxt {
    font-family: var(--font-primary) !important;
    font-size: 14px;
    font-weight: var(--font-weight-medium);
}

/* =============================================================================
   DevExpress Data Visualization Components
   ============================================================================= */

/* DevExpress GridView Enhancements */
.dxgvControl_Metropolis {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--bs-border-color);
}

.dxgvHeader_Metropolis {
    background: linear-gradient(135deg, var(--bs-primary), #0056b3) !important;
    color: white !important;
    font-family: var(--font-primary) !important;
    font-weight: var(--font-weight-semibold) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.dxgvHeaderCell_Metropolis {
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: var(--spacing-md) !important;
}

/* DevExpress GridView Row Styling for Data Analysis */
.dxgvDataRow_Metropolis {
    font-family: var(--font-primary) !important;
    transition: background-color var(--transition-fast);
}

.dxgvDataRow_Metropolis:hover {
    background-color: var(--bg-data-primary) !important;
}

/* Level-based Row Colors */
.dxgv-row-level-5 {
    background-color: var(--color-level-5-light) !important;
    border-left: 3px solid var(--color-level-5);
}

.dxgv-row-level-4 {
    background-color: var(--color-level-4-light) !important;
    border-left: 3px solid var(--color-level-4);
}

.dxgv-row-level-3 {
    background-color: var(--color-level-3-light) !important;
    border-left: 3px solid var(--color-level-3);
}

.dxgv-row-level-2 {
    background-color: var(--color-level-2-light) !important;
    border-left: 3px solid var(--color-level-2);
}

.dxgv-row-level-1 {
    background-color: var(--color-level-1-light) !important;
    border-left: 3px solid var(--color-level-1);
}

.dxgv-row-level-0 {
    background-color: var(--color-level-0-light) !important;
    border-left: 3px solid var(--color-level-0);
}

/* Semantic aliases for DevExpress rows */
.dxgv-row-optimal { background-color: var(--color-level-5-light) !important; border-left: 3px solid var(--color-optimal); }
.dxgv-row-high { background-color: var(--color-level-4-light) !important; border-left: 3px solid var(--color-high); }
.dxgv-row-medium { background-color: var(--color-level-3-light) !important; border-left: 3px solid var(--color-medium); }
.dxgv-row-low { background-color: var(--color-level-2-light) !important; border-left: 3px solid var(--color-low); }
.dxgv-row-minimal { background-color: var(--color-level-1-light) !important; border-left: 3px solid var(--color-minimal); }
.dxgv-row-critical { background-color: var(--color-level-0-light) !important; border-left: 3px solid var(--color-critical); }

/* DevExpress ComboBox and Form Controls */
.dxeButtonEditSys_Metropolis,
.dxeEditArea_Metropolis,
.dxeTextBox_Metropolis {
    font-family: var(--font-primary) !important;
    border-radius: var(--radius-sm) !important;
    border-color: var(--bs-border-color) !important;
    transition: var(--transition-fast);
}

.dxeButtonEditSys_Metropolis:focus,
.dxeEditArea_Metropolis:focus,
.dxeTextBox_Metropolis:focus {
    border-color: var(--bs-primary) !important;
    box-shadow: var(--shadow-glow) !important;
}

/* DevExpress Chart Styling */
.dxc-chart {
    font-family: var(--font-primary) !important;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.dxc-title {
    font-family: var(--font-primary) !important;
    font-weight: var(--font-weight-semibold) !important;
    color: var(--bs-dark) !important;
}

.dxc-legend {
    font-family: var(--font-primary) !important;
}

/* DevExpress Report Styling */
.dxrpControl_Metropolis {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-medium);
}

.dxrp-toolbar {
    background: linear-gradient(135deg, var(--bs-light), var(--bs-gray-100)) !important;
    border-bottom: 1px solid var(--bs-border-color);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* DevExpress Button Enhancements */
.dxbButton_Metropolis {
    font-family: var(--font-primary) !important;
    border-radius: var(--radius-sm) !important;
    transition: var(--transition-fast) !important;
    font-weight: var(--font-weight-medium) !important;
}

.dxbButton_Metropolis:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

/* Status Level Indicator Styling for DevExpress */
.dx-status-level-5 {
    color: var(--color-level-5) !important;
    font-weight: var(--font-weight-semibold) !important;
}

.dx-status-level-4 {
    color: var(--color-level-4) !important;
    font-weight: var(--font-weight-semibold) !important;
}

.dx-status-level-3 {
    color: var(--color-level-3) !important;
    font-weight: var(--font-weight-semibold) !important;
}

.dx-status-level-2 {
    color: var(--color-level-2) !important;
    font-weight: var(--font-weight-semibold) !important;
}

.dx-status-level-1 {
    color: var(--color-level-1) !important;
    font-weight: var(--font-weight-semibold) !important;
}

.dx-status-level-0 {
    color: var(--color-level-0) !important;
    font-weight: var(--font-weight-semibold) !important;
}

/* Semantic aliases for DevExpress status indicators */
.dx-status-optimal { color: var(--color-optimal) !important; font-weight: var(--font-weight-semibold) !important; }
.dx-status-high { color: var(--color-high) !important; font-weight: var(--font-weight-semibold) !important; }
.dx-status-medium { color: var(--color-medium) !important; font-weight: var(--font-weight-semibold) !important; }
.dx-status-low { color: var(--color-low) !important; font-weight: var(--font-weight-semibold) !important; }
.dx-status-minimal { color: var(--color-minimal) !important; font-weight: var(--font-weight-semibold) !important; }
.dx-status-critical { color: var(--color-critical) !important; font-weight: var(--font-weight-semibold) !important; }

/* FlexSlider improvements */
.flexslider {
    border-radius: 0.75rem;
    overflow: hidden;
    margin: 0;
    box-shadow: none;
}

    .flexslider .slides > li {
        display: none;
        -webkit-backface-visibility: hidden;
    }

    .flexslider .slides img {
        width: 100%;
        display: block;
        border-radius: 0.75rem;
    }

/* =============================================================================
   Site Header Specific Styles
   ============================================================================= */

.site-header {
    border-bottom: 1px solid var(--bs-border-color);
    background: linear-gradient(135deg, var(--bs-light), var(--bs-gray-100));
    box-shadow: var(--shadow-soft);
}

.site-logo {
    max-height: 80px;
    width: auto;
    transition: var(--transition-normal);
    filter: drop-shadow(var(--shadow-soft));
}

.site-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(var(--shadow-medium));
}

.site-title {
    font-family: var(--font-primary) !important;
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm) !important;
}

.site-description {
    font-family: var(--font-primary) !important;
    font-size: clamp(0.875rem, 2vw, 1rem);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-relaxed);
    color: var(--bs-secondary) !important;
}

/* =============================================================================
   Alert and Message Components
   ============================================================================= */

.alerts-container {
    position: relative;
    z-index: 10;
}

.alerts-container .alert {
    font-family: var(--font-primary) !important;
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-soft);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.alerts-container .alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
    opacity: 0.6;
}

/* Form enhancements */
.form-control,
.form-select {
    font-family: var(--font-primary) !important;
    border-radius: var(--radius-sm);
    border: 2px solid var(--bs-border-color);
    transition: var(--transition-fast);
    font-weight: var(--font-weight-regular);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

/* Button enhancements */
.btn {
    font-family: var(--font-primary) !important;
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-medium);
    padding: var(--spacing-sm) var(--spacing-md);
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn:active {
    transform: translateY(0);
}

/* =============================================================================
   Responsive Design
   ============================================================================= */

@media (max-width: 768px) {
    :root {
        --navbar-height: 56px;
        --header-height: var(--navbar-height);
    }
    
    body {
        padding-top: var(--header-height);
    }
    
    .site-header {
        padding: var(--spacing-md) 0 !important;
    }
    
    .site-title {
        font-size: 1.5rem !important;
        text-align: center;
    }
    
    .site-description {
        font-size: 0.875rem !important;
        text-align: center;
    }
    
    .card-header h4 {
        font-size: 1.1rem;
    }
    
    .navbar-nav .nav-link {
        padding: var(--spacing-md) var(--spacing-lg);
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .social-links-container {
        justify-content: center;
        margin-top: var(--spacing-md);
    }
}

@media (max-width: 576px) {
    :root {
        --navbar-height: 56px;
        --header-height: var(--navbar-height);
        --spacing-md: 0.75rem;
        --spacing-lg: 1rem;
    }
    
    .container {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }
    
    .site-header .row {
        text-align: center;
    }
    
    .site-header .col-lg-2,
    .site-header .col-lg-6,
    .site-header .col-lg-4 {
        margin-bottom: var(--spacing-sm);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border-width: 2px;
    }
    
    .btn {
        border-width: 2px;
    }
    
    .form-control,
    .form-select {
        border-width: 2px;
    }
    
    /* Enhanced data visualization accessibility in high contrast mode */
    .progress-status {
        border: 2px solid currentColor;
    }
    
    .stat-card {
        border-width: 3px;
        box-shadow: none;
    }
    
    .chart-container {
        border-width: 2px;
    }
    
    /* Status badges with stronger contrast */
    .badge-status {
        border: 2px solid currentColor;
        font-weight: var(--font-weight-bold);
    }
    
    /* DevExpress components high contrast */
    .dxgvControl_Metropolis {
        border-width: 2px;
    }
    
    .dxgvHeader_Metropolis {
        border-bottom-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    :root {
        --transition-fast: 0s;
        --transition-normal: 0s;
        --transition-slow: 0s;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =============================================================================
   Utility Classes
   ============================================================================= */

.text-shadow {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.hover-lift {
    transition: var(--transition-fast);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.glass-effect {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* =============================================================================
   Data Visualization Components
   ============================================================================= */

/* Enhanced Progress Bars with Status Level Themes */
.progress-status {
    height: 1.5rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-status .progress-bar {
    transition: width 0.6s ease, background-color var(--transition-normal);
    font-family: var(--font-primary);
    font-weight: var(--font-weight-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

/* Level-based Progress Colors */
.progress-bar-level-5 {
    background-color: var(--color-level-5) !important;
}

.progress-bar-level-4 {
    background-color: var(--color-level-4) !important;
}

.progress-bar-level-3 {
    background-color: var(--color-level-3) !important;
}

.progress-bar-level-2 {
    background-color: var(--color-level-2) !important;
    color: #000 !important;
}

.progress-bar-level-1 {
    background-color: var(--color-level-1) !important;
}

.progress-bar-level-0 {
    background-color: var(--color-level-0) !important;
}

/* Semantic aliases for easier use */
.progress-bar-optimal { background-color: var(--color-optimal) !important; }
.progress-bar-high { background-color: var(--color-high) !important; }
.progress-bar-medium { background-color: var(--color-medium) !important; }
.progress-bar-low { background-color: var(--color-low) !important; color: #000 !important; }
.progress-bar-minimal { background-color: var(--color-minimal) !important; }
.progress-bar-critical { background-color: var(--color-critical) !important; }

/* Statistical Cards */
.stat-card {
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    transition: var(--transition-normal);
    border: 1px solid var(--bs-border-color);
    background: white;
    box-shadow: var(--shadow-soft);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-strong);
}

.stat-card-level-5 {
    border-left: 4px solid var(--color-level-5);
    background: linear-gradient(135deg, white, var(--color-level-5-light));
}

.stat-card-level-4 {
    border-left: 4px solid var(--color-level-4);
    background: linear-gradient(135deg, white, var(--color-level-4-light));
}

.stat-card-level-3 {
    border-left: 4px solid var(--color-level-3);
    background: linear-gradient(135deg, white, var(--color-level-3-light));
}

.stat-card-level-2 {
    border-left: 4px solid var(--color-level-2);
    background: linear-gradient(135deg, white, var(--color-level-2-light));
}

.stat-card-level-1 {
    border-left: 4px solid var(--color-level-1);
    background: linear-gradient(135deg, white, var(--color-level-1-light));
}

.stat-card-level-0 {
    border-left: 4px solid var(--color-level-0);
    background: linear-gradient(135deg, white, var(--color-level-0-light));
}

/* Semantic aliases for statistical cards */
.stat-card-optimal { border-left: 4px solid var(--color-optimal); background: linear-gradient(135deg, white, var(--color-level-5-light)); }
.stat-card-high { border-left: 4px solid var(--color-high); background: linear-gradient(135deg, white, var(--color-level-4-light)); }
.stat-card-medium { border-left: 4px solid var(--color-medium); background: linear-gradient(135deg, white, var(--color-level-3-light)); }
.stat-card-low { border-left: 4px solid var(--color-low); background: linear-gradient(135deg, white, var(--color-level-2-light)); }
.stat-card-minimal { border-left: 4px solid var(--color-minimal); background: linear-gradient(135deg, white, var(--color-level-1-light)); }
.stat-card-critical { border-left: 4px solid var(--color-critical); background: linear-gradient(135deg, white, var(--color-level-0-light)); }

/* Statistical Numbers */
.stat-number {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    font-family: var(--font-primary);
    line-height: 1;
    margin-bottom: var(--spacing-sm);
}

.stat-label {
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: var(--bs-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-primary);
}

.stat-change {
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    margin-top: var(--spacing-xs);
}

.stat-change.positive {
    color: var(--color-excellent);
}

.stat-change.negative {
    color: var(--color-critical);
}

/* Chart Containers */
.chart-container {
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    background: white;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--bs-border-color);
}

.chart-title {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
    color: var(--bs-dark);
    text-align: center;
}

.chart-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.legend-item {
    display: flex;
    align-items: center;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
}

.legend-color {
    width: 1rem;
    height: 1rem;
    border-radius: var(--radius-sm);
    margin-left: var(--spacing-xs);
    margin-right: var(--spacing-xs);
}

/* Category Color Classes */
.category-1 { color: var(--category-1); }
.category-2 { color: var(--category-2); }
.category-3 { color: var(--category-3); }
.category-4 { color: var(--category-4); }
.category-5 { color: var(--category-5); }
.category-6 { color: var(--category-6); }
.category-7 { color: var(--category-7); }
.category-8 { color: var(--category-8); }

/* Background variants */
.bg-category-1 { background-color: var(--category-1); color: white; }
.bg-category-2 { background-color: var(--category-2); color: white; }
.bg-category-3 { background-color: var(--category-3); color: white; }
.bg-category-4 { background-color: var(--category-4); color: white; }
.bg-category-5 { background-color: var(--category-5); color: white; }
.bg-category-6 { background-color: var(--category-6); color: white; }
.bg-category-7 { background-color: var(--category-7); color: white; }
.bg-category-8 { background-color: var(--category-8); color: white; }

/* Module-specific aliases */
.module-primary { color: var(--module-primary); }
.module-secondary { color: var(--module-secondary); }
.module-tertiary { color: var(--module-tertiary); }
.module-quaternary { color: var(--module-quaternary); }
.module-creative { color: var(--module-creative); }
.module-logistics { color: var(--module-logistics); }
.module-technical { color: var(--module-technical); }
.module-compliance { color: var(--module-compliance); }

/* Module background variants */
.bg-module-primary { background-color: var(--module-primary); color: white; }
.bg-module-secondary { background-color: var(--module-secondary); color: white; }
.bg-module-tertiary { background-color: var(--module-tertiary); color: white; }
.bg-module-quaternary { background-color: var(--module-quaternary); color: white; }
.bg-module-creative { background-color: var(--module-creative); color: white; }
.bg-module-logistics { background-color: var(--module-logistics); color: white; }
.bg-module-technical { background-color: var(--module-technical); color: white; }
.bg-module-compliance { background-color: var(--module-compliance); color: white; }

/* Status Badges */
.badge-status {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-medium);
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-level-5 {
    background-color: var(--color-level-5);
    color: white;
}

.badge-level-4 {
    background-color: var(--color-level-4);
    color: white;
}

.badge-level-3 {
    background-color: var(--color-level-3);
    color: white;
}

.badge-level-2 {
    background-color: var(--color-level-2);
    color: #000;
}

.badge-level-1 {
    background-color: var(--color-level-1);
    color: white;
}

.badge-level-0 {
    background-color: var(--color-level-0);
    color: white;
}

/* Semantic badge aliases */
.badge-optimal { background-color: var(--color-optimal); color: white; }
.badge-high { background-color: var(--color-high); color: white; }
.badge-medium { background-color: var(--color-medium); color: white; }
.badge-low { background-color: var(--color-low); color: #000; }
.badge-minimal { background-color: var(--color-minimal); color: white; }
.badge-critical { background-color: var(--color-critical); color: white; }

/* Loading states */
.loading {
    pointer-events: none;
    opacity: 0.6;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =============================================================================
   Modern CSS Grid Layouts
   ============================================================================= */

.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.grid-dashboard {
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-areas: 
        "sidebar main"
        "sidebar main";
    gap: var(--spacing-lg);
    min-height: calc(100vh - var(--header-height));
}

.grid-sidebar {
    grid-area: sidebar;
}

.grid-main {
    grid-area: main;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.grid-hero {
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: center;
    gap: var(--spacing-xl);
}

@media (max-width: 768px) {
    .grid-dashboard {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "sidebar"
            "main";
    }
    
    .grid-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* =============================================================================
   Dark Mode Support (disabled - use [data-bs-theme="dark"] for manual toggle)
   ============================================================================= */

[data-bs-theme="dark"] {
    --bs-body-bg: #121212;
    --bs-body-color: #e0e0e0;
    --bs-gray-100: #1e1e1e;
    --bs-gray-200: #2d2d2d;
    --bs-gray-300: #404040;
    --bs-light: #1e1e1e;
    --bs-dark: #e0e0e0;
    --bs-border-color: #404040;
    
    /* Manual dark mode level colors */
    --color-level-5: #22c55e;
    --color-level-5-light: rgba(34, 197, 94, 0.2);
    --color-level-5-dark: #16a34a;
    --color-level-4: #06b6d4;
    --color-level-4-light: rgba(6, 182, 212, 0.2);
    --color-level-4-dark: #0891b2;
    --color-level-3: #38bdf8;
    --color-level-3-light: rgba(56, 189, 248, 0.2);
    --color-level-3-dark: #0284c7;
    --color-level-2: #facc15;
    --color-level-2-light: rgba(250, 204, 21, 0.2);
    --color-level-2-dark: #eab308;
    --color-level-1: #fb923c;
    --color-level-1-light: rgba(251, 146, 60, 0.2);
    --color-level-1-dark: #f97316;
    --color-level-0: #f87171;
    --color-level-0-light: rgba(248, 113, 113, 0.2);
    --color-level-0-dark: #ef4444;
    
    /* Updated chart colors for manual dark mode */
    --chart-color-2: #22c55e;
    --chart-color-3: #fb923c;
    --chart-color-4: #f87171;
    --chart-color-6: #06b6d4;
    --chart-color-7: #facc15;
    
    /* Dark mode background variations */
    --bg-data-primary: rgba(59, 130, 246, 0.15);
    --bg-data-success: rgba(34, 197, 94, 0.15);
    --bg-data-warning: rgba(250, 204, 21, 0.15);
    --bg-data-danger: rgba(248, 113, 113, 0.15);
    --bg-data-info: rgba(56, 189, 248, 0.15);
}

/* =============================================================================
   Modern Form Enhancements
   ============================================================================= */

.form-floating {
    position: relative;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

.form-control:invalid {
    border-color: var(--bs-danger);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control:valid {
    border-color: var(--bs-success);
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--bs-danger);
    animation: slideIn var(--transition-fast);
}

.valid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--bs-success);
    animation: slideIn var(--transition-fast);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom checkbox and radio styles */
.form-check-input {
    width: 1.25em;
    height: 1.25em;
    margin-top: 0.125em;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    box-shadow: var(--shadow-glow);
}

/* =============================================================================
   Advanced Image Optimizations
   ============================================================================= */

.img-modern {
    height: auto;
    max-width: 100%;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
    object-fit: cover;
    loading: lazy;
}

.img-modern:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-medium);
}

.img-hero {
    width: 100%;
    height: clamp(300px, 50vh, 600px);
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.img-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bs-light);
    transition: var(--transition-fast);
}

.img-avatar:hover {
    transform: scale(1.1);
    border-color: var(--bs-primary);
}

/* Image lazy loading placeholders */
.img-placeholder {
    background: linear-gradient(90deg, var(--bs-gray-200) 25%, transparent 50%, var(--bs-gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Modern scrollbar styling */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--bs-primary) var(--bs-gray-200);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--bs-gray-200);
    border-radius: var(--radius-sm);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--bs-primary);
    border-radius: var(--radius-sm);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--bs-primary-dark, #0a58ca);
}

/* Animation utilities */
.animate-fade-in {
    animation: fadeIn var(--transition-normal);
}

.animate-slide-up {
    animation: slideUp var(--transition-normal);
}

.animate-bounce {
    animation: bounce 1s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -30px, 0);
    }
    70% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0,-4px,0);
    }
}

/* Modern focus ring */
.focus-ring:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* =============================================================================
   Tajawal Font Application - Ensure all elements use primary font
   ============================================================================= */

/* Typography - Apply Tajawal to all headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary) !important;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
}

/* Apply Tajawal to all text elements */
p, span, div, a, li, td, th, label, small {
    font-family: var(--font-primary) !important;
}

/* Ensure all form inputs use Tajawal */
input, textarea, select, button,
.form-control, .form-select, .btn {
    font-family: var(--font-primary) !important;
}

/* DevExpress components comprehensive font override - Enhanced for all controls */
.dx-widget, .dxtv-nd, .dxtv-ndTxt,
.dxtvControl_Metropolis,
.dxeButtonEditSys_Metropolis,
.dxeEditArea_Metropolis,
.dxeTextBox_Metropolis,
.dxgvControl_Metropolis,
.dxgvHeader_Metropolis,
.dxgvHeaderCell_Metropolis,
.dxgvDataRow_Metropolis,
.dxgvDataCell_Metropolis,
.dxbButton_Metropolis,
.dxc-chart,
.dxc-title,
.dxc-legend,
.dxrpControl_Metropolis,
.dxeBase_Metropolis,
.dxeEditArea_Metropolis,
.dxeControl_Metropolis {
    font-family: var(--font-primary) !important;
    -webkit-font-feature-settings: "kern" 1, "liga" 1 !important;
    font-feature-settings: "kern" 1, "liga" 1 !important;
    text-rendering: optimizeLegibility !important;
}

/* Navbar elements */
.navbar-brand, .nav-link, .dropdown-item {
    font-family: var(--font-primary) !important;
}

/* Card components */
.card-header, .card-body, .card-footer,
.card-title, .card-text {
    font-family: var(--font-primary) !important;
}

/* Alert messages */
.alert, .badge, .breadcrumb {
    font-family: var(--font-primary) !important;
}

/* Table elements */
table, thead, tbody, tfoot, tr {
    font-family: var(--font-primary) !important;
}

/* Modal components */
.modal-header, .modal-body, .modal-footer,
.modal-title {
    font-family: var(--font-primary) !important;
}

/* Placeholder text styling */
::placeholder {
    font-family: var(--font-primary) !important;
    font-weight: var(--font-weight-light);
    opacity: 0.7;
}

/* Site-specific elements */
.site-title, .site-description {
    font-family: var(--font-primary) !important;
}

/* Override Bootstrap default font */
.text-body {
    font-family: var(--font-primary) !important;
}

/* Ensure all dynamically loaded content uses the unified Arabic font stack */
* {
    font-family: inherit;
}

html {
    font-family: var(--font-primary);
    height: 100%;
}

/* Enhanced Arabic text rendering optimizations */
[lang="ar"], [dir="rtl"], .arabic-text {
    font-family: var(--font-primary) !important;
    text-rendering: optimizeLegibility !important;
    -webkit-font-feature-settings: "kern" 1, "liga" 1, "calt" 1 !important;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Specific Arabic typography improvements */
.arabic-content {
    line-height: 1.6 !important;
    letter-spacing: 0.01em !important;
}

/* DevExpress Arabic text in data grids */
.dxgvDataRow_Metropolis [lang="ar"],
.dxgvDataRow_Metropolis .arabic-text {
    font-family: var(--font-primary) !important;
    font-weight: var(--font-weight-regular) !important;
    text-align: right !important;
}

/* =============================================================================
   Footer Specific Styles
   ============================================================================= */

.site-footer {
    background: linear-gradient(135deg, #212529, #343a40) !important;
    color: #f8f9fa !important;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    font-family: var(--font-primary) !important;
}

.site-footer .copyright-info {
    font-size: 0.95rem;
    font-weight: var(--font-weight-regular);
}

.site-footer .fw-semibold {
    font-weight: var(--font-weight-semibold) !important;
}

.site-footer small {
    font-size: 0.875rem;
    font-weight: var(--font-weight-light);
}

.site-footer .text-primary {
    color: #0dcaf0 !important;
}

.site-footer .border-secondary {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Footer icon styling */
.site-footer .bi {
    font-size: 1.1rem;
    vertical-align: middle;
}

/* Footer responsive adjustments */
@media (max-width: 768px) {
    .site-footer {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    .site-footer .copyright-info {
        justify-content: center !important;
        margin-bottom: 0.5rem;
    }
    
    .site-footer .row.gy-3 > div {
        margin-bottom: 0.5rem;
    }
}

/* Ensure minimum content height */
.container.my-4 {
    min-height: calc(100vh - var(--header-height) - 150px);
}

/* =============================================================================
   UNIVERSAL DATA VISUALIZATION COLOR USAGE GUIDE
   ============================================================================= 
   
   This section documents the comprehensive data visualization color palette
   for the ASAS Global System - applicable to any module or business domain.
   
   UNIVERSAL STATUS/QUALITY LEVEL COLORS:
   --color-level-5: #198754      - Optimal/Excellent (90-100% ranges)
   --color-level-4: #20c997      - High/Good (80-89% ranges)
   --color-level-3: #0dcaf0      - Medium/Satisfactory (70-79% ranges)
   --color-level-2: #ffc107      - Low/Needs attention (60-69% ranges)
   --color-level-1: #fd7e14      - Minimal/Poor (50-59% ranges)
   --color-level-0: #dc3545      - Critical/Failed (below 50% ranges)
   
   CHART SERIES COLORS (12-color accessibility-friendly palette):
   --chart-color-1: #0d6efd (Primary Blue)
   --chart-color-2: #198754 (Success Green)
   --chart-color-3: #fd7e14 (Warning Orange)
   --chart-color-4: #dc3545 (Danger Red)
   --chart-color-5: #6f42c1 (Purple)
   --chart-color-6: #20c997 (Teal)
   --chart-color-7: #ffc107 (Yellow)
   --chart-color-8: #6c757d (Gray)
   --chart-color-9: #e83e8c (Pink)
   --chart-color-10: #17a2b8 (Info Blue)
   --chart-color-11: #28a745 (Alternative Green)
   --chart-color-12: #007bff (Light Blue)
   
   CATEGORY/MODULE COLORS:
   --category-1: #6f42c1         - Primary (Finance, Accounting, Core)
   --category-2: #198754         - Secondary (Operations, Production)
   --category-3: #fd7e14         - Tertiary (HR, Human Resources)
   --category-4: #dc3545         - Quaternary (Sales, Marketing)
   --category-5: #e83e8c         - Creative (Design, Creative, R&D)
   --category-6: #20c997         - Logistics (Supply Chain, Logistics)
   --category-7: #6c757d         - Technical (IT, Support, Technical)
   --category-8: #0dcaf0         - Compliance (Legal, Quality, Compliance)
   
   USAGE EXAMPLES:
   
   1. KPI Statistical Cards:
   <div class="stat-card stat-card-level-5">
       <div class="stat-number">95%</div>
       <div class="stat-label">Success Rate</div>
   </div>
   
   2. Progress Indicators:
   <div class="progress progress-status">
       <div class="progress-bar progress-bar-level-4" style="width: 85%">85%</div>
   </div>
   
   3. Status Badges:
   <span class="badge badge-status badge-optimal">Optimal</span>
   
   4. Module Color Classes:
   <div class="bg-category-1 p-3">Finance Department</div>
   <div class="bg-module-primary p-3">Primary Module</div>
   
   5. DevExpress GridView Row Highlighting:
   Add class "dxgv-row-level-5" or "dxgv-row-optimal" for high-performing rows
   
   6. Business Chart Containers:
   <div class="chart-container">
       <h3 class="chart-title">Sales Performance Overview</h3>
       <!-- Chart content -->
   </div>
   
   SEMANTIC ALIASES AVAILABLE:
   Level-based: .progress-bar-level-5, .stat-card-level-4, .badge-level-3
   Semantic: .progress-bar-optimal, .stat-card-high, .badge-medium
   Module: .bg-module-primary, .module-technical, .bg-category-1
   
   BUSINESS USE CASES:
   - Financial KPIs and metrics
   - Sales performance tracking  
   - Quality assurance levels
   - Project completion status
   - Employee performance ratings
   - System health monitoring
   - Customer satisfaction scores
   - Inventory status levels
   
   ACCESSIBILITY FEATURES:
   - All colors meet WCAG 2.1 AA contrast requirements
   - Color-blind friendly palette selection
   - Dark mode compatible variations
   - High contrast mode support
   - Universal semantic meaning across cultures and domains
   
   DARK MODE SUPPORT:
   Colors automatically adjust for better visibility in dark environments
   using CSS custom properties and media queries.
   
   ============================================================================= */
