/* =====================================================================
   Brick Management: the section (menu on the left, as Reports), its lists
   of expandable entries, cards and forms; the dashboard panels and
   reports; the businesses band and picker. Documents: brick-docs.css.
   ===================================================================== */

:root {
    /* the section keeps the app's own colours: these name them for the brick screens */
    --brick-700: var(--ocean-700);
    --brick-600: var(--ocean-600);
    --brick-500: var(--ocean-500);
    --brick-100: var(--glacier-100);
    --brick-50: var(--glacier-50);
    --brick-ready: #1baf7a;
    --brick-curing: #eda100;
}

/* ---- a Brick Management entry, wherever it shows (journal, statements, dashboard) */
.bk-tag { display: inline-flex; align-items: center; gap: 3px; height: 17px; padding: 0 6px; margin-right: 5px; border-radius: 999px; flex: none;
    font-size: 10px; font-weight: 700; letter-spacing: 0.02em; background: var(--brick-100); color: var(--brick-700); border: 1px solid var(--glacier-200); white-space: nowrap; vertical-align: 1px; }
.bk-tag svg { width: 10px; height: 10px; }
.entry-text .bk-tag { align-self: center; }
.ed-fact.bk-fact { background: var(--brick-100); color: var(--brick-700); }

/* ---- businesses: the organization's picker and badges */
.biz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-bottom: 10px; }
.biz-card { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border-radius: 12px; border: 1.5px solid var(--hairline-strong);
    background: #f8fafc; cursor: pointer; user-select: none; transition: border-color .15s, background .15s, box-shadow .15s; }
.biz-card input { position: absolute; opacity: 0; pointer-events: none; }
.biz-card:hover { border-color: var(--ocean-400); }
.biz-card.on { border-color: var(--ocean-600); background: linear-gradient(180deg, #f0f8ff, #e3f2fc); box-shadow: 0 2px 10px rgba(11, 106, 166, 0.15); }
.biz-card.unavailable { opacity: 0.5; cursor: not-allowed; border-style: dashed; }
.biz-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #e8eef4; color: var(--text-secondary); }
.biz-card.on .biz-ico { background: var(--grad-button); color: #fff; }
.biz-ico svg { width: 18px; height: 18px; }
.biz-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.biz-text b { font-size: 13px; }
.biz-text small { font-size: 11px; color: var(--text-muted); line-height: 1.3; }
.biz-tick { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--hairline-strong); display: grid; place-items: center; color: transparent; flex: none; }
.biz-card.on .biz-tick { background: var(--ocean-600); border-color: var(--ocean-600); color: #fff; }
.biz-tick svg { width: 12px; height: 12px; }
.access-head.sub { margin-top: 4px; }
.biz-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.badge.biz { background: var(--brick-50); color: var(--brick-700); border-color: var(--glacier-200); }

/* ---- the businesses band on the dashboard */
.biz-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--gap, 12px); margin-bottom: var(--gap, 12px); }
.biz-tile { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; padding: 12px 34px 12px 14px; border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; overflow: hidden; }
.biz-tile::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--ocean-500); }
.biz-tile.bk::before { background: var(--brick-600); }
.biz-tile.cn::before { background: #d39b22; }
.biz-tile.hc::before { background: var(--aqua-500); }
.biz-tile:hover { box-shadow: var(--shadow); transform: translateY(-1px); transition: transform .15s, box-shadow .15s; }
.biz-tile-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--glacier-100); color: var(--ocean-700); grid-row: span 2; }
.biz-tile.bk .biz-tile-ico { background: var(--brick-100); color: var(--brick-700); }
.biz-tile-head { display: flex; flex-direction: column; }
.biz-tile-head small { color: var(--text-muted); font-size: 11px; }
.biz-tile dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 4px 12px; }
.biz-tile dl div { min-width: 0; }
.biz-tile dt { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.biz-tile dd { margin: 0; font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.biz-tile dl .warn dd { color: #a35a00; }
.biz-tile dl .good dd { color: var(--positive); }
.biz-tile .chev { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* ---- dashboard panels (also on the Overview) */
.bk-mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px 4px 0; }
.bk-mini-kpis div { display: flex; flex-direction: column; }
.bk-mini-kpis span { font-size: 10.5px; color: var(--text-muted); }
.bk-mini-kpis b { font-size: 14px; }
.bk-swatch { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); flex: none; }
.bk-stock { display: flex; flex-direction: column; gap: 10px; }
.bk-stock-name { display: flex; align-items: center; gap: 4px; font-size: 12.5px; }
.bk-stock-name span { margin-left: auto; font-size: 11px; }
.bk-bar { position: relative; display: flex; gap: 2px; height: 9px; border-radius: 6px; background: #eef2f6; margin: 5px 0 3px; }
.bk-bar i { display: block; height: 100%; border-radius: 4px; }
.bk-bar i.ready { background: var(--brick-ready); }
.bk-bar i.curing { background: var(--brick-curing); }
.bk-bar em { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text-primary); border-radius: 2px; }
.bk-stock-figs { display: flex; gap: 10px; font-size: 10.5px; color: var(--text-muted); }
.bk-stock-key { display: flex; gap: 12px; flex-wrap: wrap; font-size: 10.5px; color: var(--text-secondary); padding-top: 2px; }
.bk-stock-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.bk-stock-key i.ready { background: var(--brick-ready); }
.bk-stock-key i.curing { background: var(--brick-curing); }
.bk-stock-key i.booked { width: 2px; background: var(--text-primary); }
.bk-mats { display: flex; flex-direction: column; gap: 10px; }
.bk-mat-head { display: flex; justify-content: space-between; font-size: 12.5px; }
.bk-meter { height: 7px; border-radius: 6px; background: #eef2f6; margin: 4px 0; overflow: hidden; }
.bk-meter i { display: block; height: 100%; border-radius: 6px; background: var(--status-good); }
.bk-meter.warning i { background: var(--status-warning); }
.bk-meter.critical i { background: var(--status-critical); }
.bk-mat-foot { display: flex; justify-content: space-between; align-items: center; }
.badge.sm { font-size: 10px; padding: 1px 6px; gap: 3px; }
.badge.sm svg { width: 10px; height: 10px; }
.bk-pipe { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.bk-pipe-step { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 2px; border-radius: 9px; background: #f3f6f9; color: var(--text-muted); text-align: center; }
.bk-pipe-step svg { width: 14px; height: 14px; }
.bk-pipe-step b { font-size: 16px; color: var(--text-secondary); }
.bk-pipe-step small { font-size: 9.5px; line-height: 1.15; }
.bk-pipe-step.has { background: var(--brick-50); color: var(--brick-700); }
.bk-pipe-step.has b { color: var(--brick-700); }
.bk-up { margin-top: 8px; }
.bk-insights, .bk-insight-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.bk-insight { display: flex; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--hairline); border-left: 4px solid var(--info); }
.bk-insight > span { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--glacier-100); color: var(--ocean-700); }
.bk-insight > span svg { width: 14px; height: 14px; }
.bk-insight div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bk-insight b { font-size: 12.5px; }
.bk-insight small { font-size: 11.5px; color: var(--text-secondary); line-height: 1.35; }
.bk-insight.good { border-left-color: var(--status-good); } .bk-insight.good > span { background: #e3f6e3; color: #0a6b0a; }
.bk-insight.warning { border-left-color: var(--status-warning); } .bk-insight.warning > span { background: #fff4d6; color: #8a5b00; }
.bk-insight.critical { border-left-color: var(--status-critical); } .bk-insight.critical > span { background: #fbe3e3; color: #a32626; }
/* a chart is as tall as its box: the box gets a fixed height (an auto one would grow with every redraw) */
.bk-grid { grid-auto-rows: auto; flex: none; }
.bk-grid .panel { height: 100%; }
.bk-grid .panel-body.chart, .bk-report .panel-body.chart { flex: none; height: 280px; }
.panel-body.chart:has(.bk-mini-kpis) { display: flex; flex-direction: column; }
.panel-body.chart:has(.bk-mini-kpis) .chart-wrap { flex: 1; min-height: 120px; }
.bk-grid .chart-wrap, .bk-report .chart-wrap, .bk-report .donut-wrap { height: 100%; }

/* =====================================================================
   the section: menu on the left, a toolbar and the content
   ===================================================================== */
.bk-nav .panel-body { display: flex; flex-direction: column; }
.bk-nav .chip-icon { background: var(--brick-50); color: var(--brick-700); }
.bk-nav .list-item.selected .chip-icon { background: linear-gradient(135deg, var(--brick-500), var(--brick-700)); color: #fff; }
.bk-nav .panel-head .ico { background: linear-gradient(135deg, var(--brick-500), var(--brick-700)); color: #fff; }
.bk-nav-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: auto; padding-top: 12px; }
.bk-area { min-width: 0; }
.bk-toolbar { min-height: 46px; }
.bk-tools { gap: 6px; }
.bk-tools .seg-chips { flex-wrap: wrap; }
.bk-select { height: 30px; font-size: 12.5px; padding: 0 8px; border-radius: 8px; }
.bk-tool-fig { font-size: 12.5px; color: var(--text-secondary); }
.bk-period { display: flex; align-items: center; gap: 4px; }
.bk-period b { min-width: 150px; text-align: center; font-size: 13px; }
.bk-content { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: auto; padding-right: 2px; }
.bk-content > * { flex-shrink: 0; }
.bk-content .panel { min-height: 0; }
.bk-content .panel-head { padding-top: 8px; padding-bottom: 8px; }
.bk-getting-started { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--brick-50); border: 1px solid var(--glacier-200); color: var(--brick-700); }
.bk-getting-started div { display: flex; flex-direction: column; }
.bk-getting-started a { color: var(--brick-700); font-weight: 650; }

/* tiles: the section's figures in one compact row */
.bk-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.bk-tile { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm); overflow: hidden; }
.bk-tile::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--brick-500); opacity: 0.8; }
.bk-tile span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.bk-tile b { font-size: 18px; line-height: 1.2; color: var(--text-primary); }
.bk-tile small { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-tile.warn::before { background: var(--status-warning); } .bk-tile.warn > b { color: #8a5b00; }
.bk-tile.bad::before { background: var(--status-critical); } .bk-tile.bad > b { color: var(--negative); }

/* lists of entries: a line each, opening to the details */
.bk-split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 10px; align-items: start; }
.bk-split.even { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.bk-aside { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bk-rows { display: flex; flex-direction: column; }
.bk-row { border-bottom: 1px solid var(--hairline); }
.bk-row:last-child { border-bottom: 0; }
.bk-line { display: grid; grid-template-columns: 16px var(--cols); gap: 10px; align-items: center; min-height: 40px; padding: 4px 10px; cursor: pointer; font-size: 12.5px; outline: none; }
.bk-line:hover { background: var(--surface-hover); }
.bk-line:focus-visible { box-shadow: inset 0 0 0 2px var(--ocean-400); }
.bk-line > span { min-width: 0; }
.bk-line > span > small { display: block; font-size: 10.5px; color: var(--text-muted); line-height: 1.15; }
.bk-line .r { text-align: right; }
.bk-chev { width: 14px; height: 14px; color: var(--text-muted); transition: transform .15s; }
.bk-row.open > .bk-line { background: var(--surface-selected); }
.bk-row.open > .bk-line .bk-chev { transform: rotate(90deg); color: var(--brick-600); }
.bk-detail { padding: 10px 14px 12px 36px; background: linear-gradient(180deg, rgba(227, 245, 253, 0.45), transparent 60%); border-top: 1px dashed var(--hairline); }
.bk-acts { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; }
.bk-acts .btn.icon { width: 26px; height: 26px; }
.bk-empty { padding: 26px 10px; }
.bk-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px 16px; }
.bk-detail-grid > div { min-width: 0; overflow-x: auto; }
.bk-detail-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bk-detail-grid h4 { display: flex; align-items: center; gap: 5px; margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brick-700); }
.bk-detail-grid h4 svg { width: 13px; height: 13px; }
table.grid.dense td, table.grid.dense th { padding-top: 4px; padding-bottom: 4px; font-size: 12px; }
.bk-dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 12px; }
.bk-dl.two { grid-template-columns: 1fr 1fr; }
.bk-dl > div { min-width: 0; }
.bk-dl dt { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.bk-dl dd { margin: 0; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.bk-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.bk-chips.one { row-gap: 2px; max-height: 44px; overflow: hidden; }
.bk-chips > em { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 999px; background: #f2f5f8; font-style: normal; font-size: 11.5px; white-space: nowrap; }
.bk-chips > em b { font-weight: 700; }
.bk-chips small { font-size: 10px; }
.strike { text-decoration: line-through; color: var(--text-muted); }
.nowrap { white-space: nowrap; }
.warn { color: #a35a00; }

/* ---- raw material */
.bk-mat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.bk-mat-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm); cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.bk-mat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.bk-mat-card.selected { border-color: var(--brick-600); box-shadow: 0 0 0 2px rgba(11, 106, 166, 0.25); }
.bk-mat-card.critical { background: linear-gradient(180deg, #fff3f3, var(--surface) 60%); }
.bk-mc-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.bk-mc-head b { font-size: 13px; }
.bk-mc-stock { display: flex; align-items: baseline; gap: 4px; }
.bk-mc-stock > b { font-size: 24px; line-height: 1.1; }
.bk-mc-stock > span { color: var(--text-muted); font-size: 12px; }
.bk-spark { margin-left: auto; align-self: center; }
.bk-spark svg { display: block; }
.bk-mc-facts { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--text-secondary); }
.bk-mc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.bk-mc-foot small { color: var(--text-muted); font-size: 10.5px; }

/* ---- expenses */
.bk-head-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.bk-head-tile { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--glass-border); text-align: left;
    font: inherit; cursor: pointer; box-shadow: var(--shadow-sm); }
.bk-head-tile span { font-size: 11.5px; font-weight: 650; color: var(--text-secondary); }
.bk-head-tile b { font-size: 16px; }
.bk-head-tile i { height: 5px; border-radius: 3px; background: #eef2f6; overflow: hidden; }
.bk-head-tile i em { display: block; height: 100%; background: var(--brick-500); }
.bk-head-tile small { font-size: 10.5px; color: var(--text-muted); }
.bk-head-tile.selected { border-color: var(--brick-600); box-shadow: 0 0 0 2px rgba(11, 106, 166, 0.2); }

/* flexible middles of the section's rows and headers */
.bk-page .grow, .bkb .grow, .bk-set-card > header > div { flex: 1; min-width: 0; }

/* ---- accounts */
.bk-acct-groups { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--glass-border); }
.bk-acct-group { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; align-items: center; }
.bk-acct-group-name { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.bk-acct-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: thin; }
.bk-acct { position: relative; flex: none; display: flex; align-items: center; gap: 7px; width: 170px; padding: 5px 8px; border-radius: 10px; border: 1px solid var(--hairline);
    background: #fff; cursor: pointer; font: inherit; text-align: left; }
.bk-acct > span.grow { display: flex; flex-direction: column; }
.bk-acct small { font-size: 10.5px; color: var(--text-secondary); }
.bk-acct b { font-size: 12.5px; }
.bk-acct > i { position: absolute; top: 3px; right: 5px; font-size: 9px; font-style: normal; color: var(--text-muted); }
.bk-acct:hover { border-color: var(--brick-500); }
.bk-acct.selected { border-color: var(--brick-600); background: var(--brick-50); box-shadow: 0 0 0 2px rgba(11, 106, 166, 0.18); }
.bk-acct.income .chip-icon { background: #e4f6ee; color: #0b7a4b; } .bk-acct.expense .chip-icon { background: #fdeee8; color: #c2532c; }
.bk-stmt-panel .panel-head .actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bk-stmt-panel .panel-head input[type=date] { height: 28px; font-size: 12px; }
table.bk-ledger { table-layout: fixed; width: 100%; }
table.bk-ledger th, table.bk-ledger td { padding: 3px 8px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 28px; }
table.bk-ledger th:nth-child(1) { width: 92px; } table.bk-ledger th:nth-child(2) { width: 132px; }
table.bk-ledger th:nth-child(4), table.bk-ledger th:nth-child(5) { width: 100px; } table.bk-ledger th:nth-child(6) { width: 112px; }
table.bk-ledger .kind-chip { display: inline-flex !important; margin-right: 5px; vertical-align: middle; }
table.bk-ledger tr.detail-row td, table.bk-ledger tr.entry-detail-row td { white-space: normal; height: auto; overflow: visible; }
.bk-narr { display: block; overflow: hidden; text-overflow: ellipsis; }
.bk-narr em { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--brick-700); background: var(--brick-50); padding: 0 6px; border-radius: 999px; margin-right: 6px; }
.bk-narr small { margin-left: 8px; color: var(--text-muted); font-size: 11px; }

/* ---- set-up */
.bk-set-section h3 { display: flex; align-items: center; gap: 6px; margin: 4px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brick-700); }
.bk-set-section h3 svg { width: 14px; height: 14px; }
.bk-set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bk-set-card { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm); min-width: 0; }
.bk-set-card > header { display: flex; align-items: center; gap: 8px; }
.bk-set-card > header > div { display: flex; flex-direction: column; }
.bk-set-card > header small { color: var(--text-muted); font-size: 11px; }
.bk-set-card .chip-icon { background: var(--brick-50); color: var(--brick-700); }
.bk-set-rows { display: flex; flex-direction: column; }
.bk-set-rows > div { display: flex; align-items: center; gap: 10px; padding: 5px 4px; border-bottom: 1px solid var(--hairline); font-size: 12.5px; }
.bk-set-rows > div:last-child { border-bottom: 0; }
.bk-set-rows > div.off, .bk-rate-matrix tr.off { opacity: 0.5; }
.bk-set-rows > div > span { white-space: nowrap; font-size: 12px; }
.bk-rate-matrix th { white-space: nowrap; }
.bk-letter { border-radius: 10px; overflow: hidden; border: 1px solid var(--hairline); background: #fff; }
.bk-letter-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: #fff; background: var(--grad-navy); }
.bk-letter-head > svg { width: 26px; height: 26px; }
.bk-letter-head > div { display: flex; flex-direction: column; }
.bk-letter-head small { color: #c9ecfb; font-size: 11px; }
.bk-letter-sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 52px 16px 10px; }
.bk-letter-sigs > div { position: relative; display: flex; flex-direction: column; align-items: center; border-top: 1px solid #333; padding-top: 3px; }
.bk-letter-sigs svg.bond-sign, .bk-letter-sigs i { position: absolute; bottom: 100%; width: 100%; height: 40px; }
.bk-letter-sigs small { font-size: 10.5px; color: var(--text-secondary); }
.bk-letter-seal { position: absolute; left: -10px; bottom: 6px; width: 70px; height: 70px; color: #4b2fa8; opacity: 0.65; transform: rotate(-14deg); }
.bk-letter-seal svg { width: 100%; height: 100%; }

/* =====================================================================
   forms
   ===================================================================== */
.bk-rates { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.bk-rate { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 10px; background: #f9fbfd; }
.bk-rate b { flex: 1; font-size: 12.5px; }
.bk-rate-in { display: inline-flex; align-items: center; gap: 4px; }
.bk-rate-in input { width: 80px; }
.bk-rate-in small, .bk-rate > small { font-size: 10.5px; }
.bk-rate > small { flex-basis: 100%; }
.bk-unit-in { display: flex; align-items: center; gap: 6px; }
.bk-unit-in input { flex: 1; min-width: 0; }
.bk-unit-in em { font-style: normal; color: var(--text-muted); font-size: 12px; }
.bk-heads { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.bk-hint { display: block; margin-top: 4px; font-size: 11px; color: var(--text-muted); }
.bk-sign-cell .bond-pad canvas { width: 100%; height: 90px; }
.bk-sign-have { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.bk-sign-have svg { width: 200px; height: 60px; background: #fff; border: 1px dashed var(--hairline-strong); border-radius: 8px; }
.bk-of-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
.bk-of-items input, .bk-of-items select { width: 100%; min-width: 0; }
.bk-of-items td:nth-child(3), .bk-of-items td:nth-child(5), .bk-of-items td:nth-child(6) { white-space: nowrap; }
.bk-of-items [data-disc] small { display: block; font-size: 10px; }
.bk-trips-plan { margin: 6px 0 10px; display: flex; flex-direction: column; gap: 4px; }
.bk-trip-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.bk-trip-dots span { display: inline-flex; flex-direction: column; align-items: center; padding: 4px 6px; border-radius: 8px; background: var(--brick-50); color: var(--brick-700); animation: bk-pop .35s ease both; }
.bk-trip-dots svg { width: 16px; height: 16px; }
.bk-trip-dots small { font-size: 9.5px; font-weight: 650; }
@keyframes bk-pop { from { transform: scale(.6); opacity: 0; } }
.bk-waive { margin: 4px 0; }
.bk-order-form .switch { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.bk-bill { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; background: var(--surface-sunken); border-radius: 10px; padding: 10px 12px; }
.bk-bill > div { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.bk-bill .disc b { color: var(--negative); }
.bk-bill .total { border-top: 1px dashed var(--hairline-strong); padding-top: 5px; font-size: 14px; }
.bk-share .seg-chips { flex-wrap: wrap; }
.bk-share-out { display: flex; gap: 14px; align-items: flex-start; margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--surface-sunken); }
.bk-share-out input { width: 100%; margin-bottom: 8px; font-size: 11.5px; }
.bk-share-out .row { gap: 6px; margin-bottom: 6px; }
.bk-share-qr svg { width: 150px; height: 150px; display: block; background: #fff; border-radius: 8px; padding: 6px; }
.bk-earn { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow: auto; margin-bottom: 8px; }
.bk-earn-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--hairline); cursor: pointer; }
.bk-earn-row.old { background: #fffaf0; }
.bk-earn-row .grow { display: flex; flex-direction: column; }
.bk-earn-row small { font-size: 10.5px; color: var(--text-muted); }
.bk-bonus { display: grid; grid-template-columns: 1fr 120px auto; gap: 6px; margin-bottom: 6px; }
.bk-adv { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.bk-adv-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #f7f5ff; }
.bk-adv-row small { display: block; color: var(--text-secondary); font-size: 11px; }
.bk-adv-in { display: inline-flex; align-items: center; gap: 4px; }
.bk-adv-in input { width: 100px; }
.bk-net { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-sunken); }
.bk-net > div { display: flex; justify-content: space-between; }
.bk-net .total { font-size: 16px; border-top: 1px dashed var(--hairline-strong); padding-top: 6px; }

/* ---- layout: a section that fills the page (a side list and its pane, or a list beside its stats) */
.bk-area.bare { grid-template-rows: minmax(0, 1fr); }
.bk-content > .bk-fill { flex: 1 1 0; min-height: 480px; }
.bk-twopane, .bk-sales { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 10px; }
.bk-side-list { height: 100%; }
.bk-side-list > .panel-body { display: flex; flex-direction: column; overflow: hidden; }
.bk-side-list .list-tools { display: flex; flex-direction: column; gap: 6px; }
.bk-side-scroll { flex: 1; min-height: 0; overflow: auto; padding: 4px 6px 8px; outline: none; }
.bk-side-scroll .group-label { padding: 8px 6px 3px; }
.bk-side-scroll .group-label i { font-style: normal; color: var(--text-muted); font-weight: 600; margin-left: 4px; }
.bk-side-foot { display: flex; justify-content: space-between; gap: 6px; padding: 6px 10px; border-top: 1px solid var(--hairline); font-size: 11px; color: var(--text-muted); }
.bk-side-foot b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.bk-pane { min-width: 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 2px; }
.bk-pane > * { flex-shrink: 0; }
.bk-empty-pane { display: grid; place-items: center; gap: 10px; min-height: 260px; }

/* a row of a side list: an icon, two lines and a meter */
.bk-side-row { position: relative; display: flex; align-items: flex-start; gap: 9px; width: 100%; padding: 7px 9px; margin: 0 0 4px; border-radius: 11px; border: 1px solid var(--hairline);
    background: var(--card-bg, #fff); text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.bk-side-row:hover { border-color: var(--hairline-strong); box-shadow: 0 3px 10px rgba(16, 52, 84, 0.07); }
.bk-side-row.selected { background: linear-gradient(180deg, #eef7fe, #e3f0fa); border-color: rgba(11, 124, 189, 0.35); box-shadow: inset 3px 0 0 var(--ocean-600); }
.bk-side-row.off { opacity: 0.6; }
.bk-side-row .chip-icon.sm, .bk-side-row .bk-avatar { margin-top: 1px; }
.bk-side-row .bk-plate { margin-top: 2px; }
.bk-sr-line { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; font-size: 12.5px; }
.bk-sr-line > b:last-child { flex: none; font-variant-numeric: tabular-nums; }
.bk-sr-line b small { font-weight: 500; color: var(--text-muted); font-size: 10.5px; }
.bk-sr-line.sub { margin-top: 2px; font-size: 11px; color: var(--text-muted); }
.bk-sr-line.sub small { font-size: 10.5px; color: var(--text-muted); }
.bk-sr-line.sub svg { width: 10px; height: 10px; vertical-align: -1px; margin-right: 3px; }
.bk-side-row .bk-meter { display: block; height: 4px; margin: 5px 0 0; }
.bk-side-row.all { background: var(--surface-sunken); }

/* thin figures: one line each */
.bk-chipfigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.bk-chipfigs.in { margin-top: 8px; }
.bk-chipfig { position: relative; display: flex; align-items: baseline; gap: 6px; min-width: 0; height: 34px; padding: 0 10px; border-radius: 10px; background: var(--surface);
    border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm); align-items: center; overflow: hidden; }
.bk-chipfigs.in .bk-chipfig { background: var(--surface-sunken); box-shadow: none; border-color: var(--hairline); }
.bk-chipfig > svg { flex: none; width: 13px; height: 13px; color: var(--ocean-600); }
.bk-chipfig span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); white-space: nowrap; }
.bk-chipfig b { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bk-chipfig small { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bk-chipfig.warn > svg, .bk-chipfig.warn b { color: #8a5b00; }
.bk-chipfig.bad > svg, .bk-chipfig.bad b { color: var(--negative); }

/* a card of the order page or a detail pane */
.bk-card { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--radius-lg, 14px); background: var(--surface); border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm); min-width: 0; }
.bk-card-head { display: flex; align-items: center; gap: 6px; min-height: 26px; }
.bk-card-head > svg { width: 14px; height: 14px; color: var(--ocean-600); }
.bk-card-head > b { font-size: 13px; }
.bk-note-p { display: flex; gap: 5px; align-items: flex-start; margin: 0; }
.bk-note-p svg { width: 12px; height: 12px; flex: none; margin-top: 2px; }

/* the filters on a list's head */
.bk-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.bk-filters .bk-search { width: 170px; }
.bk-filters .bk-search input { min-width: 0; font-size: 12px; }
.bk-dates { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); }
.bk-dates input { height: 26px; font-size: 12px; padding: 0 6px; }

/* lists that fill their panel */
.bk-tall { height: 100%; }
.bk-tall > .panel-body { overflow: hidden; display: flex; flex-direction: column; }
.bk-scroll { flex: 1; min-height: 0; overflow: auto; }
.bk-list-foot { display: flex; gap: 16px; font-size: 11.5px; color: var(--text-muted); width: 100%; justify-content: flex-end; }
.bk-list-foot b { color: var(--text-primary); }

/* ---- production */
.bk-prod { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: minmax(0, 1fr); gap: 10px; }
.bk-prod .bk-line { min-height: 32px; padding: 2px 10px; }
.bk-line small.inline, .bk-line > span > small.inline { display: inline; font-size: 10.5px; color: var(--text-muted); margin-left: 4px; }
.bk-types-line { font-size: 11.5px; color: var(--text-secondary); }
.bk-types-line b { color: var(--text-primary); }
.bk-side-stats { min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.bk-stat { flex-shrink: 0; }
.bk-stat .bk-stock { gap: 7px; }
.bk-daybars { display: flex; align-items: flex-end; gap: 3px; height: 74px; padding-top: 4px; }
.bk-daybars span { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 2px; min-width: 0; }
.bk-daybars i { display: block; width: 100%; max-width: 18px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, var(--ocean-400), var(--ocean-600)); }
.bk-daybars small { font-size: 9px; color: var(--text-muted); }
.bk-barlist { display: flex; flex-direction: column; gap: 6px; }
.bk-barlist > div { display: grid; grid-template-columns: minmax(0, 1fr) 70px auto; gap: 8px; align-items: center; font-size: 12px; }
.bk-barlist i { height: 6px; border-radius: 4px; background: var(--surface-sunken); overflow: hidden; }
.bk-barlist i em { display: block; height: 100%; border-radius: 4px; background: var(--ocean-500); }
.bk-barlist i em.warn { background: var(--status-warning); }
.bk-barlist b { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; line-height: 1.15; }
.bk-barlist b small { font-size: 10px; font-weight: 500; color: var(--text-muted); }
.bk-barlist em.warn, .bk-barlist small.warn { color: #8a5b00; font-style: normal; }
.hc-pr-figs.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hc-pr-figs.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bk-kv { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.bk-kv > div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted var(--hairline); padding: 2px 0; }
.bk-kv b small { font-weight: 500; color: var(--text-muted); }
.bk-goodbar { height: 5px; border-radius: 3px; background: #f6d4d4; overflow: hidden; margin-top: 6px; }
.bk-goodbar i { display: block; height: 100%; background: var(--status-good); }
.bk-detail-grid.three { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(220px, 0.9fr); }
.bk-detail-grid.pay { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(200px, 0.8fr); }
.bk-detail-side { display: flex; flex-direction: column; gap: 8px; }
.bk-detail-grid section { min-width: 0; overflow-x: auto; }
.bk-detail-grid section h4 + table, .bk-detail-grid section table + h4 { margin-top: 0; }
.bk-detail-grid section table + h4 { margin-top: 10px; }
table.grid.dense tfoot td { font-weight: 700; border-top: 1px solid var(--hairline-strong); }

/* facts: label above value, in a compact grid */
.bk-crew { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px 12px; }
.bk-crew > div { min-width: 0; }
.bk-crew > div.wide { grid-column: 1 / -1; }
.bk-crew dt { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.bk-crew dd { margin: 0; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.bk-crew dd small { font-weight: 500; }
.bk-crew dd a svg { width: 12px; height: 12px; vertical-align: -2px; }

/* ---- raw material */
.bk-mat-head .bk-mh-top, .bk-who-head .bk-mh-top, .bk-acct-head .bk-mh-top { display: flex; align-items: center; gap: 10px; }
.bk-mh-top h2 { margin: 0; font-size: 16px; }
.bk-mh-top small svg { width: 11px; height: 11px; vertical-align: -1px; margin-right: 3px; }
.bk-mh-body { display: grid; grid-template-columns: 210px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.bk-mh-stock { display: flex; flex-direction: column; gap: 2px; }
.bk-mh-stock > small:first-child { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; }
.bk-mh-stock b { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bk-mh-stock b span { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.bk-mh-trend { display: flex; flex-direction: column; gap: 2px; }
.bk-mh-trend small { font-size: 10px; color: var(--text-muted); }
.bk-mh-trend svg { display: block; }
.bk-head-acts { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* ---- sales & delivery: the order list */
.bk-of-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.bk-fchip { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--hairline); background: #fff;
    font-size: 11px; font-weight: 600; line-height: 1; color: var(--text-secondary); cursor: pointer; }
.bk-fchip i { font-style: normal; font-size: 10px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.bk-fchip:hover { border-color: var(--ocean-300); }
.bk-fchip.active { background: var(--grad-navy); border-color: transparent; color: #fff; }
.bk-fchip.active i { color: rgba(255, 255, 255, 0.75); }
.bk-of-dates { display: flex; align-items: center; gap: 6px; }
.bk-of-dates select { flex: 1; min-width: 0; height: 26px; font-size: 12px; padding: 0 6px; border-radius: 8px; }
.bk-of-custom { justify-content: space-between; }
.bk-of-custom input { flex: 1; min-width: 0; }
.bk-order-row { position: relative; display: flex; align-items: flex-start; gap: 9px; padding: 7px 9px; margin: 0 0 4px; border-radius: 11px; border: 1px solid var(--hairline);
    background: var(--card-bg, #fff); cursor: pointer; color: inherit; text-decoration: none; }
.bk-order-row:hover { border-color: var(--hairline-strong); box-shadow: 0 3px 10px rgba(16, 52, 84, 0.07); }
.bk-order-row.selected { background: linear-gradient(180deg, #eef7fe, #e3f0fa); border-color: rgba(11, 124, 189, 0.35); box-shadow: inset 3px 0 0 var(--ocean-600); }
.bk-order-row.st-cancelled { opacity: 0.55; }
.bk-or-av { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--ocean-700);
    background: linear-gradient(180deg, #e8f1f8, #d5e5f2); }
.bk-order-row .badge { font-size: 9.5px; padding: 0 6px; }
.bk-order-row .badge svg { width: 10px; height: 10px; }
.bk-mini-bar { display: block; height: 4px; border-radius: 3px; background: #eef2f6; overflow: hidden; margin-top: 4px; }
.bk-mini-bar em { display: block; height: 100%; background: var(--status-good); }
.bk-mini-bar.violet em { background: #7d63d6; }

/* ---- an order */
.bk-order { display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; }
.bk-oh { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-lg, 14px); background: linear-gradient(135deg, var(--glacier-50), #fff 70%);
    border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm); }
.bk-oh-av { flex: none; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--grad-button); }
.bk-oh-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bk-oh-title h2 { margin: 0; font-size: 17px; min-width: 0; }
.bk-oh-no { flex: none; font-size: 11.5px; font-weight: 700; color: var(--text-muted); padding: 1px 7px; border-radius: 6px; background: var(--surface-sunken); }
.bk-oh-amt { flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.bk-oh-amt small { font-size: 10.5px; color: var(--text-muted); }
.bk-oh-amt b { font-size: 20px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.bk-meta { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 3px; font-size: 11.5px; color: var(--text-secondary); min-width: 0; }
.bk-meta a { color: inherit; }
.bk-meta svg { width: 11px; height: 11px; vertical-align: -1px; margin-right: 3px; }
.bk-order-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.bk-claim { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; background: #fff4d6; color: #7a4f00; }
.bk-claim div { display: flex; flex-direction: column; }
.bk-order-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 10px; align-items: start; }
.bk-order-main, .bk-order-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

/* the delivery's lifecycle: a step for the order and each step of a trip, how many trips reached it, when */
.bk-life { padding: 10px 10px 8px; border-radius: 12px; background: var(--surface-sunken); border: 1px solid var(--hairline); }
.bk-life ol { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; }
.bk-life ol::before { content: ''; position: absolute; left: 10%; right: 10%; top: 13px; height: 2px; background: #dbe4ec; }
.bk-life li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--text-muted); min-width: 0; }
.bk-life li > div { display: flex; flex-direction: column; min-width: 0; }
.bk-life li b { font-size: 11.5px; color: var(--text-secondary); }
.bk-life li small { font-size: 10px; line-height: 1.25; }
.bk-life-dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid #d3dde6; color: var(--text-muted); }
.bk-life-dot svg { width: 13px; height: 13px; }
.bk-life li.done .bk-life-dot { background: var(--status-good); border-color: var(--status-good); color: #fff; }
.bk-life li.part .bk-life-dot { background: #fff; border-color: var(--ocean-500); color: var(--ocean-600); box-shadow: 0 0 0 4px rgba(11, 139, 208, 0.12); }
.bk-life li.done b, .bk-life li.part b { color: var(--text-primary); }
.bk-life-bar { height: 6px; margin-top: 10px; border-radius: 4px; background: #e3eaf0; overflow: hidden; }
.bk-life-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--ocean-500), var(--status-good)); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.bk-life-foot { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--text-muted); }
.bk-life-foot b { color: var(--text-primary); }
.bk-life.cancelled { opacity: 0.5; filter: grayscale(1); }

/* trips */
.bk-trip-rows { border: 1px solid var(--hairline); border-radius: 10px; overflow: hidden; background: #fff; }
.bk-trip-rows .bk-line { min-height: 36px; }
.bk-trip-no { font-weight: 800; color: var(--text-secondary); }
.bk-dots { display: flex; gap: 3px; }
.bk-dots i { width: 8px; height: 8px; border-radius: 50%; background: #e3e8ee; }
.bk-dots i.done { background: var(--status-good); }
.bk-dots i.now { background: var(--ocean-600); box-shadow: 0 0 0 3px rgba(11, 106, 166, 0.2); }
.bk-trip-detail { display: grid; grid-template-columns: minmax(150px, 0.55fr) minmax(0, 1.45fr); gap: 12px 18px; }
.bk-trip-detail > .bk-ack-col { grid-column: 1 / -1; }
.bk-trip-detail .bk-ack:not(.pending) { display: grid; grid-template-columns: minmax(0, 1fr) 230px minmax(0, 1.2fr); align-items: center; gap: 8px 14px; }
.bk-trip-detail .bk-ack:not(.pending) > small { grid-column: 1 / -1; }
.bk-trip-detail .bk-ack.pending { flex-direction: row; align-items: center; justify-content: space-between; }
.bk-trip-detail .bk-crew { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.bk-trip-detail > section { min-width: 0; }
.bk-trip-detail h4, .bk-detail-grid h4 { display: flex; align-items: center; gap: 5px; margin: 0 0 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ocean-700); }
.bk-trip-detail h4 svg, .bk-detail-grid h4 svg { width: 13px; height: 13px; }
.bk-trip-detail section table + h4 { margin-top: 10px; }
.bk-tl { position: relative; display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; list-style: none; }
.bk-tl::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: #e3e8ee; }
.bk-tl li { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 8px; color: var(--text-muted); }
.bk-tl li i { grid-row: span 2; z-index: 1; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid #d3dde6; }
.bk-tl li i svg { width: 10px; height: 10px; }
.bk-tl li b { font-size: 12px; line-height: 1.2; }
.bk-tl li small { font-size: 10.5px; }
.bk-tl li.done i { background: var(--status-good); border-color: var(--status-good); color: #fff; }
.bk-tl li.now i { border-color: var(--ocean-600); color: var(--ocean-600); box-shadow: 0 0 0 3px rgba(11, 106, 166, 0.15); }
.bk-tl li.done b, .bk-tl li.now b { color: var(--text-primary); }
.bk-trip-acts { gap: 4px; margin-top: 8px; }
.bk-ack { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; background: #f1faf4; border: 1px solid rgba(12, 163, 12, 0.22); }
.bk-ack.pending { background: var(--surface-sunken); border-color: var(--hairline); align-items: flex-start; }
.bk-ack-head { display: flex; gap: 8px; align-items: flex-start; }
.bk-ack-head > svg { width: 18px; height: 18px; flex: none; color: var(--status-good); }
.bk-ack.pending .bk-ack-head > svg { color: var(--text-muted); }
.bk-ack-head > div { display: flex; flex-direction: column; }
.bk-ack-head small { font-size: 11px; color: var(--text-muted); }
.bk-ack-sign { display: grid; place-items: center; height: 64px; border-radius: 8px; background: #fff; border: 1px dashed #b7dcc4; }
.bk-ack-sign svg.bond-sign { width: 100%; max-width: 220px; height: 58px; }
.bk-ack > small { display: flex; gap: 4px; align-items: center; font-size: 10.5px; }
.bk-ack > small svg { width: 11px; height: 11px; }

/* payments of an order */
.bk-pays { display: flex; flex-direction: column; gap: 4px; }
.bk-pay { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--hairline); }
.bk-pay.claimed { background: #fffaf0; border-color: rgba(250, 178, 25, 0.45); }
.bk-pay > div { display: flex; flex-direction: column; }
.bk-pay small { font-size: 11px; color: var(--text-muted); }
.bk-pay-amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bk-none { margin: 0; }
.bk-links { display: flex; flex-direction: column; gap: 4px; }
.bk-links > div { display: flex; gap: 8px; align-items: center; font-size: 11.5px; }
.bk-links > div.EXPIRED, .bk-links > div.REVOKED { opacity: 0.6; }

/* the bill, summed up */
.bk-bs-lines { display: flex; flex-direction: column; gap: 3px; }
.bk-bs-lines > div { display: flex; align-items: baseline; gap: 6px; font-size: 12px; }
.bk-bs-lines > div > span { color: var(--text-secondary); white-space: nowrap; }
.bk-bs-lines > div > i { flex: 1; border-bottom: 1px dotted var(--hairline-strong); transform: translateY(-3px); }
.bk-bs-lines > div > b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bk-bs-lines > div.pos b { color: var(--positive); }
.bk-bs-lines > div.warn b { color: #8a5b00; }
.bk-bs-lines > div.total { margin-top: 3px; padding-top: 4px; border-top: 1px solid var(--hairline-strong); font-size: 13.5px; }
.bk-bs-lines > div.total > span { color: var(--text-primary); font-weight: 650; }
.bk-bs-lines > div.total > i { border: 0; }
.bk-bs-lines > div.due b { color: var(--negative); }
.bk-bs-lines > div.clear b { color: var(--positive); }
.bk-bs-lines em { font-style: normal; font-weight: 600; }
.bk-paid-bar { display: flex; height: 5px; border-radius: 3px; background: var(--surface-sunken); overflow: hidden; }
.bk-paid-bar em { display: block; height: 100%; background: var(--status-good); }
.bk-paid-bar em.way { background: var(--ocean-400); }
.bk-bs-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bk-items { display: flex; flex-direction: column; gap: 8px; }
.bk-items > div { display: flex; flex-direction: column; gap: 3px; }
.bk-items-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.bk-items-top span { font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.bk-items small { font-size: 10.5px; }
.bd-wrap { background: #eceff1; padding: 14px; border-radius: 12px; }

/* ---- team */
.bk-show { flex-wrap: nowrap; }
.bk-show .seg-chip { flex: 1; justify-content: center; }
.bk-avatar { --tone: var(--ocean-600); position: relative; flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 14px; font-style: normal;
    color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 65%, #fff), var(--tone)); }
.bk-avatar > i { position: absolute; right: -5px; bottom: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #fff; color: var(--tone); font: 800 10px/18px system-ui; font-style: normal;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }
.bk-avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 10.5px; }
.bk-avatar.xs { width: 22px; height: 22px; border-radius: 7px; font-size: 9px; }
.bk-avatar.ocean { --tone: var(--ocean-600); } .bk-avatar.aqua { --tone: #0b8f82; } .bk-avatar.teal { --tone: #2a8ab0; } .bk-avatar.violet { --tone: #5b4fc9; } .bk-avatar.slate { --tone: #5d7286; }
.bk-who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bk-members { display: flex; align-items: center; min-width: 0; margin-top: 6px; }
.bk-members > span { flex: none; width: 22px; height: 22px; margin-right: -5px; border-radius: 50%; display: grid; place-items: center; font-size: 8.5px; font-weight: 800; color: var(--ocean-700);
    background: var(--glacier-100); border: 2px solid #fff; }
.bk-members small { margin-left: 10px; font-size: 10.5px; color: var(--text-muted); min-width: 0; }
.bk-plate { flex: none; display: inline-block; padding: 3px 8px; border-radius: 6px; border: 2px solid #1d1d1d; background: #fde68a; font: 800 11.5px/1.2 ui-monospace, Consolas, monospace; letter-spacing: 0.04em; color: #111; white-space: nowrap; }
.bk-plate.sm { font-size: 10px; padding: 1px 6px; border-width: 1.5px; }
.bk-plate.xs { font-size: 9.5px; padding: 0 5px; border-width: 1px; border-radius: 4px; vertical-align: 1px; }
.bk-plate.lg { font-size: 15px; padding: 5px 10px; }
.bk-tx .bk-line { min-height: 34px; padding: 2px 10px; }
.bk-tx .bk-who .chip-icon.sm { width: 20px; height: 20px; }
.bk-months { display: flex; flex-direction: column; gap: 5px; }
.bk-months > div:not(.bk-months-key) { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12px; }
.bk-months i { position: relative; height: 8px; border-radius: 4px; background: var(--surface-sunken); overflow: hidden; }
.bk-months i em { position: absolute; left: 0; top: 0; height: 100%; border-radius: 4px; background: var(--ocean-300); }
.bk-months i em.paid { top: 3px; height: 2px; background: var(--status-good); }
.bk-months b { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; line-height: 1.1; }
.bk-months b small { font-weight: 500; font-size: 9.5px; color: var(--text-muted); }
.bk-months-key { display: flex; gap: 12px; font-size: 10.5px; color: var(--text-muted); }
.bk-months-key i { display: inline-block; width: 10px; height: 6px; border-radius: 2px; margin-right: 4px; background: var(--ocean-300); vertical-align: 1px; }
.bk-months-key i.paid { background: var(--status-good); }
.bk-vtrips { display: flex; flex-direction: column; }
.bk-vtrip { display: grid; grid-template-columns: 84px minmax(0, 1fr) minmax(0, 0.5fr) 64px 92px; gap: 10px; align-items: center; min-height: 34px; padding: 3px 12px;
    border-bottom: 1px solid var(--hairline); color: inherit; text-decoration: none; font-size: 12.5px; }
.bk-vtrip:hover { background: var(--surface-hover); }
.bk-vtrip .r { text-align: right; }
.bk-adv-mini { display: flex; flex-direction: column; gap: 2px; padding: 5px 0; border-bottom: 1px dotted var(--hairline); font-size: 12px; }
.bk-adv-mini:last-child { border-bottom: 0; }
.bk-adv-mini small { font-size: 10.5px; color: var(--text-secondary); }
.bk-adv-mini .bk-mini-bar { margin-top: 1px; }
.bk-slip-peek { display: flex; align-items: flex-end; gap: 16px; }
.bk-slip-peek .bk-crew { flex: 1; }
.bk-net.small { margin-top: 0; padding: 8px 10px; font-size: 12px; }
.bk-net.small .total { font-size: 14px; }

/* ---- forms: enrolling, the order's transport */
.bk-res-form { display: flex; flex-direction: column; gap: 10px; }
.bk-res-form .form-grid { margin: 0; }
.bk-rf-row { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.bk-res-form .seg-chips.wrap { flex-wrap: wrap; }
.bk-res-form .seg-chip svg, .bk-transport .seg-chip svg { width: 12px; height: 12px; margin-right: 4px; }
.bk-res-form .field[hidden], .bk-res-form .check-line[hidden] { display: none; }
.bk-role-other { margin-top: -4px; max-width: 280px; height: 34px; }
.bk-transport { margin-bottom: 8px; }
.bk-order-form [data-hired] { padding: 8px 10px 4px; margin-bottom: 8px; border-radius: 12px; background: var(--surface-sunken); border: 1px dashed var(--hairline-strong); }
.bk-order-form [data-hired] .seg-chips { flex-wrap: wrap; }
.bk-order-form [data-hired] .seg-chip small { font-weight: 500; }
.bk-order-form [hidden] { display: none !important; }
.bk-bill small { display: block; margin-top: 2px; }

/* ---- the batch dialog: as the chit payout's, the form on the left and what it comes to on the right */
.modal.bk-batch-modal { width: min(1180px, 96vw); }
.modal.bk-batch-modal .modal-body { display: flex; flex-direction: column; overflow: hidden; height: min(78vh, 820px); }
.modal.bk-batch-modal .modal-body > .form-error:empty { display: none; }
.bkb { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 16px; flex: 1 1 auto; min-height: 0; }
.bkb-left, .bkb-right { min-height: 0; overflow: auto; padding-right: 4px; scrollbar-gutter: stable; display: flex; flex-direction: column; gap: 10px; }
.bkb-right { padding: 10px; border-radius: 14px; background: var(--surface-sunken); border: 1px solid var(--hairline); }
.bkb-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: linear-gradient(135deg, var(--glacier-50), var(--glacier-100)); border: 1px solid var(--glacier-200); }
.bkb-head > div { display: flex; flex-direction: column; min-width: 0; }
.bkb-head small { font-size: 11px; color: var(--text-muted); }
.bkb-head-amt { flex: none; display: flex; flex-direction: column; align-items: flex-end; }
.bkb-head-amt b { font-size: 22px; color: var(--ocean-700); font-variant-numeric: tabular-nums; line-height: 1.1; }
.bkb .form-grid { margin: 0; }
.bkb .section-title { display: flex; align-items: center; gap: 6px; margin: 2px 0 -4px; }
.bkb .section-title svg { width: 13px; height: 13px; color: var(--ocean-600); }
.bkb .section-title small { font-weight: 500; text-transform: none; letter-spacing: 0; }
.bkb-table { width: 100%; }
.bkb-table th { font-size: 10px; }
.bkb-table td { padding-top: 4px; padding-bottom: 4px; vertical-align: middle; }
.bkb-table td > b { display: block; font-size: 12.5px; }
.bkb-table td > small { display: block; font-size: 10.5px; color: var(--text-muted); }
.bkb-table td > small.warn { color: #8a5b00; }
.bkb-table input { width: 100%; min-width: 0; height: 30px; text-align: right; }
.bkb-table [data-qty] { font-weight: 700; font-size: 14px; }
.bkb-table tr.filled td:first-child { box-shadow: inset 3px 0 0 var(--ocean-500); }
.bkb-table [data-good] small { display: block; font-size: 10px; }
.bkb-table th:nth-child(2) { width: 170px; } .bkb-table th:nth-child(3) { width: 90px; } .bkb-table th:nth-child(4), .bkb-table th:nth-child(5) { width: 96px; }
.bkb-table.mats th:nth-child(5) { width: 110px; } .bkb-table.mats th:nth-child(6) { width: 120px; }
.bkb-table.mats th:nth-child(2), .bkb-table.mats th:nth-child(3), .bkb-table.mats th:nth-child(4) { width: auto; }
.bkb-made { display: flex; align-items: center; gap: 4px; }
.bkb-made input { flex: 1; }
.bkb-quick { display: inline-flex; gap: 2px; }
.bkb-quick button { height: 24px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--hairline-strong); background: #f7f9fb; font: 650 10.5px system-ui; cursor: pointer; color: var(--text-secondary); }
.bkb-quick button:hover { border-color: var(--ocean-400); color: var(--ocean-700); }
.bkb-mat.set td:first-child { box-shadow: inset 3px 0 0 var(--status-good); }
.bkb-mat.bad { background: #fff6f6; }
.bkb-use { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.bkb-use > i { height: 5px; border-radius: 3px; background: #eef2f6; overflow: hidden; }
.bkb-use > i em { display: block; height: 100%; width: 0; background: var(--ocean-500); transition: width .25s; }
.bkb-use small { font-size: 10px; }
.bkb-dmgbar.over em { background: var(--negative); }
.bkb-pay { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; }
.bkb-pay b { font-size: 18px; font-variant-numeric: tabular-nums; color: var(--ocean-700); }
.bkb-pay b small { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.bkb-used { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.bkb-used span { display: flex; justify-content: space-between; border-bottom: 1px dotted var(--hairline); padding: 2px 0; }

/* ---- reports */
.report-content.bk-report { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap, 12px); align-content: start; overflow: auto; }
.bk-report > .stat-strip { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.bk-report .bk-span-all { grid-column: 1 / -1; }
.bk-report .bk-span-2 { grid-column: span 2; }
.bk-report .panel { min-height: 0; }
.bk-report .panel .scroll { max-height: 420px; overflow: auto; }
.bk-pl td { padding: 6px 12px; }

/* ---- narrower screens */
@media (max-width: 1400px) {
    .bk-detail-grid.three, .bk-detail-grid.pay { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .bk-detail-grid.three > .bk-detail-side, .bk-detail-grid.pay > .bk-detail-side { grid-column: 1 / -1; }
    .bk-mh-body { grid-template-columns: 190px minmax(0, 1fr); }
    .bk-mh-trend { grid-column: 1 / -1; }
}
@media (max-width: 1250px) {
    .bk-split { grid-template-columns: minmax(0, 1fr); }
    .bk-order-grid { grid-template-columns: minmax(0, 1fr); }
    .bk-prod { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 1100px) {
    .bk-split.even, .bk-set-grid, .bk-of-grid, .bkb { grid-template-columns: minmax(0, 1fr); }
    .bk-twopane, .bk-sales, .bk-prod { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
    .bk-content > .bk-fill { flex: none; min-height: 0; }
    .bk-side-list { height: auto; }
    .bk-side-scroll { max-height: 340px; }
    .bk-tall { height: auto; }
    .bk-scroll { max-height: none; }
    .modal.bk-batch-modal .modal-body { height: auto; overflow: auto; }
    .bkb-left, .bkb-right { overflow: visible; }
    .report-content.bk-report { grid-template-columns: minmax(0, 1fr); }
    .bk-report .bk-span-2 { grid-column: auto; }
    .bk-grid .dash-cell { grid-column: 1 / -1 !important; }
}
@media (max-width: 640px) {
    .bk-pipe { grid-template-columns: repeat(3, 1fr); }
    .bk-detail-grid, .bk-detail-grid.two, .bk-detail-grid.three, .bk-detail-grid.pay, .bk-trip-detail, .bk-trip-detail .bk-ack:not(.pending) { grid-template-columns: minmax(0, 1fr); }
    .bk-acct-group { grid-template-columns: minmax(0, 1fr); }
    .bk-life ol { grid-template-columns: repeat(5, minmax(56px, 1fr)); overflow-x: auto; }
    .bk-life li small { display: none; }
    .bk-oh { flex-wrap: wrap; }
    .bk-mh-body { grid-template-columns: minmax(0, 1fr); }
    .hc-pr-figs.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bk-line { grid-template-columns: 16px minmax(0, 1fr) auto; }
    .bk-line > span:not(:first-of-type):not(.bk-acts) { display: none; }
    .bk-vtrip { grid-template-columns: 70px minmax(0, 1fr) 54px; }
    .bk-vtrip > span:nth-child(3), .bk-vtrip > span:nth-child(5) { display: none; }
}

/* =====================================================================
   panel-level scrolling: a section fits the window and only its long
   lists scroll, each inside its own panel
   ===================================================================== */
.bk-pane.fixed { overflow: hidden; }
.bk-pane.fixed > .bk-grow, .bk-grow { flex: 1 1 0; min-height: 0; }
.bk-grow.panel > .panel-body { overflow: hidden; display: flex; flex-direction: column; }
.bk-split.bk-grow { align-items: stretch; grid-template-rows: minmax(0, 1fr); }
.bk-split.bk-grow > .panel { height: 100%; min-height: 0; }
.bk-aside.bk-scroll { min-height: 0; overflow: auto; padding-right: 2px; }
.bk-onecol { display: flex; flex-direction: column; min-height: 0; }
.bk-onecol > .panel { flex: 1; min-height: 0; }
.bk-pad { padding: 8px 12px; }
.bk-overlay-load { position: sticky; top: 0; z-index: 3; display: flex; justify-content: center; padding: 6px; background: rgba(255, 255, 255, 0.7); }
.bk-overlay-load .spinner { width: 18px; height: 18px; border-width: 2px; }
tr.busy-row td { opacity: 0.55; }
table.sticky thead th { position: sticky; top: 0; z-index: 2; background: var(--surface, #fff); box-shadow: inset 0 -1px 0 var(--hairline); }

/* ---- overview: fitted to the window */
.bk-ov { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: minmax(0, 1.05fr) minmax(0, 1fr); gap: 10px; }
.bk-ov > .panel { min-height: 0; }
.bk-ov > .panel > .panel-body { overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.bk-ov-todo { grid-column: span 3; grid-row: span 2; }
.bk-ov-flow { grid-column: span 5; }
.bk-ov-money { grid-column: span 4; }
.bk-ov-trips, .bk-ov-stock { grid-column: span 3; }
.bk-ov-dues { grid-column: span 3; }
.bk-ov .panel-body.chart { padding: 6px 10px 8px; }
.bk-ov .panel-body.chart .chart-wrap { flex: 1; min-height: 0; height: auto; }
.bk-todo { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.bk-todo-item { display: flex; align-items: flex-start; gap: 9px; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--hairline); border-left: 3px solid var(--ocean-500);
    background: var(--card-bg, #fff); color: inherit; text-decoration: none; }
a.bk-todo-item:hover { box-shadow: 0 3px 10px rgba(16, 52, 84, 0.08); border-color: var(--hairline-strong); }
.bk-todo-item > span { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--glacier-100); color: var(--ocean-700); }
.bk-todo-item > span svg { width: 13px; height: 13px; }
.bk-todo-item > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.bk-todo-item b { font-size: 12.5px; }
.bk-todo-item small { font-size: 11px; color: var(--text-secondary); line-height: 1.35; }
.bk-todo-item .chev { width: 13px; height: 13px; color: var(--text-muted); align-self: center; }
.bk-todo-item.critical { border-left-color: var(--status-critical); } .bk-todo-item.critical > span { background: #fbe3e3; color: #a32626; }
.bk-todo-item.warning { border-left-color: var(--status-warning); } .bk-todo-item.warning > span { background: #fff4d6; color: #8a5b00; }
.bk-todo-item.good { border-left-color: var(--status-good); } .bk-todo-item.good > span { background: #e3f6e3; color: #0a6b0a; }
.bk-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; width: 100%; }
.bk-money { display: flex; flex-direction: column; gap: 10px; padding: 8px 12px 10px; }
.bk-pl { display: flex; flex-direction: column; gap: 5px; }
.bk-pl > div { display: grid; grid-template-columns: 88px minmax(0, 1fr) 84px; gap: 8px; align-items: center; font-size: 12px; }
.bk-pl > div > span { color: var(--text-secondary); }
.bk-pl i { height: 8px; border-radius: 4px; background: var(--surface-sunken); overflow: hidden; }
.bk-pl i em { display: block; height: 100%; border-radius: 4px; }
.bk-pl em.sales { background: var(--ocean-500); } .bk-pl em.cost { background: #e8946b; }
.bk-pl b { text-align: right; font-variant-numeric: tabular-nums; }
.bk-pl .total { padding-top: 5px; border-top: 1px solid var(--hairline-strong); font-size: 13px; }
.bk-pl .total > span { color: var(--text-primary); font-weight: 650; }
.bk-pl .total i { background: none; }
.bk-months6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) auto; gap: 6px; align-items: end; }
.bk-months6 > div:not(.key) { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bk-months6 .bars { display: flex; align-items: flex-end; gap: 2px; height: 46px; }
.bk-months6 .bars i { display: block; width: 8px; border-radius: 3px 3px 1px 1px; min-height: 2px; }
.bk-months6 i.s { background: var(--ocean-500); } .bk-months6 i.c { background: #e8946b; }
.bk-months6 small { font-size: 9.5px; color: var(--text-muted); }
.bk-months6 .key { display: flex; flex-direction: column; gap: 2px; font-size: 10px; color: var(--text-muted); }
.bk-months6 .key i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 3px; }
.bk-ov-trips .bk-pipe { grid-template-columns: repeat(5, 1fr); padding: 8px 10px 4px; }
.bk-ov-trips .bk-pipe-step { padding: 4px 2px; }
.bk-ov-trips .bk-pipe-step b { font-size: 14px; }
.bk-up-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--hairline); color: inherit; text-decoration: none; font-size: 12px; }
a.bk-up-row:hover { background: var(--surface-hover); }
.bk-up-row > div { display: flex; flex-direction: column; }
.bk-up-row small { font-size: 10.5px; color: var(--text-muted); }
.bk-up-row .r { display: flex; align-items: center; gap: 2px; }
.bk-up-row.slim { padding: 4px 12px; border-bottom: 0; }
.section-title.bk-st { margin: 12px 0 6px; }
.bk-ov-stock .bk-mats { gap: 7px; }

/* ---- raw material: how the stock is made up */
.bk-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.bk-flow > div:not(.bk-flow-facts) { display: flex; flex-direction: column; padding: 4px 10px; border-radius: 9px; background: var(--surface-sunken); min-width: 84px; }
.bk-flow small { font-size: 10px; color: var(--text-muted); }
.bk-flow b { font-size: 15px; font-variant-numeric: tabular-nums; }
.bk-flow > div.in b { color: var(--positive); } .bk-flow > div.out b { color: var(--negative); }
.bk-flow > div.now { background: var(--glacier-100); } .bk-flow > div.now b { font-size: 18px; color: var(--ocean-700); }
.bk-flow > div.now b span { font-size: 11px; color: var(--text-muted); }
.bk-flow > i { font-style: normal; font-weight: 700; color: var(--text-muted); }
.bk-flow-facts { display: flex; flex-direction: column; gap: 1px; margin-left: auto; font-size: 11.5px; color: var(--text-secondary); text-align: right; }
.bk-mat-head > small { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.bk-mat-head > small svg { width: 11px; height: 11px; }
.bk-mat-head .bk-meter { margin: 0; }
.bk-buy { display: flex; flex-direction: column; gap: 10px; }
.bk-buy .form-grid { margin: 0; }
.bk-buy-mats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.bk-buy-mat { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 11px; border: 1.5px solid var(--hairline-strong); background: #fff; cursor: pointer; }
.bk-buy-mat input { position: absolute; opacity: 0; pointer-events: none; }
.bk-buy-mat b { font-size: 12.5px; } .bk-buy-mat small { font-size: 10.5px; color: var(--text-muted); }
.bk-buy-mat em { position: absolute; top: 6px; right: 8px; font-style: normal; font-size: 9.5px; font-weight: 700; color: #a32626; }
.bk-buy-mat.on { border-color: var(--ocean-600); background: var(--glacier-50); box-shadow: 0 0 0 2px rgba(11, 106, 166, 0.15); }
.bk-buy-after { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface-sunken); border: 1px solid var(--hairline); }
.bk-buy-after > span { display: flex; flex-direction: column; } .bk-buy-after > span small { font-size: 10px; color: var(--text-muted); }
.bk-buy-after b { font-size: 15px; font-variant-numeric: tabular-nums; } .bk-buy-after .in b { color: var(--positive); } .bk-buy-after .now b { color: var(--ocean-700); }
.bk-buy-after > i { font-style: normal; font-weight: 700; color: var(--text-muted); }
.bk-buy-after > small { flex-basis: 100%; font-size: 11px; }

/* ---- sales: the order list's filters, and the order filling its pane */
.bk-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hairline); margin: 0 -8px; padding: 0 6px; overflow-x: auto; scrollbar-width: none; }
.bk-tabs button { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 28px; padding: 0 6px; border: 0; border-bottom: 2px solid transparent;
    background: none; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.bk-tabs button i { font-style: normal; font-size: 10px; padding: 0 5px; border-radius: 999px; background: var(--surface-sunken); color: var(--text-muted); }
.bk-tabs button:hover { color: var(--ocean-700); }
.bk-tabs button.active { color: var(--ocean-700); border-bottom-color: var(--ocean-600); }
.bk-tabs button.active i { background: var(--ocean-600); color: #fff; }
.bk-dates-bar { position: relative; display: flex; align-items: center; gap: 4px; }
.bk-dates-bar [hidden] { display: none !important; }
.bk-dates-btn { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 8px; border: 1px dashed var(--hairline-strong);
    background: transparent; font: inherit; font-size: 11.5px; color: var(--text-secondary); cursor: pointer; }
.bk-dates-btn span { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-dates-btn svg { width: 12px; height: 12px; flex: none; }
.bk-dates-btn.on { border-style: solid; border-color: var(--ocean-400); background: var(--glacier-50); color: var(--ocean-700); font-weight: 600; }
.bk-dates-pop { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px;
    background: #fff; border: 1px solid var(--hairline-strong); box-shadow: 0 12px 30px rgba(16, 52, 84, 0.18); }
.bk-dates-pop .seg-chips { display: flex; } .bk-dates-pop .seg-chip { flex: 1; justify-content: center; }
.bk-dates-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.bk-dates-presets button { height: 26px; border-radius: 7px; border: 1px solid var(--hairline); background: #fff; font: inherit; font-size: 11.5px; cursor: pointer; color: var(--text-secondary); }
.bk-dates-presets button:hover { border-color: var(--ocean-300); }
.bk-dates-presets button.active { background: var(--grad-navy); border-color: transparent; color: #fff; }
.bk-orders-list .list-tools { overflow: visible; }
.bk-order-pane .bk-order { height: 100%; min-height: 0; }
.bk-order-pane .bk-order > * { flex-shrink: 0; }
.bk-order-pane .bk-order-grid { flex: 1 1 0; min-height: 0; align-items: stretch; grid-template-rows: minmax(0, 1fr); }
.bk-order-pane .bk-order-main { min-height: 0; }
.bk-order-pane .bk-order-side { min-height: 0; overflow: auto; padding-right: 2px; }
.bk-order-pane .bk-order-side > * { flex-shrink: 0; }
.bk-delivery-card { flex: 1 1 0; min-height: 0; }
.bk-delivery-card > * { flex-shrink: 0; }
.bk-delivery-card > .bk-trips-scroll { flex: 1 1 0; min-height: 0; overflow: auto; }
.bk-pay .bk-acts { flex: none; }

/* ---- payments: two columns, each list scrolling */
.bk-pay-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 10px; }
.bk-pay-left { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.bk-pay-run { flex: 1.3 1 0; } .bk-pay-adv { flex: 1 1 0; }
.bk-pay-grid .panel { min-height: 0; }
.bk-pay-grid .panel > .panel-body { overflow: hidden; display: flex; flex-direction: column; }
.bk-slip-lines { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--hairline); }
.bk-slip-ded { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.bk-slip-ded svg { width: 11px; height: 11px; margin-right: 4px; vertical-align: -1px; }

/* ---- accounts */
.bk-acct-head .bk-mh-top { align-items: center; }
.bk-acct-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.bk-acct-bar .bk-search { width: 180px; }
.bk-acct-bar .bk-search input { min-width: 0; font-size: 12px; }
.bk-side-foot > b { font-variant-numeric: tabular-nums; }
.bk-side-list .group-label b { font-size: 10.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ---- set-up */
.bk-setpanel .panel-head .actions { gap: 6px; }
.bk-set-sub { margin: 0; padding: 8px 14px 0; font-size: 12px; color: var(--text-secondary); }
.bk-setpanel .bk-scroll.bk-pad { padding: 10px 14px 14px; }
table.bk-settable { width: 100%; }
table.bk-settable td, table.bk-settable th { padding: 6px 8px; font-size: 12.5px; vertical-align: middle; }
table.bk-settable tr.off { opacity: 0.5; }
table.bk-settable small.block { display: block; font-size: 10.5px; }
.bk-setfacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 4px; }
.bk-setfacts > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-sunken); border: 1px solid var(--hairline); }
.bk-setfacts span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.bk-setfacts b { font-size: 15px; }
.bk-setfacts small { font-size: 11px; color: var(--text-muted); }
.bk-setpanel .bk-letter { max-width: 520px; margin-bottom: 10px; }
.bk-headchips { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-headchips span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px; background: var(--surface-sunken); border: 1px solid var(--hairline); font-size: 12.5px; }
.bk-headchips svg { width: 11px; height: 11px; color: var(--ocean-600); }

/* ---- shorter windows (13 and 14 inch laptops, 1366x768 and the like): tighter spacing so fitted pages still fit */
@media (max-height: 820px) {
    .bk-content { gap: 8px; }
    .bk-chipfig { height: 30px; }
    .bk-content > .bk-fill { min-height: 400px; }
    .bk-ov { gap: 8px; }
    .bk-oh { padding: 8px 12px; }
    .bk-life { padding: 8px 8px 6px; }
}
@media (max-width: 1400px) {
    .bk-ov { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
    .bk-ov-todo { grid-column: span 4; grid-row: span 2; }
    .bk-ov-flow { grid-column: span 4; }
    .bk-ov-money { grid-column: span 4; }
    .bk-ov-trips, .bk-ov-stock, .bk-ov-dues { grid-column: span 4; }
    .bk-ov-dues { display: none; }
}
@media (max-width: 1100px) {
    .bk-ov, .bk-pay-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
    .bk-ov > .panel { grid-column: auto !important; grid-row: auto !important; height: 380px; }
    .bk-ov-dues { display: flex; }
    .bk-pay-grid .panel { height: 420px; flex: none; }
    .bk-pane.fixed { overflow: visible; }
    .bk-pane.fixed > .bk-grow, .bk-grow { flex: none; height: 520px; }
    .bk-order-pane .bk-order-grid { grid-template-rows: auto; }
    .bk-delivery-card { flex: none; height: 520px; }
    .bk-order-pane .bk-order-side { overflow: visible; }
}
.bk-card-head > .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-tabs button { padding: 0 4px; }
@media (max-width: 1400px) {
    .bk-order-grid { grid-template-columns: minmax(0, 1fr) 250px; }
    .bk-trip-rows { --cols: 30px 108px minmax(0, 1fr) 58px auto !important; }
    .bk-trip-rows .bk-dots { display: none; }
    .bk-life li small { font-size: 9.5px; }
}

/* =====================================================================
   orders, expenses, purchases, batches, payments: round 3
   ===================================================================== */

/* choice cards (our vehicle / hired, who pays the transporter) */
.bk-choice { display: grid; gap: 8px; margin-bottom: 10px; }
.bk-choice.two { grid-template-columns: 1fr 1fr; }
.bk-choice > button { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 8px; align-items: center; padding: 9px 12px; border-radius: 12px;
    border: 1.5px solid var(--hairline-strong); background: #fff; font: inherit; text-align: left; cursor: pointer; color: var(--text-primary); }
.bk-choice > button > svg { grid-row: span 2; width: 18px; height: 18px; color: var(--text-muted); }
.bk-choice > button b { font-size: 12.5px; }
.bk-choice > button small { font-size: 10.5px; color: var(--text-muted); line-height: 1.3; }
.bk-choice > button:hover { border-color: var(--ocean-300); }
.bk-choice > button.on { border-color: var(--ocean-600); background: var(--glacier-50); box-shadow: 0 0 0 2px rgba(11, 106, 166, 0.14); }
.bk-choice > button.on > svg { color: var(--ocean-600); }
.bk-order-form .bk-hired { padding: 10px 12px 2px; margin-bottom: 10px; border-radius: 12px; background: var(--surface-sunken); border: 1px solid var(--hairline); }
.bk-order-form .bk-hired .form-grid { margin: 0 0 8px; }
.bk-sub-label { font-size: 11px; font-weight: 700; color: var(--text-secondary); margin: 2px 0 6px; }
.bk-order-form .form-grid.two { align-items: end; }
.bk-free { display: block; font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.bk-of-items tr.short [data-qty] { border-color: var(--status-critical); background: #fff6f6; }
.bk-short { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; padding: 9px 12px; border-radius: 12px; background: #fff7e6; border: 1px solid rgba(250, 178, 25, 0.5); color: #6b4700; }
.bk-short > svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.bk-short > div { display: flex; flex-direction: column; gap: 3px; }
.bk-short small { font-size: 11.5px; }
.bk-short .check-line { min-height: 0; padding: 4px 0 0; background: none; border: 0; font-size: 12px; }
.bk-bill .free b { color: var(--positive); }

/* the order's middle: tabs for delivery, payments and links */
.bk-tabbar { gap: 2px; border-bottom: 1px solid var(--hairline); margin: -4px -12px 4px; padding: 0 10px; min-height: 38px; }
.bk-tabbar > button[data-tab] { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border: 0; border-bottom: 2.5px solid transparent; background: none;
    font: inherit; font-size: 12.5px; font-weight: 650; color: var(--text-secondary); cursor: pointer; }
.bk-tabbar > button[data-tab] svg { width: 14px; height: 14px; }
.bk-tabbar > button[data-tab] i { font-style: normal; font-size: 10px; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--surface-sunken); color: var(--text-muted); text-align: center; }
.bk-tabbar > button[data-tab] i.due { background: #fdecea; color: var(--negative); }
.bk-tabbar > button[data-tab]:hover { color: var(--ocean-700); }
.bk-tabbar > button[data-tab].active { color: var(--ocean-700); border-bottom-color: var(--ocean-600); }
.bk-tabbar > button[data-tab].active i { background: var(--ocean-600); color: #fff; }
.bk-del-sub { margin: 0 0 -2px; }
.bk-tab-pane { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.bk-tab-pane > .bk-scroll { flex: 1 1 0; min-height: 0; overflow: auto; }
.bk-pay-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding: 10px 14px; border-radius: 12px; background: var(--surface-sunken); border: 1px solid var(--hairline); }
.bk-pay-sum > div { display: flex; flex-direction: column; }
.bk-pay-sum small { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.bk-pay-sum b { font-size: 16px; font-variant-numeric: tabular-nums; }
.bk-pay-sum b a { font-size: 13px; }
.bk-paid-bar.big { height: 7px; }
table.bk-paytable { width: 100%; }
table.bk-paytable td, table.bk-paytable th { padding: 7px 10px; font-size: 12.5px; vertical-align: middle; }
table.bk-paytable tr.claimed td { background: #fffaf0; }
.bk-linkcards { display: flex; flex-direction: column; gap: 8px; }
.bk-linkcard { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--hairline); background: #fff; }
.bk-linkcard.ACTIVE { border-left: 3px solid var(--status-good); }
.bk-linkcard.EXPIRED, .bk-linkcard.REVOKED { opacity: 0.65; background: var(--surface-sunken); }
.bk-lc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-secondary); }
.bk-lc-stats { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-secondary); }
.bk-lc-stats svg { width: 12px; height: 12px; vertical-align: -2px; margin-right: 3px; }
.bk-lc-url { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bk-lc-url input { flex: 1 1 260px; min-width: 0; height: 28px; font-size: 11.5px; }
.bk-loc { color: var(--positive) !important; font-weight: 650; }

/* proof of delivery */
.bk-evidence { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 12px; padding: 10px; border-radius: 12px; background: #f1faf4; border: 1px solid rgba(12, 163, 12, 0.22); }
.bk-ev-sign { display: flex; flex-direction: column; gap: 4px; }
.bk-ev-sign svg.bond-sign { width: 100%; height: 76px; background: #fff; border: 1px dashed #b7dcc4; border-radius: 8px; }
.bk-ev-sign small { font-size: 11px; color: var(--text-secondary); }
.bk-ev-facts { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.bk-ev-facts .mono { font-family: ui-monospace, Consolas, monospace; }

/* sending the bill */
.bk-sendbill { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bk-send-opt { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px;
    border: 1.5px solid var(--hairline-strong); background: #fff; font: inherit; text-align: left; cursor: pointer; }
.bk-send-opt > svg { grid-row: span 2; width: 20px; height: 20px; color: var(--ocean-600); }
.bk-send-opt b { font-size: 13px; } .bk-send-opt small { font-size: 11px; color: var(--text-muted); }
.bk-send-opt:hover:not(:disabled) { border-color: var(--ocean-400); background: var(--glacier-50); }
.bk-send-opt:disabled { opacity: 0.5; cursor: not-allowed; }
.bk-send-opt[data-send="whatsapp"] > svg { color: #128c4b; }
.bk-sendbill > p { grid-column: 1 / -1; margin: 0; }

/* splitting a trip */
.bk-split-form { display: flex; flex-direction: column; gap: 10px; }
.bk-split-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; align-items: end; }
.bk-split-part { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text-muted); }
.bk-split-part input { height: 32px; text-align: right; font-weight: 700; }
.bk-split-sum { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 650; }
.bk-split-bar { display: flex; gap: 3px; height: 22px; }
.bk-split-bar i { display: grid; place-items: center; min-width: 4px; border-radius: 5px; background: var(--ocean-500); color: #fff; font-style: normal; }
.bk-split-bar i:nth-child(even) { background: var(--ocean-400); }
.bk-split-bar small { font-size: 10px; font-weight: 700; overflow: hidden; white-space: nowrap; }

/* expenses: the form beside the list */
.bk-xp { display: grid; grid-template-columns: 330px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 10px; }
.bk-xp.readonly { grid-template-columns: minmax(0, 1fr); }
.bk-xp-card { min-height: 0; overflow: auto; }
.bk-xp-form { display: flex; flex-direction: column; gap: 8px; }
.bk-xp-form .field { margin: 0; }
.bk-xp-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 28px; }
.bk-xp-head b { font-size: 13.5px; }
.bk-xp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bk-xp-new { display: flex; gap: 6px; }
.bk-xp-new input { flex: 1; min-width: 0; height: 32px; }
.bk-xp-form .form-error:empty { display: none; }
.btn.block { width: 100%; justify-content: center; }

/* a batch opened */
.bk-batch { display: flex; flex-direction: column; gap: 12px; }
.bk-batch-figs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.bk-batch-figs > div { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--hairline); }
.bk-batch-figs small { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.bk-batch-figs b { font-size: 15px; font-variant-numeric: tabular-nums; }
.bk-batch-figs b em, .bk-batch-figs > div > em { font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--text-muted); }
.bk-batch-figs .bk-goodbar { margin-top: 3px; }
.bk-batch-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(220px, 0.9fr); gap: 16px; }
.bk-batch-grid > section { min-width: 0; }
.bk-batch-types { display: flex; flex-direction: column; gap: 8px; }
.bk-batch-types > div { display: flex; flex-direction: column; gap: 3px; }
.bk-bt-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.bk-bt-top em { font-style: normal; }
.bk-bt-bar { display: flex; height: 7px; border-radius: 4px; background: var(--surface-sunken); overflow: hidden; }
.bk-bt-bar em { display: block; height: 100%; background: var(--status-good); }
.bk-bt-bar em.lost { background: var(--status-critical); }
.bk-batch-types small { font-size: 10.5px; }
.bk-batch-grid small.block { display: block; font-size: 10px; }

/* the purchase dialog: one line a material */
.bk-buy-lines { display: flex; flex-direction: column; gap: 8px; }
.bk-buy-line { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1fr) 30px; gap: 8px; align-items: end; padding: 10px 10px 8px;
    border-radius: 12px; background: var(--surface-sunken); border: 1px solid var(--hairline); }
.bk-buy-line .field { margin: 0; }
.bk-buy-line [data-rm] { margin-bottom: 4px; }
.bk-buy-stock { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 11.5px; color: var(--text-secondary); }
.bk-buy-stock:empty { display: none; }
.bk-buy-stock b { color: var(--ocean-700); }
.bk-buy-stock i { font-style: normal; color: var(--text-muted); }
.bk-buy-stock small { font-size: 10.5px; color: var(--text-muted); }
.bk-buy-total { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; border-radius: 12px; background: var(--glacier-50); border: 1px solid var(--glacier-200); }
.bk-buy-total b { font-size: 18px; color: var(--ocean-700); font-variant-numeric: tabular-nums; }

/* payments: payday, paying everyone */
.bk-payday { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface-sunken); font-size: 11.5px; font-weight: 600; color: var(--text-secondary); }
.bk-payday svg { width: 12px; height: 12px; }
.bk-payday.today { background: #fff4d6; color: #7a4f00; }
.bk-payall { display: flex; flex-direction: column; gap: 10px; }
.bk-payall .form-grid { margin: 0; }
table.bk-payall-table { width: 100%; }
table.bk-payall-table td { vertical-align: middle; padding: 6px 8px; font-size: 12.5px; }
table.bk-payall-table tr.off td { opacity: 0.45; }
.bk-cut { width: 90px; height: 28px; text-align: right; }

@media (max-width: 1250px) {
    .bk-batch-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .bk-batch-grid > .bk-detail-side { grid-column: 1 / -1; }
    .bk-evidence { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
    .bk-xp { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
    .bk-xp > .panel { height: 520px; }
    .bk-batch-figs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .bk-choice.two, .bk-sendbill { grid-template-columns: minmax(0, 1fr); }
    .bk-batch-grid, .bk-batch-figs { grid-template-columns: minmax(0, 1fr); }
    .bk-buy-line { grid-template-columns: 1fr 1fr; }
    .bk-buy-line .field:first-child { grid-column: 1 / -1; }
}
.bk-of-items th:nth-child(2) { width: 104px; }
.bk-of-items [data-qty] { min-width: 88px; }
.bk-batch-grid h4 { display: flex; align-items: center; gap: 5px; margin: 0 0 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ocean-700); }
.bk-batch-grid h4 svg { width: 13px; height: 13px; }

/* ---- the order dialog: the batch dialog's frame (form left, what it comes to right) */
.modal.bk-order-modal { width: min(1240px, 96vw); }
.modal.bk-order-modal .modal-body { height: min(82vh, 860px); }
.bko { grid-template-columns: minmax(0, 1.7fr) minmax(290px, 1fr); }
.bko [hidden] { display: none !important; }
.bko .section-title { margin: 6px 0 -2px; }
.bko-grid { margin: 0; gap: 8px 10px; }
.bko-grid .field { margin: 0; min-width: 0; }
.bko-grid .field select, .bko-grid .field input { width: 100%; min-width: 0; }
.bko-grid .bko-wide { grid-column: 1 / -1; }
.bko .bk-choice { margin: 0; }
.bko-hired { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-sunken); border: 1px solid var(--hairline); }
.bko-hired .bk-sub-label { margin: 2px 0 0; }
.bko-items { table-layout: fixed; }
.bko-items th:nth-child(1) { width: auto; }
.bko-items th:nth-child(2) { width: 120px; }
.bko-items th:nth-child(3) { width: 140px; }
.bko-items th:nth-child(4) { width: 150px; }
.bko-items th:nth-child(5) { width: 40px; }
.bko-items td { vertical-align: top; padding-top: 6px; padding-bottom: 6px; }
.bko-items select { width: 100%; height: 32px; }
.bko-items input { width: 100%; height: 32px; text-align: right; }
.bko-items [data-qty] { font-weight: 700; font-size: 14px; }
.bko-items td.r > b { display: block; font-size: 13px; line-height: 32px; font-variant-numeric: tabular-nums; }
.bko-items .bk-free { display: block; margin-top: 3px; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bko-items tr.short [data-qty] { border-color: var(--status-critical); background: #fff6f6; }
.bko-charges { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 10px; align-items: end; }
.bko-charges .field { margin: 0; }
.bko-switches { display: flex; flex-direction: column; gap: 4px; }
.bko .check-line { min-height: 34px; padding: 5px 10px; font-size: 12.5px; gap: 8px; align-items: center; }
.bko .check-line small { font-size: 10.5px; }
.bko > .bkb-left > .field { margin: 0; }
.bko-ok { display: flex; align-items: center; gap: 6px; color: var(--positive); font-weight: 650; font-size: 12.5px; }
.bko-ok svg { width: 16px; height: 16px; }
.bko-short { display: flex; flex-direction: column; gap: 6px; }
.bko-short > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; padding: 6px 8px; border-radius: 8px; background: #fff6f6; border: 1px solid #f3c9c9; font-size: 12px; }
.bko-short > div span { grid-column: 1; font-size: 11px; color: var(--text-secondary); }
.bko-short > div em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-weight: 700; color: var(--negative); }
.bko-short .check-line { min-height: 0; padding: 6px 8px; background: #fff; align-items: flex-start; }
.bko-short .check-line input { margin-top: 2px; }
.bko-bill { margin: 0; padding: 0; background: none; }
.bko-bill .total b { font-size: 18px; color: var(--ocean-700); }
.bko .bk-trip-dots span { padding: 3px 5px; }
@media (max-width: 1100px) {
    .bko { grid-template-columns: minmax(0, 1fr); }
    .bko-charges { grid-template-columns: minmax(0, 1fr); }
    .bko-items th:nth-child(3), .bko-items th:nth-child(4) { width: 110px; }
}
.bko-charges { grid-template-columns: 210px minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
.bko .bko-switch { height: 100%; min-height: 48px; margin: 0; }
.bko .bko-switch > span { display: flex; flex-direction: column; line-height: 1.25; }
.bko .bko-switch b { font-size: 12.5px; font-weight: 600; }
@media (max-width: 1100px) { .bko-charges { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================
   dense forms (order, purchase, expense): a small label above a slim box
   ===================================================================== */
.bk-dense .field { gap: 3px; margin: 0; min-width: 0; }
.bk-dense .field > span:first-child { font-size: 10.5px; font-weight: 650; letter-spacing: 0.01em; text-transform: none; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-dense .field:focus-within > span:first-child { color: var(--ocean-600); }
.bk-dense input:not([type=checkbox], [type=radio], [type=hidden]), .bk-dense select, .bk-dense .combo-display, .bk-dense .dp-wrap > input {
    height: 30px; min-height: 30px; padding: 0 8px; font-size: 12.5px; font-weight: 500; border-radius: 8px; width: 100%; }
.bk-dense select { padding-right: 22px; }
.bk-dense .dp-wrap { width: 100%; }
.bk-dense .dp-wrap > input { padding-right: 28px; }
.bk-dense input::placeholder { color: #a7b8c7; font-weight: 400; }
.bk-dense .combo-display { gap: 6px; }
.bk-dense .check-line { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.bk-dense .section-title { font-size: 10.5px; margin: 4px 0 -2px; }
.bk-dense .section-title small { font-size: 10px; }
.bk-dense .bkb-table input { height: 28px; }
.bk-dense .bk-unit-in { gap: 4px; }
.bk-dense .bk-unit-in em { font-size: 10.5px; min-width: 22px; }

/* the grids of the dense forms */
.bko-grid.bko-cols4, .bko-grid.bko-cols3 { display: grid; gap: 8px 10px; }
.bko-cols4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bko-cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bko-span2 { grid-column: span 2; }
.bko-span3 { grid-column: span 3; }
.bko.bk-dense .bk-choice > button { padding: 6px 10px; }
.bko.bk-dense .bk-choice > button small { font-size: 10px; }
.bko.bk-dense .bko-hired { padding: 8px 10px; gap: 6px; }
.bko.bk-dense .bkb-left { gap: 8px; }
.bko.bk-dense .bko-charges { grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1fr); }
.bko.bk-dense .bko-switch { min-height: 30px; }
.bko.bk-dense .bko-switch small { display: none; }
.bko.bk-dense .bko-items select { height: 28px; font-size: 12.5px; }
.bko.bk-dense .bko-items td { padding-top: 4px; padding-bottom: 4px; }
.bko.bk-dense .bko-items td.r > b { line-height: 28px; font-size: 12.5px; }

/* suggestions under a box (customers, vendors) */
.bk-sug { position: fixed; z-index: 500; max-height: 260px; overflow: auto; padding: 3px; border-radius: 10px; background: #fff; border: 1px solid var(--hairline-strong);
    box-shadow: 0 12px 30px rgba(6, 32, 56, 0.18); font-size: 12px; animation: pop-in 0.1s ease-out; }
.bk-sug-item { display: flex; flex-direction: column; gap: 0; padding: 4px 8px; border-radius: 7px; cursor: pointer; line-height: 1.3; }
.bk-sug-item b { font-size: 12px; font-weight: 600; }
.bk-sug-item small { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-sug-item:hover, .bk-sug-item.active { background: var(--surface-selected); }

/* the app's own suggestion and search popups: a size that fits more in view */
.ac-pop { font-size: 12px; }
.ac-pop .ac-item { padding: 4px 8px; }
.ac-pop .ac-sub, .ac-pop .ac-meta { font-size: 10.5px; }
.ac-pop .ac-meta b { font-size: 11.5px; }
.ac-pop .ac-search input { height: 24px; font-size: 12px; }
.ac-pop .ac-group { font-size: 9.5px; }

/* the purchase dialog */
.modal.bk-buy-modal { width: min(1120px, 96vw); }
.bkp { grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); }
.bkp [hidden] { display: none !important; }
.bkp .bkb-left { gap: 8px; }
.bkp-lines { table-layout: fixed; }
.bkp-lines th:nth-child(2) { width: 120px; } .bkp-lines th:nth-child(3) { width: 110px; } .bkp-lines th:nth-child(4) { width: 120px; } .bkp-lines th:nth-child(5) { width: 34px; }
.bkp-lines td { vertical-align: top; padding-top: 4px; padding-bottom: 4px; }
.bkp-lines select { width: 100%; }
.bkp-lines input { text-align: right; }
.bkp-lines .bk-free { display: block; margin-top: 2px; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bkp-stock { display: flex; flex-direction: column; gap: 8px; }
.bkp-stock > div { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.bkp-stock .bk-meter { margin: 0; height: 5px; }
.bkp-stock small { font-size: 10.5px; }
.bkp-hist { display: flex; flex-direction: column; gap: 6px; }
.bkp-hist > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; font-size: 11.5px; padding-bottom: 5px; border-bottom: 1px dotted var(--hairline); }
.bkp-hist > div:last-child { border-bottom: 0; }
.bkp-hist small { grid-column: 1 / -1; font-size: 10.5px; }

/* expenses: the form, the bills, the insights */
.bk-xp { grid-template-columns: 290px minmax(0, 1fr) 270px; }
.bk-xp.readonly { grid-template-columns: minmax(0, 1fr) 270px; }
.bk-xp-form { gap: 7px; }
.bk-xp-form .bk-xp-row { gap: 8px; }
.bk-xp .bk-side-stats { min-height: 0; overflow: auto; }
.bk-headlist { display: flex; flex-direction: column; gap: 3px; }
.bk-headlist button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; padding: 5px 8px; border-radius: 8px; border: 1px solid transparent; background: none;
    font: inherit; font-size: 12px; text-align: left; cursor: pointer; color: var(--text-primary); }
.bk-headlist button:hover { background: var(--surface-hover); }
.bk-headlist button.on { background: var(--surface-selected); border-color: rgba(11, 124, 189, 0.3); }
.bk-headlist button b { font-variant-numeric: tabular-nums; }
.bk-headlist button i { grid-column: 1 / -1; height: 4px; border-radius: 3px; background: var(--surface-sunken); overflow: hidden; }
.bk-headlist button i em { display: block; height: 100%; background: var(--ocean-500); }
.bk-headlist button small { grid-column: 1 / -1; font-size: 10px; color: var(--text-muted); }

/* raw material: the summary on the right */
.bk-threepane { grid-template-columns: 270px minmax(0, 1fr) 290px; }
.bk-threepane > .bk-side-stats { min-height: 0; overflow: auto; }
.bk-avail { display: flex; align-items: baseline; gap: 6px; }
.bk-avail b { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ocean-700); }
.bk-avail span { font-size: 12px; color: var(--text-muted); }
.bk-avail em { margin-left: auto; font-style: normal; }
.bk-side-stats .bk-meter { margin: 2px 0; }
.bk-side-stats .btn.block { margin-top: 4px; }

@media (max-width: 1400px) {
    .bk-xp { grid-template-columns: 280px minmax(0, 1fr); }
    .bk-xp > .bk-side-stats { display: none; }
    .bk-threepane { grid-template-columns: 240px minmax(0, 1fr) 260px; }
}
@media (max-width: 1250px) {
    .bk-threepane { grid-template-columns: 230px minmax(0, 1fr); }
    .bk-threepane > .bk-side-stats { display: none; }
}
@media (max-width: 1100px) {
    .bko-cols4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bko-cols3 { grid-template-columns: minmax(0, 1fr); }
    .bko-span2, .bko-span3 { grid-column: 1 / -1; }
    .bkp { grid-template-columns: minmax(0, 1fr); }
    .bk-threepane { grid-template-columns: minmax(0, 1fr); }
}
.bk-dense select { appearance: none; -webkit-appearance: none; cursor: pointer; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%235b7a93' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center; font-weight: 500; }

/* =====================================================================
   compact dialogs (order, purchase): the app's own boxes (the label inside)
   and its rich dropdowns, only shorter
   ===================================================================== */
.modal .bk-compact .field:not(.hc-fit .field) > input:not([type=checkbox], [type=radio], [type=range], [type=file], [type=color], [type=hidden]),
.modal .bk-compact .field:not(.hc-fit .field) > select,
.modal .bk-compact .field:not(.hc-fit .field) > .dp-wrap > input,
.modal .bk-compact .field:not(.hc-fit .field) > .combo > .combo-display {
    height: 40px; min-height: 40px; padding: 16px 10px 3px; border-radius: 9px; font-size: 13px;
}
.modal .bk-compact .field:not(.hc-fit .field) > .dp-wrap > input { padding-right: 30px; }
.modal .bk-compact .field:not(.hc-fit .field) > .dp-wrap > .dp-btn { bottom: 5px; right: 6px; }
.modal .bk-compact .field:not(.hc-fit .field) > .combo > .combo-display { padding: 15px 8px 2px 10px; gap: 6px; }
.modal .bk-compact .field:not(.hc-fit .field) > .combo > .combo-display > svg { margin-top: -12px; }
.modal .bk-compact .field:not(.hc-fit .field) > .combo .combo-label { font-size: 13px; }
.modal .bk-compact .field:not(.hc-fit .field) > .combo .combo-placeholder { font-size: 12.5px; padding-left: 0; }
.modal .bk-compact .field > span:first-child:not(.dp-wrap) { top: 4px !important; left: 11px !important; font-size: 9.5px !important; }
.modal .bk-compact .field > span:first-child em { font-style: normal; color: var(--negative); }
.modal .bk-compact .field > span:first-child em[hidden] { display: none; }
.modal .bk-compact .field { gap: 0; margin: 0; }
.modal .bk-compact .bko-grid, .modal .bk-compact .bko-cols3, .modal .bk-compact .bko-cols4 { gap: 8px; }
.modal .bk-compact .check-line { min-height: 40px; padding: 4px 10px; font-size: 12.5px; }
.modal .bk-compact .bko-switch > span { display: flex; flex-direction: column; line-height: 1.2; }
.modal .bk-compact .bko-switch b { font-size: 12px; font-weight: 600; }
.modal .bk-compact .bko-switch small { font-size: 10px; display: block !important; }
.modal .bk-compact .field input:disabled { background: var(--surface-sunken); color: var(--text-muted); cursor: not-allowed; }
.modal .bk-compact .section-title { margin: 4px 0 -2px; font-size: 10.5px; }
.modal .bk-compact .bk-choice > button { padding: 6px 10px; }
.modal .bk-compact .bk-choice > button small { font-size: 10px; }
.modal .bk-compact .bkb-left { gap: 8px; }
.modal .bk-compact .bko-hired { padding: 8px 10px; gap: 6px; }
.modal .bk-compact .bko-charges { grid-template-columns: 190px minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }

/* the rich dropdown inside a table row (brick types, materials): one line high, the detail beside its name */
.modal .bk-compact .bko-items .combo-display, .modal .bk-compact .bkp-lines .combo-display { height: 32px; border-radius: 8px; padding: 0 8px; font-size: 12.5px; }
.modal .bk-compact .bko-items .combo-label, .modal .bk-compact .bkp-lines .combo-label { font-size: 12.5px; }
.modal .bk-compact .bko-items input, .modal .bk-compact .bkp-lines input { height: 32px; border-radius: 8px; font-size: 12.5px; }
.modal .bk-compact .bko-items [data-qty], .modal .bk-compact .bkp-lines [data-qty] { font-weight: 700; }
.modal .bk-compact .bko-items td.r > b { line-height: 32px; }

/* suggestions in the app's pop-up style, small */
.ac-pop.bk-sug { z-index: 500; max-height: 300px; font-size: 12px; min-width: 260px; }
.ac-pop.bk-sug .ac-head { padding: 4px 9px; font-size: 9.5px; }
.ac-pop.bk-sug .ac-head svg { width: 11px; height: 11px; }
.ac-pop.bk-sug .ac-item { padding: 4px 7px; }
.ac-pop.bk-sug .ac-row { gap: 7px; }
.ac-pop.bk-sug .chip-icon.sm { width: 22px; height: 22px; }
.ac-pop.bk-sug .ac-label { font-size: 12px; }
.ac-pop.bk-sug .ac-sub { font-size: 10.5px; }
.ac-pop.bk-sug .ac-meta { font-size: 10px; gap: 0; }
.ac-pop.bk-sug .ac-meta b { font-size: 11px; }

@media (max-width: 1100px) {
    .modal .bk-compact .bko-charges { grid-template-columns: minmax(0, 1fr); }
}

/* ---- the order dialog: each part on a thin tint of its own, white boxes on it */
.bko .bkb-left { gap: 10px; }
.bko-sec { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; border-radius: 12px; border: 1px solid; flex-shrink: 0; }
.bko-sec.s-customer { background: #f3f8fd; border-color: #dceaf6; }
.bko-sec.s-bricks { background: #f4faf6; border-color: #d9eee0; }
.bko-sec.s-delivery { background: #f7f5fd; border-color: #e3defa; }
.bko-sec.s-charges { background: #fdf9f1; border-color: #f1e5c9; }
.bko-sec-h { display: flex; align-items: baseline; gap: 6px; min-height: 18px; }
.bko-sec-h > svg { width: 13px; height: 13px; align-self: center; }
.s-customer .bko-sec-h > svg { color: var(--ocean-600); }
.s-bricks .bko-sec-h > svg { color: #1d8a4e; }
.s-delivery .bko-sec-h > svg { color: #5b4fc9; }
.s-charges .bko-sec-h > svg { color: #a3700d; }
.bko-sec-h b { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-primary); }
.bko-sec-h small { font-size: 10.5px; color: var(--text-muted); }
.bko-sec-h .link-btn { margin-left: auto; font-size: 11.5px; }
.modal .bko-sec .field:not(.hc-fit .field) > input:not([type=checkbox], [type=radio], [type=hidden]),
.modal .bko-sec .field:not(.hc-fit .field) > .dp-wrap > input,
.modal .bko-sec .field:not(.hc-fit .field) > .combo > .combo-display { background: #fff; box-shadow: 0 1px 1px rgba(16, 52, 84, 0.04); }
.modal .bko-sec .check-line { background: #fff; border-style: solid; border-color: var(--hairline); }
.modal .bko-sec .bk-choice > button { background: #fff; }
.modal .bko-sec .bk-choice > button.on { background: var(--glacier-50); }
.modal .bko-sec .bko-hired { background: rgba(255, 255, 255, 0.6); }

/* the bricks table, lined up: headers over their boxes, figures to the right */
.bko-sec .bko-items { background: transparent; }
.bko-sec .bko-items thead th { background: transparent; border-bottom: 1px solid #d9eee0; padding: 2px 6px 4px; font-size: 9.5px; color: var(--text-muted); }
.bko-sec .bko-items thead th:nth-child(2), .bko-sec .bko-items thead th:nth-child(3) { text-align: right; padding-right: 10px; }
.bko-sec .bko-items td { padding: 5px 6px; border-bottom: 1px dashed #d9eee0; vertical-align: top; }
.bko-sec .bko-items tr:last-child td { border-bottom: 0; }
.bko-sec .bko-items td:nth-child(3) .bk-free { text-align: right; padding-right: 2px; }
.bko-sec .bko-items td.r { padding-right: 4px; }
.bko-sec .bko-items td.r .bk-free { text-align: right; }
.bko-sec .bko-items td:last-child { text-align: center; }
.bko-sec .bko-items td:last-child .btn { margin-top: 2px; }
.modal .bk-compact .bko-sec .bko-items input { background: #fff; }

/* charges: the box and the two switches the same height, in a row */
.modal .bk-compact .bko-sec .bko-charges { grid-template-columns: 190px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: stretch; }
.modal .bk-compact .bko-sec .bko-switch { min-height: 40px; height: 40px; padding: 0 10px; border-radius: 9px; }
.modal .bk-compact .bko-sec .bko-cols4 { align-items: stretch; }

/* ---- proof of delivery, compact */
.bk-ev { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 10px; border-radius: 10px;
    background: #f3faf5; border: 1px solid rgba(12, 163, 12, 0.22); }
.bk-ev-sig { display: flex; flex-direction: column; gap: 3px; }
.bk-ev-sig svg.bond-sign { width: 100%; height: 56px; background: #fff; border: 1px dashed #b7dcc4; border-radius: 8px; }
.bk-ev-sig small { font-size: 10.5px; color: var(--text-secondary); }
.bk-ev-list { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.bk-ev-list > div { min-width: 0; }
.bk-ev-list dt { display: flex; align-items: center; gap: 4px; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.bk-ev-list dt svg { width: 11px; height: 11px; color: #1d8a4e; }
.bk-ev-list dd { margin: 1px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 12px; font-weight: 600; min-width: 0; }
.bk-ev-list dd small { font-size: 10.5px; font-weight: 500; color: var(--text-muted); width: 100%; }
.bk-ev-list .mono { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; }
.bk-ev-list .bk-ev-copy { width: 20px; height: 20px; }
.bk-ev-list .bk-ev-copy svg { width: 11px; height: 11px; }
.bk-ev-list .bd-ok, .bk-ev-list .bd-bad { font-size: 12px; }
@media (max-width: 1250px) { .bk-ev { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1100px) { .modal .bk-compact .bko-sec .bko-charges { grid-template-columns: minmax(0, 1fr); } }

/* ---- tinted dialogs (order, purchase, batch): sections on thin tints, white boxes on them */
.modal.bk-tinted .modal-body { background: #fbfcfe; }
.modal.bk-tinted .bkb-right { background: #f5f7fa; }
.bko-cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bko-cols2 .bko-span2 { grid-column: 1 / -1; }
.modal .bk-compact .bko-sec .field > input:not([type=checkbox], [type=radio], [type=hidden]) { background: #fff; }

/* the order: delivery on the right, beside the bricks */
.modal.bk-order-modal { width: min(1320px, 97vw); }
.bko { grid-template-columns: minmax(0, 1.25fr) minmax(380px, 1fr); }
.bko-right { gap: 8px; }
.bko-right > .bko-sec { padding: 9px 10px 10px; }
.bko-right .bk-choice > button { padding: 6px 8px; grid-template-columns: 18px minmax(0, 1fr); column-gap: 6px; }
.bko-right .bk-choice > button small { font-size: 9.5px; }
.bko-right .bk-choice > button > svg { width: 15px; height: 15px; }
.bko-right .bko-hired { padding: 8px; gap: 6px; }
.bko-right .bko-switch small { display: none !important; }
.bko-right .hc-pr-card { flex-shrink: 0; }
.modal .bk-compact .bko-right .bko-switch { height: 40px; min-height: 40px; }

/* the purchase: the lines lined up as the order's bricks */
.bkp-lines.bko-items thead th:nth-child(2), .bkp-lines.bko-items thead th:nth-child(3), .bkp-lines.bko-items thead th:nth-child(4) { text-align: right; padding-right: 10px; }
.bkp-lines td:nth-child(2) .bk-unit-in { display: flex; align-items: center; gap: 4px; }
.bkp-lines td:nth-child(2) .bk-unit-in input { flex: 1; }
.bkp-lines td:nth-child(2) .bk-unit-in em { flex: none; min-width: 26px; font-size: 10.5px; font-style: normal; color: var(--text-muted); }
.bkp-lines td:nth-child(3) .bk-free { text-align: right; }
.bkp-lines th:nth-child(2) { width: 130px; } .bkp-lines th:nth-child(3) { width: 120px; } .bkp-lines th:nth-child(4) { width: 130px; }
.modal .bk-compact .bkp-lines input { background: #fff; }

/* the batch: its tables on the tint */
.bkb-tint .bko-sec .bkb-table { background: transparent; }
.bkb-tint .bko-sec .bkb-table thead th { background: transparent; padding: 2px 6px 4px; font-size: 9.5px; color: var(--text-muted); border-bottom: 1px solid rgba(0, 0, 0, 0.07); }
.bkb-tint .bko-sec .bkb-table td { border-bottom: 1px dashed rgba(0, 0, 0, 0.07); }
.bkb-tint .bko-sec .bkb-table tr:last-child td { border-bottom: 0; }
.bkb-tint .bko-sec .bkb-table input { background: #fff; height: 30px; border-radius: 8px; font-size: 12.5px; }
.bkb-tint .bko-sec .bkb-table [data-qty] { font-size: 13px; }
.bkb-tint .bkb-types-t th:nth-child(2), .bkb-tint .bkb-types-t th:nth-child(3) { text-align: left; padding-left: 8px; }
.bkb-tint .bko-sec > .field { margin: 0; }

/* ---- a batch opened: a slim strip of figures, then three tinted parts */
.bk-bfigs { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-bfigs > div { display: flex; align-items: baseline; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; background: #fff; border: 1px solid var(--hairline); align-items: center; }
.bk-bfigs span { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.bk-bfigs b { font-size: 13px; font-variant-numeric: tabular-nums; }
.bk-bfigs em { font-style: normal; font-size: 10.5px; color: var(--text-muted); }
.bk-bfigs .good b { color: var(--positive); }
.bk-bfigs .warn b, .bk-bfigs .warn em { color: #a35a00; }
.bk-batch { gap: 8px; }
.bk-batch-grid { gap: 8px; }
.bk-bsec { padding: 8px 10px; border-radius: 10px; border: 1px solid; min-width: 0; }
.bk-bsec.s-bricks { background: #f4faf6; border-color: #d9eee0; }
.bk-bsec.s-mat { background: #f7f5fd; border-color: #e3defa; }
.bk-bsec.s-team { background: #f3f8fd; border-color: #dceaf6; }
.bk-bsec h4 { margin: 0 0 6px !important; }
.bk-bsec .bk-btable { background: transparent; }
.bk-bsec .bk-btable th { background: transparent; font-size: 9.5px; padding: 2px 6px; }
.bk-bsec .bk-btable td { padding: 4px 6px; background: transparent; }
.bk-bsec .bk-btable td small { display: block; font-size: 10px; }
.bk-bsec .bk-btable td small.inline { display: inline; }
.bk-bsec .bk-btable tfoot td { border-top: 1px solid rgba(0, 0, 0, 0.1); }
.bk-bsec .bk-trip-acts { margin-top: 6px; }
@media (max-width: 1100px) {
    .bko { grid-template-columns: minmax(0, 1fr); }
}
.bk-batch-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) !important; }
.bk-batch-grid > .bk-bsec.s-team { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.bk-bsec.s-team h4 { margin: 0 !important; }
.bk-bsec.s-team .bk-crew { flex: 1; grid-template-columns: repeat(auto-fit, minmax(140px, auto)); gap: 4px 18px; }
.bk-bsec.s-team .bk-crew > div.wide { grid-column: auto; }
.bk-bsec.s-team .bk-trip-acts { margin: 0; }
.bk-bsec .bk-btable td:first-child { white-space: nowrap; }
.bk-bsec .bk-btable { width: 100%; }
.bk-stock-issue { background: #fff4e5; border-color: #f5c58a; color: #7a4a00; }
.bk-stock-issue > div { flex: 1; }
.bk-stock-issue a, .bk-stock-issue b { color: #7a4a00; }

/* ---- production expenses: the list beside its figures; the dialog picks a head from tiles */
.bk-xpv { display: grid; grid-template-columns: minmax(0, 1fr) 290px; grid-template-rows: minmax(0, 1fr); gap: 10px; }
.bk-xpv .bk-side-stats { min-height: 0; overflow: auto; }
.chip-icon.xs { width: 20px; height: 20px; border-radius: 6px; flex: none; }
.chip-icon.xs svg { width: 11px; height: 11px; }
.bkx-hc { display: flex; align-items: center; gap: 7px; min-width: 0; }
.bkx-what, .bkx-tags { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bkx-what small, .bkx-tags small { font-size: 10.5px; }
.bkx-tags .badge { align-self: flex-start; gap: 3px; }
.bkx-tags .badge svg { width: 11px; height: 11px; }
.bk-xpv .bk-empty .btn { margin-top: 8px; }
.modal.bk-xp-modal { width: min(1080px, 96vw); }
.bkx-heads { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 6px; }
.bkx-head { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--hairline); background: #fff;
    text-align: left; cursor: pointer; font: inherit; color: inherit; transition: border-color .12s, box-shadow .12s, background .12s; }
.bkx-head > span.min-0 { display: flex; flex-direction: column; min-width: 0; }
.bkx-head b { font-size: 12.5px; }
.bkx-head small { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bkx-head:hover { border-color: var(--hairline-strong); box-shadow: 0 1px 4px rgba(0, 0, 0, .06); }
.bkx-head.on { border-color: var(--ocean-500, #2d6cdf); background: var(--glacier-50, #f2f7ff); box-shadow: 0 0 0 2px rgba(45, 108, 223, .14); }
.bkx-head.on b { color: var(--ocean-700, #1d4fa8); }
.bkx-head.add { border-style: dashed; background: transparent; }
.bkx-newhead { display: flex; gap: 6px; margin-top: 8px; }
.bkx-newhead input { flex: 1; min-width: 0; height: 32px; border-radius: 8px; background: #fff; }
.bkx-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 8px; }
.bkx-quick [data-quick] { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.bkx-quick .seg-chip { height: 24px; padding: 0 9px; font-size: 11.5px; }
.bkx-quick .spacer { flex: 1; }
.bko-grid .bko-span4 { grid-column: 1 / -1; }
.bkx-so .bk-kv b small { font-weight: 500; }
.bkx-so > small { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 11px; }
.bkx-so > small svg { width: 12px; height: 12px; }
.bkx-hist .bkx-repeat { cursor: pointer; border-radius: 6px; padding: 3px 5px; margin: 0 -5px; }
.bkx-hist .bkx-repeat:hover { background: #fff; }
.bkx .hc-pr-title small { margin-left: auto; font-size: 10px; font-weight: 500; }
@media (max-width: 1100px) {
    .bk-xpv { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
    .bk-xpv > .panel { height: 560px; }
}
.bkx-quick .seg-chip { border: 1px solid var(--hairline); background: #fff; border-radius: 999px; font-variant-numeric: tabular-nums; }
.bkx-quick .seg-chip.active { border-color: var(--ocean-500, #2d6cdf); background: var(--glacier-50, #f2f7ff); }
.modal.bk-xp-modal .modal-body { height: auto; max-height: min(80vh, 820px); }
/* many heads: a search in the section's heading, the tiles scroll */
.bkx .bko-sec-h .bkx-hsearch { margin-left: auto; width: 200px; height: 28px; background: #fff; }
.bkx .bko-sec-h .bkx-hsearch input { font-size: 12px; }
.bkx-heads.many { max-height: 158px; overflow: auto; padding: 2px 4px 2px 2px; scrollbar-gutter: stable; }
.bkx-head[hidden] { display: none !important; }
.bkx-nohead { grid-column: 1 / -1; margin: 4px 2px; }
.bkx-nohead[hidden] { display: none; }

/* ---- list headings, lined up with the rows; they stay on top while the list scrolls */
.bk-rows-head { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 16px var(--cols); gap: 10px; align-items: center; min-height: 26px; padding: 0 10px;
    background: #f4f7fa; border-bottom: 1px solid var(--hairline); font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.bk-rows-head > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-rows-head > .r { text-align: right; }
/* slim rows: more on the screen */
.bk-slim .bk-line { min-height: 30px; padding: 1px 10px; font-size: 12px; }
.bk-slim .bk-line .chip-icon.sm { width: 20px; height: 20px; }
.bk-slim .bk-line > span > small { font-size: 10px; }

/* ---- a row opened: a heading strip, the facts in a neat grid, and the journal entry beside them */
.bk-detail:has(> .bk-peek) { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 10px 14px; align-items: start; padding: 10px 14px 12px 34px; }
.bk-detail:has(> .bk-peek) > .inline-loading, .bk-detail:has(> .bk-peek) > .bk-jp, .bk-detail:has(> .bk-peek) > .bk-slip-lines { grid-column: 2; }
.bk-detail:has(> .bk-peek) > .bk-peek { grid-row: span 3; }
.bk-peek { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 8px 10px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--hairline); }
.bk-peek-h { display: flex; align-items: center; gap: 7px; min-width: 0; padding-bottom: 6px; border-bottom: 1px dashed var(--hairline); font-size: 12.5px; }
.bk-peek-h > svg { width: 14px; height: 14px; color: var(--ocean-600); flex: none; }
.bk-peek-h .muted { font-size: 11px; }
.bk-peek-h .spacer { flex: 1; }
.bk-peek-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px 14px; margin: 0; }
.bk-facts > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bk-facts > div.wide { grid-column: 1 / -1; }
.bk-facts dt { font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #8a97a5; }
.bk-facts dd { margin: 0; font-size: 12px; color: var(--text-primary); overflow-wrap: anywhere; }
.bk-facts dd small { font-size: 10.5px; color: var(--text-muted); }
.bk-quote { font-style: italic; color: var(--text-secondary); }
/* the journal entry behind it */
.bk-jp { min-width: 0; padding: 8px 10px; border-radius: 10px; background: #f7f9fc; border: 1px solid #e3e9f0; font-size: 11.5px; }
.bk-jp.none { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-style: italic; }
.bk-jp svg { width: 13px; height: 13px; }
.bk-jp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.bk-jp-head > svg { color: var(--ocean-600); }
.bk-jp-head b { font-size: 12px; color: var(--ocean-800); }
.bk-jp-type { padding: 1px 7px; border-radius: 999px; background: #e7eef6; color: var(--ocean-700); font-size: 10px; font-weight: 600; }
.bk-jp-head .muted { font-size: 10.5px; }
.bk-jp-t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.bk-jp-t th { font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #8a97a5; text-align: left; padding: 3px 6px; border-bottom: 1px solid #e3e9f0; }
.bk-jp-t td { padding: 4px 6px; border-bottom: 1px dotted #e3e9f0; vertical-align: top; }
.bk-jp-t td small { display: block; font-size: 10px; color: var(--text-muted); }
.bk-jp-t .r { text-align: right; white-space: nowrap; }
.bk-jp-t td > span.dr, .bk-jp-t td > span.cr { display: inline-block; width: 20px; margin-right: 5px; font-size: 9px; font-weight: 700; text-align: center; border-radius: 4px; }
.bk-jp-t td > span.dr { background: #e6f4ec; color: #1d6b3a; }
.bk-jp-t td > span.cr { background: #fdeceb; color: #a11b1b; }
.bk-jp-t tfoot td { border-bottom: 0; border-top: 1px solid #d6dee8; font-weight: 700; font-size: 11px; }
.bk-jp-narr { margin: 6px 0 0; font-size: 11px; color: var(--text-secondary); font-style: italic; }
.bk-jp-foot { display: block; margin-top: 5px; font-size: 10px; color: #8a97a5; }
.bk-detail:has(> .bk-peek) > .bk-slip-lines { padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--hairline); }
.bk-pay-rows .bk-line .badge { white-space: nowrap; }
@media (max-width: 1100px) {
    .bk-detail:has(> .bk-peek) { grid-template-columns: minmax(0, 1fr); padding-left: 14px; }
    .bk-detail:has(> .bk-peek) > * { grid-column: 1 !important; }
}

/* ---- sales & delivery: a shorter delivery life cycle, compact tabs */
.bk-life { padding: 6px 10px 5px; border-radius: 10px; }
.bk-life ol::before { top: 10px; }
.bk-life li { flex-direction: column; gap: 2px; }
.bk-life-dot { width: 22px; height: 22px; border-width: 1.5px; }
.bk-life-dot svg { width: 11px; height: 11px; }
.bk-life li b { font-size: 10.5px; line-height: 1.2; }
.bk-life li small { font-size: 9.5px; line-height: 1.15; }
.bk-life-bar { height: 4px; margin-top: 5px; }
.bk-life-foot { margin-top: 2px; font-size: 10.5px; }
.bk-tabbar { gap: 4px; min-height: 34px; padding: 4px 10px; align-items: center; }
.bk-tabbar > button[data-tab] { height: 26px; padding: 0 9px; gap: 5px; font-size: 12px; border-radius: 8px; border-bottom: 0; }
.bk-tabbar > button[data-tab] svg { width: 13px; height: 13px; }
.bk-tabbar > button[data-tab] i { font-size: 9.5px; min-width: 16px; padding: 0 4px; line-height: 15px; }
.bk-tabbar > button[data-tab]:hover { background: var(--surface-hover); }
.bk-tabbar > button[data-tab].active { background: #e8f1fa; color: var(--ocean-700); box-shadow: inset 0 0 0 1px #c9dcf0; }
.bk-tabbar .btn.sm { height: 26px; }
/* an opened row lays out by the room its list has: side by side when wide, one under the other when narrow */
.bk-scroll { container-type: inline-size; }
@container (max-width: 820px) {
    .bk-detail:has(> .bk-peek) { grid-template-columns: minmax(0, 1fr); padding-left: 14px; }
    .bk-detail:has(> .bk-peek) > * { grid-column: 1 !important; grid-row: auto !important; }
}
.bk-peek-h .muted { white-space: nowrap; }
.bk-peek-h b { white-space: nowrap; }
.bk-jp-t td:first-child { min-width: 150px; }
.bk-jp-t td small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.bk-detail:has(> .bk-peek) > .bk-slip-lines table { font-size: 11.5px; }
.bk-detail:has(> .bk-peek) > .bk-slip-lines td small { display: block; font-size: 10px; }

/* ---- maker-checker: the role, the count of what waits, the bell and its notices */
.bk-role-chip { display: inline-flex; align-items: center; gap: 5px; margin: 0 10px 6px; padding: 2px 9px 2px 7px; border-radius: 999px; background: #eef3f9; color: var(--ocean-700);
    font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; }
.bk-role-chip svg { width: 12px; height: 12px; }
.bk-nav-count { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #f59e0b; color: #fff; font-size: 11px; font-weight: 700;
    display: inline-grid; place-items: center; align-self: center; }
.bk-bell { position: relative; }
.bk-bell > i { position: absolute; top: -3px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #e5484d; color: #fff;
    font: 700 9.5px/16px system-ui, sans-serif; font-style: normal; text-align: center; box-shadow: 0 0 0 2px #fff; }
.bk-bell-pop { position: fixed; z-index: 1200; width: 370px; max-height: 70vh; display: flex; flex-direction: column; border-radius: 14px; background: #fff;
    border: 1px solid var(--hairline); box-shadow: 0 18px 50px rgba(10, 30, 60, .22); overflow: hidden; }
.bk-bell-h { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--hairline); font-size: 12.5px; }
.bk-bell-h b { display: inline-flex; align-items: center; gap: 6px; }
.bk-bell-h svg { width: 14px; height: 14px; }
.bk-bell-h .spacer { flex: 1; }
.bk-bell-list { overflow: auto; padding: 4px; }
.bk-bell-empty { padding: 14px; }
.bk-note { display: flex; gap: 9px; align-items: flex-start; width: 100%; padding: 8px 9px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.bk-note:hover:not([disabled]) { background: var(--surface-hover); }
.bk-note[disabled] { cursor: default; }
.bk-note > span.grow { display: flex; flex-direction: column; gap: 1px; }
.bk-note b { font-size: 12.5px; }
.bk-note small { font-size: 11px; color: var(--text-secondary); }
.bk-note small.muted { font-size: 10px; color: var(--text-muted); }
.bk-note.new { background: #f2f8ff; }
.bk-note.new b::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--ocean-500, #2d6cdf); vertical-align: middle; }
.bk-pop-stack { position: fixed; right: 18px; bottom: 54px; z-index: 1300; display: flex; flex-direction: column; gap: 8px; width: 340px; }
.bk-pop { display: flex; gap: 9px; align-items: flex-start; padding: 10px 10px 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--hairline);
    border-left: 4px solid var(--ocean-500, #2d6cdf); box-shadow: 0 12px 36px rgba(10, 30, 60, .2); cursor: pointer; animation: bk-pop-in .25s ease-out; transition: opacity .5s, transform .5s; }
.bk-pop.gold { border-left-color: #f59e0b; } .bk-pop.aqua { border-left-color: #0ea5a4; } .bk-pop.violet { border-left-color: #6d5bd0; }
.bk-pop > div { display: flex; flex-direction: column; gap: 1px; }
.bk-pop b { font-size: 12.5px; }
.bk-pop small { font-size: 11px; color: var(--text-secondary); }
.bk-pop small.muted { font-size: 10px; color: var(--text-muted); }
.bk-pop.out { opacity: 0; transform: translateX(20px); }
@keyframes bk-pop-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* what changed live lights up for a moment */
.bk-flash { animation: bk-flash 1.8s ease-out; }
@keyframes bk-flash { 0% { background-color: #fff6c9; box-shadow: inset 0 0 0 1px #f5d76e; } 100% { background-color: transparent; box-shadow: none; } }

/* ---- approvals */
.bk-apv .bk-pane { min-height: 0; overflow: auto; }
.bk-apv-card { display: flex; flex-direction: column; gap: 12px; }
.bk-apv-head { display: flex; align-items: center; gap: 10px; }
.bk-apv-head h2 { margin: 0; font-size: 16px; }
.bk-apv-head small { font-size: 11.5px; }
.bk-apv-why { padding: 9px 12px; border-radius: 10px; background: #fffaf0; border: 1px solid #f6e3b4; }
.bk-apv-why h4, .bk-apv-req h4 { display: flex; align-items: center; gap: 5px; margin: 0 0 5px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: #a35a00; }
.bk-apv-req h4 { color: var(--ocean-700); }
.bk-apv-why h4 svg, .bk-apv-req h4 svg { width: 13px; height: 13px; }
.bk-apv-why ul { margin: 0; padding-left: 18px; font-size: 12.5px; }
.bk-apv-why li { margin: 2px 0; }
.bk-apv-why .bk-quote { margin: 6px 0 0; font-size: 12px; }
.bk-apv-req { display: flex; flex-direction: column; gap: 8px; padding: 9px 12px; border-radius: 10px; background: #f7f9fc; border: 1px solid #e3e9f0; }
.bk-apv-items { font-size: 12px; }
.bk-apv-items tr.bk-apv-low td { background: #fff7e6; }
.bk-apv-decision { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; }
.bk-apv-decision svg { width: 15px; height: 15px; margin-top: 2px; }
.bk-apv-decision.approved { background: #edf8f1; color: #1d6b3a; }
.bk-apv-decision.rejected { background: #fdeeee; color: #a11b1b; }
.bk-apv-decision.withdrawn { background: #f2f4f7; color: var(--text-secondary); }
.bk-apv-decision p { margin: 4px 0 0; color: var(--text-primary); }
.bk-apv-acts { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; border-top: 1px dashed var(--hairline); }

/* the order dialog: a price below the lowest, and a word for the checker */
.bko-items tr.bko-below td { background: #fffaf0; }
.bko-checker { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: #fffaf0; border: 1px dashed #f0cf7a; }
.bko-checker small { font-size: 11px; color: #a35a00; }
.bko-checker[hidden] { display: none; }

/* set-up: people & access */
.bk-access td { vertical-align: middle; }
.bk-access select { min-width: 190px; }
.bk-roles-key { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 12px; }
.bk-roles-key > div { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: 10px; background: #f7f9fc; border: 1px solid #e3e9f0; }
.bk-roles-key b { font-size: 12.5px; }
.bk-roles-key small { font-size: 11px; color: var(--text-secondary); }
.bk-roles-key span { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.bk-roles-key i { font-style: normal; font-size: 10px; padding: 1px 7px; border-radius: 999px; background: #e7eef6; color: var(--ocean-700); }

/* the yard for a role without the money */
.bk-yard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; overflow: auto; }
.bk-xpv.solo { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1100px) { .bk-yard { grid-template-columns: minmax(0, 1fr); } }

/* approvals: the evidence, what happened, and the reason a maker answers */
.bk-apv-ev, .bk-apv-hist { padding: 9px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--hairline); }
.bk-apv-ev h4, .bk-apv-hist h4 { display: flex; align-items: center; gap: 5px; margin: 0 0 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ocean-700); }
.bk-apv-ev h4 svg, .bk-apv-hist h4 svg { width: 13px; height: 13px; }
.bk-apv-hist ol { list-style: none; margin: 0; padding: 0 0 0 4px; display: flex; flex-direction: column; gap: 8px; border-left: 2px solid #e3e9f0; }
.bk-apv-hist li { display: flex; gap: 8px; align-items: flex-start; margin-left: -11px; font-size: 12px; }
.bk-apv-hist li > i { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #eef3f9; color: var(--ocean-700); border: 2px solid #fff; }
.bk-apv-hist li > i svg { width: 11px; height: 11px; }
.bk-apv-hist li.bad > i { background: #fdeeee; color: #a11b1b; }
.bk-apv-hist li.good > i { background: #edf8f1; color: #1d6b3a; }
.bk-apv-hist li.warn > i { background: #fff4dc; color: #a35a00; }
.bk-apv-hist li p { margin: 2px 0 0; color: var(--text-secondary); white-space: pre-wrap; }
.bk-apv-said { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: #fdeeee; color: #a11b1b; font-size: 12.5px; }
.bk-apv-said svg { width: 14px; height: 14px; margin-top: 2px; }
.bk-apv-said p { margin: 2px 0 0; color: var(--text-primary); }

/* ---- a new order: the alert on the screen */
.bk-alert-back { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 16px; background: rgba(8, 24, 44, .42); backdrop-filter: blur(2px);
    animation: bk-fade .2s ease-out; }
@keyframes bk-fade { from { opacity: 0; } to { opacity: 1; } }
.bk-alert { width: min(560px, 100%); max-height: 90vh; display: flex; flex-direction: column; border-radius: 18px; background: #fff; overflow: hidden;
    box-shadow: 0 30px 80px rgba(8, 24, 44, .35); animation: bk-alert-in .35s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes bk-alert-in { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
.bk-alert-top { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; background: linear-gradient(135deg, #0b5f9e, #0d8bd0); color: #fff; }
.bk-alert-top small { display: block; font-size: 11px; opacity: .85; }
.bk-alert-top h2 { margin: 2px 0 0; font-size: 20px; line-height: 1.2; color: #fff; }
.bk-alert-top h2 span { font-weight: 500; opacity: .92; }
.bk-alert-top .btn.ghost { color: #fff; }
.bk-alert-top .btn.ghost:hover { background: rgba(255, 255, 255, .15); }
.bk-alert-ring { position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .18); }
.bk-alert-ring svg { width: 22px; height: 22px; }
.bk-alert-ring::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7); animation: bk-ring 1.6s ease-out infinite; }
@keyframes bk-ring { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.bk-alert-body { padding: 14px 16px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.bk-alert-items { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.bk-alert-items td { padding: 6px 4px; border-bottom: 1px dashed var(--hairline); }
.bk-alert-items td.r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bk-alert-items tbody td b { font-size: 14px; }
.bk-alert-items tfoot td { border-bottom: 0; padding-top: 8px; font-weight: 700; }
.bk-alert-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bk-alert-facts > div { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: #f5f8fc; }
.bk-alert-facts > div > svg { width: 15px; height: 15px; margin-top: 2px; color: var(--ocean-600); flex: none; }
.bk-alert-facts span { display: flex; flex-direction: column; min-width: 0; }
.bk-alert-facts small { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8a97a5; }
.bk-alert-facts b { font-size: 12.5px; overflow-wrap: anywhere; }
.bk-alert-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--hairline); background: #fafbfd; }
.bk-alert-foot .spacer { flex: 1; }
.bk-alert-nav { display: inline-flex; align-items: center; gap: 2px; }
.bk-alert-nav small { font-size: 11px; color: var(--text-muted); }
/* the bell: clear one, clear all */
.bk-note { position: relative; }
.bk-note .bk-note-x { opacity: 0; flex: none; }
.bk-note:hover .bk-note-x { opacity: 1; }
.bk-bell-foot { padding: 8px 12px; border-top: 1px solid var(--hairline); font-size: 12px; }
.bk-bell-empty { display: flex; align-items: center; gap: 6px; }
.bk-bell-empty svg { width: 14px; height: 14px; color: var(--positive); }
@media (max-width: 560px) { .bk-alert-facts { grid-template-columns: minmax(0, 1fr); } }

/* the batch: add a type or a material back; take one off */
.bkb-pick { margin-left: auto; height: 26px; padding: 0 8px; border-radius: 8px; border: 1px dashed var(--hairline-strong); background: #fff; font-size: 11.5px; color: var(--ocean-700); cursor: pointer; }
.bko-sec-h .bkb-pick + * { margin-left: 6px; }
.bkb-table [data-rm-type], .bkb-table [data-rm-mat] { opacity: .55; }
.bkb-table tr:hover [data-rm-type], .bkb-table tr:hover [data-rm-mat] { opacity: 1; }
.bkb-none { margin: 6px 2px; }
/* an entry with a request open on it */
.held-tag { white-space: nowrap; gap: 3px; }
.held-tag svg { width: 11px; height: 11px; }
