/* Giao diện VMS dựng lại theo docs/MOCKUP-ODOO-STYLE.html (PLAN-UI-MOI.md, R1).
   Token khai ở đây. Sáng là mặc định; tối là html.dark, do public/js/theme.js đặt.
   Quy tắc chữ (docs/DESIGN.md mục 1): chỉ 5 cỡ --fs-* (một ngoại lệ --fs-title cho .ofm-h1), chỉ độ đậm 400, 600, 700; chiều cao dòng chỉ lấy từ --lh-*.
   Quy tắc khoảng cách và kích thước (docs/DESIGN.md mục 8e): padding, margin, gap chỉ lấy từ --sp-* (lưới 4px);
   chiều cao chỉ lấy từ --ctl* hoặc --h-*. Không viết px thô ở các thuộc tính đó (test/spacing-scale.test.ts). */
:root {
  --bg: #ffffff; --bg2: #f8f9fa; --bg3: #f1f3f5; --line: #dee2e6;
  --ink: #212529; --muted: #5f666d;
  --primary: #714B67; --outline: var(--primary); --action: #017e84; --sel: #e9f3f4; --btn2: #e7e9ed;
  --ok: #155724; --ok-bg: #d4edda; --info: #055160; --info-bg: #d1ecf1;
  --warn: #664d03; --warn-bg: #fff3cd; --danger: #b02a37; --danger-bg: #f8d7da;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, "Noto Sans", Arial, sans-serif;
  --mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --r: 4px;
  /* Cỡ chữ: 5 cỡ (DESIGN mục 1). */
  --fs-xl: 22px; --fs-lg: 16px; --fs-base: 14px; --fs-label: 13px; --fs-sm: 12px;
  /* Chiều cao dòng theo lưới 4px (DESIGN mục 1). */
  --lh-sm: 16px; --lh-label: 20px; --lh-base: 20px; --lh-lg: 24px; --lh-xl: 28px;
  /* Ngoại lệ duy nhất: tiêu đề trang RFQ giống Odoo (.ofm-h1, DESIGN mục 1). */
  --fs-title: 34px; --lh-title: 40px;
  /* Khoảng cách: lưới 4px, tên theo giá trị (DESIGN mục 8e). */
  --sp-4: 4px; --sp-8: 8px; --sp-12: 12px; --sp-16: 16px; --sp-24: 24px; --sp-32: 32px; --sp-40: 40px;
  /* Chiều cao điều khiển: nút, ô nhập, ô tìm, ô chọn (giữ theo mẫu, DESIGN mục 8e). */
  --ctl-sm: 24px; --ctl: 30px; --ctl-lg: 36px;
  /* Chiều cao khác. */
  --h-step: 32px; --h-stat: 36px; --h-nav: 46px; --h-wnav: 56px; --h-logo: 32px; --h-av: 28px;
  --h-frame: 360px; --h-drop: 96px; --h-log: 256px; --h-tile: 56px; --h-bar: 14px; --h-mini: 8px;
  /* Chiều rộng cố định: hộp thoại, cột nhãn của trường thông tin, thẻ thống kê tối thiểu, thẻ kanban tối thiểu, báo cáo (nhãn, số, thanh nhỏ, số lớn). */
  --w-dialog: 560px; --w-bell: 360px; --w-label: 152px; --w-stat: 104px; --w-kcard: 288px; --w-rlabel: 200px; --w-rvalue: 80px; --w-mini: 96px; --w-num: 44px;
  /* Màu biểu đồ: xám làm nền và đỏ nhạt; đỏ đậm là --danger, màu nhấn là --action. */
  --chart-ctx: #7b9196; --chart-hot-dim: #d47373;
  color-scheme: light;
}
html.dark {
  --bg: #1c1f24; --bg2: #23272d; --bg3: #2a2f36; --line: #3a3f46;
  --ink: #e9ecef; --muted: #9aa2ab; --action: #4cc3c8; --outline: #c9a7bc; --sel: #233a3d; --btn2: #343a40;
  --ok: #28a745; --info: #17a2b8; --warn: #ffac00; --danger: #ff7d88;
  --ok-bg: #16301f; --info-bg: #123038; --warn-bg: #3a2f0e; --danger-bg: #3d1519;
  --chart-ctx: #6f8c93; --chart-hot-dim: #b8636a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--fs-base); line-height: var(--lh-base); }
a { color: var(--action); text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--font); font-weight: 600; }
code, pre { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }

/* Thanh trên: khung quản trị (od-nav) và cổng NCC (od-wnav). Menu thả xuống mở bằng :hover và :focus-within. */
.od-nav, .od-wnav {
  position: relative; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4);
  min-height: var(--h-nav); padding: 0 var(--sp-12); background: var(--bg2); border-bottom: 1px solid var(--line);
}
.od-wnav { min-height: var(--h-wnav); padding: 0 var(--sp-24); gap: var(--sp-8); background: var(--bg); }
.od-nav-main, .od-nav-end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); }
.od-nav-end { margin-left: auto; gap: var(--sp-12); color: var(--muted); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.od-brand { display: inline-flex; align-items: center; gap: var(--sp-8); margin: 0 var(--sp-12) 0 var(--sp-4); font-weight: 600; color: var(--ink); }
.od-brand img { width: var(--h-logo); height: var(--h-logo); }
.od-menu {
  position: relative; display: inline-flex; align-items: center; gap: var(--sp-8); padding: var(--sp-8) var(--sp-12);
  border: 0; border-radius: var(--r); background: none; color: var(--ink); font: inherit; white-space: nowrap; cursor: pointer;
}
.od-menu:hover { background: var(--sel); }
.od-menu.on { font-weight: 600; background: var(--sel); }
.od-dd {
  display: none; position: absolute; top: 100%; left: 0; z-index: 40; min-width: 220px; padding: var(--sp-8);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); font-weight: 400;
}
.od-dd-r { left: auto; right: 0; }
.od-has:hover > .od-dd, .od-has:focus-within > .od-dd { display: block; }
.od-dd a, .od-dd button {
  display: block; width: 100%; padding: var(--sp-8) var(--sp-12); border: 0; border-radius: var(--r); background: none;
  color: var(--ink); font: inherit; text-align: left; white-space: nowrap; cursor: pointer;
}
.od-dd a:hover, .od-dd button:hover { background: var(--sel); }
.od-dd form { margin: 0; }
.od-dd-hd { display: block; padding: var(--sp-8) var(--sp-12) var(--sp-4); color: var(--muted); font-size: var(--fs-sm); line-height: var(--lh-sm); }
@media (max-width: 1100px) {
  /* Thanh xuống dòng: menu thả neo vào thanh, không neo vào mục, để không tràn ngang trang. */
  .od-nav .od-menu, .od-wnav .od-menu { position: static; }
  .od-dd { max-width: calc(100vw - 32px); }
}

