/* ZAFAGO GMV — giao diện theo nhận diện thương hiệu Zafago, cùng hệ với crm-new (NEW-70/71/73): phẳng, màu đặc, nền sáng mặc định,
   theme tối trên nền đen thương hiệu. Khung = menu dọc nền sáng + hàng tiêu đề (control panel) dính đầu vùng nội dung.
   Thương hiệu: xanh #2000b1 (chính: nút, link, tab, mục menu đang mở, viền focus) · cam #ed6800 (nhấn, dùng ÍT) · đen #03000e · trắng #ebeaed.
   Cam Shopee / mint TikTok chỉ là màu của SÀN trong dữ liệu. KHÔNG gradient trang trí, KHÔNG kính mờ, KHÔNG bóng phát sáng.
   Khối biến dưới chép từ crm-new/frontend/css/app.css — đổi ở crm-new thì chép lại. Đổi theme: <html data-theme="dark|light">. */
:root {
  --brand: #2000b1;
  --brand-dark: #17007f;          /* hover / nhấn / chữ link */
  --brand-soft: #ecebf8;          /* nền mục menu đang mở, dòng chọn */
  --on-brand: #ffffff;            /* chữ trên nền --brand */
  --topbar: #2000b1;
  --on-topbar: #ffffff;
  --on-topbar-muted: rgb(255 255 255 / .82);
  --on-topbar-line: rgb(255 255 255 / .38);
  --on-topbar-hover: rgb(255 255 255 / .12);
  --on-topbar-soft: #e5e1ff;      /* chữ mục menu dọc (NEW-73; mục đang mở trắng) */
  /* NEW-73 v3: menu dọc NỀN SÁNG phẳng — cùng giá trị với crm-prt (hai hệ thống giống nhau) */
  --sb-bg: #ffffff;
  --sb-border: #e4e3ea;
  --sb-ink: rgb(3 0 14 / .8);          /* chữ mục: #03000e 80% */
  --sb-icon: #5d5a6b;
  --sb-muted: #6b6879;                 /* tên app, tiêu đề phụ, gợi ý */
  --sb-hover: #efeff3;
  --sb-active: #2000b1;                /* khối mục đang mở */
  --sb-active-ink: #ffffff;
  --sb-group-on: #2000b1;              /* chữ nhóm chứa mục đang mở */
  --sb-line: #d9d8e0;                  /* đường cây mục con */
  --sb-field: #f5f5f8;                 /* ô tìm */
  --sb-dot: #e5372b;                   /* chấm cần xử lý */
  --sb-strong: #03000e;                /* chữ đậm: khi rê, tên người */
  --shell-top: 0px;              /* NEW-73: chiều cao thanh trên cùng (chỉ màn < 900 px có thanh mỏng 48 px) */
  --accent: #ed6800;              /* cam — KHÔNG dùng cho cảnh báo / lỗi */
  --accent-soft: #fdf0e6;
  --accent-text: #b34f00;         /* cam đủ tương phản AA trên nền trắng */
  --ink: #03000e;
  --muted: #5d5a6b;
  --line: #d8d6de;
  --line-2: #ecebf0;              /* NEW-71: kẻ dòng bảng / danh sách (nhạt hơn --line) */
  --bg: #ebeaed;
  --surface: #ffffff;
  --surface-2: #f5f4f7;
  --hover: #f3f2f6;
  --ok: #18794e;
  --ok-soft: #e6f4ec;
  --ok-text: #18794e;
  --warn: #8a6500;                /* vàng đất — không giống cam thương hiệu */
  --warn-soft: #fdf6dc;
  --err: #c0261b;
  --err-soft: #fdeceb;
  --err-strong: #9b1c13;
  --on-ok: #ffffff;
  --on-err: #ffffff;
  --toast-bg: #03000e;
  --toast-ink: #ffffff;
  --paper: #ffffff;             /* "giấy": mã QR, xem trước email — luôn nền trắng chữ đen, cả theme tối */
  --paper-ink: #03000e;
  --btn-border: #c9c6d2;
  --soon: #a9a6b5;
  --chart-1: #2000b1;             /* biểu đồ: xanh thương hiệu */
  --chart-2: #ed6800;             /* cam thương hiệu */
  --chart-3: #0086d8;             /* xanh trời của chữ Z */
  --chart-4: #5d5a6b;             /* xám trung tính */
  --chart-5: #8b7dff;             /* tím nhạt (xanh thương hiệu sáng) */
  --chart-6: #b9b6c4;             /* xám nhạt */
  --shadow: 0 1px 2px rgb(3 0 14 / .06);
  --shadow-pop: 0 4px 16px rgb(3 0 14 / .14);   /* chỉ cho lớp nổi (hộp thoại, menu thả) — không phát sáng */
  --overlay: rgb(3 0 14 / .45);
  --radius: 6px;                  /* NEW-71: góc vuông hơn kiểu Odoo (bản mẫu C: 4–6 px) */
  --radius-btn: 4px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* GMV: màu nhận diện SÀN — CHỈ cho dữ liệu (dải biểu đồ, nhãn sàn, vạch KPI theo sàn); không dùng cho nút, menu, tab, link, khung */
  --shopee: #EE4D2D;
  --shopee-dark: #C93A1D;
  --shopee-soft: #FDECE8;
  --tiktok-mint: #25F4EE;
  --tiktok-mint-dark: #0FA8A3;
  --tiktok-mint-text: #08736F;
  --tiktok-mint-soft: #E3FDFC;
  --brand-gradient: linear-gradient(120deg, var(--shopee) 0%, #F6A08D 45%, #8FF8F5 70%, var(--tiktok-mint) 100%);   /* giữ biến; KHÔNG dùng cho khung */
  --glass: var(--surface);        /* cũ (trang công khai): phẳng, không kính mờ */
  --glow: none;                   /* cũ: không nền phát sáng */
  /* GMV-14: nút "Đăng nhập bằng Google" theo mẫu chính thức của Google (light / dark) — chỉ cho nút này */
  --g-btn-bg: #ffffff;
  --g-btn-ink: #1f1f1f;
  --g-btn-line: #747775;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --sb-bg: #12111a;                    /* NEW-73 v3: menu dọc theme tối */
  --sb-border: #2a2836;
  --sb-ink: #ebeaed;
  --sb-icon: #a29fb3;
  --sb-muted: #a29fb3;
  --sb-hover: #1f1d2b;
  --sb-active: #2000b1;
  --sb-active-ink: #ffffff;
  --sb-group-on: #8b7dff;              /* xanh #2000b1 không đọc được trên nền tối ⇒ --brand của theme tối */
  --sb-line: #34313f;
  --sb-field: #1a1925;
  --sb-dot: #ff6b5f;
  --sb-strong: #ffffff;
  --brand: #8b7dff;               /* xanh thương hiệu làm sáng ⇒ chữ / link đạt AA trên nền đen */
  --brand-dark: #b3aaff;
  --brand-soft: rgb(139 125 255 / .16);
  --on-brand: #03000e;
  --topbar: #2000b1;
  --accent: #ff8a2a;
  --accent-soft: rgb(237 104 0 / .18);
  --accent-text: #ffa45c;
  --ink: #ebeaed;
  --muted: #a29fb3;
  --line: #2a2645;
  --line-2: #1f1b38;
  --bg: #03000e;
  --surface: #100d22;
  --surface-2: #17142e;
  --hover: #1d1938;
  --ok: #4cc38a;
  --ok-soft: rgb(76 195 138 / .14);
  --ok-text: #6fd6a3;
  --warn: #e3b341;
  --warn-soft: rgb(227 179 65 / .14);
  --err: #ff7b72;
  --err-soft: rgb(255 123 114 / .14);
  --err-strong: #ff9d96;
  --on-ok: #03000e;
  --on-err: #03000e;
  --toast-bg: #ebeaed;
  --toast-ink: #03000e;
  --btn-border: #35304f;
  --soon: #5d5a73;
  --g-btn-bg: #131314;
  --g-btn-ink: #e3e3e3;
  --g-btn-line: #8e918f;
  --chart-1: #8b7dff;
  --chart-2: #ff8a2a;
  --chart-3: #3aa6e8;
  --chart-4: #a29fb3;
  --chart-5: #c9c1ff;
  --chart-6: #4a4660;
  --shadow: none;
  --shadow-pop: 0 4px 16px rgb(0 0 0 / .5);
  --overlay: rgb(3 0 14 / .7);
  --shopee-soft: rgb(238 77 45 / .16);
  --shopee-dark: #FF8266;         /* chữ cam trên nền tối */
  --tiktok-mint-text: #5FF3EE;
  --tiktok-mint-soft: rgb(37 244 238 / .12);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-dark); }
