:root {
    /* Centralized Color Settings */
    /* Default primary color: #9C2007 */
    --anyshop-primary: #9C2007;
    --anyshop-primary-rgb: 156, 32, 7;
    /* Override Bootstrap Variables */
    --bs-primary: var(--anyshop-primary);
    --bs-primary-rgb: var(--anyshop-primary-rgb);
    --bs-link-color: var(--anyshop-primary);
    --bs-link-hover-color: #7d1a06;
}
/* Comprehensive Bootstrap overrides for primary color */
.btn-primary {
    --bs-btn-bg: var(--anyshop-primary);
    --bs-btn-border-color: var(--anyshop-primary);
    --bs-btn-hover-bg: #801a06;
    --bs-btn-hover-border-color: #731805;
    --bs-btn-active-bg: #731805;
    --bs-btn-active-border-color: #661505;
    --bs-btn-disabled-bg: #c95740;
    --bs-btn-disabled-border-color: #c95740;
}

.btn-outline-primary {
    --bs-btn-color: var(--anyshop-primary);
    --bs-btn-border-color: var(--anyshop-primary);
    --bs-btn-hover-bg: var(--anyshop-primary);
    --bs-btn-hover-border-color: var(--anyshop-primary);
    --bs-btn-active-bg: var(--anyshop-primary);
    --bs-btn-active-border-color: var(--anyshop-primary);
}

.text-primary {
    color: var(--anyshop-primary) !important;
}

.bg-primary {
    background-color: var(--anyshop-primary) !important;
}

.border-primary {
    border-color: var(--anyshop-primary) !important;
}

.card-primary.card-outline {
    border-top-color: var(--anyshop-primary) !important;
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    background-color: var(--anyshop-primary);
}

.dropdown-item.active, .dropdown-item:active {
    background-color: var(--anyshop-primary);
}
/* Sidebar base links (inactive) */
.sidebar-menu .nav-link,
.nav-sidebar .nav-link {
    color: var(--bs-body-color);
}
    /* Sidebar active item */
    .sidebar-menu .nav-link.active,
    .nav-sidebar .nav-link.active {
        background-color: #f4f6f9 !important; /* Light gray highlight */
        color: var(--anyshop-primary) !important;
        border-radius: 8px !important;
        font-weight: 600;
    }
/* Dark Mode Sidebar Overrides */
[data-bs-theme="dark"] .sidebar-menu .nav-link,
[data-bs-theme="dark"] .nav-sidebar .nav-link {
    color: #e9ecef; /* Light gray/white text for inactive items */
}

    [data-bs-theme="dark"] .sidebar-menu .nav-link.active,
    [data-bs-theme="dark"] .nav-sidebar .nav-link.active {
        background-color: var(--anyshop-primary) !important;
        color: #ffffff !important; /* Solid white text for active items */
    }
