/* ==========================================================================
   CHAI ROSE GRILL HOUSE - STANDARDIZED UI DESIGN SYSTEM
   Theme: Admin Master Control / Smart Sales Dashboard Reference
   WCAG 2.2 AAA Compliant | High-Visibility Dark Theme Palette
   Hybrid Off-Canvas Drawer & Sticky Mobile-Fitted Viewport Architecture
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Oswald:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

/* --- 1. DESIGN TOKENS & COLOR PALETTE (:root) --- */
:root {
    /* Background Surfaces */
    --bg-main: #0d0f12;                /* Page Canvas Base */
    --bg-sidebar: #12151c;             /* Sidebar Navigation Base */
    --bg-surface: #141720;             /* Elevated Surface */
    --bg-surface-elevated: #1a1f2c;    /* Modal / Popover Base */
    --bg-card: #1c2027;                /* Matte Elevated Dark Card Surface */
    --bg-inset: #161920;               /* Secondary Inset Background */
    --bg-glass: rgba(28, 32, 39, 0.94);/* Glass Card Container */
    
    /* High-Contrast Borders & Outlines */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-card: rgba(255, 255, 255, 0.12);
    --border-focus: #ff7300;
    --border-orange: 2px solid #ff7300;
    --border-thick: 2px solid rgba(255, 255, 255, 0.18);
    
    /* Primary Brand Accents */
    --primary-flame: #ff6b00;          /* Electric Flame Orange */
    --primary-orange: #ff7300;         /* Brand Orange Accent */
    --primary-flame-light: #ff851a;    /* Subheading Flame */
    --primary-flame-gradient: linear-gradient(135deg, #ff6b00 0%, #ff8800 100%);
    --primary-glow: rgba(255, 107, 0, 0.45);
    --shadow-active-tab: 0 4px 18px rgba(255, 107, 0, 0.45);
    
    /* Semantic & Metric Accents */
    --accent-green: #00e676;           /* Mint Green Currency & Numeric Highlights */
    --accent-green-alt: #10b981;       /* Completed Status & Profit Indicator */
    --accent-blue: #007DFa;            /* Direct Payment / Informative */
    --accent-blue-bright: #00b4d8;
    --accent-purple: #a855f7;          /* User Avatar Accent */
    --warning-gold: #f39c12;
    --warning-gold-bright: #f1c40f;
    --danger-red: #d63031;
    --danger-red-bright: #ff7675;
    
    /* Typography Colors */
    --text-primary: #ffffff;           /* Pure Bold White */
    --text-secondary: #a0aec0;         /* Secondary Text */
    --text-muted: #8f9cae;             /* Subtitles & Metric Labels */
    --text-orange: #ff7300;            /* Brand Titles & Table Headers */
    --text-green: #00e676;             /* Currency & Profit Values */
    
    /* Font Families */
    --font-heading: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    --font-display: 'Oswald', 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

    /* Responsive Typography Scale (Desktop >= 1025px default) */
    --font-size-base: 16px;
    --fs-page-title: 1.5rem;
    --fs-section-title: 1.125rem;
    --fs-kpi-number: 1.75rem;
    --fs-body: 0.9375rem;
    --fs-small: 0.8125rem;

    /* Standardized Line-Heights & Letter-Spacing */
    --lh-body: 1.5;
    --lh-heading: 1.25;
    --line-height-base: 1.5;
    --ls-body: 0;
    --ls-heading: 0;
    --ls-label: 0.03em;

    /* Uniform Spacing Scale */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --card-padding: 1.25rem;
    --grid-gap: 1rem;

    /* Radii & Elevations */
    --radius-control: 8px;
    --radius-card: 12px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.75);
    --shadow-flame: 0 4px 18px rgba(255, 107, 0, 0.45);

    /* Interactive Sizing */
    --nav-height: 84px;
    --control-height: 42px;
    --touch-target-min: 44px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tablet Breakpoint Tokens (768px - 1024px) */
@media (max-width: 1024px) {
    :root {
        --fs-page-title: 1.35rem;
        --fs-section-title: 1.05rem;
        --fs-kpi-number: 1.5rem;
        --fs-body: 0.9rem;
        --fs-small: 0.8125rem;
        --card-padding: 1rem;
        --grid-gap: 1rem;
        --control-height: 44px;
    }
}

/* Mobile Breakpoint Tokens (< 768px) */
@media (max-width: 767px) {
    :root {
        --fs-page-title: 1.2rem;
        --fs-section-title: 1rem;
        --fs-kpi-number: 1.35rem;
        --fs-body: 0.875rem;
        --fs-small: 0.78rem;
        --card-padding: 0.875rem;
        --grid-gap: 0.875rem;
        --control-height: 44px;
    }
}

/* --- 2. BASE RESETS & TYPOGRAPHY --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: var(--lh-body);
    letter-spacing: var(--ls-body);
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    line-height: var(--lh-heading);
    letter-spacing: var(--ls-heading);
}

/* Accessible Focus Indicators */
:focus-visible {
    outline: 2px solid #ff7300 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(255, 115, 0, 0.35) !important;
}

/* Modern Inline Vector Icon System (Lucide / Feather Geometry) */
svg.cr-icon {
    display: inline-block;
    width: 1.12em;
    height: 1.12em;
    vertical-align: -0.18em;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

/* Standardized Dark Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #252b36;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-flame);
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    color: #ffffff;
    font-weight: 800;
    line-height: 1.25;
}

.page-title {
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.section-subtitle {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: var(--ls-label, 0.03em);
    text-transform: uppercase;
    color: var(--text-muted);
}

.card-category-label {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: var(--ls-label, 0.03em);
    text-transform: uppercase;
    color: var(--text-muted);
}

.metric-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: #ffffff;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.currency-highlight {
    color: var(--text-green) !important;
    font-weight: 800;
}

.text-orange {
    color: var(--text-orange) !important;
}
.text-green {
    color: var(--accent-green) !important;
}
.text-muted {
    color: var(--text-muted) !important;
}
.text-secondary {
    color: var(--text-secondary) !important;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container Utility */
.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
}
@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }
}

/* --- 3. REUSABLE CARDS & CONTAINERS --- */
.card, .container-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-md);
    padding: 24px 28px;
}
@media (max-width: 640px) {
    .card, .container-card {
        padding: 20px 16px;
        border-radius: var(--radius-md);
    }
}

/* KPI Summary Cards */
.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.kpi-card-orange {
    border-left: 4px solid var(--primary-flame) !important;
}
.kpi-card-green {
    border-left: 4px solid var(--accent-green-alt) !important;
}

