/* Business Manager (ERP demo, extension X8): an MDI frame and its documents; flex layouts that follow the windows.
   The splitter is 2px, as the gap above the panes (user's call: the gaps alike). */
.erp { display: flex; flex-direction: column; flex: 1; min-height: 0; }
/* The rebar, as Explorer's: the menu band (a maximized child's icon before the menu, its buttons in a fixed band
   without a gripper at the end of the row) and the toolbar band. */
.erp__rebar { flex: none; margin-top: 1px; }   /* 2px under the caption, as the 2px over the panes (user's call; Explorer: TODO X-egrh) */
.erp__menuband { align-items: center; }
/* No icons in the top bars (user's call): the maximized child's system-menu icon is not shown (Alt+- opens it). */
.erp__mdiicon { display: none; }
/* Text-only toolbar buttons (rebar.css): the text 6px in on both sides. */
.erp__tool > .w2k-toolbar__text { padding-left: 6px; padding-right: 6px; }
.erp__mdiband { align-items: center; }
.erp__mdiband:has(> .erp__mdibuttons:empty) { display: none; }
.erp__mdibuttons { flex: none; }   /* the band ends 2px in: their right edge under the frame's caption buttons */
.erp__main { display: flex; flex: 1; min-height: 0; padding-top: 2px; }
/* The navigator: a side pane with its own title bar (css/components/pane.css, TODO X-6g47), the tree in its body. */
.erp__navpane { flex: none; width: 168px; }
.erp[data-nonav] :is(.erp__navpane, .erp__split) { display: none; }
/* The MDI client: AppWorkspace in a client edge. */
.erp__client { flex: 1; min-width: 0; }
.erp__mdi { position: relative; }
/* A maximized child fills the client (its frame hangs outside, as Windows draws it): no scroll bars then. */
.erp__client:has(> .erp__mdi > .w2k-window[data-state="maximized"]) > :is(.w2k-scrollarea__v, .w2k-scrollarea__h, .w2k-sizebox) { display: none; }
.erp__client:has(> .erp__mdi > .w2k-window[data-state="maximized"]) > .erp__mdi { overflow: hidden; }
/* …and the client loses its edge: the child's own controls bring theirs (no frame inside a frame — user's call). */
.erp__client:has(> .erp__mdi > .w2k-window[data-state="maximized"]) { padding: 0; box-shadow: none; }   /* allow: an MDI client loses its edge under a maximized child (measured) */
.erp__status { flex: none; }
.w2k-statusbar__panel.erp__status-text { flex: 1; }
.w2k-statusbar__panel.erp__status-count { flex: none; width: 150px; }
.w2k-statusbar__panel.erp__status-user { flex: none; width: 130px; }

