/* ANS Desk – giao diện điện thoại */
:root {
  --bg: #f2f5f4;
  --card: #ffffff;
  --ink: #12201f;
  --ink-2: #4b5d5b;
  --ink-3: #8a9a98;
  --line: #e3eae8;
  --brand: #0b3b3c;
  --brand-2: #135e5f;
  --brand-soft: #e3f1ef;
  --accent: #f97316;
  --accent-soft: #fff1e6;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b91c1c;
  --warn-soft: #fdecec;
  --info: #1d4ed8;
  --info-soft: #e8eefe;
  --violet: #6d28d9;
  --violet-soft: #f1ebfe;
  --radius: 16px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-size: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans Lao", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
  overscroll-behavior-y: contain;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; }
[hidden] { display: none !important; }

/* ---------- top ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand);
  color: #fff;
  padding: calc(10px + var(--safe-t)) 14px 10px;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 6px 20px rgba(11, 59, 60, .18);
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: #fff; color: var(--brand);
  display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: 0 0 34px;
}
.brand-name { font-weight: 700; font-size: 16px; line-height: 1.1; }
.brand-sub { font-size: 11.5px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.top-actions { display: flex; gap: 6px; }
.icon-btn, .lang-btn {
  height: 38px; min-width: 38px; border-radius: 12px; background: rgba(255,255,255,.12);
  color: #fff; font-size: 18px; display: grid; place-items: center; padding: 0 8px;
}
.lang-btn { font-size: 13px; font-weight: 700; letter-spacing: .5px; }
.icon-btn:active, .lang-btn:active { background: rgba(255,255,255,.25); }
.icon-btn.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-bar { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.page-bar::-webkit-scrollbar { display: none; }
.page-pill {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px 0 3px;
  border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font-size: 12.5px; white-space: nowrap;
  border: 1.5px solid transparent;
}
.page-pill.all { padding: 0 14px; }
.page-pill img, .page-pill .pp-fallback { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #fff; color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.page-pill.on { background: #fff; color: var(--brand); border-color: #fff; font-weight: 700; }
.page-pill .pp-count { font-size: 11px; opacity: .8; }

.search-wrap { position: relative; margin-top: 10px; }
.search-wrap input {
  width: 100%; height: 42px; border-radius: 12px; border: 0; padding: 0 12px 0 36px;
  background: #fff; color: var(--ink); font-size: 15px; outline: none;
}
.search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 18px; }

.chip-row { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.chip-line { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip-line::-webkit-scrollbar { display: none; }
.chip-line-date .fchip { height: 28px; font-size: 12px; padding: 0 11px; }
.chip-line-date .fchip-select { margin-left: auto; }
.fchip {
  flex: 0 0 auto; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px;
  background: rgba(255,255,255,.12); color: #fff; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.fchip.on { background: #fff; color: var(--brand); font-weight: 700; }
.fchip .n { font-size: 11px; background: rgba(0,0,0,.15); border-radius: 999px; padding: 0 6px; }
.fchip.on .n { background: var(--brand-soft); }
.fchip.sep { background: none; padding: 0 2px; opacity: .4; }

/* ---------- banner ---------- */
.banner {
  margin: 10px 12px 0; padding: 10px 12px; border-radius: 12px; font-size: 13px;
  background: var(--accent-soft); color: #9a3412; border: 1px solid #fed7aa;
}
.banner a { color: inherit; font-weight: 700; }

