/**
 * TapFood UI Design System - Theme CSS
 * 
 * This file defines the design tokens (CSS custom properties) and base component
 * styles for the TapFood web UI. All design values use semantic tokens to ensure
 * consistency and allow for easy customization per store and context.
 */

/* ==========================================================================
   BASE TOKENS - Design System Foundation
   ========================================================================== */

:root {
    /* ======================================================================
       TYPOGRAPHY
       ====================================================================== */
    
    /* Font Families */
    --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    
    /* Font Sizes - Desktop (Backend/Admin) */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;      /* 18px */
    --font-size-xl: 1.25rem;       /* 20px */
    --font-size-2xl: 1.5rem;       /* 24px */
    --font-size-3xl: 1.875rem;     /* 30px */
    --font-size-4xl: 2.25rem;      /* 36px */
    
    /* Font Sizes - Mobile */
    --font-size-xs-mobile: 0.8125rem;   /* 13px */
    --font-size-sm-mobile: 0.9375rem;   /* 15px */
    --font-size-base-mobile: 1rem;      /* 16px */
    --font-size-lg-mobile: 1.125rem;     /* 18px */
    --font-size-xl-mobile: 1.375rem;     /* 22px */
    --font-size-2xl-mobile: 1.75rem;    /* 28px */
    --font-size-3xl-mobile: 2rem;       /* 32px */
    
    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Letter Spacing */
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;
    
    /* ======================================================================
       SPACING SYSTEM (4px base unit)
       ====================================================================== */
    
    --spacing-0: 0;
    --spacing-1: 0.25rem;    /* 4px */
    --spacing-2: 0.5rem;     /* 8px */
    --spacing-3: 0.75rem;    /* 12px */
    --spacing-4: 1rem;       /* 16px */
    --spacing-5: 1.25rem;    /* 20px */
    --spacing-6: 1.5rem;     /* 24px */
    --spacing-8: 2rem;      /* 32px */
    --spacing-10: 2.5rem;   /* 40px */
    --spacing-12: 3rem;     /* 48px */
    --spacing-16: 4rem;     /* 64px */
    
    /* Touch-Optimized Spacing (Mobile) */
    --spacing-touch: 0.75rem;        /* 12px - minimum touch padding */
    --spacing-touch-lg: 1rem;       /* 16px - preferred touch padding */
    --spacing-section-mobile: 1.5rem; /* 24px - section spacing on mobile */
    
    /* Desktop Spacing */
    --spacing-desktop: 0.5rem;      /* 8px - compact desktop spacing */
    --spacing-section-desktop: 2rem; /* 32px - section spacing on desktop */
    
    /* ======================================================================
       RESPONSIVE BREAKPOINTS
       ====================================================================== */
    
    --breakpoint-xs: 320px;
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;
    
    /* ======================================================================
       COLORS - Base Surfaces
       ====================================================================== */
    
    --bg-app: #f8f9fa;
    --bg-surface: #ffffff;
    --bg-surface-2: #f5f6f7;
    --bg-input: #ffffff;
    --border: #e1e4e8;
    --border-strong: #d1d5db;

    /* Text */
    --text: #1f2937;
    --text-muted: #6b7280;
    --text-inverse: #ffffff;

    /* Interactive - Minimalist Light Blue (in-app default) */
    --accent: #6b9bd2;
    --accent-contrast: #ffffff;
    --focus-ring: #6b9bd2;

    /* ------------------------------------------------------------------
       Marketing design language (--uv-*)
       Brand-aligned with product UI accent (#6b9bd2) and cool neutrals.
       Solid CTA uses a deeper step of the same hue for WCAG AA on white.
       Scoped remaps: .marketing-page / .mobile-marketing-page in marketing.css.
       Do not force these onto tenant UI.
       ------------------------------------------------------------------ */
    /* Neutrals — cool gray (match in-app surfaces; not green-tinted paper) */
    --uv-bg-0: #f8f9fa;
    --uv-bg-1: #ffffff;
    --uv-bg-2: #f0f2f5;
    --uv-border: rgba(31, 41, 55, 0.10);
    --uv-border-strong: rgba(31, 41, 55, 0.18);
    --uv-text: #1f2937;
    --uv-muted: #4b5563;   /* body secondary; AA on paper */
    --uv-muted-2: #6b7280; /* captions / eyebrows; AA on paper (~4.59:1) */

    /* Accent family — Uvelo brand blue */
    --uv-brand: #6b9bd2;                 /* identity / soft tints */
    --uv-accent: #366fb0;                /* solid CTAs; AA with white (~5.2:1) */
    --uv-accent-hover: #2d5d95;
    --uv-accent-soft: rgba(107, 155, 210, 0.12);
    --uv-accent-contrast: #ffffff;

    /* Overlays / frost (nav, drawers) */
    --uv-nav-frost: rgba(248, 249, 250, 0.92);
    --uv-overlay: rgba(31, 41, 55, 0.45);

    /* Semantic (marketing forms) */
    --uv-danger: #b42318;
    --uv-success: #027a48;
    --uv-font-display: "Instrument Sans", "Segoe UI", sans-serif;
    --uv-font-body: "Instrument Sans", "Segoe UI", sans-serif;
    --uv-h1: clamp(2.4rem, 5vw, 4rem);
    --uv-h2: clamp(1.75rem, 3vw, 2.5rem);
    --uv-h3: clamp(1.15rem, 1.6vw, 1.4rem);
    --uv-body: 1.0625rem;
    --uv-small: 0.9375rem;
    --uv-eyebrow: 0.8125rem;
    --uv-space-1: 0.5rem;
    --uv-space-2: 0.75rem;
    --uv-space-3: 1rem;
    --uv-space-4: 1.5rem;
    --uv-space-5: 2.5rem;
    --uv-space-6: 4rem;
    --uv-space-7: 6rem;
    --uv-space-8: 8rem;
    --uv-radius-sm: 8px;
    --uv-radius-md: 12px;
    --uv-radius-lg: 16px;
    --uv-shadow-sm: 0 1px 2px rgba(31, 41, 55, 0.08);
    --uv-shadow-md: 0 10px 28px rgba(31, 41, 55, 0.10);

    /* States (Semantic) - Gray Variations for Minimalism */
    --success: #6b7280;
    --success-bg: #f3f4f6;
    --success-text: #374151;
    --success-border: #d1d5db;
    --warning: #6b7280;
    --warning-bg: #f3f4f6;
    --warning-text: #374151;
    --warning-border: #d1d5db;
    --danger: #6b7280;
    --danger-bg: #f3f4f6;
    --danger-text: #374151;
    --danger-border: #d1d5db;
    --error: #6b7280;              /* Alias for danger */
    --error-bg: #f3f4f6;           /* Alias for danger-bg */
    --error-text: #374151;         /* Alias for danger-text */
    --error-border: #d1d5db;       /* Alias for danger-border */
    --info: #6b7280;
    --info-bg: #f3f4f6;
    --info-text: #374151;
    --info-border: #d1d5db;
    
    /* Hover States */
    --bg-hover: #f3f4f6;
    
    /* ======================================================================
       COMPONENT DIMENSIONS
       ====================================================================== */
    
    --button-height: 40px;          /* Desktop button height */
    --button-height-mobile: 48px;   /* Mobile button height (touch target) */
    --input-height: 40px;            /* Desktop input height */
    --input-height-mobile: 48px;    /* Mobile input height (touch target) */
    --sidebar-width: 260px;         /* Sidebar width (desktop) */

    /* Top Bar */
    --topbar-bg: #ffffff;
    --topbar-border: #e1e4e8;
    --topbar-height: 64px;
    --topbar-text: #1f2937;
    
    /* Sidebar - Neutral Dark Gray */
    --sidebar-bg: #374151;
    --sidebar-text: #f3f4f6;
    --sidebar-text-muted: #9ca3af;
    --sidebar-active-bg: #4b5563;
    --sidebar-active-text: #ffffff;
    --sidebar-hover-bg: #4b5563;
    --sidebar-border: #4b5563;

    /* Table */
    --table-header-bg: #f9fafb;
    --table-row-bg: #ffffff;
    --table-row-alt-bg: #f9fafb;
    --table-row-hover-bg: #f3f4f6;
    --table-border: #e5e7eb;
    --table-text: #1f2937;

    /* Tags/Badges - Gray Variations */
    --tag-bg: #f3f4f6;
    --tag-text: #374151;
    --tag-border: #d1d5db;
    --tag-active-bg: #e5e7eb;
    --tag-active-text: #1f2937;

    /* Breadcrumb */
    --breadcrumb-text: #6b7280;
    --breadcrumb-separator: #9ca3af;
    --breadcrumb-active: #1f2937;

    /* KDS (Kitchen Display System) - Minimalist Gray with Light Blue Accent */
    --kds-bg: #f5f6f7;
    --kds-surface: #ffffff;
    --kds-text: #1a1a1a;
    --kds-muted: #6b7280;
    --kds-border: #d1d5db;
    --kds-ready: #6b9bd2;
    --kds-in-progress: #6b9bd2;
    --kds-alert: #9ca3af;
}

