/* ===============================================
   GLOBAL STYLES & VARIABLES
=============================================== */
:root {
    --bg-dark: #1a1a1a;
    --card-bg: #2a2a2a;
    --gold: #D4AF37;
    --text-main: #f0f0f0;
    --text-subtle: #aaa;
    --border-color: #444;
    --veg-icon: #32c832;      /* Green for veg */
    --non-veg-icon: #e04040;  /* Red for non-veg */
    --ready-green: #256b25;   /* Background for ready orders */
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { 
    max-width: 800px; 
    margin: 0 auto; 
    padding: 10px; 
    width: 100%; 
    box-sizing: border-box;
}

main.table-selection-main {
    flex-grow: 1;
}

h2 {
    font-size: 1.8em;
    color: var(--gold);
    border-bottom: 2px solid var(--gold);
    padding-bottom: 5px;
    margin-top: 20px;
}

h3 { font-size: 1.3em; color: var(--text-main); margin-top: 15px; }
ul { list-style: none; padding: 0; margin: 0; }

.hidden { display: none !important; }

/* ===============================================
   HEADER & NAVIGATION
=============================================== */
header {
    background-color: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.header-content-wrapper { max-width: 800px; margin: 0 auto; padding: 0 10px; }

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.header-content a { line-height: 0; border: none; text-decoration: none; }
.logo { max-width: 100px; height: auto; flex-shrink: 0; }

.contact-info { text-align: right; color: var(--text-main); }
.contact-info strong { font-size: 0.9em; color: var(--gold); display: block; }
.contact-info p { margin: 0; font-size: 0.8em; line-height: 1.3; color: var(--text-subtle); }

.phone-link {
    display: block;
    margin-top: 2px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: bold;
    font-size: 0.9em;
    line-height: 1.6;
}
.phone-link:hover { color: var(--gold); }
.phone-link .fa-phone { margin-right: 6px; font-size: 0.9em; }

/* --- Marquee Bar --- */
@keyframes marquee {
    0%   { transform: translateX(100%); }
    90%  { transform: translateX(-100%); }
    100% { transform: translateX(-100%); }
}
#marquee-container {
    background-color: var(--card-bg);
    color: var(--gold);
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
#marquee-container.hidden { display: none; }
#marquee-text {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 50s linear infinite;
    margin: 0;
    font-weight: bold;
}
#marquee-text.paused { animation-play-state: paused; }

/* --- Nav Bar --- */
nav { display: flex; background-color: var(--bg-dark); width: 100%; }
.nav-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}
/* Scroll Fades */
.nav-wrapper::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 30px; 
    background: linear-gradient(to right, var(--bg-dark), transparent); 
    pointer-events: none; z-index: 5; opacity: 0; transition: opacity 0.2s;
}
.nav-wrapper::after {
    content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 30px; 
    background: linear-gradient(to left, var(--bg-dark), transparent); 
    pointer-events: none; z-index: 5; opacity: 0; transition: opacity 0.2s;
}
.nav-wrapper.fade-left::before { opacity: 1; }
.nav-wrapper.fade-right::after { opacity: 1; }

.nav-links-container {
    display: flex; flex-grow: 1; overflow-x: auto; white-space: nowrap;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 10px 0;
}
.nav-links-container::-webkit-scrollbar { display: none; }

