:root {
    --primary: #D81B60;
    --primary-light: #FCE4EC;
    --text: #333;
    --sidebar-w: 260px;
    --bg: #f5f7fa;
    --white: #fff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-y: auto;
    overflow-x: hidden;
}

#printable-area {
    display: none;
}

/* --- APP LAYOUT --- */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}
.sidebar {
    width: var(--sidebar-w);
    background: var(--white);
    display: flex;
    flex-direction: column;
    border-right: 1px solid #eee;
    z-index: 100;
    transition: 0.3s ease;

    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: thin;
    scrollbar-color: #D81B60 #f1f1f1;
}

/* LEFT SIDEBAR SCROLLBAR */
.sidebar::-webkit-scrollbar {
    width: 10px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #D81B60;
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #b71552;
}
.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.brand-logo {
    width: 40px;
    height: auto;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    color: var(--primary);
    line-height: 1.2;
}

.close-sidebar-btn {
    display: none;
    margin-left: auto;
    border: none;
    background: none;
    font-size: 1.2rem;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 25px;
    background: none;
    border: none;
    color: #666;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: left;
    transition: 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.nav-item i {
    width: 20px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
}

.sidebar-btn {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    color: #555;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-btn:hover {
    background: #eee;
}

#authBtn {
    border-color: var(--primary);
    color: var(--primary);
}

#adminBtn {
    background: #333;
    color: white;
    border: none;
}

#historyBtn {
    background: #eef2f5;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}
.top-bar{
    background:var(--white);
    padding:15px 25px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:15px;
    box-shadow:0 2px 10px rgba(0,0,0,.02);
}

.menu-toggle {
    display: none;
    border: none;
    background: none;
    font-size: 1.5rem;
    color: var(--text);
}

.search-wrapper{
    background:#f0f2f5;
    border-radius:50px;
    padding:8px 20px;
    display:flex;
    align-items:center;
    flex:1;
    min-width:220px;
    max-width:500px;
}

.search-wrapper input {
    border: none;
    background: transparent;
    outline: none;
    margin-left: 10px;
    width: 100%;
}

.event-btn {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 8px 15px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: 0.2s;
}

.event-btn:hover {
    background: var(--primary-light);
}

.cart-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.badge {
    background: white;
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: bold;
}

.content-scroll {
    flex: 1;
    overflow-y: visible;
    padding: 30px;
}

.food-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding-bottom: 50px;
}

/* Food Card */
.food-card {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: 0.2s;
}

.food-card:hover {
    transform: translateY(-3px);
}

.food-card.selected {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.card-header h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.card-header p {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 15px;
}

.add-btn-initial {
    width: 100%;
    padding: 10px;
    background: var(--white);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}

.food-card.selected .add-btn-initial {
    background: var(--primary);
    color: white;
}

/* Cart Drawer */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100%;
    background: var(--white);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 200;
    transition: 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-drawer.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary);
    color: white;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.preview-btn {
    width: 100%;
    padding: 15px;
    background: var(--text);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
}

/* Nested Cart Items */
.cart-event-block {
    margin-bottom: 20px;
    background: #fafafa;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.cart-category-block {
    margin-top: 10px;
    padding-left: 10px;
    border-left: 2px solid var(--primary-light);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.remove-icon {
    background: none;
    border: none;
    color: #ff4757;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    padding: 25px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Form Elements */
.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.save-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

/* NEW CATEGORY SELECT ELEMENTS */
.cat-sel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #fafafa;
    padding: 8px 15px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.cat-sel-row label {
    margin: 0 !important;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text);
}

.cat-sel-row input[type="number"] {
    width: 100px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
}

.cat-sel-row input[type="number"]:disabled {
    background: #eee;
    cursor: not-allowed;
}

/* Admin & Preview Styles */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-item-row {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.delete-icon {
    color: red;
    cursor: pointer;
    padding: 5px;
}

.history-entry {
    padding: 15px;
    border: 1px solid #ddd;
    margin-bottom: 15px;
    border-radius: 8px;
    background: #fafafa;
}

.preview-event {
    margin-bottom: 20px;
}

.preview-list-item {
    padding: 4px 0;
    font-size: 0.95rem;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.action-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.whatsapp {
    background: #25D366;
}

.print {
    background: #333;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
}

.overlay.open {
    display: block;
}
/* --- EMPTY STATE MESSAGES --- */
.center-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    grid-column: 1 / -1; /* Spans across all grid columns */
    padding: 50px 20px;
    height: 100%;
    min-height: 40vh;
    color: #666;
}

.center-message i {
    font-size: 3.5rem;
    color: #ccc;
    margin-bottom: 15px;
}

.center-message h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--primary);
}
/* ==========================================================
   RESPONSIVE DESIGN
========================================================== */