.od-n {
  display: inline-block; padding: 0 var(--sp-8); border-radius: 9999px; background: var(--danger); color: var(--bg);
  font-size: var(--fs-sm); font-weight: 700; line-height: var(--lh-sm);
}
.od-lost {
  display: inline-flex; align-items: center; gap: var(--sp-8); padding: var(--sp-4) var(--sp-12); border-radius: 9999px;
  background: var(--danger-bg); color: var(--danger); font-size: var(--fs-sm); font-weight: 600; line-height: var(--lh-sm);
}
.od-lost::before { content: ""; width: var(--sp-8); height: var(--sp-8); border-radius: 50%; background: var(--danger); }
.od-inst { padding: var(--sp-4) var(--sp-8); border: 1px solid var(--line); border-radius: var(--r); font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--muted); }
.od-av {
  display: grid; place-items: center; width: var(--h-av); height: var(--h-av); border-radius: 50%;
  background: var(--primary); color: #fff; font-size: var(--fs-sm); font-weight: 600; line-height: var(--lh-sm);
}
/* Chuông thông báo (DESIGN mục 8, od-bell.ejs): nút có số đỏ; bấm mở danh sách; thông báo chưa đọc đậm, đã đọc mờ. */
.od-bell { padding: 0; }
.od-bell-btn { position: relative; display: inline-flex; align-items: center; padding: var(--sp-8) var(--sp-12); border: 0; border-radius: var(--r); background: none; color: var(--muted); cursor: pointer; }
.od-bell-btn:hover { background: var(--sel); color: var(--ink); }
.od-bell-n { position: absolute; top: 0; right: 0; }
.od-bell.open > .od-dd { display: block; }
.od-bell-dd { width: var(--w-bell); max-width: calc(100vw - 32px); padding: 0; }
.od-bell-hd { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); padding: var(--sp-8) var(--sp-12); border-bottom: 1px solid var(--line); color: var(--ink); }
.od-bell-dd .od-bell-all { width: auto; padding: 0; color: var(--action); font-size: var(--fs-sm); line-height: var(--lh-sm); white-space: nowrap; }
.od-bell-dd .od-bell-all:hover { background: none; text-decoration: underline; }
.od-bell-list { display: block; max-height: 60vh; overflow-y: auto; }
.od-bell-dd a.od-bell-item { display: block; padding: var(--sp-8) var(--sp-12); border-bottom: 1px solid var(--line); border-radius: 0; white-space: normal; }
.od-bell-item b { display: block; font-weight: 600; }
.od-bell-item.read { color: var(--muted); }
.od-bell-item.read b { font-weight: 400; }
.od-bell-item small { display: block; color: var(--muted); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.od-bell-empty { display: block; padding: var(--sp-16) var(--sp-12); color: var(--muted); }
.od-company { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--muted); }

/* Trang trong khung: đầu trang, thanh bước và các bộ thành phần (DESIGN mục 8e). */
.od-main { min-width: 0; max-width: 1440px; margin: 0 auto; padding: var(--sp-16); }
.od-cp {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-12);
  padding: var(--sp-12) 0; border-bottom: 1px solid var(--line);
}
/* Dòng 1 của chứng từ: đường dẫn bên trái, thẻ thống kê giữa trang (DESIGN mục 8e, theo Odoo 19). */
.od-cp-form { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.od-cp-form .od-statbox { justify-self: center; }
.od-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); font-size: var(--fs-lg); line-height: var(--lh-lg); }
.od-sep, .od-hint { color: var(--muted); }
.od-hint { font-size: var(--fs-sm); line-height: var(--lh-sm); }
/* Dòng hành động của chứng từ: nút bên trái, thanh bước bên phải (mẫu .bar). */
.od-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-12);
  padding: var(--sp-8) 0; border-bottom: 1px solid var(--line);
}
.od-bar-start { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); }