nav a {
    flex: 0 0 auto; padding: 8px 15px; margin: 0 5px;
    color: var(--gold); text-decoration: none; font-weight: 600; font-size: 0.9em;
    border-radius: 20px; background-color: var(--card-bg);
    transition: background-color 0.2s, color 0.2s;
}
nav a:hover, nav a:active { background-color: var(--gold); color: #000; }

.scroll-arrow {
    background-color: transparent; border: none; color: var(--gold);
    font-size: 1.8em; cursor: pointer; padding: 5px; z-index: 10;
    opacity: 0.7; transition: opacity 0.2s ease-in-out; flex-shrink: 0;
}
.scroll-arrow:hover { opacity: 1; }
.scroll-arrow.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* ===============================================
   MENU SECTIONS & ITEMS
=============================================== */
section {
    background-color: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
li {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 15px 0; border-bottom: 1px dashed var(--border-color);
}
li:last-child { border-bottom: none; }

.item { display: flex; flex-direction: column; padding-right: 15px; flex-grow: 1; }
.item strong { font-size: 1.1em; color: var(--text-main); }
.description { font-size: 0.9em; color: var(--text-subtle); font-style: italic; }

/* Price & Add Button */
.price-action { display: flex; align-items: center; flex-shrink: 0; }
.price {
    font-size: 1.1em; font-weight: bold; color: var(--gold);
    white-space: nowrap; min-width: 50px; text-align: right; margin-right: 10px;
}
.add-btn {
    background-color: var(--gold); color: #000; border: none;
    font-size: 1.1em; font-weight: bold; border-radius: 50%;
    width: 25px; height: 25px; cursor: pointer; flex-shrink: 0;
    transition: transform 0.1s ease; line-height: 25px; padding: 0;
}
.add-btn:active { transform: scale(0.9); }

/* Quantity Controls */
.quantity-controls {
    display: flex; align-items: center; gap: 5px; flex-shrink: 0;
    margin-right: 5px;
}
.quantity-controls.hidden { display: none !important; }
.item-qty {
    font-size: 1.1em; font-weight: bold; color: var(--text-main);
    min-width: 15px; text-align: center;
}
.menu-btn-minus {
    background-color: #555; color: #fff; border: none;
    border-radius: 50%; width: 25px; height: 25px; font-weight: bold;
    cursor: pointer; line-height: 25px; font-size: 1.1em;
    flex-shrink: 0; transition: transform 0.1s ease;
}
.menu-btn-minus:active { transform: scale(0.9); }

/* Menu Item Icons */
.item-details strong { display: flex; align-items: center; line-height: 1.3; font-size: 1.1em; color: var(--text-main); }
.item-icon {
    font-size: 0.8em; font-weight: bold; display: inline-block;
    width: 20px; height: 20px; line-height: 20px; text-align: center;
    border-radius: 3px; margin-right: 5px; color: #fff; flex-shrink: 0;
}
.item-icon.veg { background-color: var(--veg-icon); }
.item-icon.non-veg { background-color: var(--non-veg-icon); }
.item-icon.chef { background-color: transparent; color: var(--gold); font-size: 1.1em; }
.allergen-sup {
    font-size: 0.7em; vertical-align: super; color: var(--text-subtle);
    margin-left: 5px; font-weight: normal;
}

/* ===============================================
   CART OVERLAY & CHECKOUT
=============================================== */
/* Floating Button */
#cart-toggle-btn {
    position: fixed; bottom: 20px; right: 20px;
    background-color: var(--gold); color: #000; border: none;
    border-radius: 50px; padding: 10px 15px; font-size: 1.2em;
    font-weight: bold; cursor: pointer; z-index: 999;
    display: flex; align-items: center; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
#cart-toggle-btn.hidden { display: none; }
.cart-icon { font-size: 1.5em; margin-right: 8px; }
#cart-item-count {
    background-color: #fff; color: #000; border-radius: 50%;
    width: 24px; height: 24px; display: flex; align-items: center;
    justify-content: center; font-size: 0.8em;
}

/* Overlay */
#cart-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); z-index: 1000;
    display: flex; justify-content: center; align-items: center;
    padding: 20px; box-sizing: border-box;
}
#cart-overlay.hidden { display: none; }

#cart-modal {
    background-color: var(--card-bg); border: 2px solid var(--gold);
    border-radius: 8px; padding: 20px; width: 100%; max-width: 500px;
    max-height: 90vh; overflow-y: auto; position: relative; color: var(--text-main);
}
#cart-close-btn {
    position: absolute; top: 10px; right: 15px; background: none;
    border: none; color: var(--text-main); font-size: 2em; cursor: pointer;
}
#cart-modal h2 { margin-top: 0; color: var(--gold); }

