/* ═══════════════════════════════════════════
   BACKOFFICE — Base
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: #f4f6f9;
    color: #1e293b;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ═══════════════════════════════════════════
   TOP NAV
═══════════════════════════════════════════ */
.bo-nav {
    height: 52px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
    z-index: 30;
    box-shadow: 0 1px 8px rgba(0,0,0,0.3);
}

.bo-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bo-nav-logo {
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.12);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
}

.bo-nav-title {
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
}

.bo-nav-sub {
    font-size: 9px;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

.bo-nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bo-nav-outlet-name {
    font-size: 12px;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1;
}

.bo-nav-outlet-label {
    font-size: 9px;
    color: rgba(255,255,255,0.35);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

.bo-nav-divider {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.1);
}

.bo-nav-pos-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #2563eb;
    color: white;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s;
    border: none;
    cursor: pointer;
}
.bo-nav-pos-btn:hover { background: #1d4ed8; }

.bo-nav-logout {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    background: rgba(225,29,72,0.15);
    color: #fda4af;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid rgba(225,29,72,0.25);
    cursor: pointer;
    transition: all 0.15s;
}
.bo-nav-logout:hover { background: rgba(225,29,72,0.25); color: #fff; }

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.bo-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #e8edf2;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 8px 24px;
    gap: 3px;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    align-self: stretch;
}

.bo-sidebar::-webkit-scrollbar { width: 2px; }
.bo-sidebar::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }

.bo-sidebar-section {
    padding: 14px 8px 8px;
    font-size: 9px;
    font-weight: 900;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 0;
    border-radius: 0px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
    text-align: left;
    width: 100%;
    white-space: nowrap;
}

.sidebar-link i {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #94a3b8;
    flex-shrink: 0;
    transition: all 0.12s;
}

.sidebar-link:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateX(2px);
}
.sidebar-link:hover i {
    color: #475569;
}

.sidebar-link.active {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
    font-weight: 800;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59,130,246,0.12);
    transform: translateX(2px);
}
.sidebar-link.active i {
    background: transparent;
    color: #2563eb;
}

