/* =========================================================================
   FoodApp Device-Adaptive UI & Parallel Light/Dark Theme System (common.css)
   - Mobile (< 768px): Purpose-Built Entity Cards (Matches Reference Design)
   - Tablet (768px - 991px): 2-Column Grids + Responsive Tables + Bottom Nav
   - Laptop & Desktop (>= 992px): Persistent Sidebar / Top Nav + 3-Col Grids + Full Tables
   ========================================================================= */

/* 1. Parallel Light & Dark Theme Tokens */
:root,
[data-theme="light"] {
    --primary: #ea580c;
    --primary-dark: #c2410c;
    --primary-soft: #fff2e8;
    --accent-gold: #fbbf24;
    --accent-green: #16a34a;
    --bg-light: #f8f8f6;
    --bg-white: #ffffff;
    --bg-elevated: #f1f5f9;
    --text-dark: #18181b;
    --text-muted: #71717a;
    --border-color: #e4e4e7;
    --border-subtle: #f1f1f4;
    --shadow-soft: 0 4px 18px rgba(15, 23, 42, 0.04);
    --shadow-elevated: 0 14px 34px rgba(15, 23, 42, 0.09);
}

[data-theme="dark"] {
    --primary: #fb923c;
    --primary-dark: #f97316;
    --primary-soft: rgba(251, 146, 60, 0.16);
    --accent-gold: #fbbf24;
    --accent-green: #22c55e;
    --bg-light: #0b1120;
    --bg-white: #1e293b;
    --bg-elevated: #0f172a;
    --text-dark: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.11);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --shadow-soft: 0 8px 26px rgba(0, 0, 0, 0.35);
    --shadow-elevated: 0 16px 40px rgba(0, 0, 0, 0.50);
}

/* 2. Global Reset & Theme-Aware Base Elements */
*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-light) !important;
    color: var(--text-dark) !important;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.25s ease, color 0.25s ease;
    overflow-x: hidden;
}

/* Dark Theme Overrides for Bootstrap Controls & Surfaces */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .input-group-text,
[data-theme="dark"] .app-input {
    background-color: var(--bg-elevated) !important;
    border-color: var(--border-color) !important;
    color: var(--text-dark) !important;
}

[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] .app-input::placeholder {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .modal-content,
[data-theme="dark"] .card,
[data-theme="dark"] .bg-white {
    background-color: var(--bg-white) !important;
    color: var(--text-dark) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .bg-light,
[data-theme="dark"] .table-light,
[data-theme="dark"] .table-light > th,
[data-theme="dark"] .table-light > td {
    background-color: var(--bg-elevated) !important;
    color: var(--text-dark) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .btn-light,
[data-theme="dark"] .app-btn-light {
    background-color: var(--bg-elevated) !important;
    border-color: var(--border-color) !important;
    color: var(--text-dark) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .text-dark {
    color: var(--text-dark) !important;
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* 3. Multi-Device Adaptive App Shell */
.app-wrapper {
    min-height: 100vh !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: stretch !important;
    background: var(--bg-light) !important;
}

.app-container {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    background: var(--bg-light) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
}

/* Login Card on Tablet, Laptop & Desktop */
.app-container.login-bg {
    background: var(--bg-white) !important;
}

@media (min-width: 768px) {
    .app-wrapper:has(.login-bg) {
        align-items: center !important;
        padding: 24px !important;
        background: radial-gradient(circle at top right, rgba(234, 88, 12, 0.12), transparent 45%),
                    radial-gradient(circle at bottom left, rgba(234, 88, 12, 0.08), transparent 45%),
                    var(--bg-light) !important;
    }

    .app-container.login-bg {
        max-width: 450px !important;
        min-height: 620px !important;
        height: auto !important;
        border-radius: 28px !important;
        box-shadow: var(--shadow-elevated) !important;
        border: 1px solid var(--border-color) !important;
        margin: auto !important;
        overflow: hidden !important;
    }
}

/* 4. Adaptive Top Header & Content Area */
.app-header {
    height: 62px;
    min-height: 62px;
    background: var(--bg-white) !important;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1025;
    padding: 0 16px !important;
}

@media (min-width: 992px) {
    .app-header {
        padding: 0 32px !important;
    }
}

#headerTitle, #headerLocation {
    font-size: 0.86rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.015em;
    color: var(--text-dark);
    line-height: 1.25;
}

@media (max-width: 767.98px) {
    .app-header {
        padding: 0 12px !important;
        height: 56px;
        min-height: 56px;
    }

    .admin-mobile-toggle,
    #btnBack:not(.d-none),
    #themeToggleWrap {
        display: inline-flex !important;
        width: 34px;
        height: 34px;
        border-radius: 10px;
        flex-shrink: 0;
    }

    #addBtn {
        height: 32px !important;
        padding: 0 11px !important;
        font-size: 0.76rem !important;
    }
}

@media (max-width: 380px) {
    #headerTitle, #headerLocation {
        font-size: 0.80rem !important;
    }
}

@media (min-width: 768px) {
    #headerTitle, #headerLocation {
        font-size: 1.15rem !important;
    }
}