/* Cart Items List */
#cart-items-container {
    max-height: 250px; overflow-y: auto; border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color); margin: 15px 0; padding: 10px 0;
}
.cart-item {
    display: flex; align-items: center; justify-content: space-between; padding: 10px 0;
}
.cart-item-name { font-weight: bold; flex-grow: 1; padding-right: 10px; }
.cart-item-controls { display: flex; align-items: center; flex-shrink: 0; }
.cart-item-controls button {
    background-color: #555; color: #fff; border: none; border-radius: 50%;
    width: 25px; height: 25px; font-weight: bold; cursor: pointer; line-height: 25px;
}
.cart-item-controls span { margin: 0 10px; min-width: 20px; text-align: center; }
.cart-item-price { font-weight: bold; flex-shrink: 0; min-width: 60px; text-align: right; margin-left: 10px; }

/* Summary & Total */
#cart-summary { margin-top: 15px; text-align: right; }
.summary-line { display: flex; justify-content: space-between; font-size: 1.1em; margin-bottom: 5px; }
#summary-discount { color: #25D366; font-size: 1em; }
#summary-total {
    font-size: 1.3em; font-weight: bold; color: var(--gold);
    border-top: 1px dashed var(--gold); padding-top: 10px; margin-top: 10px;
}
#summary-total span:first-child { text-align: left; }

/* Checkout Form */
#order-form label { display: block; margin-top: 10px; font-weight: bold; }
#order-form input, #order-form textarea {
    width: 100%; padding: 8px; box-sizing: border-box; border-radius: 4px;
    border: 1px solid var(--border-color); background-color: #333;
    color: var(--text-main); font-family: inherit; resize: vertical;
}

/* Consent Checkbox */
.consent-checkbox {
    margin-top: 20px; display: flex; align-items: flex-start;
    justify-content: flex-start; flex-wrap: wrap; max-width: 100%; gap: 10px;
}
.consent-checkbox input { flex-shrink: 0; margin-top: 4px; }
.consent-checkbox label {
    font-size: 0.9em; font-weight: normal; color: var(--text-subtle);
    line-height: 1.4; max-width: calc(100% - 40px);
}
.consent-checkbox a { color: var(--gold); text-decoration: underline; }

/* Buttons */
.checkout-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.checkout-buttons button {
    padding: 12px; font-size: 1em; font-weight: bold; border: none;
    border-radius: 5px; cursor: pointer;
}
.checkout-buttons button:disabled { background-color: #555; color: #999; cursor: not-allowed; }
.checkout-email { background-color: var(--gold); color: #000; }
.checkout-whatsapp { background-color: #25D366; color: #fff; }
.checkout-kitchen {
    background-color: var(--card-bg); color: var(--gold); border: 1px solid var(--gold);
}
.checkout-kitchen:hover { background-color: #333; }

/* ===============================================
   ORDER CONFIRMATION (JHASVIK STYLE - FIXED)
=============================================== */
#order-confirmation h2 { color: var(--gold); text-align: center; margin-top: 0; }
#order-confirmation p { text-align: center; color: #aaa; margin-bottom: 20px; }

/* THIS IS THE KEY FIX */
#confirmation-summary {
    background-color: var(--bg-dark);
    border-radius: 5px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    /* IMPORTANT: preserves newlines from text content */
    white-space: pre-wrap; 
    font-family: monospace;
    font-size: 0.9em;
    border: 1px solid var(--gold);
    margin-bottom: 20px;
    color: var(--text-main);
    display: block; 
}

#confirmation-close-btn { width: 100%; margin-top: 10px; }

/* ===============================================
   FOOTERS & POPUPS
=============================================== */
footer {
    text-align: center; font-size: 0.8em; color: var(--text-subtle);
    padding: 20px; border-top: 1px solid var(--border-color); margin-top: auto;
}
.site-credit-footer {
    background-color: #111; color: var(--text-subtle);
    text-align: center; padding: 20px; font-size: 0.8em;
    border-top: 1px solid var(--border-color);
}
.site-credit-footer p { margin: 5px 0; }
.site-credit-footer a { color: var(--gold); text-decoration: none; }
.site-credit-footer a:hover { text-decoration: underline; }

/* Promo Popup */
#popup-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); display: flex;
    justify-content: center; align-items: center; z-index: 1000;
    padding: 20px; box-sizing: border-box;
}
#popup-box {
    background: #fff; color: #333; padding: 25px; border-radius: 8px;
    text-align: center; box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    max-width: 400px; width: 100%;
}
#popup-box h3 { color: #000; margin-top: 0; }
#close-popup {
    background-color: var(--gold); color: #000; border: none;
    padding: 10px 20px; font-size: 1em; font-weight: bold;
    border-radius: 5px; cursor: pointer; margin-top: 15px;
    transition: background-color 0.2s;
}
#close-popup:hover { background-color: #b8860b; }

