/* ============================================================
   QUICKBITE – GLOBAL STYLES
   Colors: Blue #1565C0 | Red #C62828 | Yellow #F9A825 | Green #2E7D32
   ============================================================ */

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

:root {
  --blue:    #1565C0;
  --blue-lt: #E3F2FD;
  --blue-dk: #0D47A1;
  --red:     #C62828;
  --red-lt:  #FFEBEE;
  --yellow:  #F9A825;
  --yellow-lt:#FFF8E1;
  --green:   #2E7D32;
  --green-lt:#E8F5E9;
  --text:    #1A1A2E;
  --sub:     #555;
  --muted:   #888;
  --bg:      #F4F6FA;
  --white:   #FFFFFF;
  --border:  #E0E0E0;
  --shadow:  0 2px 12px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.12);
  --radius:  12px;
  --radius-sm: 8px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
input, textarea, select, button { font-family: inherit; }
img { max-width: 100%; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* ── Notification Bar ── */
.notif-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  padding: 12px 20px; text-align: center; font-weight: 600;
  background: var(--green); color: #fff; font-size: 14px;
  animation: slideDown .3s ease;
}
.notif-bar.error { background: var(--red); }
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* ── Header ── */
.header {
  background: var(--blue); color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { font-size: 32px; }
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.brand-tagline { font-size: 12px; opacity: .8; }
.header-actions { display: flex; gap: 10px; align-items: center; }

.btn-nav {
  background: rgba(255,255,255,.15); color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  padding: 8px 14px; border-radius: 20px; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: background .2s;
}
.btn-nav:hover { background: rgba(255,255,255,.25); }

.btn-cart {
  background: var(--yellow); color: var(--text);
  border: none; padding: 8px 16px; border-radius: 20px;
  cursor: pointer; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
  transition: transform .15s, box-shadow .15s;
}
.btn-cart:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.cart-badge {
  background: var(--red); color: #fff; border-radius: 50%;
  width: 20px; height: 20px; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── Banner ── */
.banner-section { padding: 10px 0; }
.banner-slider { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.banner-slider::-webkit-scrollbar { display: none; }
.banner-card {
  flex-shrink: 0; padding: 12px 20px; border-radius: var(--radius-sm);
  color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap;
}

/* ── Promo Bar ── */
.promo-bar { padding: 8px 0; }
.promo-tags-row { display: flex; gap: 8px; flex-wrap: wrap; }
.promo-tag {
  padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.promo-tag.red { background: var(--red-lt); color: var(--red); }
.promo-tag.blue { background: var(--blue-lt); color: var(--blue); }
.promo-tag.green { background: var(--green-lt); color: var(--green); }
.promo-tag.yellow { background: var(--yellow-lt); color: #8B6914; }

/* ── Main Content ── */
.main-content { padding: 32px 0 60px; }
.section-title { margin-bottom: 24px; }
.section-title h2 { font-size: 26px; font-weight: 800; color: var(--text); }
.section-title p { color: var(--muted); margin-top: 4px; font-size: 14px; }

/* ── Category Tabs ── */
.category-tabs {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.cat-tab {
  padding: 8px 18px; border-radius: 24px;
  border: 2px solid var(--border); background: var(--white);
  cursor: pointer; font-weight: 600; font-size: 13px; color: var(--sub);
  transition: all .2s; white-space: nowrap;
}
.cat-tab:hover { border-color: var(--blue); color: var(--blue); }
.cat-tab.active {
  background: var(--blue); color: #fff; border-color: var(--blue);
}

/* ── Menu Grid ── */
.menu-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 48px;
}
.menu-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
  transition: transform .2s, box-shadow .2s; cursor: default;
  display: flex; flex-direction: column; position: relative;
}
.menu-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.menu-card.unavailable { opacity: .55; }
.unavail-badge {
  position: absolute; top: 12px; right: 12px;
  background: var(--red-lt); color: var(--red);
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 12px;
}
.menu-card-emoji { font-size: 28px; margin-bottom: 10px; }
.menu-card-name { font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.menu-card-desc { font-size: 12px; color: var(--muted); margin-bottom: 12px; flex: 1; }
.menu-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.menu-price { font-size: 18px; font-weight: 800; color: var(--blue); }
.menu-price span { font-size: 11px; font-weight: 500; color: var(--muted); }

.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--blue); background: var(--white);
  color: var(--blue); font-size: 16px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.qty-btn:hover { background: var(--blue); color: #fff; }
.qty-val { font-weight: 700; font-size: 15px; min-width: 20px; text-align: center; }
.btn-add {
  background: var(--blue); color: #fff;
  border: none; padding: 7px 14px; border-radius: 20px;
  cursor: pointer; font-size: 13px; font-weight: 600;
  transition: background .2s;
}
.btn-add:hover { background: var(--blue-dk); }

/* ── Cart Sidebar ── */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 200;
}
.cart-sidebar {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 360px; max-width: 95vw;
  background: var(--white); z-index: 201;
  display: flex; flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.cart-header {
  padding: 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.cart-header h3 { font-size: 18px; font-weight: 800; }
.icon-btn {
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--sub); padding: 4px; border-radius: 6px;
  transition: background .15s;
}
.icon-btn:hover { background: var(--bg); }
.cart-items { flex: 1; overflow-y: auto; padding: 16px; }
.cart-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px; border-radius: var(--radius-sm);
  margin-bottom: 8px; background: var(--bg);
}
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 14px; }
.cart-item-cat { font-size: 11px; color: var(--muted); }
.cart-item-price { font-weight: 700; color: var(--blue); font-size: 14px; }
.cart-item-controls { display: flex; align-items: center; gap: 6px; }
.cart-item-remove { background: none; border: none; color: var(--red); cursor: pointer; font-size: 18px; }
.cart-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex: 1; padding: 40px;
  color: var(--muted); gap: 12px;
}
.cart-empty-icon { font-size: 48px; }
.cart-footer {
  padding: 20px; border-top: 1px solid var(--border);
}
.cart-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.cart-row.grand { font-size: 18px; font-weight: 800; color: var(--text); }

/* ── Buttons ── */
.btn-primary {
  background: var(--blue); color: #fff;
  border: none; padding: 12px 24px; border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 700; font-size: 15px;
  transition: background .2s, transform .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-primary:hover { background: var(--blue-dk); transform: translateY(-1px); }
.btn-primary.sm { padding: 8px 16px; font-size: 13px; border-radius: 6px; }
.btn-primary.full { width: 100%; }

.btn-danger {
  background: var(--red); color: #fff;
  border: none; padding: 6px 12px; border-radius: 6px;
  cursor: pointer; font-size: 12px; font-weight: 600;
}
.btn-success {
  background: var(--green); color: #fff;
  border: none; padding: 6px 12px; border-radius: 6px;
  cursor: pointer; font-size: 12px; font-weight: 600;
}
.btn-warning {
  background: var(--yellow); color: var(--text);
  border: none; padding: 6px 12px; border-radius: 6px;
  cursor: pointer; font-size: 12px; font-weight: 700;
}
.btn-outline {
  background: transparent; color: var(--blue);
  border: 2px solid var(--blue); padding: 6px 12px;
  border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600;
}
.btn-outline:hover { background: var(--blue-lt); }

/* ── Modals ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 300; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--white); border-radius: var(--radius);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-md);
  animation: popIn .25s ease;
}
.modal.modal-sm { max-width: 400px; }
@keyframes popIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--blue-lt);
}
.modal-header h3 { font-size: 17px; font-weight: 800; color: var(--blue); }
.success-header { background: var(--green-lt); }
.success-header h3 { color: var(--green); }
.modal-body { padding: 24px; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--sub); margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 10px 14px; border: 2px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text);
  background: var(--white); transition: border-color .2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none; border-color: var(--blue);
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 24px; transition: .3s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: .3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.order-summary-block {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 20px;
}
.sum-item { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }
.sum-item.total-line { font-weight: 700; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.order-total-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--blue-lt); padding: 14px 16px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-weight: 700;
}
.total-highlight { font-size: 22px; font-weight: 800; color: var(--blue); }

/* ── Order Status Board ── */
.order-board { display: flex; flex-direction: column; gap: 12px; margin-bottom: 48px; }
.no-orders { text-align: center; color: var(--muted); padding: 40px; }
.order-status-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 22px;
  display: flex; align-items: center; gap: 16px;
  border-left: 5px solid var(--border);
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.order-status-card.preparing { border-color: var(--yellow); }
.order-status-card.ready { border-color: var(--green); }
.order-status-card.delivered { border-color: var(--blue); opacity: .7; }
.order-num { font-size: 13px; font-weight: 700; color: var(--muted); }
.order-name { font-weight: 700; font-size: 16px; }
.order-items-summary { font-size: 12px; color: var(--sub); margin-top: 2px; }
.status-pill {
  margin-left: auto; padding: 6px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.status-pill.pending { background: #EEE; color: var(--sub); }
.status-pill.confirmed { background: var(--blue-lt); color: var(--blue); }
.status-pill.preparing { background: var(--yellow-lt); color: #8B6914; }
.status-pill.ready { background: var(--green-lt); color: var(--green); }
.status-pill.delivered { background: var(--blue-lt); color: var(--blue); }

/* ── Confirm Modal ── */
.confirm-order-num {
  font-size: 36px; font-weight: 900; color: var(--green);
  letter-spacing: 2px; margin: 16px 0 8px;
}
.text-center { text-align: center; }
.tip-note { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ── Footer ── */
.footer { background: var(--text); color: #aaa; padding: 24px 0; font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
.admin-link { color: var(--yellow); font-weight: 600; }
.admin-link:hover { color: #fff; }

/* ============================
   ADMIN PANEL STYLES
   ============================ */

.admin-body { background: #F0F2F5; }

/* Login */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--white); border-radius: var(--radius);
  padding: 40px; width: 100%; max-width: 380px;
  box-shadow: var(--shadow-md); text-align: center;
}
.login-logo { font-size: 48px; margin-bottom: 12px; }
.login-card h2 { font-size: 24px; font-weight: 800; color: var(--text); }
.login-sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.login-error {
  background: var(--red-lt); color: var(--red);
  padding: 10px; border-radius: 6px; font-size: 13px;
  margin-bottom: 12px;
}
.back-link { display: block; margin-top: 20px; color: var(--blue); font-size: 13px; font-weight: 600; }
.back-link:hover { text-decoration: underline; }

/* Admin layout */
.admin-panel { min-height: 100vh; display: flex; flex-direction: column; }
.admin-topbar {
  background: var(--blue); color: #fff;
  padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.admin-brand { font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.admin-topbar-right { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.admin-user { opacity: .85; }
.btn-logout {
  background: rgba(255,255,255,.15); color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.btn-logout:hover { background: rgba(255,255,255,.25); }
.btn-outline-sm {
  background: var(--yellow); color: var(--text);
  padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 700;
}
.new-order-badge {
  background: var(--red); color: #fff;
  padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }

.admin-layout { display: flex; flex: 1; overflow: hidden; }

.admin-sidebar {
  width: 220px; background: var(--white); border-right: 1px solid var(--border);
  padding: 20px 0; flex-shrink: 0;
  overflow-y: auto;
}
.sidebar-nav { }
.nav-item {
  padding: 12px 20px; cursor: pointer; font-size: 14px; font-weight: 600;
  color: var(--sub); display: flex; align-items: center; gap: 10px;
  border-left: 3px solid transparent; transition: all .15s;
}
.nav-item:hover { background: var(--bg); color: var(--blue); }
.nav-item.active { background: var(--blue-lt); color: var(--blue); border-left-color: var(--blue); }
.nav-icon { font-size: 16px; }
.badge-count {
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px; margin-left: auto;
}

.admin-content { flex: 1; padding: 28px; overflow-y: auto; }
.admin-section { }
.sec-title { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 24px; }
.sec-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.sec-header-row .sec-title { margin-bottom: 0; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card {
  border-radius: var(--radius); padding: 20px; text-align: center;
  box-shadow: var(--shadow);
}
.stat-card.blue { background: var(--blue); color: #fff; }
.stat-card.red { background: var(--red); color: #fff; }
.stat-card.yellow { background: var(--yellow); color: var(--text); }
.stat-card.green { background: var(--green); color: #fff; }
.stat-num { font-size: 36px; font-weight: 900; }
.stat-label { font-size: 13px; opacity: .85; font-weight: 600; margin-top: 4px; }

/* Admin Card */
.admin-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
}
.admin-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.card-header-row {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.card-header-row h3 { margin-bottom: 0; }
.row-group { display: flex; gap: 8px; align-items: center; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 10px 12px; font-weight: 700;
  background: var(--bg); color: var(--sub); border-bottom: 2px solid var(--border);
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }

/* Order rows */
.order-row-card {
  background: var(--white); border-radius: var(--radius-sm);
  border: 1px solid var(--border); padding: 16px 20px;
  margin-bottom: 12px; box-shadow: var(--shadow);
}
.order-row-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.order-id { font-weight: 800; color: var(--blue); font-size: 15px; }
.order-customer { font-weight: 600; font-size: 14px; }
.order-time { font-size: 11px; color: var(--muted); margin-left: auto; }
.order-row-body { font-size: 13px; color: var(--sub); }
.order-row-footer { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }

/* Cat list */
.cat-list { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 8px 14px; font-size: 13px; font-weight: 600;
}
.cat-chip button { background: none; border: none; color: var(--red); cursor: pointer; font-size: 14px; padding: 0 0 0 4px; }

/* Banners + promos */
.banner-list-item, .promo-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 8px;
}

/* Users */
.user-table-wrap { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

/* Recent orders */
.recent-orders-wrap h3 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }

/* Filter */
.filter-row select {
  padding: 8px 12px; border: 2px solid var(--border);
  border-radius: 8px; font-size: 13px; background: var(--white);
  cursor: pointer;
}
.filter-row select:focus { outline: none; border-color: var(--blue); }

/* Order detail */
.detail-section { margin-bottom: 16px; }
.detail-section h4 { font-weight: 700; margin-bottom: 8px; color: var(--text); }
.detail-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }

/* WA / Email notify buttons */
.btn-wa {
  background: #25D366; color: #fff;
  border: none; padding: 8px 14px; border-radius: 6px;
  cursor: pointer; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-email {
  background: var(--red); color: #fff;
  border: none; padding: 8px 14px; border-radius: 6px;
  cursor: pointer; font-size: 13px; font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-sidebar { width: 60px; }
  .nav-item span:not(.nav-icon):not(.badge-count) { display: none; }
  .nav-item { justify-content: center; padding: 14px 0; }
}
@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .brand-name { font-size: 18px; }
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .cart-sidebar { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .admin-topbar-right span.admin-user { display: none; }
}