.mobile-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Desktop Top Nav Links (For Student & Canteen Portals on Laptop/Desktop) */
.desktop-top-nav {
    display: none;
    align-items: center;
    gap: 8px;
}

@media (min-width: 992px) {
    .desktop-top-nav {
        display: flex;
    }
}

.desktop-top-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.desktop-top-nav a:hover,
.desktop-top-nav a.active {
    background: var(--primary-soft);
    color: var(--primary);
}

.app-content {
    flex: 1 1 auto !important;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 14px 14px 92px 14px !important;
    overflow-y: visible !important;
}

@media (min-width: 768px) {
    .app-content {
        padding: 22px 24px 96px 24px !important;
    }
}

@media (min-width: 992px) {
    .app-content {
        padding: 28px 32px 48px 32px !important;
    }
}

/* 5. Bottom Navigation Bar (Visible on Mobile/Tablet < 992px, Hidden on Laptop/Desktop >= 992px)
   Matches precise design: Flat white bar, subtle border, transparent active background, outline icons & signature orange top indicator pill */
.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 60px !important;
    background: #ffffff !important;
    border-radius: 0 !important;
    border-top: 1px solid #e2e8f0 !important;
    box-shadow: 0 -1px 4px rgba(15, 23, 42, 0.04) !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: stretch !important;
    padding: 0 4px !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    z-index: 1030 !important;
}

[data-theme="dark"] .bottom-nav {
    background: #181d26 !important;
    border-top-color: #262d3d !important;
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.3) !important;
}

@media (min-width: 992px) {
    .bottom-nav {
        display: none !important;
    }
}

.bottom-nav .nav-item {
    position: relative !important;
    flex: 1 1 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    padding: 6px 4px 4px !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #64748b !important;
    text-decoration: none !important;
    font-size: 0.72rem !important;
    font-weight: 500 !important;
    transition: color 0.18s ease !important;
    user-select: none !important;
    cursor: pointer !important;
}

[data-theme="dark"] .bottom-nav .nav-item {
    color: #94a3b8 !important;
}

/* Signature Active Top Indicator Line from user design image */
.bottom-nav .nav-item::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 0 !important;
    height: 3.5px !important;
    background: #ea580c !important;
    border-radius: 0 0 3px 3px !important;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease !important;
}

.bottom-nav .nav-item i {
    font-size: 1.32rem !important;
    line-height: 1 !important;
    color: #64748b !important;
    transition: color 0.18s ease, transform 0.18s ease !important;
    display: inline-block !important;
}

[data-theme="dark"] .bottom-nav .nav-item i {
    color: #94a3b8 !important;
}

.bottom-nav .nav-item div,
.bottom-nav .nav-item span {
    font-size: 0.72rem !important;
    line-height: 1 !important;
    font-weight: 500 !important;
    color: #64748b !important;
    transition: color 0.18s ease !important;
    white-space: nowrap !important;
}

[data-theme="dark"] .bottom-nav .nav-item div,
[data-theme="dark"] .bottom-nav .nav-item span {
    color: #94a3b8 !important;
}

/* Active State: Orange text, orange outline icon, orange top indicator pill, 100% transparent background */
.bottom-nav .nav-item.active {
    color: #ea580c !important;
    background: transparent !important;
}

.bottom-nav .nav-item.active::before {
    width: 36px !important;
    background: #ea580c !important;
}

[data-theme="dark"] .bottom-nav .nav-item.active::before {
    background: #fb923c !important;
}

.bottom-nav .nav-item.active i {
    color: #ea580c !important;
}

[data-theme="dark"] .bottom-nav .nav-item.active i {
    color: #fb923c !important;
}

.bottom-nav .nav-item.active div,
.bottom-nav .nav-item.active span {
    color: #ea580c !important;
    font-weight: 600 !important;
}

[data-theme="dark"] .bottom-nav .nav-item.active div,
[data-theme="dark"] .bottom-nav .nav-item.active span {
    color: #fb923c !important;
}

