/* Design tokens follow the measured no-code workspace style: teal theme, navy text, soft lavender page. */
:root {
  --theme: #00B899; --theme-hover: #00A589; --theme-soft: #E6F8F5; --theme-line: #00B899;
  --text: #131D2E; --text-2: #5B687A; --muted: #9FA7B2; --placeholder: #BCC2CC;
  --page: #F3F3F8; --panel: #FFFFFF; --panel-2: #F7F8FA; --readonly: #F3F5F8; --hover: rgba(19, 29, 46, .05); --selected: rgba(19, 29, 46, .08);
  --line: #E6E8ED; --line-2: #EDEEF1; --input: #DADEE5;
  --blue: #2B73F0; --blue-soft: #EBF3FF; --green: #46C26F; --green-text: #358C41; --green-soft: #ECF8ED;
  --orange: #FA851E; --orange-soft: #FFF5E8; --yellow: #EDA426; --yellow-soft: #FFF7E4; --red: #EF5655; --red-soft: #FEF1F0;
  --violet: #7758E8; --violet-soft: #F2EFFE; --teal: #03ABA0; --cyan: #0DADD9; --grey-tag: #9FA7B2;
  --chart: #8E74D9; --chart-2: #B09CF7;
  --shadow-pane: 0 0 2px 0 rgba(19, 29, 46, .02), 0 1px 4px 0 rgba(19, 29, 46, .06);
  --shadow-widget: 0 2px 6px 0 rgba(84, 48, 132, .1);
  --shadow-pop: 0 0 4px 0 rgba(19, 29, 46, .05), 0 6px 16px -1px rgba(19, 29, 46, .06), 0 6px 32px 8px rgba(19, 29, 46, .04);
  --shadow-dialog: 0 0 5px 0 rgba(19, 29, 46, .06), 0 10px 24px -2px rgba(19, 29, 46, .1), 0 10px 48px 12px rgba(19, 29, 46, .04);
  --r: 6px; --r-lg: 10px; --side: 280px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #E7E9EE; --text-2: #AEB5C2; --muted: #7D8696; --placeholder: #5B6577;
    --page: #0F1116; --panel: #181B22; --panel-2: #1E222A; --readonly: #222731; --hover: rgba(255, 255, 255, .05); --selected: rgba(255, 255, 255, .09);
    --line: #2A303A; --line-2: #242932; --input: #343B47; --theme-soft: #12302B;
    --blue-soft: #1B2A44; --green-soft: #16301F; --orange-soft: #35240F; --yellow-soft: #34290F; --red-soft: #3A1B1C; --violet-soft: #272143;
    --shadow-pane: none; --shadow-widget: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --text: #E7E9EE; --text-2: #AEB5C2; --muted: #7D8696; --placeholder: #5B6577;
  --page: #0F1116; --panel: #181B22; --panel-2: #1E222A; --readonly: #222731; --hover: rgba(255, 255, 255, .05); --selected: rgba(255, 255, 255, .09);
  --line: #2A303A; --line-2: #242932; --input: #343B47; --theme-soft: #12302B;
  --blue-soft: #1B2A44; --green-soft: #16301F; --orange-soft: #35240F; --yellow-soft: #34290F; --red-soft: #3A1B1C; --violet-soft: #272143;
  --shadow-pane: none; --shadow-widget: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--page); color: var(--text); font: 14px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); } .small { font-size: 12px; } .grow { flex: 1; } .pre { white-space: pre-wrap; }
.neg { color: var(--red); } .pos { color: var(--green-text); } .ok-t { color: var(--green-text); }
.clip { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); height: 100vh; }
.shell.collapsed { --side: 64px; }
.side { display: flex; flex-direction: column; min-height: 0; padding-top: 8px; }
.app-head { display: flex; align-items: center; gap: 10px; padding: 4px 12px 10px 20px; }
.app-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, #3CC7BE, var(--theme)); color: #fff; font-weight: 700; font-size: 12px; flex: none; }
.app-name { font-weight: 700; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collapse-btn { border: 0; background: none; color: var(--muted); padding: 4px 6px; border-radius: 4px; font-size: 14px; }
.collapse-btn:hover { background: var(--hover); color: var(--text); }
.side-search { margin: 0 12px 6px; position: relative; }
.side-search input { width: 100%; height: 32px; border: 0; border-radius: var(--r); background: rgba(19, 29, 46, .04); padding: 0 8px 0 30px; font: inherit; color: var(--text); outline: none; }
.side-search input:focus { background: var(--panel); box-shadow: 0 0 0 1px var(--theme); }
.side-search svg { position: absolute; left: 9px; top: 9px; color: var(--muted); }
.side-nav { flex: 1; overflow-y: auto; padding: 2px 0 12px; }
.nav-sep { height: 1px; background: var(--line); margin: 8px 20px; }
.node { display: flex; align-items: center; gap: 8px; height: 40px; margin: 0 12px; padding: 0 8px; border-radius: var(--r); color: var(--text); cursor: pointer; user-select: none; text-decoration: none !important; }
.node:hover { background: var(--hover); }
.node.on { background: var(--selected); font-weight: 600; }
.node .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node .caret { color: var(--muted); font-size: 10px; transition: transform .15s; }
.node .caret.open { transform: rotate(90deg); }
.node.child { padding-left: 32px; }
.node .badge-n { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--red); color: #fff; font-size: 12px; line-height: 18px; text-align: center; font-weight: 600; }
.side-foot { padding: 8px 0 10px; border-top: 1px solid var(--line); }
.shell.collapsed .nm, .shell.collapsed .app-name, .shell.collapsed .side-search, .shell.collapsed .caret, .shell.collapsed .badge-n, .shell.collapsed .nav-label { display: none; }
.shell.collapsed .node { justify-content: center; padding: 0; }
.shell.collapsed .node.child { padding-left: 0; }
.shell.collapsed .app-head { padding: 4px 8px 10px; justify-content: center; flex-direction: column; }
.ei { width: 18px; height: 18px; flex: none; display: block; }

.pane { margin: 8px 8px 8px 0; background: var(--panel); border-radius: var(--r-lg); border: 1px solid rgba(255, 255, 255, .78); box-shadow: var(--shadow-pane); display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
:root[data-theme="dark"] .pane { border-color: var(--line); }
.pane-head { height: 51px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line-2); background: rgba(255, 255, 255, .37); }
.pane-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vsep { width: 1px; height: 16px; background: var(--line); }
.view-switch { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 4px 8px; border-radius: 4px; font-weight: 600; }
.view-switch:hover { background: var(--hover); }
.head-icons { display: flex; align-items: center; gap: 2px; }
.icon-btn { border: 0; background: none; padding: 6px; border-radius: 6px; color: var(--text-2); display: inline-grid; place-items: center; position: relative; line-height: 1; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.sm { padding: 3px; }
.icon-btn .dot { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); border: 1.5px solid var(--panel); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; cursor: pointer; border: 0; }
.pane-body { flex: 1; overflow: auto; min-height: 0; }
.pane-body.pad { padding: 16px 20px 32px; }
.pane-body.dash { background: var(--page); padding: 10px; }

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--input); background: var(--panel); color: var(--text); white-space: nowrap; font-size: 14px; transition: background .12s, border-color .12s, color .12s; }
.btn:hover { border-color: var(--theme); color: var(--theme); }
.btn.primary { background: var(--theme); border-color: var(--theme); color: #fff; }
.btn.primary:hover { background: var(--theme-hover); border-color: var(--theme-hover); color: #fff; }
.btn.secondary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.text { border-color: transparent; background: none; color: var(--text); padding: 0 8px; }
.btn.text:hover { background: var(--hover); color: var(--text); }
.btn.link { border: 0; background: none; color: var(--theme); padding: 0 4px; }
.btn.link:hover { background: none; text-decoration: underline; }
.btn.danger { color: var(--red); } .btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 13px; }
.btn.wide { min-width: 120px; }
.btn:disabled { opacity: .5; cursor: default; }
.inp { width: 100%; height: 32px; border: 1px solid var(--input); border-radius: var(--r); background: var(--panel); color: var(--text); padding: 0 8px; font: inherit; font-size: 14px; outline: none; transition: border-color .12s, box-shadow .12s; }
.inp:hover { border-color: var(--theme); }
.inp:focus { border-color: var(--theme); box-shadow: 0 0 0 2px var(--theme-soft); }
.inp::placeholder { color: var(--placeholder); }
textarea.inp { height: auto; padding: 4px 8px; min-height: 72px; resize: vertical; line-height: 22px; }
.inp:disabled, .inp[readonly] { background: var(--readonly); border-color: transparent; color: var(--text); }
.inp.sm { height: 28px; font-size: 13px; }
.search-box { position: relative; width: 220px; }
.search-box svg { position: absolute; left: 9px; top: 9px; color: var(--muted); }
.search-box .inp { padding-left: 30px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--theme); width: 15px; height: 15px; }

