:root {
  --bg: #f4f8f6;
  --paper: #ffffff;
  --ink: #142019;
  --muted: #5c6b63;
  --line: #dce8e1;
  --side: #107C41;
  --side-text: #ffffff;
  --accent: #107C41;
  --accent-ink: #ffffff;
  --ok: #0d5c31;
  --bad: #8d2d2d;
  --shadow: 0 10px 30px rgba(16, 124, 65, 0.06);
  font-family: "Segoe UI", "Be Vietnam Pro", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: inherit; }
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; }
.brand span, .brand-mark { width: 36px; height: 36px; display: grid; place-items: center; background: #ffffff; color: #107C41; font-weight: 700; border-radius: 8px; }
.brand-mark { background: #107C41; color: #ffffff; }
.brand small { color: rgba(255,255,255,.92); font-size: 12px; font-weight: 650; line-height: 1.25; letter-spacing: -0.01em; }
.side-foot { margin-top: auto; font-size: 13px; color: rgba(255,255,255,.82); display: flex; flex-direction: column; gap: 6px; }
.side-foot a, .link { color: #ffffff; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
main { min-width: 0; padding: 28px 32px 64px; }
h1 { font-size: 28px; margin: 0; letter-spacing: -0.03em; }
h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 18px; }
.stats, .cards, .grid-2 { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(5, 1fr); margin-bottom: 16px; }
.cards { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.stats a, .card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-decoration: none; box-shadow: var(--shadow); }
.stats strong { display: block; font-size: 28px; }
.card p { color: var(--muted); margin: 6px 0 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { white-space: nowrap; display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; background: #eef6f1; color: var(--ok); }
.btn, button.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 9px; padding: 9px 14px; text-decoration: none; display: inline-block; cursor: pointer; font: inherit; }
.btn:hover, button.btn:hover { background: #0c6634; }
.btn.secondary { background: #ffffff; color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { background: #f4f8f6; }
.flash { padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; }
.flash.ok { background: #e7f5ee; color: var(--ok); }
.flash.bad { background: #fdecec; color: var(--bad); }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); background: #ffffff; border: 1px solid #c9d7ce; border-radius: 8px; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #107C41; border-color: #107C41; }
textarea { min-height: 72px; }
.form-grid, .filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.form-grid > .btn, .form-grid > button { justify-self: start; align-self: end; white-space: nowrap; }
.form-grid > .actions { grid-column: 1 / -1; }
.checks { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.checks label { flex-direction: row; align-items: center; color: var(--ink); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 12px; }
.login-flash { position: fixed; top: 12px; left: 12px; right: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.year-switch { display: flex; gap: 8px; flex-wrap: wrap; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.kpi-btn { background: transparent; border: 0; padding: 8px 0 0; text-align: left; cursor: pointer; font: inherit; color: inherit; border-radius: 8px; }
.kpi-btn strong { display: block; color: #107C41; font-size: 22px; letter-spacing: -0.03em; }
.kpi-btn span { color: var(--muted); font-size: 13px; }
.kpi-btn[aria-pressed="true"] { outline: 2px solid #107C41; outline-offset: 2px; }
.kpi a, #detail-link { color: #107C41; font-size: 13px; }
.dash-card { margin-bottom: 14px; }
.dash-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.dash-head h2 { margin: 0; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 13px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 6px; }
.swatch.rev, .bar.rev { background: #107C41; }
.swatch.cogs, .bar.cogs { background: #5c6b63; }
.swatch.inn, .bar.inn { background: #9dceb4; }
.month-row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; overflow-x: auto; }
.month-col { background: transparent; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 2px; border-radius: 8px; font: inherit; color: var(--muted); }
.month-col[aria-pressed="true"] { background: #eef6f1; color: #0d5c31; }
.bars { height: 128px; display: flex; align-items: flex-end; gap: 3px; }
.bar { width: 8px; border-radius: 4px 4px 0 0; display: block; }
.h-bar, .pipe-row { display: grid; grid-template-columns: 88px 1fr auto; gap: 8px; align-items: center; width: 100%; background: transparent; border: 0; padding: 6px 0; font: inherit; color: inherit; text-align: left; }
.h-bar { cursor: pointer; border-radius: 8px; }
.h-bar[aria-pressed="true"] { background: #eef6f1; }
.h-track, .pipe-track { display: flex; height: 10px; background: #e7f0eb; border-radius: 99px; overflow: hidden; }
.h-track i, .pipe-track i { display: block; height: 100%; background: #107C41; }
.h-track .ap { background: #5c6b63; }
.pipe-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pipe-row { grid-template-columns: 110px 1fr auto; cursor: default; }
details.dash-card summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
details .filters { margin-top: 12px; }
/* ---- song ngữ, bộ lọc, phê duyệt */
td > a:first-child, td.num, .nw { white-space: nowrap; }
.page-head .actions { flex-wrap: nowrap; }
.lang-switch { display: inline-flex; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; overflow: hidden; width: max-content; }
.lang-switch a { padding: 3px 10px; text-decoration: none; color: #ffffff; font-size: 12px; font-weight: 600; }
.lang-switch a[aria-current="true"] { background: #ffffff; color: #107C41; }
.login-lang { position: fixed; top: 14px; right: 14px; border-color: var(--line); background: #fff; z-index: 3; }
.login-lang a { color: var(--ink); }
.login-lang a[aria-current="true"] { background: #107C41; color: #fff; }
.badge { background: #ffffff; color: #107C41; border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.stats a.hot { border-color: #e0a100; background: #fffaeb; }
.stats a.hot strong { color: #8a6100; }
.filters { align-items: end; margin-bottom: 14px; }
.filter-actions { display: flex; gap: 8px; align-items: end; }
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.list-head strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.list-head a { color: #107C41; font-size: 13px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; }
.pager-links { display: flex; gap: 8px; }
.pill.draft { background: #f2f4f3; color: var(--muted); }
.pill.pending_approval, .pill.pending { background: #fff4d6; color: #8a6100; border-color: #f0d68a; }
.pill.rejected, .pill.cancelled { background: #fdecec; color: var(--bad); border-color: #f3c7c7; }
.pill.skipped, .pill.waiting { background: #f2f4f3; color: var(--muted); }
.steps { display: inline-flex; gap: 3px; vertical-align: middle; }
.step { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700;
        border: 1px solid var(--line); color: var(--muted); background: #fff; }
.step.approved { background: #107C41; color: #fff; border-color: #107C41; }
.step.pending { background: #fff4d6; color: #8a6100; border-color: #e0a100; box-shadow: 0 0 0 2px #fff4d6; }
.step.rejected { background: var(--bad); color: #fff; border-color: var(--bad); }
.step.skipped, .step.cancelled { text-decoration: line-through; opacity: .6; }
.btn.danger, button.btn.danger { background: #ffffff; color: var(--bad); border: 1px solid #e3b3b3; }
.btn.danger:hover, button.btn.danger:hover { background: #fdecec; }
.approval-card { margin-bottom: 14px; }
.approval-card h2 { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.approve-box { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.inline-approve { display: flex; gap: 6px; align-items: center; }
.inline-approve input { width: 140px; padding: 6px 8px; }
.inline-approve .btn { padding: 6px 10px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: #107C41; border-color: #107C41; font-weight: 600; }
.tabs b { background: #eef6f1; color: #0d5c31; border-radius: 999px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.matrix-card { margin-bottom: 14px; }
table.matrix th, table.matrix td { text-align: center; }
table.matrix th:first-child, table.matrix td:first-child { text-align: left; font-variant-numeric: tabular-nums; }
table.matrix th span { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); }
.center { text-align: center; }
.tick { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #107C41; color: #fff; font-weight: 700; }
.mflow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.mflow .node { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #eef6f1; display: flex; flex-direction: column; font-weight: 600; font-size: 13px; }
.mflow .node.cond { background: #fffaeb; border-color: #f0d68a; }
.mflow .node.done { background: #107C41; color: #fff; border-color: #107C41; }
.mflow .node small { font-weight: 400; color: var(--muted); }
.mflow .arrow { color: var(--muted); }
.insight .eyebrow { margin: 0 0 4px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #107C41; font-weight: 700; }
.insight .filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; background: #fff; border: 1px solid #d9d9d9; border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; }
.insight .filter-bar label { min-width: 160px; }
.insight .filter-bar select { background: #fff; border-color: #c5c5c5; height: 36px; }
.insight .filter-note { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.insight .insight-card { border: 1px solid #d9d9d9; border-radius: 8px; box-shadow: none; }
.insight .kpi { border: 1px solid #d9d9d9; border-radius: 8px; border-top: 3px solid #107C41; box-shadow: none; padding: 10px 12px 12px; }
.insight .kpi-fixed { border-top-color: #5c6b63; }
.insight .kpi-btn { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.insight .kpi-btn span { order: 0; font-size: 12px; letter-spacing: .02em; }
.insight .kpi-btn strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.insight .spark { width: 84px; height: 28px; margin-top: 6px; }
.insight .spark polyline { fill: none; stroke: #107C41; stroke-width: 1.6; }
.insight .chart-host { min-height: 220px; }
.insight .line-chart { width: 100%; height: auto; display: block; }
.insight .line-chart .grid { stroke: #e6e6e6; stroke-width: 1; }
.insight .line-chart text { fill: #6a6a6a; font-size: 11px; font-family: "Segoe UI", sans-serif; }
.insight .line-chart polyline { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.insight .line-chart .band { fill: rgba(16, 124, 65, .08); }
.insight .line-chart .hit { fill: transparent; cursor: pointer; }
.insight details.fold > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; align-items: center; font-weight: 600; }
.insight details.fold > summary::-webkit-details-marker { display: none; }
.insight details.fold > summary::after { content: "Mở"; color: #107C41; font-size: 12px; font-weight: 600; }
.insight details.fold[open] > summary::after { content: "Thu gọn"; }
.insight details.fold > summary span { color: var(--muted); font-weight: 400; font-size: 12px; }
.insight details.fold > summary { margin-bottom: 0; }
.insight details.fold[open] > summary { margin-bottom: 12px; }
.insight .detail-tools { justify-content: flex-end; }
.rules { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.org-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 6px; }
.org-row select, .org-row input { padding: 6px 8px; }
/* ---- menu theo luồng E2E */
.side { position: sticky; top: 0; height: 100vh; gap: 12px; padding: 16px 12px; }
.flow-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.nav-home { display: flex; gap: 8px; align-items: center; text-decoration: none; color: #fff; padding: 7px 10px; border-radius: 8px; font-weight: 600; }
.nav-home:hover, .setup a:hover { background: rgba(255,255,255,.14); }
.nav-home.active { background: rgba(255,255,255,.2); box-shadow: inset 3px 0 0 #fff; }
.ico { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.home-ico { width: 18px; height: 18px; }
.flow { padding: 4px 0 2px; border-radius: 10px; }
.flow.is-active { background: rgba(0,0,0,.12); }
.flow-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 6px; padding: 2px 10px 3px;
             font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.68); }
.flow.is-active .flow-head { color: #fff; }
.flow-title { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.flow-title .ico { width: 13px; height: 13px; opacity: .9; }
.doc-chip { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 11px; color: #107C41; background: #fff;
            border-radius: 999px; padding: 1px 8px; text-decoration: none; white-space: nowrap; }
.flow ol { list-style: none; margin: 0; padding: 0; }
.fstep { position: relative; }
.fstep:not(:last-child)::after { content: ""; position: absolute; left: 22px; top: 26px; bottom: -6px; width: 2px;
                                background: rgba(255,255,255,.28); border-radius: 2px; }
.fstep a { position: relative; z-index: 1; display: grid; grid-template-columns: 26px 1fr auto; gap: 9px; align-items: center;
          width: 100%; padding: 4px 10px; margin: 1px 0; border-radius: 8px; color: #fff; text-decoration: none; font-size: 13.5px; }
.fstep a:hover { background: rgba(255,255,255,.14); }
.fstep.active a { background: #fff; color: #0b5a2f; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.fstep .label { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.fstep .label small { font-size: 11px; font-weight: 500; opacity: .85; margin-top: 1px; }
.dot { position: relative; width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); background: rgba(255,255,255,.12);
       justify-self: center; display: grid; place-items: center; color: #fff; }
.dot .ico { width: 14px; height: 14px; }
.fstep a:hover .dot { background: rgba(255,255,255,.22); }
.fstep.active .dot { border-color: #107C41; background: #107C41; color: #fff; }
.fstep .badge { min-width: 22px; text-align: center; }
.fstep.active .badge { background: #107C41; color: #fff; }
/* tiến độ của chứng từ đang mở */
.fstep.done .dot { background: #fff; border-color: #fff; color: #107C41; }
.fstep.done .dot::after { content: "✓"; position: absolute; right: -5px; bottom: -4px; width: 13px; height: 13px; border-radius: 50%;
                          background: #ffd666; color: #0b5a2f; font-size: 9px; font-weight: 800; line-height: 13px; text-align: center;
                          box-shadow: 0 0 0 2px #107C41; }
.fstep.done::after { background: rgba(255,255,255,.85); }
.fstep.current .dot { background: #ffd666; border-color: #fff; color: #5c4100; box-shadow: 0 0 0 4px rgba(255,214,102,.35); animation: pulse 1.8s ease-in-out infinite; }
.fstep.current.active .dot { border-color: #8a6100; }
.fstep.partial .dot { background: linear-gradient(90deg, #fff 50%, #cfe9d9 50%); border-color: #fff; color: #107C41; }
.fstep.todo a, .fstep.skip a { color: rgba(255,255,255,.62); }
.fstep.todo .dot { border-style: dashed; border-color: rgba(255,255,255,.55); background: transparent; color: rgba(255,255,255,.7); }
.fstep.skip .dot { opacity: .45; border-color: transparent; }
.fstep.skip .label { text-decoration: line-through; }
.fstep.todo.active a, .fstep.skip.active a { color: #0b5a2f; }
.fstep.todo.active .dot { color: #107C41; border-color: #107C41; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(255,214,102,.45); } 50% { box-shadow: 0 0 0 7px rgba(255,214,102,0); } }
@media (prefers-reduced-motion: reduce) { .fstep.current .dot { animation: none; } }
.setup { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 6px 0; margin-top: 4px; border-top: 1px solid rgba(255,255,255,.2); }
.setup a { color: rgba(255,255,255,.85); text-decoration: none; font-size: 13px; padding: 4px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 5px; }
.setup .ico { width: 14px; height: 14px; }
.side-foot a, .side-foot button.link { display: inline-flex; align-items: center; gap: 6px; }
.side-foot .ico { width: 14px; height: 14px; }
.setup a.active { background: #fff; color: #0b5a2f; font-weight: 600; }
.next-step { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid #f0d68a; border-left: 5px solid #e0a100;
             border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.next-step div { display: flex; flex-direction: column; flex: 1; }
.next-step small { color: #8a6100; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.next-step strong { font-size: 16px; }
.next-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #fff4d6; color: #8a6100; font-weight: 700; flex: none; }
.next-step.all-done { border-color: #bfe3cd; border-left-color: #107C41; }
.next-step.all-done small { color: #0d5c31; }
.next-step.all-done .next-ico { background: #e7f5ee; color: #107C41; }
:target { scroll-margin-top: 16px; animation: flash-target 1.6s ease-out 1; }
@keyframes flash-target { 0% { box-shadow: 0 0 0 4px #ffd666; } 100% { box-shadow: var(--shadow); } }
.role-pill.super { background: #107C41; color: #fff; border-color: #107C41; }
tr.muted-row td { color: var(--muted); background: #fafafa; }
.row-edit summary { list-style: none; display: inline-block; }
.row-edit summary::-webkit-details-marker { display: none; }
.row-edit[open] summary { background: #eef6f1; }
.row-edit-body { position: absolute; right: 40px; z-index: 5; width: min(560px, 70vw); background: #fff; border: 1px solid var(--line);
                 border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.12); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.edit-grid + .edit-grid { border-top: 1px dashed var(--line); padding-top: 12px; }
.pw-row { display: flex; gap: 6px; }
.pw-row input { flex: 1; }
.pw-toggle { position: relative; display: block; }
.pw-toggle input { width: 100%; padding-right: 64px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #107C41; font-weight: 700; cursor: pointer; min-height: 32px; padding: 0 8px; }
.table-scroll { overflow-x: auto; }
.perm-matrix th a { color: #0b5a2f; text-transform: none; letter-spacing: 0; font-size: 13px; }
.perm-matrix th span { text-transform: none; letter-spacing: 0; font-weight: 400; }
.perm-matrix .group-row td { background: #f4f8f6; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.perm-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0; }
.perm-group legend { font-weight: 700; padding: 0 6px; color: #0b5a2f; }
.perm-check { flex-direction: row; align-items: flex-start; gap: 8px; color: var(--ink); padding: 5px 0; font-size: 14px; }
.perm-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: #107C41; }
.perm-check span { display: flex; flex-direction: column; }
.perm-check small { color: var(--muted); font-size: 11px; font-family: ui-monospace, monospace; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid #f3c7c7; background: #fffafa;
               border-radius: 12px; padding: 10px 14px; margin-top: 12px; }
.kick-note { display: flex; flex-direction: column; gap: 2px; background: #fdecec; border: 1px solid #f3c7c7; border-left: 4px solid var(--bad);
              border-radius: 10px; padding: 10px 12px; color: var(--bad); font-size: 14px; }
.kick-note span { color: var(--ink); font-size: 13px; }
.kick-note.soft { background: #fffaeb; border-color: #f0d68a; border-left-color: #e0a100; color: #8a6100; }
.stage-banner { display: flex; align-items: center; gap: 12px; background: #fffaeb; border: 1px solid #f0d68a; border-radius: 12px;
                padding: 10px 14px; margin-bottom: 14px; }
.stage-banner div { display: flex; flex-direction: column; flex: 1; }
.stage-banner span { color: var(--muted); font-size: 13px; }
.stage-banner a { color: #8a6100; font-size: 13px; white-space: nowrap; }
.stage-dot { width: 12px; height: 12px; border-radius: 50%; background: #ffd666; box-shadow: 0 0 0 4px rgba(255,214,102,.35); flex: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg a { padding: 8px 14px; text-decoration: none; color: var(--muted); font-size: 14px; }
.seg a[aria-current="page"] { background: #107C41; color: #fff; font-weight: 600; }
tr.late td { background: #fff8f8; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.check-inline { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); padding-bottom: 10px; }
.focus-card { outline: 2px solid #e0a100; outline-offset: 2px; }
.mobile-bar, .nav-backdrop { display: none; }

/* ---- icon trên trang Tổng quan và ô KPI */
.stats a { position: relative; }
.stat-ico { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; padding: 7px; border-radius: 10px;
            background: #e8f3ec; color: #107C41; stroke-width: 1.8; }
.stats a.hot .stat-ico { background: #ffefc2; color: #8a6100; }
.kpi-label { display: inline-flex; align-items: center; gap: 6px; }
.kpi-label .ico { width: 22px; height: 22px; padding: 4px; border-radius: 6px; background: #e8f3ec; color: #107C41; }
.kpi-fixed .kpi-label .ico { background: #eef0ef; color: #5c6b63; }
.kpi-btn strong[title] { cursor: help; }

/* Điện thoại và màn hẹp: menu trượt, form một cột, bảng cuộn ngang trong trang. */
@media (max-width: 980px) {
  .shell { display: block; }
  .mobile-bar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30;
    background: var(--side); color: #fff; padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
  }
  .mobile-bar .brand small { display: none; }
  .nav-toggle {
    width: 44px; height: 44px; flex: none; border: 0; border-radius: 10px; background: rgba(255,255,255,.14);
    display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 0; cursor: pointer;
  }
  .nav-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #fff; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(10, 30, 18, .45); }
  body.nav-open .nav-backdrop { display: block; }
  body.nav-open { overflow: hidden; }
  .side {
    position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; height: 100dvh; width: min(300px, 88vw);
    transform: translateX(-105%); transition: transform .2s ease; overflow: hidden;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  body.nav-open .side { transform: none; }
  .flow-nav { max-height: none; }
  .fstep a { min-height: 44px; }
  main { padding: 14px 12px calc(28px + env(safe-area-inset-bottom)); }
  h1 { font-size: 22px; }
  .page-head, .dash-head, .list-head, .pager, .next-step, .stage-banner, .danger-zone { flex-direction: column; align-items: stretch; }
  .page-head .actions { flex-wrap: wrap; }
  .stats, .cards { grid-template-columns: 1fr 1fr; }
  .grid-2, .form-grid, .filters, .pipe-grid, .org-row, .approve-box, .edit-grid { grid-template-columns: 1fr; }
  .form-grid > .btn, .form-grid > button, .filter-actions, .filter-actions .btn { justify-self: stretch; width: 100%; text-align: center; }
  .month-row { grid-template-columns: repeat(12, 64px); }
  input, select, textarea { font-size: 16px; }
  .btn, button.btn { min-height: 42px; }
  .seg, .tabs { display: flex; max-width: 100%; overflow-x: auto; }
  .seg { width: 100%; }
  .seg a { flex: 1; text-align: center; white-space: nowrap; }
  .row-edit-body { left: 8px; right: 8px; width: auto; }
  .insight .filter-bar label { min-width: 0; flex: 1 1 100%; }
  .insight .chart-host { min-height: 180px; }
  .table-scroll { max-width: 100%; -webkit-overflow-scrolling: touch; }
  .login-card { width: min(420px, 100%); }
  .login-wrap { padding: 16px; padding-top: calc(56px + env(safe-area-inset-top)); }
}

/* ---- outbound: lệnh xuất, chuyến xe, POD, bản đồ */
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #107C41; }
small.sub { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; margin-top: 2px; }
small.sub .ico { width: 12px; height: 12px; }
.span-2 { grid-column: span 2; }
label.check { flex-direction: row; align-items: center; gap: 8px; align-self: end; }
.actions .btn .ico, .btn .ico { width: 15px; height: 15px; vertical-align: -3px; }
h2 .ico { width: 18px; height: 18px; color: #107C41; vertical-align: -3px; }
.pill.picked, .pill.packed { background: #fff4d6; color: #8a6100; border-color: #f0d68a; }
.pill.loaded, .pill.planned { background: #efe9ff; color: #5b3cc4; border-color: #d8ccff; }
.pill.in_transit { background: #e7f0ff; color: #1f5fc8; border-color: #c4d8fb; }
.pill.delivered, .pill.completed { background: #e6f4ec; color: #0b5a2f; border-color: #bfe0cc; }
.pill.failed { background: #fdecec; color: var(--bad); border-color: #f3c7c7; }
.ob-stages { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 12px; }
.ob-stages a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
               background: #fff; color: var(--ink); text-decoration: none; font-size: 13.5px; }
.ob-stages a b { background: #eef6f1; color: #0d5c31; border-radius: 999px; padding: 0 7px; font-size: 12px; }
.ob-stages a[aria-current="page"] { background: #107C41; border-color: #107C41; color: #fff; font-weight: 600; }
.ob-stages a[aria-current="page"] b { background: rgba(255,255,255,.25); color: #fff; }
.ob-arrow { color: var(--muted); }
.ob-timeline { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; padding: 0; margin: 0 0 16px; }
.ob-timeline li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; font-size: 13px; color: var(--muted); }
.ob-timeline li::before { content: ""; position: absolute; top: 8px; left: -50%; right: 50%; height: 3px; background: var(--line); z-index: 0; }
.ob-timeline li:first-child::before { display: none; }
.ob-timeline .tl-dot { position: relative; z-index: 1; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--line); }
.ob-timeline li.done { color: var(--ink); }
.ob-timeline li.done::before, .ob-timeline li.now::before { background: #107C41; }
.ob-timeline li.done .tl-dot { background: #107C41; border-color: #107C41; }
.ob-timeline li.now .tl-dot { background: #ffd666; border-color: #e0a100; box-shadow: 0 0 0 4px rgba(255,214,102,.35); }
.ob-timeline li.now strong { color: #8a6100; }
.ob-timeline li.bad .tl-dot { background: var(--bad); border-color: var(--bad); }
.ob-timeline small { font-size: 11px; }
.ob-grid { margin-bottom: 14px; align-items: stretch; }
dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 13px; }
dl.kv dd { margin: 0; }
.map-box { height: 300px; border-radius: 10px; overflow: hidden; background: #eef3f0; }
.map-box.tall { height: 460px; }
.map-sketch { display: flex; flex-direction: column; }
.map-sketch svg { flex: 1; width: 100%; background: linear-gradient(#f4f8f6, #eaf1ed); }
.map-sketch .sk-route { fill: none; stroke: #1f6feb; stroke-width: 2.5; stroke-dasharray: 6 5; opacity: .8; }
.map-sketch text { font-size: 12px; font-weight: 700; fill: #1b2a22; }
.map-note { margin: 6px 10px; font-size: 12px; }
.pin-stop i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff;
              box-shadow: 0 1px 4px rgba(0,0,0,.35); color: #fff; font: 700 11px/1 system-ui, sans-serif; font-style: normal; }
.pin-origin span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #0b5a2f; color: #fff;
                   border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4); font-size: 15px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.map-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.prov-bars { display: flex; flex-direction: column; gap: 6px; }
.prov-bars div { display: grid; grid-template-columns: 130px 1fr 36px; gap: 8px; align-items: center; font-size: 13px; }
.prov-bars i { height: 10px; border-radius: 5px; background: #8fbfa4; }
.prov-bars b { text-align: right; font-variant-numeric: tabular-nums; }
.next-inline { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-left: 5px solid #e0a100; margin-bottom: 14px; }
.pod-result { display: flex; gap: 20px; }
.pod-result label { flex-direction: row; gap: 6px; align-items: center; }
.pod-done.failed { border-left: 5px solid var(--bad); }
.pod-done.partial { border-left: 5px solid #c77700; }
.pod-done.delivered { border-left: 5px solid #107C41; }
input.qty-in { width: 120px; text-align: right; }
/* xếp chuyến */
.load-meter { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.load-bar { flex: 0 0 260px; height: 12px; border-radius: 6px; background: #eef1ef; overflow: hidden; }
.load-bar.small { flex: none; width: 100%; height: 8px; margin: 4px 0 2px; }
.load-bar i { display: block; height: 100%; width: 0; background: #107C41; transition: width .2s; }
.load-bar i.high { background: #e0a100; }
.load-bar i.over { background: var(--bad); }
.trip-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; max-height: 420px; overflow: auto; }
.trip-groups fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 8px; margin: 0; }
.trip-groups legend { font-weight: 600; font-size: 13.5px; padding: 0 4px; }
.trip-groups legend label { display: inline-flex; flex-direction: row; gap: 6px; align-items: center; }
.trip-groups legend small { color: var(--muted); font-weight: 400; }
.trip-pick { display: flex; flex-direction: row; gap: 8px; align-items: flex-start; padding: 4px 0; font-size: 13px; border-top: 1px dashed #eef1ef; }
.trip-pick small { display: block; color: var(--muted); }
.trip-facts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 14px; }
.trip-facts > div { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; }
.trip-facts span { color: var(--muted); font-size: 12px; }
.trip-facts strong { font-size: 18px; }
.trip-facts small { color: var(--muted); font-size: 12px; }
ol.route { list-style: none; margin: 0; padding: 0; position: relative; }
ol.route::before { content: ""; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 2px; background: #cfe0d6; }
ol.route li { position: relative; display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; }
ol.route li > b { z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid #107C41; color: #107C41; font-size: 12px; }
ol.route li.origin > b { background: #0b5a2f; color: #fff; border-color: #0b5a2f; border-radius: 7px; }
ol.route li.delivered > b { background: #107C41; color: #fff; }
ol.route li.in_transit > b { border-color: #1f6feb; color: #1f6feb; }
ol.route li.failed > b { border-color: var(--bad); color: var(--bad); }
ol.route small { display: block; color: var(--muted); font-size: 12px; }
.route-act { display: flex; gap: 6px; align-items: center; }
.route-act form { margin: 0; }
/* mô hình giao hàng */
.om-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; counter-reset: om; }
.om-flow li { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfc; font-size: 13px; }
.om-flow li:not(:last-child)::after { content: "›"; position: absolute; right: -9px; top: 50%; transform: translateY(-50%); color: #107C41; font-weight: 800; font-size: 18px; }
.om-flow .ico { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: #e8f3ec; color: #107C41; }
.om-flow span { color: var(--muted); flex: 1; }
.om-flow em { font-style: normal; font-size: 12px; color: #0b5a2f; background: #eef6f1; border-radius: 6px; padding: 2px 6px; align-self: flex-start; }
.om-flow li.post { border-color: #e0a100; background: #fffaeb; }
.om-flow li.post .ico { background: #ffefc2; color: #8a6100; }
.om-states { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.om-states i { color: var(--muted); font-style: normal; }
.om-ends { display: inline-flex; flex-direction: column; gap: 4px; }
.erd { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-bottom: 10px; }
.erd .ent { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; display: flex; flex-direction: column; font-size: 12.5px; }
.erd .ent b { font-family: ui-monospace, Consolas, monospace; color: #0b5a2f; }
.erd .ent span { color: var(--muted); }
.erd .ent.hl { border-color: #107C41; background: #f3faf6; }
.erd .rel { font-size: 12px; color: var(--muted); text-align: center; }
@media (max-width: 1100px) {
  .om-flow { grid-template-columns: repeat(4, 1fr); }
  .trip-facts { grid-template-columns: repeat(2, 1fr); }
  .ob-timeline { grid-template-columns: repeat(3, 1fr); row-gap: 12px; }
}
details.quick-deliver > summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details.quick-deliver[open] > summary { margin-bottom: 12px; }
.page-head .actions .btn { white-space: nowrap; }
.pill.dispatched { background: #e7f0ff; color: #1f5fc8; border-color: #c4d8fb; }
.pill.exception, .pill.pod-rejected { background: #fdecec; color: var(--bad); border-color: #f3c7c7; }
.pill.pod-received { background: #e6f4ec; color: #0b5a2f; border-color: #bfe0cc; }
.pill.pod-pending { background: #fff4d6; color: #8a6100; border-color: #f0d68a; }
.dispatch-form { display: flex; gap: 6px; align-items: center; }
.dispatch-form input[type=date] { padding: 7px 8px; }
details.quick-deliver > summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details.quick-deliver[open] > summary { margin-bottom: 12px; }

.chat-dock { position: fixed; right: 18px; bottom: 18px; z-index: 45; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.chat-toggle { border: 0; border-radius: 999px; background: #107C41; color: #fff; min-height: 52px; padding: 0 18px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 24px rgba(16, 124, 65, .28); }
.chat-panel { display: flex; flex-direction: column; width: min(360px, calc(100vw - 24px)); height: min(460px, calc(100dvh - 110px)); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(16, 40, 24, .18); overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-panel header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #107C41; color: #fff; }
.chat-x { border: 0; background: transparent; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.chat-log { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #f6f8f7; }
.chat-bubble { max-width: 86%; padding: 8px 10px; border-radius: 12px; font-size: 14px; line-height: 1.4; }
.chat-bubble.bot { background: #fff; border: 1px solid var(--line); align-self: flex-start; }
.chat-bubble.me { background: #107C41; color: #fff; align-self: flex-end; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; }
.chat-chips button { border: 1px solid #c9d7ce; background: #fff; color: #145c32; border-radius: 999px; padding: 6px 10px; cursor: pointer; font-size: 13px; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px 12px; }
.chat-form input { flex: 1; min-width: 0; }
@media (max-width: 980px) {
  .chat-dock { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* ---- ecommerce · xuất & giao */
.pill.ec-new { background: #eef4ff; color: #1f5fc8; border-color: #c4d8fb; }
.pill.ec-confirmed, .pill.ec-picking { background: #fff4d6; color: #8a6100; border-color: #f0d68a; }
.pill.ec-on_hold, .pill.ec-failed, .pill.ec-returning { background: #fdecec; color: var(--bad); border-color: #f3c7c7; }
.pill.ec-packed, .pill.ec-ready { background: #efe9ff; color: #5b3cc4; border-color: #d8ccff; }
.pill.ec-shipped, .pill.ec-in_transit, .pill.ec-out_for_delivery { background: #e7f0ff; color: #1f5fc8; border-color: #c4d8fb; }
.pill.ec-delivered { background: #e6f4ec; color: #0b5a2f; border-color: #bfe0cc; }
.pill.ec-returned, .pill.ec-cancelled { background: #f2f4f3; color: var(--muted); }
.pay { font-weight: 700; font-size: 12px; }
.pay-cod { color: #8a6100; }
.pay-prepaid { color: #0b5a2f; }
.svc { color: #c62828; font-size: 11px; text-transform: uppercase; }
.sla { font-size: 12.5px; }
.sla.late { color: var(--bad); font-weight: 700; }
.warn-text { color: #8a6100; }
.ec-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ec-kpis a { background: var(--paper); border: 1px solid var(--line); border-top: 3px solid #107C41; border-radius: 10px; padding: 10px 12px; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.ec-kpis a.warn { border-top-color: #e0a100; }
.ec-kpis a.bad { border-top-color: var(--bad); background: #fffafa; }
.ec-kpis span { color: var(--muted); font-size: 12.5px; }
.ec-kpis strong { font-size: 24px; color: #0b5a2f; letter-spacing: -0.02em; }
.ec-kpis a.bad strong { color: var(--bad); }
.ec-kpis small { color: var(--muted); font-size: 12px; }
.ec-pipe { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; }
.ec-pipe a { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 8px 4px; border-radius: 10px; background: #f6f8f7; text-decoration: none; color: inherit; font-size: 12px; }
.ec-pipe b { font-size: 20px; color: #0b5a2f; }
.ec-pipe .ec-on_hold b, .ec-pipe .ec-failed b, .ec-pipe .ec-returning b { color: var(--bad); }
.ec-bars { display: flex; align-items: flex-end; gap: 3px; height: 170px; padding-bottom: 18px; }
.ec-bars > div { flex: 1; position: relative; height: 100%; display: flex; align-items: flex-end; gap: 1px; }
.ec-bars i { flex: 1; background: #8fbfa4; border-radius: 3px 3px 0 0; min-height: 1px; }
.ec-bars i.out { background: #107C41; }
.ec-bars small { position: absolute; bottom: -17px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--muted); }
.ec-legend i { display: inline-block; width: 10px; height: 10px; background: #8fbfa4; margin: 0 4px 0 8px; }
.ec-legend i.out { background: #107C41; }
.ec-detail { display: grid; grid-template-columns: 1fr 260px; gap: 14px; margin-bottom: 14px; }
.ec-qrbox { text-align: center; }
.ec-qrbox .qr svg, .ec-appcard .qr svg { width: 160px; height: 160px; }
.small-break { word-break: break-all; font-size: 11.5px; }
.ec-money { margin-top: 12px; max-width: 460px; }
.ec-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid #cfe0d6; display: flex; flex-direction: column; gap: 8px; }
.ec-timeline li { position: relative; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13.5px; }
.ec-timeline li::before { content: ""; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #107C41; }
.ec-timeline li.ec-failed::before, .ec-timeline li.ec-on_hold::before, .ec-timeline li.ec-returning::before, .ec-timeline li.ec-cancelled::before { background: var(--bad); }
.ec-timeline small { color: var(--muted); }
.ec-timeline span { flex-basis: 100%; color: var(--muted); }
.scan-bar { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin-bottom: 14px; }
.scan-bar input { font-size: 18px; padding: 10px 12px; }
tr.done-row td { background: #f0faf4; }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sheet-head .qr svg { width: 96px; height: 96px; }
.token { font-size: 11.5px; word-break: break-all; }
/* phiếu giao */
.labels { display: flex; flex-wrap: wrap; gap: 12px; }
.ship-label { width: 100mm; min-height: 150mm; box-sizing: border-box; background: #fff; border: 1.5px solid #111; padding: 4mm; display: flex; flex-direction: column; gap: 2.5mm; font-size: 11px; color: #111; break-inside: avoid; page-break-after: always; }
.fmt-a5 .ship-label { width: 148mm; min-height: 210mm; font-size: 12px; }
.ship-label header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1.5px solid #111; padding-bottom: 2mm; }
.ship-label header div:first-child { display: flex; flex-direction: column; }
.lb-carrier { font-size: 15px; }
.lb-track { font: 700 17px/1 ui-monospace, Consolas, monospace; letter-spacing: .04em; }
.lb-main { display: grid; grid-template-columns: 1fr 34mm; gap: 3mm; }
.lb-to { display: flex; flex-direction: column; gap: 1mm; }
.lb-to b { font-size: 14px; }
.lb-to .lb-prov { font-size: 16px; text-transform: uppercase; }
.lb-qr { text-align: center; }
.lb-qr svg { width: 34mm; height: 34mm; }
.lb-qr small { font-size: 8.5px; }
.lb-cod { text-align: center; font-weight: 800; font-size: 14px; padding: 2mm; border: 1.5px solid #111; }
.lb-cod.cod { background: #111; color: #fff; }
.lb-meta { display: flex; flex-wrap: wrap; gap: 1mm 4mm; font-size: 10px; }
.lb-items { width: 100%; font-size: 10px; border-collapse: collapse; }
.lb-items th, .lb-items td { border-bottom: 1px solid #ccc; padding: 1mm 0; text-align: left; }
.lb-note { font-style: italic; }
.lb-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; text-align: center; margin-top: 4mm; }
.lb-foot, .lb-link { font-size: 9px; color: #444; word-break: break-all; margin: 0; }
@media print {
  .side, .no-print, .page-head .actions, .flash, .chat-dock, .next-step { display: none !important; }
  .shell { display: block; } main { padding: 0 !important; }
  .card { box-shadow: none !important; border: 0 !important; }
  .labels { gap: 0; } .ship-label { border: 1.5px solid #000; margin: 0 auto; }
  @page { margin: 5mm; }
}
/* app di động */
.m-body { background: #eef3f0; margin: 0; }
.m-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #107C41; color: #fff; }
.m-brand { color: #fff; font-weight: 800; text-decoration: none; font-size: 18px; }
.m-brand span { font-weight: 400; opacity: .85; }
.m-user { margin-left: auto; font-size: 13px; opacity: .9; }
.m-main { max-width: 560px; margin: 0 auto; padding: 12px 12px 40px; display: flex; flex-direction: column; gap: 12px; }
.m-flash { margin: 10px 12px 0; }
.m-card { background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.06); display: flex; flex-direction: column; gap: 8px; }
.m-card h2 { margin: 0; font-size: 17px; }
.m-card p { margin: 0; }
.m-card label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.m-card input, .m-card select { font-size: 16px; padding: 10px; }
.m-big { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; border: 0; border-radius: 12px; background: #107C41; color: #fff; font-size: 17px; font-weight: 700; text-decoration: none; cursor: pointer; }
.m-big.ok { background: #0b5a2f; } .m-big.bad { background: #c62828; }
.m-big[disabled] { opacity: .5; }
.m-scan { align-items: stretch; }
.m-photo { display: block; margin-top: 8px; text-align: center; color: #107C41; font-weight: 600; cursor: pointer; }
.m-photo input { display: none; }
.scan-lib { display: inline-flex; align-items: center; color: #107C41; font-weight: 600; cursor: pointer; }
.scan-lib input { display: none; }
.m-manual { display: flex; gap: 8px; } .m-manual input { flex: 1; }
.m-hint, .m-sub { color: var(--muted); font-size: 13px; }
.m-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 0; border-top: 1px solid #eef1ef; text-decoration: none; color: inherit; }
.m-row span:nth-child(2) { color: var(--muted); font-size: 13px; }
.m-row em { font-style: normal; color: #8a6100; font-weight: 700; font-size: 13px; }
.m-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.m-cod { border-radius: 10px; padding: 10px; font-size: 16px; text-align: center; }
.m-cod.cod { background: #fff4d6; color: #5c4100; } .m-cod.paid { background: #e6f4ec; color: #0b5a2f; }
.m-call { font-size: 18px; font-weight: 700; color: #107C41; text-decoration: none; }
.m-items { margin: 0; padding-left: 18px; }
.m-note { background: #f6f8f7; padding: 8px; border-radius: 8px; }
.m-check { flex-direction: row !important; align-items: center; font-weight: 700; }
.m-links { flex-direction: row; flex-wrap: wrap; gap: 10px; }
.m-links a { flex: 1 1 40%; text-align: center; padding: 12px; background: #f6f8f7; border-radius: 10px; color: #0b5a2f; text-decoration: none; font-weight: 600; }
.m-logout { text-align: center; }
.m-video[hidden] { display: none !important; }
.m-video { position: fixed; inset: 0; z-index: 30; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 12px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.m-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.m-frame { position: absolute; width: min(68vw, 300px); aspect-ratio: 1; border: 3px solid #ffd666; border-radius: 16px; top: 22%; left: 50%; transform: translateX(-50%); pointer-events: none; box-shadow: 0 0 0 9999px rgba(0,0,0,.35); }
.m-video .btn, .m-video p { position: relative; z-index: 2; }
.m-video p { color: #fff; margin: 0; min-height: 1.2em; text-align: center; padding: 0 16px; }
.s-steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0; margin: 6px 0 0; font-size: 11.5px; text-align: center; }
.s-steps li { padding: 8px 2px; border-radius: 8px; background: #f2f4f3; color: var(--muted); }
.s-steps li.done { background: #107C41; color: #fff; }
@media (max-width: 980px) { .ec-detail { grid-template-columns: 1fr; } .ec-pipe { grid-template-columns: repeat(4, 1fr); } }
/* ---- chọn khu vực làm việc */
.ws-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ws-card { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); cursor: pointer; }
.ws-card:has(input:checked) { border-color: #107C41; background: #f3faf6; box-shadow: 0 0 0 3px rgba(16,124,65,.12); }
.ws-card input { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; accent-color: #107C41; }
.ws-ico .ico { width: 38px; height: 38px; padding: 8px; border-radius: 10px; background: #e8f3ec; color: #107C41; }
.ws-txt { display: flex; flex-direction: column; gap: 2px; padding-right: 22px; }
.ws-txt small { color: var(--muted); }
.ws-txt em { font-style: normal; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #107C41; margin-top: 4px; }
.ws-go { margin-top: 16px; }
.ws-chip { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; color: rgba(255,255,255,.85); padding: 6px 8px; border-radius: 8px; background: rgba(0,0,0,.12); margin-bottom: 6px; }
.ws-chip a { color: #fff; font-weight: 600; }
.brand .ws-brand { display: block; color: #ffd666; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 11px; }
.side-foot .ver { font-size: 12px; color: rgba(255,255,255,.62); }