/* --- 4. BUTTONS & INTERACTIVE CONTROLS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 12px 24px;
    min-height: var(--touch-target-min, 48px);
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    user-select: none;
    box-sizing: border-box;
}

.btn-primary, .btn-flame {
    background: var(--primary-flame);
    color: #ffffff;
    border: 1px solid #ff8800;
    box-shadow: var(--shadow-flame);
}
.btn-primary:hover, .btn-flame:hover {
    background: #ff7a00;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.55);
}

.btn-outline, .btn-outline-orange {
    background: transparent;
    border: 2px solid var(--primary-orange);
    color: var(--primary-orange);
    font-weight: 700;
    border-radius: var(--radius-sm);
}
.btn-outline:hover, .btn-outline-orange:hover {
    background: var(--primary-orange);
    color: #ffffff;
    box-shadow: var(--shadow-flame);
}

.btn-sm {
    padding: 8px 16px;
    min-height: 40px;
    font-size: 0.85rem;
}

/* Auth Navigation Buttons */
.btn-nav-login {
    background: var(--primary-flame) !important;
    color: #ffffff !important;
    border: 2px solid #ff9d3b !important;
    padding: 10px 22px !important;
    border-radius: var(--radius-full) !important;
    font-weight: 800 !important;
    font-size: 1rem !important;
    box-shadow: 0 4px 14px rgba(255, 107, 0, 0.45) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}
.btn-nav-login:hover {
    background: #ff7a00 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.65) !important;
}

.btn-nav-logout {
    background: #161920 !important;
    color: #ff7675 !important;
    border: 2px solid #d63031 !important;
    padding: 9px 18px !important;
    border-radius: var(--radius-full) !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: var(--transition-fast) !important;
}
.btn-nav-logout:hover {
    background: rgba(214, 48, 49, 0.2) !important;
    color: #ffffff !important;
    border-color: #ff7675 !important;
}

/* Filter Pills / Segmented Controls */
.filter-pills-group {
    display: inline-flex;
    background: var(--bg-inset);
    padding: 4px;
    border-radius: var(--radius-full);
    gap: 6px;
    border: 1px solid var(--border-subtle);
}

.filter-pill, .btn-filter {
    background: #252b36;
    color: var(--text-muted);
    padding: 8px 18px;
    min-height: 40px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1.5px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
}
.filter-pill:hover, .btn-filter:hover {
    color: #ffffff;
    background: #2e3644;
}
.filter-pill.active, .btn-filter.active {
    background: #252b36;
    border-color: var(--primary-orange);
    color: var(--primary-orange);
    box-shadow: 0 2px 8px rgba(255, 115, 0, 0.2);
}

/* --- 5. STANDARDIZED DATA TABLES --- */
.table-card-container, .table-scroll-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-md);
    padding: 20px 24px;
    overflow-x: auto;
    margin-bottom: 24px;
    -webkit-overflow-scrolling: touch;
}

table.standard-table, table.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

table.standard-table th, table.styled-table th {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 2px solid rgba(255, 115, 0, 0.4);
    color: var(--text-orange);
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.75px;
    background: var(--bg-card);
    white-space: nowrap;
}

table.standard-table td, table.styled-table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 0.92rem;
    vertical-align: middle;
}

table.standard-table tr.clickable-row {
    cursor: pointer;
    transition: background-color var(--transition-fast);
}
table.standard-table tr.clickable-row:hover {
    background-color: #242a34;
}

/* --- 6. HIGH-VISIBILITY FORM CONTROLS --- */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    background: var(--bg-inset);
    border: 1.5px solid #3a4454;
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition-fast);
    outline: none;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--primary-orange);
    background: #11141c;
    box-shadow: 0 0 0 3px rgba(255, 115, 0, 0.3);
}

.form-control::placeholder {
    color: var(--text-muted);
    font-weight: 500;
}

select.form-control option {
    background: var(--bg-surface);
    color: #ffffff;
    padding: 10px;
}

/* --- 7. HYBRID OFF-CANVAS & BOTTOM SHEET MODAL UTILITIES --- */
.modal-overlay, .checkout-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 3500;
    justify-content: center;
    align-items: flex-start;
    padding: 24px 16px;
    overflow-y: auto;
    box-sizing: border-box;
}

.modal-sheet, .checkout-modal-sheet {
    background: #141822;
    border: 2px solid var(--border-card);
    width: 100%;
    max-width: 600px;
    border-radius: 16px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.95);
    position: relative;
    margin: auto;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.modal-header-sticky {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.12);
    background: #141822;
    position: sticky;
    top: 0;
    z-index: 20;
    flex-shrink: 0;
}