/* Legal Page Styles */
.legal-page { line-height: 1.8; }
.legal-page h3 {
    margin-top: 25px; border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}
.legal-page ul { padding-left: 20px; list-style: disc; }
.data-point {
    margin-bottom: 15px; padding-left: 15px; border-left: 3px solid var(--gold);
}
.data-point strong { display: block; margin-bottom: 3px; color: var(--text-main); }
address {
    font-style: normal; margin-bottom: 20px; padding: 10px;
    background-color: var(--card-bg); border-radius: 4px;
}

/* ===============================================
   DINE-IN TABLE SELECTION
=============================================== */
.table-selection-main {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; flex-grow: 1; padding: 20px;
}
.table-circle-container {
    position: relative; width: 320px; height: 320px;
    margin: 50px auto; display: flex; align-items: center; justify-content: center;
}
.table-circle {
    position: relative; width: 100%; height: 100%;
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
}
.table-btn {
    display: flex; align-items: center; justify-content: center;
    position: absolute; width: 60px; height: 60px;
    background-color: var(--card-bg); color: var(--gold);
    border: 2px solid var(--gold); border-radius: 50%;
    text-decoration: none; font-size: 1.1em; font-weight: bold;
    transition: all 0.2s ease; z-index: 2;
    top: 50%; left: 50%; margin-left: -30px; margin-top: -30px;
    transform-origin: 50% 50%;
    transform: rotate(var(--angle)) translate(150px) rotate(calc(-1 * var(--angle)));
}
.table-btn:hover {
    background-color: var(--gold); color: #000;
    transform: rotate(var(--angle)) translate(150px) rotate(calc(-1 * var(--angle))) scale(1.1);
}
.table-btn.selected, .table-btn.selected:hover {
    background-color: var(--gold); color: #000;
    transform: rotate(var(--angle)) translate(150px) rotate(calc(-1 * var(--angle))) scale(1.1);
}
.center-food-image {
    width: 160px; height: 160px; object-fit: cover; border-radius: 50%;
    border: 4px solid var(--gold); box-shadow: 0 0 15px rgba(212, 175, 55, 0.5); z-index: 1;
}

/* PC Layout */
@media (min-width: 1024px) {
    main { max-width: 800px; }
    .header-content-wrapper, .nav-wrapper { max-width: 800px; }
    .header-content { padding: 20px 0; }
    .logo { max-width: 180px; }
    .contact-info strong { font-size: 1.1em; }
    .contact-info p { font-size: 0.9em; }
    .phone-link { font-size: 1.1em; }
    .nav-links-container {
        overflow-x: visible; flex-grow: 0; justify-content: center;
        flex-wrap: wrap; padding: 5px 0; gap: 10px;
    }
    .scroll-arrow { display: none !important; }
    nav a { padding: 8px 15px; margin: 0; font-size: 0.9em; }
    
    .table-circle-container { width: 450px; height: 450px; }
    .table-btn {
        transform: rotate(var(--angle)) translate(210px) rotate(calc(-1 * var(--angle)));
    }
    .table-btn:hover, .table-btn.selected, .table-btn.selected:hover {
        transform: rotate(var(--angle)) translate(210px) rotate(calc(-1 * var(--angle))) scale(1.1);
    }
    .center-food-image { width: 220px; height: 220px; }
}