/* ---------- Large Tablet ---------- */
@media (max-width:1200px){

    .food-grid{
        grid-template-columns:repeat(2,1fr);
    }

    .top-bar{
        flex-wrap:wrap;
        gap:15px;
        padding:15px 20px;
    }

    .search-wrapper{
        width:220px;
    }

    .content-scroll{
        padding:20px;
    }

    .cart-drawer{
    width:min(380px,100%);
}

    .modal-content{
    background:white;
    width:95%;
    max-width:700px;
}
}
/* ---------- Tablet ---------- */
@media (max-width:992px){

    .top-bar{
        flex-wrap:wrap;
    }

    .search-wrapper{
        width:100%;
        order:3;
        margin-top:10px;
    }

    .food-grid{
        grid-template-columns:repeat(2,minmax(220px,1fr));
    }

    .event-btn,
    .cart-btn{
        padding:10px 15px;
    }
}

/* ---------- Mobile ---------- */
@media (max-width:768px){

    .menu-toggle{
        display:block;
    }

    .close-sidebar-btn{
        display:block;
    }

    .sidebar{
        position:fixed;
        top:0;
        left:-100%;
        width:260px;
        height:100vh;
        z-index:1000;
        transition:left .3s;
    }

    .sidebar.active{
        left:0;
    }

    .main-content{
        width:100%;
    }

    .top-bar{
        padding:12px;
        flex-wrap:wrap;
        gap:10px;
    }

    .search-wrapper{
        width:100%;
        order:3;
    }

    .food-grid{
        grid-template-columns:1fr;
        gap:15px;
    }

    .food-card{
        width:100%;
    }

    .cart-drawer{
        width:100%;
        right:-100%;
    }

    .cart-drawer.open{
        right:0;
    }

    .content-scroll{
        padding:15px;
    }

    .modal-content{
        width:95%;
        max-width:none;
        padding:20px;
    }

    .modal-actions{
        flex-direction:column;
    }

    .action-btn{
        width:100%;
    }

    .event-btn,
    .cart-btn{
        flex:1;
        justify-content:center;
    }

    .btn-text{
        display:none;
    }
}

/* ---------- Small Phones ---------- */
@media (max-width:480px){

    .sidebar{
        width:100%;
    }

    .food-grid{
        grid-template-columns:1fr;
    }

    .top-bar{
        padding:10px;
    }

    .event-btn,
    .cart-btn{
        width:100%;
        font-size:14px;
    }

    .search-wrapper{
    width:min(300px,100%);
}

    .content-scroll{
        padding:10px;
    }
}
/* --- PRINT PDF STYLES --- */
@media print {
    @page {
        margin: 0;
        size: A4;
    }

    body {
        margin: 0;
        padding: 0;
        background: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        height: auto;
        overflow: visible;
    }

    .app-container,
    .cart-drawer,
    .modal,
    .overlay {
        display: none !important;
    }

    #printable-area {
        display: block !important;
        width: 100%;
    }

    .print-cover-page {
        width: 100vw;
        height: 100vh;
        position: relative;
        page-break-after: always;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

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

    .print-page {
        padding: 2cm;
        position: relative;
        page-break-after: always;
        min-height: 100vh;
    }

    .print-header {
        text-align: center;
        border-bottom: 2px solid var(--primary);
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .print-brand-info h1 {
        color: var(--primary);
        font-size: 24pt;
        text-transform: uppercase;
        margin: 0;
        letter-spacing: 1px;
    }

    .print-brand-info h2 {
        font-size: 14pt;
        color: #555;
        margin: 5px 0;
        font-weight: 400;
    }

    .print-address {
        font-size: 10pt;
        color: #444;
        margin-top: 5px;
    }

    .print-details-header {
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid #ccc;
        padding-bottom: 10px;
        margin-bottom: 20px;
        font-size: 11pt;
    }

    .print-title {
        font-size: 18pt;
        font-weight: bold;
        text-decoration: underline;
        margin-bottom: 5px;
        text-align: center;
    }

    .print-row {
        padding: 8px 0;
        border-bottom: 1px dotted #ccc;
        font-size: 12pt;
        page-break-inside: avoid;
    }

    .print-footer {
        position: absolute;
        bottom: 2cm;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 10pt;
        font-style: italic;
        color: #666;
        border-top: 1px solid #ddd;
        padding-top: 10px;
    }
}
.sidebar-footer{
    display:flex;
    flex-direction:column;
    gap:10px;
    position:sticky;
    bottom:0;
    background:#fff;
    padding-top:10px;
}
.sortable-items{
    display:flex;
    flex-direction:column;
    gap:6px;
}

.cart-item{
    cursor:grab;
}

.cart-item:active{
    cursor:grabbing;
}

.dragging{
    opacity:.5;
    background:#ffe4ef;
}