:root[data-theme="dark"] a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
svg.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.logo { font-weight: 800; font-size: 24px; letter-spacing: .02em; margin: 0; color: var(--brand); }
.logo .z { color: var(--brand); }
.logo .g { color: var(--accent-text); }
/* Khối logo dùng chung (trang công khai): dấu Z + chữ ZAFAGO (xanh / trắng theo theme) + tên sản phẩm GMV */
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; vertical-align: middle; }
.brand-lockup .bl-mark { width: 28px; height: 28px; border-radius: 6px; display: block; }
.brand-lockup .bl-word { height: 14px; width: auto; display: block; }
.brand-lockup .bl-d { display: none; }
:root[data-theme="dark"] .brand-lockup .bl-l { display: none; }
:root[data-theme="dark"] .brand-lockup .bl-d { display: block; }
.brand-lockup .bl-prod { font-weight: 700; font-size: 15px; letter-spacing: .02em; color: var(--brand); padding-left: 10px; border-left: 1px solid var(--line); line-height: 18px; }

/* ---- Đăng nhập (như crm-new): trái = mảng xanh thương hiệu + logo trắng, phải = form trắng; màn hẹp: dải trên ---- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.login-brand { background: var(--topbar); color: var(--on-topbar); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 48px 32px; text-align: center; }
.login-brand .login-mark { width: 112px; height: 112px; display: block; }
.login-word-row { display: flex; align-items: center; justify-content: center; gap: 12px; max-width: 100%; }
.login-brand .login-word { width: 220px; max-width: 60vw; height: auto; display: block; }
.login-prod { font-size: 34px; line-height: 1; font-weight: 700; letter-spacing: .02em; color: var(--on-topbar); padding-left: 12px; border-left: 2px solid var(--on-topbar-line); }
.login-brand p { margin: 6px 0 0; font-size: 16px; font-weight: 500; color: var(--on-topbar); }
.login-side { display: flex; align-items: center; justify-content: center; padding: 32px 24px; background: var(--surface); }
.login-card { width: 100%; max-width: 380px; position: relative; }
.login-lang { position: absolute; top: 0; right: 0; }
.login-card .login-title { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.login-card .login-app { margin: 4px 0 22px; }
.login-card .btn.primary { height: 40px; }
.login-foot { font-size: 12px; margin: 14px 0 0; line-height: 1.7; }
@media (max-width: 760px) {
  .login-wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-brand { flex-direction: row; flex-wrap: wrap; gap: 10px 12px; padding: 16px; }
  .login-brand .login-mark { width: 40px; height: 40px; }
  .login-brand .login-word { width: 120px; }
  .login-prod { font-size: 19px; padding-left: 10px; }
  .login-word-row { gap: 10px; }
  .login-brand p { flex-basis: 100%; margin: 0; font-size: 13px; }
  .login-side { align-items: flex-start; padding: 28px 16px; }
}

/* ---- GMV-14: trang chọn lối vào + 2 cổng đăng nhập + nhận lời mời / quên mật khẩu ---- */
.login-card .login-submit { width: 100%; min-height: 44px; }
.login-kicker { margin: 0 0 10px; font-size: 13px; }
.login-back { color: var(--brand); text-decoration: none; font-weight: 500; display: inline-flex; min-height: 32px; align-items: center; }
.login-back:hover { text-decoration: underline; }
.login-card a:not(.btn) { color: var(--brand); }
.login-card .msg { margin-bottom: 14px; }
.login-links { margin: 12px 0 0; font-size: 14px; }
.login-links a { display: inline-flex; min-height: 32px; align-items: center; font-weight: 500; }
.login-hint { font-size: 13px; margin: 18px 0 0; line-height: 1.7; }
.login-card .login-kv { margin: 0 0 18px; grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); }
.portal-list { display: flex; flex-direction: column; gap: 12px; }
.portal-opt { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; min-height: 72px; transition: border-color .12s, background .12s; }
.login-card a.portal-opt { color: var(--ink); }
.portal-opt:hover { border-color: var(--brand); background: var(--hover); }
.portal-opt.last { border-color: var(--brand); }
.portal-opt .portal-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.portal-opt strong { font-size: 16px; font-weight: 700; color: var(--ink); }
.portal-opt .portal-txt > span { font-size: 13px; color: var(--muted); line-height: 1.5; }
.portal-opt .portal-txt > .portal-last { color: var(--brand); font-weight: 600; font-size: 12px; }
.portal-opt .ic { width: 20px; height: 20px; flex: none; color: var(--brand); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.google-btn { width: 100%; min-height: 44px; gap: 10px; background: var(--g-btn-bg); color: var(--g-btn-ink); border-color: var(--g-btn-line); font-weight: 500; }
.login-card a.google-btn, :root[data-theme="dark"] .login-card a.google-btn { color: var(--g-btn-ink); }
.google-btn:hover { background: var(--g-btn-bg); border-color: var(--brand); }
.google-btn .g-mark { width: 18px; height: 18px; flex: none; }
.login-or { display: flex; align-items: center; gap: 10px; font-size: 12px; margin: 16px 0; }
.login-or::before, .login-or::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
/* GMV-16: nút "Đăng nhập bằng passkey" — cùng khuôn nút Google (viền, nền bề mặt), biểu tượng vân tay nét theo màu chữ */
.login-alt #googleBox + .passkey-btn { margin-top: 10px; }
.login-card .passkey-btn { width: 100%; min-height: 44px; gap: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 500; }
.passkey-btn .pk-mark { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--brand); }
.passkey-btn.primary .pk-mark { color: currentColor; }
.login-alt-hint { font-size: 12px; margin: 6px 0 0; text-align: center; line-height: 1.5; }
.pk-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.pk-item { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 14px; flex-wrap: wrap; }
.pk-item + .pk-item { border-top: 1px solid var(--line); }
.pk-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 260px; }
.pk-name { overflow-wrap: anywhere; }
.pk-meta { font-size: 13px; line-height: 1.5; }
.pk-act { display: inline-flex; gap: 8px; flex-wrap: wrap; }
@media (hover: none) and (pointer: coarse) {
  .login-card input { font-size: 16px; }   /* iOS không tự phóng to khi chạm ô nhập */
  .login-lang .btn { min-height: 44px; min-width: 44px; }
  .pk-act .btn.small, .mfa-nudge .btn.small { min-height: 44px; min-width: 44px; }
  .mfa-choice .btn, .passkey-card .btn, .modal footer .btn { min-height: 44px; }
  .mfa-req-foot a { display: inline-block; padding: 12px 0; }   /* GMV-16: vùng bấm đủ lớn trên màn cảm ứng */
}
@media (prefers-reduced-motion: reduce) { .portal-opt { transition: none; } }
/* Trang chủ khách hàng (views/home.js) */
.home-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.home-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line-2); }
.home-steps li:first-child { border-top: 0; padding-top: 4px; }
.home-steps .st { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; border: 1px solid var(--btn-border); color: var(--muted); }
.home-steps li.done .st { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.home-steps .sx { flex: 1 1 auto; min-width: 0; }
.home-steps .sx strong { display: block; }
.home-steps .sx p { margin: 2px 0 8px; color: var(--muted); font-size: 13px; }
.home-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.home-actions .btn { min-height: 40px; }
.home-lead { margin: 0 0 16px; color: var(--muted); }
.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row input { flex: 1 1 auto; min-width: 0; font-size: 13px; }

/* ---- Khung ứng dụng (như crm-new NEW-73 v3): .shell = [.sidebar 256 px nền sáng | .main cuộn riêng]; thu gọn = dải 64 px; < 900 px: thanh mỏng + menu trượt ---- */
.shell { display: flex; min-height: 100vh; }
.shell-body { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.sidebar { width: 256px; flex: none; display: flex; flex-direction: column; background: var(--sb-bg); color: var(--sb-ink); border-right: 1px solid var(--sb-border); position: relative; z-index: 30; }
.sidebar a { text-decoration: none; color: inherit; }
:root[data-theme="dark"] .sidebar a { color: inherit; }
.sidebar :focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.sb-head, .sb-nav, .sb-foot { position: relative; }
.sb-head { z-index: 3; flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 16px 10px 2px 16px; }
.sb-foot { z-index: 2; flex: none; }
.sb-nav { z-index: 1; }
.sb-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sb-brand img:first-child { width: 32px; height: 32px; border-radius: 7px; display: block; flex: none; }
.sb-word { height: 15px; width: auto; display: block; }
.sb-word-dark { display: none; }
:root[data-theme="dark"] .sb-word { display: none; }
:root[data-theme="dark"] .sb-word-dark { display: block; }
.sb-collapse, .sb-close { grid-column: 2; grid-row: 1; }
.sidebar .sb-i { width: 32px; height: 32px; display: grid; place-items: center; position: relative; border: 0; border-radius: 8px; background: none; color: var(--sb-icon); cursor: pointer; padding: 0; font-weight: 700; font-size: 13px; min-height: 0; }
.sidebar .sb-i:hover { background: var(--sb-hover); color: var(--sb-strong); }
.sb-close { display: none !important; }
.sb-appbtn { grid-column: 1 / -1; grid-row: 2; justify-self: start; display: inline-flex; align-items: center; margin-left: 34px; padding: 2px 8px; color: var(--sb-muted); font: 500 13px/1.4 var(--font); }
.sb-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px 16px; scrollbar-width: thin; scrollbar-color: var(--sb-border) transparent; }
.sidebar .sb-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; margin: 2px 0; padding: 0 12px; border: 0; border-radius: 8px; background: none;
  color: var(--sb-ink); font: 500 14.5px/1.3 var(--font); text-align: left; cursor: pointer; position: relative; }
