:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f7f8fc;
  color: #1c1f2b;
  font-size: 16px;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(49, 102, 255, 0.12), transparent 35%),
    radial-gradient(circle at bottom right, rgba(80, 192, 255, 0.08), transparent 30%),
    #f7f8fc;
}
button { font: inherit; }
a { color: inherit; }
.app-shell { max-width: 1440px; margin: 0 auto; padding: 24px 20px 40px; }
.topbar, .section-header, .cart-header, .hero-actions { display: flex; align-items: center; justify-content: space-between; }
.topbar { gap: 1rem; flex-wrap: wrap; margin-bottom: 24px; }
.eyebrow, .section-label { text-transform: uppercase; letter-spacing: 0.18em; color: #6b7280; font-size: 0.8rem; margin: 0 0 8px; }
h1, h2, h3, h4 { margin: 0; }
h1 { font-size: clamp(2rem, 2.4vw, 3rem); }
h2 { font-size: clamp(1.75rem, 2.2vw, 2.5rem); }
h3 { font-size: 1.35rem; }
.primary-button, .secondary-button, .tab-button, .menu-card-button {
  border: none; border-radius: 999px; cursor: pointer; padding: 0.95rem 1.4rem;
  font-weight: 700; transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.primary-button { background: linear-gradient(135deg, #2f6dfa, #1b9dff); color: white; }
.primary-button:hover, .secondary-button:hover, .tab-button:hover, .menu-card-button:hover { transform: translateY(-1px); }
.secondary-button, .tab-button { background: #ffffff; color: #1c1f2b; border: 1px solid rgba(28, 31, 43, 0.08); }
.tab-button { padding: 0.75rem 1rem; border-radius: 999px; min-width: 100px; }
.tab-button.active { background: #1b9dff; border-color: transparent; color: white; }
.hero-panel { display: grid; grid-template-columns: 1.2fr 0.9fr; gap: 24px; align-items: center; margin-bottom: 32px; padding: 30px; border-radius: 32px; background: rgba(255, 255, 255, 0.82); box-shadow: 0 28px 80px rgba(37, 84, 191, 0.08); }
.hero-text { max-width: 680px; }
.hero-text p { font-size: 1rem; color: #52555f; margin: 1rem 0 0; }
.badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.95rem; border-radius: 999px; background: rgba(47, 109, 250, 0.1); color: #234dff; font-weight: 600; margin-bottom: 1rem; }
.hero-image { min-height: 300px; background-image: url('https://images.unsplash.com/photo-1546069901-ba9599a7e63c?auto=format&fit=crop&w=900&q=80'); background-size: cover; background-position: center; border-radius: 28px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); }
.page-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr); gap: 24px; }
.menu-section {
  background: white;
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
  margin-top: 5px;
}
.payment-requests-section {
  margin-top: 5px;
}
.cart-panel { position: sticky; top: 24px; align-self: start; }
.menu-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 24px; }
.menu-card { display: grid; grid-template-rows: auto 1fr; background: #ffffff; border-radius: 24px; overflow: hidden; box-shadow: 0 16px 40px rgba(23, 43, 77, 0.08); }
.menu-card-image { min-height: 210px; background-size: cover; background-position: center; }
.menu-card-body { padding: 24px; display: grid; gap: 14px; }
.menu-card-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.menu-card-category { color: #6d7496; font-size: 0.9rem; }
.menu-card-price { color: #0b1c3b; font-weight: 800; }
.menu-card-description { color: #5d657f; }
.menu-card-button { width: fit-content; background: #2f6dfa; color: white; }
.cart-shell { background: white; border-radius: 28px; padding: 24px; box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06); }
.cart-item { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid rgba(15, 23, 42, 0.06); }
.cart-item:last-child { border-bottom: none; }
.cart-item-actions { display: inline-flex; align-items: center; gap: 8px; }
.cart-item-actions button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(28, 31, 43, 0.12); background: white; cursor: pointer; }
.cart-footer { margin-top: 24px; display: grid; gap: 18px; }
.cart-total { display: flex; justify-content: space-between; align-items: center; font-size: 1rem; }
.cart-empty, .status-message { font-size: 0.98rem; color: #52555f; padding: 12px 24px; }
.status-error { color: #c92c26; }
.orders-board { display: flex; flex-direction: column; gap: 20px; margin-top: 20px; }
.qr-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding: 16px 18px; border-radius: 18px; background: #f8fafc; border: 1px solid rgba(15, 23, 42, 0.06); }
.qr-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.qr-status { margin: 10px 0 0; color: #4b5563; }
.qr-section { margin-top: 24px; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-top: 16px; }
.qr-card { background: white; border-radius: 20px; padding: 16px; box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04); text-align: center; }
.qr-card img { width: 100%; max-width: 160px; border-radius: 12px; background: #fff; }
.qr-card p { margin: 10px 0 4px; font-weight: 700; }
.qr-card small { display: block; color: #6b7280; word-break: break-all; }
.payment-method-option.active {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  color: white !important;
  border-color: #059669 !important;
  box-shadow: 0 8px 16px rgba(5, 150, 105, 0.16);
}
.payment-method-option:hover {
  transform: translateY(-1px);
}
.orders-column { background: #f8fafc; border: 1px solid rgba(15, 23, 42, 0.06); border-radius: 24px; padding: 18px; min-height: 320px; }
.orders-column-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.orders-count { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; border-radius: 999px; background: #dbeafe; color: #1d4ed8; font-weight: 700; }
.completed-count { background: #dcfce7; color: #166534; }
.orders-list { display: grid; gap: 12px; }
.order-card { background: white; border: 1px solid rgba(15, 23, 42, 0.08); border-radius: 18px; padding: 16px; box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04); }
.order-card-completed { border-color: rgba(34, 197, 94, 0.2); background: linear-gradient(135deg, rgba(240, 253, 244, 0.95), rgba(255, 255, 255, 1)); }
.order-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.order-meta { color: #6b7280; font-size: 0.92rem; margin-top: 4px; }
.order-badge { padding: 0.35rem 0.7rem; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 0.8rem; font-weight: 700; }
.order-badge-completed { background: #dcfce7; color: #166534; }
.order-card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.status-select { padding: 0.65rem 0.8rem; border-radius: 999px; border: 1px solid rgba(15, 23, 42, 0.12); background: white; }
.order-items ul { padding-left: 1.1rem; margin: 0; color: #374151; }
.order-items li { margin-bottom: 6px; }
.order-total { text-align: right; font-weight: 700; margin-top: 8px; }

/* ============================================================
   ITEM-LEVEL ROW CARDS (optimized for orders.js)
   Fixed-width columns for perfect alignment
   ============================================================ */
.item-row-card {
  background: white;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  gap: 10px;
}
.item-row-done {
  opacity: 0.55;
  background: #f9fafb;
}
.item-row-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.item-row-note {
  font-size: 0.72rem;
  color: #d97706;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-row-recipe-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px 4px;
  border-radius: 6px;
  transition: background 0.2s ease, transform 0.2s ease;
  opacity: 0.75;
  line-height: 1;
  flex-shrink: 0;
}
.item-row-recipe-btn:hover {
  background: #f3f4f6;
  opacity: 1;
  transform: scale(1.15);
}
.recipe-modal-content {
  border-radius: 24px !important;
  max-width: 620px !important;
}
.recipe-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: #6b7280;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
  line-height: 1;
}
.recipe-close-btn:hover {
  background: #f3f4f6;
  color: #1c1f2b;
}
.recipe-content pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #1c1f2b;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
  padding: 16px;
  margin: 0;
}
.recipe-empty {
  color: #6b7280;
  font-size: 0.95rem;
  text-align: center;
  padding: 32px 16px;
  margin: 0;
}
.item-row-note-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.2s ease;
  opacity: 0.7;
}
.item-row-note-btn:hover {
  background: #f3f4f6;
  opacity: 1;
}
.item-row-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: #1c1f2b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 180px;
  min-width: 180px;
}
.item-row-name-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.item-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.item-row-cell {
  text-align: right;
}
.item-row-qty {
  font-weight: 700;
  font-size: 0.88rem;
  color: #374151;
  width: 40px;
  min-width: 40px;
  text-align: right;
}
.item-row-table {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 600;
  width: 70px;
  min-width: 70px;
  white-space: nowrap;
  text-align: right;
}
.item-row-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  width: 100px;
  min-width: 100px;
  text-align: right;
}
.item-status-select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  font-size: 0.78rem;
  background: white;
  width: 100px;
  min-width: 100px;
  cursor: pointer;
  text-align: right;
  direction: rtl;
}
.item-status-select:hover {
  border-color: #2f6dfa;
}
@media (max-width: 1080px) {
  .hero-panel { grid-template-columns: 1fr; }
  .page-grid { grid-template-columns: 1fr; }
  .cart-panel { position: static; }
  .menu-grid { grid-template-columns: 1fr; }
  .orders-board { flex-direction: column; }
}
@media (max-width: 720px) {
  .app-shell { padding: 18px 14px 32px; }
  .topbar, .section-header, .hero-actions { flex-direction: column; align-items: stretch; }
  .topbar { text-align: left; }
  .hero-panel { padding: 20px; border-radius: 24px; }
  .hero-image { min-height: 220px; }
  .primary-button, .secondary-button, .menu-card-button { width: 100%; }
  .menu-card { border-radius: 22px; }
  .cart-shell { padding: 20px; }
  .orders-column { padding: 14px; }
  .category-nav .tab-button { width: auto; }

  /* Orders page: container sát lề trái/phải */
  .menu-section {
    padding-left: 0;
    padding-right: 0;
    /* border-radius: 0; */
  }
  .menu-section .section-header {
    flex-direction: row !important;
    align-items: center !important;
    padding: 0 14px;
  }
  .menu-section .section-header .secondary-button {
    width: auto !important;
    flex-shrink: 0;
  }
  .menu-section .section-header .orders-count {
    flex-shrink: 0;
  }

  /* Topbar: fix fullscreen button không bị full width */
  .topbar {
    flex-direction: row !important;
    flex-wrap: wrap;
  }
  .topbar .secondary-button {
    width: auto !important;
  }
  .orders-list {
    gap: 6px;
    padding: 0 8px;
  }

  /* Item card nhỏ gọn hơn */
  .item-row-card {
    padding: 6px 8px;
    gap: 6px;
    border-radius: 8px;
  }
  .item-row-name {
    width: auto;
    min-width: 0;
    /* max-width: 120px; */
    font-size: 0.84rem;
    white-space: normal;
    word-break: break-word;
    overflow: visible;
    text-overflow: clip;
  }
  .item-row-note {
    /* max-width: 120px; */
    font-size: 0.65rem;
    white-space: normal;
    word-break: break-word;
    overflow: visible;
    text-overflow: clip;
  }
  .item-row-right {
    gap: 4px;
  }
  .item-row-qty {
    width: 24px;
    min-width: 24px;
    font-size: 0.8rem;
  }
  .item-row-table {
    width: 48px;
    min-width: 48px;
    font-size: 0.75rem;
  }
  .item-status-select {
    width: 72px;
    min-width: 72px;
    padding: 2px 4px;
    font-size: 0.7rem;
  }
}
.toast { background: rgba(27,157,255,0.96); color: white; padding: 10px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(11,28,63,0.18); margin-top: 8px; font-weight: 600; }
.menu-one-column { max-width: 768px; margin: 0 auto; padding: 0 0 80px 0; }
.menu-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: white; border-bottom: 1px solid rgba(15, 23, 42, 0.06); position: sticky; top: 0; z-index: 100; }
.menu-header-left { display: flex; align-items: center; gap: 12px; }
.menu-header-right { display: flex; align-items: center; margin-left: auto; }
.restaurant-logo { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
.restaurant-name { font-size: 1.1rem; font-weight: 800; color: #1c1f2b; margin: 0; }
.restaurant-subtitle { font-size: 0.75rem; color: #6b7280; margin: 2px 0 0; }
.table-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: linear-gradient(135deg, #2f6dfa, #1b9dff); color: white; font-weight: 700; font-size: 0.85rem; }
.menu-intro { padding: 20px 20px 12px; text-align: center; }
.menu-intro .section-label { margin-bottom: 4px; color: #2f6dfa; font-weight: 700; }
.menu-intro h2 { font-size: 1.5rem; color: #1c1f2b; margin-top: 4px; }
.category-nav {position: sticky; top:75px; display: flex; gap: 8px; padding: 8px 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; white-space: nowrap; }
.category-nav::-webkit-scrollbar { display: none; }
.category-nav .tab-button { flex-shrink: 0; padding: 0.6rem 1.2rem; font-size: 0.85rem; }
.menu-grid-full { padding: 12px 20px; display: flex; flex-direction: column; gap: 12px; }
.menu-card-full { display: flex; gap: 14px; background: white; border-radius: 16px; padding: 12px; box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06); border: 1px solid rgba(15, 23, 42, 0.04); }
.menu-card-full:active { transform: scale(0.99); }
.menu-card-image-full { width: 80px; min-height: 80px; border-radius: 12px; background-size: cover; background-position: center; flex-shrink: 0; }
.menu-card-body-full { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.menu-card-name { font-size: 0.95rem; font-weight: 700; color: #1c1f2b; margin: 0; line-height: 1.3; }
.menu-card-price { font-size: 0.9rem; font-weight: 800; color: #2f6dfa; white-space: nowrap; flex-shrink: 0; }
.menu-card-desc { font-size: 0.8rem; color: #6b7280; margin: 0; line-height: 1.4; }
.menu-card-row3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.menu-card-add-btn { padding: 0.35rem 0.9rem; border: none; border-radius: 999px; background: #2f6dfa; color: white; font-weight: 700; font-size: 0.78rem; cursor: pointer; }
.menu-card-add-btn:hover { background: #1b9dff; }
.menu-card-qty-control { display: inline-flex; align-items: center; gap: 6px; background: #f3f4f6; border-radius: 999px; padding: 2px; }
.menu-card-qty-btn { width: 28px; height: 28px; border-radius: 50%; border: none; background: white; cursor: pointer; font-size: 0.9rem; font-weight: 700; display: flex; align-items: center; justify-content: center; color: #1c1f2b; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.menu-card-qty-btn:hover { background: #2f6dfa; color: white; }
.menu-card-qty-value { font-weight: 700; font-size: 0.85rem; min-width: 20px; text-align: center; color: #1c1f2b; }
.menu-footer { padding: 24px 20px; margin: 16px 20px; background: white; border-radius: 20px; box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06); text-align: center; }
.footer-content { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.footer-info { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: #374151; }
.footer-info strong { font-size: 1.05rem; color: #1c1f2b; }
.footer-hours { font-size: 0.85rem; color: #6b7280; }
.footer-copy { margin: 12px 0 0; font-size: 0.75rem; color: #9ca3af; }
.bottom-action-bar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; gap: 8px; padding: 12px 16px; background: white; border-top: 1px solid rgba(15, 23, 42, 0.08); box-shadow: 0 -4px 20px rgba(0,0,0,0.06); z-index: 200; justify-content: center; }
.bottom-action-btn { flex: 1; max-width: 200px; padding: 0.75rem 0.8rem; font-size: 0.85rem; text-align: center; white-space: nowrap; }
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: flex-end; justify-content: center; }
.modal-content { background: white; border-radius: 24px 24px 0 0; width: 100%; max-width: 500px; max-height: 85vh; display: flex; flex-direction: column; animation: slideUp 0.3s ease; }

/* View Orders Modal Styles */
.view-orders-body {
  padding: 8px 16px !important;
}
.view-order-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease;
}
.view-order-card:last-child {
  margin-bottom: 0;
}
.view-order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: #fafbfc;
}
.view-order-card-header-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.view-order-card-id {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1c1f2b;
}
.view-order-card-time {
  font-size: 0.78rem;
  color: #9ca3af;
}
.view-order-card-status {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-new {
  background: #dbeafe;
  color: #1d4ed8;
}
.status-preparing {
  background: #fef3c7;
  color: #92400e;
}
.status-ready {
  background: #dcfce7;
  color: #166534;
}
.status-served {
  background: #dcfce7;
  color: #166534;
}
.status-completed {
  background: #e0e7ff;
  color: #3730a3;
}
.status-cancelled {
  background: #fee2e2;
  color: #dc2626;
}
.view-order-card-body {
  padding: 10px 16px;
}
.view-order-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
  font-size: 0.88rem;
}
.view-order-item-row:last-child {
  border-bottom: none;
}
.view-order-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.view-order-item-qty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  background: #f3f4f6;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  color: #374151;
  flex-shrink: 0;
}
.view-order-item-name {
  font-weight: 600;
  color: #1c1f2b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.view-order-item-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.view-order-item-price {
  font-weight: 600;
  color: #374151;
  font-size: 0.85rem;
}
.view-order-item-line {
  font-weight: 700;
  color: #2f6dfa;
  font-size: 0.88rem;
  min-width: 80px;
  text-align: right;
}
.view-order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #fafbfc;
}
.view-order-card-total {
  font-size: 0.9rem;
  color: #374151;
}
.view-order-card-total strong {
  font-size: 1.05rem;
  color: #2f6dfa;
}
.view-order-card-note {
  padding: 0 16px 10px;
  font-size: 0.8rem;
  color: #6b7280;
  font-style: italic;
  background: #fafbfc;
}
.view-order-empty {
  text-align: center;
  padding: 48px 16px;
  color: #9ca3af;
}
.view-order-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
}
.view-order-empty-text {
  font-size: 1rem;
  font-weight: 600;
  color: #6b7280;
}
.view-order-empty-sub {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 6px;
}
.view-orders-summary {
  background: linear-gradient(135deg, #f0f4ff, #f5f9ff);
  border: 1px solid rgba(47, 109, 250, 0.12);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.view-orders-summary-label {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 600;
}
.view-orders-summary-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #2f6dfa;
}
.view-order-loading {
  text-align: center;
  padding: 40px 16px;
}
.view-order-loading-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top: 3px solid #2f6dfa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.view-order-loading-text {
  font-size: 0.9rem;
  color: #6b7280;
}

/* ============================================================
   VIEW ORDERS — ITEM-LEVEL CARD STYLES
   ============================================================ */
.view-item-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease, opacity 0.2s ease;
}
.view-item-card:last-child {
  margin-bottom: 0;
}
.view-item-done {
  opacity: 0.65;
  background: #f9fafb;
  border-color: rgba(34, 197, 94, 0.15);
}
.view-item-row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.view-item-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.view-item-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1c1f2b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.view-item-qty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  background: #f3f4f6;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.75rem;
  color: #374151;
  flex-shrink: 0;
}
.view-item-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.item-badge-new {
  background: #dbeafe;
  color: #1d4ed8;
}
.item-badge-confirmed {
  background: #e0e7ff;
  color: #4338ca;
}
.item-badge-cooking {
  background: #fef3c7;
  color: #92400e;
}
.item-badge-ready {
  background: #dcfce7;
  color: #166534;
}
.item-badge-served {
  background: #d1fae5;
  color: #065f46;
}
.item-badge-cancelled {
  background: #fee2e2;
  color: #dc2626;
}
.view-item-row2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}
.view-item-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #9ca3af;
  min-width: 0;
}
.view-item-note {
  color: #6b7280;
  font-style: italic;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.view-item-prices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}
.view-item-unit-price {
  color: #9ca3af;
  font-size: 0.78rem;
}
.view-item-line-total {
  font-weight: 700;
  color: #2f6dfa;
  font-size: 0.88rem;
}
.view-order-item-status {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 20px 12px; border-bottom: 1px solid rgba(15, 23, 42, 0.06); }
.modal-header h3 { font-size: 1.15rem; }
.modal-body { flex: 1; overflow-y: auto; padding: 12px 20px; }
.modal-cart-item { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid rgba(15, 23, 42, 0.06); }
.modal-cart-item:last-child { border-bottom: none; }
.modal-cart-item-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.modal-cart-item-name { font-weight: 600; font-size: 0.92rem; color: #1c1f2b; }
.modal-cart-item-actions { display: flex; align-items: center; gap: 10px; margin-left: 15px; }
.qty-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(15, 23, 42, 0.12); background: white; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
.qty-btn:hover { background: #f3f4f6; }
.qty-value { font-weight: 700; font-size: 0.95rem; min-width: 24px; text-align: center; }
.modal-cart-note { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(15, 23, 42, 0.12); background: #f9fafb; font: inherit; font-size: 0.82rem; resize: vertical; min-height: 36px; box-sizing: border-box; }
.modal-cart-note:focus { outline: none; border-color: #1b9dff; box-shadow: 0 0 0 3px rgba(27, 157, 255, 0.15); background: white; }
.modal-cart-note::placeholder { color: #9ca3af; font-style: italic; }
.modal-footer { padding: 16px 20px 24px; border-top: 1px solid rgba(15, 23, 42, 0.06); display: flex; flex-direction: column; gap: 14px; }
.modal-total { display: flex; justify-content: space-between; align-items: center; font-size: 1.05rem; }
.modal-total strong { font-size: 1.2rem; color: #2f6dfa; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .secondary-button, .modal-actions .primary-button { flex: 1; text-align: center; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: #374151; margin-bottom: 6px; }
.password-input-wrap { position: relative; }
.password-input-wrap .admin-input { padding-right: 3rem; }
.password-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: none; background: transparent; cursor: pointer; font-size: 1rem; color: #4b5563; }
.password-toggle:hover { color: #111827; }
.admin-input { width: 100%; padding: 0.75rem 1rem; border-radius: 12px; border: 1px solid rgba(15, 23, 42, 0.12); background: white; font: inherit; box-sizing: border-box; }
.admin-input:focus { outline: none; border-color: #1b9dff; box-shadow: 0 0 0 3px rgba(27, 157, 255, 0.15); }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 12px; background: white; }
.admin-table th, .admin-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid rgba(15, 23, 42, 0.06); }
.admin-table th { background: #f8fafc; color: #64748b; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.admin-table tr:hover { background: #f8fafc; }
.food-img-thumb { width: 50px; height: 50px; border-radius: 10px; object-fit: cover; background: #e2e8f0; }

.admin-page-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.admin-sidebar {
  position: sticky;
  top: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.96));
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(47, 109, 250, 0.35) transparent;
}
.admin-sidebar::-webkit-scrollbar {
  width: 6px;
}
.admin-sidebar::-webkit-scrollbar-thumb {
  background: rgba(47, 109, 250, 0.28);
  border-radius: 999px;
}
.admin-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-header-title {
  min-width: 0;
}
.sidebar-header h2 {
  font-size: 1.25rem;
}
.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.nav-collapse-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: white;
  color: #334155;
  border-radius: 12px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}
.nav-collapse-btn:hover {
  background: #f3f4f6;
  color: #234dff;
}
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1200;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #2f6dfa, #1b9dff);
  color: white;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 8px 24px rgba(47, 109, 250, 0.35);
}
.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2.5px;
  border-radius: 2px;
  background: white;
}
.sidebar-header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: white;
  color: #334155;
  border-radius: 12px;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.sidebar-header-action:hover {
  background: #f3f4f6;
  color: #234dff;
  transform: translateY(-1px);
}
.sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: white;
  color: #334155;
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.sidebar-close:hover {
  background: #f3f4f6;
  color: #dc2626;
}
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1050;
}
.sidebar-overlay[hidden] {
  display: none;
}
@media (min-width: 961px) {
  .sidebar-overlay {
    display: none !important;
  }
}
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-nav-item {
  width: 100%;
  border: none;
  background: transparent;
  color: #334155;
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.admin-nav-item:hover {
  background: rgba(47, 109, 250, 0.08);
  color: #234dff;
  transform: translateX(2px);
}
.admin-nav-item.active {
  background: rgba(47, 109, 250, 0.12);
  color: #234dff;
  box-shadow: inset 0 0 0 1px rgba(47, 109, 250, 0.16);
}
.nav-icon {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}
.nav-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.sidebar-footer-title {
  font-size: 1.25rem;
  margin: 0 0 2px;
}
.sidebar-footer-item,
.sidebar-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}
.sidebar-user-badge {
  overflow: hidden;
  white-space: nowrap;
}
.sidebar-footer-item .nav-text,
.sidebar-user-badge .nav-text {
  min-width: 0;
}

@media (min-width: 961px) {
  .nav-collapse-btn {
    display: inline-flex;
  }
  .admin-page-shell.sidebar-collapsed {
    grid-template-columns: 96px minmax(0, 1fr);
  }
  .admin-sidebar.collapsed {
    padding: 24px 12px;
  }
  .admin-sidebar.collapsed .sidebar-header-title,
  .admin-sidebar.collapsed .eyebrow,
  .admin-sidebar.collapsed .nav-text,
  .admin-sidebar.collapsed .sidebar-footer-title {
    display: none;
  }
  .admin-sidebar.collapsed .sidebar-header {
    justify-content: center;
  }
  .admin-sidebar.collapsed .nav-collapse-btn {
    transform: rotate(180deg);
  }
  .admin-sidebar.collapsed .admin-nav,
  .admin-sidebar.collapsed .sidebar-footer {
    align-items: center;
  }
  .admin-sidebar.collapsed .admin-nav-item {
    justify-content: center;
    padding: 12px 0;
  }
  .admin-sidebar.collapsed .sidebar-footer-item,
  .admin-sidebar.collapsed .sidebar-user-badge {
    justify-content: center;
    width: 100%;
    padding: 0.85rem;
  }
  .admin-sidebar.collapsed .sidebar-header h2 {
    font-size: 1rem;
    text-align: center;
  }
}
.admin-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(15, 23, 42, 0.04);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  position: sticky;
  top: 14px;
  z-index: 60;
}
.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.admin-topbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(47, 109, 250, 0.12), rgba(27, 157, 255, 0.12));
  font-size: 1.3rem;
  overflow: hidden;
}
.admin-topbar-icon-logo {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}
.admin-topbar-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  display: block;
}
.admin-topbar-text {
  min-width: 0;
}
.admin-topbar-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1c1f2b;
  line-height: 1.25;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-topbar-subtitle {
  font-size: 0.78rem;
  color: #6b7280;
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.topbar-divider {
  width: 1px;
  height: 26px;
  background: rgba(15, 23, 42, 0.1);
  flex-shrink: 0;
}
.admin-greeting {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1c1f2b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.admin-greeting span {
  color: #2f6dfa;
}
.user-menu-wrap {
  position: relative;
  display: inline-flex;
}
.user-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: white;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.user-menu-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(47, 109, 250, 0.18);
  border-color: rgba(47, 109, 250, 0.35);
}
.user-avatar {
  font-size: 1.25rem;
  line-height: 1;
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  background: white;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  z-index: 1300;
  animation: dropdownIn 0.18s ease;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.user-dropdown-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: #f8fafc;
}
.user-dropdown-header strong {
  color: #1c1f2b;
  font-size: 0.95rem;
}
.user-dropdown-header span {
  color: #6b7280;
  font-size: 0.8rem;
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: white;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  color: #1c1f2b;
  cursor: pointer;
  transition: background 0.2s ease;
}
.user-dropdown-item:hover {
  background: #f1f5f9;
}
.user-dropdown-item-danger {
  color: #dc2626;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}
.user-dropdown-item-danger:hover {
  background: #fef2f2;
}
.account-modal .modal-body {
  display: grid;
  gap: 12px;
}
.account-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.account-info-label {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 600;
}
@media (max-width: 720px) {
  .admin-topbar {
    padding: 8px 12px;
    gap: 8px;
  }
  .admin-topbar-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
  .admin-topbar-title {
    font-size: 0.95rem;
  }
  .admin-topbar-subtitle {
    display: none;
  }
  .admin-greeting {
    font-size: 0.85rem;
  }
  .topbar-divider {
    height: 20px;
  }
  .user-menu-btn {
    width: 38px;
    height: 38px;
  }
  .user-dropdown {
    right: auto;
    left: auto;
    position: fixed;
    top: 70px;
    right: 12px;
    left: 12px;
    min-width: 0;
  }
}
.admin-panel-section.active {
  display: block;
}

/* Table payment status grid */
.table-status-bar {
  background: white;
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
}
.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 10px;
}

.table-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  border-radius: 14px;
  background: #f3f4f6;
  color: #9ca3af;
  font-weight: 800;
  font-size: 1.1rem;
  border: 2px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
}
.table-cell:hover {
  background: #e5e7eb;
  border-color: #2f6dfa;
  color: #2f6dfa;
}
.table-cell.active {
  background: #fef2f2;
  border-color: #dc2626;
  color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
  animation: table-pulse 1.2s ease-in-out infinite;
}
@keyframes table-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0.3); }
}

/* ============================================================
   MOBILE DRAWER — Đặt ở cuối file để thắng cascade
   (ghi đè các rule base: sticky -> fixed, display:none -> flex)
   ============================================================ */
@media (max-width: 960px) {
  .app-shell.admin-page-shell {
    grid-template-columns: 1fr;
    padding-top: 76px;
  }
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 85vw);
    max-height: 100vh;
    z-index: 1100;
    border-radius: 0 28px 28px 0;
    transform: translateX(-105%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
  }
  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  }
  .sidebar-toggle,
  .sidebar-close {
    display: inline-flex;
  }
  .nav-collapse-btn {
    display: none;
  }
  body.sidebar-open {
    overflow: hidden;
  }
}
@media (min-width: 961px) {
  body.sidebar-open {
    overflow: auto;
  }
}

