/* =================================================================
   assets/css/pages.css: shared layout for every list, record and
   document page (the run_list_page / run_doc_page engines).
   Page-specific CSS files only hold what is truly unique to one page.
   ================================================================= */

#main { position: relative; }          /* anchor for row menus */
.pg-head { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

/* ---------- list pages ------------------------------------------------ */
.pg-list { overflow: hidden; }
.pg-toolbar {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
    gap: var(--eb-space-3) var(--eb-space-4); padding: 4px var(--eb-space-5) 0;
    border-bottom: 1px solid var(--eb-line);
}
.pg-toolbar--plain { padding: var(--eb-space-3) var(--eb-space-5); }
.pg-tabs { border-bottom: 0; }
.pg-filters { display: flex; flex-wrap: wrap; gap: 10px; padding: var(--eb-space-2) 0; align-items: center; }
.pg-search { width: 260px; max-width: 100%; }
.pg-search svg { width: 16px; height: 16px; color: var(--eb-ink-2); flex: none; }
.pg-filter-select { width: auto; min-width: 150px; }
.pg-check { display: inline-flex; align-items: center; gap: 8px; font-size: var(--eb-text-md); color: var(--eb-ink-body); cursor: pointer; }
.pg-chip {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--eb-space-3);
    padding: 8px var(--eb-space-5); background: var(--eb-selected-bg); color: var(--eb-selected-fg);
    border-bottom: 1px solid var(--eb-line); font-size: var(--eb-text-md);
}
.pg-chip[hidden] { display: none; }
.eb-count--negative { background: var(--eb-negative-bg); color: var(--eb-negative-fg); }
.eb-count[hidden] { display: none; }

.pg-table { min-width: 760px; }
.pg-table td { white-space: nowrap; vertical-align: middle; }
.pg-table td.pg-wrap { white-space: normal; min-width: 180px; }
.pg-table tbody tr[data-href] { cursor: pointer; }
.pg-link { font-weight: 500; font-variant-numeric: tabular-nums; }
.pg-party { display: inline-flex; align-items: center; gap: 10px; color: var(--eb-ink); }
.pg-party:hover { color: var(--eb-link-hover); }
.pg-strong { font-weight: 600; }
.pg-muted { color: var(--eb-ink-2); }
.pg-sub { display: block; font-size: var(--eb-text-sm); color: var(--eb-ink-2); }
.pg-sub:empty { display: none; }
.pg-late { color: var(--eb-negative-fg); font-weight: 500; }
.pg-in { color: var(--eb-positive-fg); }
.pg-indentable { display: inline-block; }
.pg-indent-1 .pg-indentable { margin-left: 20px; }
.pg-indent-2 .pg-indentable { margin-left: 40px; }
.pg-indent-3 .pg-indentable { margin-left: 60px; }
.pg-indent-4 .pg-indentable { margin-left: 80px; }
.pg-header-row .pg-indentable { font-weight: 600; color: var(--eb-ink); }
.pg-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.eb-table tr.is-void td { color: var(--eb-ink-2); }
.eb-table tr.is-void .pg-link, .eb-table tr.is-void .eb-amount { text-decoration: line-through; }
.eb-table tr.is-inactive td { color: var(--eb-ink-2); }
.eb-table-wrap[hidden] { display: none; }

.pg-col-menu { width: 52px; text-align: right; }
.pg-kebab { width: 36px; height: 36px; color: var(--eb-ink-2); }
.pg-kebab svg { width: 16px; height: 16px; }
.pg-row-menu { min-width: 200px; }

.pg-state {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: var(--eb-space-12) var(--eb-space-6); text-align: center;
    color: var(--eb-ink-2); font-size: var(--eb-text-md);
}
.pg-state[hidden] { display: none; }
.pg-spinner {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2.5px solid var(--eb-line); border-top-color: var(--eb-link);
    animation: pg-spin .8s linear infinite;
}
@keyframes pg-spin { to { transform: rotate(360deg); } }
.pg-foot-pages[hidden] { display: none; }