/* 6. Hero Promo Banner, Wallet Card & Offer Carousel */
.wallet-card, .mobile-hero-banner {
    background: linear-gradient(135deg, #b83812 0%, #ea580c 55%, #f97316 100%) !important;
    border-radius: 22px !important;
    padding: 20px 22px !important;
    color: #ffffff !important;
    box-shadow: 0 12px 28px rgba(234, 88, 12, 0.24) !important;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wallet-card::after, .mobile-hero-banner::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    right: -35px;
    top: -35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    pointer-events: none;
}

.offer-card {
    min-width: 290px !important;
    background: linear-gradient(135deg, #b83812 0%, #ea580c 55%, #f97316 100%) !important;
    border-radius: 22px !important;
    padding: 16px 18px !important;
    box-shadow: 0 10px 24px rgba(234, 88, 12, 0.22) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.offer-badge {
    display: inline-block;
    background: var(--accent-gold) !important;
    color: #18181b !important;
    font-weight: 700 !important;
    font-size: 0.72rem !important;
    padding: 3px 10px !important;
    border-radius: 999px !important;
    margin-bottom: 6px;
}

.offer-right img {
    width: 80px !important;
    height: 80px !important;
    border-radius: 18px !important;
    object-fit: cover !important;
    border: 2px solid rgba(255, 255, 255, 0.35);
}

/* 7. Search Bar (Matches Reference Image: Left Magnifying Glass, Clean Rounded Input) */
.mobile-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.search-box {
    flex: 1;
    background: var(--bg-white) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    padding: 11px 16px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.02) !important;
    display: flex !important;
    flex-direction: row-reverse !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
}

.search-box input {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    width: 100%;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 0.88rem;
    color: var(--text-dark) !important;
}

.search-box input::placeholder {
    color: var(--text-muted) !important;
}

.search-box i {
    position: static !important;
    transform: none !important;
    color: var(--text-muted) !important;
    font-size: 0.95rem !important;
}

.filter-pill-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #5e8c61;
    color: #ffffff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 6px 14px rgba(94, 140, 97, 0.28);
    flex-shrink: 0;
}

.tabs, .tab-switch {
    position: relative !important;
    top: auto !important;
    z-index: 1 !important;
    background: var(--bg-white) !important;
    padding: 5px !important;
    border-radius: 999px !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-soft) !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100%;
    width: fit-content;
    cursor: grab;
    user-select: none;
}

.tabs::-webkit-scrollbar, .tab-switch::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.tabs .tab, .tab-switch .tab {
    flex: 1 0 auto !important;
    text-align: center;
    border-radius: 999px !important;
    font-weight: 600 !important;
    font-size: 0.78rem !important;
    padding: 8px 14px !important;
    transition: all 0.2s ease;
    white-space: nowrap !important;
    cursor: pointer;
    color: var(--text-muted) !important;
    border: none;
    background: transparent;
}

.tabs .tab.active, .tab-switch .tab.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.28) !important;
    transform: none !important;
}

@media (max-width: 767.98px) {
    .tabs, .tab-switch {
        max-width: 100% !important;
        margin-left: 0;
        margin-right: 0;
    }
}

/* 8. KPI Summary Cards & Quick Action Squircles */
.report-card {
    background: var(--bg-white) !important;
    border-radius: 20px !important;
    padding: 16px !important;
    box-shadow: var(--shadow-soft) !important;
    border: 1px solid var(--border-color) !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.report-card .icon {
    width: 46px !important;
    height: 46px !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.25rem !important;
    flex-shrink: 0 !important;
}

.report-card .title {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    margin: 0 !important;
}

.report-card .count {
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    color: var(--text-dark) !important;
    line-height: 1.2 !important;
}

.report-card .sub {
    font-size: 0.71rem !important;
    color: var(--text-muted) !important;
}

.action-card {
    background: var(--bg-white) !important;
    border-radius: 18px !important;
    padding: 14px 10px !important;
    text-align: center !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-soft) !important;
    transition: transform 0.2s ease !important;
    color: var(--text-dark) !important;
}

