/* Site wide styles to prevent MIME type error */
body {
    min-height: 100vh;
}

/* 
 * ═══════════════════════════════════════════════════════════════════════════
 * Brand Guidelines Override (Blue & Orange)
 * ═══════════════════════════════════════════════════════════════════════════ 
 */
:root, [data-bs-theme="light"], [data-bs-theme="dark"] {
    /* Primary Brand: Blue */
    --bs-primary: #155bb5 !important; 
    --kt-primary: #155bb5 !important;
    --bs-primary-active: #0c3c82 !important;
    --bs-primary-light: #ebf3fc !important;
    --bs-primary-inverse: #ffffff !important;
    --bs-primary-rgb: 21, 91, 181 !important;

    /* Secondary/Accent Brand: Orange */
    --bs-secondary: #f07b14 !important;
    --kt-secondary: #f07b14 !important;
    --bs-secondary-active: #d06509 !important;
    --bs-secondary-light: #fdf3ea !important;
    --bs-secondary-inverse: #ffffff !important;
    --bs-secondary-rgb: 240, 123, 20 !important;
    
    --bs-warning: #f07b14 !important;
    --kt-warning: #f07b14 !important;
}

/* Force Metronic Utilities */
.text-primary { color: var(--bs-primary) !important; }
.bg-primary { background-color: var(--bs-primary) !important; color: white !important; }
.border-primary { border-color: var(--bs-primary) !important; }

.text-secondary, .text-warning, .text-accent { color: var(--bs-secondary) !important; }
.bg-secondary, .bg-warning { background-color: var(--bs-secondary) !important; color: white !important; }

/* Buttons */
.btn-primary, .btn-primary:focus { 
    background-color: var(--bs-primary) !important; 
    border-color: var(--bs-primary) !important; 
    color: white !important; 
}
.btn-primary:hover, .btn-primary:active, .btn-primary.active, .show>.btn-primary.dropdown-toggle {
    background-color: var(--bs-primary-active) !important;
    border-color: var(--bs-primary-active) !important;
    color: white !important;
}

.btn-secondary, .btn-warning {
    background-color: var(--bs-secondary) !important;
    border-color: var(--bs-secondary) !important;
    color: white !important;
}
.btn-secondary:hover, .btn-secondary:active, .btn-secondary.active, .btn-warning:hover, .btn-warning:active, .btn-warning.active {
    background-color: var(--bs-secondary-active) !important;
    border-color: var(--bs-secondary-active) !important;
    color: white !important;
}

/* Outline Buttons Hover Fix */
.btn-outline.btn-outline-primary:hover, .btn-outline.btn-outline-primary:active, .btn-outline.btn-outline-primary.active {
    background-color: var(--bs-primary) !important;
    color: white !important;
}
.btn-outline.btn-outline-warning:hover, .btn-outline.btn-outline-warning:active, .btn-outline.btn-outline-warning.active {
    background-color: var(--bs-secondary) !important;
    color: white !important;
}
/* Tabs & Links */
.nav-line-tabs .nav-item .nav-link.active,
.nav-line-tabs .nav-item.show .nav-link,
.nav-line-tabs .nav-item .nav-link:hover:not(.disabled) {
    border-bottom-color: var(--bs-primary) !important;
    color: var(--bs-primary) !important;
}
a:hover { color: var(--bs-primary-active) !important; }
.menu-state-primary .menu-item.hover>.menu-link:not(.disabled):not(.active), 
.menu-state-primary .menu-item .menu-link:hover:not(.disabled):not(.active) {
    color: var(--bs-primary) !important;
}
.menu-state-primary .menu-item .menu-link.active {
    color: var(--bs-primary) !important;
    background-color: var(--bs-primary-light) !important;
}

/* 
 * ═══════════════════════════════════════════════════════════════════════════
 * Forms Styling (Brand Integration)
 * ═══════════════════════════════════════════════════════════════════════════ 
 */
 
/* Brand color for form labels */
.form-label, 
label.col-form-label {
    color: var(--bs-primary) !important;
    font-weight: 600 !important;
}

/* Subtle accent for required asterisk */
.form-label.required:after,
.required::after {
    color: var(--bs-secondary) !important;
}

/* Input Focus States (Orange Accent) */
.form-control:focus, 
.form-select:focus {
    border-color: var(--bs-secondary) !important;
    box-shadow: 0 0 0 0.25rem rgba(240, 123, 20, 0.25) !important;
}

/* Checkboxes & Switches */
.form-check-input:checked {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

/* Card Headers */
.card-header .card-title {
    color: var(--bs-primary) !important;
}
.text-hover-primary:hover {
    color: var(--bs-secondary) !important; 
}

/* 
 * ═══════════════════════════════════════════════════════════════════════════
 * DataTables & Native Tables Branding
 * ═══════════════════════════════════════════════════════════════════════════ 
 */
 
/* Force DataTables and standard table headers to the brand blue */
table.dataTable thead th,
table.dataTable thead td,
.table thead th {
    color: var(--bs-primary) !important;
    font-weight: 700 !important;
}

/* Colorize the sorting arrows using the orange accent */
table.dataTable thead th.sorting:after,
table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:after,
table.dataTable thead th.sorting:before,
table.dataTable thead th.sorting_asc:before,
table.dataTable thead th.sorting_desc:before {
    color: var(--bs-secondary) !important;
    opacity: 0.6 !important;
}

/* Brighten the active sorting arrow */
table.dataTable thead th.sorting_asc:before,
table.dataTable thead th.sorting_desc:after {
    opacity: 1 !important;
    color: var(--bs-secondary) !important;
}
/* 
 * ═══════════════════════════════════════════════════════════════════════════
 * Header & Responsiveness Optimization
 * ═══════════════════════════════════════════════════════════════════════════ 
 */

/* Prevent horizontal scroll on body */
body {
    overflow-x: hidden !important;
}

/* Global native mobile tables (acts like .table-responsive for all views automatically) */
@media (max-width: 767.98px) {
    .table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* Compact header menu items on desktop */
@media (min-width: 992px) {
    .menu-lg-row .menu-item .menu-link {
        padding-left: 0.6rem !important;
        padding-right: 0.6rem !important;
    }
    .menu-lg-row .menu-item {
        margin-right: 0.25rem !important;
    }
    .menu-lg-row .menu-title {
        font-size: 0.9rem !important;
    }
}

/* Hide search on smaller desktop screens to save space */
@media (max-width: 1400px) {
    .header-search {
        display: none !important;
    }
}

/* Compact Store/Branch Info on smaller screens */
@media (max-width: 1550px) {
    .app-navbar-item .bg-light-primary {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    .app-navbar-item .bg-light-primary .fs-9 {
        font-size: 0.75rem !important;
    }
    .app-navbar-item .bg-light-primary .fs-10 {
        display: none !important;
    }
}

/* 
 * ═══════════════════════════════════════════════════════════════════════════
 * Bilingual support (Urdu)
 * ═══════════════════════════════════════════════════════════════════════════ 
 */
.urdu-content {
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    line-height: 1.4;
    display: block;
    opacity: 0.8;
    margin-top: 1px;
    font-family: 'Segoe UI Urdu', 'Tahoma', 'Arial', sans-serif;
}
