:root {
    /* Sophisticated Color Palette */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.5);
    
    --accent: #f43f5e;
    --accent-light: #fb7185;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Dark Mode Neutrals */
    --bg-main: #020617;
    --bg-sidebar: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.5);
    --bg-glass: rgba(255, 255, 255, 0.03);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    --border-glow: rgba(99, 102, 241, 0.2);

    /* Shadows & Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-primary: 0 10px 15px -3px rgba(99, 102, 241, 0.3);

    /* Layout & Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-full: 9999px;
    
    --font: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);

    /* Sidebar Variables */
    --sidebar-width: 210px;
    --sidebar-collapsed-width: 70px;
}

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

body {
    font-family: var(--font);
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    font-size: 0.85rem;
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(244, 63, 94, 0.05) 0%, transparent 40%);
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0.75rem;
    z-index: 100;
    transition: var(--transition);
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
    padding: 1.5rem 0.5rem;
}

.sidebar.collapsed .logo-name,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .developer-credit,
.sidebar.collapsed .logout-btn span,
.sidebar.collapsed .section-label,
.sidebar.collapsed #shift-status-card span,
.sidebar.collapsed #shift-status-card #shift-opening-info,
.sidebar.collapsed #shift-status-card .btn span,
.sidebar.collapsed #no-shift-card span,
.sidebar.collapsed #no-shift-card .btn span {
    display: none;
}

.sidebar.collapsed .logo {
    justify-content: center;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.85rem;
}

.sidebar.collapsed .nav-item i {
    margin: 0;
}

.sidebar.collapsed .sidebar-header {
    display: flex;
    justify-content: center;
}

.sidebar.collapsed #desktop-toggle {
    position: static;
    margin: 0;
}

.sidebar.collapsed #desktop-toggle i {
    transform: rotate(180deg);
}

.sidebar.collapsed #shift-status-card,
.sidebar.collapsed #no-shift-card {
    padding: 0.75rem 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.sidebar.collapsed #shift-status-card .flex,
.sidebar.collapsed #no-shift-card .flex {
    justify-content: center !important;
    width: 100%;
}

.sidebar.collapsed #shift-status-card .btn,
.sidebar.collapsed #no-shift-card .btn {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    border-radius: 50% !important;
}

.sidebar-header {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-name span {
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.desktop-only {
    display: flex;
}

@media (max-width: 1024px) {
    .desktop-only {
        display: none !important;
    }
}

#desktop-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    transition: var(--transition);
}

#desktop-toggle:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.mobile-header {
    display: none;
    padding: 1rem 1.5rem;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
}

@media (max-width: 1024px) {
    .mobile-header {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }
    
    .app-container {
        padding-top: 60px;
    }

    body {
        overflow-y: auto;
    }
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    padding-bottom: 2rem;
}

.sidebar-section {
    margin-top: 1.5rem;
}

.sidebar-section:first-child {
    margin-top: 0;
}

.section-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
    letter-spacing: 1.5px;
    opacity: 0.7;
}

.sidebar.collapsed .section-label {
    display: none;
}

.sidebar.collapsed .sidebar-section {
    border-top: 1px solid var(--border);
    margin-top: 1rem;
    padding-top: 1rem;
}

.sidebar.collapsed .sidebar-section:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.nav-item i {
    width: 22px;
    height: 22px;
    stroke-width: 2px;
    transition: var(--transition);
}