.action-card i {
    width: 44px;
    height: 44px;
    margin: 0 auto 8px auto;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.action-card div {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* 9. Adaptive Card Grids (1-Col Mobile, 2-Col Tablet, 3-Col Laptop/Desktop) */
.menu-list, .order-list, .item-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
}

@media (min-width: 768px) {
    .menu-list, .order-list, .item-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}

@media (min-width: 1200px) {
    .menu-list, .order-list, .item-list {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.menu-card, .order-card, .item-card, .restaurant-card {
    background: var(--bg-white) !important;
    border-radius: 20px !important;
    padding: 14px 16px !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-soft) !important;
    color: var(--text-dark) !important;
    transition: all 0.2s ease !important;
    margin-bottom: 0 !important;
}

.menu-card .menu-left i {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

/* =========================================================================
   10. DEVICE-SPECIFIC DATA PRESENTATION:
       - Desktop/Laptop/Tablet (>= 768px): Clean Enterprise Data Table
       - Mobile (< 768px): Purpose-Built Entity Cards (Matches Reference Image!)
   ========================================================================= */

/* Section Header & Count Pill ("All restaurants" + "1 total") */
.admin-section-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.admin-section-title span i {
    color: var(--primary);
}

.m-total-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

/* Desktop & Tablet Table View (>= 768px) */
@media (min-width: 768px) {
    .admin-table-card {
        background: var(--bg-white) !important;
        border-radius: 20px !important;
        padding: 20px 22px !important;
        box-shadow: var(--shadow-soft) !important;
        margin-bottom: 20px !important;
        border: 1px solid var(--border-color) !important;
    }

    .admin-section-title {
        padding-bottom: 12px;
        border-bottom: 1px solid var(--border-color);
    }

    .table-admin {
        font-size: 0.86rem;
        margin-bottom: 0;
        color: var(--text-dark) !important;
    }

    .table-admin thead th {
        background: var(--bg-elevated) !important;
        color: var(--text-muted) !important;
        font-weight: 600;
        font-size: 0.74rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        padding: 10px 10px;
        white-space: nowrap;
        border-bottom: 2px solid var(--border-color) !important;
    }

    .table-admin tbody td {
        padding: 10px 10px;
        vertical-align: middle;
        white-space: nowrap;
        border-bottom: 1px solid var(--border-subtle) !important;
        color: var(--text-dark) !important;
        background: transparent !important;
    }

    .table-admin tbody tr:hover {
        background-color: var(--primary-soft) !important;
    }

    .m-entity-card-list {
        display: none !important;
    }
}

.item-table-thumb {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--bg-soft);
}

/* Mobile Entity Card View (< 768px) — Matches User's Reference Image */
@media (max-width: 767.98px) {
    .admin-table-card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 2px 0 !important;
        margin-bottom: 18px !important;
    }

    .admin-section-title > button.btn,
    .admin-section-title > a.btn {
        display: none !important;
    }

    .admin-section-title .m-total-pill {
        margin-right: 0 !important;
    }

    /* Hide raw table on mobile when mobile entity cards are rendered */
    .admin-table-card .table-responsive.has-mobile-cards {
        display: none !important;
    }

    .m-entity-card-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
}

/* Universal Entity Card & Status Pill Styles (Available on All Viewports) */
.m-entity-card,
.mobile-entity-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: var(--shadow-soft);
    transition: all 0.18s ease;
    cursor: pointer;
}

.m-entity-card:hover,
.mobile-entity-card:hover {
    border-color: rgba(234, 88, 12, 0.32);
    box-shadow: var(--shadow-elevated);
}

.entity-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.entity-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text-dark);
}

.entity-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.m-entity-card.m-collapsible .m-entity-head {
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 0;
    align-items: center;
}

.m-entity-card.m-collapsible .m-entity-body {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    animation: fadeInCardBody 0.18s ease;
}

.m-entity-card.m-collapsible.expanded {
    border-color: rgba(232, 93, 4, 0.35);
}

.m-entity-card.m-collapsible.expanded .m-entity-body {
    display: block;
}

@keyframes fadeInCardBody {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.m-entity-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 12px;
}

.m-entity-head-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.m-entity-head-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.m-expand-chevron {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    transition: all 0.2s ease;
}

.m-entity-card.m-collapsible.expanded .m-expand-chevron {
    background: var(--primary-soft);
    color: var(--primary);
    transform: rotate(180deg);
}

.m-entity-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.m-entity-thumb {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.m-entity-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.m-entity-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.25;
    margin-bottom: 2px;
    word-break: break-word;
}

.m-entity-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.m-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.m-status-pill .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.m-status-pill.active {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

[data-theme="dark"] .m-status-pill.active {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
}

.m-status-pill.active .dot {
    background: #16a34a;
}

.m-status-pill.inactive {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

[data-theme="dark"] .m-status-pill.inactive {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
}

.m-status-pill.inactive .dot {
    background: #dc2626;
}

.m-status-pill.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

[data-theme="dark"] .m-status-pill.pending {
    background: rgba(245, 158, 11, 0.22);
    color: #fbbf24;
}

.m-status-pill.pending .dot {
    background: #f59e0b;
}

.m-status-pill.amount {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
}

.m-entity-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.m-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.m-meta-label {
    color: var(--text-muted);
    font-weight: 400;
    flex-shrink: 0;
}

.m-meta-val {
    color: var(--text-dark);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

.m-meta-val.not-provided {
    color: var(--text-muted);
    font-weight: 400;
}

.m-entity-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 2px;
}

.btn-m-edit {
    flex: 1;
    height: 42px;
    border-radius: 12px;
    border: 1.5px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s ease;
}

.btn-m-edit:hover, .btn-m-edit:active {
    background: var(--primary-soft);
    color: var(--primary);
}

.btn-m-more {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
}

.m-grand-total-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-white);
    border: 1.5px solid var(--primary);
    border-radius: 16px;
    padding: 12px 16px;
    font-weight: 700;
    color: var(--text-dark);
}