/* ==========================================================================
   BASE RESET & TYPOGRAPHY
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    background: var(--bg-app);
    color: var(--text);
}

/* Typography Headings */
.h1, .h2, .h3, .h4, .h5, .h6,
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--text);
    margin: 0;
}

.h1, h1 {
    font-size: var(--font-size-3xl);
}

.h2, h2 {
    font-size: var(--font-size-2xl);
}

.h3, h3 {
    font-size: var(--font-size-xl);
}

.h4, h4 {
    font-size: var(--font-size-lg);
}

.h5, h5 {
    font-size: var(--font-size-base);
}

.h6, h6 {
    font-size: var(--font-size-sm);
}

/* Body Text */
.body-text {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--text);
}

.body-text-muted {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ==========================================================================
   TOP BAR
   ========================================================================== */

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-6);
    z-index: 1000;
    /* Enhanced shadow for better depth and separation */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    /* Subtle backdrop blur for modern feel (optional, graceful degradation) */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    font-family: var(--font-family-base);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--topbar-text);
    text-decoration: none;
    transition: opacity 0.2s;
    /* Better visual hierarchy */
    letter-spacing: var(--letter-spacing-tight);
    border: none;
    box-shadow: none;
}

.topbar-logo:hover {
    opacity: 0.8;
}