/* ---------- record & document pages ------------------------------------ */
.pg-doc-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--eb-space-4); }
.pg-crumb { font-size: var(--eb-text-md); color: var(--eb-ink-2); display: flex; gap: 6px; flex-wrap: wrap; }
.pg-crumb a { color: var(--eb-link); }
.pg-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; }
.pg-title-row .eb-title { font-size: 32px; }
.pg-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pg-actions [hidden] { display: none !important; }

.pg-banner {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--eb-space-3);
    padding: var(--eb-space-3) var(--eb-space-5); border-radius: var(--eb-radius-lg);
    font-size: var(--eb-text-md);
    background: var(--eb-warning-bg); color: var(--eb-warning-fg); border: 1px solid var(--eb-warning-panel-line);
}
.pg-banner[hidden] { display: none; }
.pg-banner--negative { background: var(--eb-negative-bg); color: var(--eb-negative-fg); border-color: var(--eb-negative-panel-line); }
.pg-banner--info { background: var(--eb-info-bg); color: var(--eb-info-fg); border-color: transparent; }
.pg-banner__text { flex: 1 1 280px; }

.pg-layout { display: flex; flex-wrap: wrap; gap: var(--eb-space-6); align-items: flex-start; }
.pg-layout__main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: var(--eb-space-5); }
.pg-side { flex: 1 1 290px; min-width: 0; display: flex; flex-direction: column; gap: var(--eb-space-4); }
.pg-side-card { padding: var(--eb-space-5); display: flex; flex-direction: column; gap: var(--eb-space-3); }
.pg-side-card[hidden] { display: none; }
.pg-side-big { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* The paper: documents read like documents */
.pg-sheet {
    background: var(--eb-surface); border: 1px solid var(--eb-line); border-radius: var(--eb-radius-sm);
    box-shadow: var(--eb-shadow-sheet); padding: 40px 44px;
    display: flex; flex-direction: column; gap: var(--eb-space-8);
}
.pg-sheet__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--eb-space-6); }
.pg-sheet__doc { font-family: var(--eb-font-display); font-size: 34px; font-weight: 500; line-height: 1; color: var(--eb-selected-fg); }
.pg-sheet__num { font-size: var(--eb-text-body); color: var(--eb-ink-2); font-variant-numeric: tabular-nums; }

/* Field grid used by sheets and record cards */
.pg-section { padding: var(--eb-space-6); display: flex; flex-direction: column; gap: var(--eb-space-4); }
.pg-section + .pg-section { border-top: 1px solid var(--eb-line-soft); }
.pg-section__title { font-size: var(--eb-text-lg); font-weight: 600; }
.pg-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 20px; }
.pg-fields--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pg-fields .is-wide { grid-column: 1 / -1; }
.pg-checks { display: flex; flex-wrap: wrap; gap: 12px 24px; }
textarea.eb-input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }

/* Reading mode: the same fields, drawn as plain text */
.is-reading .eb-input, .is-reading .eb-select {
    border-color: transparent; background: transparent; padding-left: 0; padding-right: 0;
    background-image: none; color: var(--eb-ink); -webkit-text-fill-color: var(--eb-ink);
    opacity: 1; cursor: default; height: auto; min-height: 0; resize: none;
}
.is-reading textarea.eb-input { min-height: 0; padding-top: 0; padding-bottom: 0; }
.is-reading .eb-input::placeholder { color: transparent; }
.is-reading input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
.is-reading [data-edit-only] { display: none !important; }
.pg-form:not(.is-reading) [data-read-only] { display: none !important; }
.is-reading .pg-check input:disabled { opacity: 1; }
.is-reading .eb-field.is-empty-read { display: none; }
.is-reading .pg-num-input { text-align: left; }
.is-reading .pg-lines .pg-num-input { text-align: right; }

