/* Import Fonts: Inter, Orbitron (Fallback Display), and Blanka */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Orbitron:wght@700;800;900&display=swap');
@import url('https://fonts.cdnfonts.com/css/blanka');

:root {
    --bg-dark-primary: #121214;
    --bg-dark-secondary: #1a1a1e;
    --bg-dark-card: #222228;
    --border-color: #2d2d34;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --primary: #fb923c; /* Warm Orange */
    --primary-hover: #f97316;
    --success: #10b981; /* Emerald Green */
    --info: #3b82f6;
    --warning: #f59e0b;
    --danger: #ef4444;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-brand: 'Blanka', 'Orbitron', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* =====================================================
   LIGHT MODE THEME — applied via html[data-theme="light"]
   ===================================================== */
html[data-theme="light"] {
    --bg-dark-primary:   #f0f4f8;
    --bg-dark-secondary: #ffffff;
    --bg-dark-card:      #ffffff;
    --border-color:      #d1d9e0;
    --text-primary:      #1e293b;
    --text-secondary:    #64748b;
}

html[data-theme="light"] body {
    background-color: #f0f4f8;
    color: #1e293b;
}

/* Sidebar */
html[data-theme="light"] .sidebar {
    background-color: #ffffff;
    border-right-color: #d1d9e0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.06);
}
html[data-theme="light"] .sidebar .nav-item {
    color: #475569;
}
html[data-theme="light"] .sidebar .nav-item:hover,
html[data-theme="light"] .sidebar .nav-item.active {
    color: #1e293b;
    background-color: rgba(251,146,60,0.10);
}
html[data-theme="light"] .sidebar-user-text .user-name {
    color: #1e293b !important;
}
html[data-theme="light"] .sidebar-user-text .restaurant-name {
    color: #64748b !important;
}
html[data-theme="light"] .sidebar-user-card {
    background: rgba(0,0,0,0.03) !important;
    border-color: #d1d9e0 !important;
}
html[data-theme="light"] .sidebar-header-wrapper {
    border-bottom-color: #d1d9e0 !important;
}
html[data-theme="light"] .brand-subtitle {
    color: #64748b !important;
}
html[data-theme="light"] .brand-title {
    background: linear-gradient(135deg, #1e293b 40%, #fb923c 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Sidebar overlay on mobile */
html[data-theme="light"] .sidebar {
    background-color: #ffffff !important;
}
html[data-theme="light"] .mobile-close-btn {
    color: #475569 !important;
}

/* Main content + top header */
html[data-theme="light"] .main-content {
    background-color: #f0f4f8;
}
html[data-theme="light"] header {
    border-bottom-color: #d1d9e0 !important;
}
html[data-theme="light"] .admin-page-title,
html[data-theme="light"] h1, html[data-theme="light"] h2,
html[data-theme="light"] h3, html[data-theme="light"] h4,
html[data-theme="light"] h5, html[data-theme="light"] h6 {
    color: #1e293b !important;
}
html[data-theme="light"] .admin-page-subtitle,
html[data-theme="light"] .text-secondary {
    color: #64748b !important;
}
html[data-theme="light"] .text-white {
    color: #1e293b !important;
}
html[data-theme="light"] .text-muted {
    color: #94a3b8 !important;
}

/* Glass panels / cards */
html[data-theme="light"] .glass-panel {
    background: rgba(255,255,255,0.92) !important;
    border-color: #d1d9e0 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06) !important;
}
html[data-theme="light"] .metric-card {
    background-color: #ffffff !important;
    border-color: #d1d9e0 !important;
}
html[data-theme="light"] .metric-value { color: #1e293b !important; }
html[data-theme="light"] .metric-label { color: #64748b !important; }

/* Tables */
html[data-theme="light"] .custom-table {
    background-color: #ffffff !important;
    border-color: #d1d9e0 !important;
}
html[data-theme="light"] .custom-table th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    border-bottom-color: #d1d9e0 !important;
}
html[data-theme="light"] .custom-table td {
    color: #1e293b !important;
    border-bottom-color: #e9edf1 !important;
}
html[data-theme="light"] .custom-table tr:hover td {
    background-color: rgba(241,245,249,0.8) !important;
}
html[data-theme="light"] .table-dark,
html[data-theme="light"] .table-dark th,
html[data-theme="light"] .table-dark td {
    background-color: #ffffff !important;
    color: #1e293b !important;
    border-color: #d1d9e0 !important;
}

/* Forms */
html[data-theme="light"] .custom-form-label { color: #475569 !important; }
html[data-theme="light"] .custom-form-input {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}
html[data-theme="light"] .custom-form-input:focus {
    border-color: var(--primary) !important;
}
html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] textarea {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}
html[data-theme="light"] .form-control::placeholder { color: #94a3b8 !important; }

/* Buttons */
html[data-theme="light"] .btn-dark {
    background-color: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}
html[data-theme="light"] .btn-dark:hover {
    background-color: #cbd5e1 !important;
    color: #0f172a !important;
}
html[data-theme="light"] .btn-outline-secondary {
    color: #475569 !important;
    border-color: #94a3b8 !important;
}
html[data-theme="light"] .btn-outline-secondary:hover {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
}

/* Bottom nav bar */
html[data-theme="light"] .admin-bottom-nav {
    background: rgba(255,255,255,0.97) !important;
    border-top-color: #d1d9e0 !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1) !important;
}
html[data-theme="light"] .bottom-nav-item {
    color: #64748b !important;
}
html[data-theme="light"] .bottom-nav-item.active { color: var(--primary) !important; }

/* Sidebar toggle button (hamburger) */
html[data-theme="light"] .sidebar-toggle-btn {
    background: #ffffff !important;
    border-color: #d1d9e0 !important;
    color: #1e293b !important;
}

/* Kitchen lanes & cards */
html[data-theme="light"] .kitchen-lane {
    background-color: #ffffff !important;
    border-color: #d1d9e0 !important;
}
html[data-theme="light"] .kitchen-card {
    background-color: #f8fafc !important;
    border-color: #d1d9e0 !important;
}
html[data-theme="light"] .kitchen-card-header {
    border-bottom-color: rgba(0,0,0,0.08) !important;
}

/* Message alerts */
html[data-theme="light"] .message-alert.success { background: #10b981; border-color: #34d399; color: #ffffff; }
html[data-theme="light"] .message-alert.error   { background: #fee2e2; border-color: #ef4444;  color: #991b1b; }
html[data-theme="light"] .message-alert.warning { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
html[data-theme="light"] .message-alert.info    { background: #dbeafe; border-color: #3b82f6; color: #1d4ed8; }

/* Inline bg-dark Bootstrap overrides */
html[data-theme="light"] .bg-dark {
    background-color: #f8fafc !important;
}
html[data-theme="light"] .border-secondary { border-color: #cbd5e1 !important; }
html[data-theme="light"] .bg-secondary { background-color: #e2e8f0 !important; }

/* System Active badge override */
html[data-theme="light"] .badge.bg-success.bg-opacity-10 {
    background-color: rgba(16,185,129,0.12) !important;
}

/* Theme toggle button */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-dark-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
    font-size: 1.05rem;
    padding: 0;
}
.theme-toggle-btn:hover {
    background: rgba(251,146,60,0.12);
    border-color: rgba(251,146,60,0.4);
    color: var(--primary);
    transform: scale(1.08);
}
html[data-theme="light"] .theme-toggle-btn {
    background: #ffffff !important;
    border-color: #d1d9e0 !important;
    color: #f59e0b !important;
}
html[data-theme="light"] .theme-toggle-btn:hover {
    background: #fff8ec !important;
    border-color: #fb923c !important;
}

/* Brand title in light mode */
html[data-theme="light"] span.fw-semibold.text-white {
    color: #1e293b !important;
}

/* Menu Scanner & Step Indicator Overrides */
html[data-theme="light"] .step-card {
    background: #ffffff !important;
    border-color: #d1d9e0 !important;
    color: #64748b !important;
}
html[data-theme="light"] .step-card .step-title {
    color: #475569 !important;
}
html[data-theme="light"] .step-card.active {
    background: rgba(251, 146, 60, 0.1) !important;
    border-color: #fb923c !important;
    color: #ea580c !important;
}
html[data-theme="light"] .step-card.active .step-title {
    color: #ea580c !important;
}
html[data-theme="light"] .step-num {
    background: #f1f5f9 !important;
    color: #475569 !important;
}
html[data-theme="light"] .step-card.active .step-num {
    background: #ea580c !important;
    color: #ffffff !important;
}
html[data-theme="light"] .upload-dropzone {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
}
html[data-theme="light"] .category-block {
    background: #ffffff !important;
    border-color: #d1d9e0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04) !important;
}
html[data-theme="light"] .item-row {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}
html[data-theme="light"] .menu-scan-usage-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}
html[data-theme="light"] .scan-nav-tabs {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}
html[data-theme="light"] .menu-scan-input {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}
html[data-theme="light"] .menu-scan-addon {
    background-color: #f1f5f9 !important;
    color: #ea580c !important;
    border: 1px solid #cbd5e1 !important;
}
html[data-theme="light"] .menu-scan-badge {
    background-color: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
}
html[data-theme="light"] .scan-table-head {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
html[data-theme="light"] .scan-table {
    --bs-table-bg: #ffffff !important;
    --bs-table-hover-bg: #f8fafc !important;
    color: #0f172a !important;
}
html[data-theme="light"] .scan-bottom-bar {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08) !important;
}

/* Status Badges High Contrast Overrides */
html[data-theme="light"] span[style*="color: #4ade80"],
html[data-theme="light"] span[style*="color:#4ade80"],
html[data-theme="light"] .badge[style*="color: #4ade80"],
html[data-theme="light"] .badge[style*="color:#4ade80"] {
    color: #15803d !important;
    background-color: rgba(22, 163, 74, 0.12) !important;
    border-color: rgba(22, 163, 74, 0.35) !important;
}

html[data-theme="light"] span[style*="color: #f87171"],
html[data-theme="light"] span[style*="color:#f87171"],
html[data-theme="light"] .badge[style*="color: #f87171"],
html[data-theme="light"] .badge[style*="color:#f87171"] {
    color: #b91c1c !important;
    background-color: rgba(220, 38, 38, 0.12) !important;
    border-color: rgba(220, 38, 38, 0.35) !important;
}

html[data-theme="light"] span[style*="color: #fbbf24"],
html[data-theme="light"] span[style*="color:#fbbf24"],
html[data-theme="light"] .badge[style*="color: #fbbf24"],
html[data-theme="light"] .badge[style*="color:#fbbf24"] {
    color: #b45309 !important;
    background-color: rgba(217, 119, 6, 0.12) !important;
    border-color: rgba(217, 119, 6, 0.35) !important;
}

/* Mobile App Cards Light Mode Overrides */
html[data-theme="light"] div[style*="background: rgba(255,255,255,0.03)"],
html[data-theme="light"] div[style*="background:rgba(255,255,255,0.03)"],
html[data-theme="light"] div[style*="background: rgba(255, 255, 255, 0.03)"] {
    background: #ffffff !important;
    border-color: #d1d9e0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
}

/* Form Select & Input bg-dark overrides in light mode */
html[data-theme="light"] select.bg-dark,
html[data-theme="light"] input.bg-dark,
html[data-theme="light"] .input-group-text.bg-dark {
    background-color: #f8fafc !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
}

/* Table Dark Overrides in Light Mode */
html[data-theme="light"] .table-dark {
    --bs-table-bg: #ffffff !important;
    --bs-table-color: #1e293b !important;
    --bs-table-hover-bg: #f1f5f9 !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
}
html[data-theme="light"] .table-dark thead.table-secondary,
html[data-theme="light"] .table-dark th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    border-bottom-color: #d1d9e0 !important;
}
html[data-theme="light"] .table-dark td {
    color: #1e293b !important;
    border-bottom-color: #e9edf1 !important;
}

/* Paid Status Tag & Solid Badges Override in Light Mode */
html[data-theme="light"] .badge.bg-success,
html[data-theme="light"] .bg-success .text-white,
html[data-theme="light"] .bg-success.text-white,
html[data-theme="light"] .badge-success {
    background-color: #10b981 !important;
    color: #ffffff !important;
}
html[data-theme="light"] .badge.bg-danger,
html[data-theme="light"] .bg-danger .text-white,
html[data-theme="light"] .bg-danger.text-white,
html[data-theme="light"] .badge-danger {
    background-color: #ef4444 !important;
    color: #ffffff !important;
}
html[data-theme="light"] .badge.bg-warning,
html[data-theme="light"] .badge-warning {
    background-color: #f59e0b !important;
    color: #0f172a !important;
}

/* Download Invoice & Outline Light Buttons in Light Mode */
html[data-theme="light"] .btn-outline-light {
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
    background-color: #ffffff !important;
}
html[data-theme="light"] .btn-outline-light:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

/* Category Tags in Menu Listing */
html[data-theme="light"] .badge.bg-secondary {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

/* Kitchen Dashboard (KDS) Light Mode Overrides */
html[data-theme="light"] .kb-statusbar {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}
html[data-theme="light"] .m-kds-tab {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}
html[data-theme="light"] .m-kds-tab.active {
    background: rgba(251, 146, 60, 0.15) !important;
    border-color: #ea580c !important;
    color: #ea580c !important;
}
html[data-theme="light"] .kb-lane {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03) !important;
}
html[data-theme="light"] .kb-lane-header {
    border-bottom-color: #e2e8f0 !important;
}
html[data-theme="light"] .kb-card {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04) !important;
}
html[data-theme="light"] .kb-order-num {
    color: #0f172a !important;
}
html[data-theme="light"] .kb-order-time {
    color: #64748b !important;
}
html[data-theme="light"] .kb-item-qty {
    color: #0f172a !important;
}
html[data-theme="light"] .kb-item-name {
    color: #334155 !important;
}
html[data-theme="light"] .kb-notes {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}
html[data-theme="light"] .kb-empty {
    color: #94a3b8 !important;
}
html[data-theme="light"] .kb-overlay {
    background: rgba(248, 250, 252, 0.92) !important;
}
html[data-theme="light"] .kb-overlay-card {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}
html[data-theme="light"] .custom-order-switch {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

/* Read-Only Mode & Alert Banners in Settings & Analytics */
html[data-theme="light"] input:disabled,
html[data-theme="light"] select:disabled,
html[data-theme="light"] textarea:disabled,
html[data-theme="light"] .form-control:disabled,
html[data-theme="light"] .custom-form-input:disabled {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
    opacity: 0.85;
}
html[data-theme="light"] .alert-warning[style*="color: #fbbf24"],
html[data-theme="light"] .alert-warning[style*="color:#fbbf24"] {
    background-color: rgba(245, 158, 11, 0.12) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
    color: #b45309 !important;
}
html[data-theme="light"] .alert-success[style*="color: #34d399"],
html[data-theme="light"] .alert-success[style*="color:#34d399"] {
    background-color: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
    color: #15803d !important;
}

/* Rescan Sticky Action Bar & Warning Modal in Menu Scanner */
html[data-theme="light"] .position-sticky.bottom-0[style*="background: rgba(18, 18, 20"],
html[data-theme="light"] .position-sticky.bottom-0[style*="background:rgba(18, 18, 20"] {
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08) !important;
}
html[data-theme="light"] .modal-content,
html[data-theme="light"] .modal-content.bg-dark,
html[data-theme="light"] .modal-content[style*="background: #1a1a1e"] {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15) !important;
}
html[data-theme="light"] .modal-content .text-white,
html[data-theme="light"] .modal-content .text-white-50,
html[data-theme="light"] .modal-content p.text-secondary {
    color: #334155 !important;
}
html[data-theme="light"] .modal-header .btn-close,
html[data-theme="light"] .modal-header .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(0);
}

/* Analytics Page Light Mode Overrides */
html[data-theme="light"] .analytics-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03) !important;
}
html[data-theme="light"] .stat-pill {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
}
html[data-theme="light"] .month-nav-btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
}
html[data-theme="light"] .month-nav-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
html[data-theme="light"] .month-picker-btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
}
html[data-theme="light"] .month-picker-btn:hover {
    background: #f1f5f9 !important;
}
html[data-theme="light"] .month-picker-dropdown {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 16px 40px rgba(0,0,0,0.12) !important;
}
html[data-theme="light"] .mpicker-year-label {
    color: #0f172a !important;
}
html[data-theme="light"] .mpicker-arrow {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
}
html[data-theme="light"] .mpicker-month-btn {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}
html[data-theme="light"] .mpicker-month-btn:hover:not(.active):not(.disabled) {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}
html[data-theme="light"] .top-items-list li {
    border-bottom-color: #e2e8f0 !important;
}
html[data-theme="light"] .item-rank {
    background: #f1f5f9 !important;
    color: #334155 !important;
}
html[data-theme="light"] .item-bar-bg {
    background: #e2e8f0 !important;
}

/* Item Form Card & Dropzone Overrides in Light Mode */
html[data-theme="light"] div[style*="linear-gradient(145deg, #1e1e24"],
html[data-theme="light"] div[style*="linear-gradient(145deg,#1e1e24"] {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04) !important;
}
html[data-theme="light"] #dropzoneBox {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}
html[data-theme="light"] #dropzoneBox:hover {
    border-color: #ea580c !important;
    background: rgba(251, 146, 60, 0.06) !important;
}
html[data-theme="light"] #currentImageWrapper {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}
html[data-theme="light"] .hover-glow:hover {
    box-shadow: 0 4px 20px rgba(251, 146, 60, 0.35) !important;
}