.topbar-logo img {
    height: 36px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    border: none;
    box-shadow: none;
    filter: none;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    /* Better visual grouping of right-side elements */
    padding-left: var(--spacing-4);
    border-left: 1px solid var(--border);
}

/* Notification Bell */
.notification-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    /* Subtle background for better visual presence */
    background: transparent;
}

.notification-bell:hover {
    background: var(--bg-surface-2);
    color: var(--text);
    transform: translateY(-1px);
}

.notification-bell:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.notification-bell svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--accent);
    color: var(--accent-contrast);
    border-radius: 9px;
    border: 2px solid var(--topbar-bg);
    display: none;
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    line-height: 1;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-bell.has-notifications .notification-badge {
    display: flex;
}

/* Notification Panel */
.notification-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.notification-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-surface);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    overflow: hidden;
}

.notification-panel.open {
    right: 0;
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-4);
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    flex-shrink: 0;
}

.notification-panel-header h2 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text);
}

.notification-panel-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.btn-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-2);
    color: var(--text-muted);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 24px;
    line-height: 1;
    width: 32px;
    height: 32px;
}

.btn-close:hover {
    color: var(--text);
    background: var(--bg-surface-2);
}

/* Notification Panel Tabs */
.notification-panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    flex-shrink: 0;
}

.notification-tab {
    flex: 1;
    padding: var(--spacing-3) var(--spacing-2);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-muted);
    transition: all 0.2s;
    font-family: var(--font-family-base);
}

.notification-tab:hover {
    color: var(--text);
    background: var(--bg-surface-2);
}

.notification-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: var(--bg-surface);
    font-weight: var(--font-weight-semibold);
}

.notification-panel-filters {
    padding: var(--spacing-4);
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface-2);
    flex-shrink: 0;
    min-height: 60px;
}

.filter-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.filter-group label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-muted);
}

.filter-group select {
    padding: var(--spacing-2) var(--spacing-3);
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-size: var(--font-size-sm);
    font-family: var(--font-family-base);
}

/* Radio button group for priority filter */
.filter-radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.radio-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-2);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.radio-option:hover {
    background: var(--bg-surface);
}