/* ===============================================
   KDS / WAITER / ADMIN STYLES
=============================================== */
.kitchen-body, .billing-body, .records-body {
    background-color: var(--bg-dark); display: flex; flex-direction: column; min-height: 100vh;
}
.kitchen-header {
    background-color: var(--card-bg); color: var(--gold); padding: 10px 20px;
    display: flex; justify-content: center; align-items: center;
    border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100;
}
.header-logo { display: flex; align-items: center; gap: 15px; }
.header-logo img { height: 40px; width: auto; }
.kitchen-header h1 { margin: 0; font-size: 1.2em; color: var(--gold); border: none; padding: 0; }
#connection-icon { display: inline-block; margin-left: 10px; font-size: 0.8em; }
#connection-status { display: none; }

.kitchen-main { padding: 10px; flex-grow: 1; max-width: none; }
#kds-content-wrapper { width: 100%; max-width: 1200px; margin: 0 auto; margin-top: 0; }

.table-grid, .pickup-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px;
}
.table-box, .pickup-box {
    background-color: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex; flex-direction: column;
}
.table-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--gold); padding: 10px 15px;
}
.table-header h2 { color: var(--gold); margin: 0; font-size: 1.2em; border: none; padding: 0; }
.order-time { font-size: 0.9em; font-weight: bold; color: var(--text-subtle); }

.order-list { list-style: none; padding: 0; margin: 0; flex-grow: 1; max-height: 300px; overflow-y: auto; }
.order-list-empty, .pickup-box-empty {
    color: var(--text-subtle); font-style: italic; padding: 15px; display: block;
}
.pickup-box-empty {
    grid-column: 1 / -1; text-align: center; border: 1px dashed var(--border-color); border-radius: 8px;
}

.order-group { padding: 10px 15px; border-bottom: 1px dashed var(--border-color); }
.order-group:last-child { border-bottom: none; }
.order-group h4 { margin: 0 0 5px 0; color: var(--gold); font-size: 0.9em; font-weight: bold; }
.order-group ul { list-style: none; padding: 0; margin: 0; }
.order-group li { padding: 2px 0 2px 10px; font-size: 0.95em; line-height: 1.4; border: none; }

