:root { --bg:#f6f7f9; --card:#fff; --line:#d9dde3; --text:#1c2230; --muted:#6b7585; --accent:#1d5fd1; --danger:#b42318; --focus:#ffe9a8; }
* { box-sizing: border-box; }
body { margin:0; font:14px/1.4 system-ui,-apple-system,sans-serif; background:var(--bg); color:var(--text); }
.gsearch { position:relative; background:#e4eaf5; border-bottom:1px solid #c3cee2; height:34px; padding:4px 20px; display:flex; justify-content:center; z-index:60; }
.gsearch input { width:640px; max-width:100%; height:26px; padding:2px 10px 2px 32px; font-size:14px; border:2px solid #9fb4d9; border-radius:4px; background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7585' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='6.5'/%3E%3Cpath d='M15 15l6 6'/%3E%3C/svg%3E") no-repeat 10px center; box-shadow:0 1px 3px rgba(20,32,58,.12); }
.gsearch input:focus { border-color:var(--accent); outline:none; box-shadow:0 0 0 3px rgba(29,95,209,.2); }
.gsearch .gs-list { position:absolute; top:31px; left:50%; right:auto; transform:translateX(-50%); width:640px; max-width:calc(100% - 40px); max-height:70vh; overflow:auto; font-size:14px; }
header { display:flex; align-items:center; gap:24px; padding:0 20px; height:44px; background:#14203a; color:#fff; }
header a { color:#cfd8ea; text-decoration:none; } header a.on, header a:hover { color:#fff; }
.brand { display:flex; align-items:center; gap:8px; font-weight:700; letter-spacing:.05em; color:#fff !important; } .brand span { max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .brand-logo { max-height:30px; max-width:120px; background:#fff; border-radius:4px; padding:2px; } nav { display:flex; gap:18px; align-items:center; }
.navgroup { position:relative; height:44px; display:flex; align-items:center; }
.navmenu { display:none; position:absolute; top:44px; left:-12px; min-width:160px; background:#14203a; border-radius:0 0 6px 6px; padding:6px 0; box-shadow:0 4px 12px rgba(0,0,0,.25); z-index:50; }
.navgroup:hover .navmenu, .navgroup:focus-within .navmenu { display:block; }
.navmenu a { display:block; padding:6px 14px; white-space:nowrap; } .navmenu a:hover { background:#22325a; }
main { max-width:1100px; margin:0 auto; padding:16px 20px 60px; }
h1 { font-size:20px; margin:0; } h2 { font-size:15px; margin:22px 0 8px; }
.pagehead { display:flex; justify-content:space-between; align-items:center; margin:4px 0 12px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:6px; padding:14px; margin-bottom:12px; }
.grid { display:flex; flex-wrap:wrap; gap:10px 14px; }
.f { display:flex; flex-direction:column; gap:3px; width:180px; } .f.w2 { width:374px; } .f.w-s { width:120px; }
.f.wfull { width:100%; } .f.w3 { width:min(620px,100%); } .f > span { font-size:12px; color:var(--muted); }
.f textarea.mail { min-height:9em; resize:vertical; } fieldset.stack { display:flex; flex-direction:column; gap:10px; min-width:0; box-sizing:border-box; width:100%; }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]), select { height:28px; box-sizing:border-box; }
input, select, textarea { font:inherit; padding:4px 8px; border:1px solid var(--line); border-radius:4px; background:#fff; min-width:0; }
input:focus, select:focus, textarea:focus { outline:2px solid var(--accent); outline-offset:-1px; background:var(--focus); }
.has-error input, .has-error select { border-color:var(--danger); } .f em { color:var(--danger); font-style:normal; font-size:12px; }
.buttons { margin-top:14px; display:flex; gap:14px; align-items:center; }
button, .btn { font:inherit; padding:6px 14px; border:1px solid var(--line); border-radius:4px; background:#fff; color:var(--text); text-decoration:none; cursor:pointer; display:inline-block; }
button.primary, .btn.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
button.link { border:0; background:none; padding:0 6px; color:var(--accent); } button.danger { color:var(--danger); }
form.inline { display:inline; }
table.list { width:100%; border-collapse:collapse; background:var(--card); border:1px solid var(--line); border-radius:6px; }
.list th { text-align:left; font-size:12px; color:var(--muted); font-weight:600; padding:7px 10px; border-bottom:1px solid var(--line); }
.list td { padding:7px 10px; border-bottom:1px solid #eef0f3; } .list tr[data-href]:hover { background:#f0f5ff; cursor:pointer; }
.list tr.sel { background:var(--focus); } .r { text-align:right; } .small td { font-size:12px; color:var(--muted); } .mono { font-family:ui-monospace,monospace; }
.filter input { width:100%; margin-bottom:10px; padding:8px 10px; }
.hint.refused { color:#9a3412; font-weight:600; }
.flash { background:#e6f4ea; border:1px solid #b7dfc2; padding:8px 12px; border-radius:4px; margin-bottom:12px; }
.muted { color:var(--muted); } .tag { font-size:11px; background:#e8eefc; color:var(--accent); padding:1px 6px; border-radius:8px; }
dl { display:grid; grid-template-columns:110px 1fr; gap:6px 10px; margin:0; } dt { color:var(--muted); } dd { margin:0; }
a { color:var(--accent); }

/* ---- invoice entry ---- */
.pick { position:relative; } .pick-list { position:absolute; top:100%; left:0; right:0; z-index:5; background:#fff; border:1px solid var(--line); border-radius:4px; box-shadow:0 6px 18px rgba(0,0,0,.12); }
.pick-list .opt { padding:6px 8px; cursor:pointer; } .pick-list .opt.on { background:#dbe7ff; } .pick-list small { color:var(--muted); margin-left:6px; }
.termline, .billline { min-height:18px; margin:6px 0 0; } .shipblock { margin:10px 0 14px; } .shipfields { margin-top:8px; }
.savebox { display:block; margin-top:8px; color:var(--accent); }
table.lines { width:100%; border-collapse:collapse; margin-top:6px; }
.lines th { text-align:left; font-size:12px; color:var(--muted); font-weight:600; padding:4px 4px; border-bottom:1px solid var(--line); }
.lines td { padding:2px; } .lines input { width:100%; } .lines td.amt { padding:0 8px; white-space:nowrap; }
.num { text-align:right; } .lines th.num { text-align:right; }
.c-item { min-width:90px; } .lines td:nth-child(2) { width:130px; } .lines td:nth-child(4) { width:84px; } .lines td:nth-child(5) { width:72px; }
.lines td:nth-child(6) { width:112px; } .lines td:nth-child(7) { width:112px; }
input.bad { border-color:var(--danger); background:#fff1f0; }
.foot { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-top:12px; }
.notes { width:min(520px,100%); } .notes textarea { resize:vertical; }
.totalbox { font-size:18px; padding-top:18px; } .totalbox strong { margin-left:10px; font-variant-numeric:tabular-nums; }
.errors { background:#fff1f0; border:1px solid #f3b7b1; color:var(--danger); border-radius:4px; padding:8px 12px; margin-bottom:12px; } .errors ul { margin:4px 0 0; padding-left:18px; }
.hint { font-size:12px; } .pre { white-space:pre-wrap; } .totalrow td { border-top:2px solid var(--line); }
button.danger { color:var(--danger); }

[hidden] { display:none !important; }
.list th.r, .list td.r { text-align:right; }

/* ---- payments ---- */
.static { padding:6px 0; } .apply td { padding:3px 4px; } .apply th { padding:4px; } .apply .num { text-align:right; }
.apply td:nth-child(8), .apply td:nth-child(9) { width:110px; } .apply tr:hover { background:#f7faff; }
[data-disc-note].on { color:#0a6b2c; font-weight:600; }
.sums { min-width:260px; font-size:15px; } .sums div { display:flex; justify-content:space-between; gap:20px; padding:2px 0; } .sums strong { font-variant-numeric:tabular-nums; }
.sums .unapplied { border-top:1px solid var(--line); margin-top:4px; padding-top:6px; font-size:17px; } .sums .over strong { color:var(--danger); }
.tag.paid { background:#e6f4ea; color:#0a6b2c; }

/* ---- tax masters ---- */
.tabs { display:flex; gap:4px; margin:0 0 12px; border-bottom:1px solid var(--line); } .tabs a { padding:6px 14px; text-decoration:none; color:var(--muted); border:1px solid transparent; border-bottom:0; border-radius:4px 4px 0 0; }
.tabs a.on { color:var(--text); background:var(--card); border-color:var(--line); margin-bottom:-1px; }
.checks { display:flex; flex-direction:column; gap:6px; } .rules td { padding:3px 6px; } .rules { max-width:640px; }

/* ---- invoice tax block ---- */
.lines td.amt { width:112px; } .c-cat, .c-unit, .c-punit, .c-wh { width:100%; }
.invsums { min-width:340px; } .invsums .catsub { color:var(--muted); font-size:13px; } .invsums .catsub strong { font-weight:500; }
.refresh { display:block; margin-top:8px; font-size:12px; color:var(--muted); } .catsub td { font-size:13px; }
.sums .catsubs { display:block; } .sums .catsubs .catsub { display:flex; justify-content:space-between; }
.rules input.num { width:170px; } .rules td:nth-child(3) { width:190px; }

/* ---- shared setup screens ---- */
.maint { display:grid; grid-template-columns:minmax(420px,1.25fr) minmax(400px,1fr); gap:16px; align-items:start; }
.maint-list { padding:12px; } .maint-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; } .maint-head h2 { margin:0; }
.maint-list .list { border:0; } .maint-pane { position:sticky; top:12px; } .maint-formcard h2 { margin:0 0 10px; }
.maint-empty { padding:40px 16px; text-align:center; border:1px dashed var(--line); border-radius:6px; }
.btn.small { padding:2px 10px; font-size:13px; } tr.sel { background:#eaf1ff; } .list tr.sel td { border-bottom-color:#cfdcf5; }
.zonejs { width:100%; } .zonejs td:first-child { width:150px; } .zonejs td { padding:3px 4px; } .zonejs select { width:100%; } .zonejs tfoot td { padding-top:6px; }
@media (max-width: 900px) { .maint { grid-template-columns:1fr; } .maint-pane { position:static; } }

/* ---- tax popup ---- */
button.taxlink { color:var(--accent); text-decoration:underline; text-underline-offset:2px; font-size:inherit; padding:0; border:0; background:none; cursor:pointer; }
dialog.taxdlg { border:1px solid var(--line); border-radius:8px; padding:16px 18px; min-width:420px; box-shadow:0 10px 40px rgba(0,0,0,.25); }
dialog.taxdlg::backdrop { background:rgba(20,32,58,.35); } .taxdlg h3 { margin:0 0 10px; } .taxdlg table { width:100%; border-collapse:collapse; margin-bottom:10px; }
.taxdlg td, .taxdlg th { padding:4px 6px; text-align:left; } .taxdlg th { font-size:12px; color:var(--muted); font-weight:600; border-bottom:1px solid var(--line); } .taxdlg .num { text-align:right; }
.taxdlg tfoot td { border-top:1px solid var(--line); font-weight:600; } .taxdlg .buttons { justify-content:flex-end; margin-top:6px; }

/* ---- history popup ---- */
dialog.histdlg { border:1px solid var(--line); border-radius:8px; padding:16px 18px; min-width:460px; max-width:700px; max-height:80vh; box-shadow:0 10px 40px rgba(0,0,0,.25); }
dialog.histdlg::backdrop { background:rgba(20,32,58,.35); } .histdlg h3 { margin:0 0 10px; } .histdlg .buttons { justify-content:flex-end; }
.histlist { border-collapse:collapse; width:100%; } .histlist > tbody > tr > td { padding:6px 8px; border-top:1px solid var(--line); vertical-align:top; } .nowrap { white-space:nowrap; }
.histch td { padding:1px 10px 1px 0; } .histch td:first-child { color:var(--muted); }

/* ---- ordering / hiding ---- */
.list.sortable td.grip { width:18px; color:#9aa4b5; cursor:grab; user-select:none; padding-right:0; letter-spacing:-2px; } .list.sortable tr[draggable=true]:active td.grip { cursor:grabbing; }
.list tr.dragging { opacity:.45; background:#eaf1ff; }
.list tbody[data-section=hidden] { background:#f7f7f9; } .list tr.sechead td { font-size:12px; font-weight:600; color:var(--muted); background:#eef0f4; border-top:2px solid var(--line); padding:5px 10px; }
.list tbody[data-section=hidden] tr[data-row-id] td { color:var(--muted); }
.list tr.hint td { color:#9aa4b5; font-size:12px; font-style:italic; text-align:center; padding:8px; }
.list tbody:has(tr[data-row-id]) tr.hint { display:none; }
.hidebox { display:block; margin-top:14px; color:var(--muted); } .hidebox em { color:var(--danger); font-style:normal; }

/* ---- filter, row limit, delete ---- */
.maint-filter { width:100%; margin:0 0 8px; padding:7px 10px; } .list tr.more td { text-align:center; font-size:12px; color:var(--muted); background:#fafafa; padding:6px; }
.buttons .push { margin-left:auto; } button.danger { border-color:#e5b4ae; }

/* ---- generic picker extras ---- */
.pick-list .opt.special { color:var(--muted); border-top:1px solid var(--line); } .pick-list .opt .tag { margin-left:4px; }
.pick-list .hint { padding:5px 8px; font-size:12px; color:var(--muted); border-top:1px solid var(--line); font-style:italic; }
.pick input[data-picker-input] { width:100%; }
/* the Item # cell is narrow; let its match list be wider than the cell */
table.lines .pick-list { right:auto; min-width:340px; }
.pick[data-picker=lot] .pick-list { right:auto; min-width:340px; }

/* bank rec */
.bankpick { margin-bottom:8px; } .subnav { margin:6px 0 12px; } .subnav a.on { font-weight:600; text-decoration:none; }
.recsum b.ok { color:#0a6b2c; } .recsum b.bad { color:#b3261e; }
/* kits: the header line stands out; its component lines sit indented beneath it inside a tinted band */
tr.kit-head > td { background:#eef3fd; border-top:1px solid #c9d8f5; font-weight:600; } tr.kit-head input, tr.kit-head select { font-weight:600; }
tr.kit-part > td { background:#f6f9fe; } tr.kit-part > td:first-child { border-left:3px solid #9db8ee; padding-left:18px; }
tr.kit-part + tr:not(.kit-part) > td { border-top:1px solid #c9d8f5; }
.list tr.kit-part > td:first-child { padding-left:22px; } .list tr.kit-part td { color:#3a4a66; }
.lines tr.kit-part .pick input { padding-left:4px; }

.kit-tag { display:block; color:var(--muted); font-size:11px; font-weight:400; }

/* ---- invoice line numbers + drag grip ---- */
.lines td.lno { width:64px; white-space:nowrap; } .lines .c-lno { width:34px; color:var(--muted); font-size:12px; padding:2px 3px; }
.lines .c-lno[readonly] { border-color:transparent; background:transparent; }
.grip { display:inline-block; width:14px; color:var(--muted); cursor:grab; user-select:none; text-align:center; } .grip:active { cursor:grabbing; }
.lines tr.dragging { opacity:.45; }
.lines tr.kit-part > td:first-child { padding-left:2px; } .lines tr.kit-part > td:nth-child(2) { padding-left:14px; }

/* ---- vendor payment releases ---- */
.tag.void { background:#fbe9e7; color:#b3261e; } tr.voided td { color:var(--muted); text-decoration:line-through; } tr.voided td:last-child, tr.voided td .tag { text-decoration:none; }
.filters { display:flex; flex-wrap:wrap; gap:8px 14px; align-items:end; margin:0 0 10px; } .filters label { display:flex; flex-direction:column; font-size:12px; color:var(--muted); gap:2px; }
.notice { background:#fff7e0; border:1px solid #ecd9a0; padding:6px 10px; border-radius:4px; } .warn { color:#b3261e; font-size:12px; }
table.bills tr.blocked td { color:#9aa4b5; background:#f7f7f9; } table.bills input.num { width:90px; text-align:right; } table.review td { vertical-align:top; } .f.check { justify-content:end; }

/* ---- purchase orders ---- */
.po-lines td:nth-child(2) { width:130px; } .po-lines td:nth-child(4) { width:84px; } .po-lines td:nth-child(5) { width:72px; } .po-lines td:nth-child(6), .po-lines td:nth-child(7) { width:112px; }
table.match tr.grp td { background:#f3f6fb; padding-top:6px; } table.match .c-qty { width:84px; }
.accept { margin-left:6px; font-size:12px; color:var(--muted); white-space:nowrap; } .accept input { width:auto; }

/* picking: ticket queue, backorders, order line status */
.tag.ticketed, .tag.ready { background:#e6f4ea; color:#0a6b2c; } .tag.backordered, .tag.short { background:#fbe9e7; color:#b3261e; } .tag.nodate, .tag.waiting { background:#fff4d6; color:#8a5a00; } .tag.creditheld { background:#fbe9e7; color:#b3261e; font-weight:600; }
table.list tr.blocked td { color:#8a93a3; } ul.kitparts { margin:2px 0 0 18px; padding:0; font-size:12px; color:var(--muted); } input.c-ship { width:92px; }
.pick.nobin input[data-picker-input] { visibility:hidden; }
tr.txsub > td { padding-top:0; border-top:0; } tr.txsub table { margin:0 0 6px; background:transparent; }
tr.lotrow > td { padding-top:0; border-top:0; } table.lotgrid { width:auto; margin:0 0 4px; } table.lotgrid input { width:11em; } table.lotgrid input.num { width:7em; }
.lotbox { display:inline-block; vertical-align:top; margin:0 16px 4px 0; } .lotbox table.lotgrid .pick input { width:13em; }
.credit-warn { background:#fff4d6; border:1px solid #e6c36a; color:#6b4a00; border-radius:4px; padding:8px 12px; margin:12px 0; font-weight:600; }

/* ---- statements, aging, printing ---- */
.statement { margin:0 0 28px; } .st-head { display:flex; justify-content:space-between; gap:20px; margin-bottom:10px; } .st-head h2 { margin:0 0 6px; }
.list tfoot th { border-top:2px solid var(--line, #ccc); background:#fafafa; }
@media print {
  header, .noprint, .pagehead, .flash { display:none !important; }
  body { background:#fff; } main { padding:0; max-width:none; }
  .statement { break-after:page; margin:0; } .statement:last-child { break-after:auto; }
}

/* ---- printable documents (lib/printdoc.js) ---- */
body.doc { background:#e9ecf0; margin:0; }
.logo-thumb { max-height:44px; max-width:180px; vertical-align:middle; }
.doc-bar { max-width:8.5in; margin:12px auto; }
.docsheet { background:#fff; max-width:8.5in; margin:0 auto 24px; padding:.5in; box-shadow:0 1px 4px rgba(0,0,0,.2); font-size:12px; color:#000; }
.docsheet .doc-lots { font-size:11px; margin-top:2px; }
.doc-head { display:flex; justify-content:space-between; gap:24px; margin-bottom:18px; } .doc-co { line-height:1.4; } .doc-co strong { font-size:16px; }
.doc-title { text-align:right; } .doc-title h1 { margin:0 0 6px; font-size:24px; text-transform:uppercase; letter-spacing:1px; }
.doc-meta { margin-left:auto; border-collapse:collapse; } .doc-meta th { text-align:right; font-weight:400; color:#555; padding:1px 8px 1px 0; } .doc-meta td { text-align:right; font-weight:600; padding:1px 0; }
.doc-parties { display:flex; gap:16px; margin-bottom:14px; } .doc-parties > div { flex:1; border:1px solid #999; padding:6px 10px; min-height:64px; line-height:1.4; } .doc-parties h4, .doc-notes h4 { margin:0 0 3px; font-size:10px; text-transform:uppercase; color:#555; letter-spacing:.5px; }
.doc-info { width:100%; border-collapse:collapse; margin-bottom:14px; } .doc-info th, .doc-info td { border:1px solid #999; padding:3px 8px; text-align:left; } .doc-info th { font-size:10px; text-transform:uppercase; color:#555; background:#f3f3f3; }
.doc-lines { width:100%; border-collapse:collapse; } .doc-lines thead { display:table-header-group; } .doc-lines th { border-bottom:2px solid #000; padding:4px 6px; text-align:left; font-size:10px; text-transform:uppercase; }
.doc-lines td { padding:4px 6px; border-bottom:1px solid #ddd; vertical-align:top; } .doc-lines tr { break-inside:avoid; } .doc-lines tr.kit-part td { color:#444; } .doc-lines tr.kit-part td:nth-child(2) { padding-left:18px; }
.doc-lines .r, .doc-totals td, .doc-totals th { text-align:right; }
.doc-totals { margin:10px 0 0 auto; border-collapse:collapse; break-inside:avoid; } .doc-totals th { font-weight:400; padding:2px 14px 2px 0; } .doc-totals td { padding:2px 0; min-width:90px; } .doc-totals tr.grand th, .doc-totals tr.grand td { border-top:2px solid #000; font-weight:700; font-size:14px; padding-top:4px; }
.doc-notes { margin-top:16px; break-inside:avoid; } .doc-foot { margin-top:24px; padding-top:8px; border-top:1px solid #999; text-align:center; color:#444; }
@media print {
  body.doc { background:#fff; } .docsheet { box-shadow:none; max-width:none; margin:0; padding:0; }
  @page { margin:.5in; }
}

/* ---- setup screens: tabs down the left side ---- */
.setup-layout { display:grid; grid-template-columns:190px minmax(0,1fr); gap:16px; align-items:start; }
.tabs.side { flex-direction:column; gap:2px; margin:0; border-bottom:0; position:sticky; top:12px; }
.tabs.side a { border:1px solid transparent; border-radius:4px; padding:6px 12px; }
.tabs.side a.on { margin-bottom:0; }
@media (max-width: 900px) { .setup-layout { grid-template-columns:1fr; } .tabs.side { flex-direction:row; flex-wrap:wrap; position:static; } }
.tabs.side h4 { margin:12px 0 2px; padding:0 12px; font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); } .tabs.side h4:first-child { margin-top:0; }
.tabs.side, .tabs.side a, .tabs.side h4 { text-align:left; } .tabs.side a { display:block; }
.tabs.side { align-items:stretch; }

/* ---- reports ---- */
.tabs.side details { width:100%; } .tabs.side summary { cursor:pointer; padding:7px 12px; font-weight:600; border-radius:4px; list-style:none; } .tabs.side summary::-webkit-details-marker { display:none; }
.tabs.side summary::before { content:'▸'; display:inline-block; width:1em; color:var(--muted); } .tabs.side details[open] > summary::before { content:'▾'; }
.tabs.side summary:hover { background:var(--card); } .tabs.side details[open] > a { margin-left:14px; }
.rpt-cards { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:10px; }
.rpt-card { display:flex; flex-direction:column; gap:3px; background:var(--card); border:1px solid var(--line); border-radius:6px; padding:10px 12px; color:var(--text); text-decoration:none; }
.rpt-card:hover { border-color:var(--accent); } .rpt-card span { font-size:12px; color:var(--muted); }
.presets { display:flex; flex-wrap:wrap; gap:4px 14px; margin:-4px 0 8px; font-size:12px; } .rpt-sub { margin:4px 0 10px; color:var(--muted); }
.rpt th, .rpt td { white-space:nowrap; } .rpt td:nth-child(n+2):not(.r) { white-space:normal; } a.sortlink { color:inherit; text-decoration:none; } a.sortlink:hover { text-decoration:underline; }
@media print { .setup-layout { display:block; } .tabs.side, .filters, .presets { display:none !important; } .rpt { font-size:11px; } main { max-width:none; } }

/* manual journal entry grid */
table.jtable { width: 100%; table-layout: fixed; }
table.jtable th:nth-child(1) { width: 38%; }
table.jtable th:nth-child(2), table.jtable th:nth-child(3) { width: 130px; }
table.jtable .f { width: 100%; margin: 0; }
table.jtable td input:not([type=hidden]) { width: 100%; box-sizing: border-box; }

/* account cell under an item # (lines with no item record): small, only shown when it applies */
.lines .pick.acct { margin-top: 3px; }
.lines .pick.acct input { width: 100%; font-size: 12px; }

/* item class form: a Stock class shows its stock accounts, a Service class its expense account (no script needed) */
.contents { display: contents; }
form:has(select[name=kind] option[value=service]:checked) [data-kind=stock],
form:has(select[name=kind] option[value=stock]:checked) [data-kind=service] { display: none; }

/* bill of materials: the Source select under an item #, and the per-line components dialog */
.c-source { display:block; margin-top:3px; font-size:.85em; max-width:100%; }
[data-bom-edit] { font-size:.85em; }
.bomdlg { min-width:420px; }

/* requirements */
.tag.req-ok { background:#e6f4ea; color:#176a2f; } .tag.req-late { background:#fff3d6; color:#8a5a00; } .tag.req-nodate { background:#fff3d6; color:#8a5a00; } .tag.req-short { background:#fde4e4; color:#a11a1a; }
.reqdlg { min-width:760px; max-width:95vw; } .req table { margin-top:8px; }
.pager { display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; margin:10px 0; } .pager .jump { display:flex; gap:6px; align-items:center; margin-left:auto; } .pager .jump input[type=number] { width:4.5em; }

/* sales line grid: item # with the description under it, cost and GP under the price */
.lines.sg td:nth-child(n) { width:auto; }
.lines.sg td:nth-child(3) { width:84px; } .lines.sg td:nth-child(4) { width:72px; } .lines.sg td:nth-child(5) { width:100px; min-width:100px; } .lines.sg td:nth-child(6) { width:72px; }
.lines.sg td:nth-child(2) { min-width:260px; } .lines.sg td { vertical-align:top; padding:2px; } .lines.sg td.amt { padding-top:7px; }
.lines.sg .irow { display:flex; align-items:center; gap:6px; margin-bottom:2px; } .lines.sg .irow .pick { flex:1; } .lines.sg .xrow { margin:0; } .lines.sg .xrow:not(:has(> :not([hidden]):not([type=hidden]))) { display:none; }
.lines.sg .irow .kit-tag { display:inline; } .lines.sg .irow .c-source { display:inline-block; margin-top:0; width:auto; }
.lines.sg .irow .pick.acct { margin-top:0; flex:1; }
.cg { font-size:11px; color:var(--muted); white-space:pre; line-height:1.3; text-align:right; margin-top:1px; }

.lines.sg td.cbo { width:40px; text-align:center; padding-top:7px; } .lines.sg td.cbo input[type=checkbox] { width:auto; }

/* checkboxes and radios: bigger everywhere */
input[type=checkbox], input[type=radio] { width:18px !important; height:18px !important; min-width:18px; padding:0; margin:0 4px 0 0; vertical-align:middle; accent-color:var(--accent); cursor:pointer; }
.lines.sg td.amt { width:112px; } table.list .cg { font-size:11px; color:var(--muted); white-space:nowrap; line-height:1.3; }
.lines.sg.rtvgrid td:nth-child(4) { width:150px; min-width:150px; }
.lines.tgrid { width:auto; min-width:520px; }
.sections { display:flex; flex-wrap:wrap; gap:12px; align-items:stretch; margin-bottom:12px; }
.sect { border:1px solid var(--line); border-radius:6px; padding:8px 12px 12px; min-width:0; background:var(--card); }
.sect > h4 { margin:0 0 8px; font-size:12px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
.sect dl { grid-template-columns:auto minmax(0, 1fr); }
.sect .shipfields { max-width:640px; } .sect .billline { max-width:380px; }
form.invoice > .sections { margin-bottom:10px; }
.sections > .sect.shipblock { margin:0; flex:0 1 auto; max-width:100%; }
.taxdlg.wide { min-width:min(900px, 94vw); max-height:88vh; overflow:auto; }
.taxdlg.wide .pick-list { right:auto; min-width:300px; }

/* item form: sub-tables are as wide as their fields need, not the page */
fieldset.conv { width:fit-content; max-width:100%; }
.conv-grid { width:auto; }
.conv-grid td, .conv-grid th { padding:2px 4px; }
.conv-grid input:not([type=checkbox]) { width:100%; } .conv-grid td .pick { position:relative; }
.vend-grid td:nth-child(1) { width:230px; } .vend-grid td:nth-child(2) { width:104px; } .vend-grid td:nth-child(3) { width:140px; }
.vend-grid td:nth-child(4), .vend-grid td:nth-child(5), .vend-grid td:nth-child(6) { width:84px; }
fieldset.conv > p.muted { max-width:680px; }

/* Record-family colours: layout() sets body[data-kind]; setup, reports and other screens stay neutral. */
body[data-kind=customer] { --kind:#1d5fd1; --kind-bg:#eef3fc; }
body[data-kind=invoice] { --kind:#0f8a7e; --kind-bg:#ecf7f5; }
body[data-kind=quote] { --kind:#7b3fc4; --kind-bg:#f4eefb; }
body[data-kind=cash] { --kind:#2e8b2e; --kind-bg:#eef7ee; }
body[data-kind=item] { --kind:#c27c00; --kind-bg:#fdf5e4; }
body[data-kind=vendor] { --kind:#d4561c; --kind-bg:#fcf0ea; }
body[data-kind=po] { --kind:#8a5a3a; --kind-bg:#f6f0ea; }
body[data-kind=bill] { --kind:#c0263f; --kind-bg:#fbeef0; }
body[data-kind=rma] { --kind:#c9378a; --kind-bg:#fbeef5; }
body[data-kind=ship] { --kind:#3b7a99; --kind-bg:#edf4f8; }
body[data-kind=contact] { --kind:#4a4fc4; --kind-bg:#eff0fb; }
body[data-kind] { background:#fff; }
body[data-kind] header { box-shadow:inset 0 -5px 0 var(--kind); }
body[data-kind] .pagehead h1 { color:var(--kind); border-left:6px solid var(--kind); padding-left:10px; }
body[data-kind] .sect > h4 { color:var(--kind); }
body[data-kind] .tag { color:var(--kind); }

/* sign-in and the header's user box */
.whoami { margin-left:auto; display:flex; align-items:center; gap:12px; font-size:13px; }
.whoami form { margin:0; }
.linkbtn { background:none; border:0; padding:0; color:#cfd8ea; cursor:pointer; font:inherit; } .linkbtn:hover { color:#fff; text-decoration:underline; }
body.login main { max-width:380px; margin:12vh auto 0; }
.loginbox h1 { margin-top:0; }
.stampline { color:#667; font-size:12px; font-weight:400; margin-left:14px; }

/* audit detail row, opened under its event */
tr.auditopen > td { background:var(--kind-bg, #f5f7fb); padding:8px 12px 12px 28px; border-top:0; } tr.auditopen h3 { margin:0 0 2px; font-size:13px; text-transform:capitalize; } tr.auditopen p { margin:0 0 6px; }
.auditdetail { width:auto; min-width:60%; background:#fff; } .auditdetail td { vertical-align:top; word-break:break-word; } .auditdetail td:first-child { color:var(--muted); white-space:nowrap; text-transform:capitalize; } .auditdetail .was { color:var(--muted); }

/* printed-form choices from Setup > Forms (classes on .docsheet) */
.docsheet.paper-a4 { max-width:8.27in; } .docsheet.font-small { font-size:10.5px; } .docsheet.font-large { font-size:14px; }
.doc-logo { display:block; max-height:.7in; max-width:2.4in; } .logo-small .doc-logo { max-height:.45in; max-width:1.6in; } .logo-large .doc-logo { max-height:1.1in; max-width:3.4in; }
.doc-logo-row { margin-bottom:8px; } .doc-logo-row:not(.left):not(.right) { text-align:center; } .doc-logo-row:not(.left):not(.right) .doc-logo { margin:0 auto; }
.doc-logo-row.right .doc-logo { margin-left:auto; }
.docsheet.head-shaded .doc-lines th { background:#e8e8e8; border-top:1px solid #000; }

/* budget grid: 12 periods wide, scrolls sideways on narrow screens */
.scrollx { overflow-x: auto; }
table.budgetgrid input.num { width: 6.5em; }
table.budgetgrid td:first-child { white-space: nowrap; }
dialog.lotdlg { min-width:420px; border:1px solid var(--line); border-radius:6px; padding:12px 16px; } dialog.lotdlg .pick input { width:14em; } dialog.lotdlg .pick-list { right:auto; min-width:340px; }
fieldset.bankq { border:0; padding:0; margin:0 0 10px; display:flex; flex-wrap:wrap; gap:6px 18px; } fieldset.bankq legend { font-weight:600; padding:0; margin-bottom:4px; width:100%; }