.radio-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.radio-option span {
    font-size: var(--font-size-sm);
    color: var(--text);
    user-select: none;
}

.radio-option input[type="radio"]:checked + span {
    font-weight: var(--font-weight-semibold);
    color: var(--accent);
}

.notification-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-2);
    background: var(--bg-app);
}

.notification-loading,
.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-8);
    color: var(--text-muted);
    text-align: center;
}

.notification-loading svg,
.notification-empty svg {
    width: 48px;
    height: 48px;
    fill: currentColor;
    opacity: 0.5;
    margin-bottom: var(--spacing-4);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-4);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-3);
    padding: var(--spacing-3);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.notification-item:hover {
    background: var(--bg-surface-2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.notification-item.unread {
    border-left: 3px solid var(--accent);
    background: var(--bg-surface);
}

.notification-item.read {
    opacity: 0.8;
}

.notification-item.priority-low {
    border-left-color: #6c757d;
}

.notification-item.priority-medium {
    border-left-color: #ffc107;
}

.notification-item.priority-high {
    border-left-color: #fd7e14;
}

.notification-item.priority-critical {
    border-left-color: #dc3545;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    margin-bottom: var(--spacing-2);
}

.notification-type {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--text-muted);
    text-transform: uppercase;
}

.notification-priority {
    font-size: var(--font-size-xs);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: var(--font-weight-medium);
}

.notification-priority.priority-low {
    background: #e9ecef;
    color: #495057;
}

.notification-priority.priority-medium {
    background: #fff3cd;
    color: #856404;
}

.notification-priority.priority-high {
    background: #ffeaa7;
    color: #d63031;
}

.notification-priority.priority-critical {
    background: #ffebee;
    color: #c62828;
}

.notification-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text);
    margin-bottom: var(--spacing-1);
}

.notification-message {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: var(--spacing-2);
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.notification-time,
.notification-order,
.notification-table {
    display: inline-flex;
    align-items: center;
}

.notification-actions {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-2);
    flex-shrink: 0;
}

.btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-1);
    color: var(--text-muted);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

.notification-item:hover .btn-delete {
    opacity: 1;
}

.btn-delete:hover {
    color: #dc3545;
    background: #ffebee;
}

.btn-delete svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.notification-error {
    padding: var(--spacing-4);
    color: #dc3545;
    text-align: center;
    background: #ffebee;
    border-radius: 4px;
    margin: var(--spacing-4);
}

/* Responsive design for notification panel */
@media (max-width: 768px) {
    .notification-panel {
        width: 100vw;
        right: -100vw;
    }
    
    .notification-panel.open {
        right: 0;
    }
}

/* User Profile Dropdown */
.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: var(--accent-contrast);
    font-family: var(--font-family-base);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid var(--topbar-bg);
    /* Subtle shadow for depth */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: var(--border);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.user-avatar:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.user-profile-dropdown {
    position: absolute;
    top: calc(100% + var(--spacing-2));
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    display: none;
    z-index: 1001;
    overflow: hidden;
}

.user-profile-dropdown.active {
    display: block;
}

.user-profile-header {
    padding: var(--spacing-4);
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface-2);
}

.user-profile-name {
    font-family: var(--font-family-base);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text);
    margin-bottom: var(--spacing-1);
}

.user-profile-role {
    font-family: var(--font-family-base);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.user-profile-menu {
    list-style: none;
    padding: var(--spacing-2) 0;
    margin: 0;
}

.user-profile-menu li {
    margin: 0;
}

.user-profile-menu a {
    display: flex;
    align-items: center;
    padding: var(--spacing-3) var(--spacing-4);
    font-family: var(--font-family-base);
    font-size: var(--font-size-sm);
    color: var(--text);
    text-decoration: none;
    transition: background-color 0.2s;
}

.user-profile-menu a:hover {
    background: var(--bg-surface-2);
    color: var(--text);
}

.user-profile-menu a:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: -2px;
}

.user-profile-menu a svg {
    width: 16px;
    height: 16px;
    margin-right: var(--spacing-3);
    fill: currentColor;
}

.user-profile-menu .menu-divider {
    height: 1px;
    background: var(--border);
    margin: var(--spacing-2) 0;
}