.od-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-8); height: var(--ctl); padding: 0 var(--sp-12);
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bg3); color: var(--ink);
  font: inherit; white-space: nowrap; text-decoration: none; cursor: pointer;
}
.od-btn:hover { filter: brightness(0.96); }
.od-btn:disabled { opacity: 0.5; pointer-events: none; }
.od-btn-primary { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 600; }
.od-btn-outline { border-color: var(--outline); background: var(--bg); color: var(--outline); }
.od-btn-sm { height: var(--ctl-sm); padding: 0 var(--sp-8); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.od-btn-lg { height: var(--ctl-lg); padding: 0 var(--sp-24); }
.od-btn-block { width: 100%; }

/* Khung khách (od-guest): 404 và đăng nhập. */
.od-guest { display: grid; place-items: center; min-height: 100vh; padding: var(--sp-32) var(--sp-16); background: var(--bg3); }
.od-guest-card {
  width: min(380px, 100%); padding: var(--sp-24); background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.od-guest-logo { display: flex; justify-content: center; margin-bottom: var(--sp-16); }
.od-guest-logo img { width: var(--h-logo); height: var(--h-logo); }
.od-guest-card h1 { margin-bottom: var(--sp-8); font-size: var(--fs-lg); line-height: var(--lh-lg); }
.od-guest-card p { margin: 0 0 var(--sp-16); }

/* Bộ thành phần danh sách và chứng từ (PLAN-UI-MOI.md R2). Chữ: chỉ --fs-*; độ đậm 400, 600, 700. */
.od-search-wrap { position: relative; flex: 1 1 360px; min-width: 0; max-width: 680px; }
.od-search {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); min-height: var(--ctl); padding: 0 var(--sp-12);
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bg);
}
.od-search:focus-within { border-color: var(--action); }
.od-search-input {
  flex: 1 1 140px; min-width: 90px; padding: 0; border: 0; outline: 0; background: transparent;
  color: var(--ink); font: inherit; font-size: var(--fs-base); line-height: var(--lh-base);
}
.od-facet {
  display: inline-flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) var(--sp-8); border-radius: var(--r);
  background: var(--sel); color: var(--ink); font-size: var(--fs-sm); line-height: var(--lh-sm); text-decoration: none; white-space: nowrap;
}
.od-facet:hover { filter: brightness(0.97); }
.od-sr-only { position: absolute; width: var(--sp-4); height: var(--sp-4); overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.od-count { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--muted); }
.od-muted { color: var(--muted); }
.od-pad { padding: var(--sp-16); }
.od-cp-end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-12); margin-left: auto; }
.od-panel { position: relative; }
.od-panel > summary { display: inline-block; padding: var(--sp-4) var(--sp-8); border-radius: var(--r); color: var(--muted); cursor: pointer; list-style: none; }
.od-panel > summary::-webkit-details-marker { display: none; }
.od-panel > summary:hover { background: var(--sel); }
.od-panel-body {
  position: absolute; top: calc(100% + var(--sp-4)); left: 0; z-index: 40; display: flex; flex-wrap: wrap; gap: var(--sp-16);
  min-width: 240px; padding: var(--sp-12) var(--sp-16); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.od-panel-col { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 150px; }
.od-panel-title { padding-bottom: var(--sp-4); font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--muted); }
.od-panel-item {
  display: flex; align-items: center; gap: var(--sp-8); padding: var(--sp-4) var(--sp-8); border-radius: var(--r);
  color: var(--ink); text-decoration: none; white-space: nowrap; cursor: pointer;
}
.od-panel-item:hover { background: var(--sel); }
.od-panel-item.on { font-weight: 600; }
/* Phân trang kiểu mẫu span.pg: ‹ và › không viền, nhãn ở giữa. */
.od-pager { display: flex; align-items: center; gap: var(--sp-8); }
.od-pager-btn {
  display: inline-grid; place-items: center; min-width: var(--ctl); height: var(--ctl); border: 0; border-radius: var(--r);
  background: none; color: var(--ink); font-size: var(--fs-lg); line-height: var(--lh-lg); text-decoration: none; cursor: pointer;
}
.od-pager-btn.od-off { color: var(--muted); opacity: 0.5; cursor: default; }
.od-note { margin: 0; padding: var(--sp-12) 0 0; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--muted); }
.od-selbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-12);
  margin-top: var(--sp-12); padding: var(--sp-8) var(--sp-12); background: var(--sel); border-radius: var(--r);
}
/* Trang danh sách tràn hết chiều ngang như Odoo: khung giữ lề 16px cho tiêu đề, ghi chú, thẻ, form; riêng bảng (kể cả bảng trong form)
   và thanh điều khiển kéo ra sát hai mép bằng lề âm, bảng không viền thẻ. */
.od-main.od-main-list { max-width: none; padding: 0 var(--sp-16) var(--sp-16); }
.od-main-list > .od-cp, .od-main-list > .od-table-wrap, .od-main-list > form > .od-table-wrap { margin-left: calc(-1 * var(--sp-16)); margin-right: calc(-1 * var(--sp-16)); }
.od-main-list > .od-cp { padding: var(--sp-8) var(--sp-16); }
.od-main-list .od-table-wrap { margin-top: 0; border: 0; border-radius: 0; }
.od-table-wrap { margin-top: var(--sp-12); overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
.od-table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); line-height: var(--lh-base); }
.od-table th {
  padding: var(--sp-8) var(--sp-12); text-align: left; white-space: nowrap; font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 600;
  background: var(--bg); border-bottom: 2px solid var(--line);
}
.od-table td { padding: var(--sp-8) var(--sp-12); border-bottom: 1px solid var(--line); vertical-align: middle; }
.od-table .od-num { text-align: right; font-variant-numeric: tabular-nums; }
.od-table .od-col-cb, .od-table .od-cols-cell { width: 34px; text-align: center; }
.od-table tr.od-row { cursor: pointer; }
.od-table tr.od-row:hover td { background: var(--bg2); }
.od-table tr.od-row.od-sel td { background: var(--sel); }
.od-table tr.od-group td { background: var(--bg2); font-weight: 600; }
.od-table tr.od-empty td { padding: var(--sp-24) var(--sp-12); text-align: center; color: var(--muted); }
.od-table tr.od-tfoot td { border-top: 2px solid var(--line); border-bottom: 0; font-weight: 600; }
.od-sort { color: var(--ink); text-decoration: none; }
.od-sort:hover { color: var(--action); }
.od-link { color: var(--action); text-decoration: none; }
.od-strong { font-weight: 600; }
/* Viên trạng thái cao 20px như mẫu: dòng 20px, không đệm dọc. */
.od-badge { display: inline-block; padding: 0 var(--sp-8); border-radius: 9999px; font-size: var(--fs-sm); font-weight: 600; line-height: var(--lh-base); white-space: nowrap; }
.od-badge-ok { color: var(--ok); background: var(--ok-bg); }
.od-badge-warn { color: var(--warn); background: var(--warn-bg); }
.od-badge-danger { color: var(--danger); background: var(--danger-bg); }
.od-badge-info { color: var(--info); background: var(--info-bg); }
.od-badge-none { color: var(--muted); background: var(--bg3); }
/* Thanh bước giống Odoo (ảnh mẫu RFQ), dùng cho mọi thanh bước trong VMS: mỗi bước có viền đủ bốn cạnh, kể cả mũi tên. Viền là lớp ngoài,
   phần tô là lớp trong thụt 1px; clip-path nằm ở pseudo-element để viền không bị cắt. Bước đang chọn: nền nhạt, viền xanh, chữ thường.
   Các bước ghép sát: mũi tên của bước trước lồng vào khấc 8px của bước sau; đầu trái bước đầu và đầu phải bước cuối phẳng. */