/* 11. Modern Profile Page Components (Matches Reference Profile Design) */
.m-profile-wrap {
    max-width: 540px;
    margin: 0 auto;
}

.m-profile-hero-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 26px 20px 18px 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    margin-bottom: 16px;
}

.m-profile-avatar {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e06324 0%, #ea580c 100%);
    border: 4px solid #fde6d5;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.35rem;
    margin-bottom: 12px;
}

[data-theme="dark"] .m-profile-avatar {
    border-color: rgba(251, 146, 60, 0.28);
}

.m-profile-name {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.m-role-pill {
    display: inline-block;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 4px 16px;
    border-radius: 999px;
}

.m-profile-stats {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    margin-top: 18px;
    padding-top: 14px;
}

.m-profile-stat-col {
    flex: 1;
    text-align: center;
}

.m-profile-stat-col + .m-profile-stat-col {
    border-left: 1px solid var(--border-subtle);
}

.m-profile-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.m-profile-stat-val {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-dark);
}

.m-profile-list-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    margin-bottom: 16px;
}

.m-profile-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    cursor: pointer;
    transition: background-color 0.18s ease;
    text-decoration: none;
    color: var(--text-dark);
}

.m-profile-item + .m-profile-item {
    border-top: 1px solid var(--border-subtle);
}

.m-profile-item:hover,
.m-profile-item:active {
    background: var(--bg-elevated);
}

.m-profile-item-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.m-profile-item-body {
    flex: 1;
    min-width: 0;
}

.m-profile-item-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.25;
}

.m-profile-item-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.m-profile-item-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.m-logout-btn {
    width: 100%;
    height: 50px;
    border-radius: 16px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-weight: 600;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.m-logout-btn:hover,
.m-logout-btn:active {
    background: #fee2e2;
}

[data-theme="dark"] .m-logout-btn {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.30);
    color: #f87171;
}

/* Filter Card Box (Stays white/surface on both Mobile and Desktop) */
.m-filter-card {
    background: var(--bg-white) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 20px !important;
    padding: 16px 18px !important;
    box-shadow: var(--shadow-soft) !important;
    margin-bottom: 18px !important;
}

/* =========================================================================
   12. MODERN MODAL / POPUP DIALOG SYSTEM (.app-modal)
   ========================================================================= */
.modal-backdrop.show {
    opacity: 0.55 !important;
    backdrop-filter: blur(3px);
}

.app-modal {
    background: var(--bg-white) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 24px !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22) !important;
    overflow: hidden;
    padding: 4px !important;
}

.app-modal .modal-header {
    padding: 18px 20px 14px 20px !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-modal .modal-title {
    font-size: 1.08rem !important;
    font-weight: 700 !important;
    color: var(--text-dark) !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-modal .btn-close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background-color: var(--bg-elevated) !important;
    opacity: 0.85;
    padding: 0 !important;
    margin: 0 !important;
    background-size: 11px;
}

.app-modal .modal-body {
    padding: 18px 20px 20px 20px !important;
    max-height: 78vh;
    overflow-y: auto;
}

/* Stack 2-column modal rows into full-width 1-column on Mobile (< 576px) so text never truncates */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 12px !important;
    }

    .app-modal .modal-body .row > .col-6 {
        width: 100% !important;
        flex: 0 0 100% !important;
    }
}

.app-modal .form-label {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    margin-bottom: 5px !important;
    display: block;
}

.app-input {
    width: 100%;
    height: 45px !important;
    border-radius: 13px !important;
    border: 1.5px solid var(--border-color) !important;
    background-color: var(--bg-elevated) !important;
    color: var(--text-dark) !important;
    padding: 0 14px !important;
    font-size: 0.90rem !important;
    font-weight: 500 !important;
    transition: all 0.18s ease !important;
    outline: none !important;
}

.app-input:focus {
    background-color: var(--bg-white) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-soft) !important;
}

.app-input:disabled,
.app-input[readonly] {
    opacity: 0.72;
    cursor: not-allowed;
}

.input-group {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    width: 100%;
}

.input-group > .input-group-text,
.input-group > .form-control,
.input-group > .app-input,
.input-group > .form-select,
.input-group > .btn {
    height: 48px !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
}

.input-group.input-group-sm > .input-group-text,
.input-group.input-group-sm > .form-control,
.input-group.input-group-sm > .app-input,
.input-group.input-group-sm > .form-select,
.input-group.input-group-sm > .btn {
    height: 36px !important;
    min-height: 36px !important;
}