/* ==========================================================================
   SIDEBAR COMPONENTS
   ========================================================================== */

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: var(--spacing-4) var(--spacing-6);
    background: color-mix(in srgb, var(--sidebar-bg) 85%, black);
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-header .subtitle {
    font-family: var(--font-family-base);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-normal);
    color: var(--sidebar-text-muted);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
}

.sidebar-menu {
    list-style: none;
    padding: var(--spacing-4) 0;
    flex: 1;
    overflow-y: auto;
    margin-bottom: 0;
}

.sidebar-menu--grouped {
    padding-top: var(--spacing-3);
}

.sidebar-menu li {
    margin: var(--spacing-1) 0;
}

.sidebar-group {
    margin: 0;
}

.sidebar-menu li.sidebar-group {
    margin: 0;
}

.sidebar-group-details {
    border-bottom: 1px solid color-mix(in srgb, var(--sidebar-border) 65%, transparent);
    padding: var(--spacing-2) 0;
}

.sidebar-group-details:last-child {
    border-bottom: none;
}

.sidebar-group-summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    padding: var(--spacing-2) var(--spacing-6);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--sidebar-text-muted);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-group-summary::-webkit-details-marker {
    display: none;
}

.sidebar-group-summary::after {
    content: "▸";
    font-size: 0.85em;
    line-height: 1;
    color: var(--sidebar-text-muted);
    transform: rotate(0deg);
    transition: transform 0.15s ease;
}

.sidebar-group-details[open] > .sidebar-group-summary::after {
    transform: rotate(90deg);
}

.sidebar-group-summary:hover {
    background: color-mix(in srgb, var(--sidebar-bg) 85%, black);
    color: var(--sidebar-text);
}

.sidebar-group-summary:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: -2px;
}

.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Submenu links: same font size as menu items (group summaries and direct links) */
.sidebar-menu .sidebar-submenu a {
    font-size: var(--font-size-xs) !important;
}

.sidebar-submenu--nested {
    margin-top: var(--spacing-1);
    padding-left: var(--spacing-4);
}

/* Direct links wrapped in sidebar-group-item should have the same style as group summaries */
.sidebar-menu li.sidebar-group--direct {
    margin: 0;
}

.sidebar-group--direct {
    border-bottom: 1px solid color-mix(in srgb, var(--sidebar-border) 65%, transparent);
    padding: var(--spacing-2) 0;
    margin: 0;
}

.sidebar-group--direct .sidebar-group-item {
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    width: 100% !important;
}

/* Direct links should match group summary style exactly */
.sidebar-menu .sidebar-group--direct > a {
    list-style: none !important;
    cursor: pointer !important;
    user-select: none !important;
    padding: var(--spacing-2) var(--spacing-6) !important;
    font-size: var(--font-size-xs) !important;
    font-weight: var(--font-weight-semibold) !important;
    color: var(--sidebar-text-muted) !important;
    text-transform: uppercase !important;
    letter-spacing: var(--letter-spacing-wide) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-decoration: none !important;
    transition: all 0.2s !important;
    border-left: none !important;
    font-family: var(--font-family-base) !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* Override any styles from .sidebar-menu a */
.sidebar-menu .sidebar-group--direct > a,
.sidebar-menu .sidebar-group--direct > a:hover,
.sidebar-menu .sidebar-group--direct > a:active,
.sidebar-menu .sidebar-group--direct > a:focus {
    padding: var(--spacing-2) var(--spacing-6) !important;
    font-size: var(--font-size-xs) !important;
    font-weight: var(--font-weight-semibold) !important;
    color: var(--sidebar-text-muted) !important;
    text-transform: uppercase !important;
    letter-spacing: var(--letter-spacing-wide) !important;
    border-left: none !important;
}

.sidebar-group--direct > a:hover {
    background: color-mix(in srgb, var(--sidebar-bg) 85%, black) !important;
    color: var(--sidebar-text) !important;
    text-decoration: none !important;
}

.sidebar-group--direct > a.active {
    background: color-mix(in srgb, var(--sidebar-bg) 85%, black) !important;
    color: var(--sidebar-text) !important;
    text-decoration: none !important;
}

.sidebar-group--direct > a:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: -2px;
}