.od-statusbar { display: flex; flex-wrap: wrap; min-height: var(--h-step); margin: 0; padding: 0; list-style: none; }
.od-statusbar li {
  --seg-fill: var(--btn2); --seg-edge: var(--line);
  --seg-outer: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%);
  --seg-inner: polygon(1px 1px, calc(100% - 9px) 1px, calc(100% - 1px) 50%, calc(100% - 9px) calc(100% - 1px), 1px calc(100% - 1px), 9px 50%);
  position: relative; isolation: isolate; display: inline-flex; align-items: center; padding: 0 var(--sp-16) 0 var(--sp-24);
  color: var(--muted); font-size: var(--fs-base); line-height: var(--lh-base); white-space: nowrap;
}
.od-statusbar li::before,
.od-statusbar li::after { content: ""; position: absolute; inset: 0; z-index: -1; }
.od-statusbar li::before { background: var(--seg-edge); clip-path: var(--seg-outer); }
.od-statusbar li::after { background: var(--seg-fill); clip-path: var(--seg-inner); }
.od-statusbar li.now { --seg-fill: var(--sel); --seg-edge: var(--action); color: var(--ink); }
.od-statusbar li + li { margin-left: calc(var(--sp-8) * -1); }
.od-statusbar li:first-child {
  --seg-outer: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%);
  --seg-inner: polygon(1px 1px, calc(100% - 9px) 1px, calc(100% - 1px) 50%, calc(100% - 9px) calc(100% - 1px), 1px calc(100% - 1px));
}
.od-statusbar li:last-child:not(:first-child) {
  --seg-outer: polygon(0 0, 100% 0, 100% 100%, 0 100%, 8px 50%);
  --seg-inner: polygon(1px 1px, calc(100% - 1px) 1px, calc(100% - 1px) calc(100% - 1px), 1px calc(100% - 1px), 9px 50%);
}
.od-statusbar li:only-child {
  --seg-outer: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  --seg-inner: polygon(1px 1px, calc(100% - 1px) 1px, calc(100% - 1px) calc(100% - 1px), 1px calc(100% - 1px));
}
/* Thẻ thống kê kiểu Odoo 19 (DESIGN mục 8e): trên thanh điều khiển của chứng từ, cỡ theo nội dung; nhãn trên, số dưới; nối liền. */
.od-statbox { display: flex; border-radius: var(--r); overflow: hidden; }
.od-stat {
  display: flex; flex: 0 0 auto; flex-direction: column; justify-content: center; min-width: var(--w-stat);
  height: var(--h-stat); padding: 0 var(--sp-12); border: 1px solid var(--line); background: var(--bg); color: var(--ink); text-decoration: none;
}
.od-stat + .od-stat { border-left: 0; }
.od-stat:hover { background: var(--bg2); }
.od-stat:focus-visible { outline: 2px solid var(--action); outline-offset: -2px; }
.od-stat-label { font-size: var(--fs-sm); line-height: var(--lh-sm); }
.od-stat-value { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 600; color: var(--action); }
@media (max-width: 719px) {
  .od-statbox { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .od-cp-form { grid-template-columns: minmax(0, 1fr); }
  .od-cp-form .od-statbox { justify-self: stretch; }
  .od-stat + .od-stat { border-left: 1px solid var(--line); }
  .od-stat:nth-child(even) { border-left: 0; }
  .od-stat:nth-child(n + 3) { border-top: 0; }
  .od-stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* Trường thông tin hai cột (mẫu .fields; DESIGN mục 8e): cột trái và cột phải; mỗi trường là nhãn 13px đậm và giá trị. */
.od-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 var(--sp-40); align-items: start; margin: 0; }
.od-fields-col { display: grid; gap: var(--sp-12); min-width: 0; margin: 0; }
.od-field { display: grid; grid-template-columns: var(--w-label) minmax(0, 1fr); column-gap: var(--sp-12); align-items: start; margin: 0; }
.od-field dt { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 600; color: var(--ink); }
.od-field dd { margin: 0; min-width: 0; font-size: var(--fs-base); line-height: var(--lh-base); overflow-wrap: anywhere; }
@media (max-width: 719px) { .od-fields { grid-template-columns: minmax(0, 1fr); } }
/* Danh sách cặp nhãn và giá trị một cột (thẻ kết quả AI). */
.od-meta { display: grid; grid-template-columns: var(--w-label) minmax(0, 1fr); gap: var(--sp-8) var(--sp-12); margin: 0; }
.od-meta dt { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 600; color: var(--ink); }
.od-meta dd { margin: 0; font-size: var(--fs-base); line-height: var(--lh-base); }
.od-notebook { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--line); }
.od-tab { padding: var(--sp-8) var(--sp-16); color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; font-size: var(--fs-base); line-height: var(--lh-base); }
.od-tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--primary); }
.od-kcard {
  display: flex; align-items: flex-start; gap: var(--sp-12); padding: var(--sp-12); border: 1px solid var(--line);
  border-radius: var(--r); background: var(--bg); color: var(--ink); text-decoration: none;
}
.od-kcard:hover, .od-kcard:focus-visible { border-color: var(--action); }
.od-kcard-body { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; overflow-wrap: anywhere; }
.od-kcard-im {
  flex: none; display: grid; place-items: center; width: var(--h-tile); height: var(--h-tile); border-radius: var(--r);
  background: var(--primary); color: #fff; font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: 600;
}
/* Lưới thẻ kanban (danh sách Nhà cung cấp). */
.od-kanban { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--w-kcard), 100%), 1fr)); gap: var(--sp-8); padding: var(--sp-12) var(--sp-16); background: var(--bg3); }
/* Nút chuyển kiểu hiển thị ở đầu thanh điều khiển (Kanban, Danh sách). */
.od-switch { display: inline-flex; max-width: 100%; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.od-switch-btn { display: inline-grid; place-items: center; min-width: var(--ctl); min-height: var(--ctl); padding: var(--sp-4) var(--sp-8); text-align: center; color: var(--muted); text-decoration: none; background: var(--bg); }
.od-switch-btn + .od-switch-btn { border-left: 1px solid var(--line); }
.od-switch-btn.on { background: var(--sel); color: var(--ink); }
.od-switch-btn:hover { background: var(--bg2); }
.od-chatter { display: flex; flex-direction: column; gap: var(--sp-12); }
.od-msg { padding: var(--sp-8) var(--sp-12); border-left: 3px solid var(--line); border-radius: var(--r); background: var(--bg2); }
.od-msg-head { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--muted); }
.od-msg-body { margin-top: var(--sp-4); white-space: pre-wrap; }
.od-dialog {
  width: min(var(--w-dialog), calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg); color: var(--ink); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.od-dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
.od-dialog form { padding: var(--sp-16); }
.od-dialog h2 { margin-bottom: var(--sp-8); font-size: var(--fs-lg); line-height: var(--lh-lg); }
/* Chân hộp thoại căn trái, nút xác nhận đứng trước (mẫu .mf). */
.od-dialog-foot { display: flex; justify-content: flex-start; gap: var(--sp-8); margin-top: var(--sp-12); }
.od-drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-8);
  min-height: var(--h-drop); padding: var(--sp-16); border: 1px dashed var(--line); border-radius: var(--r);
  color: var(--muted); text-align: center; cursor: pointer;
}
.od-drop:hover, .od-drop:focus-within { border-color: var(--action); color: var(--ink); }
.od-drop input[type=file] { position: absolute; width: var(--sp-4); height: var(--sp-4); opacity: 0; pointer-events: none; }
.od-viewer { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.od-viewer-head {
  display: flex; justify-content: space-between; gap: var(--sp-8); padding: var(--sp-8) var(--sp-12);
  border-bottom: 1px solid var(--line); background: var(--bg2); font-size: var(--fs-sm); line-height: var(--lh-sm);
}
.od-viewer img, .od-viewer iframe { display: block; width: 100%; max-width: 100%; border: 0; }
.od-viewer iframe { min-height: var(--h-frame); }

/* Chứng từ (PLAN-UI-MOI.md R3): chi tiết, điền hộ NCC, khung tài liệu. Hai cột từ 1100px; dưới đó một cột. */
.od-sheet { min-width: 0; padding: var(--sp-16) var(--sp-24); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); }
.od-title { margin: 0 0 var(--sp-12); font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: 600; }
.od-page-title { margin: var(--sp-16) 0 var(--sp-8); font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: 600; }
.od-subtitle { margin: var(--sp-24) 0 var(--sp-8); font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: 600; }
.od-detail, .od-fill { display: grid; gap: var(--sp-16); margin-top: var(--sp-12); }
.od-detail > *, .od-fill-side { min-width: 0; }
.od-side { padding: var(--sp-12); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); }
.od-side-title { margin: 0 0 var(--sp-8); font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: 600; }
.od-files { margin: var(--sp-12) 0 0; padding: 0; list-style: none; }
.od-file { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); padding: var(--sp-8) 0; border-bottom: 1px solid var(--line); }
.od-banner { margin-top: var(--sp-12); padding: var(--sp-8) var(--sp-16); border-radius: var(--r); }
.od-banner-warn { color: var(--warn); background: var(--warn-bg); }
.od-banner-danger { color: var(--danger); background: var(--danger-bg); }
.od-banner-ok { color: var(--ok); background: var(--ok-bg); }
/* Nút gửi form ở dòng hành động (tạo chứng từ từ hợp đồng): form không thêm khoảng cách, nút giữ kiểu .od-btn. */
.od-form-inline { display: inline-flex; margin: 0; }
.od-form-inline .od-btn { font-family: inherit; cursor: pointer; }
/* Chuỗi quan hệ của hợp đồng (DESIGN mục 8d): RFQ/PO sinh ra → hợp đồng này → hợp đồng gốc. */
.od-chain { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); margin: 0 0 var(--sp-16); }
.od-chain-node { display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-8) var(--sp-12); border: 1px solid var(--line); border-radius: var(--r); }
.od-chain-mid { background: var(--bg2); }
.od-chain-arrow { color: var(--muted); }
/* Khối tổng tiền dưới bảng hợp đồng: căn phải như chân tổng của Odoo, một cột nhãn và số. */
.od-totals { width: min(100%, var(--w-dialog)); margin-left: auto; }
.od-totals .od-fields { grid-template-columns: minmax(0, 1fr); }