/* KDS Status Highlights */
.kitchen-ready-highlight {
    background-color: #1a3a1a; border: 1px solid #25D366; border-radius: 4px; margin-bottom: 5px;
}
.kitchen-ready-highlight h4 { color: #25D366 !important; }
.kitchen-status-badge {
    background-color: #25D366; color: #000; font-weight: bold;
    text-align: center; padding: 5px; border-radius: 4px;
    margin-top: 8px; font-size: 0.85em; text-transform: uppercase;
}

/* Action Buttons */
.clear-table-btn, .clear-pickup-btn, .btn-mark-ready {
    background-color: #8B0000; color: white; border: none; padding: 10px;
    font-size: 0.9em; font-weight: bold; cursor: pointer; border-radius: 4px;
    margin-top: auto; transition: background-color 0.2s; width: 100%;
}
.btn-mark-ready { margin-top: 8px; padding: 8px 12px; }
.clear-table-btn:hover, .clear-pickup-btn:hover, .btn-mark-ready:hover { background-color: #b8860b; }
.clear-table-btn:disabled, .clear-pickup-btn:disabled, .btn-mark-ready:disabled { background-color: #555; cursor: not-allowed; }

.btn-serve {
    background-color: #006400; color: white; border: none; padding: 10px;
    font-size: 0.9em; font-weight: bold; cursor: pointer; border-radius: 4px;
    width: 100%; margin-top: 5px; box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.btn-serve:hover { background-color: #008000; }

.order-notes {
    font-size: 0.95em; font-weight: bold; color: #e04040; padding: 10px 15px 5px 15px;
    margin: 0; border-top: 1px dashed var(--border-color);
}

/* KDS Popups */
.kitchen-popup-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9); display: flex; justify-content: center;
    align-items: center; z-index: 5000; padding: 20px; box-sizing: border-box;
}
.kitchen-popup-overlay.hidden { display: none; }
.kitchen-popup-box {
    background: var(--card-bg); color: var(--text-main); padding: 30px;
    border-radius: 8px; text-align: center; box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    max-width: 400px; width: 100%; z-index: 5001; margin: 0;
}
.kitchen-popup-box h3 { color: var(--gold); font-size: 1.8em; margin: 0 0 5px 0; }
#kitchen-password, #billing-password, #records-password {
    background-color: var(--bg-dark); color: var(--text-main); border: 1px solid var(--border-color);
    padding: 12px; width: 100%; box-sizing: border-box; border-radius: 4px; margin-top: 15px; margin-bottom: 10px;
}
.kitchen-popup-box button {
    background-color: var(--gold); color: #000; border: none; padding: 12px 30px;
    font-weight: bold; border-radius: 5px; cursor: pointer; width: 100%; margin-top: 15px;
}
.kitchen-popup-box button:hover { background-color: #b8860b; }

#popup-order-details {
    text-align: left; background-color: #f4f4f4; border-radius: 5px;
    padding: 15px; margin: 15px 0; max-height: 300px; overflow-y: auto; color: var(--bg-dark);
}
#popup-order-details h4 { margin: 0 0 10px 0; font-size: 1.4em; border-bottom: 1px solid #ccc; color: var(--bg-dark); }
#popup-order-details ul { padding-left: 20px; margin: 0; }
#popup-order-details li { display: list-item; padding: 0; border: none; }
.popup-notes {
    font-size: 1.1em; font-weight: bold; color: #8B0000; background-color: #fdd;
    padding: 10px; border-radius: 4px; margin-top: 10px;
}

@keyframes newOrderFlash {
    0% { background-color: var(--card-bg); }
    50% { background-color: var(--gold); }
    100% { background-color: var(--card-bg); }
}
.table-box.new-order-flash { animation: newOrderFlash 1s ease-in-out; }

/* Waiter Styles */
.waiter-item {
    display: flex !important; justify-content: space-between !important;
    align-items: center !important; padding: 5px 0 !important;
    border-bottom: 1px dotted var(--border-color) !important;
}
.waiter-item:last-child { border-bottom: none !important; }
.delete-item-btn {
    background-color: #8B0000; color: white; border: none; width: 24px; height: 24px;
    border-radius: 50%; font-size: 1.1em; font-weight: bold; cursor: pointer;
    padding: 0; margin-left: 10px; flex-shrink: 0;
}

#waiter-order-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); z-index: 6000;
    display: flex; justify-content: center; align-items: center;
}
.waiter-popup-content {
    background: var(--card-bg); color: var(--text-main); width: 90%; max-width: 600px;
    max-height: 90vh; border-radius: 8px; display: flex; flex-direction: column;
    padding: 20px; box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.waiter-popup-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--gold); padding-bottom: 10px; margin-bottom: 10px;
}
.waiter-popup-body { flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.menu-search-bar {
    width: 100%; padding: 10px; border-radius: 4px; border: 1px solid #555;
    background: #333; color: white; font-size: 1em; box-sizing: border-box;
}
.menu-selection-list { max-height: 200px; overflow-y: auto; border: 1px solid #444; padding: 5px; }
.menu-selection-item {
    display: flex; justify-content: space-between; padding: 8px; border-bottom: 1px solid #444; cursor: pointer;
}
.menu-selection-item:hover { background-color: #444; }
.current-order-preview { border-top: 1px solid var(--gold); padding-top: 10px; max-height: 150px; overflow-y: auto; }
.preview-item { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 0.9em; }
.waiter-popup-footer { margin-top: 15px; display: flex; gap: 10px; justify-content: flex-end; }
.btn-submit-order { background-color: #006400; color: white; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; font-weight: bold;}
.btn-cancel-order { background-color: #8B0000; color: white; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; font-weight: bold;}
.add-order-btn {
    background-color: var(--gold); color: black; border: none; padding: 5px 10px;
    border-radius: 4px; font-weight: bold; cursor: pointer; margin-left: auto; font-size: 0.8em;
}

/* ===============================================
   BILLING PAGE STYLES
=============================================== 
*/
#billing-content-wrapper {
    display: flex; flex-direction: row; gap: 20px; width: 100%; max-width: 1400px; margin: 0 auto; align-items: flex-start;
}
#table-list-container {
    flex: 0 0 250px; background-color: var(--card-bg); border-radius: 8px; padding: 10px; border: 1px solid var(--border-color);
}
#table-list-container h2 { font-size: 1.3em; margin: 5px 5px 15px 5px; padding-bottom: 10px; }
#table-list { display: flex; flex-direction: column; gap: 10px; }
#table-list p { font-style: italic; color: var(--text-subtle); padding: 0 10px; }
.table-list-btn {
    background-color: #0d163d; color: var(--gold); border: 1px solid var(--border-color);
    padding: 15px; font-size: 1.1em; font-weight: bold; border-radius: 5px;
    cursor: pointer; text-align: left; transition: background-color 0.2s;
}
.table-list-btn:hover { background-color: #333d6b; }
.table-list-btn.selected { background-color: var(--gold); color: #000; }

#bill-view-container {
    flex: 1; background-color: var(--card-bg); border-radius: 8px; padding: 20px; border: 1px solid var(--border-color);
}
#bill-view-container.hidden { display: none; }
.bill-title { font-size: 1.5em; margin-top: 0; }
#bill-item-list { margin: 20px 0; padding: 0; list-style: none; border-top: 1px solid var(--border-color); }
.bill-item {
    display: grid; grid-template-columns: 1fr auto auto; align-items: center;
    gap: 15px; padding: 15px 10px; border-bottom: 1px solid var(--border-color);
}
.bill-item .item-name { font-size: 1.1em; font-weight: 500; }
.bill-item .item-price { font-size: 1.1em; font-weight: bold; min-width: 80px; text-align: right; }
.bill-delete-item {
    background-color: #8B0000; color: white; border: none; width: 28px; height: 28px;
    border-radius: 50%; font-size: 1.2em; font-weight: bold; cursor: pointer; line-height: 28px;
}
.bill-delete-item:hover { background-color: #a10000; }
.bill-delete-item:disabled { background-color: #555; }

.bill-total { font-size: 1.8em; color: var(--gold); text-align: right; margin-top: 20px; }
.billing-hr { border: none; border-top: 1px dashed var(--border-color); margin: 25px 0; }

#add-item-form { display: flex; flex-wrap: wrap; gap: 15px; align-items: flex-end; }
#add-item-form h3 { width: 100%; margin: 0 0 10px 0; font-size: 1.2em; }
.form-row { display: flex; flex-direction: column; flex: 1; }
.form-row-small { flex: 0 0 100px; }
.form-row label { font-size: 0.9em; color: var(--text-subtle); margin-bottom: 5px; }
.form-row input {
    background-color: var(--bg-dark); border: 1px solid var(--border-color);
    color: var(--text-main); padding: 10px; border-radius: 4px; font-size: 1em;
}
#add-item-btn {
    background-color: #006400; color: white; border: none; padding: 10px 20px;
    font-size: 1em; font-weight: bold; border-radius: 5px; cursor: pointer; height: 42px;
}
#add-item-btn:hover { background-color: #008000; }
#close-bill-btn {
    background-color: #8B0000; color: white; width: 100%; padding: 15px;
    font-size: 1.2em; font-weight: bold; border: none; border-radius: 5px; cursor: pointer;
}
#close-bill-btn:hover { background-color: #a10000; }

/* ===============================================
   RECORDS PAGE STYLES
=============================================== 
*/
.records-main { flex-grow: 1; padding: 20px; max-width: 1200px; margin: 0 auto; }
.records-controls {
    display: flex; flex-wrap: wrap; gap: 15px; padding: 20px;
    background-color: var(--card-bg); border-radius: 8px; margin-bottom: 20px; align-items: flex-end;
}
.date-filter { display: flex; flex-direction: column; gap: 5px; }
.date-filter label { font-size: 0.9em; color: var(--text-subtle); }
.date-filter input {
    background-color: var(--bg-dark); border: 1px solid var(--border-color);
    color: var(--text-main); padding: 8px 10px; border-radius: 4px; font-family: inherit;
}
#filter-btn { margin-left: auto; }
.records-controls button { padding: 10px 15px; height: 42px; }

.records-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.summary-box {
    background-color: var(--card-bg); border-radius: 8px; padding: 20px;
    display: flex; flex-direction: column; border-left: 4px solid var(--gold);
}
.summary-title { font-size: 1.1em; color: var(--text-subtle); margin-bottom: 5px; }
.summary-value { font-size: 2em; font-weight: bold; color: var(--text-main); }

.records-results { background-color: var(--card-bg); border-radius: 8px; padding: 20px; }
.record-item { border-bottom: 1px solid var(--border-color); }
.record-item:last-child { border-bottom: none; }
.record-summary {
    display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 15px; padding: 15px 10px;
    cursor: pointer; font-size: 1.1em; transition: background-color 0.2s;
}
.record-summary:hover { background-color: #333; }
.record-date { font-weight: bold; }
.record-table { color: var(--text-subtle); }
.record-total { font-weight: bold; color: var(--gold); text-align: right; }
.record-item-details {
    padding: 15px 20px 20px 40px; background-color: var(--bg-dark); border-top: 1px solid var(--border-color);
}
.record-item-details ul { list-style: disc; padding-left: 20px; }
.record-item-details li { padding: 5px 0; border: none; font-size: 1em; }

@media print {
    body, body.records-body { background-color: #fff !important; color: #000 !important; }
    .kitchen-header, .records-controls, #records-login-overlay, #footer-bar { display: none !important; }
    .records-main { padding: 0; max-width: 100%; color: #000 !important; }
    .records-summary { border-bottom: 2px solid #666; padding-bottom: 15px; }
    .summary-box {
        background-color: #eee !important; color: #000 !important;
        border: 1px solid #ccc !important; border-left: 4px solid #333 !important;
    }
    .summary-title, .summary-value { color: #000 !important; }
    .records-results { background-color: #fff !important; padding: 0; color: #000 !important; }
    .record-item { border: 1px solid #ccc !important; margin-bottom: 10px; page-break-inside: avoid; }
    .record-item details, .record-item details[open] { display: block; }
    .record-summary { background-color: #f0f0f0 !important; color: #000 !important; }
    .record-total { color: #000 !important; }
    .record-table { color: #333 !important; }
    .record-item-details {
        background-color: #fff !important; border-top: 1px solid #ccc !important; color: #000 !important;
    }
    .record-item-details li { color: #000 !important; }
}

@media (max-width: 1200px) {
    .table-grid, .pickup-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .table-grid, .pickup-grid { grid-template-columns: repeat(2, 1fr); }
    #billing-content-wrapper { flex-direction: column; }
    #table-list-container { width: 100%; }
    #add-item-form { flex-direction: column; align-items: stretch; }
    .form-row-small { flex: 1; }
    #add-item-btn { height: auto; }
}
@media (max-width: 500px) {
    .table-grid, .pickup-grid { grid-template-columns: 1fr; }
    .kitchen-header h1 { font-size: 1.0em; }
    .header-logo img { height: 30px; }
}
