/* =====================================================================
   SMV dashboard — ONE button colour system (prompt 17, 2026-10-06), used by index.html, floor.html and every page script.
   Every <button> carries exactly one of these meaning classes (tools/btn-check.js fails the deploy otherwise):
     btn-primary (alias .call)   solid green   save / confirm / approve / mark paid / mark done / import / create / log call
     btn-danger  (alias .danger) solid red     void / cancel a task / refuse / delete / scrap / logout  (always behind a confirm)
     btn-neutral (alias .ghost)  grey outline  close / back / cancel a form / dismiss / the X
     btn-info                    solid blue    open / view / print / download / export / refresh / edit
     btn-caution                 solid amber   hold / snooze / waiting / request approval / take over / undo
     btn-purple  (alias .purple) purple        "closed by others" / take over and close
     btn-teal                    teal          AI buttons
     btn-seg                     a toggle in a segmented control (status pickers, tabs, keypads): keeps the control's own look
     btn-nav                     header / navigation buttons (bell, Big screen, shop-floor tabs)
   Colours were checked for contrast ≥ 4.5:1 with white (or the dark text) — tools/btn-check.js recomputes them.
   Icons: a tick / cross / printer / arrow is drawn before the main actions (.noic switches it off when the label has its own).
   ===================================================================== */