.modal-body-scrollable {
    padding: 20px 24px 24px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.modal-close-btn {
    background: #1a1f2c;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 10px;
    font-size: 1.35rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.modal-close-btn:hover {
    background: #ff4757;
    border-color: #ff4757;
    color: #ffffff;
    transform: scale(1.05);
}

@media (max-width: 640px) {
    .modal-overlay, .checkout-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .modal-sheet, .checkout-modal-sheet {
        max-width: 100vw;
        max-height: 92vh;
        border-radius: 20px 20px 0 0 !important;
        margin: 0;
    }
    .modal-header-sticky {
        padding: 16px 18px 12px;
    }
    .modal-body-scrollable {
        padding: 16px 18px 24px;
    }
}

/* --- 8. MOBILE DRAWER NAVIGATION STYLES (≤ 1024px) --- */
@media (max-width: 1024px) {
    .mobile-hamburger {
        display: flex !important;
    }
    .nav-menu {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        width: 320px !important;
        max-width: 88vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: #141720 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 20px 16px 40px !important;
        gap: 10px !important;
        z-index: 100001 !important;
        transform: translate3d(105%, 0, 0) !important;
        visibility: hidden !important;
        opacity: 0.96 !important;
        pointer-events: none !important;
        will-change: transform !important;
        transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.26s ease, visibility 0.34s ease !important;
        overflow-y: auto !important;
        list-style: none !important;
        border-left: 2px solid #ff6b00 !important;
        box-shadow: -15px 0 40px rgba(0, 0, 0, 0.95) !important;
    }
    .nav-menu.open,
    .nav-menu.active {
        transform: translate3d(0, 0, 0) !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    .nav-menu li {
        width: 100% !important;
        display: block !important;
        list-style: none !important;
        margin: 0 0 6px 0 !important;
        padding: 0 !important;
    }
    .nav-menu .nav-link,
    .nav-menu .user-nav-pill,
    .nav-menu .admin-nav-pill,
    .nav-menu .btn-nav-login,
    .nav-menu .btn-nav-logout {
        display: flex !important;
        width: 100% !important;
        padding: 14px 18px !important;
        color: #ffffff !important;
        font-size: 1.05rem !important;
        font-weight: 700 !important;
        border-radius: 10px !important;
        background: #1c2027 !important;
        border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
        text-align: left !important;
        align-items: center !important;
        justify-content: flex-start !important;
        text-decoration: none !important;
        box-sizing: border-box !important;
        min-height: 52px !important;
        gap: 12px !important;
    }
    .nav-menu .nav-link:hover,
    .nav-menu .user-nav-pill:hover,
    .nav-menu .admin-nav-pill:hover,
    .nav-menu .btn-nav-login:hover {
        background: #252b36 !important;
        border-color: #ff7300 !important;
        color: #ff851a !important;
    }
    .nav-menu .btn-nav-logout {
        background: rgba(214, 48, 49, 0.15) !important;
        border-color: #d63031 !important;
        color: #ff7675 !important;
    }
    .nav-menu .btn-nav-logout:hover {
        background: rgba(214, 48, 49, 0.35) !important;
        border-color: #ff7675 !important;
        color: #ffffff !important;
    }
    .nav-menu .nav-link.active {
        background: var(--primary-flame) !important;
        border-color: #ff9d3b !important;
        color: #ffffff !important;
        box-shadow: 0 4px 14px rgba(255, 107, 0, 0.45) !important;
    }
    .nav-menu .btn-nav-login {
        background: var(--primary-flame) !important;
        border-color: #ff8800 !important;
        color: #ffffff !important;
        justify-content: center !important;
        font-weight: 800 !important;
    }
}

/* ==========================================================================
   9. RESPONSIVE UI & ANTI-VERTICAL-TEXT GUARD (MOBILE, TABLET & DESKTOP)
   ========================================================================== */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4, h5, h6, p, span, a, label, li, td, th, div {
    writing-mode: horizontal-tb !important;
    word-break: normal !important;
    overflow-wrap: break-word;
}

.flex-child, .grid-child, main, section, aside, .food-body, .teaser-content, .notif-desc, .user-menu-item-content {
    min-width: 0;
}

/* Prevent prices, badges, status pills, category pills, quick-slots, order IDs, dates/times, nav links, and cart totals from wrapping */
th,
.food-price,
.teaser-price,
.cart-row-subtotal,
.sidebar-total-amount,
.res-food-item-price,
.res-food-subtotal-value,
.res-required-pay-amount,
.receipt-total-amount,
.food-category-pill,
.receipt-status-pill,
.receipt-brand-badge,
.receipt-ref-pill,
.receipt-proof-tag,
.notif-type-tag,
.user-menu-badge,
.mobile-cart-badge,
.quick-slot-btn,
.status-badge,
.status-pill,
.type-badge,
.res-id-badge,
.role-badge,
.prep-badge,
.trans-pill,
.channel-chip,
.ref-pill,
.cat-pill,
.tab-badge-pill,
.activity-pill,
.profile-tab-btn,
.receipt-btn,
.nav-link,
.admin-nav-pill {
    white-space: nowrap !important;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .activity-header-bar,
    .filter-form,
    .filter-bar,
    .receipt-modal-header,
    .receipt-modal-footer,
    .receipt-payment-row,
    .receipt-total-row,
    .receipt-proof-header,
    .notif-card {
        flex-wrap: wrap !important;
    }
    .table-container,
    .table-scroll-box,
    .table-responsive,
    .table-box,
    .history-box,
    .receipt-items-table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

.btn, .btn-primary, .btn-outline, .btn-checkout-action, #resSubmitBtn, #menuSubmitOrderBtn {
    font-size: clamp(0.88rem, 2.5vw, 1.1rem);
    line-height: 1.3;
    text-align: center;
    white-space: normal;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 2-Line Clamping for Dish Titles */
.food-name,
.res-food-item-name,
.teaser-content h4 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    min-height: 2.6em;
    font-size: clamp(0.86rem, 2.2vw, 1.15rem);
}

td.food-name {
    display: table-cell !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: initial !important;
    overflow: visible !important;
    text-overflow: initial !important;
    min-height: 0 !important;
    vertical-align: middle !important;
}

/* Header Brand Logo & User Nav Pill Truncation */
.brand-logo {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Mobile Reservation Layout Guards (<= 768px) */
@media (max-width: 768px) {
    .res-type-selector {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .res-time-meta-card, .gcash-rule-points, .form-grid-duo {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile Food Cards, Steppers, Time Meta & Table Scroll Guards (<= 640px) */
@media (max-width: 640px) {
    .res-time-meta-card {
        grid-template-columns: 1fr !important;
    }
    .food-cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }
    .res-food-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
    .food-card-stepper button,
    .food-card-stepper .food-stepper-btn {
        flex-shrink: 0 !important;
        width: 24px !important;
        height: 24px !important;
    }
    .res-food-stepper button,
    .res-food-stepper .res-stepper-btn {
        flex-shrink: 0 !important;
        width: 30px !important;
        height: 30px !important;
    }
    .food-card-stepper input,
    .food-card-stepper .food-qty-input,
    .res-food-stepper input,
    .res-food-stepper .res-qty-input {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: 100% !important;
        text-align: center !important;
    }
    .table-container,
    .table-scroll-box,
    .table-responsive,
    .receipt-items-table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
    }
    .table-container th,
    .table-scroll-box th,
    .table-responsive th,
    .receipt-items-table th {
        white-space: nowrap !important;
    }
}

@media (max-width: 360px) {
    .food-cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }
    .res-food-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   10. CUSTOMER PROFILE DASHBOARD — MINIMALIST E-COMMERCE DARK LAYOUT
   ========================================================================== */
.profile-dashboard,
.profile-layout {
    display: flex;
    max-width: 1280px;
    margin: calc(var(--nav-height, 84px) + 28px) auto 64px;
    gap: 32px;
    padding: 0 24px;
    min-height: 70vh;
    align-items: flex-start;
    box-sizing: border-box;
    width: 100%;
}

/* --- Left Minimalist Sidebar --- */
.profile-sidebar {
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: calc(var(--nav-height, 84px) + 28px);
    z-index: 100;
    box-sizing: border-box;
}

.sidebar-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0 18px;
    margin-bottom: 14px;
    border-bottom: 1px solid #2a2f3a;
}

.sidebar-profile-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.sidebar-avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background: #1a1d24;
    border: 1px solid #2a2f3a;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.sidebar-user-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.sidebar-username {
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-edit-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    padding: 0;
    color: #9ca3af;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.18s ease;
    width: fit-content;
}

.sidebar-edit-link svg.cr-icon {
    width: 0.95em;
    height: 0.95em;
}

.sidebar-edit-link:hover {
    color: #ff6b00;
}

.sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-btn {
    background: transparent;
    color: #9ca3af;
    border: none;
    border-left: 3px solid transparent;
    border-radius: var(--radius-control);
    padding: 10px 14px;
    min-height: var(--control-height);
    text-align: left;
    font-size: var(--fs-body);
    font-weight: 600;
    letter-spacing: var(--ls-body);
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-family: inherit;
}

.sidebar-btn .sidebar-btn-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sidebar-btn svg.cr-icon {
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
}

.sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
}

.sidebar-btn.active {
    background: rgba(255, 107, 0, 0.08);
    color: #ff6b00;
    border-left-color: #ff6b00;
    font-weight: 700;
}

.sidebar-notif-badge {
    background: #e74c3c;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: var(--fs-small);
    font-weight: 700;
    line-height: 1.2;
}

/* --- Right Main Content Area --- */
.profile-content,
.profile-main-content {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    background: #181b21;
    border: 1px solid #2a2f3a;
    border-radius: var(--radius-card);
    padding: 0;
    overflow: hidden;
    box-shadow: none;
    box-sizing: border-box;
}

/* Flat Full-Width E-Commerce Horizontal Tab Navigation Bar */
.profile-main-tabs {
    display: flex;
    width: 100%;
    background: #1a1d24;
    border-bottom: 1px solid #2a2f3a;
    margin: 0;
    padding: 0;
    gap: 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.profile-main-tabs::-webkit-scrollbar {
    display: none;
}

.profile-tab-btn {
    flex: 1 0 auto;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    color: #9ca3af;
    padding: 12px 18px;
    min-height: var(--control-height);
    font-size: var(--fs-body);
    font-weight: 600;
    letter-spacing: var(--ls-body);
    font-family: inherit;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    outline: none;
    user-select: none;
    box-shadow: none;
    margin-bottom: -1px;
}

.profile-tab-btn:hover {
    background: rgba(255, 255, 255, 0.025);
    color: #ff6b00;
    border-color: transparent;
}

.profile-tab-btn.active {
    background: transparent;
    color: #ff6b00;
    border-bottom: 3px solid #ff6b00;
    font-weight: 700;
    box-shadow: none;
}

/* Section Container Padding */
.profile-section {
    display: none;
    padding: var(--card-padding);
    animation: fadeIn 0.25s ease-in-out;
}

.profile-section.active {
    display: block;
}

.profile-section.profile-section--tabbed {
    padding: 0;
}

.profile-section-body {
    padding: var(--card-padding);
}

.status-panel-block + .status-panel-block {
    margin-top: var(--space-lg);
}

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

/* Mobile & Tablet Responsive Profile Layout (<= 1024px) */
@media (max-width: 1024px) {
    .profile-dashboard,
    .profile-layout {
        flex-direction: column;
        margin-top: calc(var(--nav-height, 84px) + 16px);
        padding: 0 var(--space-md);
        gap: var(--grid-gap);
        max-width: 100%;
    }

    .profile-sidebar {
        position: fixed;
        top: 0;
        left: -340px;
        width: 290px;
        min-width: 260px;
        max-width: 86vw;
        height: 100vh;
        z-index: 3000;
        transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        background: #121418;
        border-right: 1px solid #2a2f3a;
        padding: 20px 16px;
        overflow-y: auto;
        box-shadow: 12px 0 36px rgba(0, 0, 0, 0.75);
    }

    .profile-sidebar.active {
        left: 0;
    }

    .profile-section {
        padding: var(--card-padding);
    }

    .profile-section.profile-section--tabbed {
        padding: 0;
    }

    .profile-section-body {
        padding: var(--card-padding);
    }

    .profile-tab-btn {
        padding: 12px 14px;
        font-size: var(--fs-body);
        min-height: var(--control-height);
    }
}

@media (max-width: 575px) {
    .profile-dashboard,
    .profile-layout {
        padding: 0 var(--space-sm);
    }
}

/* ==========================================================================
   11. FULL-MONTH RESERVATION AVAILABILITY CALENDAR (DARK THEME)
   ========================================================================== */
.res-calendar-card {
    background: #121418;
    border: 1px solid #2a2f3a;
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 22px;
    box-sizing: border-box;
}

.res-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #2a2f3a;
}

.res-cal-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.res-cal-month-title {
    margin: 0;
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.res-cal-cap-note {
    font-size: 0.8rem;
    color: #9ca3af;
    font-weight: 500;
}

.res-cal-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.res-cal-nav-btn,
.res-cal-today-btn {
    background: #181b21;
    border: 1px solid #2a2f3a;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.res-cal-nav-btn {
    width: 36px;
    height: 36px;
    font-size: 1.35rem;
    line-height: 1;
}

.res-cal-today-btn {
    height: 36px;
    padding: 0 12px;
    font-size: 0.82rem;
    color: #9ca3af;
}

.res-cal-nav-btn:hover,
.res-cal-today-btn:hover {
    background: #222630;
    border-color: #ff6b00;
    color: #ff6b00;
}

.res-cal-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 14px;
    font-size: 0.78rem;
    color: #9ca3af;
    font-weight: 600;
}

.res-cal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.res-cal-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.res-cal-dot.dot-open { background: #10b981; }
.res-cal-dot.dot-low { background: #f59e0b; }
.res-cal-dot.dot-full { background: #ef4444; }
.res-cal-dot.dot-selected { background: #ff6b00; }

.res-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
    text-align: center;
}

.res-cal-weekdays span {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #9ca3af;
    padding: 4px 0;
}

.res-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    transition: opacity 0.18s ease;
}

.res-cal-grid.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

.res-cal-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: #9ca3af;
    padding: 28px 12px;
    font-size: 0.9rem;
}

.res-cal-cell {
    background: #181b21;
    border: 1px solid #2a2f3a;
    border-radius: 8px;
    padding: 8px 4px;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    font-family: inherit;
    color: #ffffff;
    transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.12s ease;
    box-sizing: border-box;
    min-width: 0;
}

.res-cal-cell.is-empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
    pointer-events: none;
}

.res-cal-cell:not(:disabled):hover {
    border-color: #ff6b00;
    background: #1f242e;
    transform: translateY(-1px);
}

.res-cal-cell.is-today:not(.is-selected) {
    border-color: rgba(255, 107, 0, 0.55);
}

.res-cal-cell.is-selected {
    background: rgba(255, 107, 0, 0.16);
    border: 1.5px solid #ff6b00;
    box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.25);
}

.res-cal-cell.is-selected .res-cal-day-num {
    color: #ff6b00;
}

.res-cal-cell.is-past {
    background: #101217;
    border-color: rgba(42, 47, 58, 0.55);
    opacity: 0.45;
    cursor: not-allowed;
}

.res-cal-cell.is-full {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.35);
    cursor: not-allowed;
    opacity: 0.85;
}

