/* Khung ERP: thanh đầu trắng, cột menu xanh navy, thẻ pastel, bảng số liệu. Bám theo bản thiết kế trang chủ. */
:root {
  --navy: #0b2a5e; --navy-2: #123a7d; --navy-ink: #cfdcf5; --navy-mute: #8fa6d1;
  --blue: #1f6fe0; --blue-wash: #e8f1fd; --red: #d6232a; --red-wash: #fdeeee;
  --green: #1ea35a; --green-wash: #e6f7ed; --orange: #f58a1f; --orange-wash: #fff2e0;
  --purple: #7a49d6; --purple-wash: #f0eaff; --teal: #1796b8; --teal-wash: #e3f5fa;
  --stamp: #1f5fd1; --stamp-deep: #174aa6; --stamp-wash: #e8f0fd; --on-stamp: #fff; --focus: #1f5fd1;
  --canvas: #f1f4fa; --line: #e3e8f1; --line-2: #cdd5e3;
  --head-h: 64px; --side-w: 232px;
}
body { background: var(--canvas); }
.app { min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- Thanh đầu ---------- */
.top { position: sticky; top: 0; z-index: 40; height: var(--head-h); background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 18px 0 0; }
.top .burger { display: none; }
.brand { width: var(--side-w); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 18px; min-width: 0; }
.brand img { width: 42px; height: 42px; object-fit: contain; flex: none; }
.brand img.logo { border-radius: 8px; padding: 2px; }
.brand b { display: block; font-size: 16px; line-height: 1.15; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.brand span { display: block; font-size: 11.5px; letter-spacing: .02em; color: var(--ink-3); text-transform: uppercase; }
.search { position: relative; flex: 0 1 460px; min-width: 0; }
.search > .box { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; color: var(--ink-3); }
.search > .box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(31 111 224 / .15); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 14.5px; min-width: 0; }
.search kbd { font: 600 11px/1 var(--font); color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 6px; padding: 4px 6px; background: var(--canvas); }
.search .res { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgb(10 30 70 / .18); max-height: 70vh; overflow: auto; z-index: 50; padding: 6px; }
.search .res h4 { margin: 8px 10px 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.search .res a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; }
.search .res a:hover, .search .res a:focus { background: var(--blue-wash); outline: 0; }
.search .res a small { color: var(--ink-3); }
.top .sp { flex: 1; }
.tbtn { position: relative; width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.tbtn:hover { background: var(--canvas); }
.tbtn svg { width: 23px; height: 23px; }
.tbadge { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; line-height: 1; }
.me { position: relative; }
.me > button { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; cursor: pointer; padding: 4px 8px; border-radius: 24px; text-align: left; }
.me > button:hover { background: var(--canvas); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--navy-2)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.me small { display: block; font-size: 11.5px; color: var(--ink-3); line-height: 1.1; }
.me b { display: block; font-size: 14.5px; line-height: 1.25; color: var(--ink); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgb(10 30 70 / .2); padding: 6px; z-index: 60; }
.menu .who { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .who b { font-size: 15px; }
.menu .who span { font-size: 12.5px; color: var(--ink-3); }
.menu button, .menu a { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14.5px; color: var(--ink); text-align: left; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--blue-wash); color: var(--blue); }
.clock { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13.5px; line-height: 1.25; padding-left: 8px; border-left: 1px solid var(--line); }
.clock svg { width: 22px; height: 22px; color: var(--blue); }
.clock b { display: block; color: var(--ink); font-size: 13.5px; }

/* ---------- Thân trang ---------- */
.body { flex: 1; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 0; }
.side { background: linear-gradient(180deg, var(--navy), #0a2352); color: var(--navy-ink); position: sticky; top: var(--head-h); height: calc(100dvh - var(--head-h)); display: flex; flex-direction: column; overflow: hidden; }
.side nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; }
.ni { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: #fff; font-size: 14px; line-height: 1.25; font-weight: 600; text-decoration: none; cursor: pointer; text-align: left; }
.ni svg.ic { width: 21px; height: 21px; }
.ni .chev { margin-left: auto; width: 16px; height: 16px; transition: transform .15s; opacity: .8; }
.ni:hover { background: rgb(255 255 255 / .09); }
.ni[aria-current="true"] { background: var(--red); box-shadow: 0 6px 16px rgb(214 35 42 / .35); }
.grp.open > .ni .chev { transform: rotate(90deg); }
.sub { display: none; flex-direction: column; gap: 1px; padding: 4px 0 6px 20px; margin-left: 20px; border-left: 1px solid rgb(255 255 255 / .16); }
.grp.open > .sub { display: flex; }
.sub a { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; border-radius: 8px; color: var(--navy-ink); font-size: 13.5px; text-decoration: none; font-weight: 500; }
.sub a:hover { background: rgb(255 255 255 / .09); color: #fff; }
.sub a[aria-current="page"] { background: rgb(255 255 255 / .16); color: #fff; font-weight: 700; }
.sub a svg { width: 14px; height: 14px; opacity: .8; }
.side-art { position: relative; flex: none; height: 168px; overflow: hidden; display: flex; align-items: flex-end; padding: 16px; color: #fff; font-weight: 700; font-style: italic; font-size: 15px; line-height: 1.35; background: #0a2352 url(side-art.jpg) center / cover no-repeat; }
.side-art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #0a2352 0%, rgb(10 35 82 / .2) 60%); }
.side-art span { position: relative; text-shadow: 0 1px 6px rgb(0 0 0 / .5); }
.main { min-width: 0; padding: 18px 22px 36px; display: flex; flex-direction: column; gap: 16px; }
.scrim { display: none; }

/* ---------- Trang con ---------- */
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pagehead h1 { font-size: 22px; color: var(--navy); }
.pagehead p { color: var(--ink-3); font-size: 14px; margin-top: 2px; }
.pagehead .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.panel > .ph { padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.panel > .ph h2 { font-size: 16px; }
.panel > .ph a { font-size: 13px; text-decoration: none; font-weight: 600; }
.panel > .pb { padding: 14px 16px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 12px 14px; }
.filters .field { min-width: 140px; }
.filters .grow { flex: 1 1 220px; }
.tabs { display: flex; gap: 4px; padding: 0 10px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 11px 12px; font-weight: 600; color: var(--ink-3); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 14px; }
.tabs button[aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); }
.tabs button .n { margin-left: 6px; font-size: 11.5px; background: var(--canvas); border-radius: 9px; padding: 1px 7px; color: var(--ink-2); }
.cols2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat span { display: block; font-size: 13px; color: var(--ink-3); }
.stat b { display: block; font-size: 22px; margin-top: 2px; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat small { color: var(--ink-3); font-size: 12.5px; }
.stat.warn b { color: var(--red); }

.tablewrap { overflow: auto; max-width: 100%; }
.tbl { width: 100%; font-size: 14px; }
.tbl th { text-align: left; font-weight: 650; font-size: 12.5px; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f7f9fd; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #f5f8fe; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .c { text-align: center; }
.tbl .nw { white-space: nowrap; }
.tbl .sub2 { display: block; color: var(--ink-3); font-size: 12.5px; }
.tbl .acts { display: flex; gap: 4px; justify-content: flex-end; }
.tbl tfoot td { font-weight: 700; background: #f7f9fd; border-top: 2px solid var(--line-2); }
.tbl tr.off td { color: var(--ink-3); }
.tbl a.lnk { font-weight: 650; text-decoration: none; }
.tbl a.lnk:hover { text-decoration: underline; }
.neg { color: var(--red); font-weight: 650; }
.pos { color: var(--green); font-weight: 650; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-3); flex-wrap: wrap; }
.pager .btns { display: flex; gap: 6px; }

/* Nhãn trạng thái đơn hàng */
.chip.s-new { background: var(--red-wash); color: var(--red); }
.chip.s-producing { background: var(--blue-wash); color: var(--blue); }
.chip.s-delivering { background: var(--orange-wash); color: #b25e00; }
.chip.s-delivered { background: var(--green-wash); color: #137a40; }
.chip.s-cancelled { background: #eceff4; color: var(--ink-3); text-decoration: line-through; }

/* Ô chọn có tìm kiếm */
.combo { position: relative; }
.combo .list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 70; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 14px 34px rgb(10 30 70 / .2); max-height: 260px; overflow: auto; padding: 4px; min-width: 240px; }
.combo .list button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.combo .list button:hover, .combo .list button.act { background: var(--blue-wash); }
.combo .list small { color: var(--ink-3); }
.combo .list .none { padding: 10px; color: var(--ink-3); font-size: 13.5px; }

/* Form đơn hàng */
.lines input.in { min-height: 36px; padding: 5px 8px; font-size: 14px; }
.lines td { padding: 6px 6px; }
.lines .qty { width: 84px; text-align: right; }
.lines .price { width: 116px; text-align: right; }
.lines .unit { width: 76px; }
.totals { margin-left: auto; width: min(340px, 100%); display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.totals .grand { font-size: 18px; font-weight: 800; color: var(--navy); border-top: 1px solid var(--line); padding-top: 8px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline > div { display: grid; grid-template-columns: 12px 1fr; gap: 10px; font-size: 13.5px; }
.timeline i { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); margin-top: 5px; }
.timeline small { color: var(--ink-3); display: block; }
.callout { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--orange-wash); border: 1px solid #f8dfbd; color: #7a4300; font-size: 14px; }
.callout.err { background: var(--red-wash); border-color: #f7c9cb; color: #8f1519; }
.callout.ok { background: var(--green-wash); border-color: #bfe6cf; color: #0f6234; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 14px; padding: 28px 16px; text-align: center; color: var(--ink-3); background: #fafbfe; }
.dropzone.drag { border-color: var(--blue); background: var(--blue-wash); }

/* Bảng điều đơn */
.board { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.ocard { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ocard:last-child { border-bottom: 0; }
.ocard .body2 { flex: 1; min-width: 0; font-size: 13.5px; }
.ocard .body2 b { font-size: 14px; }
.ocard .body2 span { display: block; color: var(--ink-3); overflow-wrap: anywhere; }
.trip { margin-bottom: 14px; }
.trip .th { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, #f4f8ff, #fff); border-radius: 14px 14px 0 0; }
.trip .th .t { flex: 1; min-width: 200px; }
.trip .th .t b { font-size: 15px; }
.trip .th .t span { display: block; font-size: 13px; color: var(--ink-3); }
.trip .acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* Ứng dụng tài xế */
.dcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.dcard h3 { font-size: 16px; }
.dcard .it { font-size: 13.5px; color: var(--ink-2); }
.dcard .row2 { display: flex; gap: 8px; flex-wrap: wrap; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }

iframe.embed { width: 100%; border: 0; background: transparent; display: block; min-height: 480px; }

/* ---------- Trang chủ ---------- */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
.home .left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home .right { display: flex; flex-direction: column; gap: 16px; }
.banner { position: relative; overflow: hidden; border-radius: 14px; min-height: 152px; padding: 22px 28px; color: #fff; background: linear-gradient(100deg, #0a2352 0%, #0f3b86 55%, #0c2d63 100%); display: flex; align-items: center; }
.banner::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 62%; background: url(banner-art.jpg) right center / cover no-repeat; -webkit-mask-image: linear-gradient(90deg, transparent, #000 38%); mask-image: linear-gradient(90deg, transparent, #000 38%); }
.banner .txt { position: relative; z-index: 1; max-width: 60%; }
.banner .hi { font-size: 18px; font-weight: 500; }
.banner h2 { font-size: 34px; line-height: 1.1; font-weight: 800; margin: 2px 0 4px; letter-spacing: -.005em; text-transform: uppercase; }
.banner h3 { font-size: 20px; font-weight: 700; text-transform: uppercase; margin-bottom: 8px; word-break: break-word; }
.banner .tag { font-size: 15px; opacity: .95; }
.banner .tag i { font-style: normal; padding: 0 8px; opacity: .7; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--bd); background: linear-gradient(135deg, var(--bg), #fff 90%); text-decoration: none; color: inherit; cursor: pointer; text-align: left; font: inherit; }
.kpi:hover { box-shadow: 0 8px 22px rgb(20 40 90 / .12); }
.kpi .ic2 { width: 48px; height: 48px; border-radius: 13px; background: var(--c); color: #fff; display: grid; place-items: center; flex: none; }
.kpi .ic2 svg { width: 25px; height: 25px; }
.kpi span.l { display: block; color: var(--c); font-weight: 650; font-size: 13.5px; line-height: 1.25; }
.kpi b { display: block; font-size: 26px; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi b.sm { font-size: 19px; }
.kpi small { display: block; font-size: 12.5px; color: var(--ink-3); }
.kpi small.up { color: var(--green); } .kpi small.down { color: var(--red); }
.kpi.red { --c: #e0262c; --bg: #fff0f0; --bd: #f7d3d3; } .kpi.green { --c: #1ea35a; --bg: #e8f8ee; --bd: #c6ead3; }
.kpi.orange { --c: #f58a1f; --bg: #fff3e3; --bd: #f8dfbd; } .kpi.blue { --c: #1f6fe0; --bg: #eaf3ff; --bd: #cfe0f8; }
.charts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 1fr); gap: 14px; }
.charts .tbl th, .charts .tbl td { padding: 8px 6px; font-size: 12.5px; }
.chartbox .chart { width: 100%; min-height: 190px; }
.chartbox { padding: 14px 16px; }
.chartbox h3 { font-size: 15px; margin-bottom: 8px; }
.bars { width: 100%; height: auto; display: block; }
.donutwrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.donutwrap .legend { width: 100%; }
.legend { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.legend em { font-style: normal; color: var(--ink-3); font-size: 12px; min-width: 38px; text-align: right; }
.notes { display: flex; flex-direction: column; }
.notes a, .notes div.n { display: grid; grid-template-columns: 22px 1fr; gap: 9px; padding: 9px 2px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 13px; line-height: 1.4; }
.notes > :last-child { border-bottom: 0; }
.notes .dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; margin-top: 1px; }
.notes .dot svg { width: 12px; height: 12px; stroke-width: 3; }
.notes .dot.ok { background: var(--green); } .notes .dot.warn { background: var(--orange); } .notes .dot.info { background: var(--blue); } .notes .dot.user { background: var(--navy-2); }
.notes small { color: var(--ink-3); display: block; font-size: 12px; }
.att { display: flex; align-items: center; gap: 12px; }
.att .t { flex: 1; min-width: 0; } .att .t b { display: block; } .att .t span { color: var(--ink-3); font-size: 13.5px; }
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--bd); background: linear-gradient(135deg, var(--bg), #fff 90%); text-decoration: none; color: inherit; cursor: pointer; text-align: left; font: inherit; position: relative; min-width: 0; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgb(20 40 90 / .13); }
.tile .ic2 { width: 48px; height: 48px; border-radius: 13px; background: var(--c); color: #fff; display: grid; place-items: center; flex: none; }
.tile .ic2 svg { width: 25px; height: 25px; }
.tile h3 { font-size: 15px; color: var(--ink); line-height: 1.25; }
.tile p { font-size: 12px; color: var(--ink-2); line-height: 1.4; margin-top: 2px; }
.tile .go { margin-left: auto; color: var(--c); flex: none; } .tile .go svg { width: 16px; height: 16px; }
.tile.lock { opacity: .55; filter: grayscale(.5); }
.tile.red { --c: #e0262c; --bg: #fff0f0; --bd: #f7d3d3; } .tile.blue { --c: #1f6fe0; --bg: #eaf3ff; --bd: #cfe0f8; }
.tile.orange { --c: #f58a1f; --bg: #fff3e3; --bd: #f8dfbd; } .tile.green { --c: #1ea35a; --bg: #e8f8ee; --bd: #c6ead3; }
.tile.purple { --c: #7a49d6; --bg: #f1ebff; --bd: #dccff6; } .tile.teal { --c: #1796b8; --bg: #e6f6fb; --bd: #c3e6f0; }

/* ---------- Đăng nhập ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1000px 500px at 80% -10%, #1d4fa8 0, transparent 60%), linear-gradient(160deg, #0a2352, #0f3b86); }
.lcard { width: min(420px, 100%); background: #fff; border-radius: 20px; box-shadow: 0 24px 60px rgb(0 0 0 / .35); overflow: hidden; }
.lcard .top2 { padding: 24px 28px 18px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.lcard .top2 img { width: 54px; height: 54px; object-fit: contain; flex: none; }
.lcard h1 { font-size: 19px; color: var(--navy); text-transform: uppercase; } .lcard p.s { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }
.lcard form { padding: 22px 28px 10px; display: flex; flex-direction: column; gap: 14px; }
.lcard .err { padding: 10px 12px; border-radius: 10px; background: var(--red-wash); color: #8f1519; font-size: 14px; }
.lcard .foot { padding: 6px 28px 22px; text-align: center; font-size: 13px; color: var(--ink-3); }

/* ---------- Máy tính bảng và điện thoại ---------- */
@media (max-width: 1280px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .charts { grid-template-columns: 1fr 1fr; } .charts > :nth-child(2) { grid-column: 1 / -1; order: 3; }
  .home { grid-template-columns: 1fr; } .home .right { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  :root { --head-h: 58px; }
  .top { padding: 0 10px; gap: 6px; }
  .top .burger { display: grid; }
  .brand { width: auto; padding: 0 4px; flex: 1 1 auto; } .brand b { max-width: 40vw; font-size: 15px; } .brand span { display: none; }
  .search { display: none; } .search.open { display: block; position: fixed; top: var(--head-h); left: 8px; right: 8px; z-index: 60; flex: none; }
  .search.open > .box { box-shadow: 0 10px 30px rgb(10 30 70 / .25); }
  .clock, .me small, .me > button > svg { display: none; } .me b { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .body { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 55; top: 0; left: 0; bottom: 0; height: auto; width: min(290px, 84vw); transform: translateX(-102%); transition: transform .2s; box-shadow: 0 0 40px rgb(0 0 0 / .35); }
  .side.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; z-index: 54; background: rgb(8 18 40 / .5); }
  .main { padding: 12px 12px 28px; gap: 12px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .kpi { padding: 12px; gap: 10px; } .kpi .ic2 { width: 44px; height: 44px; } .kpi b { font-size: 22px; } .kpi b.sm { font-size: 16px; }
  .banner { min-height: 118px; padding: 16px; } .banner .txt { max-width: 70%; } .banner h2 { font-size: 20px; } .banner h3 { font-size: 14px; } .banner .hi { font-size: 13px; } .banner .tag { font-size: 11.5px; } .banner::after { width: 70%; opacity: .75; }
  .charts { grid-template-columns: 1fr; } .home .right { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .tile { flex-direction: column; align-items: flex-start; text-align: left; } .tile .go { display: none; }
  .cols2, .cols3, .board { grid-template-columns: 1fr; }
  .pagehead h1 { font-size: 19px; }
  .kv { grid-template-columns: 105px 1fr; }
}
@media (max-width: 480px) { .me b { display: none; } .kpis { grid-template-columns: 1fr 1fr; } }
@media print { .top, .side, .pagehead .acts, .filters { display: none !important; } .body { display: block; } }

/* ---------- 1.6.0: trạng thái mới, buổi giao, khu làm hàng, nhập đơn 2 cột, tài xế ---------- */
.chip.s-handed { background: #ede7fb; color: #5b33b8; }
.chip.ses-sang { background: #fff6d6; color: #8a6100; }
.chip.ses-chieu { background: #e5efff; color: #1d4fa8; }
.zonepick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; max-width: 1100px; margin: 10px auto; width: 100%; }
.zcard { border: 2px solid var(--line); border-radius: 18px; background: #fff; padding: 20px 18px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 8px; font: inherit; color: inherit; min-height: 150px; position: relative; }
.zcard:hover:not([disabled]) { border-color: var(--zc); box-shadow: 0 10px 26px rgb(20 40 90 / .12); }
.zcard[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }
.zcard[aria-pressed="true"] { border-color: var(--zc); background: linear-gradient(135deg, var(--zb), #fff 80%); }
.zcard .zi { width: 50px; height: 50px; border-radius: 14px; background: var(--zc); color: #fff; display: grid; place-items: center; }
.zcard .zi svg { width: 26px; height: 26px; }
.zcard h3 { font-size: 18px; } .zcard p { font-size: 13.5px; color: var(--ink-2); margin: 0; }
.zcard b.big { font-size: 26px; color: var(--zc); }
.zcard.roi { --zc: #e0262c; --zb: #fff0f0; } .zcard.dong_goi { --zc: #1f6fe0; --zb: #eaf3ff; } .zcard.lo_pho { --zc: #f58a1f; --zb: #fff3e3; } .zcard.all { --zc: #7a49d6; --zb: #f1ebff; }
.zcard .lock { position: absolute; top: 14px; right: 14px; font-size: 12px; color: var(--ink-3); }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.pcard.done { border-color: #bfe6cf; background: #f7fdf9; }
.pcard .hd { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pcard .hd .t { flex: 1; min-width: 160px; } .pcard .hd .t b { font-size: 15px; } .pcard .hd .t span { display: block; font-size: 12.5px; color: var(--ink-3); }
.pline { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pline:last-child { border-bottom: 0; }
.pline input { width: 22px; height: 22px; flex: none; }
.pline .n { flex: 1; min-width: 0; } .pline .n small { display: block; color: var(--ink-3); }
.pline.made .n b { text-decoration: line-through; color: var(--ink-3); }
.pline .q { font-weight: 800; white-space: nowrap; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.neworder { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.neworder .left { position: sticky; top: calc(var(--head-h) + 12px); display: flex; flex-direction: column; gap: 12px; }
.prow { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.prow.on { background: #f3f8ff; }
.prow .info { flex: 1; min-width: 0; } .prow .info b { font-size: 14px; display: block; } .prow .info small { color: var(--ink-3); display: block; font-size: 12.5px; }
.prow .info em { font-style: normal; color: var(--blue); font-size: 12.5px; font-weight: 600; display: block; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; flex: none; background: #fff; }
.stepper button { width: 40px; height: 40px; border: 0; background: #f2f6fc; font-size: 22px; font-weight: 700; color: var(--navy); cursor: pointer; line-height: 1; }
.stepper button:active { background: #dfe9fa; }
.stepper input { width: 66px; height: 40px; border: 0; text-align: center; font-size: 16px; font-weight: 700; outline: 0; }
.cartsum { position: sticky; bottom: 0; background: #fff; border-top: 2px solid var(--line); padding: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; z-index: 5; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 9px 16px; font-weight: 600; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.qrbox { position: relative; width: 100%; max-width: 420px; aspect-ratio: 1; margin: 0 auto; border-radius: 16px; overflow: hidden; background: #000; }
.qrbox video { width: 100%; height: 100%; object-fit: cover; }
.qrbox::after { content: ""; position: absolute; inset: 18%; border: 3px solid rgb(255 255 255 / .85); border-radius: 14px; box-shadow: 0 0 0 999px rgb(0 0 0 / .25); }
.photo-prev { width: 100%; max-height: 260px; object-fit: contain; border-radius: 12px; background: #f1f4fa; }
@media (max-width: 960px) {
  .neworder { grid-template-columns: 1fr; } .neworder .left { position: static; }
  .zonepick { grid-template-columns: 1fr 1fr; } .zcard { min-height: 120px; padding: 14px; } .zcard h3 { font-size: 15px; }
  .pgrid { grid-template-columns: 1fr; }
}

/* ---------- Giao hàng thông minh (1.7) ---------- */
.chip.err { background: var(--red-wash); color: var(--red); }
.btn.xs { min-height: 26px; padding: 0 8px; font-size: 12px; gap: 4px; border-radius: 7px; }
.btn.xs .ic { width: 14px; height: 14px; }
.btn.big, .big-in { min-height: 54px; font-size: 17px; }
.btn.grow, .grow { flex: 1 1 auto; }
.col { display: flex; flex-direction: column; gap: 12px; }
.row2 { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pos { color: var(--green); font-weight: 650; }
.netbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -4px 0 12px; font-size: 13px; }
.netbar .net { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.netbar .net::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-wash); }
.netbar .net.off { color: var(--red); }
.netbar .net.off::before { background: var(--red); box-shadow: 0 0 0 3px var(--red-wash); }
.netbar button.chip { border: 0; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700; }
.progress { height: 6px; background: var(--line); margin: 0 16px 12px; border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #34c77b); border-radius: inherit; transition: width .4s; }
.dcard .dc-top { display: flex; align-items: center; gap: 10px; }
.dcard .dc-top h3 { flex: 1; min-width: 0; }
.dcard .seq { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.dcard.al-late, .dcard.al-eta_late { border-color: #f3b4b7; box-shadow: inset 4px 0 0 var(--red); }
.dcard.al-warn { border-color: #f4d9a6; box-shadow: inset 4px 0 0 #e0a100; }
.dcard .cod { display: flex; align-items: center; gap: 6px; background: var(--stamp-wash); color: var(--stamp-deep); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.dcard .cod b { font-size: 16px; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(50px, 1fr)); gap: 6px; }
.qbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; padding: 0 2px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; color: var(--navy); text-decoration: none; font: inherit; font-size: 12px; white-space: nowrap; font-weight: 650; cursor: pointer; }
.qbtn:active { background: var(--blue-wash); }
.qbtn .ic { width: 20px; height: 20px; }
.qbtn.zalo b { width: 22px; height: 22px; border-radius: 7px; background: #0068ff; color: #fff; display: grid; place-items: center; font-size: 13px; }
.issue-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.issue-btn { display: flex; align-items: center; gap: 8px; min-height: 54px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; font: inherit; font-weight: 650; color: var(--ink); cursor: pointer; text-align: left; }
.issue-btn[aria-pressed="true"] { border-color: var(--red); background: var(--red-wash); color: #8f1519; box-shadow: 0 0 0 2px rgb(214 35 42 / .15); }
.sign-pad { width: 100%; height: auto; aspect-ratio: 600 / 220; border: 1.5px dashed var(--line-2); border-radius: 12px; background: #fff; touch-action: none; }
.photo-prev { max-width: 100%; border-radius: 12px; }
.done-list summary { padding: 12px 16px; cursor: pointer; font-weight: 700; color: var(--ink-2); }
.alert-panel .ocard.al-late, .alert-panel .ocard.al-eta_late { background: linear-gradient(90deg, var(--red-wash), transparent 60%); }
.alert-panel .ocard.al-warn { background: linear-gradient(90deg, #fff6df, transparent 60%); }
.live-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.live-side { display: flex; flex-direction: column; gap: 10px; max-height: min(72vh, 640px); overflow: auto; }
.live-card { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-left: 5px solid var(--c, var(--blue)); border-radius: 12px; background: #fff; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.live-card .r1 { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.live-card b { color: var(--ink); font-size: 14.5px; }
.live-card .btn { align-self: flex-start; margin-top: 4px; }
.playbar { display: flex; gap: 10px; align-items: center; margin: 0 0 12px; flex-wrap: wrap; }
.playbar .clock { font-variant-numeric: tabular-nums; min-width: 72px; color: var(--navy); }
.stats.one { grid-template-columns: 1fr; }
.tl { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.tl > div { display: flex; gap: 10px; align-items: flex-start; }
.tl > div > i { width: 10px; height: 10px; border-radius: 50%; background: var(--green); margin-top: 5px; flex: none; }
.tl > div.bad > i { background: var(--red); }
.tl small { display: block; color: var(--ink-3); }
.stars { color: #e0a100; letter-spacing: 1px; }
@media (max-width: 900px) { .live-wrap { grid-template-columns: 1fr; } .live-side { max-height: none; } }
.playbar select { width: auto; flex: none; }
.playbar input[type=range] { min-width: 160px; }

/* ---------- App tài xế (1.7.1): gọn trong một màn hình điện thoại, thanh thẻ dưới đáy ---------- */
.drv-app { max-width: 640px; margin: 0 auto; padding-bottom: 84px; --drv: var(--red); }
.drv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.drv-head h1 { font-size: 22px; color: var(--ink); letter-spacing: -.01em; }
.drv-head span { font-size: 13px; color: var(--ink-3); }
.drv-app .btn.primary { background: var(--drv); border-color: var(--drv); }
.drv-view { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.drv-nav { position: sticky; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid var(--line); margin-top: 12px; padding-bottom: env(safe-area-inset-bottom); }
.drv-nav button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 9px; border: 0; background: none; color: var(--ink-3); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.drv-nav button .ic { width: 23px; height: 23px; }
.drv-nav button[aria-current="page"] { color: var(--drv); }
.drv-nav .nbadge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--drv); color: #fff; font-size: 11px; display: grid; place-items: center; }
@media (max-width: 960px) { .drv-nav { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; box-shadow: 0 -4px 18px rgb(10 30 70 / .08); } }
.seg { display: flex; background: #e6eaf2; border-radius: 12px; padding: 3px; gap: 3px; overflow-x: auto; scrollbar-width: none; }
.seg button { flex: 1 0 auto; min-height: 38px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: 14px; font-weight: 650; color: var(--ink-2); cursor: pointer; padding: 0 10px; }
.seg button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgb(10 30 70 / .12); }
.trip-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; padding: 4px 2px 0; font-size: 13.5px; }
.trip-line b { color: var(--navy); }
.trip-line span { color: var(--ink-3); }
.trip-line .progress { flex: 1 0 100%; margin: 4px 0 0; }
.recv { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.recv summary { font-weight: 700; cursor: pointer; }
.recv .pcard { margin-top: 8px; }
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 99px; font-size: 12.5px; font-weight: 700; white-space: nowrap; background: #eceff4; color: var(--ink-2); }
.pill.blue { background: #e3edfd; color: #1d58c9; }
.pill.green { background: #e0f4e8; color: #137a40; }
.pill.warn { background: #fdefd2; color: #8f5a00; }
.pill.red { background: var(--red-wash); color: var(--red); }
.pill.cod { background: var(--stamp-wash); color: var(--stamp-deep); }
.oc { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 1px 2px rgb(10 30 70 / .04); }
.oc.al-late, .oc.al-eta_late { border-color: #f1b3b6; box-shadow: inset 4px 0 0 var(--red); }
.oc.al-warn { border-color: #f1d8a4; box-shadow: inset 4px 0 0 #e0a100; }
.oc-top { display: flex; align-items: center; gap: 8px; padding: 12px 12px 4px 14px; }
.oc-top .seq { width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.oc-code { flex: 1; font-size: 16px; letter-spacing: .01em; }
.oc-mid { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 10px; padding: 2px 12px 12px 14px; }
.oc-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.oc-info h3 { font-size: 17px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-info .addr { display: flex; gap: 5px; margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.35; }
.oc-info .addr .ic { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--drv); }
.oc-info .addr span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.oc-info .meta { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.oc-info .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.oc-info .tags:empty { display: none; }
.mini { position: relative; width: 84px; height: 84px; border-radius: 14px; overflow: hidden; background: #e7ecf3; border: 1px solid var(--line); align-self: start; text-decoration: none; }
.mini-tiles img { position: absolute; width: 256px; height: 256px; max-width: none; }
.mini-pin { position: absolute; left: 50%; top: 38%; width: 18px; height: 18px; margin: -18px 0 0 -9px; background: var(--red); border: 2px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 2px 4px rgb(0 0 0 / .35); }
.mini-none { position: absolute; inset: 0 0 22px; display: grid; place-items: center; color: var(--ink-3); }
.mini-km { position: absolute; left: 0; right: 0; bottom: 0; background: rgb(255 255 255 / .93); color: var(--ink); font-size: 12px; font-weight: 800; text-align: center; padding: 3px 0; }
.oc-quick { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.oc-quick > * { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border: 0; background: none; color: var(--navy); text-decoration: none; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.oc-quick > * + * { border-left: 1px solid var(--line); }
.oc-quick > *:active { background: var(--blue-wash); }
.oc-quick .off { color: var(--line-2); cursor: default; }
.oc-quick .ic { width: 20px; height: 20px; }
.oc-quick .zl { width: 20px; height: 20px; border-radius: 6px; background: #0068ff; color: #fff; display: grid; place-items: center; font-size: 12px; }
.oc-quick .off .zl { background: var(--line-2); }
.oc-main { display: flex; gap: 8px; padding: 0 12px 12px; }
.oc-main .btn.big { min-height: 50px; font-size: 16px; }
.center { text-align: center; }
.drv-map { height: min(44vh, 380px); }
.route-list { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.rl-head, .rl-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; }
.rl-head { border-bottom: 1px solid var(--line); }
.rl-head span { font-size: 13px; color: var(--ink-3); }
.rl-total { border-top: 1px solid var(--line); background: var(--canvas); font-size: 14px; }
.rl-row { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 9px 14px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.rl-row::before { content: ""; position: absolute; left: 26px; top: 0; bottom: 0; width: 2px; background: #f2c3c5; }
.rl-row i { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; background: var(--red); color: #fff; font-style: normal; font-weight: 800; font-size: 12px; display: grid; place-items: center; border: 2px solid #fff; }
.rl-row.start i { background: var(--navy); }
.rl-row.start::before { top: 50%; }
.rl-row:last-of-type::before { bottom: 50%; }
.rl-row b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-row small { display: block; color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-row > span { text-align: right; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.rl-row > span small { font-weight: 500; }
.rl-row.late b { color: var(--red); }
.row2.tight { gap: 8px; }
.row2.tight .btn { min-height: 46px; }
.stats.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.acc { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.acc .av { width: 52px; height: 52px; border-radius: 50%; background: var(--drv); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 800; flex: none; }
.acc b { display: block; font-size: 17px; }
.acc span { font-size: 13px; color: var(--ink-3); }
.sheet-list { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.sheet-list > a, .sheet-list > button, .sheet-list > .kv { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-decoration: none; font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; }
.sheet-list > .kv { justify-content: space-between; font-weight: 500; cursor: default; }
.sheet-list > .kv span { color: var(--ink-3); }
.sheet-list > .danger { color: var(--red); }
.sheet-list > p { padding: 10px 16px; margin: 0; font-size: 13.5px; }
.sheet-list > .callout { margin: 8px; }
.dlg .sheet-list { border: 0; border-radius: 0; margin: -20px; }
/* Hộp thoại dạng tấm trượt từ dưới lên trên điện thoại */
@media (max-width: 640px) {
  dialog.dlg.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; max-height: 96dvh; border-radius: 20px 20px 0 0; }
  dialog.dlg.sheet .dlg-head { padding: 12px 16px; }
  dialog.dlg.sheet .dlg-body { padding: 14px 16px; gap: 12px; }
  dialog.dlg.sheet .dlg-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; }
}
dialog.dlg.sheet .dlg-foot > .btn { flex: 1; }
.col.tight { gap: 10px; }
.grid2.tight { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sheet-who b { display: block; font-size: 15px; }
.sheet-who span { font-size: 13px; color: var(--ink-3); }
.ph-card { border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.ph-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.ph-title .ic { width: 20px; height: 20px; color: var(--ink-2); }
.ph-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px; align-items: center; }
.ph-thumb { aspect-ratio: 4 / 3; border-radius: 12px; background: var(--canvas); border: 1.5px dashed var(--line-2); display: grid; place-items: center; color: var(--ink-3); overflow: hidden; cursor: pointer; }
.ph-thumb .ic { width: 34px; height: 34px; }
.ph-thumb.has { border: 0; }
.ph-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ph-side { display: flex; flex-direction: column; gap: 6px; }
.ph-side .btn { min-height: 46px; }
.ph-side small { font-size: 11.5px; line-height: 1.3; }
.sig-ic { font-size: 18px; }
.lnk-btn { margin-left: auto; border: 0; background: none; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer; padding: 4px; }
.sign-wrap { position: relative; }
.sign-wrap .sign-pad { aspect-ratio: 640 / 240; }
.sign-hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--line-2); font-size: 15px; pointer-events: none; }
/* Bảng điều đơn: xem lộ trình trên bản đồ */
.route-view { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 14px; align-items: start; }
.route-view .map-box { height: min(62vh, 560px); }
.route-view .route-list { max-height: min(62vh, 560px); overflow: auto; }
@media (max-width: 760px) { .route-view { grid-template-columns: 1fr; } .route-view .map-box { height: 46vh; } }
dialog.dlg.sheet .btn.primary { background: var(--red); border-color: var(--red); }
.ph-title .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-title small { font-weight: 500; font-size: 12.5px; }
a.rl-row, a.rl-row:hover { text-decoration: none; color: inherit; }
.lnk-btn { white-space: nowrap; flex: none; }

/* ---------- Sản xuất & kho (1.8) ---------- */
.scanbox { display: flex; gap: 8px; flex-wrap: wrap; }
.scanbox .in { flex: 1 1 220px; min-width: 0; }
.scan-video { width: 100%; border-radius: 12px; background: #000; aspect-ratio: 4 / 3; object-fit: cover; }
.kg-in { min-height: 64px; font-size: 30px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.split-prev { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.bagchips { display: flex; flex-wrap: wrap; gap: 6px; }
.bagchip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: var(--blue-wash); color: var(--navy); font-weight: 750; font-size: 13.5px; text-decoration: none; white-space: nowrap; }
.bagchip button { border: 0; background: none; cursor: pointer; color: var(--ink-3); font: inherit; padding: 0 2px; }
.bagchip.big { flex-direction: column; align-items: flex-start; gap: 0; border-radius: 12px; padding: 8px 12px; }
.bagchip.big b { font-size: 18px; }
.bagchip.big small { font-weight: 600; color: var(--ink-3); font-size: 11.5px; }
.weigh-grid { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 14px; align-items: start; }
.done-weigh { border-color: #b9e4c9; background: linear-gradient(180deg, #f1fbf5, #fff 70%); }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; margin: 6px 0 10px; }
.sm-in { width: 96px; min-height: 36px; }
.trace { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.trace-hero { text-align: center; padding: 18px; border-radius: 18px; background: var(--navy); color: #fff; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.trace-hero small { opacity: .8; font-weight: 700; letter-spacing: .04em; }
.trace-hero h2 { color: #fff; font-size: 20px; }
.big-kg { font-size: 34px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.big-kg small { font-size: 14px; font-weight: 600; opacity: .8; }
.trace-hero .chip { background: rgb(255 255 255 / .16); color: #fff; }
.kvrow { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kvrow:last-child { border-bottom: 0; }
.kvrow span { color: var(--ink-3); }
.kvrow b { text-align: right; overflow-wrap: anywhere; }
.callout.warn { background: #fff6df; color: #7a4d00; }
@media (max-width: 860px) { .weigh-grid { grid-template-columns: 1fr; } }

/* ---------- Điện thoại: không tràn ngang, bảng thành thẻ ---------- */
html, body { overflow-x: hidden; }
.main, .panel, .pagehead, .filters { min-width: 0; max-width: 100%; }
@media (max-width: 640px) {
  .pagehead { flex-wrap: wrap; }
  .pagehead .acts { width: 100%; flex-wrap: wrap; }
  .pagehead .acts > * { flex: 1 1 auto; }
  .filters { flex-wrap: wrap; }
  .filters > * { flex: 1 1 140px; min-width: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .stat b { font-size: 18px; overflow-wrap: anywhere; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .grid2.tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tablewrap { overflow: visible; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .tbl td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0 !important; border: 0 !important; text-align: right; white-space: normal !important; min-width: 0; }
  .tbl td::before { content: attr(data-label); flex: none; max-width: 42%; color: var(--ink-3); font-size: 12.5px; font-weight: 600; text-align: left; }
  .tbl td[data-label=""]::before { display: none; }
  .tbl td[data-label=""] { justify-content: flex-end; }
  .tbl td > * { min-width: 0; overflow-wrap: anywhere; }
  .tbl tfoot { display: block; }
  dialog.dlg { max-width: calc(100vw - 16px); }
  .bagchips .bagchip { white-space: normal; }
}
@media (max-width: 640px) {
  .pagehead .acts > div { flex: 1 1 100% !important; flex-wrap: wrap; min-width: 0; }
  .pagehead .acts > div > .in { flex: 1 1 120px; min-width: 0; }
  .pagehead .acts > .btn.icon { flex: none; }
}
@media (max-width: 640px) {
  .tbl td { display: grid !important; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); column-gap: 12px; align-items: baseline; }
  .tbl td { row-gap: 2px; }
  .tbl td::before { grid-column: 1; grid-row: 1; max-width: none; justify-self: start; }
  .tbl td > * { grid-column: 2; justify-self: end; text-align: right; }
  .tbl td[data-label=""] { grid-template-columns: 1fr; }
  .tbl td[data-label=""] > * { grid-column: 1; }
}

/* =====================================================================
   1.9 · Cân hàng & mã bịch (màn hình máy tính bảng tại chuyền)
   Đỏ thương hiệu Tuấn Anh cho thao tác tạo mã, xanh lá cho check-in, xanh dương cho đơn.
   Số kg dùng chữ số đều (tabular) để cột không nhảy khi đổi số.
   ===================================================================== */
.cw {
  --r: #c8161d; --r-deep: #8f0e13; --r-wash: #fff1f0; --r-line: #f4c9c7;
  --g: #0e8a3e; --g-deep: #0a6b30; --g-wash: #e7f6ec;
  --b: #1d4fb8; --b-wash: #eaf0fc;
  --amber: #f0a020;
  display: flex; flex-direction: column; gap: 12px; font-variant-numeric: tabular-nums;
}
.cw .ic.big { width: 30px; height: 30px; }
.cw-body { display: flex; flex-direction: column; gap: 12px; }

/* Thanh đầu đỏ */
.cw-bar { position: sticky; top: calc(var(--head-h) + 6px); z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px; border-radius: 16px; background: linear-gradient(180deg, var(--r), var(--r-deep)); box-shadow: 0 8px 22px rgb(143 14 19 / .22); }
.cw-line1 { color: #fff; font-size: 17px; padding: 0 10px; }
.cw-seg { display: flex; background: rgb(0 0 0 / .18); border-radius: 12px; padding: 3px; gap: 3px; }
.cw-seg button { border: 0; background: transparent; color: #fff; font: 700 15px/1.15 var(--font); padding: 9px 16px; border-radius: 9px; cursor: pointer; text-align: left; min-height: 44px; }
.cw-seg button small { display: block; font-size: 12px; font-weight: 600; opacity: .85; }
.cw-seg button[aria-selected="true"] { background: #fff; color: var(--r); box-shadow: 0 2px 8px rgb(0 0 0 / .15); }
.cw-seg.cw-views button[aria-selected="true"]:last-child { color: var(--b); }
.cw-views { margin-left: auto; }
.cw-ses { display: flex; align-items: center; gap: 6px; color: #fff; background: rgb(0 0 0 / .18); border-radius: 12px; padding: 0 4px 0 10px; min-height: 50px; }
.cw-ses svg { width: 20px; height: 20px; }
.cw-ses select { border: 0; background: transparent; color: #fff; font: 700 15px var(--font); min-height: 44px; padding: 0 6px; cursor: pointer; }
.cw-ses select option { color: var(--ink); }
.cw-seg button:focus-visible, .cw-ses select:focus-visible { outline: 3px solid #ffd54a; outline-offset: 1px; }

/* Đầu khu vực: tiêu đề + tổng */
.cw-head, .cw-otool { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.cw-title { flex: 1 1 220px; min-width: 0; }
.cw-title h2 { font-size: 26px; line-height: 1.05; font-weight: 900; color: var(--r); letter-spacing: -.01em; }
.cw-otool .cw-title h2 { color: var(--b); }
.cw-title p { margin-top: 3px; color: var(--ink-2); font-size: 14px; }
.cw-title p b { color: var(--r); font-size: 16px; }
.cw-totals { display: grid; grid-template-columns: repeat(3, minmax(118px, 1fr)); gap: 0; border: 2px solid var(--b); border-radius: 12px; overflow: hidden; }
.cw-totals > div { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 7px; padding: 7px 12px; }
.cw-totals > div + div { border-left: 1px solid var(--line); }
.cw-totals svg { grid-row: span 2; width: 26px; height: 26px; }
.cw-totals .am svg { color: var(--amber); } .cw-totals .pm svg { color: var(--b); } .cw-totals .st svg { color: var(--ink-3); }
.cw-totals span { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.cw-totals b { font-size: 22px; font-weight: 900; color: var(--r); line-height: 1.1; }
.cw-totals .st b { color: var(--ink); }
.cw-totals .cur { background: var(--r-wash); }

/* Chọn sản phẩm */
.cw-prods { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x proximity; }
.cw-prod { flex: 0 0 auto; scroll-snap-align: start; display: grid; grid-template-columns: auto; text-align: left; min-width: 132px; max-width: 220px; padding: 9px 13px; border-radius: 12px;
  border: 2px solid var(--line-2); background: #fff; cursor: pointer; color: var(--ink); }
.cw-prod b { font-size: 21px; font-weight: 900; line-height: 1; letter-spacing: .02em; }
.cw-prod span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.cw-prod small { font-size: 12px; color: var(--ink-3); }
.cw-prod[aria-checked="true"] { border-color: var(--r); background: var(--r); color: #fff; box-shadow: 0 6px 16px rgb(200 22 29 / .3); }
.cw-prod[aria-checked="true"] span, .cw-prod[aria-checked="true"] small { color: #ffe3e1; }

/* Ô khối lượng */
.cw-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cw-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 112px; border-radius: 16px; cursor: pointer;
  border: 2px solid var(--r-line); background: linear-gradient(180deg, #fff, var(--r-wash)); color: var(--r); transition: transform .08s, box-shadow .15s; touch-action: manipulation; }
.cw-tile-kg { font-size: 46px; font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.cw-tile-kg small { font-size: 22px; font-weight: 800; margin-left: 4px; }
.cw-tile-sub { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.cw-tile-pr { position: absolute; top: 8px; right: 9px; color: var(--ink-3); }
.cw-tile-pr svg { width: 18px; height: 18px; }
.cw-tile:hover { box-shadow: 0 6px 18px rgb(200 22 29 / .16); }
.cw-tile:active { transform: scale(.97); background: var(--r); color: #fff; }
.cw-tile:active .cw-tile-sub { color: #fff; }
.cw-tile.ing { background: var(--r); color: #fff; }
.cw-tile.ing .cw-tile-sub { color: #fff; }
.cw-tile:disabled { cursor: progress; }
.cw-tile:focus-visible { outline: 3px solid var(--b); outline-offset: 2px; }
.cw-tile:first-child { border-color: var(--r); }
.cw-tile.other { color: var(--r-deep); border-style: dashed; background: #fff; }
.cw-tile.other .ic.big { width: 40px; height: 40px; }
.cw-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.cw-auto { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.cw-auto input { width: 20px; height: 20px; accent-color: var(--r); }

/* Mã vừa tạo */
.cw-last { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--r); border-radius: 12px; padding: 10px 12px; }
.cw-last.empty { border-left-color: var(--line-2); font-size: 13.5px; }
.cw-last-main b { display: block; font-size: 18px; font-weight: 900; color: var(--r); }
.cw-last-main small { color: var(--ink-3); font-size: 12.5px; }
.cw-last-acts { margin-left: auto; display: flex; gap: 6px; }
.cw-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.cw-chip { display: inline-block; padding: 4px 9px; border-radius: 8px; background: var(--r-wash); color: var(--r-deep); font-weight: 800; font-size: 13px; text-decoration: none; border: 1px solid var(--r-line); }

/* Nút QR check-in lớn */
.cw-qr { width: 100%; display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 84px; border: 0; border-radius: 18px; cursor: pointer; color: #fff; text-align: left;
  background: linear-gradient(180deg, #18a64d, var(--g-deep)); box-shadow: 0 10px 24px rgb(10 107 48 / .3), inset 0 1px 0 rgb(255 255 255 / .25); touch-action: manipulation; }
.cw-qr .ic.big { width: 46px; height: 46px; }
.cw-qr b { display: block; font-size: 32px; font-weight: 900; letter-spacing: .01em; line-height: 1; }
.cw-qr small { display: block; font-size: 14px; font-weight: 600; opacity: .9; margin-top: 4px; }
.cw-qr:active { transform: scale(.99); filter: brightness(.95); }
.cw-qr:focus-visible { outline: 3px solid var(--b); outline-offset: 3px; }

.cw-hist { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.cw-hist > summary { padding: 12px 14px; font-weight: 700; cursor: pointer; }

/* Danh sách đơn: dày dòng, không trang trí, tối đa số đơn trên màn hình */
.cw-otool { position: sticky; top: calc(var(--head-h) + 82px); z-index: 15; padding: 8px 12px; }
.cw-otool .cw-title h2 { font-size: 22px; }
.cw-mini { display: flex; background: var(--canvas); border-radius: 10px; padding: 3px; gap: 2px; }
.cw-mini button { border: 0; background: transparent; padding: 8px 12px; border-radius: 8px; font: 700 13.5px var(--font); color: var(--ink-2); cursor: pointer; min-height: 40px; }
.cw-mini button[aria-selected="true"] { background: #fff; color: var(--b); box-shadow: 0 1px 4px rgb(0 0 0 / .1); }
.cw-search { width: 200px; min-height: 44px; }
.cw-fchips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.cw-fchips button { flex: none; border: 1.5px solid var(--line-2); background: #fff; border-radius: 999px; padding: 6px 13px; font: 800 14px var(--font); color: var(--ink); cursor: pointer; min-height: 38px; }
.cw-fchips button small { font-weight: 700; color: var(--r); margin-left: 6px; font-size: 12.5px; }
.cw-fchips button[aria-checked="true"] { background: var(--b); border-color: var(--b); color: #fff; }
.cw-fchips button[aria-checked="true"] small { color: #fff; }
.cw-olist { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cw-orow { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, .9fr) minmax(92px, .6fr) auto; align-items: center; gap: 10px; padding: 6px 10px 6px 12px; min-height: 56px; border-top: 1px solid var(--line); border-left: 4px solid transparent; }
.cw-orow.cw-ohead { min-height: 0; padding-top: 8px; padding-bottom: 8px; border-top: 0; background: var(--canvas); font-size: 12.5px; font-weight: 700; color: var(--ink-3); position: sticky; top: 0; }
.cw-orow.cw-ohead span:nth-child(3) { text-align: right; }
.cw-orow.s-todo { border-left-color: var(--r); }
.cw-orow.s-doing { border-left-color: var(--amber); }
.cw-orow.s-made { border-left-color: var(--g); }
.cw-orow.s-handed { border-left-color: var(--line-2); color: var(--ink-3); }
.cw-orow:nth-child(even):not(.cw-ohead) { background: #fbfcfe; }
.cw-cus { min-width: 0; }
.cw-cus b { display: block; font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
.cw-cus small, .cw-op small, .cw-oq small { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-op { min-width: 0; }
.cw-op b { font-size: 16px; font-weight: 900; color: var(--b); }
.cw-oq { text-align: right; }
.cw-oq b { font-size: 19px; font-weight: 900; color: var(--r); white-space: nowrap; }
.cw-oq b.ok { color: var(--g); }
.cw-oa { display: flex; gap: 6px; justify-content: flex-end; }
.cw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 0 14px; min-height: 44px; font: 800 14.5px var(--font); color: #fff; cursor: pointer; white-space: nowrap; touch-action: manipulation; }
.cw-btn svg { width: 19px; height: 19px; }
.cw-btn.red { background: var(--r); } .cw-btn.red:hover { background: var(--r-deep); }
.cw-btn.green { background: var(--g); } .cw-btn.green:hover { background: var(--g-deep); }
.cw-btn:disabled { opacity: .5; cursor: not-allowed; }
.cw-btn:focus-visible { outline: 3px solid var(--b); outline-offset: 2px; }
.cw-btn.block { width: 100%; } .cw-btn.big { min-height: 60px; font-size: 18px; border-radius: 14px; }
.cw-done { font-size: 13px; font-weight: 700; color: var(--ink-3); padding: 0 10px; }
.cw-empty { background: #fff; border: 1px dashed var(--line-2); border-radius: 14px; padding: 34px 20px; text-align: center; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
.cw-empty strong { font-size: 17px; color: var(--ink); }

@media (max-width: 1100px) { .cw-tile-kg { font-size: 40px; } .cw-totals b { font-size: 19px; } }
@media (max-width: 760px) {
  .cw-bar { position: static; }
  .cw-ses { order: 2; min-height: 48px; } .cw-views { order: 3; }
  .cw-views { margin-left: 0; flex: 1 1 100%; } .cw-views button { flex: 1; }
  .cw-lines { flex: 1; order: 1; } .cw-lines button { flex: 1; text-align: center; }
  .cw-totals { width: 100%; grid-template-columns: repeat(3, 1fr); } .cw-totals > div { padding: 6px 8px; grid-template-columns: 1fr; } .cw-totals svg { display: none; }
  .cw-tiles { grid-template-columns: repeat(2, 1fr); } .cw-tile { min-height: 92px; } .cw-tile-kg { font-size: 38px; }
  .cw-qr { min-height: 72px; } .cw-qr b { font-size: 24px; }
  .cw-otool { position: static; } .cw-search { flex: 1; width: auto; }
  .cw-orow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "cus q" "p a"; row-gap: 4px; }
  .cw-orow.cw-ohead { display: none; }
  .cw-cus { grid-area: cus; } .cw-oq { grid-area: q; } .cw-op { grid-area: p; display: flex; gap: 6px; align-items: baseline; } .cw-oa { grid-area: a; }
  .cw-btn span { display: none; } .cw-btn { padding: 0 13px; }
}

/* Bàn phím số (Số lượng khác / In mã theo đơn) */
dialog.dlg.kp-dlg { width: min(440px, calc(100vw - 16px)); }
.kp { display: flex; flex-direction: column; gap: 10px; font-variant-numeric: tabular-nums; }
.kp-head { display: flex; gap: 12px; align-items: center; }
.kp-abbr { background: #c8161d; color: #fff; border-radius: 10px; padding: 8px 10px; font-size: 20px; font-weight: 900; }
.kp-head strong { display: block; font-size: 15px; } .kp-head small { color: var(--ink-3); font-size: 12.5px; }
.kp-disp { display: block; text-align: right; font-size: 52px; font-weight: 900; color: #c8161d; background: #fff1f0; border-radius: 14px; padding: 6px 16px; line-height: 1.15; }
.kp-disp small { font-size: 22px; }
.kp-prev { min-height: 44px; font-size: 14px; display: flex; flex-direction: column; gap: 5px; }
.kp-prev .cw-chip { background: #fff1f0; color: #8f0e13; border: 1px solid #f4c9c7; padding: 3px 8px; border-radius: 7px; font-weight: 800; font-size: 13px; }
.kp-warn { color: #8f5a00; background: var(--warn-wash); border-radius: 8px; padding: 6px 10px; font-weight: 600; }
.kp-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.kp-quick button { border: 1.5px solid var(--line-2); background: #fff; border-radius: 999px; padding: 7px 13px; font: 700 14px var(--font); cursor: pointer; min-height: 40px; }
.kp-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kp-k { min-height: 60px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; font: 800 26px var(--font); color: var(--ink); cursor: pointer; touch-action: manipulation; }
.kp-k:active { background: var(--sunk); transform: scale(.97); }
.kp-k.fn { background: var(--canvas); }
.kp .cw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; color: #fff; background: #c8161d; font: 800 18px var(--font); min-height: 60px; border-radius: 14px; cursor: pointer; }
.kp .cw-btn:disabled { opacity: .45; }
.kp .cw-btn svg { width: 22px; height: 22px; }

/* Khung in tem ẩn */
#cw-print { position: fixed; right: 0; bottom: 0; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }

/* =====================================================================
   Camera quét QR toàn màn hình (CC.qrScan)
   ===================================================================== */
html.qs-open, html.qs-open body { overflow: hidden; }
.qs { position: fixed; inset: 0; z-index: 1000; background: #000; color: #fff; display: grid; grid-template-rows: 1fr auto; font-family: var(--font); }
.qs-cam { position: relative; overflow: hidden; min-height: 0; }
.qs-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qs-mask { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.qs-frame { position: relative; width: min(64vmin, 360px); aspect-ratio: 1; border-radius: 20px; box-shadow: 0 0 0 200vmax rgb(0 0 0 / .5); }
.qs-frame i { position: absolute; width: 44px; height: 44px; border: 5px solid #fff; }
.qs-frame i:nth-child(1) { top: -3px; left: -3px; border-right: 0; border-bottom: 0; border-top-left-radius: 20px; }
.qs-frame i:nth-child(2) { top: -3px; right: -3px; border-left: 0; border-bottom: 0; border-top-right-radius: 20px; }
.qs-frame i:nth-child(3) { bottom: -3px; left: -3px; border-right: 0; border-top: 0; border-bottom-left-radius: 20px; }
.qs-frame i:nth-child(4) { bottom: -3px; right: -3px; border-left: 0; border-top: 0; border-bottom-right-radius: 20px; }
.qs-laser { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: #3ddc84; box-shadow: 0 0 12px #3ddc84; animation: qs-scan 1.8s ease-in-out infinite alternate; }
@keyframes qs-scan { from { top: 12%; } to { top: 88%; } }
@media (prefers-reduced-motion: reduce) { .qs-laser { animation: none; } }
.qs.hit .qs-frame { animation: qs-hit .35s ease-out; }
@keyframes qs-hit { 0% { box-shadow: 0 0 0 200vmax rgb(14 138 62 / .55); } 100% { box-shadow: 0 0 0 200vmax rgb(0 0 0 / .5); } }
.qs-status { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); max-width: calc(100% - 24px); background: rgb(0 0 0 / .65); padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 15px; text-align: center; }
.qs-status.ok { background: #0e8a3e; } .qs-status.err { background: #c8161d; } .qs-status.warn { background: #a86500; }
.qs-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 12px 10px; background: linear-gradient(rgb(0 0 0 / .6), transparent); }
.qs-top h2 { flex: 1; font-size: 18px; font-weight: 800; text-align: center; color: #fff; }
.qs-btn { min-width: 48px; min-height: 48px; border-radius: 24px; border: 0; background: rgb(255 255 255 / .18); color: #fff; font: 800 16px var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 14px; cursor: pointer; }
.qs-btn.on { background: #ffd54a; color: #000; }
.qs-close { background: #fff; color: #c8161d; }
.qs-btn svg { width: 22px; height: 22px; }
.qs-bottom { background: #fff; color: var(--ink); border-radius: 20px 20px 0 0; padding: 14px 14px max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow: auto; }
.qs-manual { display: flex; gap: 8px; }
.qs-in { flex: 1; min-height: 48px; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 0 14px; font: 600 16px var(--font); min-width: 0; }
.qs-go { min-height: 48px; border: 0; border-radius: 12px; padding: 0 18px; background: var(--ink); color: #fff; font: 800 15px var(--font); cursor: pointer; }
.qs-sheet:empty { display: none; }
.qs-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; color: var(--ink-2); padding: 4px 0; }
.qs-empty .ic { color: #0e8a3e; } .qs-empty b { color: var(--ink); font-size: 16px; }
.qs-order { display: flex; flex-direction: column; gap: 10px; }
.qs-oh { display: flex; align-items: flex-start; gap: 10px; }
.qs-oh > div { flex: 1; min-width: 0; } .qs-oh b { display: block; font-size: 19px; font-weight: 900; text-transform: uppercase; } .qs-oh small { color: var(--ink-3); }
.qs-link { border: 0; background: var(--canvas); border-radius: 8px; padding: 8px 12px; font: 700 13px var(--font); cursor: pointer; color: var(--ink-2); }
.qs-lines { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.qs-line { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 15px; }
.qs-line + .qs-line { border-top: 1px solid var(--line); }
.qs-line span { flex: 1; min-width: 0; } .qs-line b { white-space: nowrap; }
.qs-line em { font-style: normal; font-weight: 800; font-size: 12.5px; border-radius: 6px; padding: 3px 7px; }
.qs-line em.ok { background: #e7f6ec; color: #0a6b30; } .qs-line em.bad { background: #fff1f0; color: #c8161d; }
.qs-codes { display: flex; flex-wrap: wrap; gap: 6px; }
.qs-codes button { border: 1px solid var(--line-2); background: var(--canvas); border-radius: 8px; padding: 6px 10px; font: 700 13px var(--font); cursor: pointer; }
.qs-hint { color: var(--ink-3); }
.qs-note { border-radius: 10px; padding: 9px 12px; font-weight: 700; } .qs-note.ok { background: #e7f6ec; color: #0a6b30; } .qs-note.bad { background: #fff1f0; color: #c8161d; }
.qs-ok { min-height: 62px; border: 0; border-radius: 14px; background: #0e8a3e; color: #fff; font: 900 19px var(--font); cursor: pointer; }
.qs-ok:disabled { background: var(--line-2); color: var(--ink-3); cursor: default; }
@media (min-width: 900px) and (orientation: landscape) {
  .qs { grid-template-columns: 1fr 400px; grid-template-rows: 1fr; }
  .qs-bottom { border-radius: 0; max-height: none; height: 100%; }
  .qs-top { right: 400px; }
}

/* =====================================================================
   2.0 · Giao diện theo mẫu Tuấn Anh: thanh đỏ trên cùng, một trang toàn màn hình
   (không cuộn mất thanh trên), khối tiêu đề đỏ viết hoa, vùng dữ liệu tự cuộn, thanh tổng đỏ dưới đáy.
   ===================================================================== */
:root {
  --r: #c8161d; --r-deep: #8f0e13; --r-wash: #fff1f0; --r-line: #f4c9c7;
  --g: #0e8a3e; --g-deep: #0a6b30; --g-wash: #e7f6ec;
  --b: #1d4fb8; --b-deep: #163d8f; --b-wash: #eaf0fc;
  --amber: #f0a020; --foot-h: 64px;
}
html, body { height: 100%; }
.app { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.body { min-height: 0; overflow: hidden; }
.main { height: 100%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.main.fit { overflow: hidden; padding: 12px 14px; gap: 0; }
.side { position: relative; top: 0; height: 100%; }
.app.nav-off .body { grid-template-columns: minmax(0, 1fr); }
.app.nav-off .side { display: none; }

/* Thanh đầu đỏ */
.top { position: relative; flex: none; background: linear-gradient(100deg, var(--r-deep) 0%, var(--r) 38%, #d9252b 70%, var(--r-deep) 100%); border-bottom: 0; color: #fff; gap: 10px; padding: 0 12px 0 6px; box-shadow: 0 4px 14px rgb(143 14 19 / .3); z-index: 45; }
.top .burger { display: grid; color: #fff; }
.top .tbtn { color: #fff; }
.top .tbtn:hover { background: rgb(255 255 255 / .14); }
.top .tbadge { background: #ffd54a; color: #5a3b00; }
.brand { width: auto; padding: 0 6px; text-decoration: none; color: #fff; gap: 9px; }
.brand .brand-logo { width: 44px; height: 44px; border-radius: 12px; background: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 2px 8px rgb(0 0 0 / .18); }
.brand .brand-logo img { width: 36px; height: 36px; object-fit: contain; }
.brand b { color: #fff; font-size: 17px; font-weight: 900; letter-spacing: .02em; text-transform: uppercase; max-width: 160px; }
.htitle { min-width: 0; padding: 4px 16px 4px 14px; margin-left: 4px; border-left: 1px solid rgb(255 255 255 / .28); flex: 0 1 auto; }
.htitle h1 { font-size: 21px; font-weight: 900; letter-spacing: .01em; text-transform: uppercase; line-height: 1.1; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.htitle span { display: block; font-size: 13px; font-style: italic; font-weight: 600; color: #ffe1df; white-space: nowrap; }
.top .search { flex: 0 1 340px; }
.top .search > .box { background: rgb(255 255 255 / .16); border-color: rgb(255 255 255 / .3); color: #fff; height: 40px; }
.top .search > .box:focus-within { background: #fff; color: var(--ink-3); border-color: #fff; box-shadow: 0 0 0 3px rgb(255 213 74 / .5); }
.top .search input { color: inherit; }
.top .search input::placeholder { color: rgb(255 255 255 / .8); }
.top .search > .box:focus-within input::placeholder { color: var(--ink-3); }
.top .search kbd { background: transparent; color: rgb(255 255 255 / .85); border-color: rgb(255 255 255 / .4); }
.top .msearch { display: none; }
.top .me > button:hover { background: rgb(255 255 255 / .14); }
.top .me b { color: #fff; } .top .me small { color: #ffd9d6; } .top .me > button > svg { color: #fff; }
.top .avatar { background: #fff; color: var(--r); }
.top .clock { color: #fff; border-left-color: rgb(255 255 255 / .28); }
.top .clock b { color: #fff; } .top .clock svg { color: #ffd54a; }
@media (max-width: 1280px) { .top .clock { display: none; } .top .search { flex-basis: 240px; } }
@media (max-width: 1100px) { .top .search { display: none; } .top .search.open { display: block; position: fixed; top: var(--head-h); left: 8px; right: 8px; z-index: 60; } .top .msearch { display: grid; } .brand b { display: none; } }

/* Menu trái: nhóm chính viết hoa */
.side { background: linear-gradient(180deg, #123a7d, #0b2a5e 60%, #0a2352); }
.side nav > .ni, .grp > .ni { text-transform: uppercase; font-size: 13px; letter-spacing: .02em; font-weight: 800; }
.ni[aria-current="true"] { background: var(--r); }
.side-art { background: linear-gradient(180deg, #0a2352, #1d4fb8); height: 92px; }
.side-art::before { display: none; }

/* Tiêu đề trang cũ: viết hoa, đứng yên khi cuộn */
.main:not(.fit) .pagehead { position: sticky; top: -18px; z-index: 30; background: var(--canvas); margin: -18px -22px 0; padding: 14px 22px 10px; border-bottom: 1px solid var(--line); }
.pagehead h1 { color: var(--r); text-transform: uppercase; font-weight: 900; font-size: 24px; letter-spacing: .005em; }
.panel > .ph h2 { text-transform: uppercase; font-weight: 800; letter-spacing: .01em; }
.neworder .left { top: 0; }
.chip.s-ops { background: #fff3d6; color: #8a5a00; }

/* Thanh tổng dưới đáy */
.foot { flex: none; position: relative; height: var(--foot-h); display: flex; align-items: center; gap: 18px; padding: 0 16px; overflow: hidden; color: #fff;
  background: radial-gradient(120% 160% at 50% -40%, #e43a3f 0%, var(--r) 45%, var(--r-deep) 100%); box-shadow: 0 -4px 14px rgb(143 14 19 / .25); z-index: 40; }
.foot-art { flex: none; height: 100%; background-size: cover; background-position: center; }
.foot-art.l { width: 110px; background-image: url(foot-bowl.jpg); -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent); mask-image: linear-gradient(90deg, #000 70%, transparent); margin-left: -16px; }
.foot-art.r { width: 190px; margin-left: auto; margin-right: -16px; background-image: url(foot-herbs.jpg); -webkit-mask-image: linear-gradient(270deg, #000 65%, transparent); mask-image: linear-gradient(270deg, #000 65%, transparent); }
.foot-slogan { display: flex; flex-direction: column; font: italic 700 22px/1 "Brush Script MT", "Segoe Script", "Comic Sans MS", cursive; transform: rotate(-6deg); text-shadow: 0 2px 6px rgb(0 0 0 / .3); }
.foot-slogan span + span { margin-left: 18px; font-size: 25px; }
.foot-k { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 6px 10px; border-radius: 12px; min-width: 0; }
.foot-k:hover { background: rgb(255 255 255 / .12); }
.foot-k svg { width: 34px; height: 34px; flex: none; background: #fff; color: var(--r); border-radius: 10px; padding: 5px; }
.foot-k b { display: block; font-size: 15px; font-weight: 900; letter-spacing: .02em; }
.foot-k span { display: block; font-size: 13.5px; font-weight: 600; color: #ffe6e4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot-sep { width: 1px; height: 60%; background: rgb(255 255 255 / .35); flex: none; }

/* Trang toàn màn hình */
.pg { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; font-variant-numeric: tabular-nums; }
.pg-card { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff; border: 2px solid var(--r); border-radius: 18px; box-shadow: 0 10px 28px rgb(143 14 19 / .1); overflow: hidden; }
.pg-head { flex: none; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 14px 18px 10px; }
.pg-title { flex: 1 1 auto; min-width: 0; }
.pg-title h2 { font-size: 30px; line-height: 1.05; font-weight: 900; color: var(--r); text-transform: uppercase; letter-spacing: -.005em; }
.pg-title h2 small { font-size: 18px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.pg-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pg-top { flex: none; padding: 0 18px 10px; display: flex; flex-direction: column; gap: 10px; }
.pg-scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 18px 14px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.pg-foot { flex: none; padding: 10px 18px 14px; border-top: 1px solid var(--line); background: #fff; }
.pg-scroll .tablewrap { overflow: visible; }
.pg-scroll > .panel, .pg-scroll .panel { border-radius: 14px; }
.pg .tbl { font-size: 15px; }
.pg .tbl th { background: #e9eef6; color: var(--ink); font-size: 13.5px; font-weight: 800; padding: 11px 12px; border-bottom: 0; }
.pg .tbl thead th:first-child { border-radius: 12px 0 0 12px; } .pg .tbl thead th:last-child { border-radius: 0 12px 12px 0; }
.pg .tbl td { padding: 11px 12px; }
.pg .tbl tbody tr:nth-child(even) td { background: #fbfcfe; }
.pg .tbl tbody tr:hover td { background: #f3f7ff; }
.pg-tools .in, .pg-top .in { min-height: 44px; }
.pg-sel { display: flex; align-items: center; gap: 8px; border: 2px solid #c9d6ee; border-radius: 12px; padding: 0 6px 0 14px; background: #fff; min-height: 50px; }
.pg-sel > span { font-size: 15px; font-weight: 700; color: var(--ink-2); white-space: nowrap; text-transform: uppercase; }
.pg-sel select { border: 0; background: transparent; font: 900 17px var(--font); color: var(--b-deep); min-height: 46px; padding: 0 6px; cursor: pointer; max-width: 340px; text-transform: uppercase; }
.pg-sel select:focus-visible { outline: 3px solid var(--b); border-radius: 8px; }

/* Chọn buổi: CA SÁNG / CA CHIỀU */
.sseg { display: inline-flex; background: var(--canvas); border: 1px solid var(--line-2); border-radius: 12px; padding: 3px; gap: 3px; flex: none; }
.sseg button { border: 0; background: transparent; padding: 0 14px; min-height: 42px; border-radius: 9px; font: 800 14px var(--font); color: var(--ink-2); cursor: pointer; white-space: nowrap; letter-spacing: .02em; }
.sseg button[aria-selected="true"] { background: #fff; color: var(--b); box-shadow: 0 1px 6px rgb(10 30 70 / .14); }
.sseg button.s-sang[aria-selected="true"] { color: #a86500; background: #fff6d6; }
.sseg button.s-chieu[aria-selected="true"] { color: var(--b); background: var(--b-wash); }
.sseg.dark { background: rgb(0 0 0 / .18); border-color: transparent; }
.sseg.dark button { color: #fff; }
.sseg.dark button[aria-selected="true"] { background: #fff; color: var(--r); }

/* Nút lớn theo mẫu */
.xbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 0 18px; min-height: 48px; font: 900 15.5px var(--font); color: #fff; cursor: pointer; white-space: nowrap; text-transform: uppercase; letter-spacing: .02em; text-decoration: none; touch-action: manipulation; box-shadow: 0 3px 10px rgb(0 0 0 / .12); }
.xbtn svg { width: 21px; height: 21px; }
.xbtn.red { background: linear-gradient(180deg, #d81f27, var(--r)); } .xbtn.red:hover { background: var(--r-deep); }
.xbtn.green { background: linear-gradient(180deg, #17a24c, var(--g)); } .xbtn.green:hover { background: var(--g-deep); }
.xbtn.blue { background: linear-gradient(180deg, #2a62d6, var(--b)); } .xbtn.blue:hover { background: var(--b-deep); }
.xbtn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line-2); box-shadow: none; }
.xbtn.sm { min-height: 40px; font-size: 13.5px; padding: 0 12px; border-radius: 10px; }
.xbtn.big { min-height: 60px; font-size: 19px; border-radius: 14px; }
.xbtn.block { width: 100%; }
.xbtn:disabled, .xbtn[aria-disabled="true"] { background: #e3e7ee; color: #8a93a3; box-shadow: none; cursor: not-allowed; }
.xbtn:focus-visible { outline: 3px solid #ffd54a; outline-offset: 2px; }

/* Tổng kg chưa làm (hộp hồng) */
.totbar { display: flex; align-items: center; justify-content: center; gap: 14px; background: #fde4e4; border: 2px solid #f3b3b3; border-radius: 14px; padding: 12px 16px; text-align: center; }
.totbar svg { width: 36px; height: 36px; color: var(--r); flex: none; }
.totbar b { font-size: 28px; font-weight: 900; color: var(--r); text-transform: uppercase; letter-spacing: .01em; }
.totbar small { display: block; font-size: 13px; color: var(--ink-2); font-weight: 600; }

/* Ô số liệu to (tổng quan, tổng theo ca) */
.big-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.bstat { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; border: 2px solid var(--bc, var(--line)); background: linear-gradient(135deg, var(--bw, #fff), #fff 75%); text-decoration: none; color: var(--ink); min-width: 0; text-align: left; font: inherit; cursor: default; }
a.bstat, button.bstat { cursor: pointer; }
a.bstat:hover, button.bstat:hover { box-shadow: 0 8px 22px rgb(20 40 90 / .12); }
.bstat .bi { width: 54px; height: 54px; border-radius: 15px; background: var(--bc, var(--ink-3)); color: #fff; display: grid; place-items: center; flex: none; }
.bstat .bi svg { width: 30px; height: 30px; }
.bstat .bl { display: block; font-size: 13.5px; font-weight: 800; color: var(--ink-2); text-transform: uppercase; letter-spacing: .02em; }
.bstat .bv { display: block; font-size: 34px; font-weight: 900; line-height: 1.05; color: var(--bc, var(--ink)); }
.bstat .bs { display: block; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.bstat[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bc) inset; }
.bstat.red { --bc: var(--r); --bw: var(--r-wash); } .bstat.blue { --bc: var(--b); --bw: var(--b-wash); } .bstat.green { --bc: var(--g); --bw: var(--g-wash); }
.bstat.amber { --bc: #c77800; --bw: #fff6e0; } .bstat.purple { --bc: #6b3fc7; --bw: #f1ebff; } .bstat.navy { --bc: #0b2a5e; --bw: #eef3fb; }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pchip { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 9px; border-radius: 8px; background: #fff; border: 1px solid var(--line-2); font-size: 13px; font-weight: 800; color: var(--b-deep); }
.pchip em { font-style: normal; color: var(--r); }

/* Lưới hàng tồn theo sản phẩm */
.stockgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.scard { border: 2px solid var(--r-line); border-radius: 14px; padding: 12px; background: linear-gradient(180deg, #fff, var(--r-wash)); min-width: 0; }
.scard b { display: block; font-size: 24px; font-weight: 900; color: var(--b-deep); line-height: 1; }
.scard span { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.scard strong { display: block; font-size: 26px; font-weight: 900; color: var(--r); margin-top: 6px; }
.scard small { display: block; font-size: 12px; color: var(--ink-3); }
.scard.pk { border-color: #c9d6ee; background: linear-gradient(180deg, #fff, var(--b-wash)); }
.sec-h { font-size: 18px; font-weight: 900; color: var(--b-deep); text-transform: uppercase; letter-spacing: .02em; margin: 14px 0 8px; display: flex; align-items: center; gap: 10px; }
.sec-h small { font-size: 14px; color: var(--ink-3); font-weight: 600; text-transform: none; }

/* Danh sách đơn kiểu mẫu (Khách hàng | Sản phẩm | Số lượng | Thao tác) */
.olist { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.orow { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(110px, .6fr) minmax(0, 1.4fr); align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); border-left: 5px solid transparent; min-height: 66px; }
.orow.ohead { position: sticky; top: 0; z-index: 3; min-height: 0; border-top: 0; background: #e9eef6; font-weight: 900; font-size: 15px; color: var(--ink); padding-top: 12px; padding-bottom: 12px; }
.orow.s-todo { border-left-color: var(--r); } .orow.s-doing { border-left-color: var(--amber); } .orow.s-made { border-left-color: var(--g); background: #f6fcf8; }
.orow:nth-child(odd):not(.ohead):not(.s-made) { background: #fbfcfe; }
.o-cus { display: flex; align-items: center; gap: 10px; min-width: 0; }
.o-cus svg { width: 26px; height: 26px; flex: none; color: var(--ink); }
.o-cus b { display: block; font-size: 17px; font-weight: 800; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-cus small, .o-p small, .o-q small { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-p { min-width: 0; } .o-p b { font-size: 17px; font-weight: 900; color: var(--b-deep); }
.o-q b { font-size: 21px; font-weight: 900; color: var(--ink); white-space: nowrap; } .o-q b.ok { color: var(--g); }
.o-a { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.o-a .xbtn { min-width: 132px; }

/* Thông báo thành công giữa màn hình */
.flash { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; pointer-events: none; background: rgb(0 0 0 / .25); transition: opacity .35s; }
.flash > div { background: #0e8a3e; color: #fff; border-radius: 24px; padding: 26px 36px; text-align: center; box-shadow: 0 20px 60px rgb(0 0 0 / .35); max-width: min(92vw, 560px); animation: flash-in .25s ease-out; }
.flash.warn > div { background: #b86a00; }
.flash b { display: block; font-size: 34px; font-weight: 900; letter-spacing: .01em; }
.flash b::before { content: "✓ "; }
.flash.warn b::before { content: "➜ "; }
.flash span { display: block; font-size: 18px; font-weight: 700; margin-top: 6px; }
.flash.out { opacity: 0; }
@keyframes flash-in { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }

/* Thanh chọn (chọn tất cả, thao tác hàng loạt) */
.selbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: 12px; background: var(--b-wash); border: 1px solid #c9d6ee; }
.selbar label { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; cursor: pointer; }
.selbar input[type=checkbox], .tbl input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--r); }
.selbar .n { font-weight: 700; color: var(--ink-2); }
.selbar .sp2 { flex: 1; }

/* Công tắc In tự động / In tay */
.tgl { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font: 900 14px var(--font); text-transform: uppercase; color: #fff; background: rgb(0 0 0 / .18); border-radius: 12px; padding: 0 12px; min-height: 50px; user-select: none; }
.tgl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tgl i { position: relative; width: 50px; height: 28px; border-radius: 14px; background: rgb(255 255 255 / .35); transition: background .15s; flex: none; }
.tgl i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 4px rgb(0 0 0 / .3); }
.tgl input:checked + i { background: #2fd06d; }
.tgl input:checked + i::after { transform: translateX(22px); }
.tgl input:focus-visible + i { outline: 3px solid #ffd54a; outline-offset: 2px; }
.tgl small { display: block; font-size: 11px; font-weight: 700; opacity: .85; text-transform: none; }
.tgl.light { color: var(--ink); background: #fff; border: 1.5px solid var(--line-2); }
.tgl.light i { background: #cfd6e2; }

@media (max-width: 960px) {
  .top { padding: 0 6px; gap: 4px; }
  .htitle { border-left: 0; padding: 0 4px; margin: 0; flex: 1 1 auto; }
  .htitle h1 { font-size: 17px; } .htitle span { display: none; }
  .brand .brand-logo { width: 38px; height: 38px; } .brand .brand-logo img { width: 30px; height: 30px; }
  .side { position: fixed; top: 0; height: auto; }
  .app.nav-off .side { display: flex; }
  .main.fit { padding: 8px; }
  .pg-title h2 { font-size: 23px; } .pg-title h2 small { font-size: 15px; }
  .pg-head { padding: 12px 12px 8px; } .pg-top { padding: 0 12px 8px; } .pg-scroll { padding: 0 12px 12px; } .pg-foot { padding: 8px 12px 10px; }
  .main:not(.fit) .pagehead { top: -12px; margin: -12px -12px 0; padding: 10px 12px 8px; }
  .foot-art.l, .foot-slogan { display: none; }
  .foot-art.r { width: 110px; }
  .orow { grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(90px, .5fr) auto; }
  .o-a .xbtn { min-width: 0; }
}
@media (max-width: 640px) {
  :root { --foot-h: 50px; }
  .brand { display: none; }
  .foot { gap: 6px; padding: 0 6px; justify-content: space-around; }
  .foot-art.r, .foot-sep { display: none; }
  .foot-k { padding: 4px 6px; gap: 6px; } .foot-k svg { width: 26px; height: 26px; padding: 3px; }
  .foot-k b { font-size: 11.5px; } .foot-k span { font-size: 11.5px; }
  .pg-card { border-width: 1.5px; border-radius: 14px; }
  .pg-title h2 { font-size: 20px; } .pg-title h2 small { font-size: 13px; }
  .pg-tools { width: 100%; justify-content: stretch; } .pg-tools > * { flex: 1 1 auto; }
  .totbar b { font-size: 20px; } .totbar svg { width: 28px; height: 28px; }
  .orow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "cus q" "p p" "a a"; row-gap: 6px; padding: 10px; }
  .orow.ohead { display: none; }
  .o-cus { grid-area: cus; } .o-q { grid-area: q; text-align: right; } .o-p { grid-area: p; } .o-a { grid-area: a; }
  .o-a .xbtn { flex: 1; }
  .bstat { padding: 12px; gap: 10px; } .bstat .bi { width: 42px; height: 42px; } .bstat .bv { font-size: 26px; }
  .big-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sseg { width: 100%; } .sseg button { flex: 1; padding: 0 6px; }
  .pg-sel { width: 100%; } .pg-sel select { flex: 1; max-width: none; font-size: 15px; }
  .flash b { font-size: 26px; }
}
@media print { .foot { display: none !important; } .app { height: auto; overflow: visible; } .main { overflow: visible; height: auto; } }
/* Hộp thoại khách hàng: địa chỉ, tài xế 2 ca */
.dlg-h { margin: 6px 0 -4px; font-size: 15px; font-weight: 900; color: var(--r); letter-spacing: .03em; }
.shift { border-radius: 12px; padding: 10px 12px; border: 2px solid; }
.shift.am { border-color: #f3d27a; background: #fffaf0; } .shift.pm { border-color: #b9cbef; background: var(--b-wash); }
.shift label > span, .shift .field > span { font-weight: 800; }
.addr2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 640px) { .addr2 { grid-template-columns: 1fr; } }
/* Nhập đơn: chọn sản phẩm, ô quy cách bịch 20/10/5/4/3/2/1 kg có + −, tổng số kg */
.oprods { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; max-height: 196px; overflow: auto; padding: 2px; }
.oprod { display: grid; text-align: left; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line-2); background: #fff; cursor: pointer; color: var(--ink); min-width: 0; font: inherit; }
.oprod b { font-size: 19px; font-weight: 900; line-height: 1; color: var(--b-deep); }
.oprod span { font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.oprod small { font-size: 12px; color: var(--ink-3); font-weight: 700; }
.oprod.has { border-color: var(--g); background: var(--g-wash); } .oprod.has small { color: var(--g-deep); }
.oprod[aria-checked="true"] { border-color: var(--r); background: var(--r); color: #fff; box-shadow: 0 6px 16px rgb(200 22 29 / .28); }
.oprod[aria-checked="true"] b, .oprod[aria-checked="true"] span, .oprod[aria-checked="true"] small { color: #fff; }
.sz-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--b-wash); }
.sz-head b { display: block; font-size: 16px; font-weight: 900; } .sz-head small { color: var(--ink-3); }
.sz-tot { text-align: right; } .sz-tot small { display: block; font-size: 12px; } .sz-tot b { font-size: 24px; color: var(--r); }
.sz-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.sz { border: 2px solid var(--r-line); border-radius: 14px; background: linear-gradient(180deg, #fff, var(--r-wash)); padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.sz.on { border-color: var(--r); box-shadow: 0 4px 14px rgb(200 22 29 / .18); }
.sz.off { opacity: .35; filter: grayscale(1); }
.sz-kg { font-size: 30px; font-weight: 900; color: var(--r); line-height: 1; } .sz-kg small { font-size: 15px; margin-left: 2px; }
.sz-step { display: flex; align-items: stretch; width: 100%; border: 1.5px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; }
.sz-step button { flex: none; width: 34px; min-height: 42px; border: 0; background: #f2f6fc; font-size: 22px; font-weight: 800; color: var(--b-deep); cursor: pointer; touch-action: manipulation; }
.sz-step button:disabled { color: #b9c1cf; cursor: default; }
.sz-step button:not(:disabled):active { background: #dfe9fa; }
.sz-step input { flex: 1; min-width: 0; width: 100%; border: 0; text-align: center; font: 900 19px var(--font); outline: 0; -moz-appearance: textfield; }
.sz-step input::-webkit-inner-spin-button, .sz-step input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sz-sub { font-size: 12px; font-weight: 800; color: var(--g-deep); min-height: 15px; }
.prow2 { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.prow2:first-child { border-top: 0; } .prow2.cur { background: #fff7f6; }
.prow2 .ab { font-size: 16px; font-weight: 900; color: #fff; background: var(--b); border-radius: 8px; padding: 4px 8px; }
.prow2 .nm span { display: block; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .prow2 .nm small { display: block; color: var(--ink-3); font-size: 12.5px; }
.prow2 strong { font-size: 19px; font-weight: 900; color: var(--r); white-space: nowrap; }
.ofoot { display: flex; flex-direction: column; gap: 8px; }
.ofoot-row { display: flex; gap: 12px; align-items: stretch; }
.ofoot-row .totbar { flex: 1; justify-content: flex-start; }
.ofoot-row .xbtn { min-width: 220px; }
.kp-abbr { flex: none; }
@media (max-width: 1350px) { .sz-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .sz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oprods { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 150px; }
  .ofoot-row { flex-direction: column; } .ofoot-row .xbtn { min-width: 0; width: 100%; }
}
/* Cân hàng 2.0 */
.cw-bar { position: static; flex: none; padding: 8px; border-radius: 16px; }
.cw-seg button { display: inline-flex; align-items: center; gap: 8px; text-transform: none; }
.cw-seg button svg { width: 26px; height: 26px; flex: none; }
.cw-lines { background: #fff; padding: 4px; }
.cw-lines button { color: var(--r); font-size: 17px; font-weight: 900; padding: 8px 18px; }
.cw-lines button[aria-selected="true"] { background: linear-gradient(180deg, #2a62d6, var(--b)); color: #fff; box-shadow: 0 4px 12px rgb(29 79 184 / .35); }
.cw-views button { font-weight: 900; letter-spacing: .02em; }
.cw-views { margin-left: auto; }
.cw-totals { grid-template-columns: auto repeat(2, minmax(120px, 1fr)); align-items: stretch; border-radius: 14px; }
.cw-totals > em { grid-column: 1; display: grid; place-items: center; padding: 0 12px; font-style: normal; font-weight: 900; font-size: 14px; color: #fff; background: var(--b); letter-spacing: .03em; writing-mode: horizontal-tb; }
.cw-totals b { font-size: 26px; }
.cw-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cw-tile { min-height: 132px; flex-direction: column; border-radius: 18px; }
.cw-tile .cw-tile-ic { width: 40px; height: 40px; background: var(--r); color: #fff; border-radius: 10px; padding: 6px; }
.cw-tile-kg { font-size: 50px; }
.cw-tile-kg.sm { font-size: 22px; font-weight: 900; text-align: center; line-height: 1.1; }
.cw-tile-sub { font-size: 12.5px; font-weight: 800; text-transform: uppercase; text-align: center; padding: 0 6px; }
.cw-tile.other { background: linear-gradient(180deg, #fff, var(--r-wash)); border-style: solid; color: var(--r); }
.cw-tile.other .ic.big { width: 46px; height: 46px; }
.cw-last { margin-top: 8px; }
.cw-hist { margin-top: 8px; }
.pg-foot .cw-last { margin-top: 8px; }
@media (max-width: 1100px) { .cw-lines button { font-size: 15px; padding: 8px 12px; } .cw-views { margin-left: 0; } }
@media (max-width: 760px) {
  .cw-bar { gap: 6px; }
  .cw-lines, .cw-views { flex: 1 1 100%; } .cw-lines button, .cw-views button { flex: 1; justify-content: center; }
  .cw-seg button svg { width: 20px; height: 20px; }
  .cw-bar .tgl { flex: 1; min-height: 44px; justify-content: center; }
  .cw-bar .sseg { flex: 1 1 100%; }
  .cw-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cw-tile { min-height: 104px; } .cw-tile-kg { font-size: 38px; }
  .cw-totals { width: 100%; grid-template-columns: auto 1fr 1fr; } .cw-totals > em { font-size: 11px; padding: 0 6px; }
  .cw-totals > div { grid-template-columns: 1fr; } .cw-totals > div svg { display: none; } .cw-totals b { font-size: 19px; }
}
/* Kho trung gian: đơn chờ Điều Hành Xưởng + hàng tồn */
.ops2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.ops2 > section > .sec-h { margin-top: 4px; }
.opcard { border: 2px solid #d9cdf3; border-left: 6px solid #6b3fc7; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: #fbf9ff; }
.opc-h { display: flex; align-items: flex-start; gap: 10px; }
.opc-h b { display: block; font-size: 17px; font-weight: 900; text-transform: uppercase; } .opc-h small { color: var(--ink-3); }
.opc-h strong { font-size: 22px; font-weight: 900; color: var(--r); white-space: nowrap; }
.opc-a { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; }
/* Truy xuất: các thông tin chính to rõ */
.tfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 10px 0; }
.tfact { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.tfact span { display: block; font-size: 12.5px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; }
.tfact b { display: block; font-size: 18px; font-weight: 900; color: var(--ink); }
.tfact.hl { border: 2px solid var(--r); background: var(--r-wash); } .tfact.hl b { color: var(--r); font-size: 21px; }
.pg-top .scanbox { display: flex; gap: 8px; flex-wrap: wrap; }
.pg-top .scanbox .in { flex: 1 1 220px; min-height: 60px; font-size: 18px; }
.trace { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 960px) { .ops2 { grid-template-columns: 1fr; } .opc-a { grid-template-columns: 1fr; } }
/* 2.0 chỉnh gọn khối tiêu đề: công cụ trên một hàng, ô nhập không giãn hết chiều ngang */
.pg-title { flex: 1 1 260px; }
.pg-tools .in { width: auto; }
.pg-tools .in[type=date] { width: 168px; }
.pg-tools .tlabel { font-size: 13px; font-weight: 800; color: var(--ink-3); }
@media (min-width: 1101px) { .pg-tools .in[type=search] { width: 230px; } }
a.scard { text-decoration: none; color: inherit; display: block; }
a.scard:hover { border-color: var(--r); }
.tgl.light { min-height: 50px; }
.tgl.light small { color: var(--ink-3); }
.otool .in[type=search] { flex: 1 1 220px; width: auto; }
.tbl .ocus { max-width: 300px; } .tbl .ocus .sub2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-a { flex-wrap: nowrap; }
/* Thẻ tổng theo ca (Quản lý đơn hàng): gọn để danh sách đơn có chỗ */
.big-stats.tot3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.big-stats.tot3 .bstat { padding: 8px 12px; gap: 10px; }
.big-stats.tot3 .bstat .bi { width: 40px; height: 40px; border-radius: 12px; } .big-stats.tot3 .bstat .bi svg { width: 22px; height: 22px; }
.big-stats.tot3 .bstat .bv { font-size: 26px; display: inline-block; margin-right: 8px; }
.big-stats.tot3 .bstat .bs { display: inline-block; font-size: 13px; }
.big-stats.tot3 .bstat .bl { font-size: 12px; }
.big-stats.tot3 .pchips { margin-top: 3px; gap: 4px; } .big-stats.tot3 .pchip { padding: 1px 7px; font-size: 12px; }
@media (max-width: 640px) {
  .big-stats.tot3 { grid-template-columns: 1fr 1fr; } .big-stats.tot3 > :last-child { display: none; }
  .big-stats.tot3 .bstat .bi { display: none; } .big-stats.tot3 .bstat .bv { font-size: 21px; display: block; }
  .pg-tools .in[type=date] { width: auto; flex: 1 1 140px; }
  .o-a { flex-wrap: wrap; }
}
.pg-top > .big-stats { align-self: stretch; width: 100%; }
/* Thao tác trong bảng đơn: In / Sửa / Huỷ / Tem gọn 2 cột để bảng không tràn ngang */
.pg .tbl td .acts { display: grid; grid-template-columns: repeat(2, minmax(74px, auto)); gap: 5px; justify-content: end; }
.pg .tbl td .acts .xbtn.sm { min-height: 34px; padding: 0 9px; font-size: 12.5px; gap: 5px; box-shadow: none; }
.pg .tbl td .acts .xbtn.sm svg { width: 16px; height: 16px; }
@media (max-width: 1350px) { .tbl .ocus .sub2 { display: none; } .tbl .ocus { max-width: 220px; } }
@media (max-width: 640px) { .pg .tbl td .acts { grid-template-columns: repeat(4, auto); justify-content: end; } }
.pg .tbl td, .pg .tbl th { padding-left: 8px; padding-right: 8px; }
.pg .tbl .chip { white-space: normal; }
.orow { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(100px, .6fr) auto; }
@media (max-width: 1300px) { .o-a .xbtn { min-width: 0; padding: 0 12px; font-size: 14px; } .orow { gap: 8px; padding: 8px 10px; } }
@media (max-width: 960px) { .orow { grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(86px, .5fr) auto; } }
/* Điện thoại: thanh đỏ trên và thanh tổng dưới đứng yên; nội dung trang cuộn liền một khối để có đủ chỗ xem danh sách.
   Tổng kg và nút chính (LÊN ĐƠN) luôn dính ở đáy khung. */
@media (max-width: 640px) {
  .main.fit { overflow-y: auto; padding: 8px 8px 12px; }
  .main.fit .pg { flex: none; min-height: 100%; }
  .main.fit .pg-card { flex: 1 0 auto; overflow: visible; }
  .main.fit .pg-scroll { flex: none; overflow: visible; min-height: 120px; }
  .main.fit .pg-foot { position: sticky; bottom: -12px; z-index: 6; box-shadow: 0 -6px 14px rgb(10 30 70 / .08); border-radius: 0 0 12px 12px; }
  .main.fit .orow.ohead, .main.fit .tbl th { position: static; }
  .totbar { padding: 8px 10px; gap: 8px; } .totbar b { font-size: 17px; } .totbar small { font-size: 11.5px; }
  .cw-bar { padding: 6px; border-radius: 12px; }
  .cw-seg button { padding: 6px 8px; min-height: 40px; font-size: 13.5px; }
  .cw-seg button small { font-size: 11px; }
  .sseg button { min-height: 38px; font-size: 13px; }
  .tgl { min-height: 42px; }
  .pg-tools .tgl.light { flex: 0 0 auto; }
}
@media (max-width: 1100px) { .tbl .hmd { display: none !important; } }
@media (max-width: 640px) {
  .orow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "cus q" "p p" "a a"; padding: 10px; gap: 6px 8px; }
  .o-a { flex-wrap: nowrap; } .o-a .xbtn { flex: 1 1 0; min-width: 0; padding: 0 8px; font-size: 13.5px; }
  .o-cus b { font-size: 16px; }
}
@media (max-width: 640px) { .top a.tbtn[href='#/e/settings'] { display: none; } }
.scard .xbtn { white-space: normal; font-size: 12px; line-height: 1.15; padding: 4px 8px; }

/* =====================================================================
   2.3.0 - APP TÀI XẾ: tông đỏ trắng, vừa khít một màn hình điện thoại.
   Trang không cuộn; chỉ vùng nội dung giữa cuộn. Thanh dưới cố định.
   ===================================================================== */
html.drv-mode, body.drv-mode { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.drv-mode .app > :not(.body), body.drv-mode .body > :not(#view) { display: none !important; }
.dv { --r: #c8161d; --r-deep: #8f0e13; --r-2: #d9252b; --r-wash: #fff1f0; --r-line: #f4c9c7; --g: #0e8a3e; --g-wash: #e7f6ec; --o: #b25e00; --o-wash: #fff3e3; --bg: #f5f2f2; --ln: #ebe3e3;
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font-family: var(--font); overflow: hidden; -webkit-tap-highlight-color: transparent; }
.dv *, .dv *::before, .dv *::after { min-width: 0; }
.dv button, .dv a { touch-action: manipulation; }
.dv input, .dv select, .dv textarea { font-size: 16px; }

/* Đầu trang */
.dv-head { flex: none; color: #fff; background: linear-gradient(100deg, var(--r-deep) 0%, var(--r) 42%, var(--r-2) 74%, var(--r-deep) 100%); padding: calc(env(safe-area-inset-top) + 8px) 12px 10px; box-shadow: 0 4px 14px rgb(143 14 19 / .28); position: relative; z-index: 2; }
.dv-hrow { display: flex; align-items: center; gap: 10px; }
.dv-av { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--r); display: grid; place-items: center; font-weight: 900; font-size: 18px; flex: none; box-shadow: 0 2px 6px rgb(0 0 0 / .18); }
.dv-av.big { width: 58px; height: 58px; font-size: 25px; background: var(--r); color: #fff; }
.dv-who { flex: 1; min-width: 0; }
.dv-who b { display: block; font-size: 16.5px; font-weight: 800; line-height: 1.2; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-who span { display: block; font-size: 12.5px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-ib { width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgb(255 255 255 / .16); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; text-decoration: none; }
.dv-ib .ic { width: 21px; height: 21px; }
.dv-ib.spin .ic { animation: dvspin .8s linear infinite; }
@keyframes dvspin { to { transform: rotate(360deg); } }
.dv-sum { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin-top: 10px; }
.dv-sum button { border: 0; border-radius: 12px; background: rgb(255 255 255 / .15); color: #fff; padding: 7px 4px 6px; cursor: pointer; text-align: center; font: inherit; }
.dv-sum button:active { background: rgb(255 255 255 / .28); }
.dv-sum b { display: block; font-size: 17px; font-weight: 900; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-sum span { display: block; font-size: 11px; font-weight: 600; opacity: .9; text-transform: uppercase; letter-spacing: .03em; }

/* Dải báo (chỉ hiện khi có vấn đề) */
.dv-alerts { flex: none; display: flex; flex-direction: column; }
.dv-alerts:empty { display: none; }
.dv-al { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; padding: 8px 12px; font: 600 13px var(--font); text-align: left; color: #fff; cursor: pointer; }
.dv-al .ic { width: 17px; height: 17px; flex: none; }
.dv-al span { flex: 1; } .dv-al b { background: rgb(255 255 255 / .22); border-radius: 8px; padding: 3px 9px; font-size: 12.5px; }
.dv-al.off { background: #3b3f46; } .dv-al.warn { background: #b25e00; } .dv-al.err { background: var(--r-deep); } .dv-al.info { background: #e9e3e3; color: var(--ink-2); cursor: default; }

/* Vùng nội dung: chỉ phần này cuộn */
.dv-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 10px 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.dv-body > * { flex-shrink: 0; }
.dv-body.fixed { overflow: hidden; padding-bottom: 10px; }
.dv-body.fixed > .dv-map, .dv-body.fixed > .dv-route { flex-shrink: 1; }

/* Thanh dưới */
.dv-nav { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid var(--ln); box-shadow: 0 -4px 16px rgb(0 0 0 / .06); padding-bottom: env(safe-area-inset-bottom); position: relative; z-index: 2; }
.dv-nav button { position: relative; height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--ink-3); font: 700 11.5px var(--font); cursor: pointer; }
.dv-nav button .ic { width: 24px; height: 24px; }
.dv-nav button[aria-current="page"] { color: var(--r); }
.dv-nav button[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 26%; right: 26%; height: 3px; border-radius: 0 0 3px 3px; background: var(--r); }
.dv-nav .nb { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--r); color: #fff; font-size: 11px; display: grid; place-items: center; }

/* Nút, nhãn */
.dv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 14px; border-radius: 14px; border: 1.5px solid transparent; font: 800 15.5px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.dv-btn .ic { width: 20px; height: 20px; }
.dv-btn.red { background: linear-gradient(180deg, #d81f27, var(--r)); color: #fff; box-shadow: 0 4px 12px rgb(200 22 29 / .3); }
.dv-btn.red:active { background: var(--r-deep); }
.dv-btn.line { background: #fff; color: var(--r); border-color: var(--r-line); }
.dv-btn:disabled { opacity: .6; }
.dv-pill { font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 20px; white-space: nowrap; flex: none; }
.dv-pill.red { background: var(--r-wash); color: var(--r); } .dv-pill.green { background: var(--g-wash); color: var(--g); } .dv-pill.warn { background: var(--o-wash); color: var(--o); }
.dv-pill.gray { background: #eceaea; color: var(--ink-3); } .dv-pill.blue { background: #e8f1fd; color: #1f5fd1; }
.dv-seg { flex: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: #fff; border: 1px solid var(--ln); border-radius: 14px; position: sticky; top: -10px; z-index: 3; box-shadow: 0 4px 10px rgb(0 0 0 / .04); }
.dv-seg button { min-height: 42px; border: 0; border-radius: 10px; background: none; font: 800 14.5px var(--font); color: var(--ink-2); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.dv-seg button i { font-style: normal; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #eee; font-size: 12px; display: grid; place-items: center; }
.dv-seg button[aria-selected="true"] { background: var(--r); color: #fff; }
.dv-seg button[aria-selected="true"] i { background: rgb(255 255 255 / .25); color: #fff; }

/* Chuyến */
.dv-trip { background: #fff; border: 1px solid var(--ln); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 7px; text-align: left; font: inherit; color: inherit; width: 100%; }
.dv-trip.tap { cursor: pointer; } .dv-trip.tap:active { background: var(--r-wash); }
.dv-trow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dv-trow b { font-size: 15.5px; color: var(--r-deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-bar { height: 8px; border-radius: 6px; background: #f1e9e9; overflow: hidden; }
.dv-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--r), #f0545a); transition: width .4s; }
.dv-tsub { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.dv-recv { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.dv-recv summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--o); padding: 6px 0; }
.dv-pick > div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--ln); font-size: 14px; }
.dv-pick b { text-align: right; white-space: nowrap; } .dv-pick small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12px; }

/* Thẻ đơn */
.dv-card { background: #fff; border: 1.5px solid var(--ln); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 2px 8px rgb(60 0 0 / .04); }
.dv-card.next { border-color: var(--r); box-shadow: 0 6px 18px rgb(200 22 29 / .16); }
.dv-card.late { box-shadow: inset 5px 0 0 var(--r); }
.dv-card.done { opacity: .92; }
.dv-ribbon { background: var(--r); color: #fff; font: 900 11.5px var(--font); letter-spacing: .08em; padding: 5px 14px; }
.dv-ctop { display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 6px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; }
.dv-seq { width: 32px; height: 32px; border-radius: 50%; background: var(--r); color: #fff; font: 900 14px var(--font); display: grid; place-items: center; flex: none; }
.dv-seq.sm { width: 28px; height: 28px; font-size: 12.5px; } .dv-seq.green { background: var(--g); }
.dv-card.done .dv-seq { background: var(--g); }
.dv-cm { flex: 1; min-width: 0; }
.dv-cl1 { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dv-cl1 b { font-size: 16.5px; font-weight: 800; line-height: 1.25; word-break: break-word; }
.dv-cm p { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dv-cm small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; letter-spacing: .02em; }
.dv-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 12px 10px 54px; }
.dv-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; padding: 4px 9px; border-radius: 9px; background: #f4efef; color: var(--ink-2); white-space: nowrap; }
.dv-chip .ic { width: 14px; height: 14px; }
.dv-chip.red { background: var(--r-wash); color: var(--r); } .dv-chip.green { background: var(--g-wash); color: var(--g); } .dv-chip.cod { background: #fff4d6; color: #8a5a00; }
.dv-quick { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ln); }
.dv-quick > * { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; border: 0; background: none; color: var(--ink-2); font: 700 12px var(--font); text-decoration: none; cursor: pointer; }
.dv-quick > * + * { border-left: 1px solid var(--ln); }
.dv-quick .ic { width: 21px; height: 21px; color: var(--r); }
.dv-quick .zl { font: 900 11px var(--font); color: #fff; background: #0068ff; border-radius: 6px; padding: 2px 4px; line-height: 1.2; }
.dv-quick .off { opacity: .35; pointer-events: none; }
.dv-quick > *:active { background: var(--r-wash); }
.dv-main { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--ln); background: #fffafa; }
.dv-main .dv-btn.red { flex: 1; }
.dv-wait { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13.5px; padding: 8px 0; }
.dv-wait .ic { width: 17px; height: 17px; }
.dv-none { text-align: center; color: var(--ink-3); font-size: 13.5px; margin: 4px 0; }
.dv-empty { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-3); padding: 30px 16px; }
.dv-empty b { color: var(--ink); font-size: 16px; }
.dv-eico { width: 72px; height: 72px; border-radius: 50%; background: var(--r-wash); color: var(--r); display: grid; place-items: center; }
.dv-eico .ic { width: 36px; height: 36px; }

/* Lộ trình */
.dv-map { flex: 1 1 46%; min-height: 160px; border-radius: 16px; overflow: hidden; border: 1px solid var(--ln); }
.dv-mapacts { flex: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.dv-mapacts .dv-btn { min-height: 46px; font-size: 14px; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; }
.dv-route { flex: 1 1 40%; min-height: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--ln); border-radius: 16px; overflow: hidden; }
.dv-rhead { flex: none; display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--ln); }
.dv-rhead b { color: var(--r-deep); } .dv-rhead span { font-weight: 800; color: var(--r); }
.dv-rlist { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.dv-rrow { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--ln); background: none; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.dv-rrow i { width: 28px; height: 28px; border-radius: 50%; background: var(--r); color: #fff; display: grid; place-items: center; font: 900 12.5px var(--font); font-style: normal; }
.dv-rrow.start i { background: #3b3f46; } .dv-rrow.start i .ic { width: 15px; height: 15px; }
.dv-rrow.late i { background: var(--r-deep); box-shadow: 0 0 0 3px var(--r-line); }
.dv-rrow b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-rrow small { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-rrow > span { text-align: right; font-weight: 800; font-size: 13px; white-space: nowrap; }
.dv-rrow > span small { font-weight: 600; }

/* Thống kê */
.dv-hero { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; border-radius: 20px; padding: 16px; color: #fff; text-align: left; font: inherit; cursor: pointer; background: linear-gradient(120deg, var(--r-deep), var(--r) 58%, var(--r-2)); box-shadow: 0 8px 22px rgb(143 14 19 / .24); }
.dv-hero small { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .9; }
.dv-hero h2 { font-size: 27px; line-height: 1.1; margin: 4px 0 2px; color: #fff; }
.dv-hero span { font-size: 13.5px; opacity: .92; }
.dv-ringbox { position: relative; width: 84px; height: 84px; flex: none; }
.dv-ring { width: 84px; height: 84px; display: block; }
.dv-ringbox b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 19px; font-weight: 900; }
.dv-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dv-tile { --c: var(--r); --w: var(--r-wash); position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; border-radius: 16px; border: 1px solid var(--ln); background: linear-gradient(140deg, var(--w), #fff 70%); text-align: left; font: inherit; color: inherit; cursor: pointer; min-height: 112px; }
.dv-tile:active { transform: scale(.98); }
.dv-tile .ti { width: 34px; height: 34px; border-radius: 10px; background: var(--c); color: #fff; display: grid; place-items: center; margin-bottom: 4px; }
.dv-tile .ti .ic { width: 19px; height: 19px; }
.dv-tile > b { font-size: 21px; font-weight: 900; line-height: 1.1; color: var(--c); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-tile .tl { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.dv-tile small { font-size: 11.5px; color: var(--ink-3); }
.dv-tile em { position: absolute; right: 12px; top: 10px; font-style: normal; font-size: 22px; color: var(--ink-3); opacity: .6; }
.dv-tile.green { --c: var(--g); --w: var(--g-wash); } .dv-tile.orange { --c: var(--o); --w: var(--o-wash); } .dv-tile.blue { --c: #1f5fd1; --w: #e8f1fd; }
.dv-tile.purple { --c: #6a3fc4; --w: #f1ebff; } .dv-tile.gray { --c: #6f7a86; --w: #f2f0f0; }
.dv-sec { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--r-deep); margin: 4px 2px -2px; }

/* Bảng chi tiết (sheet) */
.dv-dlist { display: flex; flex-direction: column; }
.dv-drow { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; }
.dv-drow b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-drow small { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-drow .r { font-weight: 800; font-size: 13.5px; color: #c8161d; white-space: nowrap; }
.dv-dsec { font-weight: 800; font-size: 13px; color: #8f0e13; padding: 10px 2px 2px; text-transform: uppercase; }
.dv-items > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.dv-items small { display: block; color: var(--ink-3); font-size: 12px; }
.dv-items b { white-space: nowrap; }
.dv-sheetaddr { display: flex; gap: 6px; align-items: flex-start; color: var(--ink-2); font-size: 14px; }
.dv-sheetaddr .ic { width: 17px; height: 17px; color: #c8161d; flex: none; margin-top: 2px; }
.dv-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }

/* Tài khoản */
.dv-acc { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--ln); border-radius: 18px; padding: 14px; }
.dv-acc b { display: block; font-size: 18px; } .dv-acc span { color: var(--ink-3); font-size: 13.5px; }
.dv-kv { background: #fff; border: 1px solid var(--ln); border-radius: 16px; padding: 4px 14px; }
.dv-kv > div { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--ln); font-size: 14.5px; }
.dv-kv > div:last-child { border-bottom: 0; } .dv-kv span { color: var(--ink-3); }
.dv-menu { background: #fff; border: 1px solid var(--ln); border-radius: 16px; overflow: hidden; }
.dv .sheet-list.dv-menu > * { padding-left: 14px; }

@media (max-width: 360px) {
  .dv-sum b { font-size: 15px; } .dv-sum span { font-size: 10px; }
  .dv-chips { padding-left: 12px; }
  .dv-btn { font-size: 14.5px; padding: 0 10px; }
  .dv-tile > b { font-size: 18px; }
}
@media (min-width: 700px) { .dv-body { padding-left: max(12px, calc(50% - 330px)); padding-right: max(12px, calc(50% - 330px)); } }
.dv-sun { width: 20px; text-align: center; font-size: 18px; color: #c8161d; }

/* ===== 2.4.0: chọn ngày làm hàng + ca làm, tổng gọn trên tiêu đề (bỏ khung đỏ cuối trang) ===== */
.cw-slot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cw-dwrap { display: flex; flex-direction: column; gap: 1px; background: rgb(0 0 0 / .18); border-radius: 12px; padding: 4px 10px 5px; color: #fff; cursor: pointer; }
.cw-dwrap small { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; opacity: .85; }
.cw-date { border: 0; background: #fff; color: var(--r); font: 800 15px var(--font); border-radius: 8px; padding: 4px 8px; min-height: 32px; min-width: 140px; }
.cw-shift button { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; letter-spacing: .02em; }
.cw-shift button .ic { width: 18px; height: 18px; }
.cw-deliv { display: flex; flex-direction: column; color: #fff; padding: 2px 6px; line-height: 1.15; }
.cw-deliv small { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; opacity: .8; }
.cw-deliv b { font-size: 14.5px; white-space: nowrap; }
.cw-sum { display: flex; align-items: center; gap: 8px; background: #fff1f0; border: 1.5px solid #f4c9c7; border-radius: 12px; padding: 6px 12px; color: #8f0e13; }
.cw-sum .ic { width: 22px; height: 22px; color: #c8161d; flex: none; }
.cw-sum b { display: block; font-size: 16px; font-weight: 900; color: #c8161d; text-transform: uppercase; white-space: nowrap; }
.cw-sum small { display: block; font-size: 11.5px; color: #8f0e13; white-space: nowrap; }
.late-tag { display: inline-block; margin-left: 6px; font: 900 10.5px var(--font); font-style: normal; color: #fff; background: #c8161d; border-radius: 6px; padding: 2px 6px; vertical-align: 2px; letter-spacing: .04em; }
@media (max-width: 760px) { .cw-deliv b { font-size: 13px; } .cw-date { min-width: 0; } }
/* App tài xế 2.4.0: chọn ca giao (Sáng nay / Chiều nay / Tối → sáng mai) */
.dv-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 10px; padding: 3px; background: rgb(0 0 0 / .2); border-radius: 13px; }
.dv-slots button { position: relative; border: 0; border-radius: 10px; background: transparent; color: #fff; padding: 6px 4px; font: inherit; cursor: pointer; text-align: center; min-height: 46px; }
.dv-slots b { display: block; font-size: 13.5px; font-weight: 800; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-slots small { display: block; font-size: 10.5px; opacity: .85; white-space: nowrap; }
.dv-slots i { position: absolute; top: -5px; right: -2px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #ffd54a; color: #8f0e13; font: 900 11px/19px var(--font); font-style: normal; }
.dv-slots i.ok { background: #0e8a3e; color: #fff; }
.dv-slots button[aria-selected="true"] { background: #fff; color: #c8161d; box-shadow: 0 2px 8px rgb(0 0 0 / .18); }
.dv-slots button[aria-selected="true"] small { color: #8f0e13; opacity: 1; }
@media (max-width: 360px) { .dv-slots b { font-size: 12px; } .dv-slots small { font-size: 9.5px; } }

/* ===== 2.5.0: Cửa hàng online (quản lý) ===== */
.sh-admin { display: flex; flex-direction: column; gap: 16px; padding-bottom: 20px; }
.sh-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sh-card h3 { font-size: 16px; color: #8f0e13; text-transform: uppercase; letter-spacing: .03em; }
.sh-tgls { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.sh-banner { position: relative; border-radius: 14px; overflow: hidden; background: #f6eeee; min-height: 120px; display: grid; place-items: center; color: var(--ink-3); border: 1px dashed #e6caca; }
.sh-banner img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.sh-bacts { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.sh-actrow { display: flex; justify-content: flex-end; }
.sh-ph { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sh-ph h3 { flex: 1; }
.sh-ph .in { max-width: 260px; }
.sh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.sh-p { border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; background: #fff; }
.sh-p.off { opacity: .6; }
.sh-pic { aspect-ratio: 4 / 3; border: 0; padding: 0; background: #f6eeee; cursor: pointer; display: grid; place-items: center; color: #c8161d; font: 700 13px var(--font); }
.sh-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sh-pic span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sh-pic .ic { width: 28px; height: 28px; }
.sh-pb { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 7px; }
.sh-pb > b { font-size: 14.5px; } .sh-pb > small { color: var(--ink-3); font-size: 12.5px; margin-top: -4px; }
.sh-price { display: grid; grid-template-columns: 1fr 120px; gap: 2px 8px; align-items: center; font-size: 13px; }
.sh-price small { grid-column: 1 / -1; color: var(--ink-3); font-size: 11.5px; }
.sh-bacts .btn { background: #fff; color: #8f0e13; border-color: #fff; }
/* 2.6.0: cửa hàng online - thẻ, bảng giá, khách online */
.sh-tabs { display: flex; gap: 4px; padding: 4px; background: #f4eeee; border-radius: 12px; flex-wrap: wrap; margin: 0 18px 4px; }
.sh-tabs button { flex: 1 1 auto; min-height: 42px; border: 0; border-radius: 9px; background: none; font: 800 14px var(--font); color: var(--ink-2); cursor: pointer; padding: 0 14px; white-space: nowrap; }
.sh-tabs button[aria-selected="true"] { background: #c8161d; color: #fff; box-shadow: 0 3px 10px rgb(200 22 29 / .25); }
.sh-quick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; background: #fff8f0; border: 1px dashed #f0cfa6; border-radius: 12px; padding: 8px 12px; }
.sh-pt-wrap { overflow-x: auto; }
.sh-pt { width: 100%; border-collapse: collapse; font-size: 14px; }
.sh-pt caption { text-align: left; font-weight: 800; color: #8f0e13; padding: 4px 0 8px; display: none; }
.sh-pt th { background: #fbeaea; color: #8f0e13; font-size: 12.5px; text-transform: uppercase; padding: 8px; border: 1px solid #efd8d8; }
.sh-pt td { border: 1px solid #f0e6e6; padding: 6px 8px; vertical-align: middle; }
.sh-pt td.c { text-align: center; } .sh-pt td.r { text-align: right; }
.sh-pt td .in { width: 130px; text-align: right; font-weight: 800; color: #c8161d; }
.sh-pt tr.off td { opacity: .55; }
.sh-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.sh-kpi { background: #fff1f0; border: 1px solid #f4c9c7; border-radius: 12px; padding: 10px 12px; }
.sh-kpi b { display: block; font-size: 24px; font-weight: 900; color: #c8161d; } .sh-kpi span { font-size: 12.5px; color: var(--ink-2); font-weight: 700; }
.sh-kpi.green { background: #e7f6ec; border-color: #bfe5cc; } .sh-kpi.green b { color: #0e8a3e; }
.sh-kpi.blue { background: #e8f1fd; border-color: #c6dbf7; } .sh-kpi.blue b { color: #1f5fd1; }
.sh-kpi.warn { background: #fff3e3; border-color: #f3d3a6; } .sh-kpi.warn b { color: #b25e00; }
.sh-kpi.red b { color: #8f0e13; }
@media print {
  body.erp-print-pt .side, body.erp-print-pt .top { display: none !important; }
  .sh-tabs, .sh-ph, .sh-quick, .sh-card > p, .pg-head, .app > footer { display: none !important; }
  .sh-pt caption { display: table-caption; font-size: 16px; }
  .sh-pt td .in { border: 0; padding: 0; color: #000; background: none; -moz-appearance: textfield; }
  .sh-pt td .in::-webkit-inner-spin-button { display: none; }
  .sh-pt th:nth-child(5), .sh-pt td:nth-child(5) { display: none; }
}
.sh-cus td:last-child { white-space: normal !important; min-width: 150px; }
.sh-cus td:last-child > * { margin: 2px 0 2px 4px; }
.sh-cus td:nth-child(3) { min-width: 180px; max-width: 260px; }
.sh-cus .table-wrap, .sh-cus .tbl-wrap { overflow-x: auto; }
@media print {
  html, body, .app, .body, #view, .pg, .pg-card, .pg-scroll, .sh-admin, .sh-card, .sh-pt-wrap { height: auto !important; max-height: none !important; overflow: visible !important; position: static !important; }
  .sh-pt tr { break-inside: avoid; }
}
/* 2.8.0: ca làm việc */
.shift-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 4px 12px; border-radius: 12px; border: 1.5px solid; background: #fff; cursor: pointer; font: inherit; text-align: left; }
.shift-chip i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.shift-chip b { display: block; font-size: 13.5px; line-height: 1.2; } .shift-chip small { display: block; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.shift-chip.on { border-color: #bfe5cc; } .shift-chip.on i { background: #0e8a3e; box-shadow: 0 0 0 4px rgb(14 138 62 / .15); } .shift-chip.on b { color: #0e6b30; }
.shift-chip.off { border-color: #f4c9c7; background: #fff1f0; } .shift-chip.off i { background: #c8161d; } .shift-chip.off b { color: #8f0e13; }
.shift-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-radius: 14px; padding: 14px 16px; }
.shift-hero b { display: block; font-size: 16px; letter-spacing: .04em; } .shift-hero span { font-size: 13.5px; }
.shift-hero.on { background: #e7f6ec; color: #0e5a2a; } .shift-hero.off { background: #fff1f0; color: #8f0e13; }
.sh3 { font-size: 14px; text-transform: uppercase; color: #8f0e13; letter-spacing: .04em; margin: 4px 0 0; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.rule { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.rule > b { font-size: 13.5px; color: #8f0e13; }
.rule label:not(.check) { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.dv-load { display: flex; align-items: center; gap: 8px; border-radius: 10px; padding: 8px 10px; font-size: 13px; font-weight: 700; background: #fff3e3; color: #8a4b00; }
.dv-load .ic { width: 17px; height: 17px; flex: none; }
.dv-load.ok { background: #e7f6ec; color: #0e6b30; } .dv-load.late { background: #fff1f0; color: #8f0e13; }

/* =====================================================================
   2.9.0 - Menu trái tự ẩn (ngăn kéo), bỏ thanh đỏ dưới đáy, màn Cân hàng / Đóng gói vừa khít iPad và điện thoại:
   khung đứng yên, chỉ danh sách đơn cuộn bên trong.
   ===================================================================== */
.side-edge { display: none; }
.app.drawer .body { grid-template-columns: minmax(0, 1fr); }
.app.drawer .side { display: flex; position: fixed; z-index: 55; top: 0; left: 0; bottom: 0; height: auto; width: min(290px, 84vw); transform: translateX(-102%); visibility: hidden;
  transition: transform .2s, visibility 0s .2s; box-shadow: 0 0 40px rgb(0 0 0 / .35); }
.app.drawer .side.open { transform: none; visibility: visible; transition: transform .2s; }
.app.drawer .scrim.open { display: block; position: fixed; inset: 0; z-index: 54; background: rgb(8 18 40 / .5); }
.app.drawer .top .burger { display: grid; }
.app.drawer .side-edge { display: block; position: fixed; left: 0; top: var(--head-h, 56px); bottom: 0; width: 10px; z-index: 50; }
@media (hover: none) { .app.drawer .side-edge { display: none; } }
@media (prefers-reduced-motion: reduce) { .app.drawer .side { transition: none; } }

/* Khối đỏ: dòng 1 chuyền + dạng xem; dòng 2 ngày làm hàng, ca làm, chọn sản phẩm */
.cw { gap: 8px; }
.cw-bar { position: static; flex: none; gap: 8px; padding: 8px; }
.cw-row2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.cw-row2.full { flex-basis: 100%; }
.cw-row2 .cw-slot { flex: 0 1 auto; }
.cw-psel { margin-left: auto; display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 12px; padding: 0 6px 0 12px; min-height: 50px; min-width: 0; flex: 0 1 400px; }
.cw-psel .ic { width: 20px; height: 20px; color: var(--r); flex: none; }
.cw-psel span { font-size: 12px; font-weight: 800; color: var(--ink-3); letter-spacing: .05em; flex: none; }
.cw-psel select { flex: 1; min-width: 0; border: 0; background: transparent; font: 900 16px var(--font); color: #163d8f; min-height: 46px; text-transform: uppercase; cursor: pointer; text-overflow: ellipsis; }
.cw-psel:focus-within { outline: 3px solid #ffd54a; outline-offset: 1px; }

/* Trang không cuộn: chỉ vùng danh sách cuộn */
.main.fit:has(.pg.cw) { overflow: hidden; }
.main.fit .pg.cw { flex: 1; min-height: 0; height: 100%; }
.main.fit .pg.cw .pg-card { flex: 1; min-height: 0; overflow: hidden; }
.main.fit .pg.cw .pg-scroll { flex: 1; min-height: 0; overflow: auto; }
.cw .pg-head { padding: 10px 14px 6px; flex-wrap: nowrap; }
.cw .pg-title h2 { font-size: 22px; }
.cw .pg-tools { flex: 1 1 auto; flex-wrap: nowrap; }
.cw .pg-tools .cw-search { flex: 1 1 160px; min-width: 120px; width: auto; }

@media (max-width: 1100px) {
  .cw .pg-title { display: none; }
  .cw .pg-head { padding: 8px 10px 4px; }
  .cw .pg-tools { width: 100%; }
  .cw-seg button { padding: 7px 12px; min-height: 42px; font-size: 14px; }
  .cw-psel { flex: 1 1 260px; }
}
@media (max-width: 640px) {
  .main.fit .pg.cw { min-height: 0; }
  .main.fit:has(.pg.cw) { padding: 6px; }
  .cw-bar { padding: 6px; gap: 6px; border-radius: 12px; }
  .cw-bar .cw-lines, .cw-bar .cw-views { width: 100%; margin-left: 0; }
  .cw-bar .cw-seg button { flex: 1 1 0; justify-content: center; text-align: center; padding: 6px 4px; min-height: 40px; font-size: 12.5px; }
  .cw-bar .cw-seg button .ic { display: none; }
  .cw-bar .cw-seg button small { font-size: 11px; }
  .cw-bar .cw-line1 { display: none; }
  .cw-row2, .cw-row2 .cw-slot { width: 100%; }
  .cw-dwrap small { display: none; }
  .cw-dwrap { padding: 3px 4px; }
  .cw-date { width: 124px; min-width: 0; min-height: 34px; font-size: 14px; }
  .cw-slot .cw-shift { flex: 1; }
  .cw-slot .cw-shift button { flex: 1; justify-content: center; padding: 6px 4px; min-height: 40px; font-size: 13px; }
  .cw-psel { flex: 1 1 100%; margin-left: 0; min-height: 44px; padding-left: 10px; }
  .cw-psel span { display: none; }
  .cw-psel select { font-size: 14.5px; min-height: 40px; }
  .cw .pg-head { padding: 6px 6px 2px; }
  .cw .pg-scroll { padding: 0 8px 8px; }
  .cw-sum { padding: 4px 8px; } .cw-sum b { font-size: 14px; } .cw-sum small { font-size: 10.5px; }
  .cw .pg-tools .in { min-height: 40px; }
}
/* Thứ tự khối đỏ ở mọi cỡ màn: chuyền, dạng xem, rồi ngày + ca + sản phẩm */
.cw-bar > .cw-lines { order: 1; } .cw-bar > .cw-views { order: 2; } .cw-bar > .cw-row2 { order: 3; } .cw-bar > .xbtn { order: 4; } .cw-bar > .cw-line1 { order: 0; }
/* Điện thoại: mỗi dòng đơn gọn hai tầng (khách + kg / sản phẩm + nút) để thấy nhiều đơn hơn */
@media (max-width: 640px) {
  .cw .orow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "cus q" "p a"; row-gap: 4px; padding: 8px 10px; align-items: center; }
  .cw .o-a { flex-wrap: nowrap; gap: 6px; justify-content: flex-end; }
  .cw .o-a .xbtn { flex: 0 0 auto; min-height: 42px; padding: 0 12px; font-size: 13px; gap: 5px; }
  .cw .o-a .xbtn svg { width: 17px; height: 17px; }
  .cw .o-cus b { font-size: 15px; }
  .cw .o-p b { font-size: 15px; } .cw .o-p small { font-size: 11.5px; }
}
@media (max-width: 640px) {
  .cw .orow { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "cus cus q" "p a a"; }
  .cw-bar > .xbtn { flex: 1 1 45%; min-height: 44px; font-size: 13px; justify-content: center; padding: 0 8px; }
}