/* List windows: the filter bar over the list. */
.erp-list { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.erp-list__filter { flex: none; }
.erp-list__view { position: relative; flex: 1; min-height: 0; }
.erp-list__view > .w2k-listview, .erp-list__view > .w2k-grid { position: absolute; inset: 0; box-sizing: border-box; }
.erp-filter { display: flex; align-items: center; gap: 6px; padding: 1px 4px 3px 6px; }   /* (user, 2026-10-10) */
.erp-filter > .w2k-edit { width: 170px; }
.erp-filter > .w2k-combo { width: 128px; }
.erp-filter > .w2k-label + .w2k-combo, .erp-filter > .w2k-label:not(:first-child) { margin-left: 4px; }
/* Row colours by status (extension): approved in navy, invoiced and paid greyed, overdue in red. */
.w2k-listview__item[data-status="approved"] { color: var(--color-erp-approved); }   /* allow: document statuses in their semantic colours */
.w2k-listview__item:is([data-status="invoiced"], [data-status="paid"]) { color: var(--sys-gray-text); }   /* allow: document statuses in their semantic colours */
.w2k-listview__item[data-status="overdue"] { color: var(--color-erp-overdue); }   /* allow: document statuses in their semantic colours */

/* Documents: the header form, the tabs, the lines. */
.erp-doc { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.erp-doc__head {
  flex: none;
  display: grid;
  grid-template-columns: max-content minmax(150px, 1fr) max-content 140px;
  gap: 4px 8px;
  align-items: center;
  padding: 7px 8px 6px;
}
.erp-doc__head > .w2k-edit, .erp-doc__head > .w2k-combo, .erp-doc__head > .w2k-dtp, .erp-doc__head > .w2k-lookupedit { width: 100%; box-sizing: border-box; }
.erp-doc__address { color: var(--sys-gray-text); white-space: pre; overflow: hidden; text-overflow: ellipsis; }   /* allow: secondary text of a document */
.erp-doc__status[data-status="approved"] { color: var(--color-erp-approved); }   /* allow: document status colour */
.erp-doc__tabs { flex: 1; min-height: 0; margin: 0 8px 6px; }
.erp-doc__panel { display: flex; flex-direction: column; padding: 8px; }
.erp-doc__panel[hidden] { display: none; }
.erp-doc__lines { flex: 1; min-height: 60px; }
.erp-doc__related, .erp-doc__notes { flex: 1; min-height: 0; }
.erp-doc__foot { flex: none; display: flex; align-items: center; gap: 6px; padding-top: 6px; }
.erp-doc__foot > .w2k-button { flex: none; width: 92px; }   /* not squeezed: a too narrow window shows as overflow (data-fit) */
.erp-doc__totals { flex: none; display: flex; align-items: center; gap: 6px; margin-left: auto; }
.erp-doc__totals > .w2k-edit { width: 84px; text-align: right; }
.erp-doc__status, .erp-card__status, .erp-print__status { flex: none; }
.w2k-statusbar__panel.erp-doc__state { flex: 1; }
.w2k-statusbar__panel.erp-doc__sum { flex: none; width: 150px; }
.erp-doc[data-locked] .erp-doc__head > .w2k-dtp { pointer-events: none; }

/* Invoice */
.erp-invoice__order { display: flex; gap: 4px; }
.erp-invoice__order > .w2k-edit { flex: 1; min-width: 0; }
.erp-invoice__order > .w2k-button { width: 60px; height: var(--metric-edit-height); }
.erp-invoice__lines { flex: 1; min-height: 60px; margin: 0 8px; }
.erp-invoice__bottom { flex: none; display: flex; gap: 10px; padding: 6px 8px 8px; }
.erp-invoice__vat { flex: none; width: 300px; height: 86px; }
.erp-invoice__sum { flex: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.erp-invoice__totals { display: flex; align-items: center; gap: 6px; }
.erp-invoice__totals > .w2k-edit { width: 84px; text-align: right; }
.erp-invoice__totals > .erp-invoice__gross { width: 104px; font-weight: 700; }   /* allow: the gross total in bold (document content) */
.erp-invoice__words { text-align: right; }

/* Customer card */
.erp-card { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.erp-card__head { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 10px 6px; }
.erp-card__head > img { width: 32px; height: 32px; }
.erp-card__head b { display: block; }
.erp-card__sub { color: var(--sys-gray-text); }   /* allow: secondary text of a card */
.erp-card__tabs { flex: 1; min-height: 0; margin: 0 8px 6px; }
.erp-card__tabs > .w2k-tabpanel { display: flex; flex-direction: column; padding: 10px; }
.erp-card__tabs > .w2k-tabpanel[hidden] { display: none; }
/* Each page's form takes the page's height (rows at its top), so a window too small for it shows as the form overflowing
   — data-fit keeps the window from shrinking that far (js/wm.js); fields stay at least 160px wide. */
.erp-card__form { flex: 1; min-height: 0; display: grid; grid-template-columns: max-content minmax(160px, 1fr); gap: 6px 10px; align-items: center; align-content: start; }
.erp-card__form > .w2k-edit, .erp-card__form > .w2k-combo { width: 100%; max-width: 300px; box-sizing: border-box; }
.erp-card__notes-label { align-self: start; padding-top: 3px; }
.erp-card__form > .erp-card__notes { height: 64px; max-width: none; }
/* Handlowe: the notes fill the rest of the page, down to its bottom — also as the window is resized (user, 2026-10-10).
   Płatność, Rabat and Limit kredytu take their rows; the notes row takes what is left (at least the 64px it had). */
.erp-card__form--notes { grid-template-rows: repeat(3, max-content) minmax(64px, 1fr); align-content: stretch; }
.erp-card__form--notes > .erp-card__notes { height: auto; align-self: stretch; }
.erp-card__docs { flex: 1; min-height: 0; }
.erp-card__balance { flex: none; padding-top: 6px; }
.w2k-statusbar__panel.erp-card__state { flex: 1; }

/* Choose dialog */
.erp-choose { display: grid; grid-template-columns: max-content 1fr; grid-template-rows: auto 1fr auto; gap: 7px 8px; align-items: center; flex: 1; min-height: 0; padding: 10px; }
.erp-choose__list { grid-column: 1 / -1; align-self: stretch; min-height: 0; }
.erp-choose__list > .w2k-listview { height: 100%; box-sizing: border-box; }
.erp-choose__buttons { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; }

/* Print preview: the page on the ButtonShadow workspace. */
.erp-print { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.erp-print__bar { flex: none; display: flex; align-items: center; gap: 6px; padding: 4px; }
.erp-print__bar > .w2k-combo { width: 120px; }
.erp-print__bar > .w2k-button { width: 80px; }
.erp-print__area { flex: 1; min-height: 0; background: var(--sys-btn-shadow); }   /* allow: the print preview's desk */
.erp-print__viewport { display: grid; place-items: start center; padding: 16px; box-sizing: border-box; }
.erp-print__sheet { position: relative; overflow: hidden; background: var(--color-paper); box-shadow: 0 0 0 1px var(--color-ink), 3px 3px 0 1px var(--sys-btn-dk-shadow); }   /* allow: the printed sheet */
.w2k-statusbar__panel.erp-print__zoomtext { flex: none; width: 130px; }
/* The printed page: document fonts and colours (paper), in page pixels before the zoom. */
.erp-page { width: 794px; height: 1123px; box-sizing: border-box; padding: 56px 60px; color: var(--color-ink); background: var(--color-paper); font: 12px/1.35 Arial, Helvetica, sans-serif; }   /* allow: the printed document */
.erp-page h1 { margin: 26px 0 2px; font-size: 20px; font-weight: 700; }   /* allow: the printed document */
.erp-page__top { display: flex; justify-content: space-between; align-items: flex-start; }
.erp-page__company { font-size: 16px; }   /* allow: the printed document */
.erp-page__place { text-align: right; }
.erp-page__copy { margin-bottom: 18px; color: var(--color-ink-muted); }   /* allow: the printed document */
.erp-page__parties { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 20px; }
.erp-page__label { margin-bottom: 4px; padding-bottom: 2px; border-bottom: 1px solid var(--color-ink); font-weight: 700; }   /* allow: the printed document */
.erp-page__table { width: 100%; border-collapse: collapse; }   /* allow: the printed document */
.erp-page__table :is(th, td) { padding: 3px 4px; border: 1px solid var(--color-ink); text-align: right; vertical-align: top; }   /* allow: the printed document */
.erp-page__table th { background: var(--color-print-shade); font-weight: 700; text-align: center; }   /* allow: the printed document */
.erp-page__table .erp-page__name { text-align: left; }
.erp-page__code { color: var(--color-ink-muted); font-size: 10px; }   /* allow: the printed document */
.erp-page__summary { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 16px; }
.erp-page__vat { width: 100%; }
.erp-page__total td { font-weight: 700; }   /* allow: the printed document */
.erp-page__due > div { margin-bottom: 4px; }
.erp-page__signs { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; margin-top: 90px; text-align: center; font-size: 10px; }   /* allow: the printed document */
.erp-page__signs > div { padding-top: 4px; border-top: 1px dotted var(--color-ink); }   /* allow: the printed document */