.sidebar-subgroup {
    margin: 0;
}

.sidebar-subgroup-details {
    padding: 0;
}

.sidebar-subgroup-summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    padding: var(--spacing-3) var(--spacing-6);
    font-family: var(--font-family-base);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--sidebar-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-subgroup-summary::-webkit-details-marker {
    display: none;
}

.sidebar-subgroup-summary::after {
    content: "▸";
    font-size: 0.85em;
    line-height: 1;
    color: var(--sidebar-text-muted);
    transform: rotate(0deg);
    transition: transform 0.15s ease;
}

.sidebar-subgroup-details[open] > .sidebar-subgroup-summary::after {
    transform: rotate(90deg);
}

.sidebar-subgroup-summary:hover {
    background: var(--sidebar-hover-bg);
    border-left-color: var(--accent);
}

.sidebar-subgroup-summary:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: -2px;
}

.sidebar-item,
.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: var(--spacing-3) var(--spacing-6);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    text-transform: uppercase;
}


.sidebar-item:hover,
.sidebar-menu a:hover {
    background: var(--sidebar-hover-bg);
    border-left-color: var(--accent);
    text-decoration: none;
}

.sidebar-item--active,
.sidebar-menu a.active {
    background: var(--sidebar-active-bg);
    border-left-color: var(--accent);
    font-weight: var(--font-weight-semibold);
    color: var(--sidebar-active-text);
}

.sidebar-item:focus,
.sidebar-menu a:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: -2px;
}

.sidebar-menu a i {
    margin-right: var(--spacing-3);
    width: 20px;
    text-align: center;
    font-style: normal;
}

.sidebar-footer {
    width: 100%;
    padding: var(--spacing-4) var(--spacing-6);
    background: color-mix(in srgb, var(--sidebar-bg) 85%, black);
    border-top: 1px solid var(--sidebar-border);
    margin-top: auto;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.user-name {
    font-family: var(--font-family-base);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--sidebar-text);
}

.user-role {
    font-family: var(--font-family-base);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-normal);
    color: var(--sidebar-text-muted);
    text-transform: capitalize;
}

.logout-btn {
    width: 100%;
    padding: var(--spacing-2);
    font-family: var(--font-family-base);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    background: var(--accent);
    color: var(--accent-contrast);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    min-height: var(--button-height);
}

.logout-btn:hover {
    background: color-mix(in srgb, var(--accent) 90%, black);
}

.logout-btn:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
}

/* Mobile: No sidebar margin */
@media (max-width: 767px) {
    .main-content {
        margin-left: 0;
    }
}

.top-header {
    background: var(--bg-surface);
    padding: var(--spacing-6) var(--spacing-8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: var(--spacing-8);
}

.top-header h2,
.top-header .h1,
.top-header .h2 {
    font-family: var(--font-family-base);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--text);
    margin: 0;
}

.content-wrapper {
    padding: 0 var(--spacing-8) var(--spacing-8);
}

/* Mobile: Reduced padding */
@media (max-width: 767px) {
    .content-wrapper {
        padding: 0 var(--spacing-4) var(--spacing-4);
    }
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    padding: var(--spacing-3) var(--spacing-5);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-normal);
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    min-height: var(--button-height);
}

/* Mobile: Larger touch targets */
@media (max-width: 767px) {
    .btn {
        min-height: var(--button-height-mobile);
        padding: var(--spacing-4) var(--spacing-6);
    }
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-contrast);
}

.btn-primary:hover:not(:disabled) {
    background: color-mix(in srgb, var(--accent) 90%, black);
}

.btn-secondary {
    background: var(--bg-surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: color-mix(in srgb, var(--bg-surface-2) 95%, black);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-surface-2);
}

.btn-danger {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
}

.btn-danger:hover:not(:disabled) {
    background: var(--bg-surface-2);
    border-color: var(--border-strong);
}

.btn-success {
    background: var(--accent);
    color: var(--accent-contrast);
}

.btn-success:hover:not(:disabled) {
    background: color-mix(in srgb, var(--accent) 90%, black);
}

.btn:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   ICON BUTTONS FOR ACTION COLUMNS
   ========================================================================== */