/* Chi tiết RFQ giống form Odoo 19 (docs/SPEC-RFQ-ODOO.md; DESIGN mục 8e, ngoại lệ có chủ đích). Chỉ đọc.
   Thanh điều khiển (đường dẫn, nút thống kê, phân trang), hàng nút và thanh trạng thái, tờ, trao đổi bên phải từ 1534px như Odoo. */
/* Nền xám của tờ và nền trắng của trao đổi kéo tới đáy màn hình như Odoo. */
.od-main.od-main-wide { display: flex; flex-direction: column; max-width: none; min-height: calc(100vh - var(--h-nav)); padding: 0; }
.ofm { display: flex; flex: 1; flex-direction: column; }
.ofm-cp {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--sp-12);
  padding: var(--sp-8) var(--sp-16); background: var(--bg); border-bottom: 1px solid var(--line);
}
.ofm-cp-left { display: flex; align-items: center; gap: var(--sp-12); min-width: 0; }
.ofm-crumb { display: flex; flex-direction: column; min-width: 0; }
.ofm-crumb-parent { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--action); text-decoration: none; }
.ofm-crumb-cur { display: flex; align-items: center; gap: var(--sp-8); font-size: var(--fs-lg); line-height: var(--lh-lg); overflow-wrap: anywhere; }
.ofm-gear { font-size: var(--fs-base); line-height: var(--lh-base); color: var(--ink); }
.ofm-smart { display: flex; justify-self: center; border-radius: var(--r); overflow: hidden; }
.ofm-smart-btn {
  display: flex; align-items: center; gap: var(--sp-8); height: var(--h-stat); padding: 0 var(--sp-12);
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); text-decoration: none;
}
.ofm-smart-btn + .ofm-smart-btn { border-left: 0; }
a.ofm-smart-btn:hover { background: var(--bg2); }
.ofm-smart-icon { display: inline-flex; color: var(--primary); }
.ofm-smart-text { display: flex; flex-direction: column; }
.ofm-smart-label, .ofm-smart-value { font-size: var(--fs-sm); line-height: var(--lh-sm); white-space: nowrap; }
.ofm-smart-only { font-size: var(--fs-base); line-height: var(--lh-base); white-space: nowrap; }
.ofm-cp-right { display: flex; justify-content: flex-end; align-items: center; gap: var(--sp-8); }
.ofm-pager-value { font-size: var(--fs-base); line-height: var(--lh-base); }
.ofm-pager-btns { display: inline-flex; gap: var(--sp-4); }
.ofm-pager-btns .ofm-btn { min-width: var(--ctl); padding: 0; }
.ofm-btn {
  display: inline-flex; align-items: center; justify-content: center; height: var(--ctl); padding: 0 var(--sp-12);
  border: 1px solid var(--btn2); border-radius: var(--r); background: var(--btn2); color: var(--ink);
  font-family: inherit; font-size: var(--fs-base); line-height: var(--lh-base); text-decoration: none; white-space: nowrap; cursor: pointer;
}
.ofm-btn-primary { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 600; }
.ofm-btn-outline { border-color: var(--line); background: var(--bg); }
.ofm-btn:disabled { opacity: 0.5; cursor: default; }
.ofm-btn:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
/* Nút làm trong Odoo: mờ 50% nhưng bấm được (aria-disabled), bấm thì báo "chỉ làm được trong Odoo" (od-ui.js, .od-toast). */
.ofm-btn[aria-disabled="true"] { opacity: 0.5; }
[data-od-odoo-only] { cursor: pointer; }
/* Công tắc ẩn các điều khiển mờ (docs/NUT-MO-VMS.md). View đặt lớp ofm-hide-inert cho người không có quyền Sửa chứng từ; HTML của chúng vẫn còn.
   Chỉ ẩn điều khiển (nút, ⚙, ☆); thông tin chỉ đọc ở lại. Nút thống kê chỉ là việc thì view không in ra (admin-odoo-form.ejs). */
