/* ==========================================================================
   H-INVENTORY EMERALD & FOREST GREEN GRADIENT THEME
   Luxury, Modern, Eye-friendly Dashboard & Admin Panel Design
   ========================================================================== */

:root {
    --theme-forest-dark: #022c22;
    --theme-forest: #064e3b;
    --theme-emerald-dark: #065f46;
    --theme-emerald: #059669;
    --theme-emerald-light: #10b981;
    --theme-mint: #34d399;
    --theme-teal: #0d9488;
    --theme-bg-soft: #f2f7f4;
    --theme-primary-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --theme-topbar-gradient: linear-gradient(90deg, #064e3b 0%, #065f46 50%, #047857 100%);
    --theme-sidebar-gradient: linear-gradient(180deg, #043d2e 0%, #064e3b 45%, #022c22 100%);
}

/* Base Body Background */
body {
    background-color: var(--theme-bg-soft) !important;
    color: #1f2937;
}

/* ==========================================================================
   1. TOPBAR & HEADER
   ========================================================================== */
#page-topbar {
    background: var(--theme-topbar-gradient) !important;
    box-shadow: 0 4px 20px rgba(6, 78, 59, 0.22) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.navbar-header .header-item {
    color: #e6f4ea !important;
    transition: all 0.2s ease;
}

.navbar-header .header-item:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px;
}

.navbar-brand-box {
    background: #033628 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: inset -3px 0 12px rgba(0, 0, 0, 0.15) !important;
}

.navbar-brand-box a {
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 700;
}

.navbar-brand-box h5 {
    color: #ffffff !important;
    margin: 0;
    font-size: 16px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-profile-user {
    border: 2px solid #34d399 !important;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.5) !important;
}

/* ==========================================================================
   2. SIDEBAR NAVIGATION
   ========================================================================== */
.vertical-menu {
    background: var(--theme-sidebar-gradient) !important;
    box-shadow: 4px 0 25px rgba(2, 44, 34, 0.35) !important;
    border-right: 1px solid rgba(16, 185, 129, 0.15) !important;
}

#sidebar-menu .menu-title {
    color: #6ee7b7 !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    letter-spacing: 1.2px !important;
    text-transform: uppercase !important;
    opacity: 0.9;
    padding: 14px 22px 6px !important;
}

#sidebar-menu ul li a {
    color: #d1fae5 !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    padding: 10px 18px !important;
    margin: 3px 12px !important;
    border-radius: 10px !important;
    transition: all 0.22s ease !important;
    display: flex !important;
    align-items: center !important;
}

#sidebar-menu ul li a i {
    color: #34d399 !important;
    font-size: 19px !important;
    margin-right: 10px !important;
    transition: transform 0.2s ease, color 0.2s ease !important;
}

#sidebar-menu ul li a:hover {
    background: rgba(16, 185, 129, 0.18) !important;
    color: #ffffff !important;
    transform: translateX(4px);
}

#sidebar-menu ul li a:hover i {
    color: #ffffff !important;
    transform: scale(1.15);
}

/* Active Menu Items */
#sidebar-menu ul li.mm-active > a,
#sidebar-menu ul li a.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4) !important;
    font-weight: 600 !important;
}

#sidebar-menu ul li.mm-active > a i,
#sidebar-menu ul li a.active i {
    color: #ffffff !important;
}

/* Submenu dropdown */
#sidebar-menu ul li ul.sub-menu {
    background: rgba(2, 44, 34, 0.65) !important;
    padding: 6px 0 !important;
    border-radius: 12px !important;
    margin: 4px 14px !important;
    border: 1px solid rgba(16, 185, 129, 0.15) !important;
}

#sidebar-menu ul li ul.sub-menu li a {
    padding: 8px 18px !important;
    font-size: 12.5px !important;
    color: #a7f3d0 !important;
    margin: 2px 6px !important;
}

#sidebar-menu ul li ul.sub-menu li a:hover {
    background: rgba(16, 185, 129, 0.22) !important;
    color: #ffffff !important;
}