/* Icon Buttons for Action Column */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.btn-icon.btn-view {
    color: #3498db;
}

.btn-icon.btn-view:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
}

.btn-icon.btn-edit-icon {
    color: var(--accent);
}

.btn-icon.btn-edit-icon:hover {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: color-mix(in srgb, var(--accent) 90%, black);
}

.btn-icon.btn-delete-icon {
    color: #e74c3c;
}

.btn-icon.btn-delete-icon:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
}

.btn-icon.btn-toggle-icon {
    color: #f39c12;
}

.btn-icon.btn-toggle-icon:hover {
    background: rgba(243, 156, 18, 0.1);
    color: #e67e22;
}

.btn-icon.btn-toggle-icon.active {
    color: #6b9bd2;
}

.btn-icon.btn-toggle-icon.active:hover {
    background: rgba(39, 174, 96, 0.1);
    color: #229954;
}

/* Start / play action - monochromatic accent icon, blank background */
.btn-icon.btn-start-icon {
    color: var(--accent, #6b9bd2);
}

.btn-icon.btn-start-icon:hover {
    background: color-mix(in srgb, var(--accent, #6b9bd2) 10%, transparent);
    color: color-mix(in srgb, var(--accent, #6b9bd2) 90%, black);
}

/* Ready / check action - info-style icon, blank background */
.btn-icon.btn-ready-icon {
    color: var(--accent, #6b9bd2);
}

.btn-icon.btn-ready-icon:hover {
    background: color-mix(in srgb, var(--accent, #6b9bd2) 10%, transparent);
    color: color-mix(in srgb, var(--accent, #6b9bd2) 90%, black);
}

/* Cancel / close action - monochromatic danger icon, blank background */
.btn-icon.btn-cancel-icon {
    color: #e74c3c;
}

.btn-icon.btn-cancel-icon:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
}

/* Action Column - Fixed width, always at the end */
table th:last-child,
table td:last-child {
    width: 1%;
    white-space: nowrap;
    min-width: 120px;
    max-width: 140px;
}

table th:last-child {
    text-align: center;
}

/* ==========================================================================
   FORMS
   ========================================================================== */

.form-control {
    width: 100%;
    padding: var(--spacing-3) var(--spacing-4);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: var(--input-height);
}

/* Mobile: Larger for touch, prevent iOS zoom */
@media (max-width: 767px) {
    .form-control {
        min-height: var(--input-height-mobile);
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

.form-control:hover:not(:disabled) {
    border-color: var(--border-strong);
}

.form-control:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 20%, transparent);
}

.form-control:invalid {
    border-color: var(--danger);
}

.form-control:invalid:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent);
}

.form-control:disabled {
    background: var(--bg-surface-2);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-2);
    font-family: var(--font-family-base);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text);
}

.form-help {
    margin-top: var(--spacing-1);
    font-family: var(--font-family-base);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1rem;
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--spacing-6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Mobile: Reduced padding */
@media (max-width: 767px) {
    .card {
        padding: var(--spacing-4);
    }
}

.card-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-family: var(--font-family-base);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--text);
    margin: 0;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.table-wrapper {
    background: var(--bg-surface);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--table-header-bg);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--table-text);
    border-bottom: 2px solid var(--table-border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--table-border);
    color: var(--table-text);
}

tbody tr {
    background: var(--table-row-bg);
}

tbody tr:nth-child(even) {
    background: var(--table-row-alt-bg);
}

tbody tr:hover {
    background: var(--table-row-hover-bg);
}

/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */

.breadcrumb-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--spacing-4) var(--spacing-6);
    margin-bottom: var(--spacing-6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-4);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-family: var(--font-family-base);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    flex: 1;
}

.breadcrumb-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    flex-shrink: 0;
}

.breadcrumb-item {
    color: var(--breadcrumb-text);
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: '>';
    margin-left: var(--spacing-2);
    margin-right: var(--spacing-2);
    color: var(--breadcrumb-separator);
    font-weight: var(--font-weight-normal);
}

.breadcrumb-item a {
    color: var(--breadcrumb-text);
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: var(--spacing-1);
}

.breadcrumb-item a:hover {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb-item a:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 2px;
}