.ofm-hide-inert .ofm-btn:disabled, .ofm-hide-inert .ofm-btn[aria-disabled="true"], .ofm-hide-inert .ofm-cp-right, .ofm-hide-inert .ofm-chatter-top,
.ofm-hide-inert .ofm-gear, .ofm-hide-inert .ofm-star { display: none; }
/* Thông báo nổi (od-ui.js): khung xanh dương cho thông tin, khung đỏ cho từ chối quyền. Không chuyển động. */
.od-toast {
  position: fixed; left: 50%; bottom: var(--sp-24); z-index: 100; width: max-content; max-width: min(var(--w-dialog), 90vw); transform: translateX(-50%);
  padding: var(--sp-12) var(--sp-16); border: 1px solid var(--info); border-radius: var(--r); background: var(--info-bg); color: var(--info);
  font-size: var(--fs-base); line-height: var(--lh-base); cursor: pointer;
}
.od-toast-danger { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.ofm-body { display: grid; flex: 1; grid-template-columns: minmax(0, 1fr); }
.ofm-main { min-width: 0; padding-bottom: var(--sp-24); background: var(--bg2); }
.ofm-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-8);
  padding: var(--sp-8) var(--sp-16); background: var(--bg); border-bottom: 1px solid var(--line);
}
.ofm-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); }
.ofm-sheet { position: relative; margin: var(--sp-16); padding: var(--sp-24); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); }
.ofm-locked {
  position: absolute; top: var(--sp-16); right: var(--sp-16); display: inline-flex; align-items: center; gap: var(--sp-4);
  height: var(--ctl-sm); padding: 0 var(--sp-12); border-radius: 999px; background: var(--btn2);
  font-size: var(--fs-base); line-height: var(--lh-base); color: var(--ink);
}
.ofm-title-label { display: block; font-size: var(--fs-base); line-height: var(--lh-base); }
.ofm-h1 { display: flex; align-items: center; gap: var(--sp-12); margin: var(--sp-4) 0 var(--sp-24); font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 400; }
.ofm-star { color: var(--muted); }
.ofm-groups, .ofm-sum { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-16) var(--sp-40); }
.ofm-sep {
  margin: 0 0 var(--sp-16); border-bottom: 1px solid var(--line);
  font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 700; text-transform: uppercase; color: var(--ink);
}
.ofm-fields { display: grid; grid-template-columns: var(--w-label) minmax(0, 1fr); gap: var(--sp-16); margin: 0; }
.ofm-field { display: contents; }
.ofm-fields dt { font-size: var(--fs-base); line-height: var(--lh-base); color: var(--ink); }
.ofm-fields dd { margin: 0; min-width: 0; font-size: var(--fs-base); line-height: var(--lh-base); overflow-wrap: anywhere; }
.ofm-m2o { color: var(--action); text-decoration: none; }
.ofm-radios { display: flex; flex-direction: column; gap: var(--sp-8); }
.ofm-radio { display: inline-flex; align-items: center; gap: var(--sp-8); color: var(--muted); }
.ofm-radio.on { color: var(--ink); }
.ofm-radio-dot { display: inline-block; padding: var(--sp-8); border: 1px solid var(--line); border-radius: 50%; background: var(--bg); }
.ofm-radio.on .ofm-radio-dot { border-color: var(--action); background: var(--action); box-shadow: inset 0 0 0 4px var(--bg); }
.ofm-radios-row { flex-direction: row; gap: var(--sp-16); }
.ofm-radios-row .ofm-radio { color: var(--ink); }
.ofm-check { display: inline-block; padding: var(--sp-8); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); vertical-align: middle; }
/* Ô tổng tiền dưới bảng dòng: gọn, căn phải cả nhãn lẫn số, nhãn có dấu hai chấm, dòng Tổng đậm và to hơn (như Odoo). */
.ofm-totals { display: flex; justify-content: flex-end; margin: var(--sp-16) 0 var(--sp-8); }
.ofm-totals .ofm-fields { grid-template-columns: auto auto; gap: var(--sp-4) var(--sp-16); text-align: right; }
.ofm-totals dt::after { content: ":"; }
.ofm-totals .ofm-total-main dt, .ofm-totals .ofm-total-main dd { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: 700; }
.ofm-tabs { display: flex; flex-wrap: wrap; margin-top: var(--sp-24); border-bottom: 1px solid var(--line); }
.ofm-tab {
  position: relative; top: 1px; padding: var(--sp-8) var(--sp-16); border: 1px solid transparent; border-bottom: 0;
  color: var(--ink); text-decoration: none; font-size: var(--fs-base); line-height: var(--lh-base);
}
.ofm-tab.on { border-color: var(--line); background: var(--bg); }
.ofm-sum { margin: var(--sp-16) 0 var(--sp-8); }
.ofm-lines .od-table-wrap { margin-top: 0; border: 0; border-radius: 0; }
.ofm-lines .od-table th { font-weight: 700; }
.ofm-lines .od-table td { max-width: var(--w-label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ofm-lines .od-table td:nth-child(2) { max-width: none; }
.ofm-lines .od-table td:first-child:not([colspan]) { width: var(--sp-24); color: var(--muted); }
.ofm-lines .od-table td:first-child:not([colspan])::before { content: "⠿"; }
.ofm-page .od-fields { margin-top: var(--sp-16); }
.ofm-section .ofm-sep { margin-top: var(--sp-24); }
.ofm-section .ofm-sep + .od-fields { margin-top: 0; }
.ofm-chatter { min-width: 0; padding: var(--sp-16); background: var(--bg); border-top: 1px solid var(--line); }
.ofm-chatter-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-8); margin-bottom: var(--sp-16); }
.ofm-chatter-tabs { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.ofm-chatter-icons { display: flex; align-items: center; gap: var(--sp-12); color: var(--ink); }
.ofm-day { display: flex; align-items: center; gap: var(--sp-12); margin: var(--sp-16) 0; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--muted); }
.ofm-day::before, .ofm-day::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.ofm-msg { display: grid; grid-template-columns: var(--h-logo) minmax(0, 1fr); gap: var(--sp-12); margin-bottom: var(--sp-16); }
.ofm-avatar {
  display: inline-flex; align-items: center; justify-content: center; width: var(--h-logo); height: var(--h-logo);
  border-radius: var(--r); background: var(--primary); color: #fff; font-size: var(--fs-base); line-height: var(--lh-base); font-weight: 600;
}
.ofm-msg-vendor .ofm-avatar { background: var(--action); }
.ofm-msg-head { font-size: var(--fs-label); line-height: var(--lh-label); }
.ofm-msg-time { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--muted); }
.ofm-bubble {
  margin-top: var(--sp-4); padding: var(--sp-8) var(--sp-12); border: 1px solid var(--ok-bg); border-radius: var(--r);
  background: var(--ok-bg); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere;
}
.ofm-msg-vendor .ofm-bubble { border-color: var(--line); background: var(--bg); }
.ofm-msg-note .ofm-bubble { padding: 0; border-color: transparent; background: none; }
@media (min-width: 1534px) {
  .ofm-body { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .ofm-chatter { border-top: 0; border-left: 1px solid var(--line); }
}
@media (max-width: 719px) {
  .ofm-cp { grid-template-columns: minmax(0, 1fr); }
  .ofm-smart { justify-self: start; flex-wrap: wrap; }
  .ofm-cp-right { justify-content: flex-start; }
  .ofm-groups, .ofm-sum { grid-template-columns: minmax(0, 1fr); }
  .ofm-sheet { margin: var(--sp-8); padding: var(--sp-16); }
  .ofm-locked { position: static; margin-bottom: var(--sp-8); }
  .ofm-h1 { font-size: var(--fs-xl); line-height: var(--lh-xl); }
}
.od-fill-main, .od-quote { display: flex; flex-direction: column; gap: var(--sp-16); min-width: 0; margin: 0; }
.od-card { min-width: 0; padding: var(--sp-12) var(--sp-16); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); }
.od-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-8); margin-bottom: var(--sp-12); }
.od-card-title { margin: 0 0 var(--sp-12); font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: 600; }
.od-card-head .od-card-title { margin: 0; }
/* Chân khối căn trái: ghi chú rồi nút, nút chính đứng trước (mẫu .mf). */
.od-form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: var(--sp-12); margin-top: var(--sp-12); }
.od-more { padding: var(--sp-12) var(--sp-16); }
.od-more > summary { cursor: pointer; font-weight: 600; }
.od-more form { margin-top: var(--sp-12); }
.od-ai-val { font-weight: 600; }
.od-miss { color: var(--muted); }
.od-ai .od-notebook { margin-bottom: var(--sp-12); }
button.od-tab { padding: var(--sp-8) var(--sp-16); border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.od-ai-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); margin-top: var(--sp-12); padding-top: var(--sp-12); border-top: 1px solid var(--line); }
.od-ai-foot form { margin: 0; }
.od-log { display: flex; flex-direction: column; gap: var(--sp-8); max-height: var(--h-log); overflow-y: auto; }
.od-bubble { max-width: 90%; margin: 0; padding: var(--sp-8) var(--sp-12); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg2); white-space: pre-wrap; }
.od-bubble-user { align-self: flex-end; background: var(--sel); }
.od-bubble-error { color: var(--danger); background: var(--danger-bg); }
.od-ask { display: flex; gap: var(--sp-8); margin-top: var(--sp-12); }
.od-inp { min-width: 0; height: var(--ctl); padding: 0 var(--sp-8); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--ink); font: inherit; }
.od-ask .od-inp { flex: 1 1 auto; }
.od-table .od-inp { width: 100%; min-width: 96px; }
.od-inp-num { text-align: right; font-variant-numeric: tabular-nums; }
.od-inp-ai { border: 1px dashed var(--info); }
.od-fill-send {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--sp-12); padding: var(--sp-12); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r);
}
.od-viewer-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); }
.od-viewer-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-8);
  padding: var(--sp-8) var(--sp-12); background: var(--bg2); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); line-height: var(--lh-sm);
}
.od-viewer-actions { display: flex; gap: var(--sp-8); }
.od-ftabs { display: flex; flex-wrap: wrap; gap: var(--sp-4); padding: 0 var(--sp-8); border-bottom: 1px solid var(--line); }
.od-ftabs .od-tab { padding: var(--sp-8); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.od-stage { max-height: 70vh; min-height: var(--h-frame); overflow: auto; background: var(--bg3); }
.od-stage iframe { height: 60vh; min-height: var(--h-frame); }
.od-viewer-card .od-viewer { border: 0; border-radius: 0; }
.od-zoom {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-8); padding: var(--sp-8);
  border-top: 1px solid var(--line); font-size: var(--fs-sm); line-height: var(--lh-sm);
}
.od-viewer-card.is-collapsed .od-ftabs, .od-viewer-card.is-collapsed .od-stage, .od-viewer-card.is-collapsed .od-zoom { display: none; }
@media (min-width: 1100px) {
  .od-detail-chat { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .od-side { position: sticky; top: var(--sp-12); }
  .od-fill { grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); align-items: start; }
  .od-fill-side { position: sticky; top: var(--sp-12); }
}
@media (max-width: 1099px) {
  .od-fill-send { flex-direction: column; align-items: stretch; }
  .od-fill-send .od-btn-primary { width: 100%; }
}