/* Sidebar Brand Left Alignment */
.app-sidebar .sidebar-brand {
    justify-content: flex-start !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

    .app-sidebar .sidebar-brand .brand-link {
        justify-content: flex-start !important;
        text-align: left !important;
        width: 100% !important;
    }

    .app-sidebar .sidebar-brand .brand-text {
        text-align: left !important;
    }
/* Top Navbar Links */
.app-header .nav-link:not(.text-danger) {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .app-header .nav-link:not(.text-danger) {
    color: #e9ecef;
}
/* Ensure background color transition is smooth when toggling dark mode */
body:not(.pos-body) {
    transition: background-color 0.3s ease, color 0.3s ease;
    background-color: #f4f7f6 !important;
}

[data-bs-theme="dark"] body:not(.pos-body) {
    background-color: #212529 !important;
    color: #e9ecef !important;
}
/* Fix text colors in dark mode */
[data-bs-theme="dark"] .text-dark {
    color: #f8f9fa !important; /* Force text-dark to become light in dark mode */
}
/* Universal Dark Mode fix for active badge tags with bg-white text-dark */
[data-bs-theme="dark"] .badge.bg-white,
[data-bs-theme="dark"] .badge.bg-white.text-dark {
    background-color: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .card-title,
[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6 {
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .table {
    color: #e9ecef !important;
    --bs-table-color: #e9ecef;
}

    [data-bs-theme="dark"] .table-light,
    [data-bs-theme="dark"] .table thead.table-light,
    [data-bs-theme="dark"] .table thead.table-light th,
    [data-bs-theme="dark"] thead.table-light,
    [data-bs-theme="dark"] thead.table-light th {
        background-color: var(--bs-tertiary-bg, #2b3035) !important;
        color: var(--bs-body-color, #e9ecef) !important;
        border-color: var(--bs-border-color, #373b3e) !important;
        --bs-table-bg: var(--bs-tertiary-bg, #2b3035) !important;
        --bs-table-color: var(--bs-body-color, #e9ecef) !important;
    }

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: rgba(255, 255, 255, 0.05);
    color: #e9ecef !important;
}

.app-wrapper {
    background-color: transparent !important;
}
/* Base structural adjustments if any */
.app-wrapper {
    min-height: 100vh;
}
/* Make dropdown color pickers look like swatches */
.color-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}
/* Khmer Font Configuration */
@font-face {
    font-family: 'Siemreap';
    src: url('../fonts/Siemreap-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

html[lang="km-KH"] body,
html[lang="km-KH"] h1, html[lang="km-KH"] h2, html[lang="km-KH"] h3,
html[lang="km-KH"] h4, html[lang="km-KH"] h5, html[lang="km-KH"] h6,
html[lang="km-KH"] p, html[lang="km-KH"] a, html[lang="km-KH"] span, html[lang="km-KH"] div,
html[lang="km-KH"] input, html[lang="km-KH"] button, html[lang="km-KH"] select, html[lang="km-KH"] textarea,
html[lang="km-KH"] th, html[lang="km-KH"] td, html[lang="km-KH"] .brand-text {
    font-family: 'Siemreap', sans-serif !important;
}
/* ==========================================================================
   ENTERPRISE DESIGN SYSTEM & DASHBOARD TELEMETRY
   ========================================================================== */
/* Universal Crisp Rectangular Geometry (Zero Pills) */
:root {
    --bs-border-radius: 6px !important;
    --bs-border-radius-sm: 4px !important;
    --bs-border-radius-lg: 8px !important;
    --bs-border-radius-xl: 10px !important;
    --bs-border-radius-2xl: 12px !important;
    --bs-border-radius-pill: 6px !important; /* Force all pills to rectangular */
}

.btn, .btn-sm, .btn-lg, .form-control, .form-select, .input-group-text, .dropdown-menu {
    border-radius: 6px !important;
}

.rounded-pill {
    border-radius: 6px !important;
}
/* Tabular Numerals for Financials and Metrics */
.text-tabular {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.fs-7 {
    font-size: 0.8125rem !important;
}

.fs-8 {
    font-size: 0.75rem !important;
}

.fs-9 {
    font-size: 0.6875rem !important;
}

.tracking-wider {
    letter-spacing: 0.05em;
}
/* ==========================================================================
   ENTERPRISE TOPBAR & NAVIGATION
   ========================================================================== */
.app-header {
    height: 62px;
    background: var(--bs-body-bg) !important;
    border-bottom: 1px solid var(--bs-border-color) !important;
    padding: 0 1.25rem;
    z-index: 1030;
}

.topbar-nav-item {
    display: inline-flex;
    align-items: center;
}

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px !important;
    border: 1px solid var(--bs-border-color-translucent);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    text-decoration: none;
}

    .topbar-icon-btn:hover {
        background-color: rgba(0, 0, 0, 0.04);
        color: var(--anyshop-primary);
        border-color: var(--anyshop-primary);
    }

[data-bs-theme="dark"] .topbar-icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.topbar-pos-btn {
    height: 36px;
    border-radius: 6px !important;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

    .topbar-pos-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(156, 32, 7, 0.25);
    }
/* User Profile Dropdown in Topbar */
.topbar-user-btn {
    border-radius: 6px !important;
    padding: 4px 10px;
    border: 1px solid var(--bs-border-color-translucent);
    background: var(--bs-body-bg);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--bs-body-color);
    transition: all 0.15s ease;
}

    .topbar-user-btn:hover {
        background-color: rgba(0, 0, 0, 0.03);
        border-color: var(--bs-border-color);
    }

[data-bs-theme="dark"] .topbar-user-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.topbar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--anyshop-primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile-menu {
    min-width: 240px;
    border-radius: 8px !important;
    border: 1px solid var(--bs-border-color);
    padding: 6px;
}
/* ==========================================================================
   ENTERPRISE SIDEBAR & NAVIGATION TREE
   ========================================================================== */
.app-sidebar {
    background: var(--bs-body-bg) !important;
    border-right: 1px solid var(--bs-border-color) !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
}

.sidebar-brand {
    height: 62px;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--bs-border-color) !important;
    flex-shrink: 0;
}

.sidebar-wrapper {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 0 !important;
    height: calc(100vh - 62px - 65px);
    scrollbar-width: thin;
    scrollbar-color: rgba(194, 194, 194, 0.35) transparent;
}

    .sidebar-wrapper::-webkit-scrollbar {
        width: 5px;
    }

    .sidebar-wrapper::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar-wrapper::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.15);
        border-radius: 4px;
    }

        .sidebar-wrapper::-webkit-scrollbar-thumb:hover {
            background: var(--anyshop-primary, #9c2007);
        }

[data-bs-theme="dark"] .sidebar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
}

    [data-bs-theme="dark"] .sidebar-wrapper::-webkit-scrollbar-thumb:hover {
        background: var(--anyshop-primary, #9c2007);
    }

.sidebar-section-header {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    padding: 12px 14px 4px 14px;
}

.sidebar-menu .nav-link {
    border-radius: 6px !important;
    margin: 2px 8px;
    padding: 8px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-body-color);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
}

    .sidebar-menu .nav-link i.nav-icon {
        font-size: 1.05rem;
        margin-right: 10px;
        width: 20px;
        text-align: center;
        color: var(--bs-secondary-color);
        transition: color 0.15s ease;
    }

    .sidebar-menu .nav-link:hover {
        background-color: rgba(0, 0, 0, 0.035);
        color: var(--anyshop-primary);
    }

        .sidebar-menu .nav-link:hover i.nav-icon {
            color: var(--anyshop-primary);
        }

[data-bs-theme="dark"] .sidebar-menu .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.04);
}
/* Active Nav Item */
.sidebar-menu .nav-link.active {
    background-color: rgba(var(--anyshop-primary-rgb, 156, 32, 7), 0.08) !important;
    color: var(--anyshop-primary) !important;
    font-weight: 600;
    border-left: 3px solid var(--anyshop-primary) !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

    .sidebar-menu .nav-link.active i.nav-icon {
        color: var(--anyshop-primary) !important;
    }

[data-bs-theme="dark"] .sidebar-menu .nav-link.active {
    background-color: rgba(var(--anyshop-primary-rgb, 156, 32, 7), 0.2) !important;
    color: #ffffff !important;
}

    [data-bs-theme="dark"] .sidebar-menu .nav-link.active i.nav-icon {
        color: #ffffff !important;
    }
/* Submenu items */
.nav-treeview {
    padding-left: 8px;
}

    .nav-treeview .nav-link {
        font-size: 0.8125rem;
        padding: 6px 12px 6px 30px;
        position: relative;
    }

        .nav-treeview .nav-link::before {
            content: "";
            position: absolute;
            left: 18px;
            top: 50%;
            transform: translateY(-50%);
            width: 5px;
            height: 5px;
            border-radius: 1px;
            background-color: var(--bs-secondary-color);
            opacity: 0.4;
            transition: all 0.15s ease;
        }

        .nav-treeview .nav-link:hover::before,
        .nav-treeview .nav-link.active::before {
            background-color: var(--anyshop-primary);
            opacity: 1;
            width: 6px;
            height: 6px;
        }
/* Sidebar Cashier Footer Card */
.sidebar-cashier-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}

.cashier-mini-card {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

[data-bs-theme="dark"] .cashier-mini-card {
    background: rgba(255, 255, 255, 0.02);
}
/* ==========================================================================
   SIDEBAR FOLD & MINI-COLLAPSE (SLIM ICON DOCK)
   ========================================================================== */
/* Smooth folding transitions */
.app-sidebar,
.app-main,
.app-header,
.app-footer {
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.22s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.22s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@media (min-width: 992px) {
    /* Collapsed State on Desktop */
    body.sidebar-mini.sidebar-collapse {
        --lte-sidebar-width: 68px !important;
    }

        body.sidebar-mini.sidebar-collapse .app-sidebar {
            width: 68px !important;
            min-width: 68px !important;
            max-width: 68px !important;
        }
        /* Brand Header in collapsed mode: hide name text, center round logo */
        body.sidebar-mini.sidebar-collapse .sidebar-brand {
            padding: 0 !important;
            justify-content: center !important;
        }

            body.sidebar-mini.sidebar-collapse .sidebar-brand .brand-link {
                padding: 0 !important;
                justify-content: center !important;
            }

                body.sidebar-mini.sidebar-collapse .sidebar-brand .brand-link > div {
                    display: none !important;
                }

            body.sidebar-mini.sidebar-collapse .sidebar-brand .brand-image {
                margin: 0 auto !important;
            }
        /* Hide section headers when collapsed */
        body.sidebar-mini.sidebar-collapse .sidebar-section-header {
            display: none !important;
        }
        /* Center nav links as neat icon buttons */
        body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-link {
            width: 44px !important;
            height: 44px !important;
            margin: 4px auto !important;
            padding: 0 !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            border-radius: 8px !important;
        }

            body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-link i.nav-icon {
                margin: 0 !important;
                font-size: 1.25rem !important;
                width: auto !important;
                text-align: center !important;
            }

            body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-link p,
            body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-link .nav-arrow {
                display: none !important;
            }

        body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-treeview {
            display: none !important;
        }

        body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-link.active {
            border-left: none !important;
            background-color: var(--anyshop-primary) !important;
            color: #ffffff !important;
        }

            body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-link.active i.nav-icon {
                color: #ffffff !important;
            }
        /* Cashier Footer in collapsed mode: hide text & buttons, center avatar pill */
        body.sidebar-mini.sidebar-collapse .sidebar-cashier-footer {
            padding: 10px 8px !important;
        }

        body.sidebar-mini.sidebar-collapse .cashier-mini-card {
            padding: 6px !important;
            justify-content: center !important;
            border-radius: 8px !important;
        }

            body.sidebar-mini.sidebar-collapse .cashier-mini-card .overflow-hidden,
            body.sidebar-mini.sidebar-collapse .cashier-mini-card .flex-shrink-0 {
                display: none !important;
            }

            body.sidebar-mini.sidebar-collapse .cashier-mini-card .topbar-user-avatar {
                width: 32px !important;
                height: 32px !important;
                font-size: 0.85rem !important;
                margin: 0 auto !important;
            }
}
/* ==========================================================================
   RECTANGULAR SEARCH INPUT & TOOLBARS
   ========================================================================== */
.search-input-group {
    max-width: 320px;
}

    .search-input-group .form-control {
        border-radius: 6px 0 0 6px !important;
        font-size: 0.875rem;
        padding-left: 0.85rem;
    }

    .search-input-group .btn {
        border-radius: 0 6px 6px 0 !important;
        padding: 0 0.85rem;
    }
/* Action Button Groups - Cosmic Primary Theme */
.action-btn-group {
    display: inline-flex;
    gap: 3px;
}

    .action-btn-group .btn {
        border-radius: 6px !important;
        padding: 0.28rem 0.55rem;
        font-size: 0.8125rem;
        background-color: var(--anyshop-primary) !important;
        border-color: var(--anyshop-primary) !important;
        color: #ffffff !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: all 0.15s ease;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

        .action-btn-group .btn i,
        .action-btn-group .btn svg {
            color: #ffffff !important;
            fill: #ffffff !important;
        }

        .action-btn-group .btn:hover {
            background-color: #801a06 !important;
            border-color: #801a06 !important;
            color: #ffffff !important;
            transform: translateY(-1px);
            box-shadow: 0 2px 6px rgba(156, 32, 7, 0.35);
        }

        .action-btn-group .btn:active {
            background-color: #661505 !important;
            border-color: #661505 !important;
            color: #ffffff !important;
            transform: translateY(0);
        }
/* Metric Cards */
.metric-card {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
    border: 1px solid var(--bs-border-color-translucent) !important;
    border-radius: 8px !important;
    background: var(--bs-body-bg);
}

    .metric-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.05) !important;
    }

.metric-icon-box {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}
/* Soft Badges */
.badge-soft-success {
    background-color: rgba(25, 135, 84, 0.12) !important;
    color: #198754 !important;
    border-radius: 4px;
}

.badge-soft-warning {
    background-color: rgba(255, 193, 7, 0.16) !important;
    color: #b58105 !important;
    border-radius: 4px;
}

.badge-soft-danger {
    background-color: rgba(220, 53, 69, 0.12) !important;
    color: #dc3545 !important;
    border-radius: 4px;
}

.badge-soft-primary {
    background-color: rgba(156, 32, 7, 0.12) !important;
    color: var(--anyshop-primary) !important;
    border-radius: 4px;
}

.badge-soft-info {
    background-color: rgba(13, 202, 240, 0.14) !important;
    color: #087990 !important;
    border-radius: 4px;
}

.badge-soft-secondary {
    background-color: rgba(108, 117, 125, 0.12) !important;
    color: #6c757d !important;
    border-radius: 4px;
}

[data-bs-theme="dark"] .badge-soft-warning {
    color: #ffc107 !important;
}

[data-bs-theme="dark"] .badge-soft-info {
    color: #0dcaf0 !important;
}
/* Enterprise Tables */
.enterprise-table {
    margin-bottom: 0;
}
/* ==========================================================================
   SELECT2 ENTERPRISE & DARK MODE STYLING
   ========================================================================== */
.select2-container .select2-selection--single,
.select2-container--bootstrap-5 .select2-selection--single {
    min-height: calc(3.5rem + 2px) !important;
    height: calc(3.5rem + 2px) !important;
    padding: 1rem 0.75rem !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    background-color: var(--bs-body-bg) !important;
    border: 1px solid var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
}

    .select2-container--default .select2-selection--single .select2-selection__rendered,
    .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
        line-height: 1.25 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        color: var(--bs-body-color) !important;
    }

    .select2-container--default .select2-selection--single .select2-selection__arrow,
    .select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
        height: 3.5rem !important;
        right: 0.75rem !important;
    }

.select2-dropdown {
    background-color: var(--bs-body-bg) !important;
    border: 1px solid var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
    border-radius: 6px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    z-index: 1060 !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field,
.select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field {
    background-color: var(--bs-body-bg) !important;
    border: 1px solid var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
    border-radius: 4px !important;
    padding: 6px 10px !important;
}

.select2-results__option {
    color: var(--bs-body-color) !important;
    padding: 8px 12px !important;
    font-size: 0.875rem !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background-color: rgba(var(--anyshop-primary-rgb, 156, 32, 7), 0.15) !important;
    color: var(--anyshop-primary) !important;
}

.select2-container--default .select2-results__option[aria-selected="true"],
.select2-container--bootstrap-5 .select2-results__option[aria-selected="true"] {
    background-color: var(--anyshop-primary) !important;
    color: #ffffff !important;
}
/* Specific Dark Mode Overrides for Select2 */
[data-bs-theme="dark"] .select2-container .select2-selection--single,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
    background-color: var(--bs-body-bg) !important;
    border-color: var(--bs-border-color) !important;
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .select2-dropdown {
    background-color: #212529 !important;
    border-color: #373b3e !important;
    color: #f8f9fa !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field {
    background-color: #1a1d20 !important;
    border-color: #495057 !important;
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .select2-results__option {
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected],
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background-color: rgba(var(--anyshop-primary-rgb, 156, 32, 7), 0.35) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"],
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option[aria-selected="true"] {
    background-color: var(--anyshop-primary) !important;
    color: #ffffff !important;
}
/* Image Preview in Form Cards */
.form-image-preview-box {
    background-color: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    margin-bottom: 1rem;
}

[data-bs-theme="dark"] .form-image-preview-box {
    background-color: rgba(255, 255, 255, 0.02);
}

.form-image-preview-box img {
    max-height: 260px;
    object-fit: contain;
    width: 100%;
    border-radius: 6px;
}
/* Product Image Thumbnails in Tables */
.product-img-thumb {
    width: 44px !important;
    height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
    border: 1px solid var(--bs-border-color-translucent);
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .product-img-thumb:hover {
        transform: scale(1.08);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    }

.product-img-placeholder {
    width: 44px !important;
    height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 6px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--bs-secondary-color);
    border: 1px solid var(--bs-border-color-translucent);
}

[data-bs-theme="dark"] .product-img-placeholder {
    background-color: rgba(255, 255, 255, 0.05);
}

.enterprise-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--bs-secondary-color);
    background-color: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

[data-bs-theme="dark"] .enterprise-table th {
    background-color: rgba(255, 255, 255, 0.02);
}

.enterprise-table td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--bs-border-color-translucent);
    font-size: 0.875rem;
}

.enterprise-table tbody tr {
    transition: background-color 0.15s ease;
}

    .enterprise-table tbody tr:hover {
        background-color: rgba(0, 0, 0, 0.015);
    }

[data-bs-theme="dark"] .enterprise-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}
/* Brand Monogram in Sidebar */
.brand-monogram {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--anyshop-primary), #c95740);
    color: #ffffff;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 2px 6px rgba(156, 32, 7, 0.3);
}
/* Empty State Boxes */
.empty-state-box {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.empty-state-icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}
/* Pagination Enterprise Styling */
.pagination .page-item .page-link {
    border-radius: 6px !important;
    margin: 0 2px;
    border: 1px solid var(--bs-border-color-translucent);
    color: var(--bs-body-color);
    font-size: 0.8125rem;
    padding: 0.35rem 0.75rem;
}