/* ---------- list ---------- */
.list { padding: 10px 12px 0; display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 12px;
  box-shadow: 0 1px 2px rgba(18,32,31,.05); border: 1px solid var(--line);
  position: relative;
}
.card:active { background: #f8fbfa; }
.row { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 44px; height: 44px; border-radius: 14px; flex: 0 0 44px; overflow: hidden;
  background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.grow { flex: 1; min-width: 0; }
.name { font-weight: 700; font-size: 15.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { font-size: 12px; color: var(--ink-3); }
.snip { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag {
  font-size: 11.5px; height: 22px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px;
  background: #eef2f1; color: var(--ink-2); white-space: nowrap;
}
.tag.phone { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.tag.pos { background: var(--violet-soft); color: var(--violet); font-weight: 600; }
.tag.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, #999); }
.tag.hal { background: #ffe4e6; color: #be123c; font-weight: 700; }
.right { text-align: right; flex: 0 0 auto; }
.money { font-weight: 700; color: var(--brand); white-space: nowrap; }
.time { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.x-btn {
  width: 32px; height: 32px; border-radius: 10px; color: var(--ink-3); font-size: 15px; display: grid; place-items: center; flex: 0 0 32px;
}
.x-btn:active { background: #eef2f1; }
.check {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid #c7d3d1; flex: 0 0 26px; display: grid; place-items: center;
  color: #fff; font-size: 15px; font-weight: 800;
}
.check.on { background: var(--brand); border-color: var(--brand); }
.status {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  background: #eef2f1; color: var(--ink-2); white-space: nowrap;
}
.status.pending { background: var(--accent-soft); color: #c2410c; }
.status.ship { background: var(--info-soft); color: var(--info); }
.status.arrived { background: #e0f2fe; color: #0369a1; }
.status.done { background: var(--ok-soft); color: var(--ok); }
.status.warn { background: var(--warn-soft); color: var(--warn); }

.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty .big { font-size: 40px; margin-bottom: 8px; }
.empty strong { display: block; color: var(--ink-2); margin-bottom: 4px; }
.more-btn { margin: 4px auto 0; height: 44px; padding: 0 22px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-weight: 600; color: var(--brand); }
.skeleton { height: 92px; border-radius: var(--radius); background: linear-gradient(90deg, #e9eeed 0%, #f5f8f7 50%, #e9eeed 100%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1fr 1fr;
}
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink-3); font-size: 12px; }
.tab-ico { font-size: 22px; line-height: 1; filter: grayscale(1); opacity: .6; }
.tab.on { color: var(--brand); font-weight: 700; }
.tab.on .tab-ico { filter: none; opacity: 1; }
.tab-badge {
  position: absolute; top: 6px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}

/* ---------- select bar (bulk) ---------- */
.select-bar {
  position: fixed; left: 10px; right: 10px; z-index: 31;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px);
  background: var(--ink); color: #fff; border-radius: 16px; padding: 8px 8px 8px 14px;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.select-bar .sb-count { flex: 1; font-size: 14px; }
.select-bar button { height: 42px; padding: 0 14px; border-radius: 12px; font-weight: 700; font-size: 14px; }
.select-bar .sb-ghost { background: rgba(255,255,255,.12); color: #fff; }
.select-bar .sb-main { background: var(--accent); color: #fff; }

/* ---------- full screen (detail) ---------- */
.screen {
  position: fixed; inset: 0; z-index: 40; background: var(--bg);
  display: flex; flex-direction: column;
  animation: slideIn .18s ease-out;
}
@keyframes slideIn { from { transform: translateX(12%); } to { transform: none; } }
.scr-head {
  background: var(--brand); color: #fff; padding: calc(8px + var(--safe-t)) 8px 10px;
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
}
.back-btn { width: 42px; height: 42px; border-radius: 12px; font-size: 22px; color: #fff; display: grid; place-items: center; flex: 0 0 42px; }
.back-btn:active { background: rgba(255,255,255,.15); }
.scr-head .avatar { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; background: #fff; }
.scr-title { font-weight: 700; font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scr-sub { font-size: 12px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scr-head .icon-btn { background: rgba(255,255,255,.12); }
.scr-body { flex: 1; overflow-y: auto; padding: 12px 12px 24px; -webkit-overflow-scrolling: touch; }
.scr-foot {
  flex: 0 0 auto; background: #fff; border-top: 1px solid var(--line);
  padding: 10px 12px calc(10px + var(--safe-b)); display: flex; gap: 8px;
}
.btn {
  height: 50px; border-radius: 14px; padding: 0 16px; font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1;
  background: var(--brand-soft); color: var(--brand);
}
.btn.main { background: var(--brand); color: #fff; }
.btn.hot { background: var(--accent); color: #fff; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
.btn.small { height: 40px; font-size: 13.5px; border-radius: 12px; flex: 0 0 auto; }
.btn:disabled { opacity: .5; }
.btn:active:not(:disabled) { transform: scale(.98); }

.sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.sec-title { font-size: 12.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sec-title .link { text-transform: none; letter-spacing: 0; color: var(--brand-2); font-weight: 600; font-size: 13px; }

/* messages */
.msgs { display: flex; flex-direction: column; gap: 6px; max-height: 34vh; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.msgs.open { max-height: none; }
.msg { max-width: 82%; padding: 8px 11px; border-radius: 16px; font-size: 14px; background: #eef2f1; align-self: flex-start; word-wrap: break-word; }
.msg .mt { white-space: pre-line; }
.msg.me { align-self: flex-end; background: var(--brand-soft); }
.msg .m-time { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.msg-photos { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.msg-photos img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; }
.msg .ph { color: var(--ok); font-weight: 700; text-decoration: underline; }

/* form */
.field { margin-bottom: 10px; }
.field:last-child { margin-bottom: 0; }
.lbl { font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin-bottom: 4px; display: flex; justify-content: space-between; gap: 6px; }
.lbl .hint { font-weight: 500; color: var(--ok); }
.inp {
  width: 100%; height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: #fbfdfc;
  padding: 0 12px; font-size: 16px; outline: none;
}
.inp:focus { border-color: var(--brand-2); background: #fff; }
.inp.big { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
textarea.inp { height: 70px; padding: 10px 12px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

.branch-picked {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--ok-soft); border: 1.5px solid #bfe5cc;
}
.branch-picked .bp-name { font-weight: 700; font-size: 15px; color: #14532d; }
.branch-picked .bp-area { font-size: 12.5px; color: #3f6b50; }
.branch-results { margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; max-height: 300px; overflow-y: auto; }
.branch-item { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.branch-item:last-child { border-bottom: 0; }
.branch-item:active { background: var(--brand-soft); }
.branch-item .bi-name { font-weight: 600; font-size: 14.5px; }
.branch-item .bi-area { font-size: 12px; color: var(--ink-3); }
.branch-item.sug { background: #f6fbf9; }
.bi-badge { font-size: 10.5px; color: var(--ok); font-weight: 700; margin-left: 4px; }

.cart-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.cart-row:last-of-type { border-bottom: 0; }
.cart-img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: #eef2f1; flex: 0 0 46px; }
.cart-name { font-size: 13.5px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-price { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 0 8px; font-size: 14px; margin-top: 4px; background: #fbfdfc; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex: 0 0 auto; }
.stepper button { width: 34px; height: 36px; font-size: 18px; color: var(--brand); background: #f6faf9; }
.stepper span { min-width: 26px; text-align: center; font-weight: 700; }
.add-prod { width: 100%; height: 46px; border-radius: 12px; border: 1.5px dashed #b9cbc8; color: var(--brand-2); font-weight: 700; margin-top: 8px; }
.total-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.total-row strong { font-size: 18px; color: var(--brand); }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.switch { width: 50px; height: 30px; border-radius: 999px; background: #cfd9d7; position: relative; flex: 0 0 50px; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(20px); }

.info-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; }
.info-grid .k { color: var(--ink-3); white-space: nowrap; }
.info-grid .v { font-weight: 600; word-break: break-word; }
.info-grid a { color: var(--brand-2); }
.bill-img { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: #fff; min-height: 120px; }
.bill-wrap { position: relative; }
.bill-wrap .bill-zoom { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 8px; }

.done-box { text-align: center; padding: 28px 12px; }
.done-box .big { font-size: 52px; }
.done-box h3 { margin: 6px 0; }

/* ---------- bottom sheet ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(10,20,20,.45); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 88vh;
  background: #fff; border-radius: 22px 22px 0 0; display: flex; flex-direction: column;
  padding-bottom: var(--safe-b); animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(30%); } }
.sheet-grip { width: 42px; height: 5px; border-radius: 9px; background: #d5dedc; margin: 8px auto 4px; flex: 0 0 auto; }
.sheet-head { padding: 4px 14px 10px; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.sheet-head h3 { margin: 0; font-size: 17px; flex: 1; }
.sheet-body { overflow-y: auto; padding: 0 14px 14px; }
.prod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prod-tile { border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; text-align: left; position: relative; }
.prod-tile img, .prod-tile .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; background: #eef2f1; display: grid; place-items: center; font-size: 26px; }
.prod-tile .pt-name { font-size: 12px; font-weight: 600; padding: 4px 6px 0; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.prod-tile .pt-price { font-size: 12px; color: var(--brand); font-weight: 700; padding: 2px 6px 6px; }
.prod-tile.in { border-color: var(--brand); }
.prod-tile .pt-q { position: absolute; top: 6px; right: 6px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; min-width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; padding: 0 6px; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); text-align: left; font-size: 15px; }
.menu-item:last-child { border-bottom: 0; }
.menu-item .mi-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); display: grid; place-items: center; font-size: 18px; flex: 0 0 36px; }
.menu-item .mi-sub { font-size: 12px; color: var(--ink-3); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; z-index: 80; bottom: calc(var(--tabbar-h) + var(--safe-b) + 18px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: all .2s;
  background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 14px;
  max-width: calc(100vw - 32px); width: max-content; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.screen ~ .toast.show, body.has-screen .toast { bottom: calc(90px + var(--safe-b)); }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.92); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: 8px; }
.lightbox .lb-close { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 20px; }

@media (min-width: 700px) and (max-width: 999px) {
  body { max-width: 560px; margin: 0 auto; box-shadow: 0 0 0 1px var(--line); min-height: 100vh; }
  .tabbar, .select-bar, .screen, .sheet { max-width: 560px; margin: 0 auto; }
  .select-bar { left: 50%; transform: translateX(-50%); width: calc(min(560px, 100vw) - 20px); right: auto; }
}

/* =====================================================================
   HIỆU ỨNG (chỉ dùng transform/opacity để mượt trên điện thoại yếu)
   ===================================================================== */
.top {
  background: linear-gradient(135deg, #0b3b3c 0%, #135e5f 55%, #1b7a70 100%);
  background-size: 200% 200%;
  animation: topShift 14s ease-in-out infinite alternate;
}
@keyframes topShift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.brand-mark { animation: markIn .6s cubic-bezier(.2,1.4,.4,1) both; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
@keyframes markIn { from { transform: scale(.4) rotate(-20deg); opacity: 0; } }

/* thẻ danh sách xuất hiện lần lượt */
.list > .card { animation: cardIn .38s cubic-bezier(.2,.8,.2,1) both; }
.list > .card:nth-child(1) { animation-delay: .02s; }
.list > .card:nth-child(2) { animation-delay: .05s; }
.list > .card:nth-child(3) { animation-delay: .08s; }
.list > .card:nth-child(4) { animation-delay: .11s; }
.list > .card:nth-child(5) { animation-delay: .14s; }
.list > .card:nth-child(6) { animation-delay: .17s; }
.list > .card:nth-child(7) { animation-delay: .20s; }
.list > .card:nth-child(8) { animation-delay: .23s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.card { transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease; }
.card:active { transform: scale(.975); box-shadow: 0 1px 1px rgba(0,0,0,.04); }
@media (hover: hover) { .card:hover { box-shadow: 0 8px 22px rgba(18,32,31,.08); border-color: #cfe0dc; } }

/* viền màu bên trái theo trạng thái */
.card::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0;
  background: transparent; transition: background .2s;
}
.card:has(.status.pending)::before { background: var(--accent); }
.card:has(.status.ship)::before { background: var(--info); }
.card:has(.status.arrived)::before { background: #0ea5e9; }
.card:has(.status.done)::before { background: var(--ok); }
.card:has(.status.warn)::before { background: var(--warn); }
.card:has(.tag.pos)::before { background: var(--violet); }

/* avatar page có vòng sáng nhẹ */
.avatar { transition: transform .2s; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--brand-soft); }
.card:active .avatar { transform: scale(.92); }

/* thẻ đơn đang chờ đẩy: chấm cam nhấp nháy */
.status.pending { position: relative; padding-left: 16px; }
.status.pending::after {
  content: ""; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: var(--accent); animation: ping 1.6s ease-out infinite;
}
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(249,115,22,.55); } 80%, 100% { box-shadow: 0 0 0 7px rgba(249,115,22,0); } }

/* chip lọc + page */
.fchip, .page-pill { transition: background .2s, color .2s, transform .12s; }
.fchip:active, .page-pill:active { transform: scale(.93); }
.fchip.on, .page-pill.on { animation: chipOn .25s cubic-bezier(.2,1.5,.4,1); }
@keyframes chipOn { from { transform: scale(.88); } }
.search-wrap input { transition: box-shadow .2s; }
.search-wrap input:focus { box-shadow: 0 0 0 3px rgba(255,255,255,.35); }

/* thanh tab dưới: vạch sáng chạy theo tab đang chọn */
.tabbar { box-shadow: 0 -6px 20px rgba(18,32,31,.06); }
.tab::before {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 4px 4px;
  background: var(--brand); transform: scaleX(0); transition: transform .25s cubic-bezier(.2,.9,.3,1.2);
}
.tab.on::before { transform: scaleX(1); }
.tab .tab-ico { transition: transform .25s cubic-bezier(.2,1.6,.4,1), filter .2s, opacity .2s; }
.tab.on .tab-ico { transform: translateY(-2px) scale(1.12); }
.tab:active .tab-ico { transform: scale(.85); }
.tab-badge { animation: badgePop .4s cubic-bezier(.2,1.8,.4,1); box-shadow: 0 2px 6px rgba(249,115,22,.4); }
@keyframes badgePop { from { transform: scale(0); } }

/* nút */
.btn { position: relative; overflow: hidden; transition: transform .1s, box-shadow .2s, opacity .2s; }
.btn.main, .btn.hot { box-shadow: 0 6px 16px rgba(11,59,60,.22); }
.btn.hot { background: linear-gradient(135deg, #fb923c, #f97316 50%, #ea580c); box-shadow: 0 6px 18px rgba(249,115,22,.35); }
.btn.hot::after, .btn.main::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.btn:disabled::after { display: none; }
.btn:active:not(:disabled) { transform: scale(.96); }
.add-prod { transition: background .2s, transform .1s; }
.add-prod:active { transform: scale(.98); background: var(--brand-soft); }
.stepper button:active { background: var(--brand-soft); transform: scale(.9); }
.icon-btn, .lang-btn, .back-btn, .x-btn { transition: transform .12s, background .2s; }
.icon-btn:active, .lang-btn:active, .back-btn:active, .x-btn:active { transform: scale(.88); }

/* màn hình chi tiết + các khối */
.screen { animation: slideIn .28s cubic-bezier(.2,.9,.25,1); }
.scr-head { background: linear-gradient(135deg, #0b3b3c, #135e5f); }
.scr-body .sec { animation: secIn .35s cubic-bezier(.2,.8,.2,1) both; }
.scr-body .sec:nth-child(2) { animation-delay: .05s; }
.scr-body .sec:nth-child(3) { animation-delay: .10s; }
.scr-body .sec:nth-child(4) { animation-delay: .15s; }
@keyframes secIn { from { opacity: 0; transform: translateY(12px); } }
.scr-foot { box-shadow: 0 -8px 24px rgba(18,32,31,.07); }

.inp { transition: border-color .2s, box-shadow .2s, background .2s; }
.inp:focus { box-shadow: 0 0 0 4px rgba(19,94,95,.12); }

/* tin nhắn */
.msg { animation: msgIn .3s ease-out both; }
.msg.me { background: linear-gradient(135deg, #e3f1ef, #d3ebe7); }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.msg-photos img { transition: transform .15s; }
.msg-photos img:active { transform: scale(.94); }
.msg .ph { background: var(--ok-soft); border-radius: 6px; padding: 0 3px; text-decoration: none; }

/* chi nhánh đã chọn */
.branch-picked { animation: picked .4s cubic-bezier(.2,1.4,.4,1); }
@keyframes picked { from { transform: scale(.94); opacity: .3; } }
.branch-item { transition: background .15s; animation: fadeIn .2s ease both; }
@keyframes fadeIn { from { opacity: 0; } }

/* sản phẩm */
.prod-tile { transition: transform .12s, border-color .2s, box-shadow .2s; animation: cardIn .3s ease both; }
.prod-tile:active { transform: scale(.94); }
.prod-tile.in { box-shadow: 0 0 0 3px rgba(11,59,60,.12); }
.prod-tile .pt-q { animation: badgePop .3s cubic-bezier(.2,1.8,.4,1); }
.cart-row { animation: cardIn .3s ease both; }

/* bottom sheet, toast, lightbox, thanh chọn */
.sheet { animation: up .32s cubic-bezier(.2,1.1,.3,1); box-shadow: 0 -10px 40px rgba(0,0,0,.2); }
@keyframes up { from { transform: translateY(100%); } }
.sheet-bg { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.toast { transition: opacity .25s, transform .35s cubic-bezier(.2,1.6,.4,1); }
.lightbox { animation: fade .2s; }
.lightbox img { animation: zoomIn .3s cubic-bezier(.2,1.2,.4,1); }
@keyframes zoomIn { from { transform: scale(.85); opacity: 0; } }
.select-bar { animation: up .3s cubic-bezier(.2,1.2,.3,1); }
.check { transition: background .15s, border-color .15s, transform .15s; }
.check.on { animation: badgePop .3s cubic-bezier(.2,1.8,.4,1); }

/* màn hình hoàn tất */
.done-box .big { animation: celebrate .7s cubic-bezier(.2,1.6,.4,1) both; display: inline-block; }
@keyframes celebrate { 0% { transform: scale(0) rotate(-30deg); } 70% { transform: scale(1.2) rotate(8deg); } 100% { transform: none; } }
.bill-img { animation: fadeIn .4s ease both; }

/* trạng thái trống */
.empty .big { display: inline-block; animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }

/* người dùng bật "giảm chuyển động" thì tắt hiệu ứng */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.list.quiet > .card { animation: none; }

/* tin nhắn có chi nhánh / Anousith */
.msg.hit { border: 1.5px solid #86d3a4; background: #f0fbf4; }
.msg.hit.flash { animation: hitFlash 1.4s ease-out 2; }
@keyframes hitFlash { 0% { box-shadow: 0 0 0 0 rgba(21,128,61,.45); } 100% { box-shadow: 0 0 0 10px rgba(21,128,61,0); } }
.msg-branch {
  margin-top: 6px; width: 100%; min-height: 36px; border-radius: 10px; padding: 6px 10px;
  background: var(--ok); color: #fff; font-weight: 700; font-size: 13px; text-align: center;
  box-shadow: 0 3px 10px rgba(21,128,61,.25); transition: transform .1s;
}
.msg-branch:active { transform: scale(.96); }
.msg-branch:disabled { opacity: .6; }


/* =====================================================================
   MÁY TÍNH (≥1000px): 3 cột – menu trái | danh sách | chi tiết
   ===================================================================== */
.pane-empty { display: none; }
.card.active { border-color: var(--brand-2); box-shadow: 0 0 0 2px rgba(19,94,95,.18), 0 8px 22px rgba(18,32,31,.08); background: #fbfefd; }

@media (min-width: 1000px) {
  :root { --side-w: 236px; --list-w: 440px; }
  html, body { height: 100%; }
  body {
    padding: 0; overflow: hidden; height: 100vh;
    display: grid;
    grid-template-columns: var(--side-w) var(--list-w) minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr);
    grid-template-areas:
      "head head head"
      "tabs search detail"
      "tabs filters detail"
      "pages list detail";
  }
  .top { display: contents; }
  .top-row {
    grid-area: head; padding: 12px 20px; color: #fff;
    background: linear-gradient(135deg, #0b3b3c 0%, #135e5f 55%, #1b7a70 100%);
    background-size: 200% 200%; animation: topShift 14s ease-in-out infinite alternate;
    box-shadow: 0 2px 14px rgba(11,59,60,.18); z-index: 5;
  }
  .brand-sub { max-width: none; }
  .brand-name { font-size: 18px; }

  /* cột trái: tab + danh sách page */
  .tabbar {
    grid-area: tabs; position: static; height: auto; padding: 14px 12px 6px;
    display: flex; flex-direction: column; gap: 4px; background: #fff;
    border-top: 0; border-right: 1px solid var(--line); box-shadow: none;
  }
  .tab {
    flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px;
    font-size: 14.5px; color: var(--ink-2); transition: background .2s, color .2s;
  }
  .tab:hover { background: #f3f7f6; }
  .tab.on { background: var(--brand-soft); color: var(--brand); }
  .tab::before { top: 10px; bottom: 10px; left: 0; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; transform: scaleY(0); }
  .tab.on::before { transform: scaleY(1); }
  .tab.on .tab-ico { transform: scale(1.1); }
  .tab-badge { position: static; margin-left: auto; }

  .page-bar {
    grid-area: pages; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden;
    padding: 6px 12px 16px; background: #fff; border-right: 1px solid var(--line);
  }
  .page-bar::before { content: "PAGE"; font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: .6px; padding: 10px 6px 6px; }
  .page-pill {
    height: 46px; padding: 0 10px 0 6px; border-radius: 12px; background: transparent; color: var(--ink-2);
    font-size: 13.5px; border: 0; width: 100%; justify-content: flex-start; gap: 10px;
  }
  .page-pill span:not(.pp-count):not(.pp-fallback) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-pill.all { padding: 0 12px; }
  .page-pill:hover { background: #f3f7f6; }
  .page-pill.on { background: var(--brand-soft); color: var(--brand); border: 0; }
  .page-pill img, .page-pill .pp-fallback { width: 32px; height: 32px; flex: 0 0 32px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
  .page-pill .pp-count { margin-left: auto; background: #eef2f1; color: var(--ink-2); border-radius: 999px; padding: 1px 8px; font-weight: 700; opacity: 1; }
  .page-pill.on .pp-count { background: #fff; color: var(--brand); }

  /* cột giữa: tìm kiếm + lọc + danh sách */
  .search-wrap { grid-area: search; margin: 0; padding: 14px 16px 0; background: var(--bg); }
  .search-wrap input { border: 1.5px solid var(--line); height: 44px; }
  .search-wrap input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(19,94,95,.1); }
  .search-ico { left: 28px; top: calc(50% + 7px); }
  .chip-row { grid-area: filters; flex-wrap: wrap; padding: 10px 16px 4px; background: var(--bg); overflow: visible; }
  .fchip { background: #fff; color: var(--ink-2); border: 1px solid var(--line); height: 32px; }
  .fchip:hover { border-color: #b9cbc8; }
  .fchip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
  .fchip .n { background: #eef2f1; color: var(--ink-2); }
  .fchip.on .n { background: rgba(255,255,255,.2); color: #fff; }
  .fchip.sep { border: 0; background: none; }

  .list {
    grid-area: list; overflow-y: auto; padding: 8px 16px 90px; border-right: 1px solid var(--line);
    scrollbar-width: thin;
  }
  .card { cursor: pointer; }
  .select-bar { position: fixed; left: calc(var(--side-w) + 12px); width: calc(var(--list-w) - 24px); right: auto; bottom: 16px; transform: none; max-width: none; margin: 0; }
  .banner { position: fixed; top: 74px; right: 20px; z-index: 60; margin: 0; max-width: 460px; box-shadow: 0 8px 24px rgba(0,0,0,.1); }

  /* cột phải: chi tiết luôn hiện */
  .screen {
    grid-area: detail; position: relative; inset: auto; z-index: 1; animation: none; max-width: none; margin: 0;
    background: #f7faf9; min-height: 0;
  }
  .screen:not(.is-empty) > * { animation: paneIn .25s cubic-bezier(.2,.8,.2,1) both; }
  @keyframes paneIn { from { opacity: 0; transform: translateX(10px); } }
  .screen.is-empty { display: grid !important; place-items: center; }
  .pane-empty { display: block; text-align: center; color: var(--ink-3); padding: 40px; max-width: 360px; }
  .pane-empty .big { font-size: 56px; margin-bottom: 10px; animation: float 3s ease-in-out infinite; display: inline-block; }
  .pane-empty strong { display: block; color: var(--ink-2); font-size: 16px; margin-bottom: 8px; }
  .scr-head { padding: 14px 20px; background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
  .scr-head .scr-sub { color: var(--ink-3); opacity: 1; }
  .scr-head .back-btn { color: var(--ink-2); background: #f3f7f6; font-size: 18px; }
  .scr-head .back-btn::before { content: "✕"; }
  .scr-head .back-btn { font-size: 0; }
  .scr-head .back-btn::before { font-size: 16px; }
  .scr-head .icon-btn { background: #f3f7f6; color: var(--ink-2); }
  .scr-head .avatar { background: var(--brand-soft); }
  .scr-body { padding: 18px 20px 28px; }
  .scr-body .sec { max-width: 760px; margin-left: auto; margin-right: auto; }
  .scr-foot { padding: 12px 20px; justify-content: flex-end; }
  .scr-foot .btn { flex: 0 1 260px; }
  .scr-foot .btn.small { flex: 0 0 auto; }
  .bill-img { max-width: 520px; margin: 0 auto; }

  /* màn lên đơn: tin nhắn bên trái, form bên phải khi đủ rộng */
  .msgs { max-height: 42vh; }
  .done-box { max-width: 560px; margin: 0 auto; }

  /* bảng chọn sản phẩm / menu -> hộp thoại giữa màn hình */
  .sheet {
    left: 50%; right: auto; top: 50%; bottom: auto; width: min(760px, calc(100vw - 80px)); max-height: 82vh;
    transform: translate(-50%, -50%); border-radius: 22px; padding-bottom: 0; animation: modalIn .25s cubic-bezier(.2,1.1,.3,1);
  }
  @keyframes modalIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
  .sheet-grip { display: none; }
  .sheet-head { padding: 16px 20px 12px; }
  .sheet-body { padding: 0 20px 20px; }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
  .prod-tile:hover { border-color: #b9cbc8; box-shadow: 0 6px 16px rgba(18,32,31,.08); }

  .toast { bottom: 24px; left: calc(var(--side-w) + var(--list-w) + (100vw - var(--side-w) - var(--list-w)) / 2); }
  .menu-item:hover { background: #f6faf9; }
  .branch-item { cursor: pointer; }
  .branch-item:hover { background: #f3faf7; }
  .msg-photos img { width: 120px; height: 120px; cursor: zoom-in; }
}

@media (min-width: 1400px) {
  :root { --side-w: 250px; --list-w: 480px; }
  .chat-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
  .chat-body > .sec { margin: 0; max-width: none; }
  .chat-body > .sec-msgs { grid-row: span 3; position: sticky; top: 0; }
  .chat-body .msgs { max-height: calc(100vh - 220px); }
}

/* ảnh khách tròn + ảnh page nhỏ ở góc */
.avatar.cust { overflow: visible; position: relative; border-radius: 50%; background: var(--brand-soft); }
.avatar.cust .ci { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.cust .ci-fb { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--brand); }
.avatar.cust .pg-badge {
  position: absolute; right: -5px; bottom: -5px; width: 22px; height: 22px; border-radius: 7px;
  object-fit: cover; background: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.scr-head .avatar.cust { background: #fff; }
.scr-head .avatar.cust .pg-badge { width: 18px; height: 18px; right: -4px; bottom: -4px; }

/* =====================================================================
   KIỂM TRA HÀNG
   ===================================================================== */
.page-bar[hidden] { display: none !important; }
.chk-upd { font-size: 11.5px; opacity: .75; padding: 4px 2px 0; }
.chk-summary { background: var(--brand-soft); color: var(--brand); border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: 13.5px; margin-bottom: 10px; }
.chk-group { display: flex; justify-content: space-between; align-items: center; margin: 14px 2px 6px; font-weight: 700; color: var(--ink-2); font-size: 13.5px; }
.chk-group .n { font-size: 12px; background: #eef2f1; border-radius: 999px; padding: 1px 9px; color: var(--ink-3); }
.chk-group:first-of-type { margin-top: 4px; }
.avatar.chk-ico { display: grid; place-items: center; font-size: 20px; background: var(--brand-soft); }
.wait { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.wait.w-green { background: #e7f6ee; color: #137a43; }
.wait.w-amber { background: #fff4dc; color: #a15c00; }
.wait.w-red { background: #fde8e6; color: #b42318; animation: waitPulse 2s ease-in-out infinite; }
@keyframes waitPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(180,35,24,.25); } 50% { box-shadow: 0 0 0 5px rgba(180,35,24,0); } }
.chk-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.chk-actions .btn { flex: 1; min-width: 120px; text-align: center; text-decoration: none; }
.codes-in { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 15px; resize: vertical; }
.codes-in:focus { outline: none; border-color: var(--brand-2); }
.codes-out { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.code-row { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.code-row .name { font-weight: 600; font-size: 14px; }
.code-row .code-st { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.code-row.nf { background: #fff8f7; }
@media (prefers-reduced-motion: reduce) { .wait.w-red { animation: none; } }
@media (min-width: 1000px) {
  .chk-upd { color: var(--ink-3); opacity: 1; }
}

/* chọn hãng vận chuyển trong Kiểm tra hàng */
.carrier-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: rgba(255,255,255,.14); border-radius: 14px; padding: 4px; margin-bottom: 8px; }
.cseg { height: 38px; border-radius: 11px; color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 7px; transition: background .2s, color .2s, transform .12s; }
.cseg:active { transform: scale(.96); }
.cseg.on { background: #fff; color: var(--brand); box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.cseg .n { font-size: 11.5px; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.cdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #1d9bf0; margin-right: 4px; vertical-align: 1px; }
.cdot.hal { background: #e8590c; }
.cseg .cdot { margin: 0; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.avatar.chk-ico.hal { background: #fff0e6; }
.tag.dl { background: #fff4dc; color: #a15c00; font-weight: 600; }
.last-msg { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
@media (min-width: 1000px) {
  .carrier-seg { background: #eef2f1; max-width: 420px; }
  .cseg { color: var(--ink-2); }
  .cseg.on { background: #fff; color: var(--brand); }
}

/* tìm hội thoại & báo hàng tới */
.mlevel { font-size: 13px; font-weight: 700; border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.mlevel.sure { background: #e7f6ee; color: #137a43; }
.mlevel.warn { background: #fff4dc; color: #a15c00; }
.mlevel.done { background: var(--brand-soft); color: var(--brand); }
.mcands { display: flex; flex-direction: column; gap: 8px; }
.mcand { display: flex; align-items: flex-start; gap: 10px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.mcand.on { border-color: var(--brand-2); background: #f4fbf9; box-shadow: 0 0 0 3px rgba(19,94,95,.08); }
.mcand input { margin-top: 4px; accent-color: var(--brand); }
.mcand .name { font-weight: 700; font-size: 14.5px; }
.mpg { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px; object-fit: cover; }
.mchks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mchk { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: #f1f3f3; color: var(--ink-3); }
.mchk.on { background: #e7f6ee; color: #137a43; font-weight: 600; }
.msnip { margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.mcand .grow { min-width: 0; }
.mopen { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #eef2f1; color: var(--brand); text-decoration: none; font-weight: 700; }
.notify-msg { font-size: 14px; line-height: 1.5; }
.notify-btn { width: 100%; margin-top: 10px; height: 48px; font-size: 15.5px; }
.notify-btn.armed { background: var(--accent); animation: chipOn .25s; }
.notify-btn:disabled { opacity: .5; }
.tag.ok { background: #e7f6ee; color: #137a43; font-weight: 600; }
.notify-btn { background: var(--brand); color: #fff; border: 0; }
.notify-btn.armed { background: var(--accent); color: #fff; }

/* đơn chưa in */
.tag.unp { background: #fff1e6; color: #c2410c; font-weight: 700; }
.unp-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.unp-bar strong { color: #9a3412; font-size: 14.5px; }
.unp-bar .btn { height: 40px; padding: 0 14px; font-size: 14px; }
.unp-bar .btn:not(.ghost) { background: #ea580c; color: #fff; border: 0; }
.unp-bar .grow { flex: 1 1 100%; }
.unp-bar .btn { flex: 1; }

/* nút in nhanh 1 đơn + ô tích bấm được riêng */
.card .right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pbtn { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; font-weight: 700; background: #eef2f1; color: var(--brand); border: 1px solid var(--line); white-space: nowrap; }
.pbtn.unp { background: #ea580c; color: #fff; border-color: #ea580c; box-shadow: 0 3px 10px rgba(234,88,12,.25); }
.pbtn:active { transform: scale(.94); }
button.check { flex: 0 0 auto; width: 34px; height: 34px; min-width: 34px; padding: 0; font-size: 18px; cursor: pointer; }

/* nút in có số lần in + chống đè số tiền */
.card .right { flex: 0 0 auto; min-width: 0; }
.card .money { white-space: nowrap; }
.pbtn { display: inline-flex; align-items: center; gap: 5px; }
.pbtn .pc { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11.5px; display: inline-grid; place-items: center; }
@media (min-width: 1000px) {
  .card .row { align-items: flex-start; }
  .card .right { gap: 5px; padding-top: 2px; }
  .card .money { font-size: 15px; }
  .pbtn { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
  .pbtn .pc { min-width: 18px; height: 18px; font-size: 11px; }
  .card .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card .grow { min-width: 0; }
}

/* máy tính: các nút lọc tự xuống dòng, không bị cắt mất */
@media (min-width: 1000px) {
  .chip-row { flex-direction: column; flex-wrap: nowrap; }
  .chip-line { flex-wrap: wrap; overflow: visible; row-gap: 6px; }
  .chip-line .fchip { flex: 0 0 auto; white-space: nowrap; }
}

/* ---- Gắn khách cho kiện (tự báo khi hàng tới) ---- */
.cust-search { display: flex; gap: 8px; margin: 2px 0 10px; }
.cust-search .inp { flex: 1; min-width: 0; height: 46px; font-size: 16px; }
.cust-search .btn { width: 52px; height: 46px; padding: 0; flex: none; font-size: 18px; }
.conv-sec .meta.step { margin: 8px 0 6px; font-weight: 700; color: var(--ink, #1d2b2b); }
.link-card { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: #f4fbf9; border: 1.5px solid var(--brand-2); }
.link-card .grow { min-width: 0; }
.link-card .name { font-weight: 800; font-size: 15.5px; }
.link-card .link-st { margin-top: 4px; font-weight: 700; color: var(--brand); }
.link-acts { display: flex; gap: 8px; margin-top: 8px; }
.link-acts .btn { flex: 1; height: 42px; }
.btn.ghost.danger { color: #c0392b; }
.link-hint { margin: 12px 0 0; padding: 9px 11px; border-radius: 10px; background: #fff4dc; color: #8a5300; font-size: 13px; font-weight: 600; }
.sticky-act { position: sticky; bottom: 0; padding: 8px 0 calc(4px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--card, #fff) 70%, transparent); z-index: 2; }
.sticky-act .notify-btn { margin-top: 0; }
.notify-btn.armed { filter: brightness(1.08); box-shadow: 0 0 0 3px rgba(19,94,95,.18); }
.tag.link { background: #eaf3ff; color: #1f5fae; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 1000px) { .sticky-act { position: static; background: none; } }
.tag.auto { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.tag.need { background: #fff4dc; color: #8a5300; font-weight: 600; }
.fchip.need.on { background: #8a5300; border-color: #8a5300; color: #fff; }
.auto-box { padding: 12px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 14px; }
.auto-box .meta { margin-top: 4px; font-weight: 500; }
.copy-open { width: 100%; margin-top: 8px; height: 44px; }
.copy-open.pulse { border-color: #c77700; color: #8a5300; background: #fff4dc; animation: cpulse 1.2s ease-in-out 3; }
@keyframes cpulse { 50% { box-shadow: 0 0 0 5px rgba(199,119,0,.18); } }
@media (prefers-reduced-motion: reduce) { .copy-open.pulse { animation: none; } }
.auto-box.blocked { background: #fff4dc; color: #8a5300; }
.lang-seg { display: inline-flex; gap: 4px; padding: 3px; margin: 2px 0 6px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.lang-seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; min-height: 34px; }
.lang-seg button.on { background: var(--card); color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
