/* =====================================================================
   QLDH – Quản lý đơn hàng · Giao diện mới (Cloudflare Pages)
   Bố cục: máy tính = thanh bên trái · điện thoại = thanh trên + tab dưới
   ===================================================================== */

/* ---------- 1. Biến thiết kế ---------- */
:root {
  --ink: #0f172a;
  --ink2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e3e8f1;
  --line2: #eef2f8;
  --bg: #f2f5fa;
  --card: #fff;
  --soft: #f5f8fd;
  --brand: #2563eb;
  --brand-h: #1d4ed8;
  --brand-d: #1e3a8a;
  --brand-l: #e8f0ff;
  --warm: #f59e0b;
  --warm-l: #fef3c7;
  --chili: #dc2626;
  --chili-l: #fee2e2;
  --ok: #15803d;
  --ok-l: #dcfce7;
  --vio: #5b46b5;
  --vio-l: #ece8f7;
  --r: 16px;
  --r-s: 12px;
  --sh: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 10px rgba(15, 23, 42, .04);
  --sh2: 0 8px 26px rgba(15, 23, 42, .10);
  --side: 258px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

/* ---------- 2. Nền tảng ---------- */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  font-family: 'Inter', 'Segoe UI', system-ui, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body.nos { overflow: hidden }
#qldh, #qldh * { box-sizing: border-box }
#qldh {
  color: var(--ink);
  font: 15px/1.5 'Inter', 'Segoe UI', system-ui, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
#qldh [hidden] { display: none !important }
.d-none { display: none !important }
:where(#qldh) :where(h1, h2, h3, h4, p, ul) { margin: 0; padding: 0 }
:where(#qldh) button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0 }
:where(#qldh) a { cursor: pointer; text-decoration: none; color: var(--brand) }
:where(#qldh) * { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent }
#qldh h1, #qldh h2, #qldh h3 { text-wrap: balance }
#qldh a, #qldh button { touch-action: manipulation }
#qldh i.fa-solid, #qldh i.fa-regular { line-height: 1 }
#qldh :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px }
.spin { display: inline-block; animation: spin 1s linear infinite }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98) } }
@keyframes slide { from { transform: translateY(40px); opacity: 0 } }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px) } }
@keyframes skl { to { background-position: -200% 0 } }

#q-fatal {
  position: fixed; left: 0; right: 0; top: 0; z-index: 99999;
  background: #dc2626; color: #fff; padding: 12px 16px;
  font: 600 14px/1.4 'Inter', Arial, sans-serif; text-align: center;
}
#q-fatal[hidden] { display: none }
.q-sk {
  background: linear-gradient(90deg, #eaeff7, #dde6f3, #eaeff7);
  background-size: 200% 100%; animation: skl 1.2s linear infinite; border-radius: var(--r);
}
#q-view.anim { animation: fadeup .28s ease-out }

/* ---------- 3. Khung ứng dụng ---------- */
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--side); z-index: 60;
  display: flex; flex-direction: column;
  padding: 20px 14px 14px;
  color: #dbe4f5;
  background:
    radial-gradient(120% 60% at 0 0, rgba(59, 130, 246, .28), transparent 60%),
    linear-gradient(180deg, #0f1d44 0%, #0a1330 100%);
  overflow-y: auto;
}
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 20px; min-width: 0 }
.brand-logo {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border-radius: 13px; font-size: 18px; color: #1e3a8a;
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  box-shadow: 0 6px 16px rgba(245, 158, 11, .35);
}
.brand-text { min-width: 0 }
.brand-title { font-weight: 800; font-size: 15.5px; line-height: 1.2; color: #fff; letter-spacing: -.01em }
.brand-sub { font-size: 12.5px; color: #8fa2c6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px }

.sb-cta {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: calc(100% - 8px); margin: 0 4px 18px; min-height: 46px; padding: 0 14px;
  border-radius: 13px; color: #fff; font-weight: 700; font-size: 15px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .38), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .08s, box-shadow .15s, filter .15s;
}
.sb-cta:hover { filter: brightness(1.08) }
.sb-cta:active { transform: scale(.98) }
.sb-cta kbd {
  margin-left: 4px; font: 700 11px/1 'Inter', sans-serif; padding: 4px 6px; border-radius: 6px;
  background: rgba(255, 255, 255, .2); color: #fff;
}

.q-tabs-wrap { flex: 1; min-height: 0 }
#q-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px }
#q-nav li { min-width: 0 }
#q-nav .nav-link {
  position: relative; width: 100%; display: flex; align-items: center; gap: 13px;
  padding: 11px 12px; border: 0; border-radius: 12px; text-align: left;
  color: #a9b8d6; background: transparent; font-weight: 600; font-size: 14.5px; white-space: nowrap;
  transition: background .15s, color .15s;
}
#q-nav .nav-link i { width: 20px; text-align: center; font-size: 15px; flex: none }
#q-nav .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff }
#q-nav .nav-link.active { background: rgba(255, 255, 255, .13); color: #fff }
#q-nav .nav-link.active::before {
  content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--warm);
}
#q-nav .nb {
  margin-left: auto; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 99px;
  display: inline-grid; place-items: center; background: #ef4444; color: #fff; font-size: 11.5px; font-weight: 700;
}

