* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #2563eb; --primary-dark: #1d4ed8; --success: #16a34a; --danger: #dc2626;
    --warning: #f59e0b; --bg: #f1f5f9; --card: #fff; --text: #1e293b; --muted: #64748b;
    --border: #e2e8f0; --radius: 8px; --shadow: 0 1px 3px rgba(0,0,0,.1);
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 1rem; }
.hidden { display: none !important; }

/* NAVBAR */
.navbar { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; background: var(--card); border-bottom: 1px solid var(--border); margin-bottom: 1rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.nav-brand { font-weight: 700; font-size: 1.1rem; }
.nav-user { margin-right: .5rem; color: var(--muted); font-size: .9rem; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: .25rem; padding: .5rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); cursor: pointer; font-size: .875rem; transition: all .15s; }
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: .25rem .5rem; font-size: .8rem; }
.btn-block { width: 100%; justify-content: center; }

/* HERO */
.hero { text-align: center; padding: 2rem 1rem; }
.hero h1 { font-size: 2.5rem; margin-bottom: .5rem; }
.subtitle { color: var(--muted); font-size: 1.1rem; }

/* CARD */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; border: 1px solid var(--border); }

/* TABS */
.tabs { display: flex; gap: .5rem; padding-bottom: .5rem; }
.tab { padding: .5rem 1rem; border: none; background: none; cursor: pointer; font-size: .9rem; border-radius: var(--radius) var(--radius) 0 0; transition: all .15s; }
.tab.active { background: var(--primary); color: #fff; border-radius: var(--radius); }
.sticky-tabs { position: sticky; top: 0; background: var(--bg); z-index: 10; padding: .5rem 0; border-bottom: 2px solid var(--border); }

/* FORMS */
.form { padding: 1rem 0; }
.form-group { margin-bottom: .75rem; }
.form-group label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .25rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: .5rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .9rem; }
.form-group small { color: var(--muted); font-size: .75rem; }
.error-msg { color: var(--danger); padding: .5rem 0; font-size: .85rem; }
.success-msg { color: var(--success); padding: .5rem 0; font-size: .85rem; }

/* GRID */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }

/* TABLE CARD */
.table-card { text-align: center; }
.table-card h3 { margin-bottom: .5rem; }
.card-actions { display: flex; gap: .5rem; justify-content: center; margin-top: .75rem; }

/* LIST ITEM */
.list-item { display: flex; justify-content: space-between; align-items: center; padding: .75rem; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }

/* BADGE */
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-available { background: #dcfce7; color: #166534; }
.badge-occupied { background: #fef3c7; color: #92400e; }
.badge-waitingpayment { background: #fecaca; color: #991b1b; }
.badge-pending { background: #e0e7ff; color: #3730a3; }
.badge-cooking { background: #ffedd5; color: #9a3412; }
.badge-done { background: #dcfce7; color: #166534; }
.badge-delivered { background: #f0fdf4; color: #14532d; }
.badge-instant { background: #dbeafe; color: #1e40af; }
.badge-off { background: #f1f5f9; color: #64748b; }

/* DASHBOARD LAYOUT */
.dashboard { display: flex; gap: 1rem; }
.sidebar { display: flex; flex-direction: column; gap: .25rem; min-width: 160px; }
.sidebar-btn { text-align: left; padding: .75rem 1rem; border: none; background: none; cursor: pointer; border-radius: var(--radius); font-size: .9rem; }
.sidebar-btn:hover { background: var(--border); }
.sidebar-btn.active { background: var(--primary); color: #fff; }
.main-content { flex: 1; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

/* KITCHEN QUEUE */
.kitchen-stats { display: flex; gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--card); padding: 1rem 1.5rem; border-radius: var(--radius); text-align: center; box-shadow: var(--shadow); }
.stat span { font-size: 2rem; font-weight: 700; display: block; }
.stat small { color: var(--muted); }

.queue-list { display: flex; flex-direction: column; gap: .5rem; }
.queue-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border-left: 4px solid var(--border); }
.queue-item.queue-pending { border-left-color: var(--primary); }
.queue-item.queue-cooking { border-left-color: var(--warning); background: #fffbeb; }
.queue-item.my-item { border-left-color: var(--primary); background: #eff6ff; }
.queue-number { font-size: 1.5rem; font-weight: 700; color: var(--muted); min-width: 50px; text-align: center; }
.queue-info { flex: 1; }
.queue-actions { display: flex; gap: .5rem; }

/* CUSTOMER PAGE */
.customer-page { max-width: 600px; }
.menu-category { margin-bottom: 1.5rem; }
.cat-title { padding: .5rem 0; border-bottom: 2px solid var(--primary); margin-bottom: .75rem; color: var(--primary); }

/* CATEGORY TAGS (customer) */
.cat-tags { display: flex; flex-wrap: wrap; gap: .4rem; padding: .5rem 0; position: sticky; top: 0; background: var(--bg); z-index: 9; border-bottom: 1px solid var(--border); }
.cat-tag { white-space: nowrap; padding: .3rem .7rem; border-radius: 20px; border: 1.5px solid var(--border); background: var(--card); font-size: .8rem; cursor: pointer; transition: all .15s; color: var(--text); }
.cat-tag.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.cat-tag:hover { border-color: var(--primary); }

/* MENU GRID (customer) */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
.menu-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; }
.menu-card-img { width: 100%; aspect-ratio: 1; overflow: hidden; background: #f8fafc; }
.menu-card-img img { width: 100%; height: 100%; object-fit: cover; }
.menu-card-body { padding: .6rem; flex: 1; display: flex; flex-direction: column; }
.menu-card-name { font-weight: 700; font-size: .9rem; margin-bottom: .15rem; }
.menu-card-desc { font-size: .75rem; color: var(--muted); margin-bottom: .25rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menu-card-price { font-weight: 700; color: var(--primary); font-size: .95rem; margin-top: auto; }
.menu-card-actions { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: .5rem; }

/* MENU MANAGE (dashboard) */
.menu-manage-item { display: flex; align-items: center; gap: 1rem; padding: .75rem; border-bottom: 1px solid var(--border); background: var(--card); }
.menu-manage-item:last-child { border-bottom: none; }
.menu-manage-img { width: 60px; height: 60px; min-width: 60px; max-width: 60px; min-height: 60px; max-height: 60px; border-radius: var(--radius); object-fit: cover; background: #f1f5f9; flex-shrink: 0; }
.img-preview { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); background: #f1f5f9; }
.menu-manage-info { flex: 1; }
.menu-manage-actions { display: flex; flex-direction: column; gap: .3rem; flex-shrink: 0; }

/* ORDER DISPLAY */
.order-note { font-size: .85rem; color: var(--muted); font-style: italic; margin-bottom: .5rem; }
.order-item { display: flex; justify-content: space-between; align-items: center; padding: .35rem 0; font-size: .9rem; border-bottom: 1px solid #f1f5f9; }
.order-item:last-child { border-bottom: none; }
.order-item-info { display: flex; gap: .5rem; align-items: center; flex: 1; }
.order-item-name { font-weight: 500; }
.order-item-qty { color: var(--muted); font-size: .85rem; }
.order-item-price { color: var(--primary); font-weight: 600; font-size: .85rem; margin-left: auto; margin-right: .5rem; }
.order-total { text-align: right; padding-top: .5rem; margin-top: .5rem; border-top: 1px solid var(--border); font-size: .95rem; }

.price { font-weight: 700; color: var(--primary); }
.qty { min-width: 20px; text-align: center; font-weight: 600; }
.total { font-size: 1.2rem; text-align: right; margin: .5rem 0; }
.order-card { margin-bottom: .5rem; }
.order-header { display: flex; justify-content: space-between; margin-bottom: .5rem; font-weight: 600; }
.order-actions { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.my-badge { color: var(--primary); font-weight: 600; font-size: .85rem; }

/* MODAL */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-content { min-width: 300px; max-width: 90%; }
.modal-actions { display: flex; gap: .5rem; margin-top: 1rem; }

/* TOAST */
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: .75rem 1.5rem; border-radius: var(--radius); font-size: .9rem; z-index: 1000; box-shadow: 0 4px 12px rgba(0,0,0,.2); }

/* MISC */
.muted { color: var(--muted); }
.center { text-align: center; padding: 2rem; }
.demo-info { text-align: center; margin-top: 1rem; }
.demo-info p { margin: .25rem 0; font-size: .9rem; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .dashboard { flex-direction: column; }
    .sidebar { flex-direction: row; overflow-x: auto; min-width: unset; }
    .sidebar-btn { white-space: nowrap; font-size: .8rem; padding: .5rem .75rem; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .hero h1 { font-size: 1.8rem; }
}