#sidebar-menu ul li ul.sub-menu li.mm-active > a,
#sidebar-menu ul li ul.sub-menu li a.active {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   2.1 DESKTOP COLLAPSED SIDEBAR (body.vertical-collpsed)
   Fix brand text overlap on hamburger, center icons & polish flyout menus
   ========================================================================== */
body.vertical-collpsed .navbar-brand-box {
    width: 70px !important;
    padding: 0 !important;
    overflow: hidden !important;
    text-align: center !important;
}

body.vertical-collpsed .navbar-brand-box a {
    justify-content: center !important;
    width: 100% !important;
    gap: 0 !important;
    padding: 0 !important;
}

body.vertical-collpsed .navbar-brand-box .brand-badge-icon,
body.vertical-collpsed .brand-logo-card {
    margin: 0 auto !important;
    max-width: 50px !important;
    height: 46px !important;
    padding: 3px !important;
    border-radius: 8px !important;
}

body.vertical-collpsed .brand-logo-main,
body.vertical-collpsed .brand-logo-img,
body.vertical-collpsed .brand-logo-horizontal {
    display: none !important;
}

body.vertical-collpsed .brand-logo-collapsed,
body.vertical-collpsed .brand-logo-emblem {
    display: block !important;
    height: 100% !important;
    max-height: 40px !important;
    width: auto !important;
    object-fit: contain !important;
    margin: 0 auto !important;
}

body.vertical-collpsed .navbar-brand-box .brand-text-wrapper {
    display: none !important;
}

body.vertical-collpsed .main-content {
    margin-left: 70px !important;
}

body.vertical-collpsed .footer {
    left: 70px !important;
}

body.vertical-collpsed .vertical-menu {
    width: 70px !important;
}

body.vertical-collpsed .vertical-menu #sidebar-menu .menu-title {
    display: none !important;
}

body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li {
    position: relative !important;
    white-space: nowrap !important;
    text-align: center !important;
}

body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li > a {
    margin: 4px 12px !important;
    padding: 10px 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    border-radius: 10px !important;
    min-height: 44px !important;
    transform: none !important;
}

body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li > a i {
    margin: 0 !important;
    font-size: 20px !important;
    display: inline-block !important;
    transform: none !important;
}

body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li > a span {
    display: none !important;
}

body.vertical-collpsed .vertical-menu #sidebar-menu .has-arrow:after {
    display: none !important;
}

body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li > ul.sub-menu {
    display: none !important;
}

/* Hover flyout header */
body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > a {
    position: relative !important;
    width: calc(200px + 70px) !important;
    background: #064e3b !important;
    color: #ffffff !important;
    justify-content: flex-start !important;
    padding-left: 24px !important;
    border-radius: 10px 10px 0 0 !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.35) !important;
    z-index: 1005 !important;
    transform: none !important;
}

body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > a i {
    margin-right: 12px !important;
    color: #34d399 !important;
    transform: none !important;
}

body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > a span {
    display: inline-block !important;
    color: #ffffff !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    padding-left: 0 !important;
}

body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:not(:has(ul.sub-menu)):hover > a {
    border-radius: 10px !important;
}

/* Hover flyout submenu dropdown */
body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > ul.sub-menu {
    display: block !important;
    position: absolute !important;
    left: 70px !important;
    top: 44px !important;
    width: 200px !important;
    background: #033628 !important;
    box-shadow: 4px 8px 25px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    border-radius: 0 0 10px 10px !important;
    z-index: 1004 !important;
    padding: 6px 0 !important;
    margin: 0 !important;
}

body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > ul.sub-menu li a {
    display: block !important;
    width: auto !important;
    padding: 8px 18px !important;
    margin: 2px 6px !important;
    color: #a7f3d0 !important;
    text-align: left !important;
    justify-content: flex-start !important;
    border-radius: 6px !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    transform: none !important;
}

body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > ul.sub-menu li a:hover {
    background: rgba(16, 185, 129, 0.22) !important;
    color: #ffffff !important;
    transform: translateX(4px) !important;
}

