body{
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #212529;
    overflow-x: hidden;
}
* {
    box-sizing: border-box;
}

.overlayAdmin { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #e9ecef;
    color: #212529;
    margin: 0; 
    padding: 30px; 
}

h1 { 
    text-align: center; 
    color: #a2956b; 
    margin-bottom: 30px;
}
.btn-nav {
    text-decoration: none;
    color: #007bff;
    font-weight: 600;
    font-size: 0.9rem;
}
.btn-nav:hover {
    text-decoration: underline;
}

/* --- Logout Button Style --- */
.btn-logout {
    background-color: #333; /* Dark Grey/Black */
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-logout:hover {
    background-color: #555; /* Lighter Grey on hover */
}
#live-orders-container { 
    display: grid; 
    
    /* 'row' puts items side-by-side (Left to Right) */
    /* This creates the standard Oldest -> Newest reading order */
    display: grid;
    /* Force 4 columns, but allow them to shrink (minmax) */
    grid-template-columns: repeat(4, minmax(0, 1fr)); 
    gap: 15px;
    padding: 15px; /* Reduced padding slightly to fit better */
    width: 100%;
}

/* --- ORDER CARD BASE --- */
.order-card { 
    width:100%;
    background-color: #ffffff; 
    border: 1px solid #dee2e6; 
    border-left: 10px solid #ccc; /* Default color, overridden below */
    border-radius: 8px; 
    padding: 10px; 
    height: auto; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%; 
    overflow: hidden; 
    word-wrap: break-word; 
    min-width: 0; /* Required for Firefox grid nested items */
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* --- HEADER & LAYOUT --- */
.order-header-container {
    display: flex;
    justify-content: space-between; 
    align-items: center; 
    width: 100%;
    border-bottom: 1px solid #dee2e6;

    flex-wrap: wrap; 

}

.order-card h2 { 
    margin: 0; 
    font-size: 1.5rem; 
    display: flex; 
    align-items: center;
    gap: 5px;
}

.order-card p { margin: 8px 0; font-size: 0.95rem; }
.order-card strong { color: #495057; } 

/* --- STATUS BADGES (Unified) --- */
.order-card .status { 
    font-size: 0.8rem; 
    font-weight: bold;
    text-transform: uppercase;
    color: #fff; 
    padding: 6px 12px; 
    border-radius: 4px; 
    background-color: #6c757d; /* Fallback Grey */
    vertical-align: middle;
    white-space: nowrap; /* Prevents "IN PROGRESS" from wrapping */
}

/* --- KITCHEN STATUS LOGIC --- */

/* 1. STATUS: PENDING (New Order) -> RED w/ Pulse */
.order-card[data-status="pending"] {
    border-left-color: #dc3545;
    background-color: #fff5f5; 
    animation: pulse-red 2s infinite;
}
.order-card[data-status="pending"] .status {
    background-color: #dc3545;
}

/* 2. STATUS: PREPARING (Cooking) -> ORANGE */
.order-card[data-status="preparing"] {
    border-left-color: #fd7e14; 
    background-color: #fff9f2;
}
.order-card[data-status="preparing"] .status {
    background-color: #fd7e14;
    color: #fff;
}

/* 3. STATUS: READY (Plated) -> GREEN */
.order-card[data-status="ready"] {
    border-left-color: #28a745;
    background-color: #f0fff4;
}
.order-card[data-status="ready"] .status {
    background-color: #28a745;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* --- ACTION BUTTONS (Touch Friendly) --- */
.action-buttons {
    display: flex;
    gap: 10px; 
    align-items: center;
}

.btn-action {
    padding: 12px 24px; /* Large for fingers */
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: transform 0.1s ease, opacity 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-action:active {
    transform: scale(0.96);
}

.btn-start { background-color: #fd7e14; } /* Orange */
.btn-ready { background-color: #a2956b; } /* Green */
.btn-complete { background-color: #6c757d; } /* Grey */

.btn-cancel-small {
    background: none;
    border: 1px solid #dee2e6;
    color: #dc3545;
    font-size: 1.5rem; /* Larger X */
    width: 44px; /* Larger touch target */
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-cancel-small:hover {
    background-color: #dc3545;
    color: white;
}

/* --- ITEM LIST --- */
.order-items-list { 
    list-style: none; 
    padding-left: 0;
     
}
.order-items-list li:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.06); /* 6% dark overlay */
    border-radius: 4px; /* Optional: rounds the corners of the stripe */
}

/* 2. Add some breathing room so the background color looks good */
.order-items-list li {
    padding: 8px 6px; /* 8px top/bottom, 6px left/right */
    margin-bottom: 2px; /* Tiny gap between items */
    border-top: none; /* Remove the old dashed line if you prefer the solid colors */
    border-bottom: 1px dashed #dee2e6; /* Move separator to bottom if you keep it */
}

/* Remove border from the very last item so it looks clean */
.order-items-list li:last-child {
    border-bottom: none;
}
.order-items-list li:first-child { border-top: none; } 

.item-details { 
    font-weight: bold; 
    margin-bottom: 5px;
}
.item-id-code {
    font-size: 0.8em;
    color: #6c757d;
    margin: 5px 0;
}
.item-customizations { 
    color: #333; /* Darker text for readability */
    font-weight: 500;
    font-size: 0.95em; 
    padding-left: 15px; 
    border-left: 3px solid #ccc; 
    margin-left: 10px;
    margin-top: 5px;
}

/* --- TOTALS SECTION --- */
.totals-container {
    margin-top: 15px; 
    padding-top: 10px; 
    border-top: 1px dashed #ccc; 
}

.total-line {
    display: flex; 
    justify-content: space-between; 
    margin: 5px 0; 
    font-size: 0.95em;
    color: #333;
}

.total-line.total {
    font-size: 1.2em; 
    margin-top: 10px; 
    padding-top: 5px;
    border-top: 1px solid #ddd;
    color: #000;
}
.total-line.total strong {
    font-weight: 700; 
}

/* --- Google Fonts & Global Styles --- */
/* The font import is now in the HTML for better performance */

.main-header-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: #a2956b;
    color: white;
}
.main-header-admin nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.main-header-admin nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.header-buttons {
    display: flex;
    gap: 10px;
}


@media (max-width: 1200px) {
    #live-orders-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablets (Under 900px): Switch to 2 per row (50%) */
@media (max-width: 900px) {
    #live-orders-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Phones (Under 600px): Switch to 1 per row (100%) */
@media (max-width: 600px) {
    #live-orders-container {
        grid-template-columns: 1fr; 
    }
}

.payment-status-strip {
    text-align: center;
    padding: 8px 10px;
    margin-top:10px;
    margin-bottom: 15px; /* Push customer details down slightly */
    border-radius: 6px;
    font-weight: 800; /* Extra bold */
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Space between icon and text */
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

/* PAID: Subtle, clean green. Says "Good to go" */
.payment-status-strip.paid {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

/* UNPAID: Urgent red. Says "STOP! Collect Money" */
.payment-status-strip.unpaid {
    background-color: #ffcccc; /* Light red background */
    color: #cc0000; /* Dark red text */
    border: 2px solid #cc0000; /* Thick red border */
    animation: pulse-border 2s infinite; /* Subtle pulse to catch eye */
}

/* Optional: Subtle pulse animation for unpaid items */
@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(204, 0, 0, 0.2); }
    70% { box-shadow: 0 0 0 6px rgba(204, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(204, 0, 0, 0); }
}


.card-success {
    border-color: #28a745 !important;
    background-color: #d4edda !important;
    transform: scale(1.02);
    transition: all 0.2s ease;
    pointer-events: none; /* Prevent double clicking */
}

/* State 2: Fade Out & Shrink */
.card-removing {
    opacity: 0;
    transform: scale(0.5) translateY(50px); /* Shrink and drop down */
    max-height: 0; /* Collapse space so grid rearranges */
    margin: 0;
    padding: 0;
    overflow: hidden;
    transition: all 0.5s ease-in-out;
}


































.update-cache-btn {
    background-color: #ff6b35;
    color: white;
    margin:0;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;

    transition: background-color 0.3s ease;
}

.update-cache-btn:hover {
    background-color: #e55a2b;
}

.update-cache-btn:active {
    transform: scale(0.98);
}


:root {
    --gold: #a2956b;
    --dark-bg: #0f0f0f;
    --card-bg: #141414;
    --light-text: #f4f4f4;
    --subtle-border: #333;
}

/* --- GLOBAL & LAYOUT --- */
.overlayLogin {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: var(--dark-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    position: relative;
    z-index: 0;
    overflow: hidden;
}

/* A very faint texture in the background */
.overlayLogin::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23a2956b" fill-opacity="0.03"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
    z-index: -1;
    pointer-events: none;
}

/* --- THE CARD (Elegant & Solid) --- */
.login-container {
    position: relative;
    z-index: 2;
    
    width: 100%;
    max-width: 380px; /* Slightly narrower for elegance */
    padding: 4rem 3rem;
    
    background-color: var(--card-bg);
    
    /* Sharp, thin gold border */
    border: 1px solid var(--gold); 
    border-radius: 2px; /* Very slight radius, almost square */
    
    /* sophisticated drop shadow, not glowing */
    box-shadow: 0 30px 60px rgba(0,0,0,0.8); 
}

/* --- TYPOGRAPHY --- */
.login-form h2 {
    color: var(--gold);
    font-family: "Great Vibes", cursive;
    font-weight: 400;
    font-size: 3.8rem;
    text-align: center;
    margin-bottom: 3rem;
    line-height: 1;
    /* No shadow, just crisp text */
}

/* --- INPUTS --- */
.input-group {
    position: relative;
    margin-bottom: 2.5rem;
}

.input-group input {
    width: 100%;
    padding: 12px 0;
    font-size: 1rem;
    color: var(--light-text);
    background-color: transparent;
    border: none;
    
    /* Very subtle grey line initially */
    border-bottom: 1px solid var(--subtle-border);
    
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.4s ease;
    letter-spacing: 1px; /* Increases readability */
}

/* Label styling - Clean sans-serif */
.input-group label {
    position: absolute;
    top: 12px;
    left: 0;
    font-size: 0.85rem;
    text-transform: uppercase; /* Adds structure */
    letter-spacing: 2px;
    color: rgba(244, 244, 244, 0.4);
    pointer-events: none;
    transition: 0.3s ease all;
}

/* Focus State */
.input-group input:focus ~ label,
.input-group input:valid ~ label {
    top: -15px;
    font-size: 0.7rem;
    color: var(--gold);
}

.input-group input:focus {
    /* Solid gold line, no glow */
    border-bottom: 1px solid var(--gold);
}

/* Autofill fix */
.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover, 
.input-group input:-webkit-autofill:focus, 
.input-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--card-bg) inset !important;
    -webkit-text-fill-color: var(--light-text) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* --- BUTTON (Gold Leaf Style) --- */
button {
    width: 100%;
    padding: 16px;
    margin-top: 1.5rem;
    
    background-color: var(--gold);
    color: #111; /* Dark text on gold background */
    border: 1px solid var(--gold);
    
    border-radius: 2px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    /* Invert style on hover */
    background-color: transparent;
    color: var(--gold);
}

/* --- LINKS --- */
.bottom-text {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(244, 244, 244, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bottom-text a {
    color: var(--light-text);
    text-decoration: none;
    font-weight: 500;
    margin-left: 5px;
    transition: color 0.3s;
}

.bottom-text a:hover {
    color: var(--gold);
}






.history-card h3 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
}




#history-orders-container {
    display: grid;
    /* Force 4 columns, but allow them to shrink (minmax) */
    grid-template-columns: repeat(4, minmax(0, 1fr)); 
    gap: 15px;
    padding: 15px; /* Reduced padding slightly to fit better */
    width: 100%;
}

.history-card {
    background-color: #f9f9f9;
    border-left: 5px solid #888;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 15px;
    opacity: 0.95; 
    
    display: flex;
    flex-direction: column;
    height: 100%; 

    /* IMPORTANT: Handle text overflow */
    overflow: hidden; 
    word-wrap: break-word; 
    min-width: 0; /* Required for Firefox grid nested items */
}
/* ... (Keep your other styles for headers, buttons, details, etc.) ... */


/* --- RESPONSIVE: BREAKPOINTS --- */
/* Even though you want 25%, that is too small for tablets/phones. 
   These rules override the 25% logic on smaller screens. */

/* Laptops / Small Desktops (Under 1200px): Switch to 3 per row (33%) */
@media (max-width: 1200px) {
    #history-orders-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablets (Under 900px): Switch to 2 per row (50%) */
@media (max-width: 900px) {
    #history-orders-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Phones (Under 600px): Switch to 1 per row (100%) */
@media (max-width: 600px) {
    #history-orders-container {
        grid-template-columns: 1fr; 
    }
}

/* History Stats Dashboard */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
}

.stat-card h4 {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.main-stat .stat-value {
    color: #27ae60; /* Green for revenue */
    font-size: 1.8rem;
}

.stat-sub {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #888;
}

.breakdown-card {
    text-align: left;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.breakdown-row:last-child {
    border-bottom: none;
}





.controls-container {
    background-color: #ffffff;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: bold;
    color: #333;
}

.control-group input[type="date"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.secondary-btn {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 9px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.secondary-btn:hover {
    background-color: #555;
}

.status-label {
    margin-left: auto; /* Pushes label to far right */
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
}


.sound-toggle-btn {
    position: absolute;
    
    right: 20px;
    z-index: 9999;
    background-color: #f44336;
    color: white;
    border: none;
    top:60px;
    border-radius: 8px;
    padding: 0, 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;

    transition: all 0.3s ease;
    width: 20%;
}

.sound-toggle-btn:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.sound-toggle-btn:active {
    transform: translateY(0);
}

.sound-toggle-btn.enabled {
    background-color: #4CAF50;
}

.sound-toggle-btn.enabled:hover {
    background-color: #45a049;
}

.sound-icon {
    font-size: 20px;
    line-height: 1;
}

.sound-text {
    font-size: 14px;
}

/* Optional: Pulse animation when disabled */
.sound-toggle-btn:not(.enabled) {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}




        .loading-text {
            text-align: center;
            font-size: 1.2rem;
            color: #666;
            margin-top: 50px;
        }

        /* Container for the menu list */
        .inventory-container {
            max-width: 800px;
            margin: 0 auto;
            background: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        /* Category Headers */
        .category-header {
            background-color: #333;
            color: white;
            padding: 10px 15px;
            margin-top: 20px;
            border-radius: 5px;
            font-size: 1.1rem;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        /* List Items */
        .item-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 10px;
            border-bottom: 1px solid #eee;
        }
        
        .item-row:last-child { border-bottom: none; }

        .item-info {
            display: flex;
            flex-direction: column;
        }
        
        .item-name {
            font-weight: bold;
            font-size: 1rem;
            color: #333;
        }
        
        .item-id {
            font-size: 0.85rem;
            color: #888;
            margin-top: 2px;
        }

        /* --- TOGGLE SWITCH CSS --- */
        .switch {
            position: relative;
            display: inline-block;
            width: 52px;
            height: 28px;
            flex-shrink: 0; /* Prevents squishing on small screens */
        }

        .switch input { 
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0; left: 0; right: 0; bottom: 0;
            background-color: #ccc; /* GREY = SOLD OUT */
            -webkit-transition: .4s;
            transition: .4s;
            border-radius: 34px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 20px;
            width: 20px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            -webkit-transition: .4s;
            transition: .4s;
            border-radius: 50%;
        }

        /* When Checked (Available) -> Turn Blue */
        input:checked + .slider {
            background-color: #2196F3;
        }

        input:focus + .slider {
            box-shadow: 0 0 1px #2196F3;
        }

        input:checked + .slider:before {
            -webkit-transform: translateX(24px);
            -ms-transform: translateX(24px);
            transform: translateX(24px);
        }
        
        /* Optional: Add text labels next to switch */
        .status-label {
            font-size: 0.8rem;
            font-weight: bold;
            margin-right: 10px;
            text-align: right;
            width: 80px;
        }
        .status-label.available { color: #2196F3; }
        .status-label.soldout { color: #999; }


 .incoming-order-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #06C167; /* Uber Eats Green Base */
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    /* Speed set to 1s for a distinct rhythmic flash */
    animation: flashGreen 1s infinite; 
}

.incoming-order-overlay h1 {
    font-size: 4rem;
    color: white; /* White text looks cleaner on Green */
    font-weight: 900;
    margin: 0;
    text-transform: uppercase;
    /* Dark drop shadow for readability against the bright green */
    text-shadow: 0px 4px 10px rgba(0,0,0,0.3);
}

.incoming-order-overlay p {
    font-size: 2rem;
    color: white;
    font-weight: bold;
    margin-top: 20px;
    animation: blinkText 1s infinite;
}

/* Flashes between Uber Green and a brighter Neon Green */
@keyframes flashGreen {
    0% { background-color: #06C167; }
    50% { background-color: #00FF80; } /* Brighter/Neon flash */
    100% { background-color: #06C167; }
}

@keyframes blinkText {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}