/* Hub layouts share the ERP palette and scale from a single pane to a retained list/detail workspace. */
.splitWorkspace{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;min-width:0}
.splitList,.splitDetail,.hubTabPanel{min-width:0}
.splitDetail:empty{display:none}
.hasDetail .splitList{display:none}
.splitDetail{padding:20px;background:var(--panel);border:1px solid var(--border);border-radius:var(--radius)}
.hubTabs{display:flex;gap:6px;border-bottom:1px solid var(--border);overflow:auto;margin:20px 0 16px;position:relative}
/* one underline, slid under the selected tab with a transform (hub-ui.js sets --tx and --tw) */
.hubTabs::after{content:'';position:absolute;left:0;bottom:0;width:1px;height:3px;background:var(--accent);transform:translateX(var(--tx,0)) scaleX(var(--tw,0));transform-origin:left;pointer-events:none}
.hubTabs.tabsReady::after{transition:transform 260ms var(--ease-out,ease)}
.hubTabs button{font:inherit;white-space:nowrap;background:transparent;color:var(--text-mut);border:0;border-bottom:3px solid transparent;padding:12px;min-height:44px;cursor:pointer}
.hubTabs [aria-selected=true]{color:var(--accent);font-weight:600}
.hubBalance{display:flex;gap:16px;align-items:baseline;padding:16px 0;color:var(--text-mut)}
.hubBalance b{font-size:var(--fs-2xl);color:var(--text)}
.creditBanner{display:flex;flex-wrap:wrap;gap:12px;align-items:center;padding:14px;border-radius:var(--radius-control);background:var(--accent-light);color:var(--accent-dark);margin-top:16px}
.hubSideOverlay{justify-content:flex-end;padding:0;overflow:hidden}
.hubSidePanel.modal.wide{width:min(100%,1000px);height:100%;max-height:100dvh;margin:0;border-radius:0;overflow:auto;overscroll-behavior:contain;position:relative}
.hubSidePanel>h3{padding-right:96px;min-height:36px;display:flex;align-items:center}
.panelBody{min-width:0}
/* no scroll lock under pop-ups: the overlay contains its own scrolling (overscroll-behavior), so the page stays still and its scroll bar never jumps or leaves a strip */
/* list search row: one roomy search box with Filters beside it, no label or counter */
#app .filters{align-items:center;gap:10px;}
#app .filters .cbSearch{gap:0;}
#app .filters .cbSearch input{height:40px;min-height:40px;padding:0 14px;font-size:var(--fs-base);}
#app .filters > .plFilterToggle{height:40px;min-height:40px;padding:0 16px;}
.panelBody .vGridWrap{overflow:auto}
.customerStrip>div.customerStrip{display:flex;flex-wrap:wrap;gap:16px;align-items:center;padding:0;border:0}
#topbar{flex-wrap:wrap}
.searchDialog [role=option]{display:flex;justify-content:space-between;gap:12px;padding:12px;border-radius:var(--radius-control);cursor:pointer;min-height:44px}
.searchDialog [role=option][aria-selected=true]{background:var(--accent-fill);color:var(--on-accent)}
.searchDialog [role=option][aria-selected=true] span{color:inherit}
.searchDialog [role=option] span{color:var(--text-mut)}
.searchDialog [role=listbox]{max-height:55dvh;overflow:auto}
.searchDialog .usGroup{color:var(--text-mut);font-size:var(--fs-xs);font-weight:600;margin:12px 12px 4px;}
.searchDialog .usGroup:first-child{margin-top:4px;}
.searchDialog .usLabel{color:var(--text-mut);font-size:var(--fs-sm);font-weight:600;margin:12px 12px 6px;min-height:1.4em;}
.searchDialog [role=option] .usForget{width:28px;height:28px;margin:-4px -4px -4px 0;flex:none;opacity:0;}
.searchDialog [role=option]:hover .usForget,.searchDialog [role=option][aria-selected=true] .usForget,.searchDialog .usForget:focus-visible{opacity:1;}
.searchDialog .usForget .icn{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;}
.searchDialog [role=option] span{margin-left:auto;}
/* global search looks like the Add widgets sheet: no title, the grey search field and the round close button */
.searchDialog.modal.wide{width:min(920px,100%);border-radius:20px;padding:20px 24px 16px;}
.searchDialog > h3{display:none;}
.searchDialog .usHead{padding:0 0 8px;}
.searchDialog .mClose.sheetClose{position:static;}
.overlay:has(> .searchDialog){background:rgba(0,0,0,.42);}
.searchDialog .usLabel:empty{visibility:hidden;}
.docRow[tabindex]{cursor:pointer}
.noteRow{font-size:var(--fs-xs);color:var(--text-mut);padding-block:6px;white-space:normal}
.hasDetail .vList .docTable th:nth-child(2),.hasDetail .vList .docTable td:nth-child(2),.hasDetail .vList .docTable th:nth-child(4),.hasDetail .vList .docTable td:nth-child(4),.hasDetail .vList .docTable th:nth-child(n+6),.hasDetail .vList .docTable td:nth-child(n+6){display:none}
.hasDetail .vList .docTable{font-size:var(--fs-sm)}
.hasDetail .splitList .docTable{table-layout:fixed;width:100%}
.hasDetail .splitList .docTable th,.hasDetail .splitList .docTable td{padding:10px 7px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hasDetail .splitList .noteRow{display:none}
.hasDetail .splitList:not(.vList) .docTable th:nth-child(n+4),.hasDetail .splitList:not(.vList) .docTable td:nth-child(n+4){display:none}
.hasDetail .vList .docTable th:first-child{width:42%}
.hasDetail .vList .docTable th:nth-child(3){width:38%}
/* lists: search and a Filters button; the other filters open under it */
#app .plAdvanced{display:none}
#app .filtersExpanded .plAdvanced{display:flex;flex-wrap:wrap;gap:10px;flex-basis:100%;align-items:flex-end;padding:12px;border:1px solid var(--border);background:var(--fill-2)}
#app .plFilterToggle{display:inline-flex}
#app .plFilterToggle[hidden]{display:none}
/* a filter that is a chip in the bar never repeats in the panel; the dates show there only after Custom Dates */
#app .plAdvanced .fld.plIsQuick,#app .plAdvanced:not(.showDates) .fld.plIsDate{display:none}
.hasDetail .vList .mono{white-space:nowrap;font-size:var(--fs-xs)}
.docRow:focus-visible{outline:none}
.tableWrap:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
/* a record opens on the whole page (the list stays behind it, filters intact); Back, position and previous / next on top */
.recordBar{display:flex;align-items:center;gap:8px;margin:-4px 0 14px;padding-bottom:12px;border-bottom:1px solid var(--border)}
.recordBar .recPos{margin-left:auto;color:var(--text-mut);font-size:var(--fs-md);font-variant-numeric:tabular-nums}
@media(max-width:600px){#topbar{gap:8px}#searchBtn{margin-inline-start:auto}.splitDetail{padding:14px}.hubSidePanel.modal.wide{padding:16px}.panelBody .pageHeader{align-items:flex-start;flex-wrap:wrap}.vActions{flex-wrap:wrap}.hubTabs button{padding-inline:10px}.btn{min-height:44px}.splitDetail .vInfo{gap:12px}}
@media(max-width:600px){.hubTabPanel .docTable,[data-statement] .docTable{min-width:620px}.hubTabPanel .docTable td,[data-statement] .docTable td{white-space:nowrap}}
.projectHub>.pageHeader>div:first-child{min-width:0;flex:1 1 18rem;overflow-wrap:anywhere}
.projectHub>.pageHeader>.vActions{flex:1 1 100%}
.projectHub .projectFigures .docTable{min-width:0;width:100%;table-layout:fixed}
.projectHub .projectFigures .docTable th,.projectHub .projectFigures .docTable td{white-space:normal;overflow-wrap:anywhere}
.projectHub .projectFigures .docTable th:last-child{width:36%}
@media print{.splitList,.recordBar,.hubTabs,.mClose{display:none!important}.splitDetail{border:0;padding:0}}
.listTabs{margin:4px 0 10px}
.viewPick{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}.viewPick:hover{color:var(--accent-dark)}
/* Reports page: plain lists in columns */
.rhStar{flex:none;width:32px;height:32px;border:0;background:none;border-radius:6px;font-size:var(--fs-lg);line-height:1;color:var(--text-mut);cursor:pointer;opacity:0}
.rhGrid li:hover .rhStar,.rhStar:focus-visible,.rhStar.on{opacity:1}
@media (hover:none){.rhStar{opacity:1}}
/* Weekly entry keeps horizontal scrolling inside its table on narrow screens. */
.timesheetScreen { min-inline-size: 0; container-type: inline-size; }
.timesheetScreen .tableWrap { max-inline-size: 100%; overflow-x: auto; }
@container (min-width: 52rem) { .timesheetTotals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* attachments: one Upload file button with the limits beside it; file names read as links */
.attachHead{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:4px 0 12px;}.attachHead [data-upload]:has(.fileDrop){flex:1 1 100%;}
.linkBtn{background:none;border:none;padding:0;color:var(--accent);font:inherit;cursor:pointer;text-align:left;}
.linkBtn:hover{text-decoration:underline;}
/* any file picker left in a form gets the app's button look instead of the browser default */
input[type=file]{font:inherit;font-size:var(--fs-md);color:var(--text-mut);}
input[type=file]::file-selector-button{font:inherit;font-weight:500;margin-right:12px;padding:7px 14px;border:1px solid var(--border-strong);border-radius:var(--radius-control);background:var(--panel);color:var(--text);cursor:pointer;}
input[type=file]::file-selector-button:hover{background:var(--btn-hover);}
.formRow input[type=file],.fld input[type=file]{border:none;padding:0;min-height:0;background:none;}

/* one way back on record pages ("< Back"), one close icon on pop-ups and panels */
.recBack{display:inline-flex;align-items:center;gap:4px;background:none;border:none;padding:4px 6px 4px 0;font:inherit;font-size:var(--fs-base);font-weight:500;color:var(--text-mut);cursor:pointer;}
.recBack:hover{color:var(--accent);}
.recBack svg,.iconBtn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.iconBtn{display:inline-grid;place-items:center;width:34px;height:34px;padding:0;border:none;border-radius:50%;background:none;color:var(--text-mut);cursor:pointer;}
.iconBtn:hover:not(:disabled){background:var(--btn-hover);color:var(--text);}
.iconBtn:disabled{opacity:.35;cursor:default;}
.modal{position:relative;}
.modal > .mClose{position:absolute;top:14px;right:14px;}
.modal > h3{padding-right:44px;}

/* document history: a plain timeline */
.historyList{list-style:none;margin:8px 0 0;padding:0;}
.historyList li{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;padding:10px 0;border-bottom:1px solid var(--rule);}
.historyList li:last-child{border-bottom:none;}
.historyList .hAct{font-weight:500;min-width:120px;}
.historyList .hWhat{flex-basis:100%;padding-left:132px;}
@media(max-width:600px){.historyList .hWhat{padding-left:0;}}
.hubTabs button:focus:not(:focus-visible){outline:none;}

/* timesheets and labour allocation: one period switcher, a grid that fits, cards for summaries */
.periodBar{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;margin:0 0 16px;}
.periodLabel{font-size:var(--fs-xl);font-weight:600;min-width:12ch;text-align:center;}
.periodBar > .uiSel{width:auto!important;}
.periodBar > select + .uiSel{min-height:34px;padding:5px 10px;}   /* the same height as the date boxes beside it */
.periodBar .fld input[type=text]{box-sizing:border-box;min-height:36px;padding:7px 11px;}   /* a typed value (overtime rate) matches the pickers beside it */
/* a date/month picker next to the period label shows only its calendar icon */
.periodBar > :is(input[type=date],input[type=month]) + .uiSel{min-height:34px!important;padding:0 8px!important;border:none;background:none;}
.periodBar > :is(input[type=date],input[type=month]) + .uiSel .uiTx{display:none;}
.bankBar > :is(input[type=date],input[type=month]) + .uiSel{border:1px solid var(--border-strong);background:var(--panel);padding:0 10px!important;}
.periodField{display:flex;align-items:center;gap:8px;margin-left:auto;font-size:var(--fs-md);color:var(--text-mut);}
.periodField .uiSel{width:auto!important;}
.badge.accentBadge{background:var(--accent-light);color:var(--accent-dark);}
.timesheetGrid{width:100%;table-layout:fixed;min-width:860px;}
.timesheetGrid th,.timesheetGrid td{padding:6px 4px;vertical-align:middle;}
.timesheetGrid th:nth-child(1),.timesheetGrid th:nth-child(2){width:19%;}
.timesheetGrid th:nth-child(3){width:14%;}
.timesheetGrid th.day{width:56px;text-align:center;}
.timesheetGrid th:nth-last-child(2){width:64px;}
.timesheetGrid th:last-child{width:40px;}
.timesheetGrid input,.timesheetGrid .lkp input{width:100%;height:36px;min-height:36px;padding:0 10px;border:1px solid var(--border-strong);border-radius:var(--radius-control);background:var(--panel);color:var(--text);font:inherit;font-size:14px;}
.timesheetGrid [data-day]{padding:0 4px;text-align:center;}
.timesheetGrid .isToday{background:var(--accent-light);}
.timesheetGrid th.isToday{color:var(--accent-dark);font-weight:600;}
.timesheetGrid th.isWeekend{color:var(--text-faint);}
.timesheetGrid td.isWeekend input{background:var(--raised);}
.timesheetGrid tfoot th,.timesheetGrid tfoot td{font-weight:600;border-top:1px solid var(--border);border-bottom:none;text-align:center;}
.timesheetGrid tfoot th{text-align:left;padding-left:10px;}
.timesheetGrid td.num,.timesheetGrid tfoot td.num{text-align:right;padding-right:10px;font-variant-numeric:tabular-nums;}
.tsAdd{margin:10px 2px 6px;font-weight:500;}
.timesheetTotals{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px;margin-top:16px;}
.tsCard{padding:0;margin-bottom:16px;}
.tsCard .tableWrap{border:none;border-radius:0;}

/* banking: one filter bar, five tiles, short note */
.statGrid.statGrid5{grid-template-columns:repeat(5,minmax(0,1fr));}
@media(max-width:900px){.statGrid.statGrid5{grid-template-columns:repeat(3,minmax(0,1fr));}.statGrid.statGrid5>:nth-child(5){grid-column:span 2;}}   /* five fit in one row down to 900 px; below, the last fills its row: no empty box */
.bankBar .viewPick{font-size:var(--fs-xl);font-weight:600;margin-right:6px;}
.bankBar > select + .uiSel,.bankBar > input[type=date] + .uiSel{width:auto!important;}
.bankBar > .uiSel .uiTx{display:inline!important;}
.bankNote{margin:-10px 0 14px;}

/* year-end: three numbered steps in cards */
.yeGrid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:16px;}
@media(max-width:900px){.yeGrid{grid-template-columns:1fr;}}
.yeCard{padding:0;margin-bottom:16px;overflow:hidden;}
.yeCard .listRows .main{white-space:normal;}
.yeCard .listRows .badge{margin-right:8px;}
.yeNote{margin:0 18px 14px;}
.yeFig{display:flex;flex-direction:column;gap:2px;padding:14px 18px 8px;}
.yeFig .k{font-size:var(--fs-md);color:var(--text-mut);}
.yeFig .v{font-size:var(--fs-3xl);font-weight:600;font-variant-numeric:tabular-nums;}
.yeFig .v.neg{color:var(--danger);}
.yeCard .docTable{width:100%;}
.yeCard .docTable tfoot th{border-top:1px solid var(--border);}

/* back: a round chevron right before the page title (no separate bar) */
h2:has(> .backBtn){display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;}
h2 > .backBtn{width:36px;height:36px;margin-left:-8px;margin-right:-4px;color:var(--text-mut);}
h2 > .backBtn svg{width:22px;height:22px;}

/* appearance: theme tiles with a small preview */
.themeCard{padding:0;}
.themeChoices{display:flex;flex-wrap:wrap;gap:20px;padding:16px 18px 20px;}
.themeTile{display:flex;flex-direction:column;align-items:center;gap:6px;cursor:pointer;text-align:center;}
.themeTile input{position:absolute;opacity:0;pointer-events:none;}
.themePv{width:132px;height:84px;border-radius:10px;border:1px solid var(--border);padding:10px;display:flex;flex-direction:column;gap:6px;overflow:hidden;}
.themePv i{display:block;height:10px;border-radius:4px;}
.themePv i:last-child{width:60%;}
.themePv.light{background:#f4f5f8;}.themePv.light i{background:#fff;}
.themePv.dark{background:#1e1f22;}.themePv.dark i{background:#34363a;}
.themePv.auto{background:linear-gradient(135deg,#f4f5f8 50%,#1e1f22 50%);}.themePv.auto i{background:color-mix(in srgb,#888 45%,transparent);}
.themeTile input:checked + .themePv{border-color:var(--accent-fill);box-shadow:0 0 0 2px var(--accent-fill);}
.themeTile input:focus-visible + .themePv{outline:2px solid var(--accent);outline-offset:3px;}
.themeName{font-size:var(--fs-base);font-weight:500;}
.themeTile .hintSmall{margin:0;}

.logoPv{max-height:90px;max-width:260px;}
.swRow{display:inline-flex;align-items:center;gap:8px;}.swRow.pick{display:flex;gap:10px;}
.swatch{width:20px;height:20px;border-radius:5px;border:1px solid var(--border);background:var(--sw);}
.colorPick{width:48px;height:36px;padding:2px;}.swRow.pick input.colorPick{flex:0 0 44px;width:44px;cursor:pointer;}.swRow.pick #bHex{flex:0 0 130px;}.swRow.pick .btn{white-space:nowrap;}
.w120{max-width:120px;}.w130{max-width:130px;}
#aVou.w130{width:130px;}
.termRow{grid-template-columns:1fr 120px auto;align-items:end;}
.eiForm{max-width:520px;margin-top:14px;}
.minW240{min-width:240px;}.minW200{min-width:200px;}
.rpTog svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle;transition:transform .15s;}
.rpTog[aria-expanded="true"] svg{transform:rotate(90deg);}
.rhStar svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle;}
.rhStar.on svg{fill:currentColor;}
code.fx{font:inherit;font-size:var(--fs-md);color:var(--text-mut);background:none;padding:0;}   /* formulas in the body font */
.bizTypes{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px;}
.bizType{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border:1px solid var(--border);border-radius:var(--radius);cursor:pointer;}
.bizType:has(input:checked){border-color:var(--accent-fill);background:var(--accent-light);}
.bizType > span{display:flex;flex-direction:column;gap:2px;}
.bizType .hintSmall{margin:0;}
.bizModules{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:8px 16px;}
/* active filters as removable chips under the search bar (hidden while the filter panel is open: the fields show it) */
#app .plChips{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:-4px 0 12px;}
#app .plChips:empty,#app .filtersExpanded + .plChips{display:none;}
#app .plChip{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:0 8px 0 12px;border:1px solid var(--accent-fill);border-radius:16px;background:var(--accent-light);color:var(--text);font:inherit;font-size:var(--fs-md);cursor:pointer;}
#app .plChip .k{color:var(--text-mut);}
#app .plChip svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;color:var(--text-mut);}
#app .plChip:hover svg{color:var(--danger);}
#app .plChip:focus-visible{outline:none;box-shadow:0 0 0 3px var(--focus);}
#app .plFilterToggle.on{border-color:var(--accent-fill);color:var(--accent);}
/* quick filter chips in the bar: one click opens the choices; a set chip turns blue and shows its value */
#app .plQuick{display:contents;}
#app .plQuick .plQuickBtn{height:40px;min-height:40px;padding:0 14px;border-radius:20px;white-space:nowrap;}
#app .plQuick .plQuickBtn.on{border-color:var(--accent-fill);background:var(--accent-light);color:var(--accent);font-weight:600;}

/* payroll run: the per-person amounts are short numbers, so the table fits and Net stays in view */
[data-employees] input[data-key]{width:11ch;min-width:0;}