/* ---------- tags ---------- */
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 6px; border-radius: 4px; font-size: 13px; white-space: nowrap; color: #fff; background: var(--grey-tag); line-height: 22px; }
.tag.green { background: var(--green); } .tag.orange { background: var(--orange); } .tag.yellow { background: var(--yellow); }
.tag.red { background: var(--red); } .tag.blue { background: var(--blue); } .tag.violet { background: var(--violet); } .tag.teal { background: var(--teal); } .tag.cyan { background: var(--cyan); }
.tag.lt { color: var(--text-2); background: var(--readonly); }
.tag.lt.green { color: var(--green-text); background: var(--green-soft); } .tag.lt.red { color: var(--red); background: var(--red-soft); }
.tag.lt.orange { color: var(--orange); background: var(--orange-soft); } .tag.lt.blue { color: var(--blue); background: var(--blue-soft); }
.docs-b { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 4px; background: var(--orange-soft); color: var(--orange); }
.docs-b.ok { background: var(--green-soft); color: var(--green-text); }
.prog { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; min-width: 50px; flex: 1; }
.prog-bar { height: 100%; background: var(--theme); border-radius: 3px; }
.prog-bar.over { background: var(--yellow); }
.pcell { display: flex; align-items: center; gap: 8px; } .pcell span { font-size: 12px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- data list (toolbar + grid + footer) ---------- */
.list { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.toolbar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; flex-wrap: wrap; }
.toolbar .tools-r { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.grid-wrap { flex: 1; overflow: auto; margin: 0 16px; border: 1px solid var(--line); border-radius: 4px; min-height: 120px; }
.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.grid th { position: sticky; top: 0; z-index: 2; background: var(--panel-2); font-weight: 400; color: var(--text); text-align: left; padding: 3px 10px; line-height: 34px; white-space: nowrap; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
.grid th:hover { background: var(--readonly); }
.grid th .arr { color: var(--theme); margin-left: 4px; font-size: 10px; }
.grid td { white-space: nowrap; padding: 7px 10px; line-height: 20px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); background: var(--panel); vertical-align: middle; }
.grid th:last-child, .grid td:last-child { border-right: 0; }
.grid tr.click { cursor: pointer; } .grid tr.click:hover td { background: #F5F7FA; }
:root[data-theme="dark"] .grid tr.click:hover td { background: var(--hover); }
.grid tr.sel td { background: var(--theme-soft) !important; }
.grid .ck { width: 40px; text-align: center; padding: 0; cursor: default; }
.grid .sticky-l { position: sticky; left: 0; z-index: 1; } .grid th.sticky-l { z-index: 3; }
.grid tfoot td { background: var(--panel-2); font-weight: 600; position: sticky; bottom: 0; }
.grid-foot { display: flex; align-items: center; gap: 12px; padding: 10px 16px; font-size: 13px; color: var(--text-2); }
.pager { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pager button { width: 28px; height: 28px; border: 1px solid var(--line); background: var(--panel); border-radius: 4px; color: var(--text-2); }
.pager button:disabled { opacity: .4; cursor: default; }
.pager .pg { min-width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 4px; display: grid; place-items: center; padding: 0 6px; color: var(--text); }
.grid-empty { padding: 60px 16px; text-align: center; color: var(--muted); }
.grid-empty .ei-big { font-size: 34px; opacity: .45; }

/* simple table (inside dialogs / forms) */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { background: var(--panel-2); font-weight: 400; text-align: left; padding: 0 10px; line-height: 34px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td .clip { max-width: 320px; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--hover); }
.tbl-box { border: 1px solid var(--line); border-radius: 4px; overflow: auto; }

/* ---------- popover ---------- */
.pop-anchor { position: relative; }
.pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; min-width: 220px; background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow-pop); border: 1px solid var(--line-2); padding: 6px; }
.pop.left { right: auto; left: 0; }
.pop-item { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 34px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.pop-item:hover { background: var(--hover); }
/* Q530 (C): the top bar's search drawn as a box to type in (it opens the Ctrl K dialog); a phone keeps the icon alone */
.head-find { display: inline-flex; align-items: center; height: 30px; min-width: 260px; cursor: pointer; font: inherit; gap: 8px; padding: 0 8px 0 10px; border: 1px solid var(--input); border-radius: var(--r); background: var(--panel); color: var(--muted); }
.head-find:hover { border-color: var(--muted); background: var(--panel); }
.head-find-t { flex: 1; text-align: left; font-size: 13px; white-space: nowrap; }
@media (min-width: 768px) and (max-width: 1000px) { .head-find { min-width: 180px; } } /* a long page title keeps its room */
@media (max-width: 767px) { .head-find { min-width: 0; width: 30px; justify-content: center; border: 0; background: none; padding: 0; } .head-find-t { display: none; } }
/* a menu entry that does something is a real button (Tab / Enter reach it, L-34), drawn as the entry it was */
button.pop-item { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; }
button.pop-item:focus-visible { outline: 2px solid var(--theme); outline-offset: -2px; background: var(--hover); }
.pop-item.on { color: var(--theme); font-weight: 600; }
.pop-sep { height: 1px; background: var(--line); margin: 4px 0; }
.pop-h { padding: 8px 10px 4px; font-size: 12px; color: var(--muted); }
.filter-pop { width: 340px; padding: 12px; display: grid; gap: 10px; }
.filter-pop label { display: grid; gap: 4px; font-size: 13px; }

/* ---------- forms ---------- */
.form-page { max-width: 1150px; margin: 0 auto; }
.form-body { padding: 16px 24px 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; row-gap: 4px; }
.fld { padding: 5px 0 12px; min-width: 0; }
.fld.span2 { grid-column: 1 / -1; }
.fld-l { font-weight: 600; font-size: 14px; line-height: 20px; padding: 5px 0; display: block; }
.fld-l .req { color: var(--red); margin-left: -8px; margin-right: 2px; font-weight: 600; }
.fld-hint { font-size: 12px; color: var(--muted); margin: -4px 0 6px; line-height: 18px; }
.ro { min-height: 32px; border-radius: var(--r); background: var(--readonly); padding: 5px 8px; line-height: 22px; word-break: break-word; }
.ro.ro-empty { color: var(--placeholder); }
.sep { display: flex; align-items: stretch; border-bottom: 2px solid var(--theme-line); margin: 14px 0 12px; grid-column: 1 / -1; }
.sep-label { background: var(--theme); color: #fff; font-weight: 600; font-size: 14px; line-height: 28px; padding: 0 10px; white-space: nowrap; }
.sep-tail { width: 46px; background: repeating-linear-gradient(-60deg, transparent 0 4px, var(--theme) 4px 9px); opacity: .55; clip-path: polygon(0 0, 100% 0, 85% 100%, 0 100%); -webkit-mask-image: linear-gradient(90deg, #000 30%, transparent); mask-image: linear-gradient(90deg, #000 30%, transparent); }
.sel-data { width: 100%; justify-content: center; }
.sel-data.has { justify-content: flex-start; }
.sel-data .x { margin-left: auto; color: var(--muted); }
.sub { border: 1px solid var(--line); border-radius: 4px; overflow: auto; }
.sub table { border-collapse: collapse; width: 100%; font-size: 14px; }
.sub th { background: var(--panel-2); font-weight: 400; text-align: left; padding: 8px 5px 7px 7px; line-height: 20px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.sub th .req { color: var(--red); margin-right: 2px; }
.sub td { padding: 4px 5px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.sub td.idx { width: 44px; text-align: center; color: var(--text-2); }
.sub td .ro { min-height: 30px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 56px; }
.sub table { min-width: 860px; }
.sub-actions { display: flex; gap: 4px; margin-top: 6px; }
.form-foot { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line-2); padding: 10px 24px; display: flex; gap: 8px; align-items: center; z-index: 5; }
.tabs-f { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 14px; }
.tab-f { border: 1px solid var(--line); border-bottom: 0; background: var(--panel-2); padding: 7px 16px; border-radius: 6px 6px 0 0; margin-bottom: -1px; color: var(--text); white-space: nowrap; }
.tab-f.on { background: var(--panel); color: var(--teal); font-weight: 600; border-bottom: 1px solid var(--panel); }
.tabs-u { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tab-u { border: 0; background: none; padding: 8px 0; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
a.tab-u { text-decoration: none; cursor: pointer; display: inline-block; }
.tab-u.on { color: var(--theme); border-bottom-color: var(--theme); font-weight: 600; }
.tab-u .n { margin-left: 4px; font-size: 12px; color: var(--muted); }

/* ---------- dialog ---------- */
.mask { position: fixed; inset: 0; background: rgba(19, 29, 46, .45); z-index: 100; display: grid; place-items: center; padding: 24px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.dialog { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-dialog); width: min(640px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; min-height: 0; animation: pop .15s ease; }
@keyframes pop { from { transform: scale(.98); opacity: .6; } }
.dialog.md { width: min(860px, 100%); }
.dialog.lg { width: min(1200px, 100%); height: calc(100vh - 48px); }
.dialog.full { width: 100%; height: 100%; max-height: none; border-radius: 0; }
.mask:has(.dialog.full) { padding: 0; }
.dlg-h { height: 52px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line-2); }
.dlg-h h2 { font-size: 16px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlg-b { flex: 1; overflow: auto; padding: 16px 20px; min-height: 0; }
.dlg-f { flex: none; display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 20px; border-top: 1px solid var(--line-2); }
.rec-bar { flex: none; display: flex; align-items: center; gap: 2px; padding: 6px 12px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.rec-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); }
.rec-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 320px; min-height: 0; }
.rec-main { overflow: auto; padding: 16px 20px 32px; min-width: 0; }
.rec-side { border-left: 1px solid var(--line-2); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.rec-side .tabs-u { padding: 0 16px; margin: 0; flex: none; }
.rec-side-b { flex: 1; overflow: auto; padding: 12px 16px; }
.fv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.fv { padding: 4px 0 10px; min-width: 0; }
.fv.span2 { grid-column: 1 / -1; }
.fv-l { font-size: 13px; color: var(--text-2); line-height: 20px; padding: 2px 0 4px; }
.meta-row { display: flex; gap: 24px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding-top: 10px; margin-top: 8px; border-top: 1px dashed var(--line); }
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi-mini { background: var(--panel-2); border-radius: var(--r); padding: 10px 12px; }
.kpi-mini .l { font-size: 12px; color: var(--text-2); } .kpi-mini .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-mini .s { font-size: 12px; color: var(--muted); }
.kpi-mini.warn .v { color: var(--orange); } .kpi-mini.ok .v { color: var(--green-text); } .kpi-mini.bad .v { color: var(--red); }
.alert-bar { padding: 8px 12px; border-radius: var(--r); margin-bottom: 12px; font-size: 13px; background: var(--red-soft); color: var(--red); }

/* timeline (history / comments) */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 14px 20px; font-size: 13px; }
.tl li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.tl li::after { content: ''; position: absolute; left: 7.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.tl li:last-child::after { display: none; }
.tl li.c::before { background: var(--theme); }
.tl .who { font-weight: 600; } .tl .when { color: var(--muted); font-size: 12px; margin-left: 6px; }
.tl .what { color: var(--text-2); margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.tl li.c .what { background: var(--panel-2); color: var(--text); padding: 6px 10px; border-radius: 6px; margin-top: 4px; }
.tl .tl-del { float: right; margin: -3px -4px 0 0; opacity: 0; transition: opacity .12s; }
.tl li:hover .tl-del, .tl .tl-del:focus-visible { opacity: 1; }
@media (hover: none) { .tl .tl-del { opacity: .8; } }
.cmt-in { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line-2); padding: 10px 16px; flex: none; }

/* documents */
.checklist { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.cl-i { display: inline-flex; gap: 6px; align-items: center; height: 26px; padding: 0 10px 0 7px; border-radius: 4px; font-size: 13px; background: var(--orange-soft); color: var(--orange); cursor: pointer; }
.cl-i.done { background: var(--green-soft); color: var(--green-text); }
.upload { border: 1px dashed var(--input); border-radius: var(--r); padding: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--panel-2); color: var(--text-2); font-size: 13px; margin-bottom: 10px; }
.upload.over { border-color: var(--theme); background: var(--theme-soft); }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.doc-ic { width: 26px; height: 30px; border-radius: 3px; display: grid; place-items: center; font-size: 9px; font-weight: 700; color: #fff; background: var(--blue); }
.doc-ic.pdf { background: var(--red); } .doc-ic.img { background: var(--green); } .doc-ic.xls { background: var(--green-text); }
.doc-n { overflow: hidden; min-width: 0; } .doc-n a, .doc-n span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-n small { color: var(--muted); }

/* ---------- dashboard widgets ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; }
.wg { background: var(--panel); box-shadow: var(--shadow-widget); min-width: 0; display: flex; flex-direction: column; }
.wg-h { display: flex; align-items: center; gap: 8px; padding: 5px 10px; min-height: 40px; }
.wg-h h3 { font-size: 14px; font-weight: 700; line-height: 30px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-h a { font-size: 13px; color: var(--theme); }
.wg-b { padding: 0 10px 10px; flex: 1; min-height: 0; }
.wg.title { justify-content: center; align-items: center; min-height: 84px; }
.wg.title span { font-size: 17px; font-weight: 600; color: var(--text); }
.wg.big { cursor: pointer; }
.wg.big .wg-b { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.big-n { font-size: 56px; font-weight: 400; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.big-n.warn { color: var(--orange); } .big-n.bad { color: var(--red); } .big-n.ok { color: var(--green-text); }
.big-s { text-align: center; color: var(--text-2); font-size: 13px; margin-top: 4px; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
.chart { width: 100%; height: 220px; display: block; }
.chart text { fill: rgba(19, 29, 46, .47); font-size: 11px; font-family: inherit; }
:root[data-theme="dark"] .chart text { fill: var(--muted); }
.chart .v { fill: var(--text); }
.chart .gl { stroke: var(--line-2); }
.legend { display: flex; gap: 12px; justify-content: center; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; background: var(--chart); margin-right: 4px; vertical-align: -1px; }
.tq-tabs { overflow-y: hidden; }
.tq-os { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tq-o { padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.tq-o:hover { border-color: var(--line-2); background: var(--hover); }
.tq-o.on { border-color: var(--text); }
.tq-o small { display: block; font-size: 12px; color: var(--text-2); }
.tq-o b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tq-mo { display: grid; gap: 12px; margin-top: 12px; grid-template-columns: minmax(0, 1fr); }
.tq-mo:empty { display: none; }
.tq-box { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.tq-h { margin: 0; padding: 9px 14px; font-size: 14px; font-weight: 600; }
.tq-dong { display: block; width: 100%; padding: 9px 14px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.tq-dong:hover { background: var(--hover); }
.tq-a { display: flex; justify-content: space-between; align-items: center; gap: 8px; white-space: nowrap; }
.tq-a b { font-weight: 500; }
.tq-a span { font-size: 12px; color: var(--text-2); }
.tq-a span.thieu { font-size: 13px; color: var(--text); }
.tq-s { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; }
.tq-hang { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.tq-hang .tq-dong { flex: 1; min-width: 0; border-top: 0; }
.tq-hang > .btn { margin-right: 14px; flex: none; }
.tq-chon { display: flex; gap: 10px; align-items: flex-start; padding: 8px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.tq-chon input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.tq-k { flex: 1; min-width: 0; }
.tq-ket { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.tq-ket label { flex: 1 0 100%; font-size: 12px; color: var(--text-2); }
.tq-ket input { flex: 1 1 220px; min-width: 0; }
.tq-lk { margin-top: 12px; padding: 0; border: 0; background: none; color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font: inherit; }
.tq-lk:hover { color: var(--text); }
.tq-bc { overflow-x: auto; }
.tq-bc table { border-collapse: collapse; width: 100%; }
.tq-bc th, .tq-bc td { padding: 7px 14px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
.tq-bc th { font-weight: 500; font-size: 12px; color: var(--text-2); }
.tq-bc td b { font-weight: 500; }
.tq-bc .num { text-align: right; }
.tq-bc td.w { white-space: normal; min-width: 160px; }
.tq-bc tbody tr { cursor: pointer; }
.tq-bc tbody tr:hover td { background: var(--hover); }
.tq-qt { padding: 6px 16px 14px; }
.tq-nhom { font-weight: 600; margin: 12px 0 8px; }
.tq-luong { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.tq-mui { align-self: center; width: 12px; height: 12px; flex: none; border-top: 2px solid var(--line-2); border-right: 2px solid var(--line-2); transform: rotate(45deg); margin: 0 5px 0 1px; }
.tq-nut { flex: 0 1 240px; display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--panel); min-width: 0; text-align: left; font: inherit; color: var(--text); }
button.tq-nut { cursor: pointer; }
button.tq-nut:hover { border-color: var(--line-2); background: var(--hover); }
.tq-nut.co { border-color: var(--red); }
.tq-nut.khong { border-style: dashed; }
.tq-so { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--text); color: var(--panel); font-size: 12px; font-weight: 600; }
.tq-nut.khong .tq-so { background: var(--muted); }
.tq-ten { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tq-ten b { font-weight: 600; }
.tq-nut.khong b { font-weight: 500; color: var(--text-2); }
.tq-ten small { color: var(--text-2); font-size: 12px; }
.tq-ten em { font-style: normal; color: var(--red); font-weight: 500; }
@media (max-width: 640px) {
  .tq-os { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tq-luong { flex-direction: column; } .tq-nut { flex: none; } .tq-mui { transform: rotate(135deg); margin: 2px 0 4px 16px; }
  .tq-hang { flex-wrap: wrap; } .tq-hang .tq-dong { flex: 1 0 100%; } .tq-hang > .btn { margin: -4px 14px 9px; }
  .tq-bc table, .tq-bc tbody, .tq-bc tr, .tq-bc td { display: block; width: 100%; } .tq-bc thead { display: none; }
  .tq-bc tr { padding: 7px 14px; border-top: 1px solid var(--line); }
  .tq-bc td { display: flex; justify-content: space-between; gap: 12px; padding: 1px 0; border: 0; white-space: normal; text-align: right; min-width: 0; }
  .tq-bc td::before { content: attr(data-l); color: var(--text-2); text-align: left; white-space: nowrap; }
  .tq-bc td:empty { display: none; } .tq-bc td.w { min-width: 0; }
}
.alist { list-style: none; margin: 0; padding: 0; }
.alist li { display: flex; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line-2); cursor: pointer; font-size: 13px; }
.alist li:hover { background: var(--hover); }
.alist .d { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--blue); }
.alist .bad .d { background: var(--red); } .alist .warn .d { background: var(--orange); }
.mini-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mb-col { background: var(--panel-2); border-radius: 6px; padding: 8px; min-width: 0; }
.mb-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; }
.mb-card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 9px; margin-bottom: 6px; cursor: pointer; font-size: 13px; }
.mb-card:hover { border-color: var(--theme); }
.mb-card.late { border-left: 3px solid var(--red); }
.mb-m { display: flex; justify-content: space-between; color: var(--text-2); font-size: 12px; margin: 2px 0 5px; gap: 6px; }

/* ---------- kanban ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; padding: 0 16px 16px; overflow-x: auto; }
.board-col { background: var(--panel-2); border-radius: 8px; padding: 10px; min-height: 300px; }
.board-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; color: var(--text-2); }
.board-card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin-bottom: 8px; cursor: pointer; }
.board-card:hover { border-color: var(--theme); box-shadow: var(--shadow-widget); }
.board-card.late { border-left: 3px solid var(--red); }
.bc-t { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.bc-m { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-bottom: 5px; gap: 6px; }

/* ---------- trace ---------- */
.trace-search { display: flex; gap: 8px; max-width: 720px; margin-bottom: 16px; }
.trace-search .inp { height: 38px; font-size: 15px; }
.trace-search .btn { height: 38px; }
.tr-card { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 14px; overflow: hidden; }
.tr-h { background: var(--panel-2); padding: 10px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 600; }
.tr-flow { display: flex; gap: 12px; padding: 14px; flex-wrap: wrap; align-items: stretch; }
.tr-node { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; min-width: 220px; }
.tr-node.grow { flex: 1; min-width: 300px; }
.tr-k { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.tr-arrow { display: grid; place-items: center; color: var(--muted); font-size: 18px; }

/* ---------- tasks page ---------- */
/* one equal column per card (4 to 6 depending on the person's rights), all on one row */
.task-sum { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--line); border-radius: 8px; margin: 0 0 16px; overflow: hidden; }
.task-sum > div { padding: 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; border-right: 1px solid var(--line-2); }
.task-sum > div:last-child { border-right: 0; }
.task-sum > div.on { background: var(--theme-soft); }
.task-sum .n { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.task-sum .l { color: var(--text-2); font-size: 13px; }

/* ---------- misc ---------- */
.loading { display: flex; gap: 10px; align-items: center; justify-content: center; color: var(--muted); padding: 60px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--theme); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { color: var(--muted); text-align: center; padding: 40px 16px; }
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--panel); color: var(--text); padding: 9px 16px; border-radius: 6px; box-shadow: var(--shadow-pop); font-size: 14px; max-width: 460px; display: flex; gap: 8px; align-items: center; animation: down .2s ease; }
.toast::before { content: '✓'; width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: #fff; font-size: 11px; display: grid; place-items: center; flex: none; }
.toast.err::before { content: '!'; background: var(--red); }
.toast.out { opacity: 0; transition: .3s; }
@keyframes down { from { opacity: 0; transform: translateY(-8px); } }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--page); }
.login-card { width: min(400px, 100%); background: var(--panel); border-radius: 12px; padding: 32px 28px; box-shadow: var(--shadow-dialog); display: flex; flex-direction: column; gap: 4px; }
.login-card h1 { font-size: 22px; margin: 12px 0 2px; } .login-card p { margin: 0 0 14px; color: var(--text-2); }
.login-card .btn { margin-top: 10px; height: 38px; }
.search-dlg .inp { height: 48px; font-size: 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 0 18px; }
.sr { display: grid; grid-template-columns: 22px auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 16px; cursor: pointer; }
.sr:hover, .sr.hi { background: var(--theme-soft); }
.sr .t { font-size: 12px; color: var(--muted); }
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: 13px; cursor: pointer; }
.hbar .track { height: 10px; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--chart-2), var(--chart)); }
.hbar .val { color: var(--text-2); min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.hbar .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scrim { display: none; }
.mobile-top, .m-only { display: none !important; }

@media print {
  .side, .pane-head, .rec-bar, .rec-side, .dlg-h .icon-btn, .toolbar, .grid-foot, .cmt-in { display: none !important; }
  .mask { position: static; background: none; padding: 0; } .dialog { box-shadow: none; max-height: none; height: auto !important; width: 100% !important; }
  .shell { display: block; } .pane { margin: 0; border: 0; box-shadow: none; }
  .rec-body { display: block; } .rec-main { overflow: visible; }
}

@media (max-width: 1100px) {
  .rec-body { grid-template-columns: minmax(0, 1fr) 280px; }
  .c3, .c4, .c5 { grid-column: span 6; } .c7, .c8 { grid-column: span 12; }
}
@media (max-width: 820px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; --side: 280px; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 90; background: var(--page); transform: translateX(-100%); transition: transform .2s; }
  .menu-open .side { transform: none; box-shadow: var(--shadow-dialog); }
  .menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .3); }
  .pane { margin: 0; border-radius: 0; border: 0; }
  .mobile-top { display: inline-grid !important; }
  .m-only { display: block !important; }
  .form-grid, .fv-grid { grid-template-columns: minmax(0, 1fr); }
  .c3, .c4, .c5, .c6 { grid-column: span 12; }
  .mini-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { padding: 10px 12px; } .grid-wrap { margin: 0 12px; } .search-box { width: 100%; }
  .toolbar .tools-r { margin-left: 0; width: 100%; }
  .dialog.lg, .dialog.md { width: 100%; height: 100%; max-height: none; border-radius: 0; } .mask { padding: 0; }
  .rec-body { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow: auto; } .rec-main { overflow: visible; } .rec-side { border-left: 0; border-top: 1px solid var(--line-2); min-height: 380px; }
  .task-sum { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .board { grid-template-columns: repeat(4, 260px); }
  .big-n { font-size: 44px; }
  .form-body { padding: 12px 14px 20px; } .form-foot { padding: 10px 14px; }
  /* phones: long section titles wrap, footer and page-header buttons go to a second line instead of running off screen */
  .sep .sep-label, .form-grid .sep .sep-label { white-space: normal; line-height: 1.35; padding-top: 4px; padding-bottom: 4px; }
  .form-page .form-foot { flex-wrap: wrap; } .form-page .form-foot .btn { white-space: normal; height: auto; min-height: 32px; }
  .shell .pane-head { height: auto; min-height: 51px; flex-wrap: wrap; row-gap: 6px; padding-top: 6px; padding-bottom: 6px; }
}

/* ---------- data import wizard ---------- */
.imp-steps { display: flex; gap: 8px; margin-bottom: 18px; }
.imp-step { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r); background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: 13px; }
.imp-step span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--text-2); font-size: 12px; flex: none; }
.imp-step.on { background: var(--theme-soft); color: var(--theme); } .imp-step.on span { background: var(--theme); color: #fff; }
.imp-step.done { color: var(--text-2); } .imp-step.done span { background: var(--green); color: #fff; }
.imp-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); margin: 12px 0; }
.imp-num { width: 26px; height: 26px; border-radius: 50%; background: var(--theme); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.imp-cols { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.imp-col { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line); cursor: help; }
.imp-col.req { background: var(--orange-soft); color: var(--orange); border-color: transparent; }
.imp-drop { border: 1.5px dashed var(--input); border-radius: var(--r-lg); padding: 32px 16px; text-align: center; color: var(--text-2); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: .15s; }
.imp-drop:hover, .imp-drop.over { border-color: var(--theme); background: var(--theme-soft); color: var(--theme); }
.imp-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.imp-sum > div { padding: 10px 12px; border-radius: var(--r); background: var(--panel-2); display: flex; flex-direction: column; }
.imp-sum b { font-size: 22px; line-height: 1.2; } .imp-sum span { font-size: 12px; color: var(--text-2); }
.imp-sum .g b { color: var(--green-text); } .imp-sum .b b { color: var(--blue); } .imp-sum .r b { color: var(--red); }
.imp-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.imp-table { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); }
.imp-table thead th { position: sticky; top: 0; background: var(--panel-2); z-index: 1; }
.imp-table tr.imp-bad td { background: var(--red-soft); }
.imp-table td.imp-err { color: var(--red); white-space: normal; min-width: 260px; }
.alert-bar.warn { background: var(--orange-soft); color: var(--orange); }
.imp-done { text-align: center; padding: 12px 0; } .imp-done h3 { margin: 8px 0 16px; }
.imp-ok { width: 52px; height: 52px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 26px; margin: 0 auto; }
@media (max-width: 640px) { .imp-steps { flex-direction: column; } .imp-card { flex-wrap: wrap; } }
.imp-gh { font-size: 14px; margin: 18px 0 8px; color: var(--text-2); }
.imp-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.imp-tile { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--panel); box-shadow: var(--shadow-widget); }
.imp-tile.off { opacity: .7; } .imp-tt { font-weight: 600; }
.imp-ta { display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: 6px; }

