body {
    font-family: 'Roboto', sans-serif;
    font-family: 'Poppins', sans-serif
}

/* Add extra bottom spacing for pages that use the floating button
   so native <select> dropdowns have room to expand downward. */
.with-floating-button .page-content,
.with-floating-button .container-fluid {
    padding-bottom: 160px;
}

body {
    font-family: 'Roboto', sans-serif;
    font-family: 'Poppins', sans-serif
}

.color-white {
    color: #ffffff;
}

/* --- Old Green Button Styles (Commented Out for UI Overhaul) ---
.btn-save {
    background-color: #088E3D !important;
    color: #ffffff !important;
}

.btn-save:hover {
    background-color: #076A30 !important;
    color: #ffffff !important;
}
------------------------------------------------------------------ */

/* --- B. S. AGENCIES Brand Theme Styles --- */
:root {
    --bs-brand-primary: #D9531E;
    --bs-brand-primary-hover: #B84314;
    --bs-brand-accent: #F59E0B;
    --bs-brand-navy: #1E293B;
    --bs-brand-navy-light: #334155;
    --bs-brand-bg: #F8FAFC;
    --bs-border-color: #E2E8F0;
}

/* ====================================================
   ✨ GLOBAL POLISHED STYLES
   ==================================================== */
body {
    background-color: var(--bs-brand-bg) !important;
    color: #334155;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    -webkit-font-smoothing: antialiased;
}

/* Card Styling - Sleek, borderless shadow */
.card {
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05) !important;
    background-color: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid var(--bs-border-color) !important;
    font-weight: 600;
    color: #1E293B;
    padding: 1rem 1.25rem;
}

/* Page Title & Breadcrumb */
.page-title-box {
    padding-bottom: 16px;
    margin-bottom: 8px;
}
.page-title-box h4 {
    color: #1E293B;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.breadcrumb-item a {
    color: #64748B;
    text-decoration: none;
}
.breadcrumb-item a:hover {
    color: var(--bs-brand-primary);
}
.breadcrumb-item.active {
    color: #334155;
    font-weight: 500;
}

/* Buttons - Polished styling */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary,
.btn-save {
    background-color: var(--bs-brand-primary) !important;
    border-color: var(--bs-brand-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 1px 2px 0 rgba(217, 83, 30, 0.2);
}

.btn-primary:hover,
.btn-save:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--bs-brand-primary-hover) !important;
    border-color: var(--bs-brand-primary-hover) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(217, 83, 30, 0.25) !important;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #64748B !important;
    border-color: #64748B !important;
    color: #ffffff !important;
}
.btn-secondary:hover {
    background-color: #475569 !important;
    border-color: #475569 !important;
}

.btn-success {
    background-color: #10B981 !important;
    border-color: #10B981 !important;
}
.btn-success:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
}

.btn-danger {
    background-color: #EF4444 !important;
    border-color: #EF4444 !important;
}
.btn-danger:hover {
    background-color: #DC2626 !important;
    border-color: #DC2626 !important;
}

/* View Report Button */
.btn-report {
    background-color: transparent !important;
    color: var(--bs-brand-primary) !important;
    border: 2px solid var(--bs-brand-primary) !important;
    border-radius: 50px;
}
.btn-report:hover {
    background-color: var(--bs-brand-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(217, 83, 30, 0.2);
}

/* ====================================================
   📊 POLISHED TABLES (Contract List, Dispatch, Reports)
   ==================================================== */
.table {
    margin-bottom: 0;
    color: #334155;
    border-color: var(--bs-border-color);
}

.table thead th {
    background-color: #F1F5F9 !important;
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid #CBD5E1 !important;
    padding: 12px 14px !important;
    vertical-align: middle;
}

.table tbody td {
    padding: 11px 14px !important;
    vertical-align: middle;
    font-size: 13.5px;
    border-bottom: 1px solid #E2E8F0;
    color: #1E293B;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(248, 250, 252, 0.7);
}

.table tbody tr:hover {
    background-color: rgba(241, 245, 249, 0.8) !important;
}

/* Table Card Wrapper */
.table-responsive-mobile {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid var(--bs-border-color);
    overflow: hidden;
}

/* Form Controls - Crisp and Modern */
.form-control,
.form-select {
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13.5px;
    color: #1E293B;
    background-color: #ffffff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bs-brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(217, 83, 30, 0.15) !important;
    outline: none;
}

.form-label {
    font-weight: 500;
    font-size: 13px;
    color: #475569;
    margin-bottom: 5px;
}

/* Custom CSS for dropdown arrows */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '\25BC';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #64748b;
    font-size: 11px;
}

