        /* --- Root Variables --- */
        :root {
    --primary: #0078ff;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --light: #f8f9fa;
    --dark: #212529;
    --background: #f5f6f8;
    --surface: #ffffff;
    --outline: #dcdcdc;
    --text: #1c1c1c;
    --muted: #6c757d;
    --shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    --radius: 8px;
        }

        /* --- Base Styles --- */
        * {
            box-sizing: border-box;
        }

        html, body {
            height: 100%;
        }

        body {
            font-family: "Inter", sans-serif;
            background-color: var(--background);
            color: var(--text);
            margin: 0;
            line-height: 1.5;
            display: flex;
            flex-direction: column;
        }

        h1, h2, h3, h4, h5, h6 {
            margin: 0 0 0.75em 0;
            font-weight: 600;
        }
        h1 { font-size: 1.75rem; }
        h2 { font-size: 1.5rem; }
        h3 { font-size: 1.25rem; }

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

        /* --- General Purpose Classes --- */
        .primary {
            background-color: var(--primary);
            color: white;
            border: none;
        }
        .secondary {
            background-color: var(--secondary);
            color: white;
            border: none;
        }
        .icon-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 1.25rem;
            color: var(--muted);
            padding: 0;
        }

        /* --- App Header --- */
        .app-header {
            background-color: var(--surface);
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--outline);
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
            box-shadow: var(--shadow);
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        .brand .logo {
            font-size: 2rem;
        }
        .brand h1 {
            font-size: 1.5rem;
            margin: 0;
        }

        .nav {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .nav-btn {
            font-family: "Inter", sans-serif;
            font-size: 0.9rem;
            font-weight: 500;
            background: none;
            border: none;
            padding: 0.5rem 1rem;
            cursor: pointer;
            border-radius: var(--radius);
            transition: background-color 0.2s, color 0.2s;
        }
        .nav-btn:hover {
            background-color: var(--background);
        }
        .nav-btn.active {
            background-color: var(--primary);
            color: white;
        }

        /* --- Main Container & Views --- */
        .container {
            width: 100%;
            max-width: 1600px;
            margin: 0 auto;
            padding: 1.5rem;
            flex-grow: 1;
        }

        .view {
            display: none;
        }
        .view.active {
            display: block;
            animation: fadeIn 0.3s ease-in-out;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* --- Shop View (Menu & Cart) --- */
        .menu-and-cart {
            display: grid;
            grid-template-columns: 3fr 1fr;
            gap: 1.5rem;
            align-items: flex-start;
        }

        .menu-header, .cart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
            gap: 1rem;
        }
        
        .menu-header h2, .cart-header h2 {
            margin: 0;
        }

        input[type="search"],
        input[type="text"],
        input[type="number"],
        input[type="url"],
        input[type="month"] {
            width: 100%;
            padding: 0.75rem;
            font-size: 1rem;
            border: 1px solid var(--outline);
            border-radius: var(--radius);
            background-color: var(--surface);
        }
        
        #menu-search {
            max-width: 300px;
        }

        /* Menu Grid */
        .menu-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 1rem;
        }

        .card {
            background-color: var(--surface);
            border-radius: var(--radius);
            border: 1px solid var(--outline);
            box-shadow: var(--shadow);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 12px rgba(0, 0, 0, 0.07);
        }

        .card img {
            width: 100%;
            height: 150px;
            object-fit: cover;
            border-bottom: 1px solid var(--outline);
        }

        .card-body {
            padding: 1rem;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .card-title {
            font-weight: 600;
        }
        
        .price {
            font-weight: 500;
            color: var(--primary);
            margin-top: auto;
        }
        
        button, .add-btn {
            font-family: "Inter", sans-serif;
            font-size: 0.9rem;
            font-weight: 600;
            padding: 0.75rem 1rem;
            border: none;
            border-radius: var(--radius);
            cursor: pointer;
            transition: background-color 0.2s, opacity 0.2s;
        }
        
        .add-btn {
            background-color: var(--primary);
            color: white;
            width: 100%;
        }
        .add-btn:hover {
            opacity: 0.85;
        }
        .add-btn:disabled {
            background-color: var(--secondary);
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        /* Sold Out Styling */
        .card.sold-out {
            opacity: 0.7;
        }
        .card.sold-out img {
            filter: grayscale(50%);
        }
        
        /* Cart */
        .cart {
            background-color: var(--surface);
            border: 1px solid var(--outline);
            border-radius: var(--radius);
            padding: 1.5rem;
            position: sticky;
            top: 100px; /* Header height + padding */
        }
        
        .cart-items {
            max-height: 400px;
            overflow-y: auto;
            margin-bottom: 1rem;
        }
        
        .cart-item {
            display: grid;
            grid-template-columns: 1fr auto auto auto;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 0;
            border-bottom: 1px solid var(--outline);
            font-size: 0.9rem;
        }
        
        .cart-item:last-child {
            border-bottom: none;
        }
        
        .qty {
            display: flex;
            align-items: center;
        }
        
        .qty button {
            width: 28px;
            height: 28px;
            padding: 0;
            background-color: var(--light);
            border: 1px solid var(--outline);
            color: var(--text);
            font-size: 1.25rem;
            line-height: 1;
        }
        .qty button:first-child {
            border-radius: var(--radius) 0 0 var(--radius);
        }
        .qty button:last-child {
            border-radius: 0 var(--radius) var(--radius) 0;
        }
        
        .qty input[type="number"] {
            width: 40px;
            height: 28px;
            text-align: center;
            border: 1px solid var(--outline);
            border-left: none;
            border-right: none;
            border-radius: 0;
            padding: 0.25rem;
            font-size: 0.9rem;
            -moz-appearance: textfield;
        }
        .qty input::-webkit-outer-spin-button,
        .qty input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        
        .remove-btn {
            background: none;
            border: none;
            color: var(--danger);
            cursor: pointer;
            padding: 0;
            font-size: 0.8rem;
        }
        
        .totals {
            border-top: 2px solid var(--outline);
            padding-top: 1rem;
            margin-top: 1rem;
            font-weight: 500;
        }
        .totals .row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.5rem;
        }
        .totals .grand {
            font-weight: 700;
            font-size: 1.2rem;
        }
        
        .cart-actions {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.75rem;
            margin-top: 1rem;
        }
        
        /* --- Manage Menu View --- */
        .menu-form {
            max-width: 600px;
            background-color: var(--surface);
            padding: 1.5rem;
            border-radius: var(--radius);
            border: 1px solid var(--outline);
            display: grid;
            gap: 1rem;
            margin-bottom: 2rem;
        }
        .form-row {
            display: grid;
            gap: 0.5rem;
        }
        .form-row label {
            font-weight: 500;
        }
        .form-row input[type="checkbox"] {
            width: auto;
            cursor: pointer;
        }
        .form-actions {
            display: flex;
            gap: 0.75rem;
            margin-top: 0.5rem;
        }
        
        .manage-list-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }
        .manage-list-header h3 {
            margin: 0;
        }
        #manage-search {
            max-width: 300px;
        }
        
        .manage-list {
            display: grid;
            gap: 0.75rem;
        }
        .manage-item {
            display: grid;
            grid-template-columns: auto 1fr auto;
            align-items: center;
            gap: 1rem;
            background-color: var(--surface);
            padding: 0.75rem 1rem;
            border-radius: var(--radius);
            border: 1px solid var(--outline);
        }
        .manage-item img {
            width: 64px;
            height: 64px;
            border-radius: var(--radius);
            object-fit: cover;
        }
        .manage-actions {
            display: flex;
            gap: 0.5rem;
        }
        .edit-btn {
            background-color: var(--warning);
            color: var(--text);
            padding: 0.5rem 1rem;
        }
        .del-btn {
            background-color: var(--danger);
            color: white;
            padding: 0.5rem 1rem;
        }

        /* --- Reports & Invoices Table --- */
        .report-controls {
            display: flex;
            gap: 0.75rem;
            margin-bottom: 1.5rem;
            align-items: center;
        }
        .report-controls label {
            font-weight: 500;
        }
        
        .report-summary {
            background-color: var(--surface);
            padding: 1.5rem;
            border-radius: var(--radius);
            border: 1px solid var(--outline);
            margin-bottom: 1.5rem;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
            font-size: 1.1rem;
        }
        
        .report-table {
            background-color: var(--surface);
            border-radius: var(--radius);
            border: 1px solid var(--outline);
            overflow-x: auto;
        }
        
        table {
            width: 100%;
            border-collapse: collapse;
        }
        
        th, td {
            padding: 1rem;
            text-align: left;
            border-bottom: 1px solid var(--outline);
        }
        
        thead th {
            background-color: var(--light);
            font-weight: 600;
        }
        
        tbody tr:hover {
            background-color: var(--background);
        }
        
        td.actions {
            text-align: right;
        }

        /* --- Modal (QR & Invoice) --- */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0, 0, 0, 0.6);
            align-items: center;
            justify-content: center;
        }
        .modal.show {
            display: flex;
            animation: fadeIn 0.3s;
        }
        
        .modal-content {
            background-color: var(--surface);
            margin: auto;
            padding: 1.5rem;
            border-radius: var(--radius);
            width: 90%;
            max-width: 500px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
            animation: slideIn 0.3s;
        }
        
        @keyframes slideIn {
            from { opacity: 0; transform: translateY(-30px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--outline);
            padding-bottom: 1rem;
            margin-bottom: 1rem;
        }
        .modal-header h3 {
            margin: 0;
        }
        
        .qr-code {
            width: 100%;
            max-width: 300px;
            height: auto;
            margin: 1rem auto;
            display: grid;
            place-items: center;
        }
        .qr-code img, .qr-code canvas {
            width: 100% !important;
            height: auto !important;
        }
        
        .qr-note {
            text-align: center;
            color: var(--muted);
            margin: 1rem 0;
        }
        
        .modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 0.75rem;
            margin-top: 1.5rem;
        }
        
        /* --- Printable Bill (Shared by Invoice Modal & Print) --- */
        .bill {
            padding: 1.5rem;
            border: 1px solid var(--outline);
            border-radius: var(--radius);
        }
        .bill h2 {
            text-align: center;
            margin-bottom: 1rem;
        }
        .bill #bill-date, .bill [id^="bill-date"] {
            text-align: center;
            color: var(--muted);
            margin-bottom: 1.5rem;
        }
        .bill .item-row {
            display: flex;
            justify-content: space-between;
            padding: 0.5rem 0;
            border-bottom: 1px dashed var(--outline);
        }
        .bill #bill-totals, .bill [id^="bill-totals"] {
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 2px solid var(--text);
        }
        .bill .thanks {
            text-align: center;
            margin-top: 1.5rem;
            font-style: italic;
        }
        
        /* --- Print-Only Styles --- */
        #print-area {
            display: none;
        }
        
        @media print {
            body {
                background-color: white;
            }
            .app-header, .container, .modal {
                display: none !important;
            }
            #print-area {
                display: block;
            }
            .bill {
                border: none;
                padding: 0;
                box-shadow: none;
            }
        }
        
        /* --- Responsive Design --- */
        @media (max-width: 900px) {
            .menu-and-cart {
                grid-template-columns: 1fr;
            }
            .cart {
                position: static;
                top: auto;
            }
            #menu-search {
                max-width: none;
            }
        }
        
        @media (max-width: 600px) {
            .app-header {
                flex-direction: column;
                padding: 1rem;
            }
            .container {
                padding: 1rem;
            }
            .manage-item {
                grid-template-columns: 1fr;
                text-align: center;
            }
            .manage-item img {
                margin: 0 auto 0.75rem auto;
            }
            .manage-actions {
                justify-content: center;
            }
            .report-summary {
                grid-template-columns: 1fr;
            }
            .modal-content {
                width: 95%;
                padding: 1rem;
            }
        }
        
        /* Cart item stacking on very small screens */
        @media (max-width: 480px) {
            .cart-item {
                grid-template-columns: 1fr; /* Stack everything */
                gap: 0.5rem;
                text-align: center;
            }
            .cart-item > div:first-child {
                /* Name/Price */
                grid-column: 1 / -1;
            }
            .cart-item .qty {
                /* Qty controls */
                grid-column: 1 / -1;
                justify-self: center; /* Center the qty controls */
            }
            .cart-item > div:nth-child(3) {
                /* Total price */
                grid-column: 1 / -1;
            }
            .cart-item .remove-btn {
                /* Remove button */
                grid-column: 1 / -1;
                justify-self: center; /* Center the button */
                background-color: var(--light);
                padding: 0.5rem 1rem;
            }
        }