:root { --b-green: #12805c; --b-green-d: #0e6a4c; --b-red: #c81e1e; --b-red-d: #a51818; --b-blue: var(--blue); --b-blue-d: var(--blue-d);
  --b-amber: #b45309; --b-amber-d: #92400e; --b-purple: #7e22ce; --b-purple-d: #6b1fb0; --b-teal: #0f766e; --b-teal-d: #0b5f59;
  --b-grey: var(--n100); --b-grey-line: #98a2b3; --b-grey-ink: var(--n800); --b-dis: var(--n200); --b-dis-ink: var(--n600); }
button.btn-primary, button.call { background: var(--b-green); color: #fff; border: 1px solid var(--b-green); font-weight: 700; }
button.btn-primary:hover, button.call:hover { background: var(--b-green-d); }
button.btn-danger, button.danger { background: var(--b-red); color: #fff; border: 1px solid var(--b-red); font-weight: 700; }
button.btn-danger:hover, button.danger:hover { background: var(--b-red-d); }
button.btn-neutral, button.ghost { background: var(--b-grey); color: var(--b-grey-ink); border: 1px solid var(--b-grey-line); font-weight: 600; }
button.btn-neutral:hover, button.ghost:hover { background: var(--line); }
button.btn-info { background: var(--b-blue); color: #fff; border: 1px solid var(--b-blue); font-weight: 600; }
button.btn-info:hover { background: var(--b-blue-d); }
button.btn-caution { background: var(--b-amber); color: #fff; border: 1px solid var(--b-amber); font-weight: 600; }
button.btn-caution:hover { background: var(--b-amber-d); }
button.btn-purple, button.purple { background: var(--b-purple); color: #fff; border: 1px solid var(--b-purple); font-weight: 700; }
button.btn-purple:hover, button.purple:hover { background: var(--b-purple-d); }
button.btn-teal { background: var(--b-teal); color: #fff; border: 1px solid var(--b-teal); font-weight: 600; }
button.btn-teal:hover { background: var(--b-teal-d); }
button:disabled, button.btn-primary:disabled, button.btn-danger:disabled, button.btn-info:disabled, button.btn-caution:disabled, button.btn-teal:disabled, button.btn-purple:disabled,
button.call:disabled, button.danger:disabled, button.purple:disabled { background: var(--b-dis); color: var(--b-dis-ink); border-color: var(--b-dis); box-shadow: none; cursor: not-allowed; opacity: 1; }
button.btn-neutral:disabled, button.ghost:disabled { background: var(--b-dis); color: var(--b-dis-ink); border-color: var(--b-dis); }
/* the main actions get an icon on the left (not when the label already starts with one: .noic) */
button.btn-primary:not(.noic)::before, button.call:not(.noic)::before { content: "✓ "; }
button.btn-danger:not(.noic)::before, button.danger:not(.noic)::before { content: "✕ "; }
button.btn-info.ic-print:not(.noic)::before { content: "🖨 "; }
button.btn-info.ic-dl:not(.noic)::before { content: "⬇ "; }
button.btn-info.ic-open:not(.noic)::before { content: "↗ "; }
button.btn-caution:not(.noic)::before { content: "⏸ "; }
button.btn-teal:not(.noic)::before { content: "✨ "; }
/* prompt 30: petty cash — wallet cards, the passbook (table ≥ 900 px, cards below), request cards, the 4-step bar, photos, the detail list */
.pc-wallet.off { opacity: .6; } .pc-chips { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s2); align-items: center; }
/* Reports → Meetings: the minutes form drawn in the page (not a dialog) */
.mom-form label { display: block; font-size: 12px; color: var(--muted); margin: var(--s3) 0 var(--s1); } .mom-form textarea { width: 100%; box-sizing: border-box; } .mom-form .pc-chips select, .mom-form .pc-chips input { min-width: 0; }
.pc-list .scroll { display: none; } .pc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: var(--s2); }
@media (min-width: 900px) { .pc-list .scroll { display: block; } .pc-cards { display: none; } }
.pc-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: var(--s3); cursor: pointer; min-width: 0; }
.pc-card:hover, .pc-req:hover { box-shadow: var(--shadow); } .pc-card.void { opacity: .55; text-decoration: line-through; } .pc-card.void .pill { text-decoration: none; }
.pc-card.wait, .pc-req.wait { border-color: var(--warn); } .pc-req.late { border-color: var(--bad); }
.pc-card .t, .pc-req .t { font-size: 14px; overflow-wrap: anywhere; } .pc-card .s, .pc-req .s { font-size: 12px; color: var(--muted); margin-top: var(--s1); overflow-wrap: anywhere; }
.pc-card .q { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-top: var(--s2); font-variant-numeric: tabular-nums; }
.pc-req { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: var(--s3); margin-top: var(--s3); min-width: 0; }
.pc-req2 { display: flex; gap: var(--s3); align-items: flex-start; } .pc-req .acts2 { margin-top: var(--s2); }
.pc-steps { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s2); }
.pc-step { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--n100); color: var(--muted); font-size: 12px; }
.pc-step i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: var(--n300, var(--line)); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; }
.pc-step.done { background: var(--gbg); color: var(--good); } .pc-step.done i { background: var(--good); color: var(--card); }
.pc-step.now { background: var(--acc2); color: var(--accent); font-weight: 600; } .pc-step.now i { background: var(--accent); color: var(--card); }
.pc-step.bad { background: var(--n100); color: var(--bad); } .pc-step.bad i { background: var(--bad); color: var(--card); }
.pc-ph { width: 84px; height: 84px; flex: none; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; background: var(--n100); font-size: 11px; color: var(--muted); text-align: center; }
.pc-ph img { max-width: 100%; max-height: 100%; object-fit: cover; } .pc-ph img:not([src]) { display: none; } .pc-ph span { padding: 2px; line-height: 1.2; }
.pc-phs { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); } .pc-phs .pc-ph { width: 120px; height: 120px; }
.pc-kvs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--s1) var(--s4); margin-top: var(--s3); }
.pc-kv { display: flex; flex-direction: column; min-width: 0; } .pc-kv span { font-size: 11px; color: var(--muted); } .pc-kv b { font-weight: 500; overflow-wrap: anywhere; }
.pc-log { font-size: 12px; margin-top: var(--s2); display: flex; flex-direction: column; gap: var(--s1); } .pc-log > div { overflow-wrap: anywhere; }
.pc-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: var(--s2) var(--s3); margin-top: var(--s2); } .pc-person { margin: 0; min-width: 0; }
.pc-person .bar { margin-top: var(--s1); flex-wrap: wrap; } .pc-person select { max-width: 100%; min-width: 0; flex: 1 1 160px; }
/* the month close card: one block per wallet — open (Close month), closed and waiting for the sign-off (amber), signed (green) */
.pc-closes { margin-top: var(--s3); } .pc-close { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: var(--s3); margin-top: var(--s2); min-width: 0; }
.pc-close.wait { border-color: var(--warn); } .pc-close.ok { border-color: var(--good); } .pc-close .t { font-size: 14px; overflow-wrap: anywhere; } .pc-close .s { font-size: 12px; color: var(--muted); margin-top: var(--s1); }
.pc-close .acts { margin-top: var(--s2); } .pc-close .good { color: var(--good); }
/* prompt 30B: the professional ledger (Finance → Petty cash → Ledger): the filter bar, the 4-card strip, the cash-book table (sticky
   header, zebra rows, money right-aligned, debit red / credit green, balance bold), totals rows, the category summary; cards on a phone */
.pc-bar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-bottom: var(--s3); }
.pc-bar select, .pc-bar input { min-height: 40px; max-width: 100%; }
.pc-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
.pc-strip .tile .v { font-weight: 800; } .pc-strip .tile.close .v { font-size: clamp(22px, 14cqi, 36px); }
.pc-strip .tile .v.cr { background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--pc-in); }
.pc-strip .tile .v.dr { background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--pc-out); }
.pc-ledger .scroll { max-height: 72vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.pc-ledger table { border-collapse: separate; border-spacing: 0; min-width: 980px; }
.pc-ledger thead th { position: sticky; top: 0; background: var(--n100); color: var(--n700); z-index: 1; border-bottom: 2px solid var(--line); font-size: 12px; }
.pc-ledger tbody tr:nth-child(even) td { background: var(--stripe); }
.pc-ledger tbody tr.r:hover td { background: var(--acc2); }
.pc-ledger td, .pc-ledger th { padding: 7px 8px; vertical-align: top; }
.pc-ledger td.n, .pc-ledger th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pc-ledger td.pc-part { white-space: normal; min-width: 220px; max-width: 360px; }
.pc-dr { color: var(--pc-out); font-weight: 600; } .pc-cr { color: var(--pc-in); font-weight: 600; } .pc-balc { font-weight: 700; }
.pc-ledger tr.voided td, .pc-ledger tr.voided td .pc-dr, .pc-ledger tr.voided td .pc-cr { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.pc-ledger tr.voided td .pill { text-decoration: none; }
.pc-ledger tr.pc-tot td { font-weight: 700; border-top: 2px solid var(--line); background: var(--n50); } .pc-ledger tr.pc-tot.m td { border-top: 1px solid var(--line); background: var(--n100); }
.pc-ledger tr.wait td { box-shadow: inset 3px 0 0 var(--warn); } .pc-ledger tr.late td { box-shadow: inset 3px 0 0 var(--bad); }
.pc-vou { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; white-space: nowrap; }
.pc-tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--infobg); color: var(--info); white-space: nowrap; }
.pc-tag.cash { background: var(--n100); color: var(--n700); } .pc-tag.wal { background: var(--gbg); color: var(--good); }
.pc-cat { width: 100%; border-collapse: collapse; } .pc-cat td, .pc-cat th { padding: 5px 8px; }
.pc-ledger .pc-cards { display: none; }
@media (max-width: 899px) { .pc-ledger .scroll { display: none; } .pc-ledger .pc-cards { display: grid; } }
.pc-card .amt { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
/* the big one-tap pickers of the forms: Paid from (3) and Company (2) */
.pc-big { display: grid; gap: var(--s2); margin: var(--s1) 0 var(--s2); } .pc-big.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pc-big.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pc-big .btn-seg { min-height: 52px; font-size: 14px; font-weight: 600; border: 2px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); white-space: normal; padding: 6px 8px; line-height: 1.25; }
.pc-big .btn-seg.on { border-color: var(--accent); background: var(--acc2); color: var(--accent); }
@media (max-width: 420px) { .pc-big.three { grid-template-columns: 1fr; } }
/* Admin → Appearance: one card per theme with its swatches */
.th-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--s3); margin-top: var(--s3); }
.th-card { border: 2px solid var(--line); border-radius: 12px; padding: var(--s3); cursor: pointer; background: var(--card); min-width: 0; }
.th-card.on { border-color: var(--accent); box-shadow: var(--glow); } .th-card h4 { margin: 0 0 var(--s1); }
.th-sw { display: flex; gap: 4px; margin: var(--s2) 0; } .th-sw i { display: block; width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); }
.th-card .hint { font-size: 12px; }
/* file-input labels that look like buttons = information (upload) */
label.btnlike { background: var(--b-blue); color: #fff; border-color: var(--b-blue); font-weight: 600; }
label.btnlike::before { content: "⬆ "; }
/* the X on every dialog / pop-up / wizard sheet: 44 px tap target, top right */
#dlg .box, #pop .box, #tpop .box { position: relative; }
.dlgx { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 10px; font-size: 22px; line-height: 44px; text-align: center; z-index: 2; }
.dlgx::before { content: none !important; }
#dlgbox h3:first-of-type, #dlgbox h2:first-of-type, #popbox h2:first-of-type { padding-right: 48px; }
.sh-top .sh-x { margin-left: auto; width: 48px; height: 48px; padding: 0; font-size: 22px; }
/* the colour legend inside the "?" help */
.ui-legend { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; margin-top: 10px; font-size: 15px; }
.ui-legend span.sw { display: inline-block; width: 60px; height: 26px; border-radius: 8px; }
/* Machine shop stock: item cards (2 per row on a tablet in portrait, 4 on a laptop), buttons ≥ 48 px */
.sh-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
@media (min-width: 1000px) { .sh-items { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 420px) { .sh-items { grid-template-columns: 1fr; } }
.sh-item { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; min-height: 48px; display: flex; gap: 10px; }
.sh-item.age-g { border-left-color: #12805c; } .sh-item.age-a { border-left-color: #eab308; } .sh-item.age-r { border-left-color: #dc2626; background: #fff7f7; }
.sh-item .sh-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.sh-item .body { flex: 1; min-width: 0; } .sh-item .n { font-size: 17px; font-weight: 700; } .sh-item .d { color: var(--muted); font-size: 16px; }
.sh-item .big { font-size: 32px; font-weight: 800; line-height: 1.1; margin-top: 4px; } .sh-item .sm { font-size: 16px; color: var(--muted); }
.sh-item:active { transform: scale(.99); }
.sh-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.sh-filters select { min-height: 48px; font-size: 16px; max-width: 100%; min-width: 0; }   /* a long customer name must not push the page wider than the phone */
.sh-lots td, .sh-lots th { font-size: 16px; } .sh-lots .acts2 button { min-height: 48px; font-size: 15px; padding: 8px 10px; }
#p-shop button:not(.sm):not(.dlgx), #p-store button:not(.sm):not(.dlgx) { min-height: 48px; }
/* landing buttons and segmented toggles draw no icon */
.sh-big button::before, button.btn-seg::before, button.btn-nav::before, nav button::before { content: none !important; }
/* prompt 19: every SOLID button forces white text and white icons — whatever the element (button, <label> around a file input, <a>, <span>)
   and whatever page rule tried to colour it (e.g. #dlg label { color: var(--muted) } made "Add photo" unreadable in the lot dialog) */
.btn-primary, .btn-danger, .btn-info, .btn-caution, .btn-purple, .btn-teal, button.call, button.danger, button.purple, .btnlike,
#dlg .btn-primary, #dlg .btn-danger, #dlg .btn-info, #dlg .btn-caution, #dlg .btn-purple, #dlg .btn-teal, #dlg label.btnlike, #dlg button.call, #dlg button.danger, #dlg button.purple,
.sh-form .btnlike, #p-shop .btnlike, #p-store .btnlike { color: #fff !important; }
.btn-primary svg, .btn-danger svg, .btn-info svg, .btn-caution svg, .btn-purple svg, .btn-teal svg, button.call svg, button.danger svg, button.purple svg, .btnlike svg,
.btn-primary svg *, .btn-danger svg *, .btn-info svg *, .btn-caution svg *, .btn-purple svg *, .btn-teal svg *, .btnlike svg * { fill: currentColor; stroke: currentColor; }
.btn-primary::before, .btn-danger::before, .btn-info::before, .btn-caution::before, .btn-purple::before, .btn-teal::before, .btnlike::before { color: #fff; }
a.btn-primary, a.btn-danger, a.btn-info, a.btn-caution, a.btn-purple, a.btn-teal, span.btn-primary, span.btn-info, span.btn-caution { display: inline-block; padding: 7px 10px; border-radius: 8px; text-decoration: none; font-weight: 600; }
a.btn-primary, span.btn-primary { background: var(--b-green); } a.btn-info, span.btn-info { background: var(--b-blue); } a.btn-caution, span.btn-caution { background: var(--b-amber); } a.btn-danger { background: var(--b-red); }
.btn-neutral, button.ghost, .btn-neutral::before { color: var(--b-grey-ink); }
/* prompt 31 (attendance & payroll, site/attend.js): the segment pickers of the forms, the WhatsApp text box, the muster grid */
.aw-seg .btn-seg { min-height: 40px; font-size: 13px; font-weight: 600; border: 2px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); padding: 6px 10px; white-space: normal; }
.aw-seg .btn-seg.on { border-color: var(--accent); background: var(--acc2); color: var(--accent); }
.aw-pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 13px; line-height: 1.45; background: var(--acc2); color: var(--ink); border-radius: var(--radius); padding: var(--s3); margin: var(--s2) 0; max-height: 320px; overflow: auto; }
.aw-grid td, .aw-grid th { padding: 4px 5px; text-align: center; white-space: nowrap; }
.aw-grid .aw-stick { position: sticky; left: 0; background: var(--card); text-align: left; z-index: 1; min-width: 120px; }
.aw-grid th.aw-dh { font-weight: 600; min-width: 24px; }
.aw-cell { cursor: pointer; font-weight: 700; font-size: 12px; min-width: 24px; }
.aw-p { color: var(--good); } .aw-h { color: var(--warn); } .aw-a { color: var(--bad); } .aw-l { color: var(--accent); } .aw-s { color: var(--muted); }
.aw-grid tr:hover td { background: var(--acc2); } .aw-grid tr:hover td.aw-stick { background: var(--acc2); }
/* prompt 38: the Zoho bill picker inside the petty cash forms and the link dialog */
.pc-zsel { border: 1px solid var(--line); border-radius: 12px; padding: var(--s3); margin: var(--s2) 0; background: var(--card); min-width: 0; }
.pc-zsel .t, .pc-zsel .s { overflow-wrap: anywhere; } .pc-zsel .s { font-size: 12px; color: var(--muted); margin-top: var(--s1); }
.pc-zlist { margin-top: var(--s2); min-width: 0; } .pc-zlist .scroll { max-height: 280px; overflow: auto; }
.pc-zlist tr.r { cursor: pointer; } .pc-zlist tr.voided { opacity: .5; cursor: default; }
/* Machine shop stock: customer DC links, drawing revision badges, the DCs table, the "same / revised drawing" choice */
.sh-dclnk { color: var(--accent); cursor: pointer; font-weight: 600; text-decoration: underline dotted; }
.sh-rev { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sh-file.struck > div > b { text-decoration: line-through; color: var(--muted); } .sh-file.struck .sh-thumb { opacity: .6; }
.sh-dctab td, .sh-dctab th { font-size: 15px; } .sh-dctab th.srt { cursor: pointer; white-space: nowrap; } .sh-dctab th.srt.on { color: var(--accent); } .sh-dctab tr.r { cursor: pointer; }
.sh-drgmode { margin-left: 4px; } .sh-drgrev { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; width: 100%; } .sh-drgrev input { flex: 1; min-width: 160px; }
