/* Record pages: the list pages and their toolbar (tabs, search, filters, count) and the empty list. */

/* List pages */
.reg-table td{max-width:22.5rem}
.reg-table th{white-space:nowrap}
.coldefs{display:grid;grid-template-columns:max-content 1fr;gap:calc(0.125rem * var(--dz)) var(--space-2);margin:var(--space-2) 0 0;font-size:var(--fs-sm)}
.coldefs dd{margin:0;color:var(--ink-2)}
.check{display:inline-flex;align-items:center;gap:calc(0.375rem * var(--dz));font-size:var(--fs-md);color:var(--ink-2);white-space:nowrap}
.check input{accent-color:var(--m-system)}

/* Toolbar: title and action; tabs; then search, filters, count */
.tabs-row{display:flex;align-items:center;gap:var(--space-3);border-bottom:1px solid var(--rule);margin:0 0 calc(0.625rem * var(--dz))}
.tabs-row > :is(.primary-btn,.pop-right,#sf-btn){margin-left:auto}
.tabs-row > #sf-btn + .pop-right{margin-left:0}
/* Underline tabs */
.view-tabs{border:0;margin:0;padding:0;min-width:0}
.view-tabs .seg-opts{gap:var(--space-4)}
.view-tabs label{position:relative;display:inline-flex;align-items:center;gap:calc(0.375rem * var(--dz));height:var(--ctl-h);margin-bottom:calc(-0.0625rem * var(--dz));border-bottom:2px solid transparent;font-size:var(--fs-md);font-weight:var(--fw-strong);color:var(--muted);cursor:pointer;white-space:nowrap}
.view-tabs label:hover{color:var(--ink-2)}
.view-tabs label:has(input:checked){color:var(--ink);border-bottom-color:var(--accent)}
.view-tabs label:has(input:focus-visible){outline:2px solid var(--focus);outline-offset:2px}
.reg-filterbar .filters{flex:1 1 20rem}
.reg-filterbar .count{margin-left:auto}
.chg-filter label{font-weight:var(--fw-medium);gap:var(--space-1)}
.chg-filter label:has(input:checked){color:var(--ink)}

/* A list with no rows yet */
.reg-empty{display:flex;flex-direction:column;align-items:center;gap:var(--space-4);margin:var(--space-2) 0 var(--space-4);padding:calc(2.5rem * var(--dz)) var(--space-4);text-align:center;white-space:normal}
.reg-empty .illus{flex:none;width:clamp(9rem,22vw,14rem)}
.reg-empty h3{margin:0 0 var(--space-2);padding:0;font-size:var(--fs-xl);color:var(--ink)}
.reg-empty p{margin:0 auto var(--space-3);max-width:36rem;color:var(--ink-2)}
.reg-empty p:last-child{margin-bottom:0}

/* Chart of accounts, parties and the settings lists */
.toolbar-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-2);margin-left:auto}
.coa td.coa-code{white-space:nowrap}
.coa-class td{background:var(--surface-2);font-weight:var(--fw-bold)}
.coa-subclass td{font-weight:var(--fw-strong)}
.coa-subclass td:first-child{padding-left:calc(var(--pad-cell-x) + var(--space-3))}
.coa-type td:first-child{padding-left:calc(var(--pad-cell-x) + var(--space-3) * 2)}
/* People & Org: the departments tree indents the name by its depth (PB4b) */
.org-tree td.depth-1{padding-left:calc(var(--pad-cell-x) + var(--space-4) * 1)}
.org-tree td.depth-2{padding-left:calc(var(--pad-cell-x) + var(--space-4) * 2)}
.org-tree td.depth-3{padding-left:calc(var(--pad-cell-x) + var(--space-4) * 3)}
.org-tree td.depth-4{padding-left:calc(var(--pad-cell-x) + var(--space-4) * 4)}
.org-tree td.depth-5{padding-left:calc(var(--pad-cell-x) + var(--space-4) * 5)}
.org-tree td.depth-6{padding-left:calc(var(--pad-cell-x) + var(--space-4) * 6)}
@media (max-width:64em){
  .org-tree td.depth-1{padding-left:calc(var(--pad-cell-x) + var(--space-3) * 1)}
  .org-tree td.depth-2{padding-left:calc(var(--pad-cell-x) + var(--space-3) * 2)}
  .org-tree td.depth-3{padding-left:calc(var(--pad-cell-x) + var(--space-3) * 3)}
  .org-tree td.depth-4{padding-left:calc(var(--pad-cell-x) + var(--space-3) * 4)}
  .org-tree td.depth-5{padding-left:calc(var(--pad-cell-x) + var(--space-3) * 5)}
  .org-tree td.depth-6{padding-left:calc(var(--pad-cell-x) + var(--space-3) * 6)}
}
.coa-account td:first-child{padding-left:calc(var(--pad-cell-x) + var(--space-3) * 3)}
.pill-row{display:flex;flex-wrap:wrap;gap:var(--space-1)}
.inline-form{display:inline}
.account-page .page-tabs{max-width:100%;overflow-x:auto}
.inline-form select{max-width:12.5rem;height:var(--ctl-h);font:inherit;font-size:var(--fs-md);color:var(--ink);background:var(--surface-2);border:1px solid var(--line);border-radius:var(--control-radius);padding:0 var(--space-2);margin-right:var(--space-2)}
.reopen summary{display:inline-block;cursor:pointer}
.reopen form{display:flex;gap:var(--space-2);margin-top:var(--space-1)}
.reopen input{min-width:0;flex:1}
.periods-controls{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--space-2)}
.view-head > .periods-controls{flex-direction:row}
.open-year{position:relative}
.open-year summary{display:inline-flex;align-items:center;height:var(--ctl-h);cursor:pointer;list-style:none}
.open-year summary::-webkit-details-marker{display:none}
.open-year form{position:absolute;top:calc(100% + var(--space-1));right:0;z-index:var(--z-pop);display:flex;align-items:center;gap:var(--space-2);white-space:nowrap;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--tile-radius);box-shadow:var(--shadow);padding:var(--space-2) var(--space-3)}
@media (max-width:40rem){.periods-controls,.periods-selector{width:100%}.open-year form{white-space:normal;flex-wrap:wrap}}

