@font-face {
    font-family: 'Bridgestone';
    src: url('BridgestoneType-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Bridgestone';
    src: url('BridgestoneType-Italic.otf') format('opentype');
    font-weight: 400;
    font-style: italic;
}

:root {
    --font-sans: 'Bridgestone', ui-sans-serif, system-ui, sans-serif !important;
}

/* Force Bridgestone on all elements, especially grids and third-party components */
* {
    font-family: inherit;
}

body,
html,
button,
input,
select,
textarea,
.dx-widget,
.dx-texteditor,
.dx-datagrid,
.dx-data-row,
.dx-header-row,
.dx-column-indicators,
.dx-datagrid-headers,
.dx-datagrid-rowsview,
.fluent-grid,
.font-inter,
.font-bridgestone {
    font-family: 'Bridgestone', ui-sans-serif, system-ui, sans-serif !important;
}

/* Ensuring table headers and cells specifically follow the font */
th,
td,
.table,
.grid,
.dynamic-grid-container {
    font-family: 'Bridgestone', ui-sans-serif, system-ui, sans-serif !important;
}

/* Custom Back Button Theme */
.btn-back-custom {
    background-color: #f1f5f9 !important;
    /* slate-100 */
    color: #0f172a !important;
    border: 1px solid #334155 !important;
    /* slate-700 */
}

.btn-back-custom i {
    color: #0f172a !important;
}

.btn-back-custom:hover {
    background-color: #e2e8f0;
    /* slate-200 */
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dark .btn-back-custom {
    background-color: #1e293b !important;
    /* slate-800 */
    color: #f8fafc !important;
    border: 1px solid #94a3b8 !important;
    /* slate-400 */
}

.dark .btn-back-custom i {
    color: #f8fafc !important;
}

.dark .btn-back-custom:hover {
    background-color: #334155;
    /* slate-700 */
}

/* ========================================
   Custom Export Button Style 
   ======================================== */
body .dx-datagrid .dx-datagrid-export-button.dx-button,
body .fluent-grid .dx-datagrid-export-button.dx-button {
    background-color: rgba(34, 139, 34, 0.1) !important;
    border-radius: 6px !important;
    border: 1px solid rgba(34, 139, 34, 0.2) !important;
    padding: 0 12px 0 8px !important;
    margin-right: 12px !important;
    cursor: pointer;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
}

/* Hover Styles - Premium Green Effect */
body .dx-datagrid .dx-datagrid-export-button.dx-button:hover,
body .fluent-grid .dx-datagrid-export-button.dx-button:hover {
    background-color: #1a7f37 !important;
    border-color: #1a7f37 !important;
}

body .dx-datagrid .dx-datagrid-export-button.dx-button:hover .dx-button-content::after,
body .fluent-grid .dx-datagrid-export-button.dx-button:hover .dx-button-content::after,
body .dx-datagrid .dx-datagrid-export-button.dx-button:hover .dx-icon,
body .fluent-grid .dx-datagrid-export-button.dx-button:hover .dx-icon {
    color: #ffffff !important;
}

body .dx-datagrid .dx-datagrid-export-button.dx-button .dx-button-content,
body .fluent-grid .dx-datagrid-export-button.dx-button .dx-button-content {
    padding: 0 !important;
    margin: 0 !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}

/* "EXPORT" Text Alignment */
body .dx-datagrid .dx-datagrid-export-button.dx-button .dx-button-content::after,
body .fluent-grid .dx-datagrid-export-button.dx-button .dx-button-content::after {
    content: "EXPORT" !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #1a7f37 !important;
    text-transform: uppercase !important;
    display: inline-flex !important;
    align-items: center !important;
    height: 100% !important;
    transition: color 0.3s ease !important;
}

/* Icon Alignment */
body .dx-datagrid .dx-datagrid-export-button.dx-button .dx-icon,
body .fluent-grid .dx-datagrid-export-button.dx-button .dx-icon {
    color: #1a7f37 !important;
    font-size: 16px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    transition: color 0.3s ease !important;
}

/* ========================================
   Bridgestone Theme Colors Override
   ======================================== */
:root {
    --primary: #EE2737 !important;
    --primary-foreground: #ffffff !important;
    --color-primary: #EE2737 !important;
    --color-primary-foreground: #ffffff !important;
    --ring: #EE2737 !important;
    --color-ring: #EE2737 !important;

    /* Override all blue shades to premium reds and neutral greys */
    --color-blue-50: #fef2f2 !important;   /* Soft red-grey tint */
    --color-blue-100: #fee2e2 !important;  /* Soft light red-grey */
    --color-blue-200: #fecaca !important;  /* Soft red border */
    --color-blue-300: #fca5a5 !important;
    --color-blue-500: #EE2737 !important;  /* Bridgestone Red */
    --color-blue-600: #E31B23 !important;  /* Primary Action Red */
    --color-blue-700: #b91c1c !important;  /* Hover Red */
    --color-blue-800: #991b1b !important;
    --color-blue-950: #450a0a !important;

    /* Override all green shades (success) to neutral greys / soft reds to enforce the theme strictly */
    --color-green-50: #fafafa !important;
    --color-green-100: #f5f5f5 !important;
    --color-green-200: #e5e5e5 !important;
    --color-green-500: #737373 !important;  /* Medium grey for neutral successes */
    --color-green-600: #525252 !important;
    --color-green-700: #404040 !important;
    --color-green-800: #171717 !important;
    --color-green-950: #0a0a0a !important;
    
    /* Override all yellow/amber shades (warning/pending) to neutral light/medium greys */
    --color-yellow-50: #fafafa !important;
    --color-yellow-100: #f5f5f5 !important;
    --color-yellow-200: #e5e5e5 !important;
    --color-yellow-400: #a3a3a3 !important;
    --color-yellow-500: #737373 !important;
    --color-yellow-600: #525252 !important;
    --color-yellow-700: #404040 !important;
    --color-yellow-800: #262626 !important;
    --color-yellow-950: #0a0a0a !important;
    
    --color-amber-50: #fafafa !important;
    --color-amber-100: #f5f5f5 !important;
    --color-amber-200: #e5e5e5 !important;
    --color-amber-500: #737373 !important;
    --color-amber-600: #525252 !important;
    --color-amber-700: #404040 !important;

    /* Also clean up default focus rings and text highlights */
    --tw-ring-color: #EE2737 !important;
    --tw-shadow-color: rgba(238, 39, 55, 0.05) !important;
}

.dark {
    --primary: #EE2737 !important;
    --primary-foreground: #ffffff !important;
    --color-primary: #EE2737 !important;
    --color-primary-foreground: #ffffff !important;
    --ring: #EE2737 !important;
    --color-ring: #EE2737 !important;

    /* Override all blue shades in dark mode */
    --color-blue-50: #450a0a !important;
    --color-blue-100: #7f1d1d !important;
    --color-blue-200: #991b1b !important;
    --color-blue-300: #b91c1c !important;
    --color-blue-500: #EE2737 !important;
    --color-blue-600: #E31B23 !important;
    --color-blue-700: #fca5a5 !important;
    --color-blue-800: #fecaca !important;
    --color-blue-950: #fee2e2 !important;

    /* Override green and yellow in dark mode */
    --color-green-50: #0a0a0a !important;
    --color-green-100: #171717 !important;
    --color-green-200: #262626 !important;
    --color-green-500: #a3a3a3 !important;
    --color-green-600: #d4d4d4 !important;
    --color-green-800: #f5f5f5 !important;
    --color-green-950: #fafafa !important;
    
    --color-yellow-50: #0a0a0a !important;
    --color-yellow-100: #171717 !important;
    --color-yellow-500: #a3a3a3 !important;
    --color-yellow-600: #d4d4d4 !important;
}

/* Specific component fixes for badges, overlays, and loaders */
.border-blue-500\/50, .border-green-500\/50, .border-red-500\/50 {
    border-color: rgba(238, 39, 55, 0.3) !important;
}
.bg-blue-500\/5, .bg-green-500\/5, .bg-red-500\/5, .bg-blue-500\/10, .bg-green-500\/10, .bg-red-500\/10 {
    background-color: rgba(238, 39, 55, 0.05) !important;
}
.text-blue-600, .text-green-600, .text-red-600, .text-blue-400, .text-green-400, .text-red-400 {
    color: #EE2737 !important;
}

/* ========================================
   Popups, Loaders, and Modals
   ======================================== */

/* SweetAlert Popups */
.swal2-confirm { background-color: #EE2737 !important; border-color: #EE2737 !important; }
.swal2-confirm:focus { box-shadow: 0 0 0 3px rgba(238, 39, 55, 0.5) !important; }
.swal2-icon.swal2-info, .swal2-icon.swal2-question { border-color: #EE2737 !important; color: #EE2737 !important; }

/* DevExtreme Loading Panel / Loader */
.dx-loadpanel-content .dx-loadindicator-icon .dx-loadindicator-segment,
.dx-loadindicator-icon .dx-loadindicator-segment,
.dx-datagrid .dx-loadpanel-content .dx-loadindicator-icon .dx-loadindicator-segment {
    background: #EE2737 !important;
}

/* Generic Modal Headers */
.modal-header, .kt-modal-header {
    border-bottom: 2px solid #EE2737 !important;
}

/* DevExtreme Comprehensive Grid & Component Overrides */
.dx-pager .dx-page-sizes .dx-selection,
.dx-pager .dx-pages .dx-selection {
    background-color: #EE2737 !important;
    border-color: #EE2737 !important;
    color: #ffffff !important;
}

.dx-pager .dx-page-sizes .dx-page-size:not(.dx-selection):hover,
.dx-pager .dx-pages .dx-page:not(.dx-selection):hover {
    background-color: rgba(238, 39, 55, 0.1) !important;
    color: #EE2737 !important;
}

/* DevExtreme Grid Checkboxes */
.dx-checkbox-checked .dx-checkbox-icon {
    background-color: #EE2737 !important;
    border-color: #EE2737 !important;
    color: #ffffff !important;
}

/* DevExtreme Filter Panel (Bottom of grid) */
.dx-datagrid-filter-panel .dx-icon-filter,
.dx-datagrid-filter-panel .dx-filterbuilder-text,
.dx-datagrid-filter-panel .dx-filter-panel-text,
.dx-datagrid-filter-panel .dx-filter-panel-clear-filter {
    color: #EE2737 !important;
}

.dx-datagrid-filter-panel .dx-filter-panel-clear-filter:hover {
    color: #b91c1c !important;
    text-decoration: underline !important;
}

/* Filter Builder Popup */
.dx-filterbuilder .dx-filterbuilder-action-icon,
.dx-filterbuilder .dx-filterbuilder-item-value-text {
    color: #EE2737 !important;
}

/* DevExtreme Aggressive Loader Overrides */
.dx-loadindicator-icon .dx-loadindicator-segment,
.dx-loadindicator-icon .dx-loadindicator-segment-inner,
.dx-datagrid .dx-loadpanel-content .dx-loadindicator-icon .dx-loadindicator-segment {
    background-color: #EE2737 !important;
    border-color: #EE2737 !important;
}

.dx-loadindicator-wrapper .dx-loadindicator-icon *,
.dx-loadindicator-icon svg path,
.dx-loadindicator-icon svg circle {
    stroke: #EE2737 !important;
}

.dx-loadindicator-icon {
    background-color: transparent !important;
}

/* Fix specific blue loaders if they use border colors */
.dx-loadindicator-segment {
    border-color: #EE2737 !important;
}

/* Fix the remaining blue/red mix by forcing SVG or border colors */
.dx-loadpanel-content .dx-loadindicator-segment,
.dx-loadpanel-content .dx-loadindicator-segment-inner,
.dx-loadpanel-content .dx-loadindicator-segment::after,
.dx-loadpanel-content .dx-loadindicator-segment::before {
    background-color: #EE2737 !important;
    border-color: #EE2737 !important;
}

/* ========================================
   Accordion and Layout Component Overrides
   ======================================== */

/* Override all colorful text classes used in accordions */
.text-emerald-500, .text-indigo-500, .text-purple-500, .text-blue-500, .text-amber-500, .text-orange-500, .text-red-500, .text-red-600 {
    color: #EE2737 !important;
}

/* Standardize accordion headers to neutral grey */
.header-blue, .header-green, .header-indigo, .header-purple, .header-orange, .header-red {
    background-color: #f5f5f5 !important;
    border-color: #e5e5e5 !important;
    color: #404040 !important;
}

.dark .header-blue, .dark .header-green, .dark .header-indigo, .dark .header-purple, .dark .header-orange, .dark .header-red {
    background-color: #171717 !important;
    border-color: #262626 !important;
    color: #e5e5e5 !important;
}

/* Ensure active/expanded state also uses Bridgestone styling */
.kt-accordion-item.active .header-blue,
.kt-accordion-item.active .header-green,
.kt-accordion-item.active .header-indigo,
.kt-accordion-item.active .header-purple,
.kt-accordion-item.active .header-orange,
.kt-accordion-item.active .header-red {
    border-bottom: 2px solid #EE2737 !important;
}

/* Black Popup/Modal Titles background and styling */
.modal-header, .kt-modal-header, .dx-popup-title, .editor-popup-header {
    background-color: #000000 !important;
    background: #000000 !important;
    color: #ffffff !important;
    border-bottom: 1px solid #2b2b40 !important;
}
.modal-header .modal-title, .kt-modal-header .kt-modal-title, .dx-popup-title .dx-popup-title-title, .dx-popup-title .dx-popup-title-text, .dx-popup-title h1, .dx-popup-title h2, .dx-popup-title h3, .dx-popup-title span, .editor-popup-header h5 {
    color: #ffffff !important;
}
.modal-header button, .kt-modal-header button, .dx-popup-title .dx-closebutton, .dx-popup-title .dx-closebutton .dx-icon, .editor-popup-header button {
    color: #ffffff !important;
}

/* Brand Primary Button overrides to prevent fallback to legacy blue */
.kt-btn-primary, .btn-primary {
    background-color: #EE2737 !important;
    border-color: #EE2737 !important;
    color: #ffffff !important;
}
.kt-btn-primary:hover, .btn-primary:hover,
.kt-btn-primary:focus, .btn-primary:focus,
.kt-btn-primary:active, .btn-primary:active {
    background-color: #d61e2c !important;
    border-color: #d61e2c !important;
    color: #ffffff !important;
}

/* Profile Avatar Initials Outline and Hover standardisation */
.profile-avatar-initials {
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    transition: all 0.2s ease-in-out !important;
}

.profile-avatar-initials:hover {
    border-color: #EE2737 !important; /* Dynamic highlight on hover */
    transform: scale(1.04) !important;
}

.dark .profile-avatar-initials, [data-bs-theme="dark"] .profile-avatar-initials {
    border: 1.5px solid rgba(255, 255, 255, 0.45) !important; /* Visible outline in dark mode */
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.15) !important;
}

.dark .profile-avatar-initials:hover, [data-bs-theme="dark"] .profile-avatar-initials:hover {
    border-color: #EE2737 !important; /* Bridgestone red outline on hover in dark mode */
    box-shadow: 0 0 8px rgba(238, 39, 55, 0.4) !important;
}