.sb-foot { margin-top: 12px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); display: grid; gap: 10px }
.sb-user { display: flex; align-items: center; gap: 11px; padding: 0 6px; min-width: 0 }
.sb-user .u-t { min-width: 0 }
.sb-user .u-t b { display: block; color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.sb-user .u-t small { display: block; color: #8fa2c6; font-size: 12.5px }
.sb-actions { display: grid; grid-template-columns: 1fr; gap: 6px }
.q-sync {
  display: flex; align-items: center; gap: 7px; min-width: 0; padding: 8px 10px; border-radius: 10px;
  font-size: 12.5px; color: #8fa2c6 !important; text-align: left; white-space: nowrap;
}
.q-sync span { overflow: hidden; text-overflow: ellipsis }
.q-sync:hover { background: rgba(255, 255, 255, .08); color: #fff !important }
.btn-logout {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border-radius: 10px;
  color: #fff !important; font-weight: 600; font-size: 13.5px; white-space: nowrap;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
}
.btn-logout:hover { background: rgba(255, 255, 255, .2) }

.shell-main { margin-left: var(--side); min-height: 100vh; padding: 30px clamp(20px, 3vw, 44px) 36px }
#q-view { max-width: 1200px; margin: 0 auto }
.app-footer { max-width: 1200px; margin: 30px auto 0; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; color: var(--faint); font-size: 12.5px }
.q-role { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--brand-l); color: var(--brand-d) }

/* ---------- 4. Tiêu đề trang & nút ---------- */
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 18px }
.q-head h2 { font-size: clamp(22px, 2.6vw, 28px); line-height: 1.2; font-weight: 800; letter-spacing: -.02em }
.q-head p { color: var(--muted); font-size: 14px; margin-top: 3px; line-height: 1.5 }
.q-head p b { color: var(--ink2) }
.q-head-a { display: flex; gap: 8px; flex-wrap: wrap }

.q-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 11px;
  background: #fff; color: var(--ink) !important; font-weight: 600; font-size: 14.5px; white-space: nowrap;
  text-decoration: none; box-shadow: 0 1px 1px rgba(15, 23, 42, .03);
  transition: background .15s, border-color .15s, transform .06s, box-shadow .15s;
}
.q-btn:hover { background: var(--soft); border-color: #c5d3ec }
.q-btn:active { transform: scale(.98) }
.q-btn.pri { background: var(--brand); border-color: var(--brand); color: #fff !important; box-shadow: 0 4px 12px rgba(37, 99, 235, .28) }
.q-btn.pri:hover { background: var(--brand-h); border-color: var(--brand-h) }
.q-btn.ok { background: #16a34a; border-color: #16a34a; color: #fff !important; box-shadow: 0 4px 12px rgba(22, 163, 74, .25) }
.q-btn.ok:hover { background: #15803d; border-color: #15803d }
.q-btn.dan { background: var(--chili); border-color: var(--chili); color: #fff !important }
.q-btn.dan.ghost { color: var(--chili) !important; background: transparent; border-color: transparent; box-shadow: none }
.q-btn.dan.ghost:hover { background: var(--chili-l) }
.q-btn.soft { background: var(--brand-l); border-color: transparent; color: var(--brand-d) !important; box-shadow: none }
.q-btn.soft:hover { background: #d8e6ff }
.q-btn.ghost { background: transparent; border-color: transparent; box-shadow: none }
.q-btn.ghost:hover { background: #eaf0fb }
.q-btn.sm { min-height: 34px; padding: 5px 12px; font-size: 13.5px; border-radius: 9px }
.q-btn.lg { min-height: 48px; padding: 10px 22px; font-size: 16px; border-radius: 13px }
.q-btn.wide { width: 100% }
.q-btn[disabled] { opacity: .45; pointer-events: none }
.q-ib {
  width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 16px;
  transition: background .15s, color .15s;
}
.q-ib:hover { background: #e9effa; color: var(--ink) }
.q-ib.lg { background: #fff; border: 1px solid var(--line); color: var(--ink2) }
.q-ib.lg:hover { background: var(--soft) }

/* ---------- 5. Ô nhập, chọn, bật/tắt ---------- */
.q-in {
  width: 100%; min-height: 42px; padding: 9px 13px; border: 1px solid #cfd8e6; border-radius: 11px;
  background: #fff; color: var(--ink); font: inherit; -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.q-in::placeholder { color: var(--faint) }
.q-in:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37, 99, 235, .14) }
select.q-in {
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
textarea.q-in { resize: vertical }
.q-date { width: auto; min-width: 150px; flex: 0 0 auto }
.q-search { position: relative }
.q-search > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none }
.q-search input { padding-left: 40px }

.q-ck { position: relative; display: inline-block; width: 24px; height: 24px; flex: none }
.q-ck input { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); opacity: 0; margin: 0; cursor: pointer; z-index: 2 }
.q-ck i { position: absolute; inset: 0; border: 1.5px solid #b3c0d4; border-radius: 8px; background: #fff; transition: .12s }
.q-ck input:checked + i { background: var(--brand); border-color: var(--brand) }
.q-ck input:checked + i:after { content: ''; position: absolute; left: 7.5px; top: 3px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.2px 2.2px 0; transform: rotate(45deg) }
.q-sw { position: relative; display: inline-block; width: 44px; height: 26px; flex: none }
.q-sw input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 2 }
.q-sw i { position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px; transition: .18s }
.q-sw i:after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: .18s }
.q-sw input:checked + i { background: #16a34a }
.q-sw input:checked + i:after { transform: translateX(18px) }

/* ---------- 6. Chip, thẻ nhãn, avatar ---------- */
.q-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin: 0 -2px; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch }
.q-chips::-webkit-scrollbar { display: none }
.q-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 15px;
  border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--ink2);
  font-size: 14px; font-weight: 500; white-space: nowrap; scroll-snap-align: start;
  transition: border-color .15s, background .15s, color .15s;
}
.q-chip b { font-weight: 700; font-size: 12px; opacity: .7 }
.q-chip:hover { border-color: #b9cdf3; background: var(--soft) }
.q-chip.on, .q-chip.on:hover { background: var(--brand-d); color: #fff; border-color: var(--brand-d) }
.q-card-h .q-chips { padding: 0; margin: 0 }

.q-tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: #edf1f7; color: var(--muted); white-space: nowrap }
.q-tag.a { background: var(--brand-l); color: var(--brand-d) }
.st-moi { background: var(--brand-l); color: var(--brand-d) }
.st-chuanbi { background: var(--warm-l); color: #7a5200 }
.st-dangiao { background: var(--vio-l); color: var(--vio) }
.st-dagiao { background: var(--ok-l); color: var(--ok) }
.st-huy { background: #edf1f7; color: var(--muted) }
.p-da { background: var(--ok-l); color: var(--ok) }
.p-chua { background: var(--chili-l); color: var(--chili) }
.q-tags { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end }
.q-chg { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px }
.q-chg.up { background: var(--ok-l); color: var(--ok) }
.q-chg.down { background: var(--chili-l); color: var(--chili) }

.q-zn {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; white-space: nowrap;
  background: hsl(var(--zh) 90% 92%); color: hsl(var(--zh) 65% 24%); border: 1px solid hsl(var(--zh) 60% 78%);
}
.q-zn i { font-size: 10px; opacity: .75 }
.q-zn.none { background: #fff; color: var(--muted); border: 1px dashed #b9c7dc; font-weight: 600 }
.zdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: hsl(var(--zh) 70% 50%); flex: none }
.q-zrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px }

.q-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 15px; background: hsl(var(--h) 80% 92%); color: hsl(var(--h) 55% 30%) }
.q-av.sm { width: 34px; height: 34px; font-size: 13px }
.q-av.lg { width: 52px; height: 52px; font-size: 20px }
.q-th { width: 60px; height: 60px; border-radius: 13px; overflow: hidden; background: #eef2f8; flex: none }
.q-th img { width: 100%; height: 100%; object-fit: cover; display: block }
.q-th.sm { width: 44px; height: 44px; border-radius: 11px }
.q-ph { width: 100%; height: 100%; display: grid; place-items: center; font-weight: 800; font-size: 22px; background: linear-gradient(135deg, hsl(var(--h) 85% 92%), hsl(calc(var(--h) + 35) 85% 84%)); color: hsl(var(--h) 45% 38%) }
.q-th.sm .q-ph { font-size: 17px }
.q-ph i { font-size: 20px }

/* ---------- 7. Thẻ, số liệu, trạng thái rỗng ---------- */
.q-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); margin-bottom: 16px; overflow: hidden }
.q-card.pad { padding: 18px 20px }
.q-card.pad h3 { font-size: 16px }
.q-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line2) }
.q-card.pad .q-card-h { padding: 0 0 12px; margin-bottom: 6px }
.q-card-h h3 { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 9px }
.q-card-h h3 i { color: var(--brand); font-size: 14px; width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 9px; background: var(--brand-l) }
.q-card-h small { color: var(--muted) }
.q-card-b { padding: 6px 18px 14px }
.q-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px }
.q-cols > .q-card { margin-bottom: 0; min-width: 0 }

.q-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px }
.q-stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)) }
.q-stat { display: block; width: 100%; min-width: 0; text-align: left; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh) }
button.q-stat { transition: transform .12s, border-color .12s, box-shadow .12s }
button.q-stat:hover { border-color: #b9cdf3; transform: translateY(-2px); box-shadow: var(--sh2) }
.q-stat > span { display: block; font-size: 13px; font-weight: 500; color: var(--muted) }
.q-stat b { display: block; margin: 3px 0; font-size: clamp(21px, 2.2vw, 27px); font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.q-stat small { display: block; font-size: 12.5px; color: var(--muted) }
.q-prog { height: 7px; border-radius: 9px; background: #e3eaf5; margin: 9px 0 5px; overflow: hidden }
.q-prog i { display: block; height: 100%; background: var(--brand); border-radius: 9px; transition: width .3s }
.q-prog.ok i { background: #16a34a }

.q-empty { text-align: center; padding: 48px 20px; margin-bottom: 16px; color: var(--muted); background: linear-gradient(#fff, #f8fbff); border: 1px dashed #c3d3ee; border-radius: var(--r) }
.q-empty > i { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: var(--brand-l); color: var(--brand); font-size: 26px }
.q-empty b { display: block; color: var(--ink); font-size: 16px }
.q-empty p { margin: 4px 0 14px }
.q-row-btn { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center }
.q-day-e { color: var(--muted); font-size: 14px; padding: 16px; text-align: center }
.q-warn { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 11px 15px; background: var(--warm-l); border: 1px solid #f2d58f; border-radius: 13px; color: #7a5200; font-weight: 500 }
.q-sec { display: flex; flex-direction: column; margin: 18px 0 8px; font-weight: 700; font-size: 15px }
.q-sec small { font-weight: 400; color: var(--muted); font-size: 13px }
.q-sh { margin: 22px 2px 9px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .7px }
.q-dayh { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 18px 2px 9px; font-weight: 700; font-size: 15px }
.q-dayh:first-child { margin-top: 2px }
.q-dayh small { color: var(--muted); font-weight: 500; font-size: 13px }
.q-hint { margin: -4px 0 8px; font-size: 13px; color: var(--muted) }
.q-hint2 { margin: -2px 2px 11px; font-size: 13px; color: var(--muted) }
.q-hint2 button { padding: 0; color: var(--brand); font-weight: 600; background: none; border: 0 }

/* ---------- 8. Tổng quan ---------- */
.q-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr; gap: 16px 36px; align-items: center;
  margin-bottom: 6px; padding: 24px 28px; color: #fff; border-radius: 20px;
  background:
    radial-gradient(70% 140% at 100% 0, rgba(96, 165, 250, .5), transparent 60%),
    linear-gradient(135deg, #14306f 0%, #1e40af 55%, #2563eb 100%);
  box-shadow: 0 14px 34px rgba(30, 64, 175, .28);
}
.q-hero .lbl { font-size: 15px; font-weight: 600; opacity: .92 }
.q-hero .big { margin: 4px 0; font-size: 72px; font-weight: 800; line-height: 1; letter-spacing: -3px }
.q-hero-r { display: flex; flex-direction: column; gap: 13px; min-width: 0 }
.q-hero .pills { display: flex; flex-wrap: wrap; gap: 8px }
.q-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; border-radius: 99px; background: rgba(255, 255, 255, .18); font-size: 13.5px; font-weight: 600 }
.q-pill.red { background: #fee2e2; color: #991b1b }
.q-hero .barlbl { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13.5px; font-weight: 600 }
.q-hero .bar { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .25); overflow: hidden }
.q-hero .bar i { display: block; height: 100%; border-radius: 99px; background: #4ade80; transition: width .4s }
.q-hero-m { font-size: 14px; opacity: .95 }
.q-hero-go { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border: 0; border-radius: 12px; background: #fff; color: var(--brand-d); font-weight: 700; font-size: 15px; box-shadow: 0 6px 16px rgba(0, 0, 0, .15); transition: transform .1s }
.q-hero-go:hover { transform: translateY(-1px) }

.q-sched { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px }
.q-sc { min-width: 0; text-align: left; padding: 15px 17px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); transition: transform .12s, border-color .12s, box-shadow .12s }
.q-sc:hover { border-color: #b9cdf3; transform: translateY(-2px); box-shadow: var(--sh2) }
.q-sc span { display: block; font-size: 13.5px; font-weight: 600 }
.q-sc b { display: block; margin: 2px 0; font-size: 32px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em }
.q-sc small { display: block; font-size: 12.5px; color: var(--muted) }
.q-sc.red { background: #fef2f2; border-color: #fecaca }
.q-sc.red b { color: var(--chili) }
.q-sc.zero b { color: #a5b2c6 }
.q-alertbar { display: flex; align-items: center; gap: 9px; width: 100%; margin-bottom: 16px; padding: 11px 15px; text-align: left; background: var(--warm-l); border: 1px solid #fde68a; border-radius: 13px; color: #92400e; font-size: 14px }
.q-alertbar i:last-child { margin-left: auto }
.q-more { width: 100%; margin: 4px 0 16px; padding: 13px; background: #fff; border: 1px dashed #c3d3ee; border-radius: 13px; color: var(--brand-d); font-weight: 600; transition: background .15s }
.q-more:hover { background: var(--soft) }

.q-rows .q-r { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line2) }
.q-rows .q-r:last-child { border-bottom: 0 }
.q-r .rk { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 8px; background: #eef2f8; color: var(--muted); font-size: 12px; font-weight: 800 }
.q-r .rk.t1 { background: var(--warm-l); color: #a16207 }
.q-r .grow { flex: 1; min-width: 0 }
.q-r b { font-weight: 600 }
.q-r small { display: block; font-size: 12.5px; color: var(--muted) }
.q-r .nm { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.q-alerts { display: grid; gap: 8px; padding: 8px 14px 14px }
.q-al { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--soft) }
.q-al b { font-weight: 600 }
.q-al span { margin-left: auto; color: var(--muted); font-size: 13px }
.q-stk { font-size: 12.5px; font-weight: 600; color: var(--muted) }
.q-stk.low { color: #b45309 }
.q-stk.out { color: var(--chili) }

.q-bars { display: flex; align-items: flex-end; gap: 8px; height: clamp(170px, 26vw, 220px); padding: 22px 18px 12px }
.q-bar { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px }
.q-bar i { display: block; width: 100%; max-width: 40px; min-height: 2px; border-radius: 8px 8px 3px 3px; background: #c4d6f7; transition: height .3s, background .15s }
.q-bar:hover i { background: #93b4f0 }
.q-bar em { height: 15px; font-style: normal; font-size: 11.5px; color: var(--muted); white-space: nowrap }
.q-bar span { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap }
.q-bar.today i { background: var(--brand) }
.q-bar.today span { color: var(--brand) }
.q-bar .tip { display: none; position: absolute; bottom: calc(100% - 4px); left: 50%; transform: translateX(-50%); z-index: 3; padding: 4px 9px; border-radius: 8px; background: var(--brand-d); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap }
.q-bar:hover .tip { display: block }

/* ---------- 9. Danh sách đơn / sản phẩm / khách ---------- */
.q-bar-f { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px }
.q-bar-f .q-search { flex: 1 1 260px }
.q-tabs { display: flex; gap: 4px; margin: 0 0 10px; padding: 4px; border-radius: 13px; background: #e8eef7 }
.q-vm { width: auto; flex: none; margin: 0 }
.q-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap }
.q-tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(15, 23, 42, .12) }
.q-adv { margin-bottom: 14px; padding: 14px 16px 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--r) }
.q-adv .q-chips { padding-bottom: 10px }

.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; margin-bottom: 16px }
.q-it { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; min-width: 0; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; box-shadow: var(--sh); transition: border-color .15s, box-shadow .15s, transform .12s }
.q-it:hover { border-color: #b9cdf3; box-shadow: var(--sh2) }
.q-it.sel { border-color: var(--brand); background: var(--soft) }
.q-it.dim { opacity: .55 }
.q-it-m { min-width: 0 }
.q-it-m b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.q-it-m small { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.q-it-r { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right }
.q-it-r b { font-weight: 800 }
.q-it-r em { font-style: normal; font-size: 13px; font-weight: 500; color: var(--muted) }
.q-it-r small { font-size: 12.5px; color: var(--muted) }
.q-it-u { grid-column: 1 / -1; margin-top: 5px; font-size: 13px; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.q-it-f { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 9px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--muted) }
.q-ord { grid-template-columns: auto 1fr auto; padding-left: 20px }
.q-ord > .q-ck { align-self: center; margin-right: 2px }
.q-ord::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--line) }
.q-ord:has(.st-moi)::before { background: #60a5fa }
.q-ord:has(.st-chuanbi)::before { background: #f59e0b }
.q-ord:has(.st-dangiao)::before { background: #8b5cf6 }
.q-ord:has(.st-dagiao)::before { background: #22c55e }

.q-prod { grid-template-columns: 60px 1fr auto; align-items: center; gap: 4px 12px }
.q-prod.hid { opacity: .55 }
.q-pr { color: var(--brand); font-weight: 800; white-space: nowrap }
.q-pr small { font-weight: 500; color: var(--muted) }
.q-cust { grid-template-columns: auto 1fr auto; align-items: center; gap: 2px 12px }

.q-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; align-items: start; margin-bottom: 14px; padding-bottom: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 12px }
.q-day { min-height: 200px; overflow: hidden; scroll-snap-align: start; background: #f8fafd; border: 1px solid var(--line); border-radius: var(--r); transition: .15s }
.q-day[data-col=moi] { border-top: 4px solid #60a5fa }
.q-day[data-col=chuanbi] { border-top: 4px solid #f59e0b }
.q-day[data-col=dangiao] { border-top: 4px solid #8b5cf6 }
.q-day[data-col=dagiao] { border-top: 4px solid #22c55e }
.q-day.over { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37, 99, 235, .16) }
.q-day > header { display: flex; align-items: center; gap: 8px; padding: 11px 14px }
.q-day > header span { color: var(--muted); font-size: 13px }
.q-day > header b { margin-left: auto; font-weight: 800 }
.q-meals { display: grid; gap: 9px; padding: 0 10px 12px }
.q-meal { padding: 11px 13px; background: #fff; border: 1px solid var(--line); border-radius: 13px; cursor: grab; box-shadow: var(--sh); transition: border-color .15s }
.q-meal:hover { border-color: #b9cdf3 }
.q-meal.drag { opacity: .4 }
.q-meal-h { display: flex; align-items: center; gap: 9px }
.q-meal-h b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14.5px }
.q-meal-h b:last-child { flex: none }
.q-meal-d { margin: 6px 0 8px; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.q-meal-f { display: flex; align-items: center; justify-content: space-between; gap: 6px }

.q-tbl-wrap { overflow: auto; margin-bottom: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh) }
.q-tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px }
.q-tbl th { position: sticky; top: 0; padding: 12px 14px; text-align: left; background: var(--soft); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap }
.q-tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle }
.q-tbl tbody tr { cursor: pointer; transition: background .12s }
.q-tbl tbody tr:hover { background: var(--soft) }
.q-tbl tbody tr.sel { background: var(--brand-l) }
.q-tbl tbody tr:last-child td { border-bottom: 0 }
.q-tbl .r { text-align: right }
.q-tbl .mono { color: var(--brand-d); font-weight: 600; white-space: nowrap }
.q-tbl td small { display: block; font-size: 12.5px; color: var(--muted) }
.q-tbl td b { white-space: nowrap }
.q-tbl td:nth-child(3) { min-width: 150px }
.q-tbl .it { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2) }
.q-tbl .dim td { opacity: .55 }

.q-stop { padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh) }
.q-stop.done { opacity: .62 }
.q-sn { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: 14px }
.q-stop.done .q-sn { background: #16a34a }
.q-stop .ph { margin-top: 10px; font-size: 20px; font-weight: 800 }
.q-stop .ad { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; color: var(--ink2) }
.q-stop .ad i { margin-top: 3px; color: var(--brand) }
.q-cod { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 10px; font-weight: 800; font-size: 15px }
.q-cod.c1 { background: var(--warm-l); color: #7a5200 }
.q-cod.c2 { background: var(--ok-l); color: var(--ok) }
.q-acts3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px }
.q-acts3 .q-btn { min-height: 42px; padding: 8px 6px; font-size: 14px }
.q-stack { display: grid; gap: 8px; margin-top: 8px }
.q-stack .q-btn { min-height: 46px }

.q-zcard { margin-bottom: 10px; padding: 13px; background: #fff; border: 1px solid var(--line); border-radius: 14px }
.q-zcard-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px }
.q-zcard-h .q-in { flex: 1; font-weight: 700 }
.q-zsw { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px }
.q-zsw button { width: 26px; height: 26px; border-radius: 50%; background: hsl(var(--zh) 70% 55%); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line) }
.q-zsw button.on { box-shadow: 0 0 0 2px var(--ink) }
.q-ztest { margin-bottom: 12px; padding: 11px 13px; background: var(--soft); border-radius: 12px }

/* ---------- 10. Hộp thoại & biểu mẫu ---------- */
.q-ov { position: fixed; inset: 0; z-index: 1055; display: flex; align-items: center; justify-content: center; padding: clamp(10px, 3vw, 24px) }
.q-ov.cfm { z-index: 1080 }
.q-ov-bg { position: absolute; inset: 0; background: rgba(10, 18, 40, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .18s }
.q-box { position: relative; width: 100%; max-width: 580px; max-height: min(100%, calc(100dvh - 20px)); display: flex; flex-direction: column; background: #fff; border-radius: 22px; box-shadow: 0 24px 70px rgba(0, 0, 0, .3); animation: pop .2s ease-out }
.q-box.sm { max-width: 430px }
.q-box.lg { max-width: 920px }
.q-box.xl { max-width: 1120px; height: min(92vh, 880px) }
.q-box-h { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 14px 14px 22px; border-bottom: 1px solid var(--line2) }
.q-box-h h2 { font-size: 18px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em }
.q-box-h small { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted) }
.q-box-b { flex: 1; padding: 18px 22px; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch }
.q-box-f { flex: none; display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 13px 18px calc(13px + var(--sab)); border-top: 1px solid var(--line2); background: #fbfcfe; border-radius: 0 0 22px 22px }
.q-sp { flex: 1 }
.q-form { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 13px }
.q-form.one { grid-template-columns: 1fr }
.q-form .full { grid-column: 1 / -1 }
.q-form label, .q-fl { display: block; min-width: 0; font-size: 13px; font-weight: 600; color: var(--muted) }
.q-form label .q-in, .q-fl .q-in { margin-top: 5px; color: var(--ink); font-weight: 400 }
.q-seg { display: grid; gap: 7px }
.q-seg.c2 { grid-template-columns: 1fr 1fr }
.q-seg.c3 { grid-template-columns: repeat(3, 1fr) }
.q-seg button { padding: 10px 6px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink); font-weight: 600; font-size: 14px; line-height: 1.25 }
.q-seg button.on { border-color: var(--brand); background: var(--brand-l); color: var(--brand-d) }
.q-blk { margin-bottom: 13px; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: 15px }
.q-blk h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 11px; font-size: 12.5px; font-weight: 700; color: var(--brand-d); text-transform: uppercase; letter-spacing: .5px }
.q-blk .q-form { margin-bottom: 0 }

.q-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 6px }
.q-sum > div { padding: 12px 15px; background: var(--brand-l); border-radius: 13px }
.q-sum span { display: block; font-size: 13px; color: var(--brand-d) }
.q-sum b { font-size: 19px; font-weight: 800; color: var(--brand-d) }
.q-ir-box { margin-bottom: 12px; padding: 4px 14px; border: 1px solid var(--line); border-radius: 14px }
.q-ir { display: grid; grid-template-columns: 44px 1fr auto; gap: 11px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line2) }
.q-ir:last-child { border-bottom: 0 }
.q-ir b { font-weight: 600 }
.q-ir small { display: block; font-size: 12.5px; color: var(--muted) }
.q-ir .am { font-weight: 700 }
.q-tt { display: flex; justify-content: space-between; padding: 4px 14px; color: var(--ink2) }
.q-tt.big { margin-top: 7px; padding-top: 10px; border-top: 1.5px solid var(--ink); font-size: 19px; font-weight: 800; color: var(--ink) }
.q-tt.big span:last-child { color: var(--brand) }

.q-steps { display: flex; margin: 2px 0 18px }
.q-st { position: relative; flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted) }
.q-st:before { content: ''; position: absolute; top: 15px; left: -50%; right: 50%; height: 2px; background: #d6deeb }
.q-st:first-child:before { display: none }
.q-st i { position: relative; z-index: 1; width: 32px; height: 32px; display: grid; place-items: center; margin: 0 auto 6px; border-radius: 50%; background: #fff; border: 2px solid #d6deeb; font-size: 12px; color: var(--muted) }
.q-st.done { color: var(--ink2) }
.q-st.done:before, .q-st.cur:before { background: var(--brand) }
.q-st.done i { background: var(--brand); border-color: var(--brand); color: #fff }
.q-st.cur { color: var(--brand) }
.q-st.cur i { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 5px rgba(37, 99, 235, .14) }
.q-box-b .q-note, .q-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; padding: 9px 13px; background: var(--warm-l); border-radius: 11px; color: #7a5200; font-weight: 600 }
.q-cust-card { margin-bottom: 14px; padding: 15px; background: var(--soft); border: 1px solid var(--line); border-radius: 15px }
.q-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 13px }
.q-mini .q-btn { min-height: 40px; padding: 8px 6px }
.q-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 }
.q-tile { padding: 11px 13px; background: var(--soft); border: 1px solid var(--line); border-radius: 13px }
.q-tile b { display: block; font-size: 17px; font-weight: 800 }
.q-tile span { font-size: 12px; color: var(--muted) }
.q-pay { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 15px; background: var(--soft); border: 1px solid var(--line); border-radius: 13px }
.q-pay .grow { flex: 1 }
.q-pay small { display: block; font-size: 12.5px; color: var(--muted) }
.q-ok { width: 70px; height: 70px; display: grid; place-items: center; margin: 6px auto 12px; border-radius: 50%; background: var(--ok-l); color: var(--ok); font-size: 30px; animation: pop .35s }

/* Form lên đơn */
.q-of-tabs { flex: none; padding: 10px 14px 0 }
.q-of-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch }
.q-of-prod, .q-of-side { padding: 14px; overscroll-behavior: contain }
.q-of-side { background: #f7f9fd }
.q-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px }
.q-pt { display: grid; grid-template-columns: 56px 1fr auto; gap: 11px; align-items: center; min-width: 0; padding: 9px 11px; background: #fff; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s }
.q-pt:hover { border-color: #b9cdf3 }
.q-pt.sel { border-color: var(--brand); background: var(--soft); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13) }
.q-pt .q-th { width: 56px; height: 56px }
.q-pt .nm { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.q-pt .q-pr { font-size: 14px }
.q-step2 { display: inline-flex; align-items: center; overflow: hidden; background: #fff; border: 1px solid #cbd5e1; border-radius: 11px }
.q-step2 button { width: 36px; height: 36px; display: grid; place-items: center; background: #f1f5fb; color: var(--ink); font-size: 13px }
.q-step2 button:hover { background: var(--brand-l); color: var(--brand) }
.q-step2 b { min-width: 32px; text-align: center; font-weight: 700 }
.q-add { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-l); color: var(--brand); font-size: 14px }
.q-sugg { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: 3px; overflow: hidden; background: #fff; border: 1px solid #cbd5e1; border-radius: 13px; box-shadow: 0 14px 34px rgba(15, 23, 42, .18) }
.q-sugg button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--line2) }
.q-sugg button:last-child { border: 0 }
.q-sugg button:hover { background: var(--soft) }
.q-cl { display: grid; grid-template-columns: 44px 1fr auto; gap: 6px 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line2) }
.q-cl:last-child { border: 0 }
.q-cl .cn { font-weight: 600; line-height: 1.3 }
.q-cl .ct { font-size: 13.5px; font-weight: 800; color: var(--brand) }
.q-cl .l2 { grid-column: 2 / 4; display: flex; align-items: center; justify-content: space-between; gap: 8px }
.q-cl .q-in { width: 112px; min-height: 36px; padding: 5px 10px; text-align: right }
.q-reo { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 11px 13px; background: var(--brand-l); border-radius: 13px; color: var(--brand-d); font-size: 13px; font-weight: 600 }
.q-qc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px }
.q-qc button { height: 30px; padding: 0 12px; border: 1px dashed #b9c7dc; border-radius: 99px; color: var(--ink2); font-size: 12.5px; font-weight: 600 }
.q-qc button:hover { border-color: var(--brand); color: var(--brand) }
.q-of-sum { display: flex; flex-direction: column; margin-right: auto; line-height: 1.2 }
.q-of-sum small { font-size: 12.5px; font-weight: 600; color: var(--muted) }
.q-of-sum b { font-size: 21px; font-weight: 800; color: var(--brand) }
.q-box[data-tab=cart] .q-btn-next { display: none }

.q-pv { position: relative; height: 340px; margin-bottom: 14px; overflow: hidden; background: #e7edf6; border: 1px solid var(--line); border-radius: 15px }
.q-pv iframe { position: absolute; top: 10px; left: 50%; transform-origin: 50% 0; border: 0; background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .2) }
.q-pal-sw { display: flex; align-items: center; gap: 10px; min-height: 42px }

/* Cài đặt / tài khoản */
.q-me { display: flex; align-items: center; gap: 13px; margin-bottom: 13px }
.q-me b { font-size: 17px }
.q-me small { display: block; color: var(--muted) }
.q-lg { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line2); font-size: 13.5px }
.q-lg:last-child { border: 0 }
.q-lg small { grid-column: 1 / -1; color: var(--muted); word-break: break-word }
.q-secret { padding: 11px; text-align: center; word-break: break-all; user-select: all; background: var(--soft); border: 1px dashed #b9c7dc; border-radius: 11px; font: 700 16px/1.4 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 2px }
.q-qrbox { display: grid; place-items: center; margin: 10px 0 }
.q-qrbox img { width: 176px; height: 176px; padding: 8px; image-rendering: pixelated; background: #fff; border: 1px solid var(--line); border-radius: 13px }
.q-pwbar { height: 5px; margin-top: 7px; overflow: hidden; background: #e3eaf5; border-radius: 9px }
.q-pwbar i { display: block; width: 0; height: 100%; background: var(--chili); transition: .2s }

/* ---------- 11. Nút nổi, thanh thao tác nhiều đơn, thông báo ---------- */
.q-fab { position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(86px + var(--sab)); z-index: 900; display: none; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #1e40af); color: #fff; font-size: 22px; box-shadow: 0 12px 26px rgba(37, 99, 235, .45) }
body[data-role=shipper] .q-fab, body[data-role=shipper] .sb-cta { display: none !important }
.q-bulk {
  position: fixed; bottom: calc(22px + var(--sab)); left: calc(50% + var(--side) / 2); transform: translateX(-50%); z-index: 1000;
  display: none; align-items: center; gap: 6px; max-width: calc(100vw - var(--side) - 24px); padding: 8px; overflow-x: auto; scrollbar-width: none;
  background: #0f1d44; color: #fff; border-radius: 17px; box-shadow: 0 14px 36px rgba(10, 18, 48, .4);
}
.q-bulk::-webkit-scrollbar { display: none }
.q-bulk.show { display: flex }
.q-bulk .q-btn { flex: none; min-height: 38px; background: rgba(255, 255, 255, .14); border-color: transparent; color: #fff !important; box-shadow: none }
.q-bulk .q-btn:hover { background: rgba(255, 255, 255, .26) }
.q-bulk .q-btn.pri { background: var(--brand) }
.q-bulk .cn { flex: none; padding: 0 11px; font-weight: 700; white-space: nowrap }
.q-toasts { position: fixed; left: var(--side); right: 0; bottom: calc(22px + var(--sab)); z-index: 1090; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 14px; pointer-events: none }
.q-toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 540px; padding: 11px 18px; background: #0f1d44; color: #fff; border-radius: 13px; box-shadow: 0 10px 28px rgba(0, 0, 0, .28); font-weight: 500; font-size: 14.5px; animation: pop .2s }
.q-toast.err { background: var(--chili) }
.q-toast.out { opacity: 0; transition: .3s }
.q-toast .un { margin-left: 4px; padding: 2px 7px; border-radius: 7px; color: #9ec2ff; font-weight: 800 }
.q-toast .un:hover { background: rgba(255, 255, 255, .12) }

/* ---------- 12. Đăng nhập ---------- */
.q-login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: #fff }
.lg-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 56px clamp(32px, 6vw, 84px); color: #e6edfb;
  background: radial-gradient(90% 70% at 85% 0, rgba(96, 165, 250, .4), transparent 60%), linear-gradient(160deg, #0b1740 0%, #1e3a8a 62%, #2563eb 100%);
}
.lg-hero .brand-logo { width: 54px; height: 54px; font-size: 24px; border-radius: 16px }
.lg-hero h1 { margin: 0; color: #fff; font-size: clamp(30px, 3.4vw, 42px); font-weight: 800; line-height: 1.15; letter-spacing: -.03em }
.lg-hero p { margin: 10px 0 0; max-width: 460px; font-size: 16px; line-height: 1.6; color: #b8c8ea }
.lg-feats { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none }
.lg-feats li { display: flex; align-items: center; gap: 13px; font-weight: 600; color: #fff }
.lg-feats i { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: rgba(255, 255, 255, .14); font-size: 15px }
.lg-pane { display: grid; place-items: center; padding: max(24px, var(--sat)) 24px max(24px, var(--sab)); background: #fff }
.q-login-card { width: 100%; max-width: 400px }
.q-login-card .lg-mob { display: none }
.q-login-card h2 { font-size: 26px; font-weight: 800; letter-spacing: -.03em }
.q-login-card p { margin: 5px 0 24px; color: var(--muted) }
.q-login-card label { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--muted) }
.q-login-card label .q-in { margin-top: 5px; color: var(--ink); font-weight: 400 }
.q-login-card .q-btn { width: 100%; min-height: 48px; margin-top: 6px; font-size: 16px; border-radius: 13px }
.q-login-err { min-height: 20px; margin-top: 12px; text-align: center; color: var(--chili); font-size: 14px }
.q-pwbox { position: relative }
.q-pwbox .q-in { padding-right: 46px }
.q-pwbox button { position: absolute; right: 5px; top: 5px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--muted) }
#code { text-align: center; letter-spacing: 5px; font-weight: 700 }
.q-logo { width: 52px; height: 52px; display: grid; place-items: center; flex: none; margin-bottom: 16px; border-radius: 16px; background: linear-gradient(135deg, #fcd34d, #f59e0b); color: #1e3a8a; font-size: 24px; box-shadow: 0 8px 20px rgba(245, 158, 11, .3) }

/* ---------- 13. Responsive ---------- */
@media (min-width: 992px) {
  .q-of-tabs { display: none }
  .q-of-body { display: grid; grid-template-columns: minmax(0, 1fr) 400px; overflow: hidden }
  .q-of-prod, .q-of-side { overflow: auto; padding: 16px 18px }
  .q-of-side { border-left: 1px solid var(--line) }
  .q-box[data-tab] .q-of-prod, .q-box[data-tab] .q-of-side { display: block }
  .q-btn-next { display: none !important }
}
@media (max-width: 1180px) {
  .q-stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .q-sched { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media (max-width: 899px) {
  .q-login { grid-template-columns: 1fr; background: radial-gradient(90% 70% at 85% 0, rgba(96, 165, 250, .4), transparent 60%), linear-gradient(160deg, #0b1740 0%, #1e3a8a 62%, #2563eb 100%) }
  .lg-hero { display: none }
  .lg-pane { background: transparent }
  .q-login-card { padding: 30px 26px; background: #fff; border-radius: 24px; box-shadow: 0 24px 70px rgba(0, 0, 0, .32) }
  .q-login-card .lg-mob { display: grid }
}
@media (max-width: 991px) {
  /* Thanh trên cùng */
  .sidebar {
    position: sticky; top: 0; left: auto; bottom: auto; width: auto; z-index: 60;
    flex-direction: row; align-items: center; gap: 8px; overflow: visible;
    padding: calc(10px + var(--sat)) 14px 10px;
    background: linear-gradient(135deg, #0f1d44 0%, #1e3a8a 70%, #2563eb 100%);
    box-shadow: 0 4px 16px rgba(15, 29, 68, .18);
  }
  .sb-brand { flex: 1; padding: 0; gap: 11px }
  .brand-logo { width: 38px; height: 38px; font-size: 16px; border-radius: 12px }
  .brand-title { font-size: 15px }
  .brand-sub { font-size: 12px }
  .sb-cta, .sb-user { display: none }
  .sb-foot { display: block; margin: 0; padding: 0; border: 0 }
  .sb-actions { display: flex; gap: 6px }
  .q-sync { padding: 10px; background: rgba(255, 255, 255, .1); color: #fff !important }
  .q-sync span { display: none }
  .btn-logout { padding: 10px 12px }
  .btn-logout span { display: none }

  /* Thanh điều hướng dưới cùng */
  .q-tabs-wrap {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; flex: none;
    padding: 6px 6px calc(6px + var(--sab));
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--line); box-shadow: 0 -8px 26px rgba(15, 23, 42, .07);
  }
  #q-nav { flex-direction: row; gap: 2px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch }
  #q-nav::-webkit-scrollbar { display: none }
  #q-nav li { flex: 1 0 54px; scroll-snap-align: center }
  #q-nav .nav-link { flex-direction: column; justify-content: center; gap: 4px; padding: 8px 3px 7px; border-radius: 13px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: -.01em }
  #q-nav .nav-link i { width: auto; font-size: 18px }
  #q-nav .nav-link:hover { background: var(--soft); color: var(--ink) }
  #q-nav .nav-link.active { background: var(--brand-l); color: var(--brand) }
  #q-nav .nav-link.active::before { display: none }
  #q-nav .nb { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; font-size: 10.5px }

  .shell-main { margin-left: 0; padding: 16px 14px calc(98px + var(--sab)) }
  .app-footer { display: none }
  .q-fab { display: grid }
  .q-bulk { left: 50%; max-width: calc(100vw - 20px); bottom: calc(92px + var(--sab)) }
  .q-toasts { left: 0; bottom: calc(92px + var(--sab)) }

  /* Hộp thoại dạng tờ giấy trượt từ dưới */
  .q-ov { padding: 0; align-items: flex-end }
  .q-box, .q-box.sm { max-width: none; max-height: 92dvh; border-radius: 22px 22px 0 0; animation: slide .24s ease-out }
  .q-box.lg, .q-box.xl { max-width: none; height: 100dvh; max-height: 100dvh; border-radius: 0 }
  .q-box.lg .q-box-h, .q-box.xl .q-box-h { padding-top: calc(14px + var(--sat)) }
  .q-box:not(.lg):not(.xl)::before { content: ''; flex: none; width: 42px; height: 4px; margin: 9px auto 0; border-radius: 9px; background: #d5dce8 }
  .q-box-f { border-radius: 0 }
  .q-box-b { padding: 14px }

  .q-in { font-size: 16px }
  .q-vm .q-tab[data-m=table] { display: none }
  .q-tbl-wrap { display: none }
  .q-pgrid { grid-template-columns: 1fr }
  .q-box[data-tab=prod] .q-of-side { display: none }
  .q-box[data-tab=cart] .q-of-prod { display: none }
  .q-box[data-tab=prod] .q-btn-save, .q-box[data-tab=prod] .q-btn-cancel { display: none }
}
@media (max-width: 767px) {
  .q-cols { grid-template-columns: minmax(0, 1fr) }
}
@media (max-width: 700px) {
  .q-hero { grid-template-columns: 1fr; padding: 20px 20px 22px }
  .q-hero .big { font-size: 58px }
  .q-hero-go { width: 100%; justify-content: center }
}
@media (max-width: 639px) {
  .q-stats:not(.four) { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .q-stats:not(.four) > .q-stat:first-child { grid-column: 1 / -1 }
}
@media (max-width: 600px) {
  .shell-main { padding: 14px 12px calc(98px + var(--sab)) }
  .q-head > div:first-child { flex: 1 1 100% }
  .q-head-a { flex: 1 1 100% }
  .q-head-a .q-btn { flex: 1 }
  .q-bar-f > .q-chips { flex: 1 1 100% !important }
  .q-date { flex: 1 1 140px }
  .q-card-h { padding: 12px 14px }
  .q-card-b { padding: 4px 14px 12px }
  .q-it { padding: 13px 14px }
  .q-ord { padding-left: 18px }
  .q-stat { padding: 13px 14px }
  .q-box-h { padding: 12px 8px 10px 16px }
  .q-box-b { padding: 14px 16px }
  .q-box-f { padding: 10px 12px calc(10px + var(--sab)) }
  .q-sp { display: none }
  .q-box-f > .q-btn { flex: 1 1 auto }
  .q-box-f > .q-btn.pri { flex: 2 1 140px }
  .q-box-f > .q-of-sum { flex: 1 1 auto }
  .q-of-sum ~ .q-btn { flex: 0 0 auto !important }
  .q-toasts { padding: 0 12px }
  .q-board { grid-auto-columns: 84vw }
  .q-bars { gap: 5px; padding: 20px 6px 10px }
}
@media (max-width: 420px) {
  .q-form { grid-template-columns: 1fr }
  .q-stat b { font-size: 19px }
  .q-stats.four .q-stat b { font-size: 18px }
  .q-sc b { font-size: 28px }
}
@media (pointer: coarse) {
  .q-ib { width: 40px; height: 40px }
  .q-btn.sm { min-height: 38px }
  .q-chip { min-height: 38px }
  .q-in { font-size: 16px }
}
@media (prefers-reduced-motion: reduce) {
  #qldh *, .q-ov * { animation: none !important; transition: none !important }
  html { scroll-behavior: auto }
}

/* ---------- 14. Tối ưu dễ nhìn, dễ bấm ---------- */
.q-stabs { margin-bottom: 16px; overflow-x: auto; scrollbar-width: none }
.q-stabs::-webkit-scrollbar { display: none }
.q-stabs .q-tab { flex: 1 0 auto }
/* hàng thao tác của thẻ đơn: nút chính luôn dễ bấm, nằm bên phải */
.q-ord .q-it-f > span:last-child { margin-left: auto }
.q-it-f .q-tags { flex: 1 1 auto; min-width: 0 }
@media (max-width: 991px) {
  /* nút "Tạo đơn" trùng với nút + nổi -> ẩn trên điện thoại */
  .q-head-a [data-act=newOrder] { display: none }
  .q-head-a:empty { display: none }
  .q-head { margin-bottom: 12px }
  .q-head h2 { font-size: 22px }
  /* ô tìm kiếm + kiểu xem nằm chung 1 hàng, kiểu xem chỉ còn biểu tượng */
  .q-bar-f { flex-wrap: nowrap; gap: 8px }
  .q-bar-f .q-search { flex: 1 1 auto !important; min-width: 0 }
  .q-bar-f .q-vm { flex: none !important; margin: 0 }
  .q-vm .q-tab { flex: none !important; width: 44px; padding: 8px 0; font-size: 0; gap: 0 }
  .q-vm .q-tab i { font-size: 16px }
  /* thẻ đơn: nút thao tác chiếm cả hàng cho dễ bấm bằng ngón cái */
  .q-ord .q-it-f { flex-direction: column; align-items: stretch; gap: 10px }
  .q-ord .q-it-f .q-tags { justify-content: flex-start }
  .q-ord .q-it-f > span:last-child { margin-left: 0; display: flex !important; gap: 8px; align-items: center }
  .q-ord .q-it-f > span:last-child .q-btn { flex: 1; min-height: 42px; font-size: 14.5px }
  .q-ord .q-it-f > span:last-child .q-ib { flex: none; background: var(--soft) }
}
@media (max-width: 600px) {
  .q-bar-f .q-search { flex-basis: 0 !important }
}
.q-fgl { margin: 2px 2px 7px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px }
.q-adv-f { padding: 4px 0 12px }
.q-adv .q-chips { flex-wrap: wrap; overflow: visible; padding-bottom: 8px }
/* nhãn NGÀY GIAO: tách rõ với ngày tạo đơn */
.q-due { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap }
.q-due.now { background: var(--warm-l); color: #7a5200; box-shadow: inset 0 0 0 1px #f2d58f }
.q-due.later { background: var(--vio-l); color: var(--vio); box-shadow: inset 0 0 0 1px #d6cdf0 }
.q-due.late { background: var(--chili-l); color: var(--chili); box-shadow: inset 0 0 0 1px #fecaca }

/* ---------- 15. Hướng dẫn cho người mới ---------- */
.sb-actions .btn-logout.help { background: transparent; border-color: rgba(255, 255, 255, .14); color: #cbd7ee !important }
.q-guide { margin-bottom: 18px; padding: 18px 20px; background: linear-gradient(135deg, #fffbeb, #fff7e0); border: 1px solid #f6dd9c; border-radius: 18px }
.q-guide-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px }
.q-guide-h h3 { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 800; color: #78350f }
.q-guide-h p { margin-top: 2px; color: #92400e; font-size: 13.5px }
.q-guide-a { display: flex; gap: 6px }
.q-gsteps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px }
.q-gs { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; padding: 13px 14px; background: #fff; border: 1px solid #f1e3b6; border-radius: 14px }
.q-gs .q-btn { grid-column: 2; justify-self: start; margin-top: 4px }
.q-gn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--warm); color: #fff; font-weight: 800 }
.q-gt b { display: block; font-size: 14.5px }
.q-gt small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); line-height: 1.45 }
.q-flowrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--faint) }
.q-flowrow .q-tag { font-size: 13px; padding: 4px 12px }
.q-ol { margin: 0; padding-left: 22px; display: grid; gap: 7px; color: var(--ink2); line-height: 1.5 }
.q-legend { display: grid; gap: 9px }
.q-legend > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
.q-legend small { color: var(--muted); font-size: 13px }

/* ---------- 16. Chế độ đơn giản (mặc định): ẩn bớt nút và trạng thái ---------- */
body.simple .q-vm,
body.simple .q-sched, body.simple .q-sh, body.simple .q-more,
body.simple [data-act=shipStart], body.simple [data-act=zoneStart],
body.simple .q-steps,
body.simple .q-box-f .q-ib.lg,
body.simple .q-ord > .q-ck,
body.simple .q-it-f .q-ib[data-act=editOrder] { display: none !important }
body.simple .q-ord { grid-template-columns: 1fr auto }

/* ---------- 17. Đơn hàng (chế độ đơn giản): 2 khu lớn, chia theo ngày và khu vực ---------- */
.q-bigtabs { padding: 5px; margin-bottom: 12px; border-radius: 16px }
.q-bigtabs .q-tab { padding: 14px 10px; font-size: 16px; font-weight: 700; border-radius: 12px }
.q-bigtabs .q-tab b { font-size: 12.5px; padding: 1px 9px; border-radius: 99px; background: #dbe5f5; color: var(--ink2) }
.q-bigtabs .q-tab.on b { background: var(--brand); color: #fff }
.q-bigtabs .q-tab[data-t=todo].on { color: var(--brand-d) }
.q-bigtabs .q-tab[data-t=done].on { color: var(--ok) }
.q-bigtabs .q-tab[data-t=done].on b { background: #16a34a }
.q-dsec { margin: 22px 0 10px; padding: 9px 14px; font-size: 16px; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: 12px; align-items: center }
.q-dsec:first-child { margin-top: 4px }
.q-dsec.now { border-left-color: var(--warm); background: #fffbeb }
.q-dsec.late { border-left-color: var(--chili); background: #fef2f2; color: var(--chili) }
.q-zh { display: flex; align-items: center; gap: 8px; margin: 12px 4px 8px; font-weight: 700; font-size: 14px; color: var(--ink2) }
.q-zh small { color: var(--muted); font-weight: 500 }