/* Báo cáo (R6, mẫu .graph): khối có câu kết luận làm tiêu đề, thanh <progress> (độ dài ở value, không dùng style=), SVG có thuộc tính. */
.od-graphs { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-16); margin-top: var(--sp-16); }
.od-graphs-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.od-graph { min-width: 0; padding: var(--sp-16) var(--sp-24); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.od-graph-plain { padding: 0; border: 0; background: none; }
.od-graph-title { margin: 0 0 var(--sp-12); font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: 600; }
.od-graph .od-table-wrap { margin-top: 0; }
.od-graph .od-note { padding-top: var(--sp-8); }
.od-tone-ctx { color: var(--chart-ctx); }
.od-tone-hot { color: var(--danger); }
.od-tone-hot-dim { color: var(--chart-hot-dim); }
.od-tone-acc { color: var(--action); }
.od-meter {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: var(--h-bar); border: 0; border-radius: var(--r);
  background: transparent; overflow: hidden;
}
/* Không vẽ đường nền rỗng (DESIGN mục 8c): chỉ phần giá trị có màu. */
.od-meter::-webkit-progress-bar { background: transparent; }
.od-meter::-webkit-progress-value { background: currentColor; }
.od-meter::-moz-progress-bar { background: currentColor; }
.od-meter-mini { display: inline-block; width: var(--w-mini); height: var(--h-mini); margin-right: var(--sp-8); vertical-align: middle; }
.od-hbars { display: flex; flex-direction: column; gap: var(--sp-8); }
.od-hbar { display: grid; grid-template-columns: minmax(0, var(--w-rlabel)) minmax(0, 1fr) auto; align-items: center; gap: var(--sp-12); }
.od-hbar-label { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.od-hbar-value { min-width: var(--w-rvalue); font-weight: 600; white-space: nowrap; }
.od-svg { display: block; width: 100%; height: auto; }
.od-svg-ax { stroke: var(--line); stroke-width: 1; }
.od-svg-ln { fill: none; stroke: var(--action); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.od-svg-dot { fill: var(--action); }
.od-svg-col { fill: var(--chart-ctx); }
.od-svg-col.hl { fill: var(--action); }
.od-svg text { fill: var(--muted); font-size: var(--fs-sm); }
.od-svg text.od-svg-end, .od-svg text.od-svg-val, .od-svg text.hl { fill: var(--ink); font-weight: 600; }
.od-fact { display: flex; align-items: baseline; gap: var(--sp-12); padding: var(--sp-8) 0; border-bottom: 1px solid var(--line); }
.od-fact:last-child { border-bottom: 0; }
.od-fact-num { min-width: var(--w-num); text-align: right; font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: 600; }
.od-total-line { display: flex; justify-content: space-between; gap: var(--sp-12); padding: var(--sp-8) var(--sp-12); font-variant-numeric: tabular-nums; }
@media (max-width: 899px) {
  .od-graphs-two { grid-template-columns: minmax(0, 1fr); }
  .od-hbar { grid-template-columns: minmax(0, 1fr) auto; }
  .od-hbar-label { grid-column: 1 / -1; }
  .od-graph { padding: var(--sp-12) var(--sp-16); }
}

/* Trang Cài đặt (R7): ô nhập trong hộp thoại và khung key hiện một lần. */
.od-fld { display: flex; flex-direction: column; gap: var(--sp-4); margin-top: var(--sp-12); }
.od-fld > span { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 600; }
.od-fld .od-inp { width: 100%; }
.od-keyonce { display: block; padding: var(--sp-8) var(--sp-12); border: 1px dashed var(--line); border-radius: var(--r); background: var(--bg2); overflow-wrap: anywhere; user-select: all; }
/* Tài khoản NCC (R7): dòng được tô khi đi từ link Odoo tới, thanh thông báo dính đầu trang, dải thông tin. */
.od-table tr[data-od-focus] td { background: var(--sel); }
.od-banner-info { color: var(--info); background: var(--info-bg); }
.od-banner-sticky { position: sticky; top: 0; z-index: 5; }
.od-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.od-check { display: flex; align-items: center; gap: var(--sp-8); margin-top: var(--sp-12); }

/* Đăng nhập và mật khẩu (R8): nút đứng riêng, dòng liên kết, chữ "hoặc" giữa hai cách đăng nhập. */
.od-guest-actions { margin-top: var(--sp-16); }
.od-guest-card .od-guest-links { margin: var(--sp-12) 0 0; text-align: center; }
.od-guest-card .od-or { margin: var(--sp-12) 0; text-align: center; color: var(--muted); }
.od-google-g { margin-right: var(--sp-8); }
.od-guest-card .od-btn + .od-btn { margin-top: var(--sp-8); }
.od-guest-card form .od-banner { margin-top: 0; margin-bottom: var(--sp-12); }