.sidebar .sb-row .ic { width: 20px; height: 20px; color: var(--sb-icon); }
.sidebar .sb-row:hover, .sidebar .sb-child:hover { background: var(--sb-hover); color: var(--sb-strong); }
.sb-label { min-width: 0; }
.sb-chev { margin-left: auto; display: grid; color: var(--sb-icon); transition: transform .15s; }
.sidebar .sb-chev .ic { width: 16px; height: 16px; }
.sb-grp.open > .sb-grp-btn .sb-chev { transform: rotate(90deg); }
.sidebar .sb-grp.has-active > .sb-grp-btn, .sidebar .sb-grp.has-active > .sb-grp-btn .ic { color: var(--sb-group-on); }
.sidebar .sb-grp.has-active > .sb-grp-btn { font-weight: 600; }
.sb-items { display: none; padding: 0 0 4px 21px; }
.sb-grp.open > .sb-items { display: block; }
.sb-node { position: relative; padding-left: 18px; }
.sb-node::before { content: ""; position: absolute; left: 0; top: 0; width: 12px; height: 50%; border-left: 1px solid var(--sb-line); border-bottom: 1px solid var(--sb-line); }
.sb-node:not(:last-child)::after { content: ""; position: absolute; left: 0; top: 50%; bottom: 0; border-left: 1px solid var(--sb-line); }
.sb-node.on::before { border-color: var(--sb-active); }
.sidebar .sb-child { display: flex; align-items: center; gap: 8px; min-height: 36px; margin: 1px 0; padding: 0 12px; border-radius: 8px; font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--sb-ink); position: relative; }
.sidebar .sb-link.active, .sidebar .sb-link.active:hover { background: var(--sb-active); color: var(--sb-active-ink); font-weight: 600; }
.sidebar .sb-row.active .ic { color: var(--sb-active-ink); }
.sidebar .sb-link.soon { opacity: .5; pointer-events: none; }
.sb-foot { border-top: 1px solid var(--sb-border); padding: 8px 12px 10px; }
.sb-tools { display: flex; align-items: center; gap: 4px; }
.sidebar .sb-lang { width: auto; min-width: 32px; padding: 0 8px; font-size: 12px; letter-spacing: .04em; }
.sb-user { margin-top: 4px; }
.sb-me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: 0; border-radius: 8px; background: none; color: var(--sb-ink); cursor: pointer; text-align: left; }
.sb-me:hover, .sb-me[aria-expanded="true"] { background: var(--sb-hover); }
.sb-av { width: 32px; height: 32px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; font-size: 12px; display: grid; place-items: center; flex: none; }
.sb-who { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.sb-who strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--sb-strong); }
.sb-co { font-size: 12px; color: var(--sb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.umenu { position: relative; flex: none; }
.umenu-pop { position: absolute; left: 0; bottom: calc(100% + 6px); color: var(--ink); min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 6px; z-index: 40; }
.umenu-who { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; overflow-wrap: anywhere; }
.umenu-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.umenu-pop button:hover, .umenu-pop button:focus-visible { background: var(--hover); outline: none; }
.umenu-pop button.danger { color: var(--err); }
@media (min-width: 900px) {
  .sidebar.rail { width: 64px; }
  .sidebar.rail .sb-word, .sidebar.rail .sb-chev, .sidebar.rail .sb-items, .sidebar.rail .sb-appbtn { display: none; }
  .sidebar.rail .sb-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sidebar.rail .sb-head { grid-template-columns: 1fr; justify-items: center; row-gap: 6px; padding: 14px 0 4px; }
  .sidebar.rail .sb-collapse { grid-column: 1; grid-row: 2; }
  .sidebar.rail .sb-nav { padding: 4px 10px 12px; scrollbar-width: none; }
  .sidebar.rail .sb-row { justify-content: center; padding: 0; gap: 0; }
  .sidebar.rail .sb-grp.has-active > .sb-grp-btn { background: var(--sb-active); color: var(--sb-active-ink); }
  .sidebar.rail .sb-grp.has-active > .sb-grp-btn .ic { color: var(--sb-active-ink); }
  .sidebar.rail .sb-foot { padding: 8px 6px 10px; }
  .sidebar.rail .sb-tools { flex-direction: column; }
  .sidebar.rail .sb-me { justify-content: center; padding: 6px 0; }
}
/* Màn hẹp: thanh mỏng nền sáng + menu trượt */
.mbar { display: none; height: 48px; align-items: center; gap: 4px; padding: 0 8px 0 4px; background: var(--sb-bg); color: var(--ink); border-bottom: 1px solid var(--sb-border); flex: none; }
.mbar a { text-decoration: none; color: inherit; }
:root[data-theme="dark"] .mbar a { color: inherit; }
.mbar .mb-i { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--sb-icon); cursor: pointer; padding: 0; font-weight: 700; font-size: 16px; flex: none; }
.mbar .mb-i:hover { background: var(--sb-hover); color: var(--ink); }
.mbar .mb-i .ic { width: 22px; height: 22px; }
.mbar .mb-lang { font-size: 12px; letter-spacing: .04em; }
.mb-name { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-name img { width: 24px; height: 24px; border-radius: 5px; flex: none; }
.sb-backdrop { position: fixed; inset: 0; z-index: 55; background: var(--overlay); }
@media (max-width: 899px) {
  .shell { flex-direction: column; }
  .mbar { display: flex; }
  .sidebar { position: fixed; top: var(--dev-banner, 0px); bottom: 0; left: 0; z-index: 60; width: min(300px, 86vw); transform: translateX(-100%); visibility: hidden; border-right: 0;
    transition: transform .18s ease, visibility 0s linear .18s; }
  .sidebar.open { transform: none; visibility: visible; transition: transform .18s ease; box-shadow: var(--shadow-pop); }
  .sb-close { display: grid !important; }
  .sb-collapse { display: none !important; }
  body.sb-open { overflow: hidden; }
}
@media (max-width: 760px) {
  .shell { display: block; min-height: 0; }
  .shell-body { display: block; }
  .mbar { position: sticky; top: var(--dev-banner, 0px); z-index: 30; }
}

/* ---- Vùng nội dung + hàng tiêu đề kiểu control panel (Odoo): một hàng trắng sát đầu, dính khi cuộn ---- */
.main { padding: 16px 16px 24px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 8px 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0; flex: 1; letter-spacing: -.01em; }
.main > .page-head { position: sticky; top: -16px; z-index: 20; margin: -16px -16px 16px; padding: 8px 16px; min-height: 49px; background: var(--surface); border-bottom: 1px solid var(--line); }
.main > .page-head h1 { font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: 0; min-width: 0; overflow-wrap: anywhere; }
.main > .page-head h1 .badge { vertical-align: 2px; }
.main > .page-head h1 a, :root[data-theme="dark"] .main > .page-head h1 a { color: var(--brand); font-weight: 500; text-decoration: none; }
.main > .page-head h1 a:hover { text-decoration: underline; }
.main > .page-head .btn { min-height: 32px; padding: 4px 12px; }
.main > .page-head > .muted { font-size: 13px; }
.main > .page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Nút "‹ Màn trước" đầu hàng = breadcrumb kiểu Odoo: chữ xanh + dấu "/" */
.main > .page-head > a.btn.small:first-child { border: 0; background: none; padding: 0; min-height: 0; font-size: 18px; line-height: 24px; font-weight: 500; color: var(--brand); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.main > .page-head > a.btn.small:first-child::after { content: "/"; color: var(--muted); font-weight: 400; }
.main > .page-head > a.btn.small:first-child:hover { text-decoration: underline; background: none; }
.main > .page-head > a.btn.small:first-child + h1 { flex: 1 1 0; }
.main > .page-head + p.muted { margin: -4px 0 12px; font-size: 13px; }
.main > .msg:first-child { margin-top: 0; }

/* ---- Thành phần ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card h2 { font-size: 17px; }
.card h3 { font-size: 15px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.btn { border: 1px solid var(--btn-border); background: var(--surface); padding: 5px 12px; min-height: 32px; border-radius: var(--radius-btn); cursor: pointer; font-weight: 500; transition: border-color .1s, background .1s; text-decoration: none; color: var(--ink); }
a.btn { display: inline-flex; align-items: center; justify-content: center; }
:root[data-theme="dark"] a.btn { color: var(--ink); }
.btn:hover { border-color: var(--brand); background: var(--hover); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
:root[data-theme="dark"] a.btn.primary { color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.mint { background: var(--ok); border-color: var(--ok); color: var(--on-ok); font-weight: 600; }   /* nút xác nhận tích cực */
.btn.mint:hover { background: var(--ok-text); border-color: var(--ok-text); }
.btn.danger { background: var(--err); border-color: var(--err); color: var(--on-err); font-weight: 600; }
.btn.danger:hover { background: var(--err-strong); border-color: var(--err-strong); }
.btn.small { padding: 3px 10px; font-size: 13px; min-height: 28px; }
.btn.icon { padding: 4px 9px; min-height: 32px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--btn-border); background: var(--surface); }
.btn.primary:disabled:hover { background: var(--brand); border-color: var(--brand); }
input[type=file] { font-size: 13px; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 500; color: var(--ink); background: var(--surface); border: 1px solid var(--btn-border); border-radius: var(--radius-btn); padding: 5px 12px; min-height: 32px; margin-right: 10px; cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--brand); background: var(--hover); }
textarea:disabled, input:disabled { opacity: .6; cursor: not-allowed; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  border: 1px solid var(--btn-border); border-radius: var(--radius-btn); padding: 5px 10px; min-height: 32px; background: var(--surface); min-width: 0; transition: border-color .1s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.login-card input[type=email], .login-card input[type=password], .login-card input[type=text] { min-height: 36px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--muted); }
.field .req { color: var(--brand); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }

/* Bảng danh sách kiểu Odoo — dòng gọn, tiêu đề chữ thường đậm, kẻ dòng nhạt, số căn phải, rê chuột đổi nền */
table.data { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 13px; }
table.data th, table.data td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data th { font-size: 13px; line-height: 1.35; color: var(--ink); background: var(--surface); position: sticky; top: 0; z-index: 1; font-weight: 700; border-bottom: 2px solid var(--line); }
table.data th.num { text-align: right; }
table.data tbody tr { transition: background .1s; }
table.data tbody tr:hover td { background: var(--hover); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td a { text-decoration: none; }
table.data td a:hover { text-decoration: underline; }
table.data td a b { white-space: nowrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.pager { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 10px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
/* Trạng thái rỗng thân thiện: biểu tượng nhẹ + chữ giải thích */
.empty { padding: 28px 20px; text-align: center; color: var(--muted); line-height: 1.6; }
.table-wrap > .empty::before, .main > .empty::before, .card > .empty::before { content: ""; display: block; width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 10px;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a87a0' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7.5L12 3l9 4.5v9L12 21l-9-4.5zM3 7.5l9 4.5 9-4.5M12 12v9'/%3E%3C/svg%3E") center / 22px no-repeat; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 11px; font-size: 12px; line-height: 18px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.shopee { background: var(--shopee-soft); color: var(--shopee-dark); }
.badge.tiktok { background: var(--tiktok-mint-soft); color: var(--tiktok-mint-text); }
.badge.ok { background: var(--ok-soft); color: var(--ok-text); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.new { background: var(--accent-soft); color: var(--accent-text); }
.badge.info { background: var(--brand-soft); color: var(--brand-dark); }

.msg { padding: 9px 13px; border-radius: var(--radius-btn); margin-bottom: 12px; line-height: 1.55; }
.msg:not(.err):not(.ok):not(.info):not(.warn) { background: var(--surface); border-left: 3px solid var(--brand); }   /* .msg trơn = hộp gợi ý */
.msg.err { background: var(--err-soft); color: var(--err); }
.msg.ok { background: var(--ok-soft); color: var(--ok-text); }
.msg.info { background: var(--brand-soft); color: var(--brand-dark); }
.msg.warn { background: var(--warn-soft); color: var(--ink); border-left: 3px solid var(--warn); }
.msg ul { margin: 6px 0 0; padding-left: 18px; }

.modal-bg { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); width: 100%; max-width: 560px; box-shadow: var(--shadow-pop); }
.modal header { padding: 15px 20px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; }
.modal header .x { margin-left: auto; cursor: pointer; border: 0; background: none; font-size: 18px; color: var(--muted); }
.modal .body { padding: 18px 20px; }
.modal footer { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.modal.confirm { max-width: 480px; }
.modal.confirm .body p { margin: 0 0 8px; line-height: 1.5; }
.modal.confirm .body p:last-child { margin-bottom: 0; }
.modal.confirm .body ul { margin: 4px 0 8px; padding-left: 20px; line-height: 1.5; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; z-index: 60; max-width: calc(100vw - 32px); }
.toast { padding: 10px 15px; border-radius: var(--radius-btn); color: var(--toast-ink); background: var(--toast-bg); border: 1px solid var(--toast-bg); z-index: 60; box-shadow: var(--shadow-pop); }
.toast.err { background: var(--err); border-color: var(--err); color: var(--on-err); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: thin; }
.tabs a { padding: 9px 15px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; flex: 0 0 auto; white-space: nowrap; }
:root[data-theme="dark"] .tabs a { color: var(--muted); }
.tabs a:hover { color: var(--ink); }
.tabs a.active, :root[data-theme="dark"] .tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.chip { border: 1px solid var(--btn-border); background: var(--surface); color: var(--muted); padding: 4px 12px; min-height: 30px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--ink); }
.chip.on { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand); }

/* Tổng quan cửa hàng trong hệ thống (#/overview/<id>) */
.filters { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; margin-bottom: 16px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.filters input, .filters select { min-width: 150px; }
.kpi-wrap { display: grid; gap: 14px; margin-bottom: 18px; }
.kpi-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; border-top: 3px solid var(--line); box-shadow: var(--shadow); }
.kpi-group.total { border-top-color: var(--brand); }
.kpi-group.shopee { border-top-color: var(--shopee); }          /* vạch màu sàn = màu dữ liệu */
.kpi-group.tiktok { border-top-color: var(--tiktok-mint-dark); }
.kpi-group h3 { margin: 0 0 10px; font-size: 15px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0; overflow-wrap: anywhere; letter-spacing: -.01em; }
.kpi-sub { font-size: 12px; }
.delta { font-weight: 600; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--err); }
.delta.up::before { content: "▲ "; font-size: .8em; }
.delta.down::before { content: "▼ "; font-size: .8em; }
.note { font-size: 12px; margin: 10px 0 0; }
.seg { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.chart { margin-bottom: 12px; }
.chart svg { width: 100%; height: 180px; display: block; background: var(--surface-2); border-radius: var(--radius); }
.chart-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Hỏi đáp */
.chat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-height: 240px; max-height: 60vh; overflow-y: auto; margin-bottom: 10px; box-shadow: var(--shadow); }
.chat-msg { display: flex; flex-direction: column; margin-bottom: 12px; }
.chat-msg.user { align-items: flex-end; }
.chat-bubble { max-width: 85%; padding: 9px 13px; border-radius: 12px; overflow-wrap: anywhere; }
.chat-msg.user .chat-bubble { background: var(--brand-soft); color: var(--ink); border-bottom-right-radius: 4px; }
.chat-msg.assistant .chat-bubble { background: var(--surface-2); border-bottom-left-radius: 4px; }
.chat-msg.pending .chat-bubble { color: var(--muted); font-style: italic; }
.chat-bubble p { margin: 4px 0; }
.chat-bubble .table-wrap { margin: 6px 0; }
.chat-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { flex: 1; resize: vertical; }

@media (max-width: 760px) {
  .main { padding: 12px 12px 20px; }
  .main > .page-head { position: static; margin: -12px -12px 12px; padding: 8px 12px; }
  .main > .page-head > a.btn.small:first-child, .main > .page-head h1 { font-size: 16px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .toolbar > input, .toolbar > select { flex: 1 1 150px; min-width: 0 !important; }
  .filters input, .filters select { min-width: 0; width: 100%; }
  .filters label { flex: 1 1 140px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 19px; }
  .kv { grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); }
  .chat-bubble { max-width: 100%; }
  table.data td, table.data th { white-space: nowrap; }
}

/* ---- Khung cố định: menu + hàng tiêu đề đứng yên, chỉ vùng dữ liệu cuộn (desktop) ---- */
@media (min-width: 761px) {
  html, body { height: 100%; }
  body { overflow: hidden; }
  #app { height: 100%; display: flex; flex-direction: column; }
  .shell { flex: 1 1 auto; min-height: 0; }
  .main { flex: 1; min-height: 0; overflow-y: auto; }
  .table-wrap.fit { overflow: auto; }
  .table-wrap.fit table.data th { box-shadow: 0 1px 0 var(--line); }
}

/* Bảo mật tài khoản */
.security-grid { display: grid; gap: 18px; }
.security-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.security-card-head h2 { font-size: 17px; margin: 0 0 4px; }
.security-card-head p { margin: 0; }
.security-grid > * { min-width: 0; }
/* GMV-16: màn bắt buộc bật xác thực 2 lớp (admin) + lời nhắc nhẹ */
.mfa-required { max-width: 760px; }
.mfa-required > p:first-child { margin-top: 0; line-height: 1.6; }
.mfa-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 16px 0; }
.mfa-choice { border-top: 1px solid var(--line); padding: 14px 0 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.mfa-choice h2 { font-size: 16px; margin: 0; }
.mfa-choice p { margin: 0; flex: 1 1 auto; }
.mfa-req-foot { margin: 0; font-size: 13px; }
.mfa-nudge { padding: 12px 16px 0; }
.mfa-nudge .msg { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin: 0; }
.mfa-nudge-act { display: inline-flex; gap: 8px; flex-wrap: wrap; }   /* thẻ có bảng rộng: bảng cuộn trong khung, không đẩy trang tràn ngang (GMV-16) */
.mfa-qr { display: flex; justify-content: center; margin: 4px 0 18px; }
.mfa-qr img { display: block; width: 220px; height: 220px; max-width: 100%; border-radius: var(--radius); background: var(--paper); padding: 8px; }
.mfa-secret { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }

/* Kết nối TikTok Shop */
.tt-conn { margin-bottom: 16px; }
.tt-conn-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.tt-conn-head h2 { margin: 0 0 4px; font-size: 17px; }
.tt-conn-head .tt-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tt-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 18px; margin: 8px 0 10px; font-size: 13px; }
.tt-meta .warn-text { color: var(--warn); font-weight: 600; }

/* Kho & giá vốn */
.inv-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.inv-tile { display: flex; flex-direction: column; gap: 2px; text-align: left; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer; font: inherit; transition: border-color .12s, background .12s; }
.inv-tile:hover { border-color: var(--brand); background: var(--hover); }
.inv-tile:focus-visible, .inv-fchip:focus-visible, .inv-opt:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.inv-tile .kpi-value { font-size: clamp(16px, 1.55vw, 21px); white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 1200px) { .inv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.inv-note { margin: 4px 0 16px; line-height: 1.5; }
.inv-cov { display: inline-block; margin-top: 2px; }
.inv-dash { cursor: help; }
.inv-sub { font-size: 12px; }
.inv-sub-p { font-size: 12px; margin: -4px 0 8px; }
.inv-warn { color: var(--warn); font-weight: 600; }
.inv-chip { white-space: nowrap; }
.inv-name { display: inline-block; min-width: 140px; max-width: 260px; }
.inv-title { display: inline-block; max-width: 280px; overflow-wrap: anywhere; }
.num-strong { font-weight: 700; }
.inv-grow { flex: 1 1 280px; align-self: center; font-size: 13px; }
.inv-fchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.inv-fchip { border: 1px solid var(--btn-border); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 4px 12px; min-height: 30px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
.inv-fchip:hover { border-color: var(--brand); color: var(--ink); }
.inv-fchip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.inv-empty { text-align: center; max-width: 640px; margin: 24px auto; }
.inv-empty .toolbar { justify-content: center; margin-bottom: 0; }
.inv-actions { display: flex; gap: 6px; flex-wrap: nowrap; }
.inv-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.inv-steps h3 { margin-top: 0; display: flex; align-items: center; gap: 8px; }
.inv-n { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; background: var(--brand); color: var(--on-brand); font-size: 13px; font-weight: 700; }
.inv-export { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 18px; }
.inv-changes { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.inv-kv { background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; min-width: 0; overflow-wrap: anywhere; }
.inv-kv .kpi-value { font-size: 20px; }
.inv-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.inv-pick { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.inv-opt { display: flex; gap: 8px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: 8px 12px; cursor: pointer; font: inherit; }
.inv-opt:hover { background: var(--hover); }
.inv-opt.on { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.inv-opt span { color: var(--muted); }
/* Biểu đồ tồn / bán: cột = số bán (mint TikTok — số bán theo SKU lấy từ TikTok), đường = tồn kho (xanh thương hiệu) */
.inv-bar { fill: var(--tiktok-mint-dark); }
.inv-line { fill: none; stroke: var(--brand); stroke-width: 2.2; }
.inv-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.inv-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.inv-sw.bar { background: var(--tiktok-mint-dark); }
.inv-sw.line { background: var(--brand); height: 3px; vertical-align: 3px; }
.inv-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inv-chart .inv-panel + .inv-panel { margin-top: 8px; }
.inv-panel-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 2px; }
.inv-chart svg { height: 72px; }
.inv-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
.inv-axis { stroke: var(--line); stroke-width: 1; }
.inv-dot { stroke-width: 5; stroke-linecap: round; }
.inv-hit { fill: transparent; }
.inv-hit:hover { fill: var(--hover); fill-opacity: .5; }
.inv-ro { margin: 0 0 12px; }
.drawer-bg { position: fixed; inset: 0; background: var(--overlay); z-index: 45; display: flex; justify-content: flex-end; }
.drawer { background: var(--surface); width: min(760px, 100%); height: 100%; overflow-y: auto; box-shadow: var(--shadow-pop); border-left: 1px solid var(--line); }
.drawer-body { padding: 20px 22px 32px; }
.drawer-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.drawer-head h2 { margin: 0 0 4px; font-size: 20px; overflow-wrap: anywhere; }
.drawer-status { margin: 8px 0; }
@media (max-width: 760px) {
  .inv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-tile { padding: 12px; }
  .inv-tile .kpi-value { font-size: 17px; }
  .inv-steps { grid-template-columns: 1fr; }
  .inv-mini { grid-template-columns: 1fr; }
  .drawer-body { padding: 16px; }
}
#invBody .badge, #invBody table .btn { white-space: nowrap; }
#invBody td:first-child a { white-space: nowrap; }
.inv-kv .kpi-label, .inv-kv .kpi-value { display: block; }
#invTabs { overflow-x: auto; white-space: nowrap; }
#invTabs a { flex: none; }

/* ---- Tổng quan nhúng (overview.html trong khung hệ thống) ---- */
.main.ov { padding: 0; overflow: hidden; display: flex; }
.ov-frame { display: block; flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: var(--bg); }
@media (max-width: 760px) {
  .main.ov { display: block; padding: 0; }
  .ov-frame { height: calc(100dvh - var(--dev-banner, 0px) - 48px); }
}
.modal .msg, .login-card .msg { overflow-wrap: anywhere; }   /* GMV-14: email / link dài không tràn khung trên điện thoại */