.breadcrumb-item.active {
    color: var(--breadcrumb-active);
    font-weight: var(--font-weight-semibold);
}

.breadcrumb-item.active a {
    color: var(--breadcrumb-active);
    cursor: default;
    pointer-events: none;
}

.breadcrumb-home-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    fill: currentColor;
    flex-shrink: 0;
}

.breadcrumb-item a:hover .breadcrumb-home-icon {
    fill: var(--accent);
}

/* ==========================================================================
   TAGS / BADGES
   ========================================================================== */

.tag,
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--tag-bg);
    color: var(--tag-text);
    border: 1px solid var(--tag-border);
}

.tag-success,
.tag-warning,
.tag-danger,
.tag-info {
    background: var(--tag-bg);
    color: var(--tag-text);
    border-color: var(--tag-border);
}

.tag-active {
    background: var(--tag-active-bg);
    color: var(--tag-active-text);
    border-color: var(--border-strong);
}

/* ==========================================================================
   ALERTS / MESSAGES
   ========================================================================== */

.messages {
    margin-bottom: 1.5rem;
}

.message,
.alert {
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    border: 1px solid;
}

.alert-success,
.message.success,
.alert-warning,
.message.warning,
.alert-danger,
.message.error,
.message.danger,
.alert-info,
.message.info {
    background: var(--accent);
    color: var(--accent-contrast);
    border-color: color-mix(in srgb, var(--accent) 85%, black);
    border-left: 3px solid color-mix(in srgb, var(--accent) 85%, black);
}

/* ==========================================================================
   MODALS
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Note: In templates, .modal is the overlay (dark background), not the modal box itself */
/* The actual modal box uses .modal-content class */
.modal {
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
    filter: none !important;
    -webkit-filter: none !important;
}

.modal-content,
.modal .modal-content,
div.modal,
div.modal-content,
[id*="Modal"] .modal-content,
[id*="modal"] .modal-content,
#staffModal .modal-content,
#toggleModal .modal-content,
#deleteModal .modal-content,
#customerModal .modal-content {
    box-shadow: none !important;
}

.modal-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-close:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ==========================================================================
   FILTERS / SEARCH
   ========================================================================== */

.filters {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.filter-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
}

/* ==========================================================================
   BACKEND CONTEXT OPTIMIZATIONS
   ========================================================================== */

.context-backend {
    /* Desktop-optimized typography */
    --font-size-base: var(--font-size-sm); /* 14px for dense information */
    --spacing-section: var(--spacing-section-desktop);
    --touch-target-min: 32px; /* Smaller for mouse precision */
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 767px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 1000;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .content-wrapper {
        padding: 0 var(--spacing-4) var(--spacing-4);
    }

    .top-header {
        padding: var(--spacing-4) var(--spacing-6);
        margin-bottom: var(--spacing-4);
    }
    
    .top-header h2,
    .top-header .h1,
    .top-header .h2 {
        font-size: var(--font-size-xl);
    }

    /* Mobile viewport: force bottom toolbar visible (fixes device emulation / small viewports) */
    body.context-mobile-staff #mobileBottomNav,
    body.context-mobile-staff nav.mobile-nav {
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 99999 !important;
        min-height: 64px !important;
        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;
        pointer-events: auto !important;
    }
}

/* ==========================================================================
   MOBILE BOTTOM TOOLBAR - Ensure always visible on /m/ (context-mobile-staff)
   ========================================================================== */

body.context-mobile-staff #mobileBottomNav,
body.context-mobile-staff nav.mobile-nav,
body.context-mobile-staff .mobile-nav {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 99999 !important;
    pointer-events: auto !important;
}

/* ==========================================================================
   MODAL SHADOW OVERRIDE - Ensure no shadows on any modal forms
   ========================================================================== */

.modal,
.modal-content,
.modal .modal-content,
div.modal,
div.modal-content,
[id*="Modal"],
[id*="Modal"] .modal-content,
[id*="modal"],
[id*="modal"] .modal-content,
#staffModal,
#staffModal .modal-content,
#toggleModal,
#toggleModal .modal-content,
#deleteModal,
#deleteModal .modal-content,
#customerModal,
#customerModal .modal-content {
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
    filter: none !important;
    -webkit-filter: none !important;
}