.select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    padding-right: 30px;
}

/* DataTables pagination active state */
.page-item.active .page-link {
    background-color: var(--bs-brand-primary) !important;
    border-color: var(--bs-brand-primary) !important;
    color: #ffffff !important;
}

.page-link {
    color: #475569;
    border-color: var(--bs-border-color);
}

.page-link:hover {
    color: var(--bs-brand-primary);
    background-color: #F8FAFC;
}

/* Metismenu active sidebar link highlights */
#sidebar-menu ul li a:hover,
#sidebar-menu ul li a:hover i,
#sidebar-menu ul li a:hover span {
    color: #ffffff !important;
}
#sidebar-menu ul li.mm-active > a {
    color: #ffffff !important;
}
#sidebar-menu ul li ul.sub-menu li a:hover {
    color: #ffffff !important;
}
/* Only leaf active items get soft terracotta orange */
#sidebar-menu ul.sub-menu li a.active,
#sidebar-menu ul.sub-menu li a.active span,
#sidebar-menu ul:not(.sub-menu) > li:not(:has(ul.sub-menu)) > a.active,
#sidebar-menu ul:not(.sub-menu) > li:not(:has(ul.sub-menu)) > a.active span,
#sidebar-menu ul:not(.sub-menu) > li:not(:has(ul.sub-menu)) > a.active i {
    color: #E26938 !important;
    font-weight: 600 !important;
}

/* --- Floating Buttons (Fixed + Smaller) --- */
/* Old green fab:
.fab { background-color: #088E3D; }
.fab:hover { background-color: #0AAE4C; }
.fab-label { background: #088E3D; }
*/
.fab {
    width: 42px;
    height: 42px;
    background-color: #D9531E !important;
    color: #fff !important;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 8px rgba(217, 83, 30, 0.35);
    position: fixed;
    right: 20px;
    z-index: 2000;
    /* make sure it floats above everything */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Hover lift */
.fab:hover {
    transform: scale(1.05);
    background-color: #B84314 !important;
}

/* Label styling */
.fab-label {
    position: absolute;
    right: 55px;
    background: #1E293B;
    color: #fff;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
}

.fab:hover .fab-label {
    opacity: 1;
    transform: translateY(0);
}

/* === Individual positions === */
#openAddAccountBtn {
    bottom: 90px;
    /* Show above Quality button */
}

#openAddQualityBtn {
    bottom: 30px;
}

/* Ensure the container doesn't block fixed positioning */
.fab-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1050;
}

.fab {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 12px 18px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.fab i {
    font-size: 22px;
}

/* 🔥 MAKE LABEL ALWAYS VISIBLE */
.fab-label {
    display: inline-block;
    opacity: 1;
    visibility: visible;
    white-space: nowrap;
    transition: none;
}

/* ❌ Remove hover-only behavior if present */
.fab:hover .fab-label {
    opacity: 1;
    visibility: visible;
}

#modalItemList table tbody tr:hover {
    background-color: #f0f8ff;
    /* light blue */
    cursor: pointer;
}