body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > ul.sub-menu li.mm-active > a,
body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > ul.sub-menu li a.active {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   3. CARDS & CONTAINERS
   ========================================================================== */
.card {
    border-radius: 16px !important;
    border: 1px solid #e6f0eb !important;
    box-shadow: 0 4px 20px rgba(6, 78, 59, 0.04) !important;
    background-color: #ffffff !important;
    transition: all 0.25s ease !important;
}

.card:hover {
    box-shadow: 0 8px 28px rgba(6, 78, 59, 0.08) !important;
}

.card-header {
    background-color: #fafdfb !important;
    border-bottom: 1px solid #e6f0eb !important;
    font-weight: 600;
}

/* ==========================================================================
   4. BUTTONS & CONTROLS
   ========================================================================== */
.btn-primary {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    border-color: #059669 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28) !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    transition: all 0.25s ease !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
    border-color: #047857 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.38) !important;
}

.btn-outline-primary {
    color: #059669 !important;
    border-color: #10b981 !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    border-color: #059669 !important;
    color: #ffffff !important;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%) !important;
    border-color: #10b981 !important;
    color: #064e3b !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25) !important;
}

/* ==========================================================================
   5. TABLES & FORMS (Exclude print views & invoices from green headers)
   ========================================================================== */
.table:not(.print-table):not(#invoice *):not(.invoice-sheet *):not(.print-sheet *) thead th,
.table:not(.print-table):not(#invoice *):not(.invoice-sheet *):not(.print-sheet *) .table-light {
    background-color: #ecfdf5 !important;
    color: #065f46 !important;
    border-color: #d1fae5 !important;
    font-weight: 700 !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.2) !important;
}

/* ==========================================================================
   6. BADGES & FOOTER
   ========================================================================== */
.badge.bg-primary {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

.badge.bg-success {
    background-color: #059669 !important;
    color: #ffffff !important;
    font-weight: 600;
}

.footer {
    background: #ffffff !important;
    border-top: 1px solid #e6f0eb !important;
    color: #065f46 !important;
}

.footer a {
    color: #059669 !important;
    font-weight: 600;
}

/* ==========================================================================
   7. CUSTOM SCROLLBAR (EMERALD)
   ========================================================================== */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: #f1f8f4;
}
::-webkit-scrollbar-thumb {
    background: #10b981;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #059669;
}

/* ==========================================================================
   8. HEADER BRANDING & AVATAR ENHANCEMENTS
   ========================================================================== */
.brand-logo-card {
    height: 56px;
    width: auto;
    max-width: 230px;
    border-radius: 10px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    flex-shrink: 0;
    overflow: hidden;
    padding: 2px 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    transition: all 0.2s ease;
}

.brand-logo-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.brand-logo-main,
.brand-logo-horizontal,
.brand-logo-img {
    height: 100%;
    width: auto;
    max-height: 52px;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.brand-logo-collapsed,
.brand-logo-emblem {
    display: none !important;
    height: 100%;
    width: auto;
    max-height: 42px;
    max-width: 100%;
    object-fit: contain;
}

.brand-badge-icon {
    height: 48px;
    width: auto;
    min-width: 50px;
    max-width: 95px;
    border-radius: 10px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
    overflow: hidden;
    padding: 3px 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.2s ease;
}

.brand-logo-img,
.brand-favicon-img {
    height: 100%;
    width: auto;
    max-width: 100%;
    max-height: 48px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.brand-text-wrapper {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    max-width: 170px;
}

.brand-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-subtitle {
    font-size: 10px;
    font-weight: 600;
    color: #a7f3d0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-quick-pill {
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #e6f4ea !important;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    margin-right: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all 0.2s ease;
}

.header-quick-pill:hover,
.header-quick-pill.active {
    background: #ffffff;
    color: #064e3b !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #ffffff;
}

.header-avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #a7f3d0;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    font-size: 14px;
}

/* ==========================================================================
   9. PROFESSIONAL PRINT SYSTEM RESET (CORPORATE NAVY / CHARCOAL SLATE)
   Zero green on printouts - ink-efficient, razor-sharp corporate output
   ========================================================================== */
#invoice,
.invoice-sheet,
.print-sheet {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

#invoice .text-success,
.invoice-sheet .text-success,
.print-sheet .text-success {
    color: #0f172a !important;
}

#invoice table thead th,
.invoice-sheet table thead th,
.print-sheet table thead th,
.print-table thead th {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border-color: #cbd5e1 !important;
}

@media print {
    body {
        background-color: #ffffff !important;
        color: #0f172a !important;
    }

    .vertical-menu,
    #page-topbar,
    .navbar-header,
    .footer,
    .page-title-box,
    .main-content > footer,
    .no-print,
    .btn,
    .rightbar-overlay,
    .right-bar {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .page-content,
    .main-content > .page-content,
    .page-content .page-content,
    .page-content-wrapper {
        padding: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin: 0 !important;
        margin-top: 0 !important;
    }

    .container-fluid {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    .card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .table thead th {
        background-color: #1e293b !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ==========================================================================
   10. COMPLETE COMPREHENSIVE RESPONSIVE ENGINE (MOBILE, TABLET & DESKTOP)
   Ensures every dashboard, table, card, form, modal, and drawer adapts flawlessly
   ========================================================================== */

/* Universal Layout & Body Overflow Security */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

#layout-wrapper {
    max-width: 100%;
    overflow-x: hidden;
}

/* Eliminate duplicate .page-content padding, reset -100px negative margin, & ensure perfect top clearance below topbar */
.main-content > .page-content {
    padding-top: calc(70px + 24px) !important;
    padding-bottom: 60px !important;
}

.page-content .page-content {
    padding: 0 !important;
}

.page-content-wrapper {
    margin-top: 0 !important;
}

.page-content .container-fluid.mt-5,
.page-content .container-fluid.mt-4,
.page-content .container-fluid.mt-3 {
    margin-top: 0 !important;
}

/* Smooth Touch-Scrollable Table Container for ALL devices */
.table-responsive,
div[style*="overflow-x: auto"],
div[style*="overflow-x:auto"],
div[style*="overflow-x: scroll"],
div[style*="overflow-x:scroll"] {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin;
    margin-bottom: 1rem;
    border-radius: 10px;
}

/* Ensure data tables don't squish into unreadable vertical columns on mobile screens */
.table-responsive > .table:not(.print-table),
div[style*="overflow-x: auto"] > .table:not(.print-table),
div[style*="overflow-x:auto"] > .table:not(.print-table) {
    min-width: 620px;
    margin-bottom: 0 !important;
}

/* Action button cells inside tables */
.table td.d-flex,
.table th.d-flex {
    min-width: 170px;
    white-space: nowrap !important;
}
.table td, .table th {
    vertical-align: middle;
}

/* Select2 mobile container full-width */
.select2-container {
    width: 100% !important;
    max-width: 100% !important;
}
.select2-dropdown {
    max-width: 90vw !important;
}

/* Mobile Sidebar Overlay Backdrop */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 44, 34, 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1001;
    transition: opacity 0.25s ease;
}

/* Responsive DataTables Controls (Search, Length, Info, Pagination) */
@media (max-width: 767.98px) {
    div.dataTables_wrapper div.dataTables_length,
    div.dataTables_wrapper div.dataTables_filter {
        width: 100% !important;
        text-align: left !important;
        margin-bottom: 0.75rem !important;
        float: none !important;
    }
    div.dataTables_wrapper div.dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 4px !important;
        display: block !important;
    }
    div.dataTables_wrapper div.dataTables_info,
    div.dataTables_wrapper div.dataTables_paginate {
        width: 100% !important;
        text-align: center !important;
        float: none !important;
        margin-top: 0.75rem !important;
    }
    div.dataTables_wrapper .pagination {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 3px !important;
    }
}

/* Media Query: Tablets & Mobile (< 992px) */
@media (max-width: 991.98px) {
    /* Compact Topbar */
    #page-topbar {
        height: 60px !important;
    }
    .navbar-header {
        height: 60px !important;
        padding: 0 10px !important;
    }
    .navbar-brand-box {
        width: auto !important;
        padding: 0 4px !important;
        background: transparent !important;
        box-shadow: none !important;
        border-right: none !important;
    }
    .brand-badge-icon,
    .brand-logo-card {
        height: 46px !important;
        width: auto !important;
        max-width: 215px !important;
        border-radius: 9px !important;
        padding: 2px 8px !important;
    }
    .brand-logo-main,
    .brand-logo-horizontal,
    .brand-logo-img {
        max-height: 40px !important;
        display: block !important;
    }
    .brand-logo-collapsed,
    .brand-logo-emblem {
        display: none !important;
    }
    .brand-text-wrapper {
        display: none !important;
    }
    #vertical-menu-btn {
        padding: 0 8px !important;
        font-size: 22px !important;
        height: 60px !important;
    }

    /* Main Content spacing under compact topbar */
    .main-content {
        margin-left: 0 !important;
    }
    .main-content > .page-content {
        padding-top: calc(60px + 16px) !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        padding-bottom: 40px !important;
    }

    /* Vertical Menu: Mobile Drawer slide-in animation */
    .vertical-menu {
        position: fixed !important;
        top: 60px !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 270px !important;
        max-width: 82vw !important;
        z-index: 1002 !important;
        display: block !important;
        transform: translateX(-105%) !important;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.45) !important;
    }
    body.sidebar-enable .vertical-menu {
        transform: translateX(0) !important;
    }
    body.sidebar-enable .sidebar-overlay {
        display: block !important;
    }

    /* Cards on tablet/mobile */
    .card {
        border-radius: 14px !important;
        margin-bottom: 16px !important;
    }
    .card-body {
        padding: 16px !important;
    }
    .card-header {
        padding: 12px 16px !important;
    }
}

/* Media Query: Phones (< 576px) */
@media (max-width: 575.98px) {
    /* Card headers with buttons stack nicely */
    .card-header.d-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    .card-header.d-flex > div,
    .card-header.d-flex > a {
        width: 100% !important;
        display: flex !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    /* Filter forms clean stacking */
    form.row.g-2.align-items-center > .col-auto,
    form.row > .col-auto {
        width: 100% !important;
    }
    form.row.g-2.align-items-center input[type="date"],
    form.row input[type="date"],
    form.row .btn {
        width: 100% !important;
    }

    /* Dashboard KPI cards on phones */
    .kpi-card {
        padding: 16px !important;
        border-radius: 14px !important;
    }
    .kpi-title {
        font-size: 11px !important;
    }
    .kpi-value {
        font-size: 21px !important;
    }
    .kpi-icon {
        font-size: 44px !important;
        right: 10px !important;
        bottom: 8px !important;
    }

    /* Chart section card & timeline navigation on phones */
    .chart-section-card {
        padding: 14px !important;
        border-radius: 14px !important;
    }
    #customDateForm {
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    #customDateForm > div {
        flex: 1 1 calc(50% - 4px) !important;
        min-width: 120px;
    }
    #customDateForm button {
        width: 100% !important;
        margin-top: 4px;
    }
    #btnSlidePrev, #btnSlideNext {
        font-size: 11.5px !important;
        padding: 6px 10px !important;
    }

    /* Chart Slide Tabs - Smooth horizontal touch swipe */
    #chartTabList {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding-bottom: 4px !important;
        gap: 6px !important;
    }
    #chartTabList::-webkit-scrollbar {
        display: none !important;
    }
    .chart-slide-tab {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        font-size: 12px !important;
        padding: 6px 12px !important;
    }

    /* Modals on small phones */
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }
    .modal-content {
        border-radius: 14px !important;
    }

    /* POS & Sales table footer */
    .pc-table tfoot td {
        padding: 8px 6px !important;
    }
    .pc-table tfoot .grand-label {
        font-size: 13px !important;
    }
    .pc-table tfoot .grand_total {
        font-size: 17px !important;
    }
}