/* Buying (SC4): the purchase order's heading may wrap at phone width, so a long number and status never widen the page (R41d). */
#view-scm-purchase-order .toolbar h2{white-space:normal;overflow-wrap:anywhere}

/* Leases (RN2a1b2): the terms, the occupants, the notes and the reasons wrap at phone width (R41d); the workflow and the
   attachments do not print with the lease's summary. */
#view-sell-lease .kv dd,#view-sell-lease td,#lease-preview .kv dd{overflow-wrap:anywhere}
@media print{#view-sell-lease #record-workflow,#view-sell-lease #doc-attachments,#view-sell-lease #lease-changes form{display:none}}
/* The job page (OW3b): long text wraps at 390px, a note keeps its line breaks, and the forms, the details and the workflow do not
   print with the job's head and notes. */
#view-ops-order .doc-heads dd,#view-ops-order .ops-note-body,#view-ops-order .small{overflow-wrap:anywhere}
#view-ops-order .ops-note-body{white-space:pre-wrap}
/* A task's drawer (OW17g) sits in <body>, outside the job page: its notes wrap and keep their line breaks the same way. */
#ops-task-drawer .ops-note-body,#ops-task-drawer .small{overflow-wrap:anywhere}
#ops-task-drawer .ops-note-body{white-space:pre-wrap}
#ops-task-drawer .ops-task-notes{list-style:none;padding:0}
@media print{#view-ops-order form,#view-ops-order details,#view-ops-order #record-workflow{display:none}}
/* The move-out settlement (RN2b3): long text wraps at 390px, and the action card and the date filter do not print. */
#view-sell-settlement .kv dd,#view-sell-settlement td,#view-sell-settlement .small{overflow-wrap:anywhere}
@media print{#view-sell-settlement #settlement-actions,#view-sell-settlement #settlement-filter{display:none}}
/* The settlements of rent on sales (BP3b): long text wraps at 390px, and the void form does not print with the statement. */
#view-sell-settlements .kv dd,#view-sell-settlements td,#view-sell-settlements .small,#settlement-preview .kv dd,#settlement-preview li,#view-sell-settlement-statement .kv dd,#view-sell-settlement-statement td,#view-sell-settlement-statement li{overflow-wrap:anywhere}
@media print{#view-sell-settlement-statement #settlement-void{display:none}}

/* People, Import employees (W8): one card that fills the page; the upload row sits under the empty state or the preview. */
.people-import-card{flex:1;min-height:0;display:flex;flex-direction:column;gap:var(--space-3)}
.people-import-card > .people-import-empty{flex:1;justify-content:center;border:0;box-shadow:none;background:none}
.people-import-card > .table-scroll{flex:1}
.people-import-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:var(--space-2) var(--space-3)}
.people-import-card > .table-scroll + .people-import-actions{justify-content:flex-end}
label.primary-btn,label.close{display:inline-block}
.people-import-actions label:focus-within{outline:2px solid var(--accent);outline-offset:2px}

/* People, Bring in (W8): the values every ticked employee gets sit in a bar at the foot, beside the button, in view while the list scrolls. */
.bring-for-ticked{position:sticky;bottom:calc(-1 * var(--pad-page-y));z-index:var(--z-bar);display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--space-2) var(--space-3);margin-top:var(--space-3);padding:var(--space-2) var(--pad);background:var(--surface);border-top:var(--bar-border);box-shadow:var(--bar-shadow)}
.bring-for-ticked > p{flex:1 0 100%;margin:0}
.bring-for-ticked .ed-fields{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-3);flex:1}
.bring-for-ticked .ed-fields label{flex:0 1 14rem}