.res-cal-day-num {
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
}

.res-cal-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    line-height: 1.2;
    white-space: nowrap;
}

.res-cal-badge.badge-open {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.res-cal-badge.badge-low {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.38);
}

.res-cal-badge.badge-full {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.res-cal-badge.badge-past {
    background: transparent;
    color: #6b7280;
    border: none;
    font-weight: 600;
}

@media (max-width: 640px) {
    .res-calendar-card {
        padding: 14px 12px;
    }
    .res-cal-weekdays,
    .res-cal-grid {
        gap: 4px;
    }
    .res-cal-cell {
        min-height: 54px;
        padding: 6px 2px;
        gap: 3px;
        border-radius: 6px;
    }
    .res-cal-day-num {
        font-size: 0.84rem;
    }
    .res-cal-badge {
        font-size: 0.6rem;
        padding: 1px 4px;
    }
}

@media (max-width: 400px) {
    .res-cal-weekdays span {
        font-size: 0.66rem;
    }
    .res-cal-badge {
        font-size: 0.56rem;
        padding: 1px 3px;
    }
}

/* Admin Dashboard 1-Month Calendar Extensions */
.admin-res-calendar-card {
    background: #181b21;
    border: 1px solid #2a2f3a;
    border-radius: 14px;
    margin-bottom: 28px;
}

.res-cal-dot.dot-past {
    background: #6b7280;
}

.res-cal-cell.is-admin-clickable {
    text-decoration: none;
    cursor: pointer;
    min-height: 70px;
    padding: 8px 6px;
}

.res-cal-cell.is-admin-clickable.is-past {
    cursor: pointer;
    opacity: 0.62;
}

.res-cal-cell.is-admin-clickable.is-full {
    cursor: pointer;
    opacity: 1;
}

.res-cal-cell.is-admin-clickable:hover {
    border-color: #ff6b00;
    background: #1f242e;
    opacity: 1;
    transform: translateY(-1px);
}

.res-cal-cell.is-admin-clickable.is-today {
    border: 1.5px solid #ff6b00;
    box-shadow: 0 0 0 1px rgba(255, 107, 0, 0.28);
}

.res-cal-cell.is-admin-clickable.is-today .res-cal-day-num {
    color: #ff6b00;
}

.admin-cal-cell-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 4px;
    padding: 0 2px;
}

