:root {
    --primary: #1565C0;
    --primary-hover: #0D47A1;
    --secondary: #1976D2;
    --dark-blue: #0D47A1;
    --light-blue: #E3F2FD;
    --bg-main: #F5F9FF;
    --white: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --success: #2E7D32;
    --warning: #F9A825;
    --danger: #C62828;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -2px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.1);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Admin / Staff Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: all 0.3s ease;
}

.app-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: all 0.3s ease;
}

.app-header {
    height: 64px;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
}

.app-content {
    flex: 1;
    padding: 1.5rem;
}

/* Sidebar Links */
.sidebar-brand {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    gap: 0.75rem;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0.75rem;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.75rem 0.75rem 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    color: var(--text-main);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.925rem;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

.sidebar-link i {
    font-size: 1.15rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.sidebar-link:hover {
    background-color: var(--light-blue);
    color: var(--primary);
}

.sidebar-link:hover i {
    color: var(--primary);
}

.sidebar-link.active {
    background-color: var(--primary);
    color: var(--white);
}

.sidebar-link.active i {
    color: var(--white);
}

/* Cards & Components */
.card-custom {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-stat {
    border-radius: var(--radius-md);
    padding: 1.25rem;
    background: var(--white);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.card-stat .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card-stat.primary .stat-icon {
    background-color: var(--light-blue);
    color: var(--primary);
}

.card-stat.success .stat-icon {
    background-color: #E8F5E9;
    color: var(--success);
}

.card-stat.warning .stat-icon {
    background-color: #FFF8E1;
    color: var(--warning);
}

.card-stat.danger .stat-icon {
    background-color: #FFEBEE;
    color: var(--danger);
}

/* Buttons */
.btn-primary-custom {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.btn-primary-custom:hover, .btn-primary-custom:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--white);
}

.btn-light-custom {
    background-color: var(--light-blue);
    color: var(--primary);
    border: 1px solid transparent;
    font-weight: 500;
}

.btn-light-custom:hover {
    background-color: #bbdefb;
    color: var(--primary-hover);
}

/* Badges */
.badge-order-new { background-color: #E3F2FD; color: #1565C0; }
.badge-order-process { background-color: #FFF3E0; color: #E65100; }
.badge-order-ready { background-color: #E8F5E9; color: #2E7D32; }
.badge-order-completed { background-color: #ECEFF1; color: #455A64; }
.badge-order-cancelled { background-color: #FFEBEE; color: #C62828; }

.badge-pay-paid { background-color: #E8F5E9; color: #2E7D32; font-weight: 600; }
.badge-pay-pending { background-color: #FFF8E1; color: #F57F17; font-weight: 600; }
.badge-pay-failed { background-color: #FFEBEE; color: #C62828; font-weight: 600; }

/* Responsive Media Queries */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.4);
        z-index: 1035;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

/* Customer View Specific Styling */
.customer-container {
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 90px;
}

.sticky-bottom-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1020;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 0.85rem 1rem;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
}

.sticky-bottom-cart-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.menu-category-nav {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
    scrollbar-width: none;
}
.menu-category-nav::-webkit-scrollbar {
    display: none;
}

.category-pill {
    padding: 0.45rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--white);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-pill.active, .category-pill:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Kitchen KDS Columns */
.kds-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}

.kds-column {
    background: #EDF2F7;
    border-radius: var(--radius-md);
    padding: 1rem;
    min-height: calc(100vh - 160px);
    display: flex;
    flex-direction: column;
}

.kds-column-header {
    font-weight: 700;
    font-size: 1rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid #CBD5E1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================
   STANDALONE LAYOUTS (Cashier & Kitchen)
   ========================================== */
.standalone-body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

/* Top Navbar */
.standalone-navbar {
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    color: #FFFFFF;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1040;
    box-shadow: 0 2px 12px rgba(21, 101, 192, 0.3);
}

.standalone-navbar.kitchen-navbar {
    background: linear-gradient(135deg, #E65100 0%, #BF360C 100%);
    box-shadow: 0 2px 12px rgba(230, 81, 0, 0.3);
}

.standalone-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
}

.standalone-brand:hover {
    color: #FFFFFF;
    opacity: 0.9;
}

.standalone-brand i {
    font-size: 1.3rem;
}

/* Role Badge */
.standalone-role-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.7rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
}

.standalone-role-badge.cashier {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.standalone-role-badge.kitchen {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Nav Links */
.standalone-nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 1.5rem;
}

.standalone-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.standalone-nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

.standalone-nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    font-weight: 600;
}

.standalone-nav-link i {
    font-size: 1.05rem;
}

/* Avatar */
.standalone-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.standalone-avatar.kitchen-avatar {
    background: rgba(255, 255, 255, 0.25);
}

/* Standalone Content */
.standalone-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 100%;
}

/* Mobile Bottom Navigation */
.standalone-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: #FFFFFF;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0.4rem 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

.standalone-mobile-nav.kitchen-mobile-nav .standalone-mobile-link.active {
    color: #E65100;
}

.standalone-mobile-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.35rem 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    transition: color 0.2s ease;
    border-radius: var(--radius-sm);
}

.standalone-mobile-link i {
    font-size: 1.25rem;
}

.standalone-mobile-link.active {
    color: var(--primary);
    font-weight: 600;
}

.standalone-mobile-link:hover {
    color: var(--primary);
}

.standalone-mobile-link.text-danger:hover,
.standalone-mobile-link.text-danger {
    color: var(--danger) !important;
}

/* Mobile padding for standalone body */
@media (max-width: 767.98px) {
    .standalone-body {
        padding-bottom: 70px;
    }
}

/* ==========================================
   CUSTOMER MENU & BARCODE FEATURES
   ========================================== */
.table-barcode-banner {
    background: linear-gradient(135deg, #FFFFFF 0%, #F1F5F9 100%);
    border: 1px solid #E2E8F0;
    position: relative;
    overflow: hidden;
}

.table-barcode-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, #1565C0 0%, #FFC107 100%);
}

.table-barcode-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: #FFFFFF;
    border: 2px solid #E2E8F0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.table-barcode-icon-box:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(21, 101, 192, 0.2);
    border-color: #1565C0;
}

.table-qr-mini {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.qr-zoom-hint {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #1565C0;
    color: #FFFFFF;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Stylized Barcode Strips */
.barcode-strip {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    height: 22px;
    margin: 0.4rem auto;
    opacity: 0.85;
}

.barcode-strip span {
    display: inline-block;
    height: 100%;
    background: #0F172A;
    border-radius: 1px;
}

/* Menu Item Card Active in Cart */
.menu-item-card.has-items {
    border-color: #1565C0;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.15), 0 8px 20px rgba(21, 101, 192, 0.08);
}

/* Note Quick Chips */
.note-chips-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.note-chip {
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #CBD5E1;
    border-radius: 50px;
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.note-chip:hover, .note-chip:active {
    background: #E3F2FD;
    color: #1565C0;
    border-color: #90CAF9;
}

/* Barcode Scanner Modal Styling */
.scanner-viewport-box {
    position: relative;
    width: 100%;
    max-width: 320px;
    height: 240px;
    margin: 0 auto;
    background: #0F172A;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #38BDF8;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.scanner-laser-line {
    position: absolute;
    left: 10%;
    right: 10%;
    height: 3px;
    background: #EF4444;
    box-shadow: 0 0 12px #EF4444, 0 0 24px #EF4444;
    border-radius: 2px;
    animation: scanLaser 2s ease-in-out infinite alternate;
    z-index: 10;
}

@keyframes scanLaser {
    0% { top: 15%; }
    100% { top: 85%; }
}

.scanner-target-corners {
    position: absolute;
    inset: 15px;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    pointer-events: none;
}