.input-group > :first-child {
    border-top-left-radius: 12px !important;
    border-bottom-left-radius: 12px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > :last-child {
    border-top-right-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group > :not(:first-child):not(:last-child) {
    border-radius: 0 !important;
}

.input-group > .input-group-text {
    border: 1.5px solid var(--border-color);
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 14px !important;
    flex-shrink: 0;
}

.input-group > .input-group-text:first-child {
    border-right: 0 !important;
}

.input-group > .input-group-text:last-child,
.input-group > .btn:last-child {
    border-left: 0 !important;
}

.input-group > .app-input,
.input-group > .form-control {
    flex: 1 1 auto !important;
    width: 1% !important;
    min-width: 0 !important;
    margin-bottom: 0 !important;
}

[data-theme="dark"] .app-modal .btn-close {
    filter: invert(1);
    background-color: rgba(255, 255, 255, 0.85) !important;
}

/* Modern Switch Row inside Modals */
.app-modal .form-switch {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 11px 14px 11px 56px !important;
    display: flex;
    align-items: center;
    min-height: 46px;
}

.app-modal .form-switch .form-check-input {
    width: 2.3em !important;
    height: 1.25em !important;
    margin-left: -2.85em !important;
    margin-right: 10px !important;
    margin-top: 0 !important;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.app-modal .form-switch .form-check-label {
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    color: var(--text-dark) !important;
    cursor: pointer;
}

/* Modal Primary & Cancel Buttons */
.app-btn-primary {
    background: linear-gradient(135deg, #ea580c 0%, #f97316 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 14px !important;
    height: 46px !important;
    font-size: 0.92rem !important;
    font-weight: 600 !important;
    box-shadow: 0 6px 18px rgba(234, 88, 12, 0.25) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.16s ease, box-shadow 0.16s ease !important;
}

.app-btn-primary:hover,
.app-btn-primary:active {
    transform: translateY(-1px);
    color: #ffffff !important;
}

.app-btn-light {
    background: var(--bg-elevated) !important;
    color: var(--text-dark) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    height: 44px !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
}

/* 13. Status Badges & Global Loader */
.badge-status-active {
    background: rgba(22, 163, 74, 0.14);
    color: #15803d;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
}

[data-theme="dark"] .badge-status-active {
    color: #4ade80;
}

.badge-status-inactive {
    background: rgba(220, 38, 38, 0.14);
    color: #b91c1c;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
}

[data-theme="dark"] .badge-status-inactive {
    color: #f87171;
}

#apiGlobalLoader {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.api-loader-box {
    background: var(--bg-white);
    padding: 22px 32px;
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    text-align: center;
}

/* 14. Global Autofill Fix (Never change input background/text color on focus or autofill) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-elevated) inset !important;
    -webkit-text-fill-color: var(--text-dark) !important;
    caret-color: var(--text-dark) !important;
    transition: background-color 9999s ease-in-out 0s;
}

/* 15. BI Analytics Report Design (Matches Reference Image + Hidden Scrollbar Swipe Chips) */
.bi-filter-shell {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 14px 14px 12px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-soft);
}

.bi-date-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.bi-date-field {
    flex: 1;
    min-width: 0;
    position: relative;
}

.bi-date-field label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.bi-date-field input.app-input {
    height: 38px !important;
    font-size: 0.80rem !important;
    padding: 0 10px !important;
    border-radius: 10px !important;
}

.bi-refresh-btn {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: none;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 17px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(232, 93, 4, 0.22);
    transition: transform 0.15s ease;
}

.bi-refresh-btn:active {
    transform: scale(0.95);
}

/* Swipeable Chip Bar with Hidden Scrollbar */
.bi-chip-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 4px;
    cursor: grab;
    user-select: none;
}

.bi-chip-scroll::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.bi-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-dark);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.18s ease;
}

.bi-chip.active {
    background: #b84a14;
    border-color: #b84a14;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(184, 74, 20, 0.24);
}

/* BI Section Block */
.bi-sec-wrap {
    margin-bottom: 20px;
}

.bi-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 2px 10px;
    cursor: pointer;
    user-select: none;
}

.bi-sec-head-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bi-sec-mini-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.bi-sec-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-dark);
}

.bi-sec-head-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bi-sec-chevron {
    color: var(--primary);
    font-size: 0.82rem;
    transition: transform 0.2s ease;
}

.bi-sec-wrap.collapsed .bi-sec-chevron {
    transform: rotate(180deg);
    color: var(--text-muted);
}

.bi-sec-wrap.collapsed .bi-group-card {
    display: none;
}

/* Grouped White Card for BI Items */
.bi-group-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.bi-row-item {
    border-bottom: 1px solid var(--border-subtle);
}

.bi-row-item:last-child {
    border-bottom: none;
}

.bi-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 15px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.bi-row-head:hover {
    background: var(--bg-soft);
}

.bi-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.bi-row-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.bi-row-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.25;
    word-break: break-word;
}

