/* app.css — Kho vận, the frame every screen shares: a sibling of the company ERP (48 px top bar, teal accent, 15 px body, cards with
   a 1 px border, 10 px corners) with Ecom Auto's status marks (✓ green · ⏳ amber · ⛔ / ⚠ red). One responsive layout, mobile first;
   every reflow is a container query on .app. Touch targets ≥ 44 px at every width. Taken from the approved demo (d10.css), without
   the demo's own bar and device frame. */
:root {
  --bg: #f5f6f4; --card: #fff; --ink: #1c2321; --muted: #66706c; --line: #dfe3e0;
  --accent: #0f766e; --accent-soft: #e3f2f0;
  --ok: #1a7f37; --ok-bg: #ecfdf3;
  --warn: #9a6700; --warn-bg: #fff8e6; --warn-line: #ecd9a0;
  --err: #b42318; --err-bg: #fdecea;
  --dim: rgba(28, 35, 33, .45);
  --tap: 44px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { color: var(--ink); font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body.khoa { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { container: app / inline-size; min-height: 100vh; background: var(--bg); }
.topbar { background: var(--card); border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; padding: 0 16px; }
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; min-height: 48px; }
.brand .logo { width: 28px; height: 28px; border-radius: 6px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.topbar .right { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0 10px; font-size: 13px; min-height: 48px; min-width: 0; }
.net { font-size: 13px; font-weight: 600; }
.net.wait { color: var(--warn); }
.user { color: var(--ink); overflow-wrap: anywhere; }
.user small { color: var(--muted); font-size: 13px; }
.nav { order: 3; width: 100%; display: flex; gap: 4px; overflow-x: auto; border-top: 1px solid var(--line); }
.nav a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 12px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a.on { color: var(--accent); border-bottom-color: var(--accent); }
@container app (min-width: 760px) {
  .nav { order: 0; width: auto; border-top: 0; }
  .nav a { min-height: 48px; }
}

main { padding: 16px; max-width: 1440px; margin: 0 auto; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.head h1 { margin: 0; font-size: 22px; line-height: 1.25; }
.head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card h2 { margin: 0; font-size: 17px; line-height: 1.3; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h2 .count { color: var(--muted); font-weight: 600; }
.card h3 { margin: 16px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.src { color: var(--muted); font-size: 12px; margin-top: 6px; }
.tip { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -10px -6px; padding: 0; border: 0; background: transparent; cursor: pointer; flex: none; vertical-align: middle; }
.tip span { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; background: #fff; }
.tip.on span { background: var(--ink); color: #fff; border-color: var(--ink); }
.pop { background: #fff; color: var(--ink); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; padding: 8px 12px; margin: 8px 0; font-size: 13px; font-weight: 400; line-height: 1.45; }

button.btn, a.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 8px 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); cursor: pointer; text-decoration: none; color: var(--ink); font-weight: 600; }
button.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.btn.big { min-height: 56px; font-size: 17px; padding: 10px 20px; }
button.btn.block { width: 100%; }
button.btn:disabled { opacity: .5; cursor: default; }
.badge { padding: 2px 8px; border-radius: 6px; font-weight: 700; font-size: 13px; white-space: nowrap; display: inline-block; }
.badge.hot { background: var(--err-bg); color: var(--err); }
.badge.th { background: #eef1ef; color: var(--muted); }
.badge.chan { background: #eef1ef; color: var(--ink); border: 1px solid var(--line); font-weight: 600; white-space: normal; }
.ok { color: var(--ok); } .wait { color: var(--warn); } .bad { color: var(--err); } .muted { color: var(--muted); }
.code { font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.trk { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 13px; }
.gapt { margin-top: 16px; }
.gap12 { margin: 12px 0 0; }
h2.h15 { font-size: 15px; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; }
.none { color: var(--muted); font-size: 13px; padding: 8px 0; }
.strip { border-radius: 10px; padding: 10px 16px; margin-bottom: 16px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.strip.wait { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.strip.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #b7e1c4; }
.strip.bad { background: var(--err-bg); color: var(--err); border: 1px solid var(--err); }
.net.bad { color: var(--err); }
.label { padding: 2px 8px; border-radius: 6px; font-size: 13px; font-weight: 600; background: #eef1ef; color: var(--muted); }
.label.ok { background: var(--ok-bg); color: var(--ok); }

/* rows (orders) */
.rows { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; min-height: 56px; background: #fff; }
.row.tap { cursor: pointer; }
@media (hover: hover) { .row.tap:hover { border-color: #b9c4bf; } }
.row.sel { border: 2px solid var(--accent); background: var(--accent-soft); }
.row.badrow, .row.alertrow { border-color: var(--err); background: var(--err-bg); }
.row.dimrow { background: #fafbfa; }
.row .l1 { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-width: 0; }
.row .l2 { font-size: 13px; color: var(--muted); grid-column: 1; min-width: 0; overflow-wrap: anywhere; }
.row .r { text-align: right; font-size: 13px; font-weight: 600; }
.row .r .small { display: block; font-size: 12px; font-weight: 400; }
.row .r .big { display: block; font-size: 17px; }
.row .go { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.row .go .btn { flex: 1 1 200px; }
details.more { margin-top: 12px; }
details.more summary { min-height: var(--tap); display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; cursor: pointer; font-weight: 600; color: var(--accent); }

/* Đối chiếu cuối ngày */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@container app (min-width: 760px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-width: 0; display: flex; flex-direction: column; }
.tile .k { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.tile .v { font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile .v .gap { font-size: 15px; color: var(--err); margin-left: 6px; }
.tile .split { font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; }
.tile .src { margin-top: auto; padding-top: 6px; }
.tile.lost { border: 2px solid var(--err); }
.dcbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 16px; }
.dcbar input[type=date] { min-height: var(--tap); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; background: #fff; max-width: 100%; }
h2.dch { font-size: 17px; margin: 24px 0 0; }
.groups { display: grid; gap: 16px; margin-top: 16px; }
.groups > .card + .card { margin-top: 0; }

/* sign-in, no access */
.center { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 24px 0; }
.signin { width: 100%; max-width: 400px; text-align: center; }
.signin .logo { width: 56px; height: 56px; border-radius: 12px; background: var(--accent); color: #fff; font-size: 20px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.signin h1 { font-size: 22px; margin: 12px 0 4px; }
.signin p { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.signin p.ink { font-size: 15px; color: var(--ink); }
.signin p.bad, .signin p.ok { margin: 8px 0 0; font-weight: 600; }
.signin p.bad { color: var(--err); } .signin p.ok { color: var(--ok); }
.signin .two { display: flex; gap: 8px; flex-wrap: wrap; }
.signin .two .btn { flex: 1 1 140px; }
.hoac { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.hoac::before, .hoac::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.mail { text-align: left; }
.mail input { width: 100%; min-height: var(--tap); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; margin-bottom: 8px; background: #fff; }
.ms { display: inline-grid; grid-template-columns: 9px 9px; gap: 2px; margin-right: 4px; }
.ms i { width: 9px; height: 9px; display: block; }

.footer { color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 8px; overflow-wrap: anywhere; }