/* ═══════════════════════════════════════════
   SETTINGS TABS (light sub-panel)
═══════════════════════════════════════════ */
.settings-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    margin: 1px 8px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    width: calc(100% - 16px);
    transition: all 0.12s;
    white-space: nowrap;
}
.settings-tab i {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #94a3b8;
    flex-shrink: 0;
    transition: all 0.12s;
}
.settings-tab:hover { background: #f8fafc; color: #1e293b; }
.settings-tab:hover i { background: #f1f5f9; color: #475569; }
.settings-tab.active { background: #eff6ff; color: #1d4ed8; font-weight: 700; }
.settings-tab.active i { background: #dbeafe; color: #1d4ed8; }

/* ═══════════════════════════════════════════
   PAGE TRANSITIONS
═══════════════════════════════════════════ */
main { opacity: 0; transition: opacity 0.15s ease; }
body.page-ready main { opacity: 1; animation: none; }

/* Fallback: ensure main is always visible after 0.4s even if page-ready fails */
@keyframes bo-fallback-show { to { opacity: 1; } }
main { animation: bo-fallback-show 0s 0.4s forwards; }

/* ═══════════════════════════════════════════
   REPORT TABS
═══════════════════════════════════════════ */
.report-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    margin-bottom: -1px;
}
.report-tab i { font-size: 10px; }
.report-tab:hover { color: #1e293b; border-bottom-color: #cbd5e1; }
.report-tab.active { color: #1d4ed8; border-bottom-color: #2563eb; font-weight: 700; }

/* ═══════════════════════════════════════════
   DASHBOARD COMPONENTS
═══════════════════════════════════════════ */
.bo-stat-card {
    background: white;
    border-radius: 0;
    border: 1px solid #e8edf2;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.15s;
    position: relative;
    overflow: hidden;
}
.bo-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent, #3b82f6);
    border-radius: 0;
}
.bo-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.bo-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-bottom: 12px;
}
.bo-stat-label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}
.bo-stat-value {
    font-size: 24px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1;
}

.bo-quick-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: white;
    border: 1px solid #e8edf2;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-decoration: none;
    transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.bo-quick-link i {
    width: 30px;
    height: 30px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #64748b;
    flex-shrink: 0;
    transition: all 0.15s;
}
.bo-quick-link:hover {
    border-color: #2563eb;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.1);
}
.bo-quick-link:hover i { background: #dbeafe; color: #2563eb; }

/* ═══════════════════════════════════════════
   ANIMATIONS (legacy support)
═══════════════════════════════════════════ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.4s ease-out forwards; }
.animate-scale-in { animation: scaleIn 0.25s ease-out forwards; }
.hover-lift:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }

/* ═══════════════════════════════════════════
   NAVIGATION LOADING OVERLAY
═══════════════════════════════════════════ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner-container {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.lottie-loader {
    width: 120px;
    height: 120px;
    margin-bottom: 16px;
}

.loading-circle {
    width: 12px;
    height: 12px;
    background: #3b82f6;
    border-radius: 50%;
    animation: loadingBounce 1.4s ease-in-out infinite both;
}

.loading-circle:nth-child(1) { animation-delay: -0.32s; }
.loading-circle:nth-child(2) { animation-delay: -0.16s; }
.loading-circle:nth-child(3) { animation-delay: 0s; }

@keyframes loadingBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.loading-text {
    color: #f1f5f9;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.loading-subtext {
    color: rgba(241, 245, 249, 0.6);
    font-size: 14px;
    font-weight: 500;
}

/* Page transition effects */
main.page-exit {
    opacity: 0.7;
    transform: scale(0.98);
    transition: all 0.3s ease;
}

/* ═══════════════════════════════════════════
   SKELETON LOADERS
   Usage: add <div class="skeleton" style="height:20px;width:80%"></div>
   Or use .skel-row for a table row placeholder.
═══════════════════════════════════════════ */
.skeleton {
    background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 37%, #eef2f7 63%);
    background-size: 400% 100%;
    animation: skeletonShimmer 1.4s ease infinite;
    border-radius: 6px;
    display: block;
}
@keyframes skeletonShimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}
.skel-line { height: 12px; margin: 6px 0; }
.skel-line.sm { width: 40%; }
.skel-line.md { width: 65%; }
.skel-line.lg { width: 90%; }
.skel-card {
    padding: 16px; border: 1px solid #eef2f7; border-radius: 12px;
    background: #fff; margin-bottom: 12px;
}
.skel-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid #f1f5f9;
}
.skel-row .skeleton { height: 14px; }
.skel-circle { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
html.dark .skeleton { background: linear-gradient(90deg, #1e293b 25%, #263348 37%, #1e293b 63%); background-size: 400% 100%; }

/* ── Sidebar Reports Dropdown ─────────────────────────────────────────────── */
.sidebar-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 0;
    border-radius: 0px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
    text-align: left;
    width: 100%;
    white-space: nowrap;
    justify-content: space-between;
}
.sidebar-dropdown-btn:hover { background: #f1f5f9; border-color: #cbd5e1; color: #0f172a; transform: translateX(2px); }
.sidebar-dropdown-btn.open { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #1d4ed8; border-color: #3b82f6; }
.sidebar-dropdown-btn .dd-icon {
    width: auto; height: auto;
    border-radius: 0;
    background: transparent;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: #94a3b8;
    flex-shrink: 0; transition: all 0.12s;
}
.sidebar-dropdown-btn:hover .dd-icon { color: #475569; }
.sidebar-dropdown-btn.open .dd-icon { color: #2563eb; }
.sidebar-dropdown-btn .dd-label { flex: 1; }
.sidebar-dropdown-btn .dd-arrow { font-size: 9px; color: #94a3b8; transition: transform 0.2s; }
.sidebar-dropdown-btn.open .dd-arrow { transform: rotate(180deg); color: #2563eb; }

.sidebar-dropdown-menu {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}
.sidebar-dropdown-menu.open {
    max-height: 2000px !important;
    overflow: visible;
}
.sidebar-dropdown-menu.open a {
    display: flex !important;
}
.sidebar-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px 7px 42px;
    margin: 0;
    border-radius: 0;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    transition: all 0.1s;
    white-space: nowrap;
    border-left: 2px solid transparent;
}
.sidebar-dropdown-menu a:hover { background: #f1f5f9; color: #1e293b; border-left-color: #cbd5e1; }
.sidebar-dropdown-menu a.active { background: #eff6ff; color: #1d4ed8; font-weight: 700; border-left-color: #3b82f6; }
.sidebar-dropdown-menu a i { font-size: 9px; width: 14px; text-align: center; color: #94a3b8; }
.sidebar-dropdown-menu a.active i { color: #2563eb; }
.dd-group-label {
    padding: 8px 10px 3px 14px;
    font-size: 8px;
    font-weight: 900;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

/* ── Sidebar Collapse ─────────────────────────────────────────────────────── */
.bo-sidebar {
    transition: width 0.22s ease;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    flex-shrink: 0;
}
.bo-sidebar.collapsed {
    width: 52px;
}
.bo-sidebar.collapsed .sidebar-link .link-label,
.bo-sidebar.collapsed .bo-sidebar-section,
.bo-sidebar.collapsed .sidebar-dropdown-btn .dd-label,
.bo-sidebar.collapsed .sidebar-dropdown-btn .dd-arrow,
.bo-sidebar.collapsed .sidebar-dropdown-menu,
.bo-sidebar.collapsed .dd-group-label {
    display: none !important;
}
.bo-sidebar.collapsed .sidebar-link,
.bo-sidebar.collapsed .sidebar-dropdown-btn {
    justify-content: center;
    padding: 10px 0;
    margin: 0;
    width: 100%;
}
.bo-sidebar.collapsed .sidebar-link i,
.bo-sidebar.collapsed .sidebar-dropdown-btn .dd-icon {
    margin: 0;
}
.bo-sidebar.collapsed .sidebar-link {
    position: relative;
}
.bo-sidebar.collapsed .sidebar-link::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.bo-sidebar.collapsed .sidebar-link:hover::after {
    opacity: 1;
}

/* Toggle button in nav */
.bo-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.1);
    color: rgba(255,255,255,.6);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    font-size: 12px;
}
.bo-sidebar-toggle:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
}

/* ═══════════════════════════════════════════
   MOBILE RESPONSIVE DESIGN
═══════════════════════════════════════════ */

/* Mobile Navigation Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 39;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255,255,255,.1);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 16px;
}

.mobile-menu-toggle:hover {
    background: rgba(255,255,255,.2);
}

/* Tablet and below (≤1024px) */
@media (max-width: 1024px) {
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Hide desktop sidebar toggle */
    .bo-sidebar-toggle {
        display: none;
    }
    
    /* Sidebar becomes overlay on mobile */
    .bo-sidebar {
        position: fixed;
        top: 52px;
        left: 0;
        bottom: 0;
        width: 260px;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 12px rgba(0,0,0,0.3);
    }
    
    .bo-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    /* Adjust nav for mobile */
    .bo-nav {
        padding: 0 12px;
    }
    
    .bo-nav-brand {
        gap: 8px;
    }
    
    .bo-nav-title {
        font-size: 12px;
    }
    
    .bo-nav-sub {
        display: none;
    }
    
    /* Hide outlet info on very small screens */
    .bo-nav-outlet {
        display: none !important;
    }
    
    /* Adjust logout button */
    .bo-nav-logout {
        padding: 6px 8px;
        font-size: 10px;
    }
    
    .bo-nav-logout span {
        display: none;
    }
    
    /* Main content takes full width */
    main {
        width: 100%;
        padding: 12px;
    }
    
    /* Stat cards stack on mobile */
    .bo-stat-card {
        padding: 12px;
    }
    
    .bo-stat-value {
        font-size: 20px;
    }
    
    /* Quick links adjust */
    .bo-quick-link {
        padding: 10px 12px;
        font-size: 11px;
    }
    
    .bo-quick-link i {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
}

/* Mobile phones (≤768px) */
@media (max-width: 768px) {
    /* Further reduce nav height */
    .bo-nav {
        height: 48px;
        padding: 0 10px;
    }
    
    .bo-nav-brand img {
        height: 28px;
    }
    
    .bo-nav-title {
        font-size: 11px;
    }
    
    .bo-nav-logout {
        padding: 5px 7px;
    }
    
    /* Sidebar adjustments */
    .bo-sidebar {
        top: 48px;
        width: 240px;
    }
    
    .sidebar-link {
        font-size: 11.5px;
        padding: 8px 10px;
    }
    
    .sidebar-link i {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    /* Main content */
    main {
        padding: 10px;
    }
    
    /* Tables become scrollable */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Form inputs full width */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    select,
    textarea {
        width: 100%;
        font-size: 14px;
    }
    
    /* Buttons stack on mobile */
    .button-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .button-group button,
    .button-group a {
        width: 100%;
    }
    
    /* Modal adjustments */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 10px;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }
    
    /* Cards */
    .bo-stat-card {
        padding: 10px;
    }
    
    .bo-stat-value {
        font-size: 18px;
    }
    
    .bo-stat-label {
        font-size: 9px;
    }
    
    /* Report tabs scroll horizontally */
    .report-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding-bottom: 2px;
    }
    
    .report-tab {
        font-size: 10px;
        padding: 8px 12px;
    }
}

/* Small mobile phones (≤480px) */
@media (max-width: 480px) {
    .bo-nav {
        height: 44px;
        padding: 0 8px;
    }
    
    .bo-nav-brand img {
        height: 24px;
    }
    
    .bo-nav-title {
        font-size: 10px;
    }
    
    .mobile-menu-toggle {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .bo-sidebar {
        top: 44px;
        width: 220px;
    }
    
    .sidebar-link {
        font-size: 11px;
        padding: 7px 8px;
    }
    
    .sidebar-link i {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }
    
    main {
        padding: 8px;
    }
    
    .bo-stat-value {
        font-size: 16px;
    }
    
    .bo-quick-link {
        padding: 8px 10px;
        font-size: 10px;
    }
    
    .bo-quick-link i {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }
    
    /* Reduce padding everywhere */
    .bg-white {
        padding: 12px !important;
    }
    
    /* Stack grid columns */
    .grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Smaller text */
    h1 { font-size: 20px; }
    h2 { font-size: 18px; }
    h3 { font-size: 16px; }
    h4 { font-size: 14px; }
    
    /* Table text smaller */
    table {
        font-size: 11px;
    }
    
    th, td {
        padding: 6px 8px !important;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .bo-nav {
        height: 40px;
    }
    
    .bo-sidebar {
        top: 40px;
    }
    
    main {
        padding: 8px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets */
    button,
    a,
    input,
    select {
        min-height: 44px;
    }
    
    .sidebar-link {
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .sidebar-link:hover,
    .bo-quick-link:hover,
    .report-tab:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .bo-nav,
    .bo-sidebar,
    .mobile-menu-toggle,
    .mobile-overlay,
    button,
    .bo-nav-logout {
        display: none !important;
    }
    
    main {
        width: 100%;
        padding: 0;
    }
    
    .bo-stat-card {
        break-inside: avoid;
    }
}

/* Utility classes for responsive design */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
    
    .show-mobile-flex {
        display: flex !important;
    }
    
    .show-mobile-inline {
        display: inline !important;
    }
}

/* Responsive grid utilities */
.responsive-grid {
    display: grid;
    gap: 16px;
}

@media (min-width: 1280px) {
    .responsive-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .responsive-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .responsive-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
    .responsive-grid { grid-template-columns: 1fr; }
}

/* Responsive spacing */
@media (max-width: 768px) {
    .gap-4 { gap: 8px !important; }
    .gap-6 { gap: 12px !important; }
    .p-6 { padding: 12px !important; }
    .p-8 { padding: 16px !important; }
    .px-6 { padding-left: 12px !important; padding-right: 12px !important; }
    .py-6 { padding-top: 12px !important; padding-bottom: 12px !important; }
}


/* ══════════════════════════════════════════════════════════════════════════
   GLOBAL RECTANGULAR UI — no rounded buttons/inputs across all Backoffice pages
   Overrides Tailwind rounded-* utilities. Circular elements (avatars, dots,
   toggles, spinners) are explicitly preserved below.
   ══════════════════════════════════════════════════════════════════════════ */
button,
.btn,
input[type="button"],
input[type="submit"],
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="tel"],
select,
textarea {
    border-radius: 0 !important;
}

/* Anchor tags that are styled as buttons (Tailwind bg + padding) */
a.rounded,
a.rounded-sm,
a.rounded-md,
a.rounded-lg,
a.rounded-xl,
a.rounded-2xl,
a.rounded-3xl {
    border-radius: 0 !important;
}

/* Generic Tailwind rounded utilities → rectangular */
.rounded,
.rounded-sm,
.rounded-md,
.rounded-lg,
.rounded-xl,
.rounded-2xl,
.rounded-3xl {
    border-radius: 0 !important;
}

/* PRESERVE circular elements — these SHOULD stay round */
.rounded-full,
img.rounded-full,
.toggle-dot,
.stoggle-thumb,
.loading-circle,
[class*="rounded-full"] {
    border-radius: 9999px !important;
}


/* ═══════════════════════════════════════════
   REPORTS PAGE — UI POLISH (additive only)
═══════════════════════════════════════════ */

/* Better report tabs — pill style with subtle bg */
.report-tab {
    padding: 9px 16px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border-bottom: none !important;
    border: 1.5px solid transparent !important;
    background: transparent !important;
    transition: all 0.12s !important;
}
.report-tab:hover {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #1e293b !important;
}
.report-tab.active {
    background: #1e293b !important;
    color: #ffffff !important;
    border-color: #1e293b !important;
    box-shadow: 0 2px 6px rgba(15,23,42,0.15) !important;
}
.report-tab i {
    font-size: 10px !important;
}

/* Report picker cards — better hover */
.report-card {
    transition: all 0.18s ease !important;
}
.report-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08) !important;
}

/* Stat cards in reports — subtle left accent bar */
.reports-section .stat-card {
    position: relative;
    overflow: hidden;
}
.reports-section .stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
    background: var(--accent, #3b82f6);
}

/* Tables in reports — zebra striping + better rows */
.reports-section table tbody tr:nth-child(even) {
    background: #f8fafc;
}
.reports-section table tbody tr {
    transition: background 0.1s;
}
.reports-section table tbody tr:hover {
    background: #eff6ff !important;
}
.reports-section table thead {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f8fafc;
}
.reports-section table th {
    border-bottom: 2px solid #e2e8f0 !important;
}

/* Section cards — subtle shadow improvement */
.reports-section .bg-white {
    box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.02) !important;
}

/* Filter bar in reports — tighter, cleaner */
.reports-section .bg-slate-50\/30 {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9) !important;
}

/* Better chart containers */
.reports-section canvas {
    max-height: 260px;
}

/* KPI cards grid — consistent sizing */
.reports-section .grid .bg-slate-50 {
    border: 1px solid #e8edf2;
}
.reports-section .grid .bg-blue-50,
.reports-section .grid .bg-emerald-50,
.reports-section .grid .bg-amber-50,
.reports-section .grid .bg-indigo-50 {
    border: 1px solid rgba(0,0,0,0.04);
}

/* Heatmap table polish */
.reports-section table td[title] {
    cursor: default;
}

/* Export/action buttons in reports */
.reports-section button[onclick*="export"],
.reports-section button[onclick*="Export"] {
    transition: all 0.15s !important;
}
.reports-section button[onclick*="export"]:hover,
.reports-section button[onclick*="Export"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Section transition animation */
.reports-section {
    animation: reportFadeIn 0.2s ease-out;
}
@keyframes reportFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Better scrollbar for tab bar */
.px-4::-webkit-scrollbar { height: 0; }