.bi-row-sub {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.bi-row-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.bi-row-amt {
    font-size: 0.90rem;
    font-weight: 700;
    color: var(--text-dark);
}

.bi-row-amt.zero {
    color: var(--text-muted);
    font-weight: 600;
}

.bi-row-chev {
    font-size: 0.76rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.bi-row-item.expanded .bi-row-chev {
    transform: rotate(180deg);
}

.bi-row-details {
    display: none;
    background: #fff9f5;
    padding: 10px 15px 12px 67px;
    border-top: 1px solid rgba(232, 93, 4, 0.08);
}

[data-theme="dark"] .bi-row-details {
    background: rgba(249, 115, 22, 0.07);
    border-top-color: rgba(249, 115, 22, 0.14);
}

.bi-row-item.expanded .bi-row-details {
    display: block;
}

.bi-detail-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.80rem;
    padding: 3px 0;
}

.bi-detail-lbl {
    color: var(--text-muted);
}

.bi-detail-val {
    color: var(--text-dark);
    font-weight: 600;
}

/* Standalone Schedule Report Link Card */
.bi-schedule-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 13px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: border-color 0.18s ease, transform 0.15s ease;
}

.bi-schedule-card:hover {
    border-color: var(--primary);
}

.bi-view-more-btn {
    width: 100%;
    border: none;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-white);
    color: #b84a14;
    font-size: 0.80rem;
    font-weight: 600;
    padding: 11px 16px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

[data-theme="dark"] .bi-view-more-btn {
    color: var(--primary);
}

.bi-view-more-btn:hover {
    background: var(--bg-soft);
}

/* 12. App Primary Button Consistency Override */
.btn-primary,
.btn-primary:active,
.btn-primary:focus {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.btn-primary:hover {
    background-color: #c2410c !important;
    border-color: #c2410c !important;
    color: #ffffff !important;
}

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    background: transparent !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-primary:focus {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}

/* 13. Set Availability Custom Mobile Card (Matches Reference Image Exactly) */
.m-avail-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 16px 18px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

[data-theme="dark"] .m-avail-card {
    background: var(--bg-elevated);
    border-color: var(--border-color);
}

.m-avail-thumb {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    flex-shrink: 0;
    overflow: hidden;
}

.m-avail-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.m-avail-meta-box {
    flex: 1;
    background: #f4f6f9 !important;
    border-radius: 14px;
    padding: 10px 14px;
    min-width: 0;
}

[data-theme="dark"] .m-avail-meta-box {
    background: #252b36 !important;
}

.m-avail-meta-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 2px;
}

.m-avail-meta-val {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-dark);
}