/* ---------- document gallery & viewer ---------- */
.doc-ic.word { background: var(--blue); } .doc-ic.big { width: 44px; height: 54px; font-size: 12px; border-radius: 5px; }
.doc-list li.click { cursor: pointer; } .doc-list li.click:hover { background: var(--hover); }
.doc-n small { display: block; } .doc-n small.doc-note { color: var(--text-2); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.up-note { flex: 1; min-width: 180px; max-width: 360px; }
.doc-tools { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.seg { display: inline-flex; border: 1px solid var(--input); border-radius: var(--r); overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 4px 8px; color: var(--text-2); display: grid; place-items: center; }
.seg button + button { border-left: 1px solid var(--input); } .seg button.on { background: var(--theme-soft); color: var(--theme); }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.doc-lib { flex: 1; overflow: auto; padding: 4px 16px 16px; } .doc-lib .doc-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.doc-card { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--panel); cursor: pointer; display: flex; flex-direction: column; transition: box-shadow .15s, border-color .15s; }
.doc-card:hover { border-color: var(--theme); box-shadow: var(--shadow-widget); }
.dc-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line-2); }
.dt-img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.dt-ph { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; }
.dc-note { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.dc-b { padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dc-n { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-m { display: flex; gap: 6px; align-items: center; font-size: 12px; min-width: 0; } .dc-m .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-nt { font-size: 12px; color: var(--text-2); background: var(--orange-soft); border-radius: 4px; padding: 3px 6px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.viewer-mask { padding: 2vh 2vw; }
.viewer { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-dialog); width: 100%; height: 100%; max-width: 1500px; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; }
.vw-h { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.vw-h b { min-width: 0; max-width: 50%; }
.vw-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 320px; min-height: 0; }
.vw-stage { position: relative; background: #525659; display: flex; min-height: 0; }
.vw-pdf { flex: 1; border: 0; width: 100%; height: 100%; background: #525659; }
.vw-img { flex: 1; overflow: auto; display: grid; place-items: center; cursor: zoom-in; padding: 16px; }
.vw-img img { max-width: 100%; max-height: calc(96vh - 90px); object-fit: contain; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.3); }
.vw-img.zoom { cursor: zoom-out; place-items: start center; } .vw-img.zoom img { max-width: none; max-height: none; }
.vw-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; color: #e6e6e6; text-align: center; padding: 24px; }
.vw-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center; }
.vw-nav:hover { background: rgba(0,0,0,.7); } .vw-nav.l { left: 12px; } .vw-nav.r { right: 12px; }
.vw-side { border-left: 1px solid var(--line); padding: 14px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.vw-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vw-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; margin: 14px 0; padding-top: 12px; border-top: 1px dashed var(--line); }
.vw-info dt { color: var(--muted); } .vw-info dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.danger-t { color: var(--red); align-self: flex-start; }
@media (max-width: 860px) {
  .viewer-mask { padding: 0; } .viewer { border-radius: 0; }
  .vw-body { grid-template-columns: 1fr; grid-template-rows: minmax(55vh, 1fr) auto; overflow: auto; }
  .vw-side { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .vw-h .btn .lbl { display: none; }
  .doc-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* ---------- order notes / watch-outs ---------- */
.notes { display: flex; flex-direction: column; gap: 8px; }
.nt-comp { border: 1px solid var(--input); border-radius: var(--r); padding: 8px; background: var(--panel); }
.nt-comp textarea { border: 0; padding: 4px; resize: vertical; box-shadow: none !important; }
.nt-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.nt-card { border: 1px solid var(--line); border-left: 4px solid var(--grey-tag); border-radius: var(--r); padding: 8px 10px; background: var(--panel); }
.nt-card.t-red { border-left-color: var(--red); } .nt-card.t-violet { border-left-color: var(--violet); } .nt-card.t-orange { border-left-color: var(--orange); }
.nt-card.t-cyan { border-left-color: var(--cyan); } .nt-card.t-blue { border-left-color: var(--blue); } .nt-card.t-green { border-left-color: var(--green); }
.nt-card.pin { background: var(--yellow-soft); }
.nt-card.done { opacity: .65; } .nt-card.done .nt-body { text-decoration: line-through; text-decoration-color: var(--muted); }
.nt-top { display: flex; align-items: center; gap: 6px; min-height: 26px; }
.nt-pin { font-size: 13px; } .nt-act { display: flex; align-items: center; gap: 2px; }
.nt-act .icon-btn { font-size: 12px; }
.nt-body { white-space: pre-wrap; font-size: 14px; margin: 4px 0; overflow-wrap: anywhere; }
.nt-meta { font-size: 12px; color: var(--muted); }
.nt-sub { font-size: 12px; font-weight: 600; color: var(--text-2); margin-top: 4px; }
.nt-remind { background: var(--yellow-soft); border: 1px solid var(--yellow); border-radius: var(--r); padding: 8px 12px; margin-bottom: 12px; font-size: 13px; color: var(--text); }
.nt-remind b { color: var(--yellow); } .nt-remind ul { margin: 6px 0 0; padding-left: 18px; } .nt-remind li { margin: 3px 0; }

/* ---------- stock vouchers ---------- */
.purpose-opts, .qc-opts { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.qc-opt { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--input); border-radius: 16px; font-size: 13px; cursor: pointer; background: var(--panel); user-select: none; }
.qc-opt input { margin: 0; accent-color: var(--theme); }
.qc-opt.on { border-color: var(--theme); background: var(--theme-soft); color: var(--theme); font-weight: 600; }
.qc-opt.on.green { border-color: var(--green); background: var(--green-soft); color: var(--green-text); }
.qc-opt.on.red { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.qc-opt.on.orange { border-color: var(--orange); background: var(--orange-soft); color: var(--orange); }
.qc-opt.on.yellow { border-color: var(--yellow); background: var(--yellow-soft); color: var(--yellow); }
.qc-opt.on.blue { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.qc-box { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.qc-foot { display: flex; align-items: center; gap: 8px; }
.att-list { display: flex; flex-direction: column; gap: 6px; }
.att-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); font-size: 13px; }

/* ---------- tax-code lookup ---------- */
.tax-in { display: flex; gap: 8px; } .tax-in .inp { flex: 1; min-width: 0; } .tax-in .btn { white-space: nowrap; }
.tax-err { margin-top: 6px; padding: 6px 10px; border-radius: var(--r); background: var(--red-soft); color: var(--red); font-size: 13px; }
.tax-card { margin-top: 8px; border: 1px solid var(--green); background: var(--green-soft); border-radius: var(--r-lg); padding: 10px 12px; font-size: 13px; }
.tax-card.bad { border-color: var(--red); background: var(--red-soft); }
.tax-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tax-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; } .tax-card dt { color: var(--text-2); } .tax-card dd { margin: 0; overflow-wrap: anywhere; }
.tax-warn { margin-top: 8px; padding: 6px 10px; border-radius: var(--r); background: var(--panel); color: var(--red); border: 1px solid var(--red); }
.tax-diff { margin-top: 8px; padding: 6px 10px; border-radius: var(--r); background: var(--panel); border: 1px dashed var(--input); display: flex; flex-direction: column; gap: 2px; }
.tax-f { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tax-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- period filter ---------- */
.period { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border: 1px solid var(--input); border-radius: var(--r); background: var(--panel); font-size: 13px; flex-wrap: wrap; }
.period.on { border-color: var(--theme); background: var(--theme-soft); }
.period-l { color: var(--text-2); white-space: nowrap; } .period.on .period-l { color: var(--theme); font-weight: 600; }
.period .inp.sm { width: auto; min-width: 0; border-color: transparent; background: transparent; padding-left: 4px; padding-right: 4px; }
.period .inp.sm:focus { border-color: var(--theme); background: var(--panel); }
.period select.inp.sm { font-weight: 600; }
.period-r { color: var(--text-2); font-size: 12px; white-space: nowrap; padding-right: 6px; }
@media (max-width: 640px) { .period { width: 100%; } }
.tbl tr.carry td { background: var(--panel-2); color: var(--text-2); }

/* ---------- photo attachments in forms / lists ---------- */
.att-photos { border: 1px dashed var(--input); border-radius: var(--r-lg); padding: 10px 12px; margin-bottom: 14px; }
.att-photos.need { border-color: var(--red); background: var(--red-soft); }
.att-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.req-tag { font-size: 11px; color: #fff; background: var(--red); border-radius: 8px; padding: 0 7px; }
.att-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.att-th { position: relative; width: 88px; height: 88px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); display: grid; place-items: center; }
.att-th img { width: 100%; height: 100%; object-fit: cover; }
.att-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; line-height: 20px; padding: 0; }
.att-add { width: 88px; height: 88px; border-radius: var(--r); border: 1px dashed var(--input); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-2); font-size: 12px; cursor: pointer; background: var(--panel); }
.att-add:hover { border-color: var(--theme); color: var(--theme); }
.ph-cell { display: inline-flex; align-items: center; gap: 6px; }
.ph-th { width: 34px; height: 34px; border-radius: 4px; overflow: hidden; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); }
.ph-th .dt-img { object-position: center; } .ph-th .doc-ic.big { width: 22px; height: 26px; font-size: 8px; } .ph-th .dt-ph small { display: none; }

/* ---------- payables: bill picker ---------- */
.bill-pick .tbl tr.on td { background: var(--theme-soft); }
.bill-pick .inp.sm { width: 100%; text-align: right; }
.bill-pick-f { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }

/* ---------- BOM: automatic conversion under a norm (R31) and an SO's own BOM (R30) ---------- */
.conv { display: block; font-size: 11.5px; line-height: 1.4; color: var(--text-2); font-weight: 400; white-space: nowrap; }
.conv.odd { display: inline-block; color: var(--yellow); background: var(--yellow-soft); border-radius: 4px; padding: 0 5px; margin-top: 2px; }
.conv-note { display: block; font-size: 11.5px; line-height: 1.4; color: var(--text-2); white-space: normal; }
tr.bom-off > td.bo-c, tr.bom-off > td.bo-q { text-decoration: line-through; opacity: .6; }
.bom-ch { color: var(--orange); font-weight: 600; }
.lot-diff.neg { color: var(--red); } .lot-diff.pos { color: var(--orange); }

/* R36: trees on a phone (vertical, a level per tap) and the reason of a node that is off */
.vtree { display: flex; flex-direction: column; gap: 8px; }
.vt-node { border: 1px solid var(--line); border-radius: 14px; background: transparent; }
.vt-node > summary { list-style: none; cursor: pointer; padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; }
.vt-node > summary::-webkit-details-marker { display: none; }
.vt-node[open] > summary { border-bottom: 1px dashed var(--line); }
.vt-l { font-size: 11px; color: var(--muted); }
.vt-h { min-width: 0; }
.vt-kids { padding: 8px 8px 8px 14px; display: flex; flex-direction: column; gap: 8px; }
.vt-leaf { padding: 6px 4px; display: flex; flex-direction: column; gap: 3px; }
.vt-leaf + .vt-leaf { border-top: 1px dashed var(--line); }
.vt-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.vt-k { color: var(--muted); flex: none; }
.vt-v { text-align: right; min-width: 0; }
.node-reason { display: flex; gap: 4px; align-items: center; margin-top: 4px; }
.node-reason .inp { min-width: 140px; }
.tree-tbl .note-f.compact { margin-top: 4px; }
/* R40 packaging hold order: drag handle + ▲ ▼ (phone) on each line */
.drag-h { cursor: grab; color: var(--muted); display: inline-flex; vertical-align: middle; margin-right: 4px; }
.mv-btns { display: inline-flex; gap: 2px; margin-left: 6px; vertical-align: middle; }
tr.dragging { opacity: .5; }
@media (hover: none) { .drag-h { display: none; } }
/* R41 samples: a small photo in lists; the current sample among its versions */
.smp-ph { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; display: block; background: var(--readonly); }
.smp-ph.none { opacity: .35; }
.chip.on { background: var(--theme-soft); color: var(--theme); font-weight: 600; }
/* R46 Tỷ lệ hương, Tính nhanh: the number boxes inside the table rows */
.fl-in { display: block; width: 120px; } .fl-in .inp { height: 30px; padding: 4px 8px; text-align: right; }
/* 18/10/2026: a list on a phone is a column of cards (ui.js ListView), as the trees are */
.lv-card { border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; display: flex; flex-direction: column; gap: 3px; }
.lv-card.click { cursor: pointer; }
.lv-card.click:active { background: rgba(47, 123, 246, .05); }
.lv-h { font-weight: 600; margin-bottom: 2px; min-width: 0; }
/* ---- Mẫu biểu tự điền (pages/maubieu.js, 19/10/2026): templates on the left, the form on the right; green = filled by the app, yellow = typed ---- */
.mb-cols { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 14px; align-items: start; }
.mb-list { display: grid; gap: 2px; align-content: start; max-height: calc(100vh - 170px); overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--glass); backdrop-filter: blur(12px); }
.mb-q { border: 1px solid var(--input); border-radius: var(--r); padding: 6px 10px; background: var(--panel); color: var(--text); font: inherit; margin-bottom: 4px; }
.mb-g { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 10px 6px 2px; }
.mb-it { display: flex; gap: 8px; align-items: center; text-align: left; border: 0; background: transparent; color: var(--text); padding: 6px 8px; border-radius: var(--r); font: inherit; font-size: 13px; cursor: pointer; }
.mb-it:hover { background: var(--hover); } .mb-it.on { background: var(--selected); font-weight: 600; }
.mb-n { font-variant-numeric: tabular-nums; color: var(--muted); width: 22px; flex: none; }
.mb-nm { flex: 1; min-width: 0; line-height: 1.3; }
.mb-meter { width: 32px; height: 5px; border-radius: 3px; background: var(--yellow-soft); overflow: hidden; flex: none; } .mb-meter i { display: block; height: 100%; background: var(--green); }
.mb-main { min-width: 0; }
.mb-fill { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--glass); backdrop-filter: blur(12px); box-shadow: var(--shadow-widget); }
.mb-head { font-size: 15px; }
.mb-src { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.mb-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 4px 10px; }
.mb-f { display: grid; grid-template-columns: 10px minmax(110px, 40%) minmax(0, 1fr); gap: 8px; align-items: center; padding: 4px 8px; border-radius: var(--r); font-size: 13px; }
.mb-f.a { background: var(--green-soft); } .mb-f.a.none { background: var(--readonly); } .mb-f.h { background: var(--yellow-soft); }
.mb-k { color: var(--text-2); overflow-wrap: anywhere; } .mb-v { min-width: 0; overflow-wrap: anywhere; }
.mb-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; } .mb-dot.a { background: var(--green); } .mb-dot.h { background: var(--yellow); }
.mb-in { width: 100%; box-sizing: border-box; border: 1px dashed var(--yellow); border-radius: 6px; padding: 3px 8px; background: var(--panel); color: var(--text); font: inherit; }
.mb-sum { color: var(--muted); }
.mb-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .mb-act .grow { flex: 1; }
.mb-note { border: 1px solid var(--input); border-radius: var(--r); padding: 5px 9px; background: var(--panel); color: var(--text); font: inherit; font-size: 13px; min-width: 200px; }
.mb-vers { display: flex; flex-wrap: wrap; gap: 6px 12px; } .mb-vers a.on { font-weight: 600; }
.mb-frame { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: var(--r); background: #e9ecf1; }
.mb-row-act { display: inline-flex; gap: 10px; }
.mb-spots { display: grid; gap: 4px; max-height: 40vh; overflow: auto; }
.mb-spot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px; align-items: center; font-size: 13px; padding: 3px 6px; border-radius: var(--r); background: var(--yellow-soft); }
@media (max-width: 860px) { .mb-cols { grid-template-columns: minmax(0, 1fr); } .mb-list { max-height: 260px; } .mb-fields { grid-template-columns: minmax(0, 1fr); } }
.mb-wait { padding: 6px 2px; } .mb-lack { padding: 6px 10px; border-radius: var(--r); background: var(--orange-soft); color: var(--text); }
.pay-marks { display: grid; gap: 2px; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* the PO tab as a file per PO (pages/potap.js, owner 24/10/2026, preview v18): HỒ SƠ's list and folder (theme.css hs-*), black and
   grey only, bold for an item's row and the totals (U-08), codes and numbers on one line (U-09) */
.pt-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.pt-app { grid-template-columns: 220px minmax(0, 1fr); }
.pt-grp { padding: 10px 10px 4px; font-weight: 600; white-space: nowrap; border-top: 1px solid var(--line); }
.pt-grp:first-child { border-top: 0; }
.pt-grpb { display: flex; align-items: baseline; gap: 6px; width: 100%; font: inherit; font-weight: 600; text-align: left; color: var(--text); background: none; border-left: 0; border-right: 0; border-bottom: 0; cursor: pointer; padding-bottom: 8px; }
.pt-grpb > span:first-child { flex: 1; }
.pt-grpb::before { content: "▸"; color: var(--muted); font-weight: 400; width: 12px; }
.pt-grpb.open::before { content: "▾"; }
.pt-grpb:hover { background: var(--hover); }
.hs-list .pt-it { padding-left: 22px; }
.hs-list .pt-it { grid-template-columns: minmax(0, 1fr); }
.pt-it b, .pt-it .small { white-space: nowrap; }
.pt-owe { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-grid { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 14px; align-items: start; }
@media (max-width: 1500px) { .pt-grid { grid-template-columns: minmax(0, 1fr); } .pt-side { position: static; } }
.pt-main { display: grid; gap: 14px; min-width: 0; } .pt-main > * { min-width: 0; }
.pt-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--text-2); margin-top: -6px; }
.pt-ans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 900px) { .pt-ans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pt-ans a, .pt-ans .pt-card { display: grid; align-content: start; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); color: inherit; text-decoration: none; }
.pt-ans .pt-card { font: inherit; text-align: left; background: transparent; cursor: pointer; }
.pt-ans a:hover, .pt-ans .pt-card:hover, .pt-ans .pt-card.on { border-color: var(--text-2); }
/* the compartments as tabs under the four figures; an item's child rows folded under it (owner 25/10/2026, Q118, Q119) */
.pt-subs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: -6px; }
.pt-subs button { font: inherit; background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.pt-subs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
/* owner 26/10/2026: "BỎ MẤY MŨI TÊN NÀY ĐI" — no ▸ / ▾; a click on the row still opens / folds it */
.pt-t tr.pt-fold { cursor: pointer; }
.pt-t tr.pt-fold:hover td { background: var(--hover); }
/* the figures as sums that close (Q126): name, quantity, value; the signs between them */
.pt-sums { display: grid; gap: 6px; }
/* one sum on one line: its boxes share the width, the signs between them take what they need (columns set per row) */
.pt-sum { display: grid; align-items: stretch; gap: 4px; }
.pt-op { align-self: center; font-size: 16px; color: var(--muted); min-width: 10px; text-align: center; }
.pt-app.pt-app-w { grid-template-columns: 270px minmax(0, 1fr); }
.pt-app.pt-nolist { grid-template-columns: minmax(0, 1fr); }
.pt-app.pt-nolist > .hs-list { display: none; }
.pt-app > .hs-list { overflow-x: hidden; }
.pt-t .dp-clip { display: none; }
table.hs-t.pt-t th, table.hs-t.pt-t td { padding: 5px 4px; font-size: 13px; }
.pt-box { min-width: 0; overflow: hidden; display: grid; align-content: start; gap: 1px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pt-box:hover, .pt-box.on { border-color: var(--text-2); }
.pt-box .k { font-size: 12px; line-height: 1.3; color: var(--muted); }
.pt-box .q, .pt-box .v { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-box .q { font-size: 12.5px; }
.pt-box .v { font-size: 14px; font-weight: 600; }
/* a file's tables: headings on one line, no pin / filter tools (Q125: "hiển thị gớm quá") */
.pt-t th, .pt-t th.n { white-space: nowrap; }
/* the left list of the ORD tab: each ORD a small block with its figures, its products under it (Q125) */
.pt-ord { display: grid; gap: 1px; }
.pt-ord .r { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pt-ord .r span:last-child { color: var(--text); white-space: nowrap; }
.pt-tp { display: flex; justify-content: space-between; gap: 6px; width: 100%; font: inherit; font-size: 12px; text-align: left; color: var(--text-2); background: none; border: 0; padding: 3px 8px 3px 22px; cursor: pointer; font-variant-numeric: tabular-nums; }
.pt-tp:hover { background: var(--hover); }
.pt-tp span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-tp span:last-child { white-space: nowrap; }
.pt-ans .k { font-size: 12px; color: var(--muted); } .pt-ans .v { font-size: clamp(13px, 1.3vw, 17px); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-ans > * { min-width: 0; } .pt-ans .h { font-size: 11.5px; color: var(--muted); }
.hs-ngan.pt-open { overflow: visible; }
.pt-t td.n, .pt-t th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-t td.nw { white-space: nowrap; }
table.hs-t.pt-t { min-width: 0; }
table.hs-t.pt-t th, table.hs-t.pt-t td { padding: 5px 4px; font-size: 13px; }
.pt-t th.n { min-width: 64px; }
.pt-t tr.pt-par td { font-weight: 600; border-top: 1px solid var(--text-2); }
.pt-t tr.pt-par td.pt-plain { font-weight: 400; }
.pt-t tr.pt-shut { visibility: collapse; }
.pt-t tr.pt-kid td { color: var(--text-2); }
.pt-t tr.pt-kid td:first-child { padding-left: 24px; }
.pt-t tr.pt-tot td { font-weight: 600; border-top: 1px solid var(--text-2); }
.pt-addm { position: relative; }
.pt-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 190px; display: grid; gap: 2px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.pt-menu button { font: inherit; font-size: 13px; text-align: left; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; }
.pt-menu button:hover, .pt-menu button:focus-visible { background: var(--hover); outline: none; }
.pt-side { display: grid; gap: 4px; position: sticky; top: 12px; }
.pt-side label { font-size: 12px; color: var(--muted); }
/* the notes column hidden (tapkit.js NoteSide): only its name, the page takes the room */
@media (min-width: 1501px) { .pt-grid:has(> .pt-side.off) { grid-template-columns: minmax(0, 1fr) auto; } }
.pt-side-h { display: flex; align-items: center; gap: 8px; }
.pt-side-h .pt-fl { margin-left: auto; }
.pt-side textarea { font: inherit; font-size: 13px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-height: 90px; resize: vertical; }
.pt-why { padding: 4px 2px; border-top: 1px solid var(--line); color: var(--text-2); overflow-wrap: anywhere; }
/* a phone: the list above the file, each sum read down (its boxes one under the other, the signs between them) */
@media (max-width: 760px) {
  .pt-app.pt-app-w { grid-template-columns: minmax(0, 1fr); }
  .pt-sum { grid-template-columns: minmax(0, 1fr) !important; gap: 2px; }
  .pt-op { text-align: left; padding-left: 10px; line-height: 1; }
}
/* the left list of the ORD tab as a small table (Q125, Q129): ORD parent rows that fold, product child rows that link */
.pt-app.pt-app-w { grid-template-columns: 280px minmax(0, 1fr); }
table.pt-lt { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
table.pt-lt th { font-weight: 500; color: var(--muted); text-align: left; padding: 4px 4px; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.pt-lt td { padding: 4px 4px; border-bottom: 1px solid var(--line); }
table.pt-lt .n { text-align: right; white-space: nowrap; }
table.pt-lt tr.pt-lo { cursor: pointer; font-weight: 600; }
table.pt-lt tr.pt-lo.on td { background: var(--selected); }
table.pt-lt tr.pt-lo:hover td { background: var(--hover); }
table.pt-lt tr.pt-lc td:first-child { padding-left: 22px; }
table.pt-lt tr.pt-lc td { color: var(--text-2); }
.pt-fb { font: inherit; background: none; border: 0; color: var(--muted); cursor: pointer; width: 16px; padding: 0; }
@media (max-width: 760px) { .pt-app.pt-app-w { grid-template-columns: minmax(0, 1fr); } }
.pt-app.pt-app-w.pt-nolist { grid-template-columns: minmax(0, 1fr); }
.pt-ans .pt-card { overflow: hidden; }
button.pt-lot { font: inherit; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; text-decoration: underline dotted; }
/* a product's receipts: a table of their own under the product's row */
.pt-t tr.pt-subrow > td { padding: 2px 0 8px 14px; }
table.pt-t.pt-sub { width: 100%; font-size: 12.5px; }
table.pt-t.pt-sub th { font-size: 11.5px; padding: 3px 6px; border-bottom: 1px solid var(--line); }
table.pt-t.pt-sub td { padding: 3px 6px; border-bottom: 1px solid var(--line); }
/* the ORD tab's left list as a tree (Q129): the factory, its ORDs (each its figures under its name, folding), their products indented
   under a guide line, each a link */
.pt-tree { display: grid; }
.pt-tree .o { display: grid; gap: 1px; padding: 6px 8px 6px 6px; border-radius: 8px; cursor: pointer; }
.pt-tree .o:hover { background: var(--hover); }
.pt-tree .o.on { background: var(--selected); }
.pt-tree .o .h { display: flex; align-items: center; gap: 4px; font-weight: 600; }
.pt-tree .o .r { display: flex; justify-content: space-between; gap: 8px; padding-left: 20px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pt-tree .o .r span:last-child { color: var(--text); white-space: nowrap; }
.pt-tree .kids { margin: 0 0 6px 15px; padding-left: 8px; border-left: 1px solid var(--line); display: grid; }
.pt-tree .kids a { display: flex; justify-content: space-between; gap: 8px; padding: 3px 6px; font-size: 12px; border-radius: 6px; text-decoration: none; font-variant-numeric: tabular-nums; }
.pt-tree .kids a:hover { background: var(--hover); }
.pt-tree .kids a span:last-child { color: var(--text-2); white-space: nowrap; }
.pt-lots { white-space: nowrap; }
.pt-t .pt-mini { padding: 0; height: auto; min-height: 0; font-size: 12px; }
.shell.collapsed .node.child { display: none; }
.side-nav .node.child { height: 30px; font-size: 13px; }
.side-nav .node.child.on { font-weight: 600; }
/* Lập ORD as a box in the middle (owner 26/10/2026: "1 popup riêng vừa vặn thôi … TỐI GIẢN ĐI"): as wide as its table, scrolls inside */
.dialog.form-pop { width: min(1240px, 100%); }
.dialog.form-pop .form-page { flex: 1 1 auto; min-height: 0; overflow-y: auto; max-width: none; width: 100%; }
.ord-more td { border-top: 0; padding-top: 0; }
.ord-more-f { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 13px; color: var(--muted); }
.ord-more-f label { display: flex; align-items: center; gap: 6px; }
.ord-more-f .inp, .ord-more-f .sel { width: 130px; }
.pack-split .pack-h { font-weight: 600; margin: 10px 0 4px; }
.pack-split .pack-h:first-child { margin-top: 0; }
.pack-split .pt-lt-n { border-bottom: 1px dotted var(--muted); cursor: help; }
/* owner 26/10/2026: "căn giữa các dòng đi, giữa chiều trên dưới ấy": the tap tables' cells sit in the middle of their row */
table.hs-t.pt-t td { vertical-align: middle; }
.pt-lbar { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 6px; }
.pt-fl { font-size: 15px; line-height: 1; color: var(--muted); }
.ord-head { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 14px; }
@media (max-width: 760px) { .ord-head { grid-template-columns: minmax(0, 1fr); } }
/* Q134: the "KM" beside a price on the ORD form — filled: taken off the KM deposit; outlined: owed outside KM */
.km-cell { display: flex; align-items: center; gap: 4px; }
.km-cell .inp, .km-cell input { min-width: 0; flex: 1; }
.km-chip { font: inherit; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: none; color: var(--muted); cursor: pointer; }
.km-chip.on { border-color: var(--text); color: var(--text); }
.km-chip:disabled { opacity: .35; cursor: default; }
.ord-tot td { font-weight: 600; border-top: 1px solid var(--line-2); }
/* the ORD form keeps its Tổng row with one line too (owner 26/10/2026: "không chọn không thấy dòng tổng, chọn không ra"; the dialogs' rule
 hides a total equal to its only row) */
.dialog table.ord-lines > tfoot { display: table-footer-group !important; }
.pack-split .pack-code { padding: 0; height: auto; min-height: 0; font: inherit; background: none !important; border: 0; box-shadow: none; }
.pack-card { position: fixed; z-index: 1000; width: 280px; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow-dialog); font-size: 13px; display: grid; gap: 3px; }
.pack-card { background: var(--glass-strong, var(--panel)); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); }
.pack-split .pack-card { background: rgba(255, 255, 255, .97) !important; }
:root[data-theme="dark"] .pack-split .pack-card { background: rgba(36, 36, 40, .97) !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pack-split .pack-card { background: rgba(36, 36, 40, .97) !important; } }
.pack-split th.pack-grp { text-align: center; border-bottom: 1px solid var(--line-2); }
/* the box's buttons sit on a solid strip: the rows scrolling under them no longer show through (owner 26/10/2026: "lỗi kìa") */
.dialog.form-pop .form-foot { background: rgba(255, 255, 255, .97) !important; }
:root[data-theme="dark"] .dialog.form-pop .form-foot { background: rgba(36, 36, 40, .97) !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dialog.form-pop .form-foot { background: rgba(36, 36, 40, .97) !important; } }
/* the menu: a heading is a parent row that folds its modules, the modules under it indented, no icon before a module (owner 26/10/2026);
   the menu shrunk to icons keeps the icons (nothing else to click there) */
.nav-sec.nav-sec-p { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 12px 20px 4px; }
.nav-sec.nav-sec-p:hover { color: var(--text); }
.shell:not(.collapsed) .side-nav .node > svg, .shell:not(.collapsed) .side-nav .node > .ei { display: none; }
.shell:not(.collapsed) .side-nav .nav-kid > .node:not(.child) { padding-left: 28px; }
.shell:not(.collapsed) .side-nav .nav-kid .node.child { padding-left: 44px; }
.shell.collapsed .nav-sec.nav-sec-p { visibility: hidden; height: 8px; padding: 0; }

/* Mẫu giao diện (/mau-giao-dien, pages/maugd.js, Q144): the lists of the set on the left (as on ui.shadcn.com/create), the set shown
   with the app's own pieces on the right; only this page's layout, the pieces keep the app's real classes */
.gd { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.gd-panel { position: sticky; top: 12px; display: grid; gap: 6px; max-height: calc(100vh - 90px); overflow: auto; padding: 14px; background: var(--panel); border-radius: var(--sc-radius-xl, 12px); box-shadow: 0 0 0 1px color-mix(in oklch, var(--text) 8%, transparent); }
.gd-ph { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 6px; }
.gd-code { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); user-select: all; }
.gd-pick { border-radius: var(--sc-radius-lg, 10px); }
.gd-pick.on { background: color-mix(in oklch, var(--sc-muted) 60%, transparent); }
.gd-pick-h { display: grid; width: 100%; gap: 1px; padding: 8px 10px; text-align: left; background: none; border: 0; border-radius: inherit; font: inherit; color: var(--text); cursor: pointer; }
.gd-pick-h:hover { background: var(--hover); }
.gd-k { font-size: 12px; color: var(--muted); } .gd-v { font-weight: 500; }
.gd-list { display: grid; gap: 1px; padding: 0 4px 8px; max-height: 320px; overflow: auto; }
.gd-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; text-align: left; background: none; border: 0; border-radius: var(--sc-radius-md, 8px); font: inherit; color: var(--text); cursor: pointer; }
.gd-opt > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.gd-opt:hover { background: var(--hover); } .gd-opt.on { background: var(--sc-accent); color: var(--sc-accent-foreground); font-weight: 500; }
.gd-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px color-mix(in oklch, var(--text) 12%, transparent); }
.gd-note { display: block; font-size: 12px; color: var(--muted); padding: 2px 8px; }
.gd-opt .gd-note { padding: 0; text-align: right; }
.gd-paste { display: flex; gap: 6px; padding: 6px 4px 0; } .gd-paste .inp { flex: 1; min-width: 0; }
.gd-act { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 4px 4px; }
.gd-show { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; min-width: 0; }
.gd-card { display: grid; gap: 12px; align-content: start; min-width: 0; }
.gd-card h3 { margin: 0; font-size: 15px; } .gd-card p { margin: 0; }
.gd-wide { grid-column: 1 / -1; }
.gd-h { margin: 0; font-size: 22px; font-weight: 600; }
.gd-sws { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.gd-sw { display: grid; gap: 2px; font-size: 12px; } .gd-sw > span { height: 44px; border-radius: var(--sc-radius-md, 8px); box-shadow: 0 0 0 1px color-mix(in oklch, var(--text) 10%, transparent); }
.gd-sw code { color: var(--muted); font-size: 11px; }
.gd-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gd-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gd-empty .empty { display: grid; gap: 10px; justify-items: center; }
.gd-prog { display: grid; grid-template-columns: 110px 1fr 40px; align-items: center; gap: 10px; }
@media (max-width: 900px) { .gd { grid-template-columns: minmax(0, 1fr); } .gd-panel { position: static; max-height: none; } .gd-show { grid-template-columns: minmax(0, 1fr); } .gd-fields { grid-template-columns: 1fr; } }
.gd-ics { display: inline-flex; gap: 4px; color: var(--sc-muted-foreground); }
/* the sample page: the set, the kinds of pieces (as /create's list), the pieces (Q147) */
.gd.gd3 { grid-template-columns: 280px 180px minmax(0, 1fr); }
.gd-nav { position: sticky; top: 12px; display: grid; gap: 1px; max-height: calc(100vh - 90px); overflow: auto; align-content: start; }
.gd-nav .gd-opt { padding: 4px 8px; font-size: 13px; } .gd-nav .gd-opt:disabled { opacity: .45; cursor: default; }
.gd-navsel { display: none; }
.gd-main { min-width: 0; }
@media (max-width: 1279px) { .gd.gd3 { grid-template-columns: 280px minmax(0, 1fr); } .gd-nav { display: none; } .gd-navsel { display: block; grid-column: 2; } .gd3 > .gd-main, .gd3 > .gd-show { grid-column: 2; } .gd3 > .gd-panel { grid-row: span 2; } }
@media (max-width: 900px) { .gd.gd3 { grid-template-columns: minmax(0, 1fr); } .gd-navsel, .gd3 > .gd-main, .gd3 > .gd-show { grid-column: 1; } .gd3 > .gd-panel { grid-row: auto; } }
/* the left list of a file page (ORD, PO): an item's name wraps inside the narrow column (Q162); the row picked on the left and its row
   on the right carry a dark bar on their left edge, the right row a light ground too (Q166; black and grey only, U-08) */
.pt-left a.pt-name { display: block; max-width: 210px; white-space: normal; }
.pt-left a.pt-name.is-picked { border-left: 3px solid var(--sc-foreground, var(--text)); padding-left: 6px; }
/* the PO number of the PO open on the right (Q175): the same bar */
.pt-left .pt-pono.is-picked { border-left: 3px solid var(--sc-foreground, var(--text)); padding-left: 6px; }
.pt-t tr.is-picked td { background: var(--sc-accent, var(--selected)); }
.pt-t tr.is-picked td:first-child { box-shadow: inset 3px 0 0 var(--sc-foreground, var(--text)); }
/* an item's name in the right-hand tables of a file page (Q169): it wraps within a sensible width instead of stretching the table */
.pt-t td.pt-iname { min-width: 240px; max-width: 300px; white-space: normal; }
/* the tables of a file page (PO, ORD, Kho, Công nợ): their head stays in sight while the rows scroll (owner 27/10/2026, Q179: "dù
   các màn nhảy thì cái cột tiêu đề cũng phải giữ lại"); the table scrolls inside its box, as tall as the window allows */
.hs-tap .hs-scroll { max-height: calc(100vh - 140px); }
.hs-t thead th { position: sticky; top: 0; z-index: 2; background: var(--sc-card, var(--panel)); }
/* a computer: the left list of a file page stays in place with a scroll of its own, so bringing a row of the file into view never
   moves the list away from what was clicked (Q180) */
@media (min-width: 761px) { .pt-app > .hs-list { position: sticky; top: 0; align-self: start; max-height: calc(100vh - 90px); overflow: auto; } }

/* Q393, Q395: the ORD page's one table: set widths, so nothing moves between compartments or on folding; three columns that stay put.
   Their widths as their words need them (measured on ORD2608-01, 07/11/2026): the name wraps from Q169's 240px (the longest, 280px on
   one line, takes two), a PNK / PXK number with its heading's filter and pin marks (Q521) 88, a quantity with them 76. At 300 + 90 + 90
   they held 480 of the 640px frame at 1280 and left 160px for the columns that slide; now 404 and 236 */
table.hs-t.pt-t.pt-fix { --f1: 240px; --f2: 88px; --f3: 76px; table-layout: fixed; width: calc(var(--f1) + var(--f2) + var(--f3) + var(--tw)); min-width: 0; }
.pt-fix .pt-c1 { width: var(--f1); } .pt-fix .pt-c2 { width: var(--f2); } .pt-fix .pt-c3 { width: var(--f3); }
.pt-fix :is(th, td).pt-f1, .pt-fix :is(th, td).pt-f2, .pt-fix :is(th, td).pt-f3 { position: sticky; z-index: 1; }
.pt-fix :is(th, td).pt-f1 { left: 0; white-space: normal; } .pt-fix :is(th, td).pt-f2 { left: var(--f1); } .pt-fix :is(th, td).pt-f3 { left: calc(var(--f1) + var(--f2)); border-right: 2px solid var(--text-2) !important; }
.pt-fix th.pt-f1, .pt-fix th.pt-f2, .pt-fix th.pt-f3 { z-index: 2; }
/* the headings of the columns that stay put: theme.css table.tk th.tk-th (position: relative, for the column's resize grip) weighed more
   than the rule above, so their left offset pushed them right: "PNK" stood 240px off its column (300px with the old widths) and covered
   the headings beside it. On a phone only the first stays put and the other two headings take no offset, as their cells */
table.hs-t.pt-fix thead th.pt-f1 { position: sticky; }
@media (min-width: 769px) { table.hs-t.pt-fix thead th:is(.pt-f2, .pt-f3) { position: sticky; } }
@media (max-width: 768px) { table.hs-t.pt-fix thead th:is(.pt-f2, .pt-f3) { left: auto; } }
.pt-fix tr:not(.pt-par, .pt-lech, .pt-tot) > td:is(.pt-f1, .pt-f2, .pt-f3) { background: var(--panel, #fff); }
.pt-fix td.pt-span { vertical-align: middle; }
.pt-pinbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.pt-t td.pt-pinname { white-space: normal; min-width: 300px; }
@media (max-width: 768px) {
  table.hs-t.pt-t.pt-fix { --f1: 170px; }
  .pt-fix :is(th, td).pt-f2, .pt-fix :is(th, td).pt-f3 { position: static; border-right: inherit !important; }
}
/* Theo dõi mua hàng (Q448): the 9 steps, black and grey only (U-08) */
.ms-lbar { flex-wrap: wrap; justify-content: flex-start; gap: 2px 8px; } .ms-lbar .pt-fl { margin-left: auto; }
.ms-note { margin: 8px 0; font-size: 13px; color: var(--text-2); }
.ms-steps { display: block; padding: 4px 0 8px; }
.ms-tally { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; }
.ms-step { border-bottom: 1px solid var(--line); }
.ms-step-h { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; width: 100%; text-align: left; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; padding: 9px 0 2px; align-items: baseline; cursor: pointer; }
.ms-st { font-weight: 500; white-space: nowrap; } .ms-caret { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.ms-nx { margin: 0 0 9px 32px; font-size: 13px; } .ms-nx b { font-weight: 500; color: var(--text-2); }
.ms-d { margin: 0 0 12px 32px; padding-left: 10px; border-left: 2px solid var(--line); font-size: 13px; } .ms-d p { margin: 0 0 6px; }
.ms-lab { color: var(--text-2); font-size: 12px; display: block; }
.ms-h { font-size: 14px; font-weight: 600; margin: 14px 0 6px; } .ms-gh { font-size: 14px; font-weight: 500; margin: 8px 0 6px; } .ms-g { margin-bottom: 14px; }
.ms-box { margin-top: 8px; max-height: 340px; overflow: auto; }
.ms-tk { width: 28px; text-align: center; }
.ms-fn { display: inline-block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.ms-none { color: var(--muted); margin-right: 6px; white-space: nowrap; }
.ms-do .btn { margin-left: 4px; }
.ms-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 8px 0; }
.ms-fld { display: flex; flex-direction: column; gap: 3px; flex: 1 1 200px; min-width: 0; font-size: 13px; } .ms-fld span { color: var(--text-2); font-size: 12px; }
.ms-cell { min-width: 130px; } .ms-num { min-width: 90px; width: 100px; text-align: right; }
.ms-lnk { border: 0; background: none; padding: 0; font: inherit; color: var(--theme); text-decoration: underline; cursor: pointer; }
.ms-det { margin-top: 10px; }
.ms-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--panel); border-top: 1px solid var(--line); padding: 8px 0; margin-top: 14px; z-index: 5; }
.ms-sheet { width: 100%; height: 70vh; border: 1px solid var(--line); margin-top: 12px; background: #fff; }
@media (max-width: 760px) { .ms-nx, .ms-d { margin-left: 0; } .ms-d { padding-left: 8px; } }
.ms-steps, .ms-step, .ms-d { min-width: 0; }
.pt-main > div:has(> .ms-steps) { min-width: 0; }

/* Công nợ theo sổ kế toán (socongno.js) */
.cn-page { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cn-h1 { margin: 0; font-size: 16px; font-weight: 600; }
.cn-h2 { margin: 0; padding: 10px 12px; font-size: 14px; font-weight: 600; }
.cn-sub, .cn-btns, .cn-tabs, .cn-dates, .cn-conf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cn-tabs { gap: 6px; }
.cn-foot { margin: 0; }
.cn-find { width: 200px; max-width: 100%; }
.cn-chk { display: inline-flex; align-items: center; gap: 6px; }
.cn-pick { padding: 8px 12px; }
.cn-box { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); min-width: 0; }
.cn-so { max-height: 560px; overflow: auto; }
.cn-t th.c { text-align: center; }
.cn-so thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.cn-so thead tr + tr th { top: 28px; }
.cn-so tr.pt-tot td { position: sticky; bottom: 0; background: var(--panel); font-weight: 600; }
.cn-t tfoot td { font-weight: 600; }
.cn-go { cursor: pointer; }
.cn-go:hover td { background: var(--hover); }
.cn-lk { font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
table.hs-t.pt-t.cn-t td.cn-dg { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.hs-t.pt-t.cn-t th, table.hs-t.pt-t.cn-t td { padding: 4px 5px; font-size: 12.5px; }
html[data-ui-style] table.cn-t td.cn-ten, html[data-ui-style] table.cn-t td.cn-hh, table.cn-t td.cn-ten, table.cn-t td.cn-hh { white-space: normal !important; min-width: 150px; }
table.cn-t td.cn-ten { max-width: 240px; }
.cn-top { vertical-align: top; }
.cn-ghep { margin: 0; padding: 8px 12px; border-top: 1px solid var(--line); }
.cn-viec { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--line); }
.cn-s { display: block; }
.cn-menu { display: flex; flex-direction: column; align-items: flex-start; padding: 4px; }
.cn-a { display: flex; justify-content: space-between; gap: 10px; }
.cn-mr { display: block; width: 100%; padding: 8px 12px; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; text-align: left; font: inherit; }
button.cn-mr { cursor: pointer; }
.cn-tot { font-weight: 600; }
.cn-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cn-3 small { display: block; color: var(--muted); font-size: 12px; }
.cn-top3 { padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 8px 0; }
.cn-plo { padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.cn-pg { margin-top: 6px; }
.cn-only-ph { display: none; }
.dialog.cn-win { width: min(1180px, 100%); height: auto; max-height: calc(100vh - 48px); }
@media (max-width: 760px) {
  .cn-only-pc { display: none; }
  /* the list is what the phone reads; the table stays laid out, unseen, for In and Xuất Excel to read (tapkit.js takes laid-out tables only) */
  .cn-grab { position: absolute; left: -99999px; top: 0; width: 900px; height: 1px; overflow: hidden; visibility: hidden; }
  .cn-only-ph { display: block; }
  .dialog.cn-win { max-height: 100%; }
  .cn-viec { flex-wrap: wrap; }
}
.ms-many { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
/* Q521: the filter button on each column head of a drawn table (tapkit.js useHeadFilter), as on the shared lists (.grid th .cf) */
.hs-t th .cf { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 3px; border-radius: 5px; color: var(--muted); vertical-align: middle; cursor: pointer; opacity: .45; }
.hs-t th:hover .cf, .hs-t th .cf.on { opacity: 1; }
.hs-t th .cf:hover { background: var(--hover); color: var(--theme); }
.hs-t th .cf.on { color: var(--theme); background: var(--theme-soft); }
.ms-day { display: flex; flex: 1 0 100%; gap: 4px; align-items: center; contain: inline-size; } /* takes the list's width, never widens it */ .ms-day .inp { flex: 1 1 0; min-width: 0; width: auto; padding: 2px 4px; }

/* Theo dõi mua hàng, demo 9 (Q576): the one table frame (public/js/droptable.js) and the five tabs (pages/muahang.js). Black and grey only (U-08);
   at 375 px the tabs and the steps are one row scrolled sideways, the table scrolls inside its box (ban-giao-demo-9 mục 9) */
.m9-tabs, .m9-sub { display: flex; gap: 4px; align-items: center; border-bottom: 1px solid var(--line); margin-bottom: 8px; overflow-x: auto; white-space: nowrap; }
.m9-sub { border-bottom: 0; }
.m9-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 10px; color: var(--text-2); cursor: pointer; font: inherit; white-space: nowrap; }
.m9-tab.on { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.m9-plus { margin-left: auto; position: sticky; right: 0; background: var(--panel); }
.m9-head { display: flex; flex-direction: column; gap: 6px; margin: 2px 0 10px; }
.m9-back { padding: 0; align-self: flex-start; }
.m9-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; } .m9-title .btn { height: 26px; padding: 0 10px; font-size: 13px; }
.m9-steps { display: flex; gap: 6px; overflow-x: auto; white-space: nowrap; padding-bottom: 2px; }
.m9-step { display: flex; flex-direction: row; align-items: baseline; gap: 6px; white-space: nowrap; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 4px 10px; cursor: pointer; font: inherit; color: var(--text); }
.m9-step.on { border-color: var(--text); font-weight: 600; }
.m9-acts { white-space: nowrap; }
.dt-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.dt-menu { position: relative; }
.dt-mlist { position: absolute; z-index: 20; top: 100%; left: 0; min-width: 200px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 4px 14px rgba(0,0,0,.12); padding: 4px 0; }
.dt-mlist .pop-item { display: block; width: 100%; text-align: left; }
.dt-sub { border-left: 2px solid var(--line); margin-left: 12px; }
.dt-mnote { padding: 6px 12px; color: var(--text-2); border-top: 1px solid var(--line-2); max-width: 320px; white-space: normal; }
/* the screen's own pickers (Kỳ, Kho, Mã hàng) in the bar's row; on a phone they take a row of their own, each as wide as it needs */
.dt-tools { display: inline-flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; min-width: 0; flex: 1 1 0; }
/* many pickers wrap inside their own box, Tìm stays at the row's end beside them (never a row of its own at 1280) */
.dt-tools ~ .dt-q { flex: none; }
.dt-bar:has(> .dt-tools) { align-items: flex-start; }
@media (max-width: 760px) { .dt-tools { flex: 1 1 100%; } .dt-tools > * { min-width: 0; max-width: 100%; } }
/* a header of two levels: the shared cell centred over its columns; the second row stuck right under the first */
table.dt thead th.dt-top { text-align: center; }
table.dt thead tr.dt-h2 > th { top: var(--dt-h1, 30px); }
/* the row of column numbers under the header (A, B, 1, 2…), stuck under the header rows; small, centred */
table.dt thead tr.dt-no > th { top: var(--dt-hh, 34px); text-align: center; font-weight: 400; font-size: 11px; color: var(--muted); padding-top: 2px !important; padding-bottom: 2px !important; }
.dt-q { margin-left: auto; } .dt-q .inp { width: 220px; max-width: 60vw; }
.dt-box { overflow-x: auto; max-width: 100%; }
table.dt th { position: relative; } table.dt td.dt-ck, table.dt th.dt-ck { width: 30px; text-align: center; }
tr.dt-p { cursor: pointer; }
tr.dt-p.dt-l0 td { font-weight: 600; }
/* the rows under a row read one step in */
table.dt tr.dt-l1 > td.dt-c0 { padding-left: 24px !important; } table.dt tr.dt-l2 > td.dt-c0 { padding-left: 44px !important; } table.dt tr.dt-l3 > td.dt-c0 { padding-left: 64px !important; } /* the style sets (giaodien.css) put every cell's padding with !important */
table.dt td.dt-wrapc { white-space: normal !important; min-width: 220px; }
.dt-warn, .dt-err { margin: 8px 0; color: var(--text); border-left: 2px solid var(--text-2); padding-left: 8px; }
@media (max-width: 760px) { .dt-q { margin-left: 0; flex: 1 1 100%; min-width: 0; } .dt-q .inp { width: 100%; max-width: none; } .dt-bar .period { flex: 1 1 100%; } }
/* A1 (Q582), the fixed screen of the shared frame: a page drawn with Page body="pad fix" does not scroll while the table's part has its 330px; its tabs, head and the table's bar stay put,
   the table's box (droptable.js) takes what is left and is the one place that scrolls, its header stuck on top — at 1280 and at 375 alike */
/* the table's part (its bar and its box) never under 330px (soát chéo 09/11/2026): on a lower screen the page scrolls to reach it */
.pane-body.fix { overflow: hidden auto; display: flex; flex-direction: column; padding-bottom: 8px; }
.pane-body.fix > * { flex: none; }
.pane-body.fix > .dt-wrap { flex: 1 1 0; min-height: 330px; display: flex; flex-direction: column; }
.pane-body.fix .dt-box { flex: 1 1 0; min-height: 0; overflow: auto; }
table.dt thead th { position: sticky; top: 0; z-index: 2; }
/* one mark on every column header, the vertical three dots (headmenu.js, owner 09/11/2026), at the header's right edge: the header stays one
   line, never a second line of icons. Its menu: Lọc cột này, Ghim đến cột này / Bỏ ghim cột */
table.tk thead th.tk-th { vertical-align: middle; padding-right: 22px !important; }
table.dt.tk thead th.tk-th { position: sticky; } /* the frame's header stays on top (theme.css sets tk headers relative) */
table.tk thead th .tk-tools { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); display: inline-flex; }
/* a table filtering on its own head (data-tk-pin): its own filter mark stays in the header, unseen, under the ⋮ (its box opens there) */
table.tk[data-tk-pin] thead th > .cf:not(.hm) { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; margin: 0; opacity: 0 !important; pointer-events: none; }
table.tk[data-tk-pin] thead th:has(> .cf.on:not(.hm)) .hm { opacity: 1; color: var(--theme); background: var(--theme-soft); }
.hm { cursor: pointer; }
.hm svg, .tt-k svg { stroke-width: 2.8px; } .hm svg circle, .tt-k svg circle { stroke-width: 2.4px; }
/* the ⋮ always seen, faint until the header is hovered (a filter can be found without guessing), full when in use */
html table.tk th .tk-tools, html .grid th .cf.hm, html .tbl th .tt { opacity: .55; visibility: visible; }
html table.tk th:hover .tk-tools, html .grid th:hover .cf.hm, html .tbl th:hover .tt, html table.tk th .tk-tools:has(.on), html .grid th .cf.hm.on, html .tbl th .tt:has(.on) { opacity: 1; }
@media (hover: none) { .tbl th .tt { visibility: visible !important; } .tbl th .tt .tt-k { display: inline-grid !important; } }
.hm-pop { width: auto; min-width: 170px; padding: 4px; display: flex; flex-direction: column; gap: 1px; }
.hm-pop .hm-i { display: block; width: 100%; text-align: left; border: 0; background: none; font: inherit; color: var(--text); padding: 7px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.hm-pop .hm-i:hover { background: var(--hover); }
.hm-pop .hm-i.on { color: var(--theme); font-weight: 600; }
/* the Tổng row stuck at the bottom is solid (the style sets clear tfoot cells with !important) */
html[data-ui-style][data-ui-style][data-ui-style][data-ui-style][data-ui-style] table.dt.dt tfoot tr > td, table.dt tfoot td { position: sticky; bottom: 0; z-index: 1; background: var(--sc-card, var(--panel, #fff)) !important; box-shadow: 0 -1px 0 var(--line); }