.admin-cal-ratio {
    font-size: 0.7rem;
    font-weight: 700;
    color: #9ca3af;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
    .res-cal-cell.is-admin-clickable {
        min-height: 58px;
        padding: 6px 3px;
    }
    .admin-cal-cell-top {
        flex-direction: column;
        justify-content: center;
        gap: 2px;
        padding: 0;
    }
    .admin-cal-ratio {
        font-size: 0.62rem;
    }
}

/* ==========================================================================
   12. RESERVATION TYPE MEDIA SERVICE CARDS (DARK E-COMMERCE STYLE)
   ========================================================================== */
.res-type-selector {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 28px;
    width: 100%;
}

.res-type-card {
    background: #181b21;
    border: 1.5px solid #2a2f3a;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 0;
    box-sizing: border-box;
}

.res-type-card:hover {
    border-color: rgba(255, 107, 0, 0.55);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.res-type-card.selected {
    border-color: #ff6b00;
    box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.28), 0 12px 28px rgba(255, 107, 0, 0.18);
}

.res-card-media {
    position: relative;
    width: 100%;
    height: 175px;
    background: #0f1115;
    overflow: hidden;
}

.res-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.res-type-card:hover .res-card-media img {
    transform: scale(1.04);
}

.res-card-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.res-card-tag {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.res-card-tag.tag-deposit {
    background: #f59e0b;
    color: #121418;
}

.res-card-tag.tag-popular {
    background: #3b82f6;
    color: #ffffff;
}

.res-card-price {
    background: rgba(15, 17, 21, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.res-card-body {
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
}

.res-type-card .res-type-label {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
}

.res-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.84rem;
    color: #9ca3af;
}

.res-card-meta strong {
    color: #ffffff;
    font-weight: 700;
    margin-left: 3px;
}

.res-type-card .res-type-desc {
    margin: 0;
    font-size: 0.84rem;
    color: #9ca3af;
    line-height: 1.45;
    flex: 1;
}

.res-card-location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-top: 2px;
}

.res-card-location svg.cr-icon {
    color: #ff6b00;
}

.res-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 6px;
}

.res-card-btn-secondary,
.res-card-btn-primary {
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.16s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.res-card-btn-secondary {
    background: transparent;
    border: 1px solid #2a2f3a;
    color: #e5e7eb;
}

.res-card-btn-secondary:hover {
    background: #232834;
    border-color: #4b5563;
    color: #ffffff;
}

.res-card-btn-primary {
    background: #ff6b00;
    border: 1px solid #ff6b00;
    color: #ffffff;
}

.res-card-btn-primary:hover {
    background: #ff7f24;
    border-color: #ff7f24;
}

.res-type-card.selected .res-card-btn-primary {
    background: #e65c00;
    border-color: #ff851a;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.35);
}

@media (max-width: 960px) {
    .res-type-selector {
        grid-template-columns: 1fr;
    }
    .res-card-media {
        height: 190px;
    }
}

/* ==========================================================================
   13. RESERVATION BOOKING MODAL POPUP (DARK THEME)
   ========================================================================== */
.res-booking-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    box-sizing: border-box;
}

.res-booking-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.res-booking-modal-card {
    background: #181b21;
    border: 1px solid #2a2f3a;
    border-radius: 16px;
    width: 100%;
    max-width: 880px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.85);
    transform: translateY(14px) scale(0.97);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.res-booking-modal-overlay.is-open .res-booking-modal-card {
    transform: translateY(0) scale(1);
}

.res-booking-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px 16px;
    background: #121418;
    border-bottom: 1px solid #2a2f3a;
    flex-shrink: 0;
}

.res-modal-header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.res-modal-type-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    background: rgba(255, 107, 0, 0.16);
    border: 1px solid rgba(255, 107, 0, 0.45);
    color: #ff6b00;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    padding: 3px 10px;
    border-radius: 999px;
}

.res-modal-title {
    margin: 2px 0 0;
    font-size: 1.38rem;
    font-weight: 800;
    color: #ffffff;
    font-family: var(--font-heading);
    letter-spacing: 0.4px;
    line-height: 1.2;
}

.res-modal-subtitle {
    margin: 0;
    font-size: 0.84rem;
    color: #9ca3af;
    line-height: 1.4;
}

.res-modal-close-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 10px;
    background: #181b21;
    border: 1px solid #2a2f3a;
    color: #e5e7eb;
    font-size: 1.55rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
    flex-shrink: 0;
}

.res-modal-close-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

.res-booking-modal-body {
    padding: 24px 26px 28px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .res-booking-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .res-booking-modal-card {
        max-width: 100vw;
        max-height: 94vh;
        border-radius: 18px 18px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }
    .res-booking-modal-header {
        padding: 16px 16px 14px;
    }
    .res-modal-title {
        font-size: 1.18rem;
    }
    .res-booking-modal-body {
        padding: 16px 14px 24px;
    }
}

/* ==========================================================================
   14. RESERVATION FOOD CATEGORY FILTER BAR & BADGES
   ========================================================================== */
.res-food-cat-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 4px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.res-food-cat-bar::-webkit-scrollbar {
    display: none;
}

.res-food-cat-btn {
    background: #121418;
    border: 1px solid #2a2f3a;
    color: #9ca3af;
    padding: 8px 14px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    transition: all 0.16s ease;
}

.res-food-cat-btn:hover {
    background: #1f242e;
    border-color: rgba(255, 107, 0, 0.5);
    color: #ffffff;
}

.res-food-cat-btn.active {
    background: rgba(255, 107, 0, 0.16);
    border-color: #ff6b00;
    color: #ff6b00;
}

.res-cat-cnt {
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 999px;
}

.res-food-cat-btn.active .res-cat-cnt {
    background: rgba(255, 107, 0, 0.25);
    color: #ff851a;
}

.res-food-img-wrap {
    position: relative;
    width: 100%;
}

.res-food-cat-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(15, 17, 21, 0.85);
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(4px);
}