/* Global Text Utility & Low-Opacity Badge Overrides in Light Mode */
html[data-theme="light"] .text-light {
    color: #1e293b !important;
}
html[data-theme="light"] .text-white {
    color: #0f172a !important;
}
html[data-theme="light"] .text-success,
html[data-theme="light"] .badge.text-success {
    color: #15803d !important;
}
html[data-theme="light"] .text-danger,
html[data-theme="light"] .badge.text-danger {
    color: #dc2626 !important;
}
html[data-theme="light"] .text-warning,
html[data-theme="light"] .badge.text-warning {
    color: #b45309 !important;
}
html[data-theme="light"] .text-info,
html[data-theme="light"] .badge.text-info {
    color: #0369a1 !important;
}

/* Specific inline-styled badges in Light Mode */
html[data-theme="light"] span[style*="color:#c4b5fd"], html[data-theme="light"] span[style*="color: #c4b5fd"] { color: #6d28d9 !important; background: rgba(139,92,246,0.12) !important; border-color: rgba(139,92,246,0.3) !important; }
html[data-theme="light"] span[style*="color:#7dd3fc"], html[data-theme="light"] span[style*="color: #7dd3fc"] { color: #0284c7 !important; background: rgba(56,189,248,0.12) !important; border-color: rgba(56,189,248,0.3) !important; }
html[data-theme="light"] span[style*="color:#fdba74"], html[data-theme="light"] span[style*="color: #fdba74"] { color: #c2410c !important; background: rgba(251,146,60,0.12) !important; border-color: rgba(251,146,60,0.3) !important; }
html[data-theme="light"] span[style*="color:#fca5a5"], html[data-theme="light"] span[style*="color: #fca5a5"] { color: #b91c1c !important; background: rgba(239,68,68,0.12) !important; border-color: rgba(239,68,68,0.3) !important; }
html[data-theme="light"] span[style*="color:#94a3b8"], html[data-theme="light"] span[style*="color: #94a3b8"] { color: #334155 !important; background: rgba(100,116,139,0.12) !important; border-color: rgba(100,116,139,0.3) !important; }
html[data-theme="light"] span[style*="color:#c084fc"], html[data-theme="light"] span[style*="color: #c084fc"] { color: #7e22ce !important; background: rgba(168,85,247,0.12) !important; border-color: rgba(168,85,247,0.3) !important; }

/* =====================================================
   END LIGHT MODE
   ===================================================== */

/* Light mode: AI Support Chat Drawer */
html[data-theme="light"] #ai-support-drawer {
    background: #ffffff !important;
    border-color: #d1d9e0 !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15) !important;
}
html[data-theme="light"] .ai-drawer-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-bottom-color: #d1d9e0 !important;
}
html[data-theme="light"] .ai-avatar {
    background: rgba(251,146,60,0.1) !important;
}
html[data-theme="light"] .ai-chat-body {
    background: #f8fafc !important;
}
html[data-theme="light"] .ai-msg-bot .ai-msg-content {
    background-color: #ffffff !important;
    color: #1e293b !important;
    border-color: #d1d9e0 !important;
}
html[data-theme="light"] .ai-pill-btn {
    background: rgba(241,245,249,0.8) !important;
    border-color: #d1d9e0 !important;
    color: #475569 !important;
}
html[data-theme="light"] .ai-pill-btn:hover {
    background: rgba(251,146,60,0.12) !important;
    color: #ea580c !important;
    border-color: #fb923c !important;
}
html[data-theme="light"] .ai-drawer-footer {
    background: #f8fafc !important;
    border-top-color: #d1d9e0 !important;
}
html[data-theme="light"] .ai-drawer-footer textarea,
html[data-theme="light"] .ai-drawer-footer input {
    background: #ffffff !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
}
html[data-theme="light"] #ai-support-fab {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
}
html[data-theme="light"] #ai-online-dot {
    border-color: #f8fafc !important;
}

/* Light mode: sidebar toggle trigger (expand button) */
html[data-theme="light"] .sidebar-toggle-trigger {
    background: rgba(251,146,60,0.08) !important;
    border-color: rgba(251,146,60,0.25) !important;
    color: #ea580c !important;
}

/* Light mode: PWA install banner */
html[data-theme="light"] #pwa-install-banner {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border-top-color: rgba(251,146,60,0.2) !important;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.12) !important;
}
html[data-theme="light"] .pwa-title { color: #1e293b !important; }
html[data-theme="light"] .pwa-subtitle { color: #64748b !important; }

/* Light mode: message alerts in restaurant portal */
html[data-theme="light"] .messages-container .message-alert {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12) !important;
}

/* Light mode: fix any remaining Bootstrap dark utility classes */
html[data-theme="light"] .border-bottom.border-secondary {
    border-color: #d1d9e0 !important;
}

/* Brand Typography & Tablora Logo Component */
.brand-title {
    font-family: var(--font-brand) !important;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(135deg, #ffffff 40%, #fb923c 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    display: inline-block;
}

.brand-subtitle {
    font-family: var(--font-sans) !important;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #9ca3af;
    text-transform: none;
    line-height: 1;
    margin-top: 1px;
    display: block;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease;
}

/* Base Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Glassmorphism utility */
.glass-panel {
    background: rgba(26, 26, 30, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
}

/* Sidebar Layout Base */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    background-color: var(--bg-dark-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease, transform 0.3s ease;
}

.main-content {
    flex-grow: 1;
    padding: 2rem;
    background-color: var(--bg-dark-primary);
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    box-sizing: border-box;
}

/* Navigation Links */
.sidebar-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background-color: rgba(251, 146, 60, 0.12);
    border-left: 3px solid var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
}

/* Desktop Collapsed vs Expanded Rules (min-width: 768px) */
@media (min-width: 768px) {
    /* Default Collapsed Desktop Sidebar (80px) */
    .sidebar {
        width: 80px;
        padding: 1.25rem 0.5rem;
        overflow-x: hidden;
    }

    .main-content {
        margin-left: 80px;
        width: calc(100% - 80px);
        max-width: calc(100vw - 80px);
        min-width: 0;
        box-sizing: border-box;
    }

    .sidebar-header-wrapper {
        width: 100%;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.75rem;
        margin-bottom: 1.5rem !important;
    }

    .sidebar-brand-text,
    .nav-text,
    .sidebar-user-text {
        display: none !important;
        opacity: 0;
    }

    /* Expand / Collapse Icon Button inside Sidebar Header - Always Visible! */
    .sidebar-toggle-trigger {
        background: rgba(251, 146, 60, 0.15);
        border: 1px solid rgba(251, 146, 60, 0.35);
        color: #fb923c;
        border-radius: 8px;
        width: 32px;
        height: 32px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        padding: 0;
        margin: 0;
    }

    .sidebar-toggle-trigger:hover {
        background: var(--primary);
        color: #111;
        transform: scale(1.1);
    }

    .nav-item {
        justify-content: center;
        padding: 0.75rem 0.5rem;
        border-radius: 0.75rem;
    }

    .nav-item i {
        font-size: 1.35rem;
    }

    .sidebar-footer .nav-item {
        justify-content: center !important;
        padding: 0.6rem 0.5rem;
    }

    .nav-item:hover {
        transform: scale(1.06);
    }

    /* Expanded State (260px) when body has class .sidebar-expanded */
    body.sidebar-expanded .sidebar {
        width: 260px;
        padding: 1.5rem 1rem;
    }

    body.sidebar-expanded .main-content {
        margin-left: 260px;
        width: calc(100% - 260px);
        max-width: calc(100vw - 260px);
    }

    body.sidebar-expanded .sidebar-header-wrapper {
        flex-direction: row !important;
        justify-content: flex-start !important;
        align-items: center !important;
        padding: 0.6rem 0.75rem !important;
        gap: 0.75rem !important;
    }

    body.sidebar-expanded .sidebar-brand-text,
    body.sidebar-expanded .nav-text {
        display: flex !important;
        opacity: 1;
    }

    body.sidebar-expanded .sidebar-brand-text {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        min-width: 0 !important;
        flex: 1 !important;
        opacity: 1 !important;
    }

    body.sidebar-expanded .nav-text {
        display: inline-block !important;
    }

    body.sidebar-expanded .nav-item {
        justify-content: flex-start !important;
        padding: 0.75rem 0.75rem !important;
        gap: 0.75rem !important;
    }

    body.sidebar-expanded .nav-item:hover {
        transform: none;
    }

    body.sidebar-expanded .sidebar-footer .nav-item {
        justify-content: flex-start !important;
        padding: 0.65rem 0.75rem !important;
        gap: 0.75rem !important;
    }
}

/* Sidebar User Card Footer Component */
.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.75rem;
    transition: all 0.25s ease;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex: 1;
    text-align: left;
}

.sidebar-user-text .user-name {
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.sidebar-user-text .restaurant-name {
    color: #9ca3af;
    font-size: 0.73rem;
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-top: 1px;
}

.sidebar img,
.sidebar-logo img,
.sidebar-header-wrapper img,
.sidebar-user-avatar {
    width: 36px !important;
    height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    object-fit: cover !important;
    border: 1.5px solid rgba(251, 146, 60, 0.5);
}

.sidebar-user-avatar.initial-avatar {
    background-color: #fb923c;
    color: #111827 !important;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(251, 146, 60, 0.25);
    line-height: 1 !important;
}

@media (min-width: 768px) {
    /* Collapsed Sidebar: center avatar, hide card border & text */
    body:not(.sidebar-expanded) .sidebar-user-card {
        justify-content: center;
        background: transparent;
        border-color: transparent;
        padding: 0.4rem 0;
    }
    body:not(.sidebar-expanded) .sidebar-user-text {
        display: none !important;
    }
    
    /* Expanded Sidebar: show full card & user text */
    body.sidebar-expanded .sidebar-user-card {
        justify-content: flex-start;
        padding: 0.6rem 0.75rem;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    body.sidebar-expanded .sidebar-user-text {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        min-width: 0 !important;
        flex: 1 !important;
        text-align: left !important;
        opacity: 1 !important;
    }

    body.sidebar-expanded .sidebar-user-text .user-name {
        color: #ffffff;
        font-size: 0.85rem;
        font-weight: 600;
        line-height: 1.25;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.sidebar-expanded .sidebar-user-text .restaurant-name {
        color: #9ca3af;
        font-size: 0.73rem;
        font-weight: 400;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-top: 1px;
    }
}

@media (max-width: 767.98px) {
    .sidebar-header-wrapper {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0.5rem 0.75rem !important;
        margin-bottom: 1.25rem !important;
    }
    .sidebar-logo {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
    }
    .sidebar-brand-text {
        display: flex !important;
        flex-direction: column !important;
    }
    .mobile-close-btn {
        width: 32px;
        height: 32px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.05);
        color: #94a3b8 !important;
        transition: all 0.2s ease;
    }
    .mobile-close-btn:hover {
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff !important;
    }
    .sidebar .nav-item {
        justify-content: flex-start !important;
        padding: 0.75rem 0.75rem !important;
        gap: 0.75rem !important;
    }
    .sidebar-user-card {
        justify-content: flex-start !important;
        padding: 0.65rem 0.75rem !important;
        gap: 0.75rem !important;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
    .sidebar-user-text {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        flex: 1;
        text-align: left;
    }
    .sidebar-user-text .user-name {
        color: #ffffff;
        font-size: 0.85rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sidebar-user-text .restaurant-name {
        color: #9ca3af;
        font-size: 0.73rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-top: 1px;
    }
    .sidebar-footer .nav-item {
        justify-content: flex-start !important;
        padding: 0.65rem 0.75rem !important;
        gap: 0.75rem !important;
    }
}

/* Metric Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background-color: var(--bg-dark-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(251, 146, 60, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border: none;
    color: #121214;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-dark {
    background-color: var(--bg-dark-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}
.btn-dark:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

/* Tables and Lists */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: var(--bg-dark-card);
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.custom-table th {
    background-color: var(--bg-dark-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-new { background-color: rgba(251, 146, 60, 0.15); color: var(--primary); border: 1px solid rgba(251, 146, 60, 0.3); }
.badge-accepted { background-color: rgba(59, 130, 246, 0.15); color: var(--info); border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-preparing { background-color: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-ready { background-color: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-completed, .badge-served { background-color: rgba(16, 185, 129, 0.25); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-cancelled { background-color: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }

/* Form Elements */
.custom-form-group {
    margin-bottom: 1.25rem;
}
.custom-form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.custom-form-input {
    width: 100%;
    background-color: var(--bg-dark-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}
.custom-form-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Customer Mobile Menu Styling */
.customer-body {
    background-color: #f1f5f9;
    color: #0f172a;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.mobile-app-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-color: #f1f5f9;
}

.mobile-app-shell {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background-color: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    position: relative;
    display: flex;
    flex-direction: column;
}

@media (min-width: 577px) {
    .mobile-app-wrapper {
        padding: 1.5rem 0;
    }
    .mobile-app-shell {
        border-radius: 1.75rem;
        min-height: calc(100vh - 3rem);
        overflow: hidden;
        border: 1px solid #e2e8f0;
    }
}

.customer-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #f1f5f9;
    padding: 0.85rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.app-logo-img {
    height: 40px !important;
    width: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.app-logo-avatar {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 2px 6px rgba(234, 88, 12, 0.25);
}

.app-title-text {
    font-size: 0.95rem;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.small-subtitle {
    font-size: 0.75rem;
    color: #64748b;
}

.customer-main-content {
    flex-grow: 1;
    padding-bottom: 5.5rem !important;
}

.customer-menu-card {
    background-color: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 1.1rem;
    overflow: hidden;
    display: flex;
    padding: 0.85rem;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.customer-menu-card:active {
    transform: scale(0.985);
}

.menu-item-img {
    width: 88px;
    height: 88px;
    border-radius: 0.85rem;
    object-fit: cover;
    background-color: #f8fafc;
    flex-shrink: 0;
}

.menu-item-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-item-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
    margin: 0 0 0.2rem 0;
}

.menu-item-price {
    font-weight: 800;
    color: #ea580c;
    font-size: 1.05rem;
}

.quantity-controller {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #ea580c;
    border-radius: 9999px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 5px rgba(234, 88, 12, 0.12);
}
.qty-btn {
    border: none;
    background: transparent;
    color: #ea580c;
    font-weight: 800;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background-color 0.15s;
    user-select: none;
}
.qty-btn:active {
    background-color: #ffedd5;
}
.qty-num {
    padding: 0 0.4rem;
    font-weight: 700;
    font-size: 0.88rem;
    min-width: 22px;
    text-align: center;
    color: #0f172a;
}

/* Floating mobile bottom cart bar */
.bottom-cart-bar {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 448px;
    z-index: 1050;
}

.cart-inner-btn {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    color: #ffffff;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(234, 88, 12, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-inner-btn:active {
    transform: scale(0.98);
}

/* Cart overlay bottom sheet modal */
.cart-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1100;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.cart-modal-content {
    background: #ffffff;
    border-radius: 1.75rem 1.75rem 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUpSheet 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.sheet-handle-bar {
    width: 40px;
    height: 4.5px;
    background-color: #cbd5e1;
    border-radius: 9999px;
    margin: 0 auto 1rem;
}

@keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* Kitchen layout styles are now scoped inside kitchen.html extra_css block */

.kitchen-lane {
    background-color: var(--bg-dark-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.kitchen-lane-header {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.order-card-pulse {
    animation: orderPulse 1.5s infinite alternate;
}

@keyframes orderPulse {
    0% { border-color: var(--border-color); }
    100% { border-color: var(--primary); }
}

.kitchen-card {
    background-color: var(--bg-dark-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.kitchen-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.5rem;
}

.kitchen-item-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.kitchen-item-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.kitchen-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Animations */
.fade-in-order {
    animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================================
   RESTAURANT ADMIN MOBILE APP LAYOUT & BOTTOM NAV
   ===================================================== */
.admin-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(26, 26, 30, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1050;
    padding: 0 0.25rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.35rem 0.5rem;
    border-radius: 0.75rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    max-width: 75px;
    text-align: center;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.bottom-nav-item:active {
    transform: scale(0.9);
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active i {
    transform: translateY(-2px);
}

/* Global Table & Panel Responsiveness (Applies to Desktop, Tablet, and Mobile) */
.table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.5rem;
}
.glass-panel {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* =====================================================
   RESPONSIVE / MOBILE ADMIN SIDEBAR & SHELL
   ===================================================== */
@media (max-width: 767.98px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    .dashboard-container {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    .sidebar {
        transform: translateX(-100%);
        width: 270px;
        background-color: #16161a;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
        border-top-right-radius: 1.25rem;
        border-bottom-right-radius: 1.25rem;
        z-index: 1100;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 0.75rem 0.75rem 5.5rem 0.75rem !important; /* Spacing so fixed bottom navbar doesn't cover content */
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    .glass-panel {
        padding: 0.9rem !important;
        border-radius: 0.875rem !important;
    }
    .custom-table {
        white-space: nowrap !important;
    }
    .admin-page-title {
        font-size: 1.15rem !important;
    }
    .admin-page-subtitle {
        font-size: 0.72rem !important;
    }
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .metric-card {
        padding: 0.85rem;
        border-radius: 0.875rem;
    }
    .metric-value {
        font-size: 1.3rem;
    }
    .kitchen-board {
        grid-template-columns: 1fr 1fr;
    }
    .custom-table td, .custom-table th {
        padding: 0.6rem 0.75rem !important;
        font-size: 0.82rem !important;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
    }
    .kitchen-board {
        grid-template-columns: 1fr;
    }
    .metric-value {
        font-size: 1.15rem;
    }
    .main-content {
        padding: 0.65rem 0.65rem 5.5rem 0.65rem !important;
    }
    .glass-panel {
        padding: 0.75rem !important;
    }
}

/* =====================================================
   DJANGO MESSAGES / ALERTS
   ===================================================== */
.messages-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 360px;
}

.message-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideInRight 0.3s ease forwards;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    opacity: 1 !important;
}

.message-alert.success { background: #10b981; border: 1px solid #34d399; color: #ffffff; }
.message-alert.error   { background: #450a0a;  border: 1px solid #ef4444;  color: #f87171; }
.message-alert.warning { background: #451a03; border: 1px solid #f59e0b; color: #fbbf24; }
.message-alert.info    { background: #1e3a8a; border: 1px solid #3b82f6; color: #60a5fa; }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Sidebar toggle button (visible on all viewports) */
.sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 0.5rem;
    padding: 0.4rem 0.65rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background: var(--border-color);
    color: var(--primary);
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    z-index: 1090;
}
.sidebar-overlay.active { display: block; }

