/* 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); }
.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; }
.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; }
.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 { 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; }
  .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; }