.res-food-cat-badge.cat-pork { color: #ff851a; border-color: rgba(255, 107, 0, 0.45); }
.res-food-cat-badge.cat-chicken { color: #fbbf24; border-color: rgba(245, 158, 11, 0.45); }
.res-food-cat-badge.cat-rice { color: #34d399; border-color: rgba(16, 185, 129, 0.45); }
.res-food-cat-badge.cat-drinks { color: #38bdf8; border-color: rgba(56, 189, 248, 0.45); }

.res-food-empty-cat {
    grid-column: 1 / -1;
    text-align: center;
    padding: 28px 16px;
    color: #9ca3af;
    font-size: 0.9rem;
    background: #121418;
    border: 1px dashed #2a2f3a;
    border-radius: 10px;
}

/* ==========================================================================
   15. CALENDAR DAILY AVAILABLE TIME SLOTS PANEL
   ========================================================================== */
.res-cal-slots-panel {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #2a2f3a;
}

.res-cal-slots-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.res-cal-slots-title {
    margin: 0;
    color: #ffffff;
    font-size: 0.96rem;
    font-weight: 800;
}

.res-cal-slots-sub {
    display: block;
    font-size: 0.78rem;
    color: #9ca3af;
    margin-top: 2px;
}

.res-cal-slots-cap {
    font-size: 0.76rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: #181b21;
    border: 1px solid #2a2f3a;
    color: #9ca3af;
}

.res-cal-slots-cap.cap-open {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.res-cal-slots-cap.cap-low {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.res-cal-slots-cap.cap-full {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.res-cal-slots-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.res-cal-slots-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: #9ca3af;
    font-size: 0.85rem;
    padding: 16px;
}

.res-cal-slot-chip {
    background: #181b21;
    border: 1px solid #2a2f3a;
    border-radius: 10px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.12s ease;
}

.res-cal-slot-chip.is-available:hover {
    border-color: #ff6b00;
    background: #1f242e;
    transform: translateY(-1px);
}

.res-cal-slot-chip.is-selected {
    background: rgba(255, 107, 0, 0.16);
    border: 1.5px solid #ff6b00;
    box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.25);
}

.res-cal-slot-chip.is-past,
.res-cal-slot-chip.is-full {
    background: #101217;
    border-color: rgba(42, 47, 58, 0.6);
    opacity: 0.48;
    cursor: not-allowed;
}

.slot-chip-time {
    font-size: 0.86rem;
    font-weight: 800;
    color: #ffffff;
}

.res-cal-slot-chip.is-selected .slot-chip-time {
    color: #ff6b00;
}

.slot-chip-status {
    font-size: 0.68rem;
    font-weight: 700;
    color: #34d399;
}

.res-cal-slot-chip.is-selected .slot-chip-status {
    color: #ff851a;
}

.res-cal-slot-chip.is-past .slot-chip-status {
    color: #6b7280;
}

.res-cal-slot-chip.is-full .slot-chip-status {
    color: #f87171;
}

@media (max-width: 640px) {
    .res-cal-slots-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }
    .res-cal-slot-chip {
        padding: 8px 4px;
    }
    .slot-chip-time {
        font-size: 0.8rem;
    }
}

/* Per-Type 5-Slot Summary Strip & Same-Time Booked Type Badges */
.res-cal-slots-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #181b21;
    border: 1px solid #2a2f3a;
    color: #9ca3af;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.res-cal-slots-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

.res-cal-type-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.res-type-slot-pill {
    background: #181b21;
    border: 1px solid #2a2f3a;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 0.8rem;
    font-family: inherit;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.12s ease;
}

.res-type-slot-pill:hover {
    border-color: rgba(255, 107, 0, 0.55);
    background: #1e232d;
}

.res-type-slot-pill.is-filter-active {
    border-color: #ff6b00;
    background: rgba(255, 107, 0, 0.12);
    box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.25);
}

.res-type-slot-top,
.res-type-slot-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.res-type-slot-booked {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 600;
    white-space: nowrap;
}

/* 5-Slot Visual Pips Bar */
.res-slot-pips {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.res-slot-pip {
    width: 12px;
    height: 6px;
    border-radius: 999px;
    display: inline-block;
    background: #2a2f3a;
    transition: background-color 0.15s ease;
}

.res-slot-pip.is-open.pip-table { background: #38bdf8; }
.res-slot-pip.is-open.pip-food  { background: #34d399; }
.res-slot-pip.is-open.pip-combo { background: #ff6b00; }
.res-slot-pip.is-taken {
    background: rgba(239, 68, 68, 0.35);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

/* Calendar Day Cell Per-Type Mini Indicators (T:5 F:5 TF:5) */
.res-cal-type-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    width: 100%;
    margin-top: 2px;
}

.cal-t-pill {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 4px;
    line-height: 1.25;
    white-space: nowrap;
}

.cal-t-pill.t-table { background: rgba(56, 189, 248, 0.16); color: #38bdf8; }
.cal-t-pill.t-food  { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.cal-t-pill.t-combo { background: rgba(255, 107, 0, 0.18);  color: #ff851a; }
.cal-t-pill.t-low   { background: rgba(245, 158, 11, 0.2);  color: #fbbf24; }
.cal-t-pill.t-full  { background: rgba(239, 68, 68, 0.18);  color: #f87171; text-decoration: line-through; }

/* Per-Slot Number Tag & T/F/TF Indicators inside Starting Time Cards */
.slot-num-tag {
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
}

.slot-type-indicators {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.slot-ind-pill {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 5px;
    line-height: 1.15;
    white-space: nowrap;
}

.slot-ind-pill.ind-table-open { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.35); }
.slot-ind-pill.ind-food-open  { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.slot-ind-pill.ind-combo-open { background: rgba(255, 107, 0, 0.16);  color: #ff851a; border: 1px solid rgba(255, 107, 0, 0.38); }
.slot-ind-pill.ind-taken      { background: rgba(239, 68, 68, 0.14);  color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }

/* Live 5-Slot Status Strip on the 3 Reservation Service Cards */
.res-card-slot-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    margin: 6px 0 8px;
    border-radius: 8px;
    background: #121418;
    border: 1px solid #2a2f3a;
    font-size: 0.74rem;
    font-weight: 700;
    color: #34d399;
}

.res-card-slot-status.status-low {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.08);
}

.res-card-slot-status.status-full {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.1);
}

.res-type-card.is-type-full {
    border-color: rgba(239, 68, 68, 0.45);
}

/* Modal Per-Type Remaining Slots Banner & 5 Quick Slot Buttons */
.res-modal-slot-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
    margin: 10px 0 12px;
    border-radius: 10px;
    font-size: 0.84rem;
    border: 1px solid #2a2f3a;
    background: #121418;
    color: #e5e7eb;
}

.res-modal-slot-banner.banner-open { border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.08); }
.res-modal-slot-banner.banner-low  { border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.1); }
.res-modal-slot-banner.banner-full { border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.12); color: #fca5a5; }

.quick-slots-five {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 8px !important;
}

.quick-slots-five .quick-slot-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 9px 6px;
}

.quick-slots-five .qs-num {
    font-size: 0.64rem;
    text-transform: uppercase;
    color: #9ca3af;
    font-weight: 700;
}

.quick-slots-five .qs-state {
    font-size: 0.66rem;
    color: #34d399;
    font-weight: 700;
}

.quick-slots-five .quick-slot-btn.active .qs-state {
    color: #ffffff;
}

.quick-slots-five .quick-slot-btn.is-slot-taken {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: rgba(239, 68, 68, 0.45);
}

.quick-slots-five .quick-slot-btn.is-slot-taken .qs-state {
    color: #f87171;
}

@media (max-width: 900px) {
    .res-cal-slots-grid,
    .quick-slots-five {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    .res-cal-type-summary {
        grid-template-columns: 1fr;
    }
    .res-cal-slots-grid,
    .quick-slots-five {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

.res-type-slot-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e5e7eb;
    font-weight: 700;
}

.res-type-slot-rem {
    font-weight: 800;
    font-size: 0.76rem;
    white-space: nowrap;
}

.res-type-slot-pill.type-pill-open .res-type-slot-rem { color: #34d399; }
.res-type-slot-pill.type-pill-low .res-type-slot-rem { color: #fbbf24; }
.res-type-slot-pill.type-pill-full { border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.08); }
.res-type-slot-pill.type-pill-full .res-type-slot-rem { color: #f87171; }

.res-cal-dot.dot-type-table { background: #38bdf8; }
.res-cal-dot.dot-type-food  { background: #34d399; }
.res-cal-dot.dot-type-combo { background: #ff6b00; }

.res-cal-slot-chip.has-shared-time {
    border-color: rgba(255, 107, 0, 0.55);
}

.slot-booked-types {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    margin-top: 3px;
}

.slot-type-tag {
    font-size: 0.64rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot-type-tag.tag-table {
    background: rgba(56, 189, 248, 0.16);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.slot-type-tag.tag-food {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.slot-type-tag.tag-combo {
    background: rgba(255, 107, 0, 0.18);
    color: #ff851a;
    border: 1px solid rgba(255, 107, 0, 0.4);
}

@media (max-width: 640px) {
    .res-cal-type-summary {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   LIVE 5-STEP ORDER PROGRESS STEPPER (customer/my_orders.php)
   ========================================================================== */
.active-orders-section {
    background: var(--bg-card, #1c2027);
    border: 1.5px solid var(--border-card, rgba(255, 255, 255, 0.12));
    border-radius: var(--radius-lg, 14px);
    padding: 20px 22px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.55));
}

.active-orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.active-orders-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-flame, #ff6b00);
    letter-spacing: 0.4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.live-sync-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #cbd5e1;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 5px 12px;
    border-radius: var(--radius-full, 9999px);
    white-space: nowrap;
}

.live-sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
    animation: liveDotPulse 1.8s infinite;
}

@keyframes liveDotPulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
    100% { opacity: 1; transform: scale(1); }
}

.active-orders-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.active-order-card {
    background: var(--bg-inset, #161920);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--primary-flame, #ff6b00);
    border-radius: var(--radius-md, 12px);
    padding: 18px 20px;
    transition: border-color var(--transition-fast, 0.2s ease), box-shadow var(--transition-fast, 0.2s ease);
}

.active-order-card:hover {
    border-color: rgba(255, 107, 0, 0.45);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.active-order-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.active-order-id {
    font-size: 1.08rem;
    font-weight: 800;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.order-type-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.order-type-chip.type-delivery {
    background: rgba(0, 125, 250, 0.16);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.order-type-chip.type-pickup {
    background: rgba(255, 107, 0, 0.16);
    color: #ff9d3b;
    border: 1px solid rgba(255, 107, 0, 0.35);
}

.active-order-meta {
    font-size: 0.84rem;
    color: var(--text-muted, #8f9cae);
    margin-top: 4px;
    line-height: 1.45;
}

.active-order-meta strong {
    color: #e2e8f0;
}

.active-order-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.active-order-total {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--accent-green, #00e676);
    white-space: nowrap;
}

.active-order-rider-bar {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(0, 125, 250, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 8px;
    font-size: 0.84rem;
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.active-orders-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--text-muted, #8f9cae);
    font-size: 0.94rem;
    background: var(--bg-inset, #161920);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md, 12px);
}

/* 5-Step Horizontal Stepper */
.order-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    position: relative;
    margin: 14px 0 6px;
    padding: 4px 0;
    list-style: none;
    gap: 4px;
}

.order-stepper .step-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
    min-width: 0;
    padding: 0 4px;
}

/* Connector Track Between Steps */
.order-stepper .step-item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 16px;
    left: calc(50% + 18px);
    width: calc(100% - 36px);
    height: 3px;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 3px;
    z-index: 0;
    transition: background-color 0.3s ease;
}

.order-stepper .step-item.completed:not(:last-child)::after {
    background: linear-gradient(90deg, #10b981, #00e676);
}

.order-stepper .step-item.active:not(:last-child)::after {
    background: linear-gradient(90deg, rgba(255, 107, 0, 0.75), rgba(255, 255, 255, 0.14));
}

.order-stepper .step-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #252b36;
    border: 2px solid rgba(255, 255, 255, 0.22);
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.order-stepper .step-label {
    margin-top: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #8f9cae;
    line-height: 1.25;
    word-break: normal;
    overflow-wrap: break-word;
}

/* Completed Step State */
.order-stepper .step-item.completed .step-circle {
    background: #10b981;
    border-color: #00e676;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
}

.order-stepper .step-item.completed .step-label {
    color: #34d399;
}

/* Active Current Step State */
.order-stepper .step-item.active .step-circle {
    background: var(--primary-flame, #ff6b00);
    border-color: #ffb066;
    color: #ffffff;
    box-shadow: 0 0 0 5px rgba(255, 107, 0, 0.25), 0 0 16px rgba(255, 107, 0, 0.55);
    animation: stepperPulse 2s infinite;
}

.order-stepper .step-item.active .step-label {
    color: #ffffff;
    font-weight: 800;
}

@keyframes stepperPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.55); }
    70% { box-shadow: 0 0 0 10px rgba(255, 107, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0); }
}

/* Compact Table Variant */
.order-stepper.order-stepper-compact {
    min-width: 310px;
    margin: 4px 0;
}

.order-stepper.order-stepper-compact .step-circle {
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
}

.order-stepper.order-stepper-compact .step-item:not(:last-child)::after {
    top: 12px;
    left: calc(50% + 14px);
    width: calc(100% - 28px);
    height: 2px;
}

.order-stepper.order-stepper-compact .step-label {
    margin-top: 5px;
    font-size: 0.68rem;
}

/* Cancelled / Rejected Status Badge */
.order-status-cancelled {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.16);
    border: 1.5px solid rgba(239, 68, 68, 0.5);
    color: #f87171;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Mobile Vertical Layout Below 576px */
@media (max-width: 576px) {
    .active-orders-section {
        padding: 16px 14px;
    }

    .active-order-card {
        padding: 14px;
    }

    .order-stepper:not(.order-stepper-compact) {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 12px 0 4px;
        padding-left: 2px;
    }

    .order-stepper:not(.order-stepper-compact) .step-item {
        flex: none;
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 12px;
        padding: 8px 0;
    }

    .order-stepper:not(.order-stepper-compact) .step-item:not(:last-child)::after {
        top: 42px;
        left: 16px;
        width: 3px;
        height: calc(100% - 20px);
    }

    .order-stepper:not(.order-stepper-compact) .step-label {
        margin-top: 0;
        font-size: 0.86rem;
    }

    .order-stepper.order-stepper-compact {
        min-width: 240px;
    }

    .order-stepper.order-stepper-compact .step-label {
        font-size: 0.64rem;
    }
}

/* ==========================================================================
   CROSS-DASHBOARD UNIFORMITY & OVERFLOW PROTECTION LAYER
   Applies consistent sizing, touch targets, wrapping, and spacing across
   Admin, Staff, Rider, and Customer dashboards on Desktop, Tablet & Mobile
   ========================================================================== */
.admin-layout,
.rider-container,
.profile-dashboard,
.profile-content,
.profile-section,
.main-content,
.sales-card,
.res-kpi-card,
.order-card,
.metric-card,
.table-container,
.graph-container,
.notif-card {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="search"],
select.form-control {
    min-height: var(--control-height);
    border-radius: var(--radius-control);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    letter-spacing: var(--ls-body);
    max-width: 100%;
}

@media (max-width: 575px) {
    .filter-form,
    .filter-group,
    .panel-segment-tabs {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-xs);
        width: 100%;
    }

    .filter-form > *,
    .filter-group > a,
    .filter-group > button {
        flex: 1 1 auto;
        min-height: var(--control-height);
        justify-content: center;
        text-align: center;
    }
}

/* ==========================================================================
   STANDARDIZED ADMIN & STAFF PAGE TITLE (.admin-page-title)
   Uniform typography, weight, spacing, and emoji alignment across all
   Admin & Staff pages on Desktop (>= 1025px), Tablet (768-1024px), & Mobile
   ========================================================================== */
.admin-page-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-family: var(--font-heading, 'Plus Jakarta Sans', 'Inter', sans-serif);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.02em;
    color: #ffffff;
    text-transform: none;
    margin: 0;
}

.admin-page-title--spaced {
    margin-bottom: 1.25rem;
}

.admin-page-title .admin-title-emoji {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .admin-page-title {
        font-size: 1.35rem;
    }
}

@media (max-width: 767px) {
    .admin-page-title {
        font-size: 1.2rem;
    }
}

/* ==========================================================================
   GLOBAL HORIZONTAL TEXT FLOW, ALIGNMENT, UNIFORM SPACING & ANTI-SQUISH
   Ensures readable horizontal typography across Public, Customer, Rider & Admin
   ========================================================================== */
html, body, main, section, article, aside, header, footer, nav, table, form {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
}

h1, h2, h3, h4, h5, h6,
p, li, dd, dt, label, blockquote,
td, th, .card-desc, .form-label {
    word-break: normal;
    overflow-wrap: break-word;
}

/* Uniform readable typography spacing */
h1, h2, h3, h4, h5, h6 {
    line-height: var(--lh-heading, 1.25);
    margin-bottom: 0.5rem;
}

p {
    line-height: var(--lh-body, 1.5);
    letter-spacing: var(--ls-body, 0);
    margin-bottom: 0.75rem;
}

p:last-child {
    margin-bottom: 0;
}

.form-label,
.form-group > label:not(.checkbox-label):not(.senior-toggle-opt) {
    display: block;
    text-align: left;
    margin-bottom: 0.35rem;
    line-height: 1.35;
    letter-spacing: var(--ls-body, 0);
}

/* Tabular numerals for crisp price, total, and metric alignment */
.food-price,
.order-total-amount,
.metric-val,
.kpi-stat-value,
.kpi-value,
.grand-total,
.change-display,
.cart-item-price,
.route-fee,
.gcash-amount,
.order-tile-total,
.currency-highlight {
    font-variant-numeric: tabular-nums;
}

/* Consistent left alignment on descriptions, card bodies, and table text cells */
.card-desc,
.form-group,
.customer-info-box,
.items-box,
.order-tile-modal-block,
.id-notice-box,
.gcash-rule-card,
.site-footer p,
.site-footer li {
    text-align: left;
}

/* Crisp vertical icon + label alignment */
.nav-link,
.btn,
.badge,
.status-badge,
.filter-pill,
.tab-btn,
.btn-header-action,
.btn-header-btn,
.btn-action,
.btn-contact,
.customer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Short badges, prices, dates & buttons stay on one clean horizontal line */
.badge,
.status-badge,
.status-pill,
.type-badge,
.role-badge,
.channel-chip,
.ref-pill,
.pill-badge,
.table-count-badge,
.user-count,
.route-fee,
.order-total-amount,
.gcash-amount {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Tablet & Mobile Anti-Squish Flex/Grid/Table Engine (<= 1024px) */
@media (max-width: 1024px) {
    /* Prevent flex rows holding text + buttons/badges from squeezing text vertically */
    .page-header,
    .header-flex,
    .card-header,
    .section-header,
    .table-header-bar,
    .table-top-bar,
    .chart-box-header,
    .report-header-bar,
    .audit-card-header,
    .filter-bar,
    .filter-top-row,
    .panel-header,
    .cart-item-row,
    .total-row,
    .order-card-header,
    .route-info-bar,
    .payment-row,
    .id-modal-actions-bar {
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    /* Guarantee text containers inside flex/grid items can wrap horizontally cleanly */
    .page-header > *,
    .header-flex > *,
    .card-header > *,
    .section-header > *,
    .chart-box-header > *,
    .report-header-bar > *,
    .order-card-header > *,
    .info-row > *,
    .cart-item-row > *,
    .site-footer > div > * {
        min-width: 0;
        max-width: 100%;
    }

    /* Ensure non-tile tables scroll smoothly instead of squishing columns letter-by-letter */
    .table-container:not(.order-tiles-wrapper),
    .table-responsive:not(.order-tiles-wrapper),
    .table-scroll-box:not(.order-tiles-wrapper),
    .table-box:not(.order-tiles-wrapper),
    .audit-table-container,
    .drilldown-table-wrap,
    .receipt-items-table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100%;
        max-width: 100%;
    }

    /* Override cramped inline fixed widths on table headers/cells on narrow screens */
    table:not(.order-tiles-table) th,
    table:not(.order-tiles-table) td {
        word-break: normal !important;
        overflow-wrap: break-word !important;
        writing-mode: horizontal-tb !important;
    }
}

/* Compact Mobile Stacking (<= 575px) */
@media (max-width: 575px) {
    .receipt-meta-banner,
    .id-modal-meta-grid,
    .form-grid-duo {
        grid-template-columns: 1fr !important;
    }
    .audit-search-input {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .site-footer > div > div {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
}

/* Desktop Zero-Horizontal-Scroll Guarantee for Admin/Staff Tables (>= 1025px) */
@media (min-width: 1025px) {
    .admin-layout .table-container,
    .admin-layout .table-scroll-box,
    .admin-layout .table-responsive,
    .admin-layout .audit-table-container,
    .admin-layout .drilldown-table-wrap {
        overflow-x: hidden;
        max-width: 100%;
    }
    .admin-layout table {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .admin-layout table th,
    .admin-layout table td {
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
}
