:root {
  --ink: #14313B;
  --ink-2: #1D4250;
  --steel: #1F5C73;
  --steel-d: #174A5D;
  --steel-l: #DCE8ED;
  --mist: #E9EEF0;
  --paper: #FFFFFF;
  --rule: #C5D0D5;
  --rule-l: #DDE4E7;
  --text: #1B2A30;
  --muted: #5B6E76;
  --amber: #C98200;
  --amber-l: #FBF0D9;
  --red: #B3261E;
  --red-l: #F8E1DF;
  --green: #2E7D4F;
  --green-l: #DFF1E6;
  --display: Bahnschrift, "DIN Alternate", "DIN 2014", "Barlow", "Segoe UI", sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --r: 4px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--body); color: var(--text); background: var(--mist); }
a { color: var(--steel); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; text-align: right; }
.boot { padding: 40px; color: var(--muted); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.rail { background: var(--ink); color: #C9D8DE; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 16px 16px 14px; border-bottom: 1px solid var(--ink-2); }
.brand b { display: block; font-family: var(--display); font-size: 17px; color: #fff; font-weight: 600; }
.brand span { font-size: 12px; color: #8FAAB4; }
.rail nav { padding: 8px 0 16px; flex: 1; }
.rail .grp { padding: 14px 16px 4px; font-size: 12px; color: #7F9AA4; font-family: var(--display); }
.rail a { display: block; padding: 6px 16px 6px 20px; color: #D4E1E6; border-left: 3px solid transparent; }
.rail a:hover { background: var(--ink-2); text-decoration: none; }
.rail a.on { background: var(--ink-2); border-left-color: var(--amber); color: #fff; }
.rail .me { padding: 12px 16px; border-top: 1px solid var(--ink-2); font-size: 12px; }
.rail .me b { color: #fff; display: block; font-size: 13px; }
.rail .me a { display: inline; padding: 0; border: 0; color: #9FC3D1; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: var(--paper); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 5; }
.topbar h1 { flex: 1; min-width: 0; }
.topbar .crumb { font-size: 12px; color: var(--muted); display: block; font-family: var(--body); font-weight: 400; }
.page { padding: 20px 24px 60px; }
.btn.menu-btn { display: none; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--rule); background: var(--paper); border-radius: var(--r); cursor: pointer; white-space: nowrap; color: var(--text); }
.btn:hover { background: #F3F6F7; text-decoration: none; }
.btn.primary { background: var(--steel); border-color: var(--steel); color: #fff; }
.btn.primary:hover { background: var(--steel-d); }
.btn.danger { color: var(--red); border-color: #E3B7B3; }
.btn.danger:hover { background: var(--red-l); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 3px 8px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
input[type=text], input[type=number], input[type=date], input[type=password], input[type=email], input:not([type]), select, textarea {
  width: 100%; padding: 6px 8px; border: 1px solid var(--rule); border-radius: var(--r); background: #fff; min-height: 32px;
}
input[readonly] { background: #F4F7F8; color: var(--muted); }
textarea { min-height: 60px; resize: vertical; }
input.err, select.err { border-color: var(--red); background: #FFF8F7; }
label.f { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
label.f > span b { color: var(--red); font-weight: 400; }
label.f .hint { font-size: 12px; color: var(--steel); min-height: 0; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.fgrid .w2 { grid-column: span 2; }
.fgrid .wf { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }

/* ---------- panels & tables ---------- */
.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); margin-bottom: 16px; }
.panel > header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--rule-l); }
.panel > header h2 { flex: 1; }
.panel > .body { padding: 14px; }
.panel.flush > .body { padding: 0; }
.tablewrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); background: #F4F7F8; padding: 7px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; position: sticky; top: 0; }
table.t td { padding: 7px 10px; border-bottom: 1px solid var(--rule-l); vertical-align: top; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: #F2F7F9; }
table.t tfoot td { font-weight: 600; background: #F4F7F8; }
table.t td.nowrap { white-space: nowrap; }
table.grid td { padding: 3px 4px; }
table.grid input, table.grid select { min-height: 30px; padding: 4px 6px; }
table.grid td.ro { padding: 7px 8px; color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.filters label.f { min-width: 140px; }
.filters .grow { flex: 1; min-width: 200px; }

/* status pills */
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--steel-l); color: var(--steel-d); white-space: nowrap; }
.pill.draft { background: #E8ECEE; color: #4B5E66; }
.pill.wait { background: var(--amber-l); color: #7A5000; }
.pill.ok { background: var(--green-l); color: var(--green); }
.pill.bad { background: var(--red-l); color: var(--red); }

/* ---------- document view ---------- */
.dochead { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; margin-bottom: 16px; }
.dochead .id { flex: 1; min-width: 240px; }
.dochead .docno { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.dochead .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 20px; }
.kv div > span { display: block; font-size: 12px; color: var(--muted); }
.kv div > b { font-weight: 500; white-space: pre-line; }
.addr { font-size: 13px; line-height: 1.4; white-space: pre-line; }
.totals { margin-left: auto; min-width: 280px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 6px; font-family: var(--display); font-size: 18px; font-weight: 600; }
.cols2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.notes { background: var(--amber-l); border: 1px solid #EFD49A; border-radius: var(--r); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }
.notes ul { margin: 4px 0 0; padding-left: 18px; }
.info { background: var(--steel-l); border-radius: var(--r); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }
.history { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.history li { padding: 6px 0 6px 14px; border-left: 2px solid var(--rule); position: relative; }
.history li::before { content: ""; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--steel); }
.history li small { display: block; color: var(--muted); }

/* the process line: document chain drawn like a pipe run */
.flow { display: flex; align-items: flex-start; overflow-x: auto; padding: 14px 16px 12px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); margin-bottom: 16px; }
.flow .node { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 96px; text-align: center; }
.flow .node .dot { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--rule); background: var(--paper); }
.flow .node.done .dot { border-color: var(--steel); background: var(--steel); }
.flow .node.here .dot { border-color: var(--amber); background: var(--amber); box-shadow: 0 0 0 4px var(--amber-l); }
.flow .node .lbl { font-size: 12px; color: var(--muted); }
.flow .node .ref { font-family: var(--display); font-size: 13px; font-variant-numeric: tabular-nums; }
.flow .node.here .ref { font-weight: 600; }
.flow .node .ref a + a { display: block; }
.flow .pipe { flex: 1 0 28px; height: 4px; background: var(--rule); margin: 7px -24px 0; }
.flow .pipe.done { background: var(--steel); }

/* ---------- dashboard ---------- */
.gauges { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.gauge { background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--steel); border-radius: var(--r); padding: 12px 14px; display: block; color: var(--text); }
.gauge:hover { text-decoration: none; background: #F7FAFB; }
.gauge.warn { border-left-color: var(--amber); }
.gauge .v { font-family: var(--display); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.gauge .l { font-size: 12px; color: var(--muted); }
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; font-size: 11px; color: var(--muted); }
.bars .b i { display: block; width: 100%; max-width: 44px; background: var(--steel); border-radius: 2px 2px 0 0; min-height: 2px; }
.bars .b em { font-style: normal; color: var(--text); font-variant-numeric: tabular-nums; }
.funnel div { display: grid; grid-template-columns: 90px 1fr 40px; gap: 8px; align-items: center; padding: 4px 0; font-size: 13px; }
.funnel i { display: block; height: 14px; background: var(--steel); border-radius: 2px; }

/* ---------- login: ERP wheel in the centre, sign-in panel on the right ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 400px; background: #fff; }
.login .hero { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; background: #eaf6fb url('/img/water-bg.svg') center / cover no-repeat; }   /* water-treatment scene behind the wheel */
.login .hero .copyright { max-width: 640px; margin: 14px auto 0; text-align: center; font-size: 11.5px; line-height: 1.45; color: #23465a; background: rgba(255,255,255,.72); padding: 6px 12px; border-radius: 6px; }
.app-foot { padding: 14px 24px 18px; font-size: 11px; color: var(--muted); text-align: center; border-top: 1px solid var(--rule); margin-top: 24px; }
.login .hero img { width: min(620px, 82vh, 100%); height: auto; display: block; }
.login .hero-foot { margin-top: 12px; background: rgba(255,255,255,.72); padding: 2px 10px; border-radius: 4px; font-family: var(--display); font-size: 14px; color: var(--muted); letter-spacing: .02em; }
.login form { background: var(--mist); border-left: 1px solid var(--rule); padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.login form .btn.primary { margin-top: 4px; }
.err-box { background: var(--red-l); color: var(--red); border-radius: var(--r); padding: 8px 12px; font-size: 13px; white-space: pre-line; }

/* ---------- modal & toasts ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 49, 59, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--paper); border-radius: var(--r); width: 100%; max-width: 560px; box-shadow: 0 10px 40px rgba(20, 49, 59, .3); }
.modal.wide { max-width: 860px; }
.modal header { padding: 14px 18px; border-bottom: 1px solid var(--rule-l); }
.modal .body { padding: 16px 18px; }
.modal footer { padding: 12px 18px; border-top: 1px solid var(--rule-l); display: flex; justify-content: flex-end; gap: 8px; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: 420px; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r); font-size: 13px; white-space: pre-line; box-shadow: 0 4px 16px rgba(0, 0, 0, .2); }
.toast.err { background: var(--red); }
.toast.warn { background: #7A5000; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; z-index: 40; width: 250px; transform: translateX(-100%); transition: transform .15s; }
  .rail.open { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .cols2 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login .hero { padding: 20px 20px 0; }
  .login .hero img { width: min(300px, 70vw); }
  .login .hero-foot { display: none; }
  .login form { border-left: 0; border-top: 1px solid var(--rule); padding: 28px 24px 40px; justify-content: flex-start; }
  .page { padding: 14px; }
  .topbar { padding: 10px 14px; }
  .fgrid .w2 { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .rail, .topbar .actions, #toasts { display: none; } .shell { display: block; } }
td.code, td .code { white-space: nowrap; font-weight: 600; }
table.t td a { white-space: nowrap; }
.lines-panel { margin-top: 0; }
table.t th.n { text-align: right; }

/* totals below the item lines (requirement 2.3) */
.totals-row { display: flex; gap: 16px; padding: 12px 14px; border-top: 1px solid var(--rule-l); }
.totals-row .totals { min-width: 300px; }
.totals small { font-size: 11px; }
.headtotal { text-align: right; }
.headtotal span { display: block; font-size: 12px; color: var(--muted); }
.headtotal b { font-family: var(--display); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.matrix select { min-height: 28px; padding: 2px 4px; font-size: 12px; }
.matrix td, .matrix th { white-space: nowrap; }
.matrix td.changed select { border-color: var(--amber); background: var(--amber-l); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 12px; }
.tabs a { padding: 7px 12px; border: 1px solid transparent; border-bottom: 0; border-radius: var(--r) var(--r) 0 0; color: var(--muted); }
.tabs a.on { background: var(--paper); border-color: var(--rule); color: var(--text); margin-bottom: -1px; }
code.tok { background: var(--steel-l); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.topbar { flex-wrap: wrap; }
.topbar h1 { min-width: 260px; }
.topbar .actions { justify-content: flex-end; }
.matrix select { min-width: 124px; }
.matrix td:first-child, .matrix th:first-child { position: sticky; left: 0; background: var(--paper); z-index: 1; }
.matrix th:first-child { background: #F4F7F8; }

/* notifications */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; color: var(--steel); }
.bell:hover { background: var(--steel-l); text-decoration: none; }
.bell span { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--amber); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.notes-list .n-item { display: flex; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--rule-l); cursor: pointer; }
.notes-list .n-item:hover { background: #F2F7F9; }
.notes-list .n-item.unread { background: #FBF6EA; }
.notes-list .n-item.unread b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-right: 8px; }
.chk-wrap { display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: 420px; }
.chk-wrap .check { font-size: 12px; white-space: nowrap; }

/* financial year selector */
.fysel { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-family: var(--display); }
.fysel select { width: auto; min-height: 30px; padding: 3px 6px; font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--steel-d); border-color: var(--steel-l); background: var(--steel-l); }
.fysel.closed select { background: var(--red-l); color: var(--red); }

/* price / stock hints beside the line grid */
.ihw { display: flex; align-items: center; gap: 4px; }
.ihw input { flex: 1; min-width: 0; }
.ih { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--steel-l); background: var(--steel-l); color: var(--steel-d);
  font-size: 12px; font-weight: 700; line-height: 1; display: inline-flex; align-items: center; justify-content: center; cursor: help; padding: 0; }
.ih:hover, .ih:focus-visible { background: var(--steel); color: #fff; border-color: var(--steel); }
.ih.off { visibility: hidden; }
.ih.warn { background: var(--amber-l); border-color: var(--amber); color: #7A5000; }
.ihpop { position: fixed; z-index: 70; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: 0 8px 28px rgba(20, 49, 59, .22);
  padding: 10px 12px; width: max-content; max-width: min(520px, 94vw); font-size: 13px; }
.ihpop .ih-h { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.ihpop .ih-title { font-family: var(--display); font-weight: 600; margin-bottom: 6px; color: var(--steel-d); }
.ih-t { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.ih-t td, .ih-t th { padding: 3px 8px 3px 0; border-bottom: 1px solid var(--rule-l); text-align: left; vertical-align: top; }
.ih-t th { font-size: 11px; color: var(--muted); font-weight: 600; }
.ih-t .n { text-align: right; }
.ih-t tr.mine td { background: var(--amber-l); }
.ih-t tr.tot td { font-weight: 700; border-top: 2px solid var(--ink); }
.ih-warn { margin-top: 6px; color: var(--red); font-weight: 600; font-size: 12px; }
.ih-ok { margin-top: 6px; color: var(--green); font-size: 12px; }
.ih-t td a, .ih-t td.nowrap { white-space: nowrap; }

/* additional description under the item description in line grids */
input.xdesc { margin-top: 3px; font-size: 12px; min-height: 26px; padding: 3px 6px; color: var(--muted); background: var(--paper-2, #f7f9fa); }
input.xdesc:focus { color: inherit; background: #fff; }

/* RFQ comparison */
.rfq-q td { vertical-align: top; } .rfq-q input, .rfq-q select { min-width: 0; }
tr.rfq-sel td { background: var(--green-l, #e7f4ec); }
button.x { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 6px; } button.x:hover { color: var(--red); }

/* print format chooser (invoice / challan) */
.printfmt { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; box-sizing: border-box; }
.printfmt .btn { justify-content: center; text-align: center; padding: 10px; color: var(--accent, #1e5a6e); border-color: var(--accent, #1e5a6e); }
.printfmt .btn:hover { background: var(--accent, #1e5a6e); color: #fff; }

/* quotation revision selector in the title bar */
.revsel { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-right: 6px; }
.revsel select { min-height: 32px; font-size: 13px; padding: 2px 6px; }

/* Help & Support desk */
.navbadge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: #e08a1e; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
#helpfab { position: fixed; right: 22px; bottom: 22px; z-index: 50; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 10px; border-radius: 24px;
  background: var(--accent, #1e5a6e); color: #fff; text-decoration: none; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
#helpfab span { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--accent, #1e5a6e); align-items: center; justify-content: center; font-weight: 800; }
#helpfab:hover { filter: brightness(1.1); }
@media print { #helpfab { display: none; } }
.tk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; } @media (max-width: 900px) { .tk-grid { grid-template-columns: 1fr; } }
.tk-thread { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 4px; }
.tk-msg { max-width: 78%; padding: 10px 12px; border-radius: 10px; background: #f0f4f6; border: 1px solid var(--rule); align-self: flex-start; }
.tk-msg.me { align-self: flex-end; background: #e3f1f7; border-color: #b9d9e6; }
.tk-msg.internal { background: #fff7e0; border-color: #f0d68a; }
.tk-who { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; } .tk-body { white-space: pre-wrap; }
.tk-files { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; }
.tk-sys { align-self: center; font-size: 11.5px; color: var(--muted); background: #f7f9fa; border-radius: 10px; padding: 2px 10px; }
.tk-star { border: 0; background: none; font-size: 20px; color: #c8d1d6; cursor: pointer; padding: 0 2px; } .tk-star.on { color: #e5a50a; }
.kvl + .kvl { margin-top: 4px; }
.tk-who .pill { font-size: 10px; padding: 0 6px; line-height: 16px; vertical-align: 1px; } .tk-stars { white-space: nowrap; }

/* customer PO → sales order */
.aisteps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; } @media (max-width: 900px) { .aisteps { grid-template-columns: 1fr; } }
.aisteps > div { display: flex; gap: 12px; background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; }
.aisteps b { flex: none; width: 30px; height: 30px; border-radius: 6px; background: var(--accent, #1e5a6e); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.aisteps h3 { margin: 0 0 4px; font-size: 14px; } .aisteps p { margin: 0; font-size: 12.5px; color: var(--muted); }
tr.po-flag td { background: #fff8e6; } .po-chk { color: #8a5a00; } #po-lines input.num { width: 90px; }

/* welcome card */
.modal.welcome { max-width: 520px; overflow: hidden; }
.wl-head { display: flex; gap: 14px; align-items: center; padding: 18px 20px; background: linear-gradient(120deg, #1e5a6e, #2aa36b); color: #fff; }
.wl-head h2 { margin: 0; font-size: 20px; color: #fff; } .wl-av { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.wl-list { margin: 4px 0 10px; padding-left: 20px; } .wl-list li { margin: 3px 0; }

/* comments on documents */
.cm-thread { display: flex; flex-direction: column; gap: 10px; }
.cm { background: #f6f8f9; border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; }
.cm.auto { background: #fbfbfb; } .cm.auto .cm-b { color: var(--muted); }
.cm-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; } .cm-t { margin-left: auto; }
.cm-av { width: 26px; height: 26px; border-radius: 50%; background: #e3f0f5; color: #1e5a6e; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.cm-b { white-space: pre-wrap; } .cm-at { color: #1e5a6e; }
.cm-new { position: relative; margin-top: 12px; } .cm-new textarea { width: 100%; }
.cm-pick { position: absolute; z-index: 20; left: 0; top: 64px; background: #fff; border: 1px solid var(--rule); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); min-width: 300px; max-height: 260px; overflow: auto; }
.cm-opt { padding: 6px 10px; cursor: pointer; } .cm-opt:hover { background: #eef5f8; }
.cm .pill { font-size: 10px; padding: 0 6px; line-height: 16px; }

/* ---------- Tally ledger settings ---------- */
.tl-wrap { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 14px; align-items: start; }
.tl-nav { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); padding: 6px 0; position: sticky; top: 10px; }
.tl-nav a, .tl-nav summary { display: flex; align-items: center; gap: 6px; padding: 7px 12px; color: var(--text); cursor: pointer; text-decoration: none; }
.tl-nav a:hover, .tl-nav summary:hover { background: #F2F7F9; text-decoration: none; }
.tl-grp { font-weight: 600; font-size: 13px; }
.tl-grp.on, .tl-grp.act { background: var(--steel-l); color: var(--steel-d); }
.tl-item { font-size: 13px; padding-left: 24px !important; }
.tl-item.on { color: var(--steel); font-weight: 600; background: #EEF5F8; border-left: 3px solid var(--steel); padding-left: 21px !important; }
.tl-n { margin-left: auto; font-size: 11px; color: var(--muted); background: var(--mist); border-radius: 9px; padding: 0 7px; font-weight: 400; }
.tl-main > header { display: flex; align-items: center; gap: 10px; }
.tl-add { color: var(--green); border-color: var(--green); }
.tl-add:hover { background: var(--green-l); }
.tl-t th { background: #E6F4FA; color: var(--ink); font-size: 13px; }
.tl-sort { color: var(--steel); font-size: 11px; }
.tl-ed { color: var(--green); }
.tl-del { color: var(--red); }
.tl-pager { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--rule-l); }
.tl-pager select { padding: 3px 6px; width: auto; min-width: 64px; flex: 0 0 auto; }
.tl-pager > * { white-space: nowrap; }
@media (max-width: 800px) { .tl-wrap { grid-template-columns: 1fr; } .tl-nav { position: static; } }