.m-avail-switch {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.m-avail-switch .form-check-input {
    width: 3.2em !important;
    height: 1.7em !important;
    cursor: pointer !important;
    border-radius: 2em !important;
    background-color: #cbd5e1 !important;
    border: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") !important;
    transition: background-color 0.2s ease, background-position 0.2s ease !important;
    box-shadow: none !important;
}

.m-avail-switch .form-check-input:checked {
    background-color: #ea580c !important;
    border-color: #ea580c !important;
}

[data-theme="dark"] .m-avail-switch .form-check-input {
    background-color: #334155 !important;
}

[data-theme="dark"] .m-avail-switch .form-check-input:checked {
    background-color: #ea580c !important;
}

/* 14. Modern Image Upload Box Component */
.m-image-upload-zone {
    border: 2px dashed rgba(234, 88, 12, 0.35);
    background: rgba(234, 88, 12, 0.03);
    border-radius: 18px;
    padding: 22px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

[data-theme="dark"] .m-image-upload-zone {
    background: rgba(251, 146, 60, 0.06);
    border-color: rgba(251, 146, 60, 0.3);
}

.m-image-upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.m-upload-icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.m-image-preview-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 18px;
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .m-image-preview-wrap {
    background: rgba(255, 255, 255, 0.04);
}

.m-image-preview-thumb {
    width: 62px;
    height: 62px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    flex-shrink: 0;
}

/* =========================================================================
   15. PROFESSIONAL CANTEEN COMMAND CENTER (Laptop, Tablet & Mobile)
   ========================================================================= */
.canteen-hero-banner {
    background: linear-gradient(135deg, #9a3412 0%, #c2410c 45%, #ea580c 100%) !important;
    border-radius: 22px !important;
    padding: 18px 18px !important;
    color: #ffffff !important;
    box-shadow: 0 14px 32px rgba(234, 88, 12, 0.24) !important;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.canteen-hero-banner h4 {
    font-size: clamp(1.02rem, 4.2vw, 1.42rem) !important;
    line-height: 1.25 !important;
    word-break: break-word;
}

.canteen-hero-banner::after {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    right: -45px;
    top: -45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

@media (min-width: 992px) {
    .canteen-hero-banner {
        padding: 24px 28px !important;
        border-radius: 24px !important;
    }
}

.canteen-hero-stat {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(6px);
    border-radius: 16px;
    padding: 10px 18px;
    min-width: 128px;
    text-align: left;
}

.canteen-hero-stat .stat-lbl {
    font-size: 0.70rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.80);
    font-weight: 600;
}

.canteen-hero-stat .stat-val {
    font-size: 1.22rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin-top: 2px;
}

/* KPI Icon Theme-Safe Overrides */
.report-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated) !important;
    border-color: rgba(234, 88, 12, 0.30) !important;
}

.report-card .icon.orange {
    background: rgba(249, 115, 22, 0.14) !important;
    color: #ea580c !important;
}

.report-card .icon.green {
    background: rgba(34, 197, 94, 0.14) !important;
    color: #16a34a !important;
}

.report-card .icon.blue {
    background: rgba(59, 130, 246, 0.14) !important;
    color: #2563eb !important;
}

.report-card .icon.red {
    background: rgba(239, 68, 68, 0.14) !important;
    color: #dc2626 !important;
}

[data-theme="dark"] .report-card .icon.orange {
    background: rgba(251, 146, 60, 0.20) !important;
    color: #fb923c !important;
}

[data-theme="dark"] .report-card .icon.green {
    background: rgba(74, 222, 128, 0.20) !important;
    color: #4ade80 !important;
}

[data-theme="dark"] .report-card .icon.blue {
    background: rgba(96, 165, 250, 0.20) !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .report-card .icon.red {
    background: rgba(248, 113, 113, 0.20) !important;
    color: #f87171 !important;
}

/* Pulse Summary Strip (Today's Revenue, Orders, Stock, Report) */
.canteen-pulse-bar {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 16px 20px;
    box-shadow: var(--shadow-soft);
    text-align: left !important;
}

/* Canteen Bento Module Grid:
   - Mobile (< 768px): 1-Column Sleek Touch Cards
   - Tablet (768px - 1199px): 2-Column Bento Grid
   - Laptop & Desktop (>= 1200px): 3-Column Bento Grid */
.canteen-modules-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 768px) {
    .canteen-modules-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (min-width: 1200px) {
    .canteen-modules-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

.canteen-module-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 15px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: var(--text-dark);
    position: relative;
}

.canteen-module-card:hover {
    transform: translateY(-2px);
    border-color: rgba(234, 88, 12, 0.40);
    box-shadow: var(--shadow-elevated);
}

.canteen-module-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.canteen-module-card:hover .canteen-module-icon {
    background: var(--primary);
    color: #ffffff;
}

.canteen-module-body {
    flex: 1;
    min-width: 0;
}

.canteen-module-step {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 2px;
}

.canteen-module-title {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.25;
}

.canteen-module-sub {
    font-size: 0.77rem;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.35;
}

.canteen-module-arrow {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.canteen-module-card:hover .canteen-module-arrow {
    background: var(--primary-soft);
    color: var(--primary);
    transform: translateX(2px);
}

/* Quick Stock Responsive Grid */
.quick-stock-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 768px) {
    .quick-stock-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (min-width: 1280px) {
    .quick-stock-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

.quick-stock-grid .m-avail-card {
    margin-bottom: 0 !important;
}

/* =========================================================
   Dark Mode Enhancements for Bootstrap Tables & Badges
   ========================================================= */
[data-theme="dark"] .admin-table-card {
    background: #181d26 !important;
    border-color: #262d3d !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .table {
    --bs-table-bg: transparent !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02) !important;
    --bs-table-striped-color: #f8fafc !important;
    --bs-table-active-bg: rgba(251, 146, 60, 0.1) !important;
    --bs-table-active-color: #ffffff !important;
    --bs-table-hover-bg: rgba(251, 146, 60, 0.08) !important;
    --bs-table-hover-color: #ffffff !important;
    --bs-table-color: #e2e8f0 !important;
    --bs-table-border-color: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .table > :not(caption) > * > * {
    background-color: transparent !important;
    color: #e2e8f0 !important;
    border-bottom-color: rgba(255, 255, 255, 0.07) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .table thead.table-light,
[data-theme="dark"] .table thead.table-light > tr > th,
[data-theme="dark"] .table thead > tr > th {
    background-color: #0f172a !important;
    color: #94a3b8 !important;
    border-bottom: 1px solid #262d3d !important;
}

[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: rgba(251, 146, 60, 0.08) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .badge-status-active {
    background: rgba(34, 197, 94, 0.18) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(74, 222, 128, 0.3) !important;
}

[data-theme="dark"] .badge-status-inactive {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #f87171 !important;
    border: 1px solid rgba(248, 113, 113, 0.3) !important;
}


