/* ==========================================================================
   Gọi món QR — Emerald & Warm Cream SaaS Theme (Consolidated & Polished)
   ========================================================================== */
:root {
  --bg: #f7f4ee;
  --card: #ffffff;
  --tx: #222b26;
  --mu: #6d7870;
  --ac: #138e59;
  --ac-hover: #0f704b;
  --ac2: #ffffff;
  --bd: #e6e2da;
  --ok: #138e59;
  --wa: #d08b18;
  --er: #c94f4a;
  --soft: #e8f5ed;
  --blue: #2863a5;
  --shadow: 0 7px 20px rgba(53, 42, 23, 0.05);
  --shadow-lg: 0 20px 52px rgba(22, 34, 27, 0.22);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }

.w { max-width: 1120px; margin: 0 auto; padding: 24px 22px 112px; }
h1 { font-size: clamp(23px, 3vw, 30px); letter-spacing: -0.035em; line-height: 1.15; margin: 0; }
h2 { font-size: 13px; color: var(--mu); margin: 22px 0 10px; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 750; }
.mu { color: var(--mu); font-size: 13px; }
.c { background: var(--card); border: 1px solid var(--bd); border-radius: 16px; padding: 16px; margin: 10px 0; box-shadow: var(--shadow); }
.r { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.wr { flex-wrap: wrap; justify-content: flex-start; }
.so { opacity: 0.5; }
.hidden { display: none !important; }

/* ---------- Buttons & Inputs ---------- */
.b {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 46px; border: 0; border-radius: 12px; padding: 11px 16px;
  font: inherit; font-weight: 750; background: var(--ac); color: #fff;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 0.12s, background 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 12px rgba(22, 132, 91, 0.16);
}
.b:hover:not(:disabled) { background: var(--ac-hover); }
.b:active:not(:disabled) { transform: scale(0.98); }
.b:disabled { opacity: 0.52; cursor: not-allowed; box-shadow: none; }
.b.g { background: #fff; color: var(--ac); border: 1px solid #b9d8c7; box-shadow: none; }
.b.g:hover:not(:disabled) { background: var(--soft); }
.b.s { min-height: 40px; padding: 7px 12px; font-size: 13.5px; }
.b.red { background: var(--er); color: #fff; box-shadow: 0 4px 12px rgba(201, 79, 74, 0.16); }
.b.red:hover:not(:disabled) { background: #b13d38; }
.b.ok { background: var(--ok); color: #fff; }
.b.ok:hover:not(:disabled) { background: var(--ac-hover); }

input, textarea, select {
  width: 100%; min-height: 46px; font: inherit; padding: 11px 13px;
  border-radius: 11px; border: 1px solid var(--bd); background: #fbfdfb; color: var(--tx); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:focus, textarea:focus, select:focus {
  border-color: #55a77e; background: #fff; box-shadow: 0 0 0 3px rgba(22, 132, 91, 0.12);
}
textarea { resize: vertical; }

.pw-field { position: relative; }
.pw-field input { padding-right: 46px; }
.pw-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: 9px;
  background: transparent; color: var(--mu); cursor: pointer;
  display: grid; place-items: center; transition: background 0.15s, color 0.15s;
}
.pw-toggle:hover { background: var(--soft); color: var(--ac); }

/* ---------- Status Badges & Quantity ---------- */
.t {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 99px;
  font-size: 12px; font-weight: 800; color: #315b42; background: #e8f4ed; white-space: nowrap;
}
.t.new { color: #865700; background: #fff3d8; }
.t.doing { color: #285b91; background: #e8f1ff; }
.t.done { color: #206246; background: #e3f4e9; }
.t.cancel { color: #9b3936; background: #fff0ef; }

.q { display: flex; align-items: center; gap: 6px; }
.q button {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid #b9d8c7;
  background: #f5faf6; color: var(--ac); font-size: 19px; font-weight: 700; cursor: pointer;
  display: grid; place-items: center; transition: transform 0.1s, background 0.12s;
}
.q button:active { transform: scale(0.93); background: var(--soft); }
.q b { min-width: 20px; text-align: center; font-size: 14px; }

/* ---------- Brand & Auth ---------- */
.brand-icon {
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 14px; background: var(--soft); color: var(--ac); font-size: 21px; flex: none;
}
.brand-icon svg { width: 24px; height: 24px; display: block; }

.auth-shell { max-width: 460px; margin: 4vh auto; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin: 0 2px 18px; }
.auth-brand h1 { font-size: 24px; }
.auth-brand p { margin: 3px 0 0; }
.auth-card { padding: 18px; }
.auth-card .mu { margin: 0 0 12px; }
.auth-title { font-size: 18px; color: var(--tx); text-transform: none; letter-spacing: -0.01em; margin: 4px 0 10px; }
.field-label { display: block; font-size: 12px; font-weight: 800; color: #546a5c; margin: 11px 0 5px; }
.auth-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.auth-actions .b:only-child,
.auth-actions .b:nth-child(3) { grid-column: 1 / -1; }
.slug-preview { margin-top: 8px; padding: 9px 12px; border-radius: 10px; background: var(--soft); color: var(--tx); font-size: 12.5px; word-break: break-all; }
.slug-preview strong { color: var(--ac); }
.table-picker-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.table-picker-grid button { min-height: 44px; }
.auth-error { min-height: 18px; margin: 9px 0 4px !important; font-weight: 600; }
.auth-error:empty { display: none; }
.auth-helper {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--bd);
}
.auth-helper .mu { margin: 0; }
.text-link {
  background: none; border: 0; padding: 2px 0; color: var(--ac);
  font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.login-cover {
  position: relative; overflow: hidden;
  height: 152px; border-radius: 14px;
  background: linear-gradient(135deg, #0d6643 0%, #138e59 56%, #1ea66d 100%);
  margin: -2px -2px 16px; padding: 16px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 3px;
  color: #fff; font-size: 16px; font-weight: 700;
}
.login-cover::after {
  content: ""; position: absolute; right: 14px; top: 14px; width: 108px; height: 108px; opacity: 0.16; pointer-events: none;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Cpath d='M14 14h3v3h-3zM17 17h4v4h-4z'/%3E%3C/svg%3E");
}
.login-cover strong, .login-cover span { position: relative; z-index: 1; }
.login-cover strong {
  font-family: "Lora", Georgia, "Times New Roman", serif;
  font-size: 25px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.12;
  text-shadow: 0 1px 10px rgba(10, 44, 29, 0.25);
}
.login-cover span {
  font-size: 13px; font-weight: 600; letter-spacing: 0.015em; color: #ebf9f1;
  text-shadow: 0 1px 8px rgba(10, 44, 29, 0.25);
}

.auth-back-wrap { margin: 14px 0 2px; }
.back-store-link {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 9px 14px;
  border: 1px solid #b9d8c7; border-radius: 12px; background: #f5faf6; color: var(--ac);
  font-size: 14px; font-weight: 750; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.back-store-link:hover { background: var(--soft); border-color: #85bd9d; }
.back-store-link:active { transform: scale(0.98); }
.back-store-link span:first-child { font-size: 19px; line-height: 1; }

.admin-contact {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 14px; padding: 12px 14px; border: 1px solid #d4eadb; border-radius: 13px; background: #f0f8f2;
}
.admin-contact > div { display: grid; gap: 2px; }
.admin-contact b { font-size: 14px; color: var(--tx); }
.admin-contact span { font-size: 12px; color: var(--mu); }
.admin-contact a { flex: 0 0 auto; color: var(--ac); font-size: 16px; font-weight: 850; text-decoration: none; white-space: nowrap; }
.admin-contact a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Customer Menu ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 20px; align-items: center;
  padding: 16px; border-radius: 22px; background: #fff; color: var(--tx);
  border: 1px solid var(--bd); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden;
}
.hero h1 { font-size: clamp(23px, 4vw, 31px); margin: 6px 0; }
.hero p { margin: 0; color: var(--mu); font-size: 14px; }
.hero img { width: 180px; height: 132px; object-fit: cover; border-radius: 16px; }
.eyebrow { display: block; color: var(--ac); font-size: 11px; font-weight: 850; letter-spacing: 0.13em; text-transform: uppercase; }

.cust-search { position: relative; margin: 0 0 10px; }
.cust-search input { padding: 11px 40px 11px 40px; background: #fff; border-radius: 13px; box-shadow: var(--shadow); }
.cust-search .s-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--mu); pointer-events: none; display: grid; place-items: center; }
.cust-search .s-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--soft); color: var(--ac);
  font-size: 14px; font-weight: 700; cursor: pointer; display: grid; place-items: center;
}

.category-nav {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 1px 10px; margin: 0 0 12px;
  scrollbar-width: none; position: sticky; top: 0; z-index: 4;
  background: linear-gradient(180deg, var(--bg) 78%, transparent);
}
.category-nav::-webkit-scrollbar { display: none; }
.category-nav a {
  flex: 0 0 auto; padding: 8px 14px; border: 1px solid var(--bd); border-radius: 999px;
  background: #fff; color: #365747; text-decoration: none; font-size: 13.5px; font-weight: 750; box-shadow: var(--shadow);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.category-nav a:hover, .category-nav a:active, .category-nav a.active { background: var(--soft); border-color: var(--ac); color: var(--ac); }

.customer-orders { margin-bottom: 14px; }
.customer-order { display: grid; gap: 8px; }
.order-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding-top: 8px; border-top: 1px dashed var(--bd);
}
.order-step { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--mu); font-weight: 650; }
.order-step i {
  width: 17px; height: 17px; border-radius: 50%; background: #eae7df; color: var(--mu);
  font-style: normal; font-size: 10px; font-weight: 800; display: grid; place-items: center; flex: none;
}
.order-step.active { color: var(--tx); }
.order-step.active i { background: var(--ac); color: #fff; }

.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dish {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 11px;
  align-items: center; padding: 10px; margin: 0; border-radius: 16px;
}
.dish.in-cart { border-color: #93c8aa; background: #fbfefc; }
.food { display: block; width: 84px; height: 84px; object-fit: cover; border-radius: 13px; background: #f4eee4; }
.dish-info { min-width: 0; }
.dish-info b { display: block; font-size: 14px; line-height: 1.3; }
.dish .price { margin-top: 4px; color: #bd651a; font-weight: 850; font-size: 14px; }
.dish-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.dish-opt-btn {
  border: 0; background: none; padding: 2px 4px; font-size: 11.5px; font-weight: 700;
  color: var(--ac); cursor: pointer; border-radius: 6px;
}
.dish-opt-btn:hover { background: var(--soft); }

.note-panel {
  display: grid; grid-template-columns: 1fr minmax(200px, 1.5fr) auto; gap: 12px;
  align-items: center; margin: 20px 0 22px;
}
.note-panel.no-call { grid-template-columns: 1fr minmax(200px, 1.5fr); }
.note-panel .mu { margin-top: 3px; }
.qchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.qchip {
  border: 1px solid var(--bd); background: #fff; color: var(--tx); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; font-weight: 650; cursor: pointer; transition: all 0.14s;
}
.qchip:hover { border-color: var(--ac); color: var(--ac); background: var(--soft); }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(14px); border-top: 1px solid var(--bd);
}
.bar-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cart-total { display: grid; gap: 1px; color: var(--mu); font-size: 12px; }
.cart-total b { color: var(--tx); font-size: 18px; }
.bar .b { width: auto; min-width: 158px; min-height: 50px; margin: 0; font-size: 15.5px; }

/* Slide-up Cart Sheet & Option Modal */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 900; background: rgba(19, 34, 27, 0.62); backdrop-filter: blur(3px);
  display: grid; align-items: end; justify-items: center;
}
.sheet-panel {
  width: min(620px, 100%); max-height: 86vh; background: var(--bg);
  border-radius: 22px 22px 0 0; border: 1px solid var(--bd); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden; animation: slideUp 0.2s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--bd);
}
.sheet-head h3 { margin: 0; font-size: 18px; }
.sheet-body { overflow-y: auto; padding: 12px 18px; flex: 1; }
.sheet-foot {
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  background: #fff; border-top: 1px solid var(--bd);
}
.cart-line {
  display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--bd);
}
.cart-line:last-child { border-bottom: 0; }
.cart-line img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; }
.cart-line-meta { flex: 1; min-width: 0; }
.cart-line-meta b { display: block; font-size: 14px; }
.cart-line-meta span { font-size: 13px; color: #bd651a; font-weight: 750; }
.opt-group { margin-bottom: 14px; }
.opt-group label { display: block; font-size: 12.5px; font-weight: 750; color: var(--mu); margin-bottom: 6px; }
.opt-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.opt-pill {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--bd); background: #fff;
  font-size: 13px; font-weight: 650; cursor: pointer;
}
.opt-pill.active { background: var(--soft); border-color: var(--ac); color: var(--ac); }

/* ---------- Admin Dashboard ---------- */
.admin-header {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: #fff; border: 1px solid var(--bd); border-radius: 18px; box-shadow: var(--shadow); flex-wrap: wrap;
}
.admin-meta { min-width: 0; flex: 1; }
.admin-meta h1 { font-size: 22px; }
.admin-meta p { margin: 3px 0 0; }
.admin-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tabs {
  display: flex; gap: 7px; margin: 16px 0; padding: 5px;
  background: #e9f1eb; border: 1px solid var(--bd); border-radius: 15px; overflow-x: auto;
}
.tabs .b { min-height: 42px; flex: 1; white-space: nowrap; }
.tabs .b.g { border-color: transparent; background: transparent; color: #647a6c; box-shadow: none; }
.tabs .b.g:hover { background: #fff; }
.tab-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 99px; background: var(--er); color: #fff; font-size: 11px; font-weight: 800;
}
.tabs .b:not(.g) .tab-badge { background: rgba(255, 255, 255, 0.25); }

.admin-content { padding-top: 4px; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin: 20px 0 14px; flex-wrap: wrap; }
.dashboard-heading h2 { font-size: 21px; color: var(--tx); letter-spacing: -0.03em; text-transform: none; margin: 4px 0; }
.dashboard-heading p { margin: 0; }

.date-selector {
  display: block; max-width: 300px; margin: 10px 0 16px; padding: 12px 14px;
  background: #fff; border: 1px solid var(--bd); border-radius: 14px; color: var(--mu);
  font-size: 13px; font-weight: 750; box-shadow: var(--shadow);
}
.date-selector input { display: block; margin-top: 6px; min-height: 44px; font-size: 15.5px; color: var(--tx); }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 18px; }
.stat-card { background: #fff; border: 1px solid var(--bd); border-radius: 15px; padding: 15px; box-shadow: var(--shadow); }
.stat-card span { display: block; color: var(--mu); font-size: 12px; font-weight: 700; }
.stat-card b { display: block; font-size: 23px; line-height: 1.2; margin-top: 5px; }
.stat-card.green { background: #eaf6ef; border-color: #d6ebdd; }

.order-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(250px, 0.85fr); gap: 16px; align-items: start; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 18px 0 10px; }
.section-head h2 { font-size: 16px; color: var(--tx); letter-spacing: 0; text-transform: none; margin: 0; }
.empty-state { background: #fff; border: 1px dashed #bfd6c7; border-radius: 16px; padding: 28px 18px; text-align: center; color: var(--mu); }

.order-filters { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 8px; margin-bottom: 6px; scrollbar-width: none; }
.order-filters::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto; min-height: 40px; border: 1px solid var(--bd); border-radius: 999px;
  background: #fff; color: #63766c; padding: 8px 13px; font: inherit; font-size: 12.5px; font-weight: 750; cursor: pointer;
}
.filter-chip.active { background: var(--ac); border-color: var(--ac); color: #fff; }

.order-card { padding: 17px; }
.order-card.call-card { border-left: 4px solid var(--wa); }
.order-card.takeaway-card { border-left: 4px solid var(--ac); background: #fbfefc; }
.order-card-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.order-card-head strong { font-size: 17px; }
.order-lines { padding: 12px 0; border-top: 1px solid var(--bd); border-bottom: 1px solid var(--bd); margin: 12px 0; }
.order-line { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.order-actions .b { flex: 1; min-width: 118px; min-height: 46px; }

.chart-card { padding: 16px; }
.chart-bars {
  height: 164px; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px; align-items: end; padding: 14px 0 0;
}
.chart-col {
  height: 100%; display: flex; flex-direction: column; align-items: center;
  justify-content: end; gap: 5px; color: var(--mu); font-size: 10.5px; min-width: 0;
}
.chart-val { font-size: 9.5px; font-weight: 750; color: var(--tx); white-space: nowrap; min-height: 14px; }
.chart-track {
  height: 110px; width: 100%; display: flex; align-items: end;
  background: #f2f5f1; border-radius: 7px 7px 3px 3px; overflow: hidden;
}
.chart-track i { display: block; width: 100%; min-height: 4px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #40b77d, #138e59); }

.stock-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #fff; border: 1px solid var(--bd); border-radius: 13px; padding: 9px 10px; margin: 7px 0; font-size: 13px;
}
.stock-row .b { flex: 0 0 auto; }

/* ---------- Menu Editor & Photo Gallery ---------- */
.menu-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; }
.menu-save:disabled { background: #e4e9e5; color: #7d8981; opacity: 1; box-shadow: none; cursor: not-allowed; }
.menu-column-head {
  display: grid; grid-template-columns: minmax(130px, 1.3fr) minmax(125px, 0.9fr) minmax(80px, 0.65fr) minmax(160px, 1.3fr) 44px;
  gap: 8px; padding: 0 12px 4px; color: var(--mu); font-size: 12px; font-weight: 750;
}
.menu-column-head span:nth-child(4) { padding-left: 6px; }
.me {
  display: grid; grid-template-columns: minmax(130px, 1.3fr) minmax(125px, 0.9fr) minmax(80px, 0.65fr) minmax(160px, 1.3fr) auto;
  gap: 8px; align-items: center; margin: 9px 0; padding: 12px;
  background: #fff; border: 1px solid var(--bd); border-radius: 15px; box-shadow: var(--shadow);
}
.me input { min-width: 0; }
.me > .cat-input { cursor: pointer; }
.me [data-del] { min-width: 44px; }
.photoField { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; min-width: 0; }
.photoPreview { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; border: 1px solid var(--bd); background: #f6f3ed; }
.photoControls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.photoControls .b { min-height: 40px; }
.photo-status { font-size: 12px; color: var(--mu); }
.photo-url { display: none !important; }

.photo-gallery-modal { position: fixed; inset: 0; z-index: 1000; }
.photo-gallery-scrim { display: grid; place-items: center; width: 100%; height: 100%; padding: 18px; background: rgba(19, 34, 27, 0.8); backdrop-filter: blur(4px); }
.photo-gallery-panel {
  width: min(760px, 100%); max-height: min(86vh, 800px); overflow: auto; padding: 18px;
  background: var(--bg); border: 1px solid var(--bd); border-radius: 22px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}
.photo-gallery-panel > header { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 12px; }
.photo-gallery-panel h2 { margin: 4px 0; color: var(--tx); font-size: 21px; letter-spacing: -0.02em; text-transform: none; }
.photo-gallery-panel p { margin: 0; }
.photo-gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.photo-tile { position: relative; min-width: 0; }
.photo-tile .photo-gallery-item { width: 100%; height: 100%; }
.photo-gallery-item {
  position: relative; min-width: 0; padding: 7px; background: #fff; border: 1px solid var(--bd); border-radius: 14px;
  color: var(--tx); text-align: left; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.photo-gallery-item img { display: block; width: 100%; aspect-ratio: 1.2; object-fit: cover; border-radius: 9px; margin-bottom: 6px; }
.photo-gallery-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-gallery-item:active { border-color: var(--ac); transform: scale(0.98); }
.photo-del-btn {
  position: absolute; top: 11px; right: 11px; width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: rgba(24, 24, 24, 0.72); color: #fff; font-size: 15px; line-height: 1; font-weight: 800;
  display: grid; place-items: center; cursor: pointer; z-index: 2; transition: background 0.15s;
}
.photo-del-btn:hover { background: var(--er); }
.photo-upload-bar {
  background: #fff; border: 1px solid var(--bd); border-radius: 16px; padding: 12px; margin-bottom: 14px;
  display: grid; gap: 10px;
}
.photo-upload-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.photo-upload-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-paste-hint { margin: 0; font-size: 12px; color: var(--mu); line-height: 1.4; }
.photo-gallery-sec-title {
  margin: 14px 0 8px; font-size: 12.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--mu); display: flex; justify-content: space-between; align-items: center;
}
.cover-editor {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  background: #fff; border: 1px solid var(--bd); border-radius: 16px; padding: 12px; margin: 10px 0 14px; box-shadow: var(--shadow);
}
.cover-editor img { width: 120px; height: 72px; object-fit: cover; border-radius: 11px; background: #f4eee4; }
.cover-editor-info b { display: block; font-size: 14.5px; }
.cover-editor-info span { display: block; font-size: 12.5px; color: var(--mu); margin-top: 2px; }
.cover-editor-actions { display: flex; gap: 7px; flex-wrap: wrap; }

.cat-modal-panel { width: min(540px, 100%); }
.cat-add-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 12px; }
.cat-list { display: grid; gap: 7px; max-height: 48vh; overflow: auto; padding-right: 2px; }
.cat-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--bd); border-radius: 13px; background: #fff;
}
.cat-row-info { min-width: 0; }
.cat-row-info b { display: block; font-size: 14.5px; color: var(--tx); word-break: break-word; }
.cat-row-info span { display: block; font-size: 12px; color: var(--mu); }
.cat-row-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.cat-modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--bd); }

/* ---------- QR Tools & Printable Cards ---------- */
.qr-tools {
  display: flex; align-items: end; gap: 10px; flex-wrap: wrap;
  padding: 16px; background: #fff; border: 1px solid var(--bd); border-radius: 16px; box-shadow: var(--shadow);
}
.qr-tools label { max-width: 180px; font-size: 12px; color: var(--mu); font-weight: 750; }
.qr-tools label input { margin-top: 4px; }
.qr-tools .qr-check {
  display: inline-flex; align-items: center; gap: 8px; max-width: none; width: auto;
  min-height: 46px; padding: 0 12px; border: 1px solid var(--bd); border-radius: 12px;
  background: #fbfdfb; color: var(--tx); font-size: 13.5px; cursor: pointer;
}
.qr-tools .qr-check input[type="checkbox"] {
  width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; accent-color: var(--ac); flex: 0 0 auto;
}
.qr-security-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 12px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--bd); background: #fff;
}
.qr-security-bar.is-on { border-color: #bfe0cd; background: #f2faf5; }
.qr-security-bar.is-off { border-color: #ecd9a8; background: #fffbf0; }
.qr-security-info { min-width: 0; flex: 1 1 280px; }
.qr-security-info strong { display: block; font-size: 14.5px; color: var(--tx); }
.qr-security-info span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--mu); }
.qr-security-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.qr-title { display: none; }
.qrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 12px; }
.qr-card {
  display: grid; grid-template-rows: auto auto 1fr auto; justify-items: center; align-items: center;
  gap: 8px; min-height: 300px; padding: 18px !important;
  border: 1px solid #cfe3d5 !important; border-radius: 20px !important;
  background: linear-gradient(160deg, #fff, #f7fbf8) !important;
}
.qr-card-brand { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-width: 0; color: #18764e; }
.qr-card-brand > span { font-size: 20px; }
.qr-card-brand > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.qr-card-table { display: grid; justify-items: center; line-height: 1; }
.qr-card-table span { color: #64766b; font-size: 11px; font-weight: 800; letter-spacing: 0.13em; }
.qr-card-table strong { margin-top: 4px; color: #173f2e; font-size: 26px; letter-spacing: -0.04em; }
.qr-code { display: grid; place-items: center; padding: 6px; border-radius: 13px; background: #fff; box-shadow: 0 3px 12px rgba(23, 63, 46, 0.07); }
.qr-code svg { display: block; width: 142px !important; height: 142px !important; max-width: 100%; margin: 0 !important; padding: 0 !important; border: 0 !important; background: #fff; }
.qr-card-foot { display: grid; gap: 1px; text-align: center; }
.qr-card-foot b { color: #16764d; font-size: 14px; }
.qr-card-foot span { color: var(--mu); font-size: 11px; }
.qr-card.qr-card-counter {
  border-color: #e2c891 !important;
  background: linear-gradient(160deg, #fffdf8, #faf3e3) !important;
}
.qr-card-counter .qr-card-table span { color: #8c6419; }
.qr-card-counter .qr-card-table strong { color: #9a5b00; font-size: 23px; letter-spacing: -0.02em; }
.qr-card-counter .qr-card-foot b { color: #9a5b00; }

/* ---------- Platform /admin Approval Cards ---------- */
.account-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; margin: 12px 0; }
.account-tabs .filter-chip { font-size: 14px; min-height: 44px; }
.request-card { display: grid; gap: 12px; }
.request-details { display: grid; gap: 8px; }
.request-details p {
  display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px;
  margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--bd); overflow-wrap: anywhere;
}
.request-details p b { color: var(--mu); font-size: 13px; }
.request-details p span { font-weight: 650; }

/* ---------- Toast & Confirm Dialog ---------- */
.toast-host {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 1100;
  display: flex; flex-direction: column; gap: 8px; width: calc(100% - 24px); max-width: 420px; pointer-events: none;
}
.toast {
  background: #222b26; color: #fff; padding: 12px 15px; border-radius: 13px;
  font-size: 13.5px; font-weight: 650; box-shadow: var(--shadow-lg);
  animation: toastIn 0.22s ease; pointer-events: auto;
}
.toast.ok { background: #138e59; }
.toast.err { background: #c94f4a; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

.confirm-scrim {
  position: fixed; inset: 0; z-index: 1050; background: rgba(19, 34, 27, 0.72); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 16px;
}
.confirm-panel {
  width: min(400px, 100%); background: #fff; border: 1px solid var(--bd); border-radius: 20px;
  padding: 20px; box-shadow: var(--shadow-lg);
}
.confirm-panel h3 { margin: 0 0 8px; font-size: 18px; }
.confirm-panel p { margin: 0 0 16px; color: var(--mu); font-size: 14px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

/* ---------- Footer ---------- */
.site-footer {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 5px 14px;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--bd); background: rgba(255, 255, 255, 0.5);
  color: var(--mu); text-align: center; font-size: 12px; letter-spacing: 0.01em;
}
.site-footer span + span { padding-left: 14px; border-left: 1px solid var(--bd); }
.site-footer a { color: var(--ac); font-weight: 750; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Consolidated)
   ========================================================================== */
@media (max-width: 760px) {
  .w { padding: 14px 14px 108px; }
  .hero { grid-template-columns: 1fr; gap: 0; padding: 0 0 15px; }
  .hero img { order: -1; width: 100%; height: 170px; border-radius: 0; }
  .hero > div { padding: 14px 16px 0; }
  .hero h1 { font-size: 23px; }

  .customer-view .menu-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .customer-view .dish { grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; padding: 10px; border-radius: 15px; }
  .customer-view .food { width: 76px; height: 76px; border-radius: 11px; }
  .customer-view .dish-info b { font-size: 15px; }
  .customer-view .dish .q button { width: 34px; height: 36px; border-radius: 10px; font-size: 18px; }
  .customer-view .dish .q b { min-width: 16px; }

  .admin-header { padding: 14px; }
  .admin-meta h1 { font-size: 19px; }
  .order-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .date-selector { max-width: none; }

  .menu-heading-actions { width: 100%; }
  .menu-heading-actions .b { flex: 1; }
  .menu-column-head { display: none !important; }
  .me {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 46px;
    grid-template-areas: "name name remove" "category price remove" "photo photo remove";
    gap: 9px; padding: 12px;
  }
  .me > input:first-child { grid-area: name; }
  .me > select, .me > .cat-input { grid-area: category; min-width: 0; }
  .me > .price-input { grid-area: price; }
  .me > .photoField { grid-area: photo; grid-template-columns: 64px minmax(0, 1fr); }
  .me > [data-del] { grid-area: remove; justify-self: end; align-self: start; width: 44px; min-width: 44px; min-height: 44px; padding: 0; }

  .qrs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qr-card { min-height: 250px; padding: 12px !important; gap: 6px; }
  .qr-card-brand > b { font-size: 12px; }
  .qr-card-brand > span { font-size: 16px; }
  .qr-card-table strong { font-size: 23px; }
  .qr-code svg { width: 116px !important; height: 116px !important; }

  .photo-gallery-scrim { padding: 10px; }
  .photo-gallery-panel { padding: 14px; border-radius: 18px; }
  .photo-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cat-add-form { grid-template-columns: 1fr; }
  .cat-row { flex-direction: column; align-items: stretch; }
  .cat-row-actions { justify-content: flex-end; }
  .photo-upload-row { grid-template-columns: 1fr; }
  .cover-editor { grid-template-columns: 88px minmax(0, 1fr); }
  .cover-editor img { width: 88px; height: 60px; }
  .cover-editor-actions { grid-column: 1 / -1; }
  .request-details p { grid-template-columns: 112px minmax(0, 1fr); }
}

@media (max-width: 460px) {
  .w { padding: 10px 12px 105px; }
  .auth-shell { margin: 3vh auto; }
  .hero { border-radius: 18px; }
  .hero img { height: 148px; }
  .hero > div { padding: 12px 14px 0; }
  .hero h1 { font-size: 21px; }
  .hero p { font-size: 13px; }
  .category-nav a { padding: 8px 12px; font-size: 13.5px; }
  .note-panel { grid-template-columns: 1fr; gap: 9px; margin: 14px 0; }
  .note-panel .b { width: 100%; min-height: 48px; }
  .note-panel textarea { min-height: 76px; font-size: 15px; }

  .bar { padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .bar-inner { gap: 8px; }
  .cart-total { font-size: 11.5px; }
  .cart-total b { font-size: 16px; }
  .bar .b { min-width: 136px; min-height: 46px; font-size: 14.5px; }

  .tabs .b { flex: 0 0 auto; padding: 9px 13px; }
  .stats-grid { gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-card b { font-size: 20px; }
  .dashboard-heading { align-items: start; flex-direction: column; }
  .order-card { padding: 13px; }
  .order-card-head strong { font-size: 15px; }
  .order-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .order-actions .b { min-width: 0; }
  .qr-tools { align-items: stretch; flex-direction: column; }
  .qr-tools label { max-width: none; }
  .site-footer { flex-direction: column; gap: 3px; padding: 14px 12px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .site-footer span + span { padding: 0; border: 0; }
}

@media (max-width: 380px) {
  .customer-view .dish { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px; padding: 9px; }
  .customer-view .food { width: 64px; height: 64px; }
  .customer-view .dish .q button { width: 30px; height: 32px; }
  .admin-contact { align-items: flex-start; flex-direction: column; gap: 5px; }
  .qr-security-bar { align-items: stretch; }
  .qr-security-actions, .qr-security-actions .b { width: 100%; }
}

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body { background: #fff !important; color: #000 !important; }
  .np, .bar, .tabs, .admin-header, .qr-tools, .qr-security-bar, .qr-title, .site-footer, .dashboard-heading, .toast-host { display: none !important; }
  .w { width: 190mm; max-width: none; margin: 0 auto; padding: 0; }
  .admin-content { padding: 0; }
  .qrs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 65mm; align-content: start; gap: 2mm; width: 100%; }
  .qrs .qr-card {
    height: 65mm; min-height: 65mm; break-inside: avoid; page-break-inside: avoid;
    grid-template-rows: 6mm 10mm 1fr 7mm; gap: 0; margin: 0; padding: 2.5mm !important; overflow: hidden;
    border: 0.3mm dashed #78a98a !important; border-radius: 3mm !important; background: #fff !important;
    box-shadow: none !important; color: #20372c; print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  .qr-card-brand { justify-content: flex-start; gap: 2mm; padding-bottom: 1mm; border-bottom: 0.2mm solid #dcebe0; }
  .qr-card-brand > span { font-size: 11pt; }
  .qr-card-brand > b { font-size: 9pt; color: #176d49; }
  .qr-card-table { display: flex; align-items: baseline; justify-content: center; gap: 2mm; }
  .qr-card-table span { font-size: 7pt; color: #51665a; letter-spacing: 0.12em; }
  .qr-card-table strong { margin: 0; color: #174e36; font-size: 15pt; }
  .qr-code { padding: 0; border-radius: 0; box-shadow: none; }
  .qr-code svg { width: 35mm !important; height: 35mm !important; max-width: none; padding: 1mm !important; background: #fff; border: 0 !important; }
  .qr-card-foot { gap: 0; }
  .qr-card-foot b { color: #176d49; font-size: 8pt; }
  .qr-card-foot span { color: #607067; font-size: 7pt; }
  .qrs .qr-card.qr-card-counter { border-color: #c89b3c !important; background: #fffdf8 !important; }
  .qr-card-counter .qr-card-table strong { color: #9a5b00; font-size: 13pt; }
  .qr-card-counter .qr-card-foot b { color: #9a5b00; }
}

/* Auth typography and vector brand mark */
.auth-shell h1 { line-height: 1.28; letter-spacing: 0; }
.pending-card { padding: 24px; }
.pending-card h1 { margin: 5px 0 8px; font-size: 26px; line-height: 1.25; letter-spacing: 0; }
.pending-card .mu { max-width: 40ch; margin: 0 0 18px; font-size: 14px; line-height: 1.65; }
.status-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 13px; border-radius: 15px; background: #eaf6ef; color: var(--ac); }
.status-icon svg { display: block; width: 25px; height: 25px; }
.hero-brand-icon { display: inline-flex; vertical-align: middle; margin-right: 7px; color: var(--ac); }
.hero-brand-icon svg { display: block; width: 1em; height: 1em; }
.qr-card-brand > span svg { display: block; width: 20px; height: 20px; }
@media print { .qr-card-brand > span svg { width: 11pt; height: 11pt; } }