.pagination .page-item.active .page-link {
    background-color: var(--anyshop-primary);
    border-color: var(--anyshop-primary);
    color: #ffffff;
    font-weight: 600;
}
/* Stock Status Filter Group */
.stock-filter-group {
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
}

    .stock-filter-group .btn {
        font-weight: 600;
        font-size: 0.8125rem;
        padding: 0.35rem 0.75rem;
        border-radius: 6px !important;
        border: 1px solid transparent !important;
        color: var(--bs-body-color, #495057) !important;
        background-color: transparent;
        transition: all 0.15s ease-in-out;
    }

        .stock-filter-group .btn:hover {
            color: var(--bs-emphasis-color, #212529) !important;
            background-color: rgba(0, 0, 0, 0.06);
            transform: none;
        }

        .stock-filter-group .btn.active,
        .stock-filter-group .btn.btn-active-all {
            background-color: var(--anyshop-primary, #0d6efd) !important;
            color: #ffffff !important;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
        }

        .stock-filter-group .btn.btn-active-instock {
            background-color: #198754 !important;
            color: #ffffff !important;
            box-shadow: 0 1px 3px rgba(25, 135, 84, 0.25) !important;
        }

        .stock-filter-group .btn.btn-active-lowstock {
            background-color: #ffc107 !important;
            color: #000000 !important;
            box-shadow: 0 1px 3px rgba(255, 193, 7, 0.25) !important;
        }

        .stock-filter-group .btn.btn-active-outofstock {
            background-color: #dc3545 !important;
            color: #ffffff !important;
            box-shadow: 0 1px 3px rgba(220, 53, 69, 0.25) !important;
        }
/* ========================================================
   Dual Card & Table Scroll Styles (Suppliers & Vendors)
   ======================================================== */
.vendor-dual-card {
    min-height: 580px;
    min-height: calc(100vh - 375px);
    background-color: var(--bs-card-bg);
    border: 1px solid var(--bs-border-color) !important;
}

.vendor-table-scroll {
    min-height: 480px;
    max-height: calc(100vh - 475px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bs-border-color) var(--bs-body-bg);
}

    .vendor-table-scroll::-webkit-scrollbar {
        width: 6px;
    }

    .vendor-table-scroll::-webkit-scrollbar-track {
        background: var(--bs-body-bg);
    }

    .vendor-table-scroll::-webkit-scrollbar-thumb {
        background: var(--bs-border-color);
        border-radius: 4px;
    }

        .vendor-table-scroll::-webkit-scrollbar-thumb:hover {
            background: var(--bs-secondary-color);
        }
/* Dark Mode Overrides for Vendor Tables & Cards */
[data-bs-theme="dark"] .vendor-dual-card {
    background-color: var(--bs-card-bg) !important;
    border-color: var(--bs-border-color) !important;
}

[data-bs-theme="dark"] .vendor-table-scroll table thead th {
    background-color: var(--bs-tertiary-bg) !important;
    color: var(--bs-body-color) !important;
    border-color: var(--bs-border-color) !important;
}

@media (max-width: 991.98px) {
    .vendor-dual-card {
        min-height: auto;
    }

    .vendor-table-scroll {
        min-height: auto;
        max-height: 520px;
    }
}
/* ========================================================
   Enterprise Filter Toolbars & Dropdown Dialog Systems
   ======================================================== */
/* Micro Shadow Utility */
.shadow-xs {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}
/* White Button Utility (Theme-Aware) */
.btn-white {
    background-color: var(--bs-body-bg, #ffffff);
    color: var(--bs-body-color, #212529);
    border-color: var(--bs-border-color, #dee2e6);
}

    .btn-white:hover {
        background-color: var(--bs-tertiary-bg, #f8f9fa);
        color: var(--bs-body-color, #212529);
        border-color: var(--bs-border-color, #ced4da);
    }

[data-bs-theme="dark"] .btn-white {
    background-color: var(--bs-card-bg, #212529) !important;
    color: var(--bs-body-color, #f8f9fa) !important;
    border-color: var(--bs-border-color) !important;
}

    [data-bs-theme="dark"] .btn-white:hover {
        background-color: var(--bs-tertiary-bg, #2c3034) !important;
        color: #ffffff !important;
    }
/* Filter Dropdown & Entity Selector (40% desktop default) */
.filter-branch-dropdown,
.filter-dropdown-static-40 {
    position: relative;
    width: 40%;
    flex: 0 0 40%;
    min-width: 270px;
}
    /* Matching Dropdown Menu (Locks 100% to Trigger Width) */
    .filter-branch-dropdown .dropdown-menu,
    .filter-dropdown-static-40 .dropdown-menu,
    .dropdown-menu-match-parent {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
/* Dropdown Menu Scrollable & Overscroll Containment */
.dropdown-menu-scrollable {
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    overscroll-behavior: contain;
}

    .dropdown-menu-scrollable::-webkit-scrollbar {
        width: 5px;
    }

    .dropdown-menu-scrollable::-webkit-scrollbar-track {
        background: transparent;
    }

    .dropdown-menu-scrollable::-webkit-scrollbar-thumb {
        background: var(--bs-border-color);
        border-radius: 4px;
    }

        .dropdown-menu-scrollable::-webkit-scrollbar-thumb:hover {
            background: var(--bs-secondary-color);
        }
/* Filter Bar Responsive Sizing Columns */
.filter-search-col {
    flex: 1 1 auto;
    min-width: 170px;
}

.filter-category-select,
.filter-category-dropdown {
    width: 155px;
    flex: 0 0 155px;
}

.filter-sort-select,
.filter-sort-dropdown {
    width: 160px;
    flex: 0 0 160px;
}
/* Responsive Breakpoints for Enterprise Filter Toolbars */
@media (max-width: 1199.98px) {
    .filter-branch-dropdown,
    .filter-dropdown-static-40 {
        width: 100% !important;
        flex: 1 1 100% !important;
    }

    .filter-search-col {
        flex: 1 1 200px !important;
    }

    .filter-category-select,
    .filter-category-dropdown {
        flex: 1 1 150px !important;
        width: auto !important;
    }

    .filter-sort-select,
    .filter-sort-dropdown {
        flex: 1 1 150px !important;
        width: auto !important;
    }
}
/* ========================================================
   Enterprise Form Select & Custom Dropdown Refinements
   ======================================================== */
.form-select.form-select-sm {
    height: 31px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    font-size: 0.8125rem;
    border-radius: 6px;
    border-color: var(--bs-border-color, #dee2e6);
    background-color: var(--bs-body-bg, #ffffff);
    color: var(--bs-body-color, #212529);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

    .form-select.form-select-sm:focus {
        border-color: var(--anyshop-primary, #9C2007);
        box-shadow: 0 0 0 0.2rem rgba(156, 32, 7, 0.15);
        outline: none;
    }
/* Custom Dropdown Trigger Button Height & Flex Alignment */
.dropdown .btn-white.dropdown-toggle.btn-sm {
    height: 31px;
    line-height: 1.5;
    padding: 0.25rem 0.65rem;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
}

    .dropdown .btn-white.dropdown-toggle.btn-sm::after {
        margin-left: 0.5rem;
        vertical-align: middle;
    }

[data-bs-theme="dark"] .form-select.form-select-sm {
    background-color: var(--bs-body-bg, #1e2227);
    border-color: var(--bs-border-color, #343a40);
    color: var(--bs-body-color, #e9ecef);
}
/* ========================================================
   Branch Selector Dropdown Utility (Enterprise Pattern)
   Expanded precision width: 280px with matching dropdown menu
   ======================================================== */
.branch-filter-dropdown {
    position: relative;
    width: 280px;
    max-width: 280px;
    flex-shrink: 0;
}

    .branch-filter-dropdown .btn-white.dropdown-toggle,
    .branch-filter-dropdown .dropdown-toggle {
        height: 31px;
        line-height: 1.5;
        padding: 0.25rem 0.65rem;
        font-size: 0.8125rem;
        display: inline-flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        background-color: var(--bs-body-bg, #ffffff);
        border-color: var(--bs-border-color, #dee2e6);
    }

        .branch-filter-dropdown .branch-filter-text,
        .branch-filter-dropdown .dropdown-toggle > span > span {
            max-width: 215px;
            text-overflow: ellipsis;
            overflow: hidden;
            white-space: nowrap;
            display: inline-block;
            vertical-align: middle;
        }

    .branch-filter-dropdown .dropdown-menu {
        width: 280px !important;
        min-width: 280px !important;
        max-width: 280px !important;
        box-sizing: border-box !important;
        z-index: 1060 !important;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    }

    .branch-filter-dropdown .dropdown-item {
        font-size: 0.8125rem;
        padding: 0.45rem 0.75rem;
        transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
    }

        .branch-filter-dropdown .dropdown-item.active,
        .branch-filter-dropdown .dropdown-item:active {
            background-color: var(--anyshop-primary, #9C2007) !important;
            color: #ffffff !important;
        }

            .branch-filter-dropdown .dropdown-item.active i,
            .branch-filter-dropdown .dropdown-item:active i {
                color: #ffffff !important;
            }

/* ========================================================
   Report Type Selector Dropdown Utility (Enterprise Pattern)
   Scoped precision width: 170px matching branch-filter-dropdown aesthetic
   ======================================================== */
.report-type-selector.branch-filter-dropdown,
.report-type-dropdown {
    width: 170px !important;
    min-width: 160px !important;
    max-width: 185px !important;
}

    .report-type-selector.branch-filter-dropdown .dropdown-toggle,
    .report-type-dropdown .dropdown-toggle {
        width: 100%;
    }

    .report-type-selector.branch-filter-dropdown .report-type-text,
    .report-type-dropdown .report-type-text {
        max-width: 115px;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        display: inline-block;
        vertical-align: middle;
    }

    .report-type-selector.branch-filter-dropdown .dropdown-menu,
    .report-type-dropdown .dropdown-menu {
        width: 175px !important;
        min-width: 165px !important;
        max-width: 195px !important;
    }

@media (max-width: 576px) {
    .branch-filter-dropdown,
    .report-type-selector.branch-filter-dropdown,
    .report-type-dropdown {
        width: 100% !important;
        max-width: 100% !important;
    }

        .branch-filter-dropdown .dropdown-menu,
        .report-type-selector.branch-filter-dropdown .dropdown-menu,
        .report-type-dropdown .dropdown-menu {
            width: 100% !important;
            min-width: 100% !important;
            max-width: 100% !important;
        }

        .branch-filter-dropdown .branch-filter-text,
        .branch-filter-dropdown .dropdown-toggle > span > span {
            max-width: calc(100vw - 120px);
        }

        .report-type-selector.branch-filter-dropdown .report-type-text,
        .report-type-dropdown .report-type-text {
            max-width: calc(100vw - 120px);
        }
}
/* ========================================================
   Enterprise Modal Dialogs
   ======================================================== */
.modal.enterprise-modal .modal-content,
.enterprise-dialog .modal-content {
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: 12px;
    box-shadow: 0 0.5rem 1.75rem rgba(0, 0, 0, 0.15);
    background-color: var(--bs-body-bg);
}

.modal.enterprise-modal .modal-header,
.enterprise-dialog .modal-header {
    border-bottom: 1px solid var(--bs-border-color);
    padding: 1rem 1.25rem;
}

.modal.enterprise-modal .modal-footer,
.enterprise-dialog .modal-footer {
    border-top: 1px solid var(--bs-border-color);
    padding: 0.75rem 1.25rem;
}
/* ========================================================
   Custom Confirm Modals (_ConfirmDialogNegative / Positive / Warn)
   ======================================================== */
.modal.custom-confirm-modal {
    z-index: 1080 !important;
}

.custom-confirm-modal .modal-content {
    border-radius: 12px !important;
    background-color: var(--bs-body-bg, #ffffff) !important;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.22) !important;
}

.custom-confirm-modal .confirm-message {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--bs-body-color, #212529);
}
/* ========================================================
   Enterprise Themed Datepicker Component
   Styled with branded red calendar button matching screenshot
   ======================================================== */
.date-picker-group {
    display: inline-flex;
    align-items: stretch;
    height: 31px;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 6px;
    background-color: var(--bs-body-bg, #ffffff);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

    .date-picker-group:focus-within {
        border-color: var(--anyshop-primary, #9C2007);
        box-shadow: 0 0 0 0.2rem rgba(156, 32, 7, 0.15);
    }

    .date-picker-group .date-input {
        flex: 1 1 auto;
        border: none;
        outline: none;
        background-color: transparent;
        color: var(--bs-body-color, #212529);
        font-size: 0.8125rem;
        padding: 0.15rem 0.5rem;
        min-width: 0;
        line-height: 1.5;
    }

        .date-picker-group .date-input:focus {
            outline: none;
            box-shadow: none;
        }
        /* Hide native browser date picker indicator so our custom branded button acts as the trigger */
        .date-picker-group .date-input::-webkit-calendar-picker-indicator {
            opacity: 0;
            width: 0;
            margin: 0;
            padding: 0;
            cursor: pointer;
        }

    .date-picker-group .date-addon-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 0.65rem;
        background-color: var(--anyshop-primary, #9C2007);
        color: #ffffff !important;
        border: none;
        cursor: pointer;
        font-size: 0.85rem;
        transition: background-color 0.15s ease-in-out;
        border-top-right-radius: 5px;
        border-bottom-right-radius: 5px;
    }

        .date-picker-group .date-addon-btn:hover {
            background-color: #801a06;
            color: #ffffff !important;
        }

        .date-picker-group .date-addon-btn:active {
            background-color: #731805;
        }
/* Dark mode adjustments */
[data-bs-theme="dark"] .date-picker-group {
    background-color: var(--bs-body-bg, #1e2227);
    border-color: var(--bs-border-color, #343a40);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

    [data-bs-theme="dark"] .date-picker-group .date-input {
        color: var(--bs-body-color, #e9ecef);
    }

        [data-bs-theme="dark"] .date-picker-group .date-input::-webkit-calendar-picker-indicator {
            filter: invert(1);
        }
/* ==========================================================================
   Consolidated Form Group & Validation Architecture (Zero Layout Shift)
   ========================================================================== */
.form-group-unified {
    margin-bottom: 1rem;
}

.form-header-unified,
.form-group .d-flex.justify-content-between.align-items-center.mb-1 {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 0.25rem !important;
}

    .form-label-unified,
    .form-header-unified .form-label,
    .form-group .d-flex.justify-content-between.align-items-center.mb-1 .form-label {
        margin-bottom: 0 !important;
        font-size: 0.8125rem !important;
        font-weight: 600 !important;
        color: var(--bs-body-color);
    }

    .form-validation-unified,
    .form-header-unified .text-danger,
    .form-group .d-flex.justify-content-between.align-items-center.mb-1 .text-danger,
    .field-validation-error {
        font-size: 0.75rem !important;
        color: var(--bs-danger) !important;
        font-weight: 500;
    }
/* Ensure clean unobtrusive validation display */
.field-validation-valid {
    display: none !important;
}

.field-validation-error {
    display: inline-block !important;
}
/* Modern real-time input error glow on validation failure */
.form-group:has(.field-validation-error) .form-control,
.form-group:has(.field-validation-error) .form-select,
.form-group:has(.field-validation-error) .form-dropdown-toggle,
.form-group-unified:has(.field-validation-error) .form-control,
.form-group-unified:has(.field-validation-error) .form-select {
    border-color: var(--bs-danger) !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15) !important;
}
/* Dark mode token harmonization */
[data-bs-theme="dark"] .form-header-unified .form-label,
[data-bs-theme="dark"] .form-group .d-flex.justify-content-between.align-items-center.mb-1 .form-label {
    color: var(--bs-body-color) !important;
}

.product-name-clamp {
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    line-height: 1.4;
}