/* Icon Colors */
.nav-item[data-page="dashboard"] i { color: #60a5fa; filter: drop-shadow(0 0 5px rgba(96, 165, 250, 0.3)); }
.nav-item[data-page="pos"] i { color: #fbbf24; filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.3)); }
.nav-item[data-page="orders"] i { color: #34d399; filter: drop-shadow(0 0 5px rgba(52, 211, 153, 0.3)); }
.nav-item[data-page="tables"] i { color: #a78bfa; filter: drop-shadow(0 0 5px rgba(167, 139, 250, 0.3)); }
.nav-item[data-page="menu"] i { color: #f472b6; filter: drop-shadow(0 0 5px rgba(244, 114, 182, 0.3)); }
.nav-item[data-page="inventory"] i { color: #fb7185; filter: drop-shadow(0 0 5px rgba(251, 113, 133, 0.3)); }
.nav-item[data-page="reports"] i { color: #22d3ee; filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.3)); }
.nav-item[data-page="finance"] i { color: #fbbf24; filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.3)); }
.nav-item[data-page="settings"] i { color: #94a3b8; filter: drop-shadow(0 0 5px rgba(148, 163, 184, 0.3)); }
.nav-item[data-page="users"] i { color: #2dd4bf; filter: drop-shadow(0 0 5px rgba(45, 212, 191, 0.3)); }
.logout-btn i { color: #fb7185; }

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

.nav-item.active i {
    color: white !important;
    filter: none !important;
}

.nav-item:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
    border-color: var(--border);
    transform: translateX(6px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: white;
    border-radius: 4px 0 0 4px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.developer-credit {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 1px;
    font-weight: 500;
    opacity: 0.6;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: #ef4444;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.logout-btn:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
}

#login-screen, #registration-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-main);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
}

.login-panel, .registration-panel {
    width: 100%;
    max-width: 400px;
    padding: 3rem;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-header, .registration-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input {
    padding: 0.85rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: white;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
}

/* Category Navigation - SOLID VISIBILITY RESTORATION */
.category-tabs {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    gap: 0.75rem !important;
    padding: 0.5rem 0.5rem 1rem !important;
    scrollbar-width: thin !important;
    margin-bottom: 0.75rem !important;
    position: relative !important;
    z-index: 1000 !important;
    min-height: 60px !important;
}

.category-tabs::-webkit-scrollbar { display: none !important; }

.tab-item {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    white-space: nowrap !important;
    padding: 0.6rem 1.5rem !important;
    background: #1e293b !important;
    border: 2px solid #334155 !important;
    border-radius: 10px !important;
    font-weight: 800 !important;
    font-size: 0.95rem !important;
    color: #ffffff !important;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5) !important;
}

.tab-item:hover {
    background: #334155 !important;
    border-color: #6366f1 !important;
    transform: translateY(-5px) !important;
}

.tab-item.active {
    background: #6366f1 !important; /* SOLID PRIMARY BLUE */
    color: white !important;
    border-color: #818cf8 !important;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4) !important;
    transform: scale(1.05) translateY(-2px) !important;
}

.avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    box-shadow: var(--shadow-sm);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    position: relative;
    scroll-behavior: smooth;
}

.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

/* Utility Classes */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

/* Payment Modal Styles */
/* Payment Modal Styles - Premium Edition */
.payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

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

.payment-method-card {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.payment-method-card input {
    position: absolute;
    opacity: 0;
}

.pm-content {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.pm-content i {
    width: 40px;
    height: 40px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.pm-content span {
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

/* Selected State */
.payment-method-card input:checked + .pm-content {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.3), 
                inset 0 0 15px rgba(99, 102, 241, 0.1);
}

.payment-method-card input:checked + .pm-content i {
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary));
    transform: translateY(-2px);
}

.payment-method-card input:checked + .pm-content span {
    color: var(--text-primary);
    font-weight: 700;
}

/* Checkmark indicator */
.payment-method-card input:checked + .pm-content::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.payment-method-card:hover .pm-content {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-light);
}

/* Amount Input Styling */
.amount-input-wrapper {
    position: relative;
    margin-top: 1.5rem;
}

#amount-paid-input {
    font-size: 2rem;
    font-weight: 800;
    text-align: right;
    padding-right: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid var(--border);
    height: 80px;
    color: var(--primary);
}

#amount-paid-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.currency-label {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-secondary);
    pointer-events: none;
}

#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(4px);
    z-index: 99;
}

@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: calc(-1 * var(--sidebar-width));
        top: 0;
        height: 100vh;
        z-index: 1000;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .mobile-header {
        display: flex;
    }

    .app-container {
        padding-top: 60px;
        flex-direction: column;
    }

    .main-content {
        padding: 1rem;
    }

    .mobile-only {
        display: flex !important;
    }

    .pos-layout {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important;
    }

    .pos-main {
        padding-right: 0 !important;
        overflow: visible !important;
        width: 100% !important;
    }

    /* Categories on Mobile - Keep Horizontal */
    .category-tabs {
        padding-bottom: 0.75rem !important;
        margin-bottom: 1rem !important;
    }

    /* Floating Cart FAB (Mobile Only) */
    .cart-fab {
        position: fixed;
        bottom: 2rem;
        right: 1.5rem;
        width: auto;
        min-width: 140px;
        height: 60px;
        background: linear-gradient(135deg, var(--primary), var(--primary-dark));
        color: white;
        border-radius: var(--radius-full);
        box-shadow: 0 10px 30px rgba(99, 102, 241, 0.5);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 1.5rem;
        z-index: 1000;
        cursor: pointer;
        transition: var(--transition);
        border: 2px solid rgba(255, 255, 255, 0.2);
        animation: fabIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes fabIn {
        from { transform: translateY(100px) scale(0); opacity: 0; }
        to { transform: translateY(0) scale(1); opacity: 1; }
    }

    .cart-fab .fab-info {
        display: flex;
        flex-direction: column;
        line-height: 1.2;
    }

    .cart-fab .fab-count {
        background: white;
        color: var(--primary);
        font-size: 0.75rem;
        font-weight: 900;
        padding: 2px 6px;
        border-radius: 4px;
        margin-bottom: 2px;
        text-align: center;
    }

    .cart-fab:active { transform: scale(0.92); }

    .fab-animate {
        animation: fabBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    @keyframes fabBounce {
        0% { transform: scale(1); }
        30% { transform: scale(1.15); }
        50% { transform: scale(0.95); }
        100% { transform: scale(1); }
    }

    .pos-cart {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 85vh;
        z-index: 2001; /* Higher than FAB */
        transform: translateY(100%);
        transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        border-radius: 30px 30px 0 0;
        background: var(--bg-sidebar);
        padding: 1.5rem;
        box-shadow: 0 -20px 50px rgba(0,0,0,0.5);
        display: flex;
        flex-direction: column;
    }

    .pos-cart::before {
        content: '';
        width: 60px;
        height: 6px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 10px;
        position: absolute;
        top: 15px;
        left: 50%;
        transform: translateX(-50%);
        box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    }

    .pos-cart.active {
        transform: translateY(0);
    }

    .cart-header {
        padding-top: 1rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .btn {
        padding: 1.1rem; /* Better touch targets for Android/iOS */
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-header .btn {
        width: 100%;
    }

    /* Prevent mobile zoom on focus */
    .form-control, .form-control-modern, select, input {
        font-size: 16px !important;
    }

    .modal-content {
        max-width: 95%;
        margin: 0 auto;
    }

    .modal-body {
        padding: 1.25rem;
    }

    /* Ultra-Premium POS Grid (2 Columns) */
    .product-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
        padding-bottom: 100px !important; /* Space for FAB */
    }

    .product-card {
        border-radius: var(--radius-lg) !important;
    }

    .product-img {
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
    }

    .p-name {
        font-size: 0.95rem !important;
        white-space: normal !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        height: 2.3em !important;
        line-height: 1.15 !important;
        margin-bottom: 0.25rem !important;
    }

    .p-category {
        display: none; /* Hide on small cards to save space */
    }

    .p-price-tag {
        font-size: 0.65rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    .p-add-icon {
        width: 2rem !important;
        height: 2rem !important;
    }
}

/* Responsive Table Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
}

.table-responsive .data-table {
    min-width: 600px; /* Ensure table doesn't compress too much */
}

/* iOS Safe Area Support */
@supports (padding: env(safe-area-inset-bottom)) {
    .pos-cart.active {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Scrollbar refinement for Android/macOS */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

.glass-panel:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn i {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 20px -5px rgba(99, 102, 241, 0.4);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
    padding: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.hidden {
    display: none !important;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-05 { gap: 0.5rem; }
.gap-1 { gap: 1rem; }
.mt-1 { margin-top: 1.5rem; }
.mt-2 { margin-top: 2.5rem; }
.mt-05 { margin-top: 0.75rem; }
.mb-1 { margin-bottom: 1.5rem; }
.text-danger { color: var(--accent); }
.text-success { color: var(--success); }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* POS Layout */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 1rem;
    height: calc(100vh - 3rem);
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.pos-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    padding-right: 1rem;
}

/* End of Category Navigation */

/* Product Cards - High Impact */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
    padding-bottom: 2rem;
}

.product-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
}

.product-img {
    height: 120px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.p-img-tag {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .p-img-tag {
    transform: scale(1.15);
}

.p-add-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 5px 10px var(--primary-glow);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: scale(0.5) translateY(10px);
    z-index: 2;
}

.product-card:hover .p-add-btn {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.p-price-tag {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 800;
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.p-add-icon {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 5px 15px var(--primary-glow);
    z-index: 3;
    transition: var(--transition);
}

.product-card:active .p-add-icon {
    transform: scale(0.8);
}

.product-info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.05));
}

.p-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.p-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
    opacity: 0.8;
}

.p-price {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary-light);
    letter-spacing: -0.2px;
}

/* Sidebar Cart - Executive Panel */
.pos-sidebar {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(40px);
    border: 1px solid var(--border-light);
    border-radius: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    box-shadow: var(--shadow-2xl);
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.table-selector { margin-top: 1.5rem; }

.table-selector select, .form-control-modern {
    width: 100%;
    padding: 0.85rem 1.4rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.form-control-modern:focus, .table-selector select:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 4px var(--primary-glow);
    transform: translateY(-2px);
}

.form-label-modern {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-items {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(-5px) scale(1.02);
    border-color: var(--border-light);
}

.item-info { display: flex; flex-direction: column; gap: 0.5rem; }
.item-name { font-weight: 700; font-size: 1.1rem; }
.item-price { font-size: 0.95rem; color: var(--primary-light); font-weight: 600; }

.item-qty {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.item-qty button {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.item-qty button:hover { color: var(--primary); transform: scale(1.2); }
.item-qty span { min-width: 2rem; text-align: center; font-weight: 800; font-size: 1.1rem; }

.cart-footer {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.data-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-table td {
    padding: 0.75rem 1.25rem;
    background: var(--bg-glass);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.menu-table-img {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.menu-table-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-table-img i {
    width: 24px;
    height: 24px;
    opacity: 0.3;
}

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-available { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-available::before { background: #10b981; }

.badge-sold_out { background: rgba(244, 63, 94, 0.15); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.2); }
.badge-sold_out::before { background: #f43f5e; }

.badge-pending { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-pending::before { background: #f59e0b; }

.badge-paid { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-paid::before { background: #10b981; }

/* Modal Styling */
#modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-sidebar);
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    border-radius: var(--radius-xl);
    position: relative;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    animation: modalSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

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

/* --- Main Header (Desktop) --- */
.main-header.desktop-only {
    display: none;
}

@media (min-width: 769px) {
    .main-header.desktop-only {
        display: block;
        padding: 0.75rem 1.5rem;
        background: rgba(15, 23, 42, 0.8);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        position: sticky;
        top: 0;
        z-index: 100;
        margin-bottom: 1rem;
    }
}

.application-header {
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

#close-modal {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

#close-modal:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

/* Form Controls */
.form-layout { display: flex; flex-direction: column; gap: 1.5rem; }
.form-group { display: flex; flex-direction: column; gap: 0.75rem; }
.form-group label { font-size: 0.9rem; color: var(--text-secondary); font-weight: 600; }
.form-control {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    color: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    width: 100%;
    transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-control-sm { padding: 0.6rem 1rem; border-radius: var(--radius-sm); background: var(--bg-glass); border: 1px solid var(--border); color: var(--text-primary); font-size: 0.9rem; font-weight: 600; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.stats-card { 
    display: flex; 
    align-items: center; 
    gap: 1.5rem;
    padding: 2rem;
}

.stats-icon-bg {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
    box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.05);
}

.stats-icon-bg.primary { background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.05)); color: var(--primary-light); }
.stats-icon-bg.accent { background: linear-gradient(135deg, rgba(244, 63, 94, 0.2), rgba(244, 63, 94, 0.05)); color: var(--accent-light); }
.stats-icon-bg.success { background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05)); color: #10b981; }

.stats-content { display: flex; flex-direction: column; gap: 0.35rem; }
.stats-label { color: var(--text-muted); font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.stats-value { font-size: 2rem; font-weight: 800; color: var(--text-primary); letter-spacing: -1px; }

/* Charts */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
.chart-container h3 { margin-bottom: 2rem; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.5px; }
canvas { width: 100% !important; max-height: 350px; }

/* Mini Table Grid (Dashboard) */
.mini-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.mini-table {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.mini-table.status-available { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.mini-table.status-occupied { background: rgba(244, 63, 94, 0.1); color: #f43f5e; box-shadow: 0 0 15px rgba(244, 63, 94, 0.15); }
.mini-table:hover { transform: scale(1.1); filter: brightness(1.2); }

/* Scrollbar Style */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.main-content > * {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.toast {
    background: var(--bg-sidebar);
    color: white;
    padding: 1.25rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    border-left: 6px solid var(--primary);
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    animation: toastIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- Receipt Screen Styles --- */
.order-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.receipt-divider {
    border-top: 1px dashed var(--border);
    margin: 1.5rem 0;
}

.receipt-item {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.receipt-item:last-child {
    border-bottom: none;
}

@media (max-width: 640px) {
    .modal-body {
        padding: 1.25rem;
    }
    
    .receipt-totals {
        padding: 1.25rem !important;
    }
    
    .receipt-section {
        padding: 0.75rem !important;
    }
    
    .receipt-item {
        font-size: 0.85rem;
    }
}

/* --- PRINT STYLES --- */
@media print {
    @page { 
        margin: 0; 
        size: auto;
    }

    /* Reset background and colors for print */
    html, body {
        background: white !important;
        color: black !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Hide non-essential UI */
    .app-container, .sidebar, .mobile-header, .header-actions, #toast-container, .toast, .print-hide, 
    .page-header, .btn, #close-modal, #sidebar-overlay, .modal-overlay,
    .modal-background, .developer-credit, .loader, select, input, textarea,
    .period-selector, .header-actions, button {
        display: none !important;
    }

    .print-area {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
    }

    /* Standardize containers for a 'rapi' look */
    .app-container, .modal-overlay, #modal-container, 
    .modal-content, .modal-body {
        display: block !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    body.modal-open .main-content {
        display: none !important;
    }

    body:not(.modal-open) .main-content {
        display: block !important;
        position: static !important;
        width: 100% !important;
    }

    /* Standardize text color */
    * {
        color: black !important;
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
        -webkit-filter: none !important;
        filter: none !important;
    }

    /* Aggressively hide ALL buttons and interactive elements */
    button, .btn, .btn-icon, .btn-sm, 
    #close-modal, .header-actions, .print-hide,
    .data-table .btn, .data-table button,
    i[data-lucide], select, .period-selector {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Professional Print Header for Reports */
    body:not(.modal-open) .main-content::before {
        content: 'LAPORAN RESMI KASIRPRO';
        display: block;
        text-align: center;
        font-size: 22pt;
        font-weight: 900;
        margin-bottom: 2mm;
        text-transform: uppercase;
        letter-spacing: 4px;
        color: black !important;
    }

    body:not(.modal-open) .main-content::after {
        content: 'Dicetak pada: ' attr(data-print-date);
        display: block;
        text-align: right;
        font-size: 8pt;
        margin-top: 5mm;
        border-top: 1px solid #ddd;
    }

    /* Whitelist specific containers that must be visible */
    .glass-panel {
        display: block !important;
        background: white !important;
        border: none !important; /* Authentic receipts don't have boxes */
        margin-bottom: 5mm !important;
        padding: 4mm !important;
        border-radius: 0 !important;
        break-inside: avoid;
    }

    /* Tables must be very 'rapi' and professional */
    .data-table, .summary-table {
        border-collapse: collapse !important;
        width: 100% !important;
        margin-top: 8mm !important;
        border: 2pt solid black !important;
    }
    
    .data-table th, .summary-table th {
        background: #e2e8f0 !important;
        border: 1.5pt solid black !important;
        padding: 4mm 3mm !important;
        font-weight: 900 !important;
        text-transform: uppercase !important;
        font-size: 9pt !important;
        text-align: left !important;
    }
    
    .data-table td, .summary-table td {
        border: 0.5pt solid #333 !important;
        padding: 3.5mm 3mm !important;
        font-size: 9pt !important;
        background: white !important;
    }

    .data-table tr:nth-child(even) td,
    .summary-table tr:nth-child(even) td {
        background: #f8fafc !important;
    }

    /* Numeric columns should be right-aligned */
    .text-right, 
    .data-table .text-right,
    .summary-table .text-right {
        text-align: right !important;
    }

    .text-center,
    .data-table .text-center {
        text-align: center !important;
    }

    /* --- Totals & Summary Styling --- */
    .totals-row, .receipt-totals {
        border-top: 1px dashed black !important;
        margin-top: 3mm !important;
        padding-top: 3mm !important;
        background: transparent !important;
        border-bottom: none !important;
    }

    .total-amount {
        font-size: 14pt !important;
        font-weight: 900 !important;
        text-decoration: underline double !important;
    }

    /* Charts look bad on print, hide them or make them generic */
    .charts-grid, .pie-chart-container, .chart-wrapper, canvas {
        display: none !important;
    }

    /* Stats Cards in Dashboard print */
    .stats-card {
        border: 1.5pt solid black !important;
        width: 100% !important;
        margin-bottom: 5mm !important;
        padding: 5mm !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .stats-info h3 { font-size: 10pt !important; margin: 0 !important; }
    .stats-info .number { font-size: 16pt !important; font-weight: 800 !important; margin: 0 !important; }

    /* --- Receipt Specifics (modal-open) --- */
    body.modal-open #modal-container {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        background: white !important;
        text-align: center !important; /* Centering for print */
    }

    body.modal-open .modal-content {
        width: 80mm !important; /* Default 80mm */
        margin: 0 auto !important;
        border: none !important;
        box-shadow: none !important;
        background: white !important;
        display: inline-block !important; /* Allow parent's text-align: center to work */
        text-align: left !important; /* Reset text align for content inside */
    }

    body.modal-open .modal-content.width-58mm {
        width: 58mm !important;
    }

    body.modal-open .modal-header, 
    body.modal-open .modal-footer {
        display: none !important;
    }

    body.modal-open .modal-body {
        padding: 0 !important;
        overflow: visible !important;
        background: white !important;
    }

    /* Receipt Styling - FORCE BLOCK AND NO GAPS */
    .thermal-receipt, 
    .thermal-receipt * {
        margin: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        gap: 0 !important;
        line-height: 1.2 !important;
        display: block; /* Use block for most things, tables handle the rest */
    }

    .thermal-receipt table,
    .thermal-receipt tr,
    .thermal-receipt td {
        display: table !important; /* Reset tables to be tables */
        width: 100% !important;
    }

    .thermal-receipt tr {
        display: table-row !important;
    }

    .thermal-receipt td {
        display: table-cell !important;
    }

    .receipt-header, .receipt-footer {
        text-align: center !important;
        width: 100% !important;
    }

    .receipt-title {
        font-size: 14pt !important;
        font-weight: 900 !important;
        margin-bottom: 1mm !important;
        text-transform: uppercase !important;
    }
    
    .width-58mm .receipt-title {
        font-size: 11pt !important;
    }
    
    .width-58mm * {
        font-size: 8pt !important;
    }

    .receipt-item {
        border-bottom: 1px dotted #ccc !important;
        padding: 1mm 0 !important;
    }

    /* Force show-on-print elements */
    .show-on-print {
        display: block !important;
    }

    .receipt-divider {
        border-top: 1px dashed black !important;
        margin: 1mm 0 !important;
        padding: 0 !important;
        height: 0 !important;
    }

    .badge {
        border: 1pt solid black !important;
        background: transparent !important;
        color: black !important;
        padding: 1mm 2mm !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
        font-size: 8pt !important;
    }
}

.show-on-print {
    display: none;
}

/* --- Shift Management UI --- */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-indicator.success { background-color: var(--success); box-shadow: 0 0 8px var(--success); }
.status-indicator.danger { background-color: var(--danger); box-shadow: 0 0 8px var(--danger); }

.reconciliation-report .summary-table tr {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.reconciliation-report .summary-table td {
    padding: 0.75rem 0;
}
.reconciliation-report .highlight {
    background: rgba(99, 102, 241, 0.1);
}
.reconciliation-report .highlight-alt {
    background: rgba(255, 255, 255, 0.03);
}
.reconciliation-report .diff-row {
    border-top: 2px solid rgba(255,255,255,0.1);
    font-size: 1.1rem;
}

@media print {
    .reconciliation-report {
        color: black !important;
        background: white !important;
        padding: 5mm !important;
        display: block !important;
        width: 100% !important;
    }
    .reconciliation-report .summary-table {
        border: 1pt solid black !important;
    }
    .reconciliation-report .summary-table td {
        border-bottom: 0.5pt solid black !important;
        padding: 3mm !important;
        color: black !important;
    }
    .reconciliation-report .highlight, 
    .reconciliation-report .highlight-alt {
        background: #f1f5f9 !important;
        border: 1px solid black !important;
    }
}

/* --- Settings Tabbed UI --- */
.settings-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.settings-tab {
    padding: 1rem 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.settings-tab:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.settings-tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary-light);
    background: linear-gradient(to bottom, transparent, rgba(99, 102, 241, 0.05));
}

.settings-tab i {
    width: 18px;
    height: 18px;
}

.hardware-panel {
    padding: 2rem;
    border-radius: var(--radius-lg);
}

.form-grid-hardware {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1rem;
}

.paper-size-btn {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--text-secondary);
}

.paper-size-btn:hover {
    border-color: var(--primary-light);
    color: var(--text-primary);
}

.paper-size-btn.active {
    background: var(--primary);
    border-color: var(--primary-light);
    color: white;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

/* --- Waiter Interface --- */
.waiter-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    height: calc(100vh - 120px);
}

.waiter-main {
    overflow-y: auto;
    padding-right: 0.5rem;
}

.waiter-sidebar {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.table-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 1rem;
    padding: 0.5rem;
}

.table-card {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.table-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
}

.table-card.selected {
    background: var(--primary);
    border-color: var(--primary-light);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    transform: scale(1.05);
}

.table-card .table-number {
    font-size: 1.5rem;
    font-weight: 700;
}

.table-card .table-status {
    font-size: 0.65rem;
    opacity: 0.7;
    font-weight: 500;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-card.occupied { border-left: 4px solid var(--danger); }
.table-card.available { border-left: 4px solid var(--success); }

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255,255,255,0.05);
}

@media (max-width: 1024px) {
    .waiter-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .waiter-sidebar {
        position: sticky;
        bottom: 1rem;
        z-index: 50;
        margin-top: 2rem;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
        border: 1px solid var(--primary-glow);
        box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    }
}

/* --- Notifications --- */
.notification-trigger {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
}

.notification-trigger:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.1);
}

.notification-trigger i {
    width: 22px;
    height: 22px;
    color: var(--text-primary);
}

.badge-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-sidebar);
    animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.badge-count.hidden {
    display: none;
}

/* --- New Order Modal & Alerts --- */
.new-order-alert {
    max-width: 450px !important;
    border: 2px solid var(--primary) !important;
    background: linear-gradient(135deg, #0f172a, #1e293b) !important;
}

.pulse-border {
    animation: border-pulse 1.5s infinite;
}

@keyframes border-pulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); border-color: var(--primary); }
    50% { box-shadow: 0 0 25px 5px rgba(99, 102, 241, 0.2); border-color: var(--primary-light); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); border-color: var(--primary); }
}

.new-order-alert h2 {
    color: var(--primary-light);
    letter-spacing: 1px;
}

.animate-bounce {
    animation: simple-bounce 1s infinite;
}

@keyframes simple-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* --- Notification Drawer --- */
.notification-drawer {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 320px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
}

.notification-drawer.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.drawer-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.drawer-item {
    padding: 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.drawer-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

.drawer-item:last-child {
    border-bottom: none;
}

.drawer-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.empty-drawer {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Fix for drawer placement relative to sidebar */
@media (min-width: 1025px) {
    .notification-drawer {
        top: 60px;
        right: auto;
        left: 260px; /* Width of sidebar */
    }
    
    .sidebar.collapsed + .notification-drawer {
        left: 90px;
    }
}