/* Line grid */
.pg-lines-wrap { position: relative; overflow-x: auto; margin: 0 -8px; padding: 0 8px; }   /* positioned, so screen-reader labels inside stay clipped instead of widening the page */
.pg-lines { width: 100%; border-collapse: collapse; font-size: var(--eb-text-md); min-width: 640px; }
.pg-lines th {
    padding: 10px 6px; text-align: left; white-space: nowrap;
    font-size: var(--eb-text-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--eb-ink-2); border-bottom: 1.5px solid var(--eb-ink);
}
.pg-lines td { padding: 6px; border-bottom: 1px solid var(--eb-line-soft); vertical-align: middle; }
.pg-lines .eb-input, .pg-lines .eb-select { height: 36px; font-size: var(--eb-text-md); width: 100%; min-width: 0; }
.pg-lines .eb-r, .pg-lines .eb-r .eb-input { text-align: right; }
.pg-lines .pg-amount { font-weight: 600; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 96px; }
.pg-lines .pg-col-x { width: 40px; text-align: center; }
.pg-line-x { width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--eb-ink-3); cursor: pointer; }
.pg-line-x:hover { background: var(--eb-negative-bg); color: var(--eb-negative-fg); }
.is-reading .pg-lines td { padding-top: 12px; padding-bottom: 12px; }
.is-reading .pg-lines .pg-col-x { display: none; }
.pg-lines tr.is-blank .pg-line-x { visibility: hidden; }
.pg-lines-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.pg-num-input { text-align: right; font-variant-numeric: tabular-nums; }

/* Totals */
.pg-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--eb-space-6); }
.pg-foot__notes { flex: 1 1 260px; display: flex; flex-direction: column; gap: var(--eb-space-4); min-width: 0; }
.pg-totals { flex: 0 1 320px; display: flex; flex-direction: column; margin-left: auto; }
.pg-totals__row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: var(--eb-text-md); font-variant-numeric: tabular-nums; }
.pg-totals__row > :first-child { color: var(--eb-ink-2); }
.pg-totals__row[hidden] { display: none; }
.pg-totals__row.is-sum { border-top: 1px solid var(--eb-line); margin-top: 6px; padding-top: 12px; font-weight: 600; }
.pg-totals__row.is-sum > :first-child, .pg-totals__row.is-grand > :first-child { color: var(--eb-ink); }
.pg-totals__row.is-grand { border-top: 1.5px solid var(--eb-ink); margin-top: 6px; padding-top: 14px; font-size: 20px; font-weight: 600; }
.pg-balance-ok { color: var(--eb-positive-fg); }
.pg-balance-off { color: var(--eb-negative-fg); }


/* Sheet head: party on the left, meta fields on the right */
.pg-party-block { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: var(--eb-space-3); }
.pg-party-block .eb-field { max-width: 360px; }
.pg-sheet__titles { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; }
.pg-sheet__meta { flex: 0 1 380px; align-content: start; }
.pg-address { font-size: var(--eb-text-md); line-height: 1.6; color: var(--eb-ink-body); white-space: pre-line; margin: 0; }
.pg-address:empty { display: none; }
.is-reading .pg-party-block .eb-select { font-size: var(--eb-text-lg); font-weight: 600; }

/* Line grid column widths */
.pg-w-item { width: 170px; }
.pg-w-qty { width: 72px; }
.pg-w-money { width: 112px; }
.pg-w-rate { width: 72px; }
.pg-w-acct { width: 190px; }
.pg-w-amt { width: 110px; text-align: right !important; }
.pg-w-date { width: 150px; }
.pg-lines td.pg-amount.is-negative { color: var(--eb-negative-fg); }
.pg-lines tfoot td { padding: 12px 6px; font-weight: 600; font-variant-numeric: tabular-nums; border-bottom: 0; }

/* Stamp for voided / paid documents */
.pg-void-note { font-size: var(--eb-text-md); color: var(--eb-negative-fg); }