.selectItemBtn {
    background: linear-gradient(90deg, #ff7e5f, #feb47b);
    color: #fff;
    font-weight: 500;
}

.selectItemBtn:hover {
    background: linear-gradient(90deg, #feb47b, #ff7e5f);
    color: #fff;
}


/* ===========================
   FREEZE TITLES & STICKY HEADERS FOR ALL REPORTS
   Supports vertical scroll freeze & horizontal scrolling
   =========================== */

/* Keep table container scrollable with freeze header support */
/* OLD CODE:
.sticky-table {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.sticky-table table {
    width: 100%;
    min-width: 900px;
    border-collapse: separate;
    border-spacing: 0;
}

.sticky-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f8f9fa;
    white-space: normal;
    word-wrap: break-word;
    box-shadow: inset 0 -1px 0 #dee2e6;
}

.sticky-table td {
    word-wrap: break-word;
    white-space: normal;
}
*/
/* NEW CODE: Universal Freeze Titles for Reports & Lists */
.sticky-table,
.sticky-report-container {
    max-height: 72vh;
    overflow-y: auto;
    overflow-x: auto;
    width: 100%;
    position: relative;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    margin-bottom: 1rem;
}

.sticky-table table,
.sticky-report-container table {
    width: 100%;
    min-width: 900px;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin-bottom: 0 !important;
}

/* Freeze header row on vertical scroll */
.sticky-table thead th,
.sticky-report-container thead th,
.sticky-report-table thead th {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background-color: #f8f9fa !important;
    color: #1E293B !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    border-top: none !important;
    border-bottom: 2px solid #cbd5e1 !important;
    box-shadow: inset 0 -1px 0 #cbd5e1, 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Also freeze table footers if present (totals row) */
.sticky-table tfoot th,
.sticky-report-container tfoot th,
.sticky-report-table tfoot th {
    position: -webkit-sticky !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 9 !important;
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    box-shadow: inset 0 1px 0 #cbd5e1, 0 -2px 4px rgba(0, 0, 0, 0.04);
}

/* Freeze First Column (Sr No / Date / Contract No) when scrolling horizontally */
.sticky-report-table th.freeze-col-1,
.sticky-report-table td.freeze-col-1,
.sticky-table th.freeze-col-1,
.sticky-table td.freeze-col-1 {
    position: -webkit-sticky !important;
    position: sticky !important;
    left: 0 !important;
    z-index: 6 !important;
    background-color: #ffffff;
}

/* When first column header is both top-sticky and left-sticky */
.sticky-report-table thead th.freeze-col-1,
.sticky-table thead th.freeze-col-1 {
    z-index: 20 !important;
    background-color: #f8f9fa !important;
}

.sticky-report-table tfoot th.freeze-col-1,
.sticky-table tfoot th.freeze-col-1 {
    z-index: 19 !important;
    background-color: #f1f5f9 !important;
}

.sticky-table td,
.sticky-report-container td {
    white-space: nowrap;
}

/* ===========================
   MOBILE-RESPONSIVE LIST TABLES
   Horizontal scroll on mobile,
   desktop stays untouched.
   =========================== */

.table-responsive-mobile {
    width: 100%;
}

/* ====================================================
   💎 ULTRA-POLISHED MODERN ENTERPRISE ENHANCEMENTS
   ==================================================== */

/* Smooth custom scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Polished Topbar Brand & Shadow */
#page-topbar {
    background: #ffffff !important;
    border-bottom: 1px solid #E2E8F0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}

/* Polished Sidebar Menu */
.vertical-menu {
    background-color: #1E293B !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05) !important;
}

#sidebar-menu ul li a {
    color: #94A3B8 !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    margin: 2px 10px !important;
    transition: all 0.2s ease !important;
}

#sidebar-menu ul li a:hover,
#sidebar-menu ul li a.active,
#sidebar-menu ul li.mm-active > a {
    color: #ffffff !important;
    background-color: rgba(217, 83, 30, 0.15) !important;
    color: #FF8A50 !important;
}

#sidebar-menu ul li a i {
    font-size: 17px !important;
    margin-right: 8px !important;
    vertical-align: middle !important;
    color: inherit !important;
}

/* Sub-menus in sidebar */
#sidebar-menu ul li ul.sub-menu {
    padding: 4px 0 !important;
}

#sidebar-menu ul li ul.sub-menu li a {
    padding: 7px 20px 7px 36px !important;
    font-size: 13px !important;
    color: #94A3B8 !important;
}

#sidebar-menu ul li ul.sub-menu li a:hover,
#sidebar-menu ul li ul.sub-menu li a.active {
    color: #ffffff !important;
    background-color: transparent !important;
    font-weight: 600 !important;
}

/* DataTables & Table Polish */
.dataTables_wrapper .dataTables_paginate .paginate_button.current, 
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #D9531E !important;
    border-color: #D9531E !important;
    color: #ffffff !important;
    border-radius: 6px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
    color: #1E293B !important;
    border-radius: 6px !important;
}

.table-hover tbody tr:hover {
    background-color: #F8FAFC !important;
}

/* Polished Form Inputs */
.form-control, .form-select {
    border-color: #CBD5E1 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

.form-control:focus, .form-select:focus {
    border-color: #D9531E !important;
    box-shadow: 0 0 0 3px rgba(217, 83, 30, 0.14) !important;
}

/* Floating Form Save Button Bar */
.floating-save-bar {
    position: fixed;
    bottom: 0;
    left: 250px;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #E2E8F0;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
    padding: 12px 24px;
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

@media (max-width: 991.98px) {
    .floating-save-bar {
        left: 0;
    }
}