:root {
  --bg: #f4f6f8; --panel: #fff; --text: #17202a; --muted: #5f6b7a; --line: #e2e7ec; --soft: #eef2f5;
  --brand: #0f766e; --brand-soft: #e6f4f2; --brand-text: #fff;
  --ok: #15803d; --ok-soft: #e8f6ec; --warn: #b45309; --warn-soft: #fdf3e2; --bad: #b91c1c; --bad-soft: #fdecec;
  --info: #1d4ed8; --info-soft: #e8efff;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; font-size: 15px; color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* Bố cục */
.layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.side { background: #0f2a2a; color: #d4e4e2; padding: 16px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; color: #fff; font-weight: 700; font-size: 16px; }
.brand img { width: 30px; }
.nav a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; color: #c5d7d5; margin-bottom: 2px; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.on { background: var(--brand); color: #fff; }
.nav .sep { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7fa09c; padding: 14px 10px 6px; }
.nav svg { width: 18px; height: 18px; flex: none; }
.side .me { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 16px; padding: 12px 10px 0; font-size: 13px; }
.side .me a { color: #9fc3be; }
.main { padding: 22px 26px 60px; min-width: 0; }
.topbar { display: none; }
.head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head .grow { flex: 1; }

/* Thành phần */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 16px; }
.grid > .card { margin-top: 0; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.stat { padding: 14px 16px; }
.stat .k { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.warn .v { color: var(--warn); }
.stat.bad .v { color: var(--bad); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); padding: 8px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: none; cursor: pointer; padding: 4px 6px; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: var(--soft); color: var(--bad); }

input[type=text], input[type=number], input[type=password], input[type=search], input[type=date], select, textarea {
  border: 1px solid #cfd7df; border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
textarea { resize: vertical; min-height: 60px; }
label.f { display: block; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.form { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 180px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input[type=search] { max-width: 340px; }
.filters select { width: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; padding: 5px 12px; border-radius: 99px; cursor: pointer; font-size: 13px; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #f8fafb; font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: #f8fbfb; }
td input[type=number] { width: 90px; text-align: right; padding: 5px 8px; }
td select { padding: 5px 8px; min-width: 110px; }
.sku { white-space: nowrap; }
.sku { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13.5px; font-weight: 600; }
.pname { max-width: 420px; }
.pname .v { color: var(--muted); font-size: 13px; }
.clip { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-mute { background: var(--soft); color: var(--muted); }
.plus { color: var(--ok); font-weight: 600; }
.minus { color: var(--bad); font-weight: 600; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; font-size: 13px; color: var(--muted); }
.empty { text-align: center; padding: 34px 10px; color: var(--muted); }
.notice { padding: 10px 14px; border-radius: 8px; background: var(--info-soft); color: #1e3a8a; font-size: 14px; }
.notice.warn { background: var(--warn-soft); color: #7c2d12; }
.notice.bad { background: var(--bad-soft); color: #7f1d1d; }

/* Ô quét mã */
.scan { position: relative; }
.scan input { font-size: 17px; padding: 12px 14px 12px 44px; border: 2px solid var(--brand); }
.scan svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 20px; color: var(--brand); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 20; max-height: 340px; overflow-y: auto; }
.suggest div { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--soft); }
.suggest div.on, .suggest div:hover { background: var(--brand-soft); }

/* Hộp thoại */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 640px; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 900px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 99; }
.toast { background: #1f2937; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: 380px; animation: up .2s; }
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }

/* Đăng nhập */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, #0f2a2a, #0f766e); }
.auth .card { width: 100%; max-width: 400px; padding: 28px; }
.auth h1 { margin-bottom: 4px; }

/* Ô kệ */
.shelves { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.shelf { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; cursor: pointer; }
.shelf:hover { border-color: var(--brand); }
.shelf .c { font-family: Consolas, monospace; font-weight: 700; font-size: 15px; }
.shelf.empty-s { background: #fafbfc; }
.shelf.default { border-style: dashed; }

/* Tem in */
.bc { display: block; width: 100%; }
.labels { display: flex; flex-wrap: wrap; gap: 6px; }
.label { background: #fff; border: 1px dashed #c8d0d8; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: 1.2mm 2mm; color: #000; font-family: Arial, sans-serif; }
.label .t { font-size: 7.5pt; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; flex: none; }
.label .t.v { font-weight: 700; }
.label .code { font-family: Consolas, monospace; font-weight: 700; text-align: center; letter-spacing: .5px; }
.label .bcw { flex: 1; min-height: 0; display: flex; }
.label .bcw svg { height: 100%; }
.label.loc .code { font-size: 22pt; }
#print-area { display: none; }

@media print {
  body { background: #fff; }
  #app, #toasts { display: none !important; }
  #print-area { display: block !important; }
  .label { border: 0; page-break-inside: avoid; }
  .labels.roll { display: block; }
  .labels.roll .label { page-break-after: always; margin: 0; }
  .labels.sheet { gap: 0; }
  .doc-print { font-family: Arial, sans-serif; font-size: 12px; color: #000; }
  .doc-print table th, .doc-print table td { border: 1px solid #555; padding: 4px 6px; }
  .doc-print th { position: static; background: #eee; color: #000; }
}

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) {
  .layout { display: block; }
  .side { position: fixed; inset: 0 30% 0 0; max-width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .layout.open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #0f2a2a; color: #fff; position: sticky; top: 0; z-index: 30; }
  .topbar button { background: none; border: 0; color: #fff; padding: 4px; }
  .main { padding: 16px 16px 60px; }
  .g3, .g2 { grid-template-columns: 1fr; }
  h1 { font-size: 19px; }
  .stat .v { font-size: 22px; }
}

/* Biểu đồ */
.viz { width: 100%; overflow: hidden; }
.viz svg { display: block; }
.viz .grid { stroke: #e9edf1; stroke-width: 1; }
.viz .base { stroke: #b9c2cb; stroke-width: 1; }
.viz .ax { font-size: 11px; fill: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.viz-tip { position: fixed; z-index: 100; display: none; background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(0,0,0,.12); border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--text); pointer-events: none; line-height: 1.5; }
.hb { display: grid; grid-template-columns: minmax(120px, 38%) 1fr 54px; gap: 8px; align-items: center; padding: 4px 0; }
.hb-l { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hb-t { background: #f1f4f7; border-radius: 4px; height: 14px; }
.hb-b { background: #2a78d6; height: 14px; border-radius: 0 4px 4px 0; }
.hb-v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
/* Nút camera trong ô quét */
.scan .cam-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--brand-soft); color: var(--brand); border-radius: 8px; padding: 6px 8px; cursor: pointer; display: flex; }
.scan input { padding-right: 52px !important; }
.cam-line { position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; background: #ef4444; box-shadow: 0 0 8px #ef4444; }

/* Chọn kho */
.wh-pick { margin: -6px 8px 12px; }
.wh-pick span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #7fa09c; margin-bottom: 4px; }
.wh-pick select { background: #143a3a; color: #fff; border-color: #2c5a57; }

/* Phiếu gửi hàng */
.slabel { box-sizing: border-box; padding: 3mm; border: 1px solid #000; display: flex; flex-direction: column; gap: 1.5mm; font-family: Arial, sans-serif; color: #000; overflow: hidden; background: #fff; }
.sl-top { display: flex; justify-content: space-between; align-items: center; border-bottom: 1.5px solid #000; padding-bottom: 1mm; }
.sl-car { font-size: 1.6em; font-weight: 700; text-transform: uppercase; }
.sl-ch { font-size: .9em; }
.sl-bc svg { height: 15mm; width: 100%; display: block; }
.sl-code { text-align: center; font-family: Consolas, monospace; font-weight: 700; font-size: 1.25em; letter-spacing: 1px; }
.sl-box { border: 1px solid #000; border-radius: 1.5mm; padding: 1.2mm 2mm; }
.sl-k { font-size: .75em; text-transform: uppercase; font-weight: 700; color: #333; }
.sl-to { font-size: 1.1em; }
.sl-name { font-size: 1.35em; font-weight: 700; }
.sl-phone { font-size: 1.2em; font-weight: 700; }
.sl-items { flex: 1; min-height: 0; overflow: hidden; }
.sl-small { font-size: .8em; color: #333; }
.sl-cod { border: 2px solid #000; border-radius: 1.5mm; padding: 1mm 2mm; text-align: center; }
.sl-money { font-size: 1.9em; font-weight: 800; }
.sl-foot { font-size: .75em; }
.sl-page { page-break-after: always; }
.sl-sheet { display: grid; grid-template-columns: repeat(2, 105mm); }
.sl-sheet .slabel { border-style: dashed; }

.warn-t { color: var(--warn); font-weight: 600; }

/* Tìm nhanh · Nhập giá vốn */
.qsearch { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #c5d7d5; font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.qsearch:hover { background: rgba(255,255,255,.1); color: #fff; }
.qsearch span { flex: 1; }
.qsearch kbd { font: 12px/1 inherit; border: 1px solid rgba(255,255,255,.25); border-radius: 4px; padding: 2px 6px; opacity: .8; }
.sr-sec { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #64748b); margin: 12px 4px 4px; }
.sr-item { display: block; padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; }
.sr-item:hover, .sr-item:focus { background: #eef6f5; outline: none; }
input.changed { border-color: var(--brand); background: #effaf7; }

/* Hàng hoàn */
.notice.ok { background: var(--brand-soft); color: #134e4a; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper input { width: 56px; text-align: center; padding: 4px; }
.stepper .btn.sm { padding: 4px 10px; font-size: 16px; line-height: 1; }
tr.rt-miss td { background: #fff7ed; }
tr.rt-extra td { background: #eff6ff; }
.rt-total { margin-top: 10px; font-size: 15px; }
.rt-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.rt-ph { position: relative; }
.rt-ph img { width: 110px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.rt-ph button { position: absolute; top: 4px; right: 4px; padding: 2px 4px; }
.rt-add { width: 110px; height: 110px; border: 2px dashed var(--line); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); cursor: pointer; font-size: 12px; text-align: center; }
.rt-add:hover { border-color: var(--brand); color: var(--brand); }
.chip.rt-badmode { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.scan.rt-scan-bad input { border-color: #b91c1c; background: #fef2f2; }

/* Tổng quan: mục tiêu + biểu đồ */
.g-goal { grid-template-columns: minmax(260px, 1fr) 2fr; }
.goal .v { font-size: 24px; font-weight: 700; margin-top: 2px; }
.gbar { position: relative; height: 10px; background: var(--soft); border-radius: 99px; margin-top: 12px; overflow: visible; }
.gfill { height: 100%; border-radius: 99px; background: var(--brand); }
.gfill.warn { background: #d97706; }
.gtime { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--text); opacity: .55; }
.tchart { position: relative; margin-top: 8px; }
.tchart svg { width: 100%; height: auto; display: block; overflow: visible; }
.tchart .tg { stroke: var(--line); stroke-width: 1; }
.tchart .tl { fill: var(--muted); font-size: 10px; }
.tchart .tb { fill: var(--brand); opacity: .85; }
.tchart .tb.on { opacity: 1; fill: #0b5b55; }
.ttip { position: absolute; top: -6px; width: 120px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.12); pointer-events: none; }
@media (max-width: 820px) { .g-goal { grid-template-columns: 1fr; } }

/* Video bằng chứng */
.vbox { position: fixed; right: 12px; bottom: 12px; width: 260px; background: #0f172a; border-radius: 10px; overflow: hidden; z-index: 45; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.vcanvas { width: 100%; display: block; }
.vbar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; color: #e2e8f0; font-size: 12px; }
.vbar .vst { flex: 1; }
.vbar .vst.rec { color: #fca5a5; font-weight: 700; }
.vbar .vst.ok { color: #86efac; }
.vbar .vst.bad { color: #fca5a5; }
.vlist { display: flex; flex-wrap: wrap; gap: 12px; }
.vitem { width: 300px; max-width: 100%; }
.vitem video { width: 100%; border-radius: 8px; background: #000; display: block; }
@media (max-width: 820px) { .vbox { width: 150px; right: 8px; bottom: 8px; } }

.update-bar { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 60; background: #0f2a2a; color: #fff; padding: 8px 14px; border-radius: 0 0 10px 10px; font-size: 14px; display: flex; gap: 10px; align-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); }

/* Bán sỉ */
.b2b-sum { margin-top: 10px; padding: 10px 12px; background: var(--soft); border-radius: 8px; line-height: 1.8; }

/* Chat tập trung */
.nav a .nbadge { margin-left: auto; }
.nbadge { background: #ef4444; color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; line-height: 16px; }
.chatbox { display: grid; grid-template-columns: 300px 1fr 280px; height: calc(100vh - 150px); min-height: 480px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.ch-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.ch-filters { padding: 8px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.ch-filters .chips { flex-wrap: wrap; }
.chip.sm { padding: 2px 8px; font-size: 12px; }
.ch-threads { overflow-y: auto; flex: 1; }
.ch-th { display: flex; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--soft); cursor: pointer; align-items: center; }
.ch-th:hover { background: var(--soft); }
.ch-th.on { background: var(--brand-soft); }
.ch-th.unread b { font-weight: 800; }
.ch-th img, .ch-av { width: 38px; height: 38px; border-radius: 50%; flex: none; object-fit: cover; }
.ch-av { background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tagb { background: var(--soft); border-radius: 4px; padding: 0 4px; }
.dot-wait { width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; flex: none; }
.ch-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ch-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ch-msgs { flex: 1; overflow-y: auto; padding: 12px; background: #f7f9fb; }
.ch-day { text-align: center; font-size: 11px; color: var(--muted); margin: 10px 0; }
.ch-m { display: flex; flex-direction: column; margin: 4px 0; max-width: 75%; }
.ch-m.in { align-items: flex-start; }
.ch-m.out { align-items: flex-end; margin-left: auto; }
.ch-bub { padding: 8px 11px; border-radius: 14px; background: #fff; border: 1px solid var(--line); word-break: break-word; }
.ch-m.out .ch-bub { background: var(--brand); color: #fff; border-color: var(--brand); }
.ch-m.out .ch-bub a { color: #fff; }
.ch-bub img { max-width: 220px; max-height: 260px; border-radius: 8px; display: block; margin-bottom: 4px; }
.ch-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.ch-compose { border-top: 1px solid var(--line); padding: 8px; position: relative; }
.ch-compose textarea { width: 100%; resize: none; margin-bottom: 6px; }
.ch-warn { color: #b45309; }
.ch-qr { position: absolute; bottom: 100%; left: 8px; right: 8px; max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 -6px 20px rgba(0,0,0,.1); z-index: 5; }
.ch-qr > div { padding: 7px 10px; cursor: pointer; border-bottom: 1px solid var(--soft); }
.ch-qr > div:hover { background: var(--brand-soft); }
.ch-side { border-left: 1px solid var(--line); overflow-y: auto; padding: 8px; background: #fafbfc; }
.ch-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.ch-card input, .ch-card select, .ch-card textarea { width: 100%; }
.ch-ord { display: block; padding: 7px 0; border-top: 1px solid var(--soft); color: inherit; }
@media (max-width: 1100px) { .chatbox { grid-template-columns: 260px 1fr; } .ch-side { display: none; } }
@media (max-width: 820px) { .chatbox { grid-template-columns: 1fr; height: auto; } .ch-list { max-height: 40vh; } .ch-main { min-height: 70vh; } }

/* Bắt đầu dùng thật */
.setup-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--soft); }
.setup-item:first-of-type { border-top: 0; }
.setup-ck { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.setup-item.done .setup-ck { background: var(--brand); border-color: var(--brand); }
.setup-item.done b { color: var(--muted); font-weight: 500; }
.setup-home { color: inherit; }

/* Giao hàng loạt */
.ship-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.ship-layout > * { min-width: 0; }
.ship-side { position: sticky; top: 12px; }
.ship-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-top: 10px; }
.ship-f { padding: 12px 14px; }
.ship-row { display: grid; grid-template-columns: 130px 1fr; gap: 8px; align-items: start; padding: 5px 0; border-bottom: 1px dashed var(--soft); }
.ship-row > span { font-size: 13px; color: var(--muted); padding-top: 4px; }
.ship-row .chips { flex-wrap: wrap; }
@media (max-width: 1100px) { .ship-layout { grid-template-columns: 1fr; } .ship-side { position: static; } }
@media (max-width: 640px) { .ship-row { grid-template-columns: 1fr; } }

/* Đơn ngoài sàn & mẫu phiếu */
.g2-own { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 12px; align-items: start; }
.own-sum { position: sticky; top: 12px; }
.ship-set { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.ship-cks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
.ship-prev-wrap { width: calc(100mm * .72); height: calc(150mm * .72); overflow: hidden; }
.ship-prev { transform: scale(.72); transform-origin: top left; width: 100mm; }
.sl-logo { height: 9mm; max-width: 24mm; object-fit: contain; margin-right: 2mm; }
.sl-pr { display: flex; justify-content: space-between; gap: 4px; }
@media (max-width: 900px) { .g2-own, .ship-set { grid-template-columns: 1fr; } .own-sum { position: static; } }
.g2-own .pname .clip { max-width: 200px; }
.g2-own .tbl-wrap th, .g2-own .tbl-wrap td { padding-left: 6px; padding-right: 6px; }
.g5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; } @media (max-width: 900px) { .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Nhân viên & phân quyền */
.perm-g { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.perm-i { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; cursor: pointer; }
.perm-i input { margin-top: 3px; }

/* Nhặt hàng · ô chia */
.pick-msg { font-size: 17px; margin-bottom: 10px; }
.pick-cur { text-align: center; border: 2px solid var(--brand); }
.pick-loc { font-size: 34px; font-weight: 800; color: var(--brand); font-family: Consolas, monospace; }
.pick-sku { font-size: 26px; font-weight: 700; font-family: Consolas, monospace; margin-top: 6px; }
.pick-qty { font-size: 22px; margin: 8px 0; }
tr.pick-ok td { background: #e8f6ec; } tr.pick-now td { background: #fff7ed; }
.put-big { text-align: center; padding: 18px; border: 3px solid var(--brand); }
.put-big.full { background: var(--ok-soft); border-color: var(--ok); }
.put-slot { font-size: 64px; font-weight: 800; line-height: 1.1; color: var(--brand); }
.put-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 12px; }
.put-cell { border: 2px solid var(--line); border-radius: 10px; padding: 6px; text-align: center; background: var(--panel); cursor: pointer; }
.put-cell .put-n { font-size: 22px; font-weight: 800; }
.put-cell.part { border-color: #f59e0b; background: #fffbeb; }
.put-cell.full { border-color: var(--ok); background: var(--ok-soft); }
.put-cell.packed { opacity: .45; }
.hour-bars { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 140px; align-items: end; }
.hour-bars > div { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; }
.hour-bars span { display: block; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; }
.hour-bars small { font-size: 9px; color: var(--muted); }

/* Màn hình kho (TV) */
body.tv-mode .side, body.tv-mode .topbar { display: none; }
body.tv-mode .layout { display: block; }
body.tv-mode .main { padding: 0; max-width: none; }
.tv { background: #0b1220; color: #e5e7eb; min-height: 100vh; padding: 18px 22px; }
.tv-head { display: flex; gap: 12px; align-items: center; font-size: 24px; margin-bottom: 14px; }
.tv-head b { flex: 1; } .tv-head span { font-family: Consolas, monospace; }
.tv-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.tv-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.tv-tile { background: #111c2e; border-radius: 14px; padding: 16px; text-align: center; font-size: 18px; color: #9ca3af; }
.tv-tile b { display: block; font-size: 64px; line-height: 1.1; color: #fff; }
.tv-tile.bad { background: #7f1d1d; color: #fecaca; } .tv-tile.warn { background: #78350f; color: #fde68a; } .tv-tile.ok { background: #064e3b; color: #a7f3d0; }
.tv-box { background: #111c2e; border-radius: 14px; padding: 14px 16px; font-size: 18px; }
.tv-box h3 { margin: 0 0 8px; font-size: 16px; color: #9ca3af; font-weight: 600; }
.tv-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #1f2a3d; }
.tv-row b { font-size: 22px; }
.tv .hour-bars span { background: #34d399; } .tv .hour-bars small { color: #6b7280; }
.tv-ticker { margin-top: 12px; display: flex; gap: 18px; overflow: hidden; white-space: nowrap; color: #6ee7b7; font-size: 16px; }
@media (max-width: 1000px) { .tv-grid { grid-template-columns: repeat(3, 1fr); } .tv-grid3 { grid-template-columns: 1fr; } .tv-tile b { font-size: 44px; } }

/* Kiểm kê nhanh · ảnh sản phẩm */
.pthumb { object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #fff; vertical-align: middle; }
.empty-img { width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.cnt-loc { text-align: center; border: 2px solid var(--brand); }
.cnt-loc.none { border-color: #f59e0b; }
.cnt-loc-code { font-size: 34px; font-weight: 800; font-family: Consolas, monospace; color: var(--brand); }
.cnt-row { gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--soft); }
/* Hướng dẫn sử dụng */
.g-help { grid-template-columns: minmax(0,260px) minmax(0,1fr); align-items: start; }
@media (max-width: 800px) { .g-help { grid-template-columns: minmax(0,1fr); } }
.help-toc a { display: block; padding: 7px 8px; border-radius: 6px; color: inherit; text-decoration: none; }
.help-toc a:hover, .help-toc a.on { background: var(--soft); }
.help-steps { padding-left: 20px; margin: 6px 0 0; }
.help-steps li { padding: 5px 0; line-height: 1.5; }
.help-fab { position: fixed; right: 16px; bottom: 16px; width: 40px; height: 40px; border-radius: 50%; background: var(--accent, #ff0000); color: #fff !important; font-weight: 700; font-size: 20px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: pointer; z-index: 50; text-decoration: none; }
@media print { .help-fab { display: none; } }
.pl-tbl th, .pl-tbl td { border: 1px solid #999; padding: 3px 6px; font-size: 12px; vertical-align: middle; }
.pl-tbl thead th { background: #eee; }
.plist table td, .plist table th { padding: 4px 6px; border-bottom: 1px solid var(--line); }
.g-cash { grid-template-columns: minmax(0,1fr) minmax(0,250px); align-items: start; }
@media (max-width: 1200px) { .g-cash { grid-template-columns: minmax(0,1fr); } }
.help-tbl td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.help-g p { margin: 4px 0 8px; line-height: 1.5; }
.hourbars { display: flex; gap: 4px; align-items: flex-end; height: 140px; padding-top: 6px; }
.hourbars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.hourbars span { width: 100%; background: var(--brand, #0f766e); border-radius: 4px 4px 0 0; min-height: 2px; }
.hourbars small { font-size: 10px; color: var(--muted); margin-top: 2px; }
/* Dashboard */
.bi-h { font-size: 15px; margin: 18px 0 10px; }
.bi-todo { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 4px; }
.bi-todo a { color: inherit; padding: 10px 14px; }
.bi-todo a b { font-size: 18px; color: var(--brand); }
.bi-todo a.bad b { color: var(--bad); }
.bi-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.bi-card.hi { border: 2px solid #4f46e5; }
.bi-card.dark { background: #0f172a; color: #e2e8f0; border-color: #0f172a; }
.bi-card.dark .badge { background: #1e293b; color: #e2e8f0; }
.bi-big { font-size: 24px; font-weight: 700; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.bi-kv { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 2px 0; }
.bi-kv span { opacity: .75; }
.bi-kv b { font-variant-numeric: tabular-nums; text-align: right; }
.bi-svg { width: 100%; height: auto; display: block; margin-top: 8px; }
.bi-ax { font-size: 11px; fill: var(--muted); }
.bi-ax2 { font-size: 11px; fill: var(--brand); font-weight: 600; }
.bi-lb { font-size: 12px; fill: var(--text); font-weight: 700; }
.bi-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; margin-top: 6px; }
.bi-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.bi-tbl td, .bi-tbl th { white-space: nowrap; }
.bi-tbl tr.bi-sec td { background: var(--soft); font-weight: 700; font-size: 12px; text-transform: uppercase; color: var(--muted); }
.bi-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .bi-g2 { grid-template-columns: minmax(0, 1fr); } }
.bi-g2 > .card, .bi-cards > .card { min-width: 0; }
/* Menu gọn */
.side { scrollbar-width: thin; scrollbar-color: #2b4a48 transparent; }
.nav a { padding: 7px 10px; font-size: 13.5px; margin-bottom: 1px; }
.nav svg { width: 17px; height: 17px; opacity: .9; }
.ngrp { margin-top: 2px; }
.nhead { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0; cursor: pointer; padding: 9px 10px 7px; color: #8fb0ac;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; border-radius: 8px; text-align: left; }
.nhead:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.nhead .nt { flex: 1; }
.nhead .ncnt { font-weight: 600; font-size: 10px; background: rgba(255, 255, 255, .08); border-radius: 99px; padding: 0 6px; letter-spacing: 0; }
.nhead .nchev { transition: transform .15s; font-size: 14px; }
.ngrp.open .nchev { transform: rotate(90deg); }
.ngrp.has-on .nhead { color: #fff; }
.ngrp.has-on .nhead::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #34d399; }
.ngrp .nitems { display: none; padding-left: 4px; border-left: 1px solid rgba(255, 255, 255, .08); margin-left: 12px; }
.ngrp.open .nitems { display: block; }
.navtools { display: flex; gap: 6px; padding: 10px 6px 0; }
.navtools button { background: rgba(255, 255, 255, .06); border: 0; color: #9fc3be; border-radius: 6px; padding: 5px 8px; font-size: 12px; cursor: pointer; }
.navtools button:hover { color: #fff; }
.navtools #navall { flex: 1; text-align: left; }
@media (min-width: 901px) {
  body.nav-mini .layout { grid-template-columns: 64px minmax(0, 1fr); }
  body.nav-mini .side { padding: 12px 6px; }
  body.nav-mini .side .nt, body.nav-mini .brand, body.nav-mini .qsearch span, body.nav-mini .qsearch kbd, body.nav-mini .me, body.nav-mini #navall, body.nav-mini .nhead .ncnt, body.nav-mini .nhead .nchev { display: none; }
  body.nav-mini .nav a { justify-content: center; padding: 9px 0; }
  body.nav-mini .nav a .nbadge { position: absolute; margin: -18px 0 0 22px; font-size: 9px; padding: 0 4px; }
  body.nav-mini .ngrp .nitems { display: block; border: 0; margin: 0; padding: 0; }
  body.nav-mini .nhead { justify-content: center; padding: 6px 0; }
  body.nav-mini .nhead::after { content: ''; display: block; width: 24px; border-top: 1px solid rgba(255,255,255,.15); }
  body.nav-mini .navtools { justify-content: center; }
  body.nav-mini #navmini { transform: rotate(180deg); }
  body.nav-mini .qsearch { justify-content: center; }
}
.ai-test { height: 320px; overflow-y: auto; background: var(--soft); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.ai-test .ch-m.in .ch-bub { background: #fff; }
.bi-donuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.bi-donuts > .card, .bi-todo > .card, .bi-cards > .card { margin: 0; }
.bi-donut h3 { margin: 0 0 8px; font-size: 14px; }
.bi-dwrap { display: flex; gap: 12px; align-items: center; }
.bi-dsvg { width: 132px; height: 132px; flex: none; }
.bi-dsvg path, .bi-dsvg circle { transition: opacity .15s; }
.bi-dsvg:hover path, .bi-dsvg:hover circle { opacity: .55; }
.bi-dsvg path:hover, .bi-dsvg circle:hover { opacity: 1; }
.bi-dtot { font-size: 15px; font-weight: 700; fill: var(--text); }
.bi-dsub { font-size: 9px; fill: var(--muted); }
.bi-dleg { flex: 1; min-width: 0; font-size: 12px; }
.bi-dleg > div { display: flex; gap: 6px; align-items: center; padding: 2px 0; }
.bi-dleg i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.bi-dleg .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bi-dleg b { width: 40px; text-align: right; }
.bi-dleg .muted { width: 70px; text-align: right; font-size: 11px; }
.held-card { border: 2px solid var(--warn); background: var(--warn-soft); }
.sr-item.on { background: #eef6f5; box-shadow: inset 3px 0 0 var(--brand); }
.sr-item svg { vertical-align: -3px; color: var(--brand); }
.h1-help { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: 8px; border-radius: 50%; border: 1.5px solid var(--brand);
  background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 700; cursor: pointer; vertical-align: 3px; padding: 0; line-height: 1; }
.h1-help:hover { background: var(--brand); color: #fff; }
.help-pop { max-height: 65vh; overflow-y: auto; }
.help-pop .help-steps li { padding: 6px 0; }
@media print { .h1-help { display: none; } }
.ws-switch { display: flex; gap: 4px; background: rgba(255,255,255,.06); border-radius: 10px; padding: 3px; margin: 0 4px 10px; }
.ws-switch button { flex: 1; border: 0; background: none; color: #a9c3c0; padding: 7px 4px; border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ws-switch button.on { background: #fff; color: #0f2a2a; }
.ws-switch button:not(.on):hover { color: #fff; }
body[data-ws="vp"] .side { background: #1b1f3a; }
body.nav-mini .ws-switch { flex-direction: column; }
body.nav-mini .ws-switch button { font-size: 16px; overflow: hidden; width: 100%; text-indent: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-h { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-c { min-height: 96px; background: var(--soft); border-radius: 8px; padding: 4px; cursor: pointer; overflow: hidden; }
.cal-c:hover { outline: 2px solid var(--brand-soft); }
.cal-c.off { background: none; cursor: default; }
.cal-c.today { outline: 2px solid var(--brand); }
.cal-n { font-size: 11px; font-weight: 700; color: var(--muted); }
.cal-p { background: #fff; border-left: 3px solid; border-radius: 4px; font-size: 11px; padding: 2px 4px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 3px; }
.kpi-bar { height: 6px; background: var(--soft); border-radius: 99px; margin-top: 4px; overflow: hidden; }
.kpi-bar span { display: block; height: 100%; border-radius: 99px; }
@media (max-width: 700px) { .cal-c { min-height: 60px; } .cal-p { font-size: 9px; } }

/* ===== Trung tâm AI (Mission Control) ===== */
.mc { --mc-bg: #0a0f1f; --mc-card: #111832; --mc-line: rgba(148, 163, 255, .14); --mc-dim: #8b95b8;
  background: radial-gradient(1200px 500px at 20% -10%, #1d2756 0%, transparent 60%), radial-gradient(900px 500px at 110% 10%, #2a1747 0%, transparent 55%), var(--mc-bg);
  color: #e6e9ff; border-radius: 18px; padding: 22px; min-height: calc(100vh - 60px); }
.mc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.mc-head h1 { margin: 0; font-size: 26px; letter-spacing: .2px; color: #fff; }
.mc-sub, .mc-dim { color: var(--mc-dim); }
.mc-sub { font-size: 13px; margin-top: 2px; }
.mc-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--mc-line); border-radius: 99px; font-size: 12px; color: #cbd2ff; background: rgba(255,255,255,.03); }
.mc-pill i { width: 8px; height: 8px; border-radius: 50%; background: #64748b; }
.mc-pill i.ok { background: #34d399; box-shadow: 0 0 10px #34d399; }
.mc-btn { background: rgba(255,255,255,.06); color: #fff; border: 1px solid var(--mc-line); padding: 8px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.mc-btn:hover { background: rgba(255,255,255,.12); }
.mc-warn { background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .35); color: #fde68a; padding: 10px 14px; border-radius: 12px; margin-bottom: 16px; font-size: 13px; }
.mc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.mc-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px 14px; border-radius: 18px; cursor: pointer; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, var(--mc-card)) 0%, var(--mc-card) 70%); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  box-shadow: 0 8px 30px -12px color-mix(in srgb, var(--c) 60%, transparent), inset 0 1px 0 rgba(255,255,255,.06); transition: transform .18s, box-shadow .18s; font: inherit; }
.mc-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px -12px color-mix(in srgb, var(--c) 80%, transparent), inset 0 1px 0 rgba(255,255,255,.1); }
.mc-card b { font-size: 15px; margin-top: 2px; }
.mc-card span { font-size: 11.5px; color: var(--mc-dim); font-family: ui-monospace, Menlo, Consolas, monospace; display: inline-flex; align-items: center; gap: 6px; }
.mc-card span i { width: 7px; height: 7px; border-radius: 50%; background: #34d399; opacity: .5; }
.mc-card span i.on { opacity: 1; box-shadow: 0 0 8px #34d399; animation: mcPulse 1.6s infinite; }
.mc-card.locked { opacity: .45; filter: grayscale(.5); }
.mc-bot { display: block; }
.mc-card .mc-bot { animation: mcFloat 3.2s ease-in-out infinite; }
.mc-card:nth-child(3n) .mc-bot { animation-delay: -1.1s; }
.mc-card:nth-child(3n+1) .mc-bot { animation-delay: -2.2s; }
.mc-eyes { animation: mcBlink 5s infinite; transform-origin: 50px 42px; }
.mc-ant { animation: mcPulse 1.8s infinite; }
@keyframes mcFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes mcBlink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes mcPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.mc-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 18px 0; }
.mc-stat { background: linear-gradient(160deg, rgba(99, 102, 241, .14), rgba(17, 24, 50, .9)); border: 1px solid var(--mc-line); border-radius: 14px; padding: 14px 16px; }
.mc-stat .k { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mc-dim); }
.mc-stat .v { font-size: 26px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; color: #fff; }
.mc-stat .v small { font-size: 15px; color: var(--mc-dim); font-weight: 600; }
.mc-stat .s { font-size: 11.5px; color: var(--mc-dim); }
.mc-cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1000px) { .mc-cols { grid-template-columns: minmax(0, 1fr); } }
.mc-h2 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--mc-dim); font-weight: 700; margin: 0 0 8px 2px; }
.mc-panel { background: rgba(17, 24, 50, .75); border: 1px solid var(--mc-line); border-radius: 14px; padding: 6px; }
.mc-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.mc-row:hover { background: rgba(255,255,255,.04); }
.mc-row b { color: #fff; }
.mc-tag { font-size: 11px; padding: 3px 9px; border-radius: 99px; background: rgba(148,163,184,.15); color: #cbd5e1; white-space: nowrap; }
.mc-tag.ok { background: rgba(52, 211, 153, .15); color: #6ee7b7; }
.mc-act { display: flex; gap: 10px; padding: 9px 10px; border-bottom: 1px solid var(--mc-line); font-size: 13px; }
.mc-act:last-child { border-bottom: 0; }
.mc-act i { width: 7px; height: 7px; border-radius: 50%; background: #818cf8; margin-top: 6px; flex: none; box-shadow: 0 0 8px #818cf8; }
.mc-act:nth-child(3n) i { background: #f472b6; box-shadow: 0 0 8px #f472b6; }
.mc-act:nth-child(3n+1) i { background: #38bdf8; box-shadow: 0 0 8px #38bdf8; }
.mc-chat-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.mc-skills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mc-skills .chip { border-color: color-mix(in srgb, var(--c) 50%, var(--line)); }
.mc-msgs { height: 48vh; overflow-y: auto; background: var(--soft); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.mc-msg { display: flex; gap: 8px; align-items: flex-start; }
.mc-msg.user { justify-content: flex-end; }
.mc-bub { max-width: 82%; padding: 9px 12px; border-radius: 12px; background: #fff; font-size: 13.5px; line-height: 1.55; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.mc-msg.user .mc-bub { background: var(--c); color: #fff; }
.mc-msg .mc-bot { flex: none; }
.mc-typing i { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: var(--c); animation: mcPulse 1s infinite; }
.mc-typing i:nth-child(2) { animation-delay: .2s; }
.mc-typing i:nth-child(3) { animation-delay: .4s; }
@media (prefers-reduced-motion: reduce) { .mc-card .mc-bot, .mc-eyes, .mc-ant, .mc-card span i.on { animation: none; } }

/* Việc của tôi · Sổ tay · Báo cáo nhanh trợ lý */
.task-row { display: flex; gap: 10px; align-items: center; padding: 9px 8px; border-bottom: 1px solid var(--soft); color: inherit; border-radius: 6px; }
.task-row:hover { background: var(--soft); }
.task-row.bad .grow { font-weight: 600; }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.note-grid > .card { margin: 0; }
.note-card { cursor: pointer; position: relative; transition: box-shadow .15s, transform .15s; }
.note-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px -10px rgba(15, 23, 42, .25); }
.note-card h3 { margin: 4px 0 6px; font-size: 15px; }
.note-ex { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.note-pin { position: absolute; top: 10px; right: 12px; }
.note-body { line-height: 1.6; white-space: normal; }
.mc-alert { position: absolute; top: 10px; right: 10px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; font-size: 11px; font-weight: 700; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.mc-alert.bad { background: #ef4444; box-shadow: 0 0 12px #ef4444; animation: mcPulse 1.4s infinite; }
.mc-alert.warn { background: #f59e0b; box-shadow: 0 0 10px #f59e0b; }
.mc-brief { max-width: 100%; flex: 1; }
.mc-bi { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--soft); }
.mc-bi:last-child { border-bottom: 0; }
.mc-bi.bad .grow { font-weight: 600; }

/* Luồng tự động */
.auto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 12px; margin-bottom: 14px; }
.auto-grid > .card { margin: 0; }
.auto-card { border-left: 4px solid var(--line); transition: border-color .15s; }
.auto-card.on { border-left-color: var(--brand); }
.auto-ic { font-size: 22px; line-height: 1; }
.auto-pv { margin-top: 8px; background: var(--soft); border-radius: 8px; padding: 8px 10px; max-height: 220px; overflow-y: auto; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px; transition: background .15s; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(18px); }