/* Side panel bits */
.pg-kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--eb-line-soft); font-size: var(--eb-text-md); }
.pg-kv:last-child { border-bottom: 0; }
.pg-kv > :first-child { color: var(--eb-ink-2); }
.pg-kv > :last-child { text-align: right; font-variant-numeric: tabular-nums; }
.pg-mini { list-style: none; margin: 0; padding: 0; }
.pg-mini li { border-bottom: 1px solid var(--eb-line-soft); }
.pg-mini li:last-child { border-bottom: 0; }
.pg-mini a, .pg-mini .pg-mini__row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; color: var(--eb-ink); font-size: var(--eb-text-md); }
.pg-mini a:hover { text-decoration: none; color: var(--eb-link-hover); }
.pg-mini__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pg-mini__amt { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
.pg-progress { height: 8px; border-radius: 4px; background: var(--eb-line-soft); overflow: hidden; }
.pg-progress > div { height: 100%; border-radius: 4px; background: var(--eb-chart-1); width: 0; }

/* Allocation tables (payments, credits, refunds, deposits) */
.pg-alloc td .eb-input { width: 100px; margin-left: auto; }
.pg-alloc td, .pg-alloc th { white-space: nowrap; }
.pg-alloc th[class*="pg-w-"] { width: auto; }
.pg-alloc .pg-col-x { width: 56px; }
.pg-alloc tr.is-picked td { background: var(--eb-selected-bg); }

/* Tabs inside a page (not filters) */
.pg-panel[hidden] { display: none; }

/* Code / secrets */
.pg-code {
    font-family: var(--eb-font-mono); font-size: 13px; padding: 10px 12px; border-radius: var(--eb-radius-md);
    background: var(--eb-surface-2); border: 1px solid var(--eb-line); word-break: break-all; user-select: all;
}

/* ---------- dialogs (partials/dialogs.html) ----------------------------- */
.eb-dialog {
    border: 0; padding: 0; border-radius: var(--eb-radius-lg); width: min(460px, calc(100vw - 32px));
    background: var(--eb-surface); color: var(--eb-ink); box-shadow: var(--eb-shadow-pop);
}
.eb-dialog::backdrop { background: var(--eb-overlay); }
.eb-dialog__body { padding: var(--eb-space-6); display: flex; flex-direction: column; gap: var(--eb-space-4); }
.eb-dialog__title { font-family: var(--eb-font-display); font-weight: 500; font-size: 24px; }
.eb-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
/* the cost choice (inventory): later documents and two ways to post */
.eb-dlg-list { margin: 0; padding: 0; list-style: none; max-height: 180px; overflow: auto; border: 1px solid var(--eb-border, #e2e2e2); border-radius: 8px; }
.eb-dlg-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; font-size: 13px; }
.eb-dlg-list li + li { border-top: 1px solid var(--eb-border, #e2e2e2); }
.eb-dlg-choice { border: 0; padding: 0; margin: 0; }
.eb-radio { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.eb-radio input { margin-top: 3px; }
.eb-dialog [hidden] { display: none; }

/* ---------- phone ------------------------------------------------------ */
@media (max-width: 720px) {
    .pg-toolbar { padding: 0 var(--eb-space-4); }
    .pg-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 18px; width: 100%; }
    .pg-tabs .eb-tab { flex: none; }
    .pg-filters, .pg-search, .pg-filter-select { width: 100%; }

    /* list rows become label/value cards */
    .pg-table { min-width: 0; }
    .pg-table thead { display: none; }
    .pg-table tbody tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--eb-line-soft); }
    .pg-table tbody td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; white-space: normal; background: transparent !important; text-align: right; }
    .pg-table tbody td::before { content: attr(data-label); color: var(--eb-ink-2); font-size: var(--eb-text-sm); text-align: left; }
    .pg-table tbody td[data-label=""]::before, .pg-table tbody td:not([data-label])::before { content: none; }
    .pg-table tbody td:first-child { font-weight: 600; text-align: left; }
    .pg-table .pg-col-menu { display: none; }

    .pg-sheet { padding: var(--eb-space-6) var(--eb-space-5); }
    .pg-fields--2 { grid-template-columns: 1fr; }
    .pg-title-row .eb-title { font-size: var(--eb-text-2xl); }
}

/* ---------- print: the sheet alone ------------------------------------- */
@media print {
    #nav-root, .eb-nav, .pg-actions, .pg-side, .pg-crumb, .pg-banner, .eb-toast-root,
    [data-edit-only], .pg-lines .pg-col-x, .pg-title-row { display: none !important; }
    body, .eb-shell, .eb-main { background: #fff !important; padding: 0 !important; margin: 0 !important; display: block !important; }
    .pg-layout__main { flex: 1 1 100%; }
    .pg-sheet { box-shadow: none; border: 0; padding: 0; }
    .eb-card { box-shadow: none; }
}

/* Variant pages (AR/AP credit, sales/purchase orders) hide what doesn't apply */
.is-ap .pg-ar-only, .is-purchase .pg-sales-only { display: none !important; }

/* Reading mode: line cells size to their text instead of fixed edit widths */
.is-reading .pg-lines th[class*="pg-w-"] { width: auto; }
.is-reading .pg-lines .eb-input, .is-reading .pg-lines .eb-select { field-sizing: content; width: auto; max-width: 100%; }
.is-reading .pg-lines td { white-space: nowrap; }

/* ---------- banking ---------------------------------------------------- */
.eb-btn--sm { height: 32px; padding: 0 12px; font-size: var(--eb-text-sm); }
.pg-register-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--eb-space-4) var(--eb-space-8); padding: var(--eb-space-5); }
.pg-account-pick { flex: 0 1 340px; min-width: 240px; }
.pg-register-bal { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.pg-grow-text { flex: 1 1 260px; margin: 0; }
.pg-row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.pg-row-actions [hidden] { display: none !important; }
.pg-w-acct-wide { width: 260px; }
.pg-dialog-wide { width: min(640px, calc(100vw - 32px)); }
.pg-mini__row .eb-btn { flex: none; }
.pg-mini .pg-mini__row a { display: inline; padding: 0; }
.pg-diff-ok { color: var(--eb-positive-fg); }
.pg-diff-off { color: var(--eb-negative-fg); }
@media (max-width: 720px) {
    .pg-register-bal { text-align: left; }
    .pg-row-actions { justify-content: flex-start; flex-wrap: wrap; }
}
/* Sheets without a party (journal entry, deposit): the fields take the full width */
.pg-party-block:not(:has(.eb-field)) + .pg-sheet__meta { flex: 1 1 100%; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

/* ---------- reports ---------------------------------------------------- */
.pg-report-tabs { overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; }   /* no stray vertical scroll arrow (2026-10-08) */
.pg-report-tabs .eb-tab { flex: none; margin-bottom: 0; }
.pg-report-controls { justify-content: flex-start; }
.pg-report-controls .eb-field { flex: 0 1 200px; }
.pg-report { gap: var(--eb-space-5); }
.pg-report__head { text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.pg-report__head p { margin: 0; }
.pg-report-table { width: 100%; border-collapse: collapse; font-size: var(--eb-text-md); font-variant-numeric: tabular-nums; }
.pg-report-table th { padding: 8px 10px; font-size: var(--eb-text-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--eb-ink-2); border-bottom: 1.5px solid var(--eb-ink); }
.pg-report-table td { padding: 7px 10px; border-bottom: 1px solid var(--eb-line-soft); }
.pg-r-amt { white-space: nowrap; min-width: 110px; }
.pg-r-link { color: var(--eb-ink); }
.pg-r-link:hover { color: var(--eb-link-hover); }
.pg-report-table tr.is-section td { padding-top: 20px; font-weight: 600; font-size: var(--eb-text-lg); border-bottom: 0; color: var(--eb-selected-fg); }
.pg-report-table tr.is-row .pg-r-label { padding-left: 26px; }
.pg-report-table tr.is-sub .pg-r-label { padding-left: 46px; color: var(--eb-ink-2); }
.pg-report-table tr.is-total td { font-weight: 600; border-top: 1px solid var(--eb-line); border-bottom: 0; }
.pg-report-table tr.is-grand td { font-weight: 600; font-size: 18px; border-top: 1.5px solid var(--eb-ink); border-bottom: 3px double var(--eb-ink); padding-top: 12px; padding-bottom: 12px; }
.pg-report-table tr.is-note td { color: var(--eb-ink-2); font-style: italic; border-bottom: 0; }
.pg-report-table td.is-negative { color: var(--eb-negative-fg); }
/* an unfavorable variance (budget vs actual) */
.pg-report-table td.is-flagged { color: var(--eb-negative-fg); font-weight: 600; }
.pg-report-table td.is-flagged::after { content: " \25BC"; font-size: 0.7em; }
@media print { .pg-report-tabs, .pg-report-controls, #r-tiles, .eb-page-head { display: none !important; } }
.pg-report-table .eb-r, .pg-lines .eb-r { text-align: right; }
.pg-report-controls .pg-field-wide { flex: 0 1 300px; }
.pg-report-table.is-wide { font-size: var(--eb-text-sm); }
.pg-report-table.is-wide td.pg-r-amt, .pg-report-table.is-wide th.eb-r { white-space: nowrap; }
@media print { .pg-report-table.is-wide { font-size: 10px; } }

/* bill: landed cost (inventory, 2026-10-04) */
.pg-w-chk { width: 56px; text-align: center; }
.pg-landed { margin: 12px 0; padding: 12px; border: 1px dashed var(--eb-border, #d9d9d9); border-radius: 10px; display: grid; gap: 8px; }
.pg-landed__bills { max-height: 180px; overflow: auto; }

/* stock lines: lots and the stock warning (inventory, 2026-10-05) */
.pg-w-lot { width: 130px; }
.pg-stock-warn { margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; font-size: 13px;
    background: var(--eb-warn-bg, #fff6e5); color: var(--eb-warn-fg, #7a4b00); border: 1px solid var(--eb-warn-border, #f0d29a); }
.pg-bom-editor { margin-top: 12px; padding: 12px; border: 1px dashed var(--eb-border, #d9d9d9); border-radius: 10px; display: grid; gap: 10px; }

/* close books (2026-10-05) */
.pg-inline-field { flex-direction: row; align-items: center; gap: 8px; }
.pg-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pg-checklist__item { display: flex; gap: 10px; align-items: flex-start; }
.pg-checklist__mark { flex: 0 0 auto; min-width: 52px; text-align: center; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 999px; background: var(--eb-surface-2, #eee); }
.pg-checklist__item.is-ok .pg-checklist__mark { background: var(--eb-positive-soft, #e3f3e8); color: var(--eb-positive, #1d7a3e); }
.pg-checklist__item.is-warn .pg-checklist__mark { background: var(--eb-warning-soft, #fbf0d9); color: var(--eb-warning, #8a5a00); }
.pg-checklist__item.is-fail .pg-checklist__mark { background: var(--eb-negative-soft, #fbe3e1); color: var(--eb-negative, #a8261c); }
.pg-row-actions { justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.pg-banner--warning { background: var(--eb-warning-soft, #fbf0d9); }
.pg-changed { margin: 0 0 8px; padding-left: 20px; font-size: 13px; }
.pg-report-card .pg-kv { max-width: 560px; }
.pg-section__subtitle { font-size: 14px; font-weight: 600; margin: 16px 0 6px; }
.pg-perimeter { max-height: 220px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; }
.pg-sites { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pg-sites li { padding: 4px 10px; border-radius: 999px; background: var(--eb-surface-2, #f1f1f1); font-size: 13px; }
.pg-w-site { width: 140px; }
.no-sites .pg-w-site { display: none; }


/* Budget editor grid (2026-10-05) */
.pg-budget-wrap { overflow-x: auto; }
.pg-budget { min-width: 1280px; }
.pg-budget th, .pg-budget td { white-space: nowrap; }
.pg-budget td.pg-budget__name { min-width: 200px; white-space: normal; }
.pg-budget input.eb-input { width: 84px; text-align: right; padding-left: 6px; padding-right: 6px; }
.pg-budget tr.is-section td { font-weight: 600; padding-top: 14px; }
.pg-budget tr.is-total td { font-weight: 600; border-top: 1px solid var(--eb-line); }
.pg-budget tr.is-net td { font-weight: 700; }

/* a second line under a cell's main text (bank feed hints) */
.pg-block { display: block; margin-top: 2px; }

/* order progress under a purchase order, sales order or estimate (2026-10-05) */
.pg-order-progress { margin-top: var(--eb-space-4, 16px); }
.pg-order-progress .pg-section__title { margin: 0; }

/* pay bills (2026-10-05) */
.pg-pay-tools { gap: var(--eb-space-4, 16px); padding: 4px 0 12px; flex-wrap: wrap; }
.pg-pay-table tr.pg-group-row td { font-weight: 600; background: var(--eb-line-soft); }
.pg-pay-table .pg-col-check { width: 36px; }
.pg-pay-table .pg-num-input { max-width: 120px; margin-left: auto; }

/* Fixed assets (2026-10-05) */
.pg-fa-tools { display: grid; gap: var(--eb-space-3, 12px); padding: var(--eb-space-4, 16px); }
.pg-fa-tools__row { flex-wrap: wrap; align-items: flex-end; gap: var(--eb-space-3, 12px); }
.pg-fa-tools__gap { flex: 1 1 24px; }
.pg-fa-result { border: 1px solid var(--eb-line, #ddd); border-radius: 8px; padding: 10px 12px; display: grid; gap: 4px; }
.pg-fa-result p { margin: 0; }
.pg-fa-result.is-success { background: var(--eb-positive-bg); color: var(--eb-positive-fg); }
.pg-fa-result.is-warning { background: var(--eb-warning-bg); color: var(--eb-warning-fg); }
.pg-fa-result.is-error { background: var(--eb-negative-bg); color: var(--eb-negative-fg); }
.pg-fa-result.is-info { background: var(--eb-info-bg); color: var(--eb-info-fg); }
.pg-rev-result { padding: 14px 16px; gap: 6px; border-width: 2px; }
.pg-rev-result .pg-rev-result__head { font-size: 1.1rem; font-weight: 600; }
.pg-total-row td { font-weight: 600; border-top: 2px solid var(--eb-line, #ddd); }
#sched tr.is-current td { font-weight: 600; }


/* classes and projects on documents (dims.js): hidden when the company has none */
.pg-w-dim { min-width: 9rem; }
body.no-classes .pg-dim-class, body.no-projects .pg-dim-project { display: none; }
/* deferred revenue (2026-10-09): the line's months and first month, and the page */
.pg-w-defer { width: 150px; }
body.no-defer .pg-defer { display: none; }
.pg-defer-note { margin: 8px 0 0; }
.pg-rev-tie { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--eb-space-3, 12px); padding: var(--eb-space-4, 16px); }
.pg-rev-tie__v { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.pg-rev-tie.is-off .pg-rev-tie__diff { color: var(--eb-negative-fg); }
.pg-rev-months { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .85rem; }
.pg-rev-detail td { background: var(--eb-surface-2, transparent); }
.pg-rev-section { padding: var(--eb-space-4, 16px); display: grid; gap: var(--eb-space-3, 12px); }
.pg-rev-section h2 { margin: 0; }
#filter-note { padding: 12px 16px 0; margin: 0; }
.pg-line-note { display: block; font-size: var(--eb-fs-xs, 0.75rem); color: var(--eb-text-muted, #6b7280); margin-top: 2px; }
body.is-receipt .pg-not-receipt { display: none; }

/* payroll (2026-10-05) */
.pg-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--eb-text-sm); }
.pg-pad { padding: var(--eb-space-4, 16px) var(--eb-space-4, 16px) 0; }
#map-rows .eb-input, #map-rows .eb-select { min-width: 9rem; width: 100%; }
/* tax preview and receipt warnings (2026-10-05) */
.pg-tax-preview { display: grid; gap: 4px; }
.pg-tax-preview__row { display: flex; justify-content: space-between; gap: 12px; }
.pg-warn-list { margin: 0; padding-left: 1.2em; }
@media print { .pg-no-print { display: none !important; } }
body:not(.tax-engine) .pg-tax-engine { display: none !important; }
.pg-tax-preview { margin-top: 12px; }

/* report_1099: the IRS IRIS upload (2026-10-05) */
.pg-steps { margin: 0 0 var(--eb-space-3, 12px) 1.2em; padding: 0; }
.pg-steps li { margin: 2px 0; }
.pg-iris-row { gap: var(--eb-space-3, 12px); flex-wrap: wrap; align-items: flex-end; }
.pg-iris-defaults { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--eb-space-2, 8px); margin: 8px 0; }
#iris-header { font-family: var(--eb-font-mono, monospace); font-size: 12px; }

/* Re-audit R01 (2026-10-06): a build whose components differ from its recipe */
.eb-hint.is-warning { color: var(--eb-warning-fg); font-weight: 600; }
