/* Page-unique styles moved out of Blade views. One block per view. */

/* resources/views/contact/show.blade.php */
.info_col {
    width: 25%;
    float: left;
    padding-left: var(--bb-space-8);
    padding-right: var(--bb-space-8);
}

/* resources/views/home/calendar.blade.php */
/* event type colour as a swatch; the label itself in body text (blue/yellow text was 3.8:1 and 1.7:1) */
.cal-swatch { display: inline-block; width: 12px; height: 12px; margin: 0 var(--bb-space-4) 0 var(--bb-space-6); border-radius: var(--bb-radius-sm); vertical-align: -1px; }

/* resources/views/printer/index.blade.php */
.pr-name { display: inline-flex; align-items: center; gap: var(--bb-space-8); font-weight: 700; }
.pr-name > i { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--bb-radius-md); background: var(--bb-primary-tint); color: var(--bb-primary-text); font-size: var(--bb-text-base); }
.pr-name a { color: var(--bb-text); }
.pr-name a:hover { color: var(--bb-primary-text); }
.pr-conn { display: inline-block; padding: 2px var(--bb-space-8); border-radius: var(--bb-radius-full); font-size: var(--bb-text-sm); font-weight: 700; background: var(--dm-info-bg); color: var(--dm-info-text); }
.pr-conn.is-windows { background: var(--dm-info-bg); color: var(--dm-info-text); }
.pr-conn.is-linux { background: var(--dm-tint); color: var(--dm-primary-text); }
.pr-addr { padding: 2px var(--bb-space-6); border-radius: var(--bb-radius-sm); background: var(--bb-surface-raised); color: var(--bb-text); font-size: var(--bb-text-sm); }
.pr-paper { margin-left: 4px; padding: var(--bb-space-2) var(--bb-space-6); border-radius: var(--bb-radius-full); background: var(--bb-surface-raised); font-weight: 700; color: var(--bb-text-muted); }
.pr-foot-note { margin: var(--bb-space-12) var(--bb-space-4) 0; font-size: var(--bb-text-sm); color: var(--bb-text-muted); }

/* resources/views/restaurant/booking/index.blade.php */
/* readable day numbers: other-month days were gray-300 (1.5:1); today's number stays dark on the orange dot in both themes */
.bk-cal-card .fc-other-month .fc-day-number { color: var(--bb-text-muted, #6b6b6e) !important; }
.bk-cal-card .fc-today .fc-day-number { color: var(--bb-on-primary, #1d1d20) !important; }

/* resources/views/product/partials/combo_product_form_part.blade.php */
.cp-search { max-width: 640px; margin: 0 0 var(--bb-space-16); }
.cp-search .bb-igroup { display: flex; width: 100%; }
.cp-search .bb-iaddon { display: flex; align-items: center; }
.cp-table-wrap { border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); overflow-x: auto; background: var(--bb-surface); }
.combo_product_table { margin: 0 !important; border: 0 !important; }
.combo_product_table > thead > tr > th { border: 0 !important; background: var(--bb-surface-raised) !important; padding: var(--bb-space-8) var(--bb-space-16) !important; font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted) !important; text-transform: none; text-align: left; }
.combo_product_table > thead > tr > th.cp-n, .combo_product_table td.cp-n, .combo_product_table > tbody > tr:not(.combo_empty) > td:nth-child(n+2):nth-child(-n+4) { text-align: right; }
.combo_product_table .cp-x, .combo_product_table > tbody > tr > td:last-child { text-align: center; width: 48px; }
.combo_product_table > tbody > tr > td { border: 0 !important; border-top: 1px solid var(--bb-border) !important; padding: var(--bb-space-12) var(--bb-space-16) !important; vertical-align: middle; text-align: left !important; background: transparent !important; }
.combo_product_table > tbody > tr:not(.combo_empty) > td:nth-child(n+2):nth-child(-n+4) { text-align: right !important; }
.combo_product_table > tbody > tr:first-child > td { border-top: 0 !important; }
.combo_product_table input.quantity { width: 84px !important; margin-left: auto; text-align: right; font-weight: 600; }
.combo_product_table .sub_unit { width: 84px; margin: var(--bb-space-4) 0 0 auto; }
.combo_product_table tfoot td { border: 0 !important; border-top: 2px solid var(--bb-border) !important; background: var(--bb-surface-raised) !important; padding: var(--bb-space-12) var(--bb-space-16) !important; font-weight: 700; }
.combo_product_table .remove_combo_product_entry_row { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--bb-radius-md); transition: background .12s; }
.combo_product_table .remove_combo_product_entry_row:hover { background: var(--dm-danger-bg); }
.cp-empty { display: flex; flex-direction: column; align-items: center; gap: var(--bb-space-4); padding: var(--bb-space-24) var(--bb-space-16); text-align: center; color: var(--bb-text-muted); }
.cp-empty i { font-size: var(--bb-text-3xl); color: var(--bb-primary-text); opacity: .7; margin-bottom: var(--bb-space-4); }
.cp-empty b { color: var(--bb-text); font-size: var(--bb-text-md); }
.cp-empty span { font-size: var(--bb-text-sm); }
.combo_product_table tbody:has(tr:not(.combo_empty)) .combo_empty { display: none; }
.cp-flow { margin-top: var(--bb-space-16); }
.cp-cost-val { font-size: var(--bb-text-2xl); font-weight: 700; color: var(--bb-text); font-variant-numeric: tabular-nums; margin: var(--bb-space-2) 0 var(--bb-space-2); }
.cp-cost-note { margin: 0 0 var(--bb-space-12); font-size: var(--bb-text-sm); color: var(--bb-text-muted); }

/* resources/views/product/partials/quick_add_product.blade.php */
.qa .modal-content { border-radius: var(--bb-radius-xl); overflow: hidden; }
.qa .modal-header { padding: var(--bb-space-16) var(--bb-space-48) var(--bb-space-12) var(--bb-space-20); background: linear-gradient(135deg, var(--bb-primary-tint), var(--dm-surface) 70%); border-bottom: 1px solid var(--bb-border); }
.qa .modal-title { font-size: var(--bb-text-2xl); font-weight: 700; }
.qa-sub { margin: 0 0 var(--bb-space-12); font-size: var(--bb-text-base); color: var(--bb-text-muted, var(--bb-text-muted)); }
.qa .modal-body { background: var(--bb-surface-raised, var(--bb-surface-raised)); padding: 16px var(--bb-space-16) 6px; max-height: calc(100vh - 220px); overflow-y: auto; }
.qa .pc-card, .qa .pc-more { margin-bottom: var(--bb-space-12); }
.qa .pc-card-b :is(.row, .tw-bs-row) > :is([class*="col-"], .bs-col) { margin-bottom: 0; }
.qa .modal-footer { background: var(--dm-surface) !important; }
.qa-save { height: 42px; padding: 0 var(--bb-space-24); border: 0; border-radius: var(--bb-radius-md); background: linear-gradient(135deg, var(--bb-primary), var(--bb-accent)); color: var(--bb-on-primary); font-weight: 700; font-size: var(--bb-text-md); cursor: pointer; box-shadow: var(--bb-shadow-md); }
.qa-save:hover { filter: brightness(.96); }
.qa-save[disabled] { opacity: .6; cursor: not-allowed; }

/* resources/views/product/partials/variable_product_form_part.blade.php */
.vp-h { display: flex; align-items: center; gap: var(--bb-space-6); margin-bottom: var(--bb-space-8); font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-text); }
.vp-opts { display: flex; flex-wrap: wrap; gap: var(--bb-space-8); }
.vp-opt { flex: 1 1 260px; display: flex !important; align-items: center; gap: var(--bb-space-12); margin: 0 !important; padding: var(--bb-space-12) var(--bb-space-16); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--bb-surface-raised); cursor: pointer; transition: border-color .12s, background .12s; }
.vp-opt:hover { border-color: var(--bb-primary-border-soft); }
.vp-opt:has(input:checked) { border-color: var(--bb-primary); background: var(--bb-primary-tint); }
.vp-opt input { margin: 0; accent-color: var(--bb-primary); width: 16px; height: 16px; }
.vp-opt b { font-weight: 600; font-size: var(--bb-text-base); }
.vp-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--bb-space-16); margin: var(--bb-space-16) 0 var(--bb-space-12); padding-top: var(--bb-space-16); border-top: 1px solid var(--bb-border); }
.vp-bar h4 { margin: 0; font-size: var(--bb-text-lg); font-weight: 700; color: var(--bb-text); }
.vp-bar p { margin: var(--bb-space-2) 0 0; font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
/* the variations table: each option reads as its own card instead of a grid of borders */
.vp-table .table-responsive { border: 0; overflow-x: auto; overflow-y: visible; }
#product_variation_form_part { border: 0 !important; border-collapse: separate; border-spacing: 0 .7rem; background: transparent; }
#product_variation_form_part > thead > tr > th { border: 0 !important; background: transparent !important; padding: 0 var(--bb-space-12) var(--bb-space-2); font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); text-transform: none; }
#product_variation_form_part > tbody > tr.variation_row > td { border: 0 !important; background: var(--bb-surface); vertical-align: top; padding: var(--bb-space-16) var(--bb-space-12); border-top: 1px solid var(--bb-border) !important; border-bottom: 1px solid var(--bb-border) !important; }
#product_variation_form_part > tbody > tr.variation_row > td:first-child { border-left: 1px solid var(--bb-border) !important; border-radius: var(--bb-radius-lg) 0 0 var(--bb-radius-lg); width: 54px; }
#product_variation_form_part > tbody > tr.variation_row > td:last-child { border-right: 1px solid var(--bb-border) !important; border-radius: 0 var(--bb-radius-lg) var(--bb-radius-lg) 0; }
#product_variation_form_part > tbody > tr.variation_row > td:nth-child(2) { width: 230px; background: var(--bb-surface-raised); }
.variation_value_table { margin: 0 !important; border: 0 !important; border-collapse: separate; border-spacing: 0 .35rem; }
.variation_value_table > thead > tr > th { border: 0 !important; background: transparent !important; padding: 0 var(--bb-space-6) var(--bb-space-4) !important; font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-text-muted) !important; text-transform: none; vertical-align: bottom; }
.variation_value_table > thead > tr > th small, .variation_value_table > thead > tr > th i { font-weight: 500; color: var(--bb-text-faint); }
.variation_value_table > tbody > tr > td { border: 0 !important; padding: 0 var(--bb-space-6) !important; vertical-align: top; }
.variation_value_table .bb-control { min-width: 78px; font-variant-numeric: tabular-nums; }
.variation_value_table { width: 100%; min-width: 880px; table-layout: auto; }
/* purchase price: the two fields sit side by side inside the cell (no floats, so nothing slides under its neighbour) */
.variation_value_table td:has(> .width-50) { font-size: 0; white-space: nowrap; min-width: 250px; }
.variation_value_table .width-50 { display: inline-block; float: none; width: 50%; vertical-align: top; box-sizing: border-box; padding-right: var(--bb-space-6); }
.variation_value_table .width-50 + .width-50 { padding: 0; }
.variation_value_table td .bb-igroup { display: flex; width: 100%; min-width: 120px; }
.variation_value_table td .bb-igroup .bb-control { flex: 1 1 auto; width: 1% !important; min-width: 0; float: none; }
.variation_value_table td .bb-ibtn { flex: 0 0 auto; width: auto !important; display: flex; }
.variation_value_table td .bb-ibtn .btn { margin: 0 !important; }
.variation_value_table > thead > tr > th:last-child { width: 44px; text-align: center; }
.variation_value_table > thead > tr > th > .tw-float-left, .variation_value_table > thead > tr > th > .tw-float-right { float: none !important; }
.variation_value_table > thead > tr > th > span:has(small) { display: inline-block; width: 50%; font-size: var(--bb-text-xs); }
.variation_value_table > thead > tr > th > span.tw-float-right { text-align: right; }
.variation_value_table td.variation-image-cell { text-align: center; min-width: 70px; }
/* "apply to all" becomes a small, clear tile */
.variation_value_table .apply-all { height: 38px; width: 34px; padding: 0 !important; border-radius: 0 var(--bb-radius-md) var(--bb-radius-md) 0 !important; background: var(--bb-primary-tint) !important; color: var(--bb-primary-text) !important; border: 1px solid var(--bb-border-input) !important; border-left: 0 !important; }
.variation_value_table .apply-all:hover { background: var(--bb-primary) !important; color: var(--bb-on-primary) !important; }
.variation_value_table .bb-igroup .bb-control { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.variation_value_table .bb-ibtn { width: 1%; }
.variation-upload-btn { height: 34px; min-width: 34px; border-radius: var(--bb-radius-md) !important; display: inline-flex !important; align-items: center; justify-content: center; gap: var(--bb-space-4); }
@media (max-width: 991px) { #product_variation_form_part > tbody > tr.variation_row > td:nth-child(2) { width: auto; } }

/* resources/views/product/view-modal.blade.php */
/* Product view: plain header, neutral chips and buttons, one primary action (Edit), plain KPI cards. */
.pv .modal-content { border-radius: var(--bb-radius-lg); overflow: hidden; }
.pv-head { position: relative; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 20px var(--bb-space-48) 16px var(--bb-space-20); background: var(--bb-surface); border-bottom: 1px solid var(--bb-border); }
.pv-head .close { position: absolute; right: 18px; top: 16px; }
.pv-photo { width: 76px; height: 76px; flex-shrink: 0; border-radius: var(--bb-radius-md); overflow: hidden; background: var(--bb-surface-raised, var(--bb-100)); border: 1px solid var(--bb-border); }
.pv-photo img { width: 100%; height: 100%; object-fit: cover; }
.pv-title { flex: 1 1 280px; min-width: 0; }
.pv-title h4 { margin: 0 0 6px; font-size: var(--bb-text-2xl); font-weight: 700; color: var(--bb-text, var(--bb-text)); line-height: 1.25; letter-spacing: -0.01em; }
.pv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.pv-chip { padding: var(--bb-space-2) 8px; border-radius: var(--bb-radius-sm); background: var(--bb-surface-raised, var(--bb-background)); border: 1px solid var(--bb-border, var(--bb-border)); color: var(--bb-text-body, var(--bb-text-muted)); font-size: var(--bb-text-sm); font-weight: 500; }
.pv-chip.is-bad { background: var(--bb-danger-bg); border-color: transparent; color: var(--bb-danger-text); }
.pv-chip.is-warn { background: var(--bb-warning-bg); border-color: transparent; color: var(--bb-warning); }
.pv-sku { font-size: var(--bb-text-sm); color: var(--bb-text-muted, var(--bb-text-muted)); }
.pv-sku code { padding: var(--bb-space-2) 6px; border-radius: var(--bb-radius-sm); background: var(--bb-surface-raised, var(--bb-background)); border: 1px solid var(--bb-border, var(--bb-border)); color: var(--bb-text, var(--bb-text)); font-size: var(--bb-text-sm); }
.pv-copy { border: 0; background: transparent; color: var(--bb-text-muted, var(--bb-text-muted)); cursor: pointer; padding: 2px 6px; border-radius: var(--bb-radius-sm); }
.pv-copy:hover { background: var(--bb-surface-hover, var(--bb-background)); color: var(--bb-text, var(--bb-text)); }
.pv-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; padding-top: 2px; }
.pv-btn { height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: var(--bb-space-6); border-radius: var(--bb-radius-md); border: 1px solid var(--bb-border-input, var(--bb-border-strong)); background: var(--bb-surface); color: var(--bb-text, var(--bb-text)) !important; font-size: var(--bb-text-base); font-weight: 600; text-decoration: none !important; transition: background .12s, border-color .12s; }
.pv-btn i { color: var(--bb-text-muted, var(--bb-text-muted)); }
.pv-btn:hover { background: var(--bb-surface-hover, var(--bb-background)); border-color: var(--bb-border-darker, var(--bb-border-strong)); }
.pv-btn.is-primary { background: var(--bb-primary); border-color: var(--bb-primary); color: var(--bb-on-primary) !important; }
.pv-btn.is-primary i { color: var(--bb-on-fill); }
.pv-btn.is-primary:hover { background: var(--bb-primary-hover); border-color: var(--bb-primary-dark); }
.pv-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: var(--bb-space-16); }
.pv-kpi { padding: 12px 16px; border-radius: var(--bb-radius-md); background: var(--bb-surface); border: 1px solid var(--bb-border); box-shadow: var(--bb-shadow-xs); }
/* direct children only: the price inside <b> is a span too */
.pv-kpi > span { display: block; font-size: var(--bb-text-sm); font-weight: 500; color: var(--bb-text-muted, var(--bb-text-muted)); }
.pv-kpi b { display: block; margin-top: 4px; font-size: var(--bb-text-2xl); font-weight: 700; color: var(--bb-text, var(--bb-text)); font-variant-numeric: tabular-nums; line-height: 1.3; letter-spacing: -0.01em; }
.pv-kpi b small { font-size: calc(1em * .7); font-weight: 500; color: var(--bb-text-muted, var(--bb-text-muted)); }
.pv-kpi > small { display: block; margin-top: 2px; font-size: var(--bb-text-sm); color: var(--bb-text-muted, var(--bb-text-muted)); }
.pv-kpi.is-low { border-color: var(--bb-warning); }
.pv-kpi.is-low > small { color: var(--bb-warning); font-weight: 600; }
.pv-kpi b.is-gain { color: var(--bb-success); } .pv-kpi b.is-loss { color: var(--bb-danger-text); }
.pv-tabs { margin-bottom: 0; border-bottom: 1px solid var(--bb-border); }
.pv-tabs > li > a { padding: var(--bb-space-8) var(--bb-space-12); font-weight: 600; font-size: var(--bb-text-base); color: var(--bb-text-muted, var(--bb-text-muted)); border: 0; border-bottom: 2px solid transparent; margin-bottom: calc(-1 * var(--bb-space-2)); background: transparent !important; }
.pv-tabs > li > a:hover { color: var(--bb-text, var(--bb-text)); }
.pv-tabs > li.active > a, .pv-tabs > li.active > a:hover { color: var(--bb-text, var(--bb-text)); border: 0; border-bottom: 2px solid var(--bb-primary); }
.pv-pane { padding-top: 16px; }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: var(--bb-space-12); }
.pv-card { padding: var(--bb-space-12) 16px; border-radius: var(--bb-radius-md); border: 1px solid var(--bb-border); background: var(--bb-surface); }
.pv-card h5 { margin: 0 0 6px; font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-text, var(--bb-text)); }
.pv-fact { display: flex; justify-content: space-between; gap: var(--bb-space-12); padding: var(--bb-space-6) 0; border-top: 1px solid var(--bb-border); font-size: var(--bb-text-base); }
.pv-fact:first-of-type { border-top: 0; }
.pv-fact span { color: var(--bb-text-muted, var(--bb-text-muted)); }
.pv-fact b { font-weight: 600; color: var(--bb-text, var(--bb-text)); text-align: right; min-width: 0; word-break: break-word; }
.pv-desc, .pv-racks { margin-bottom: var(--bb-space-12); font-size: var(--bb-text-base); line-height: 1.6; }
@media (max-width: 767px) { .pv-head { padding-right: var(--bb-space-48); } .pv-photo { width: 60px; height: 60px; } }
@media print { .pv-tabs { display: none; } .pv-pane > .tab-pane { display: block !important; opacity: 1 !important; } }

/* resources/views/contact/show.blade.php */
/* hero: tappable contact details, WhatsApp, credit limit */
.bb-meta-link { color: inherit; text-decoration: none; }
.bb-meta-link:hover { color: var(--bb-primary-text); text-decoration: none; }
.bb-meta-link.is-wa i { color: var(--dm-success-text); }
.bb-kpi-sub { font-size: var(--bb-text-xs); font-weight: 600; color: var(--dm-muted, var(--bb-text-muted)); }
.bb-kpi-sub b { color: var(--dm-text, var(--bb-text)); font-weight: 700; }
.bb-limit { display: block; height: 5px; border-radius: var(--bb-radius-full); background: var(--dm-raised, var(--bb-border)); overflow: hidden; margin-top: 2px; }
.bb-limit i { display: block; height: 100%; border-radius: var(--bb-radius-full); background: var(--bb-success); }
.bb-limit i.is-hot { background: var(--bb-danger); }

/* ledger toolbar: quick period chips */
.lg-chips { display: inline-flex; gap: 2px; padding: var(--bb-space-2); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-md); }
.lg-chips button { height: 30px; padding: 0 var(--bb-space-12); border: 0; border-radius: var(--bb-radius-md); background: transparent; font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); cursor: pointer; white-space: nowrap; }
.lg-chips button:hover { color: var(--bb-text); }
.lg-chips button.is-active { background: var(--bb-surface); color: var(--bb-primary-text); box-shadow: var(--bb-shadow-xs); }

/* the ledger */
.lg { padding: var(--bb-space-4) 0 var(--bb-space-8); }
.lg-period { display: flex; align-items: center; gap: var(--bb-space-8); flex-wrap: wrap; margin: var(--bb-space-4) 0 var(--bb-space-16); }
.bb-chip.lg-period-chip { gap: var(--bb-space-6); height: 26px; padding: 0 var(--bb-space-12); font-size: var(--bb-text-sm); border: 1px solid var(--bb-primary-border-soft); }
.lg-period-chip i { font-style: normal; opacity: 0.6; }
.bb-chip.lg-period-chip.is-muted { border-color: var(--bb-border); }
.lg-period-n { font-size: var(--bb-text-sm); font-weight: 600; color: var(--bb-text-muted); }
.lg-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--bb-space-8); margin-bottom: var(--bb-space-16); }
.lg-card { display: flex; flex-direction: column; gap: var(--bb-space-2); padding: var(--bb-space-12) var(--bb-space-16); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); }
.lg-card-l { font-size: var(--bb-text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--bb-text-muted); }
.lg-card-v { font-size: var(--bb-text-lg); font-weight: 700; letter-spacing: -0.01em; color: var(--bb-text); font-variant-numeric: tabular-nums; }
.lg-card.is-ok .lg-card-v { color: var(--bb-success-text); }
.lg-card.is-strong { background: var(--bb-surface); border-width: 2px; }
.lg-card.is-strong.is-due { border-color: var(--bb-danger-border); background: var(--bb-danger-bg); }
.lg-card.is-strong.is-due .lg-card-v { color: var(--bb-danger-text); }
.lg-card.is-strong.is-ok { border-color: var(--bb-success-border); background: var(--bb-success-bg); }

.lg-table-wrap { overflow-x: auto; border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); }
.lg-table-wrap:focus-visible { outline: 2px solid var(--bb-focus-ring-color); outline-offset: 2px; }
.lg-table { margin: 0 !important; width: 100%; }
.lg-table thead th { position: sticky; top: 0; background: var(--bb-surface-raised); font-size: var(--bb-text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--bb-text-muted); white-space: nowrap; border-bottom: 1px solid var(--bb-border); padding: var(--bb-space-12) var(--bb-space-12); }
.lg-table tbody td { font-size: var(--bb-text-base); vertical-align: top; padding: var(--bb-space-8) var(--bb-space-12); border-top: 1px solid var(--bb-border); color: var(--bb-text); }
.lg-table tbody tr:hover td { background: var(--bb-surface-hover); }
.lg-nowrap { white-space: nowrap; }
.lg-num { text-align: right; font-variant-numeric: tabular-nums; }
.lg-type { display: inline-block; padding: var(--bb-space-2) var(--bb-space-8); border-radius: var(--bb-radius-full); font-size: var(--bb-text-xs); font-weight: 700; white-space: nowrap; background: var(--bb-info-bg); color: var(--bb-info-text); }
.lg-ref { font-weight: 700; }
.lg-dr { font-weight: 700; color: var(--bb-danger-text); }
.lg-cr { font-weight: 700; color: var(--bb-success-text); }
.lg-bal { font-weight: 700; }
.lg-others { font-size: var(--bb-text-sm); color: var(--bb-text-muted); min-width: 160px; }
.lg-others table { width: 100%; margin-top: var(--bb-space-4); font-size: var(--bb-text-sm); }
.lg-others table td, .lg-others table th { padding: var(--bb-space-2) var(--bb-space-6) !important; border: 0 !important; background: transparent !important; }
.lg-empty { text-align: center; padding: var(--bb-space-32) var(--bb-space-16) !important; color: var(--bb-text-muted) !important; font-weight: 600; }

.lg-aging-wrap { margin-top: var(--bb-space-16); }
.lg-aging-h { display: flex; align-items: center; justify-content: space-between; gap: var(--bb-space-8); margin-bottom: var(--bb-space-8); font-size: var(--bb-text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--bb-text-muted); }
.lg-aging-h b { font-size: var(--bb-text-md); letter-spacing: 0; text-transform: none; color: var(--bb-text); }
.lg-aging { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--bb-space-8); }
.lg-bucket { display: flex; flex-direction: column; gap: var(--bb-space-2); padding: var(--bb-space-8) var(--bb-space-12); border-radius: var(--bb-radius-md); background: var(--bb-surface); border: 1px solid var(--bb-border); border-top: 3px solid var(--c); }
.lg-bucket.is-zero { border-top-color: var(--bb-border-strong); }
.lg-bucket-l { font-size: var(--bb-text-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--c); }
.lg-bucket.is-zero .lg-bucket-l { color: var(--bb-text-muted); }
.lg-bucket.is-zero .lg-bucket-v { color: var(--bb-text-muted); }
.lg-bucket-v { font-size: var(--bb-text-md); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--bb-text); }

/* ───────── Account index (the tab navigation) ─────────
   A binder-style index: the rail and the pane meet, and the open entry is cut through the seam so they read as one
   sheet. Each entry carries one live fact so the situation is readable before anything is opened. */
.ct-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); align-items: start; margin-top: var(--bb-space-16); }
.ct-side { position: sticky; top: 76px; background: var(--bb-surface-raised); border: 1px solid var(--bb-border); border-right: 0; border-radius: var(--bb-radius-xl) 0 0 var(--bb-radius-xl); padding: var(--bb-space-8) 0 var(--bb-space-8) var(--bb-space-8); }
.ct-rail.nav { margin: 0; padding: 0; }
.ct-rail.nav > li { float: none; margin: 0; }
.ct-rail.nav > li + li { margin: 0; }
.ct-rail.nav > li.ct-group { padding: var(--bb-space-12) var(--bb-space-16) var(--bb-space-4); }
.ct-rail.nav > li.ct-group:first-child { padding-top: var(--bb-space-6); }
.ct-group span { font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-body); letter-spacing: 0.01em; }
.ct-rail.nav > li > a { position: relative; display: flex; align-items: center; gap: var(--bb-space-12); margin: var(--bb-space-2) 0; padding: var(--bb-space-8) var(--bb-space-12) var(--bb-space-8) var(--bb-space-12); border: 1px solid transparent; border-right: 0; border-radius: var(--bb-radius-lg) 0 0 var(--bb-radius-lg); background: transparent; color: var(--bb-text-body); transition: background 0.12s, color 0.12s; }
.ct-rail.nav > li > a:hover { background: var(--bb-primary-tint); color: var(--bb-text); }
.ct-rail.nav > li > a:focus-visible { outline: 2px solid var(--bb-primary); outline-offset: -2px; }
.ct-ic { width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: var(--bb-radius-md); color: var(--bb-text-muted); background: var(--bb-surface); border: 1px solid var(--bb-border); transition: background 0.15s, color 0.15s, border-color 0.15s; }
.ct-ic svg { width: 16px; height: 16px; }
.ct-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ct-tx b { font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-tx small { font-size: var(--bb-text-sm); font-weight: 500; color: var(--bb-text-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-rail.nav > li.is-zero > a .ct-tx b { color: var(--bb-text-body); font-weight: 600; }
.ct-rail.nav > li.is-zero > a .ct-tx small { color: var(--bb-text-body); }
.ct-rail.nav > li.is-due > a .ct-tx small { color: var(--bb-danger-text); font-weight: 700; }

/* the open entry: same paper as the pane, with a primary stop, cut through the seam */
.ct-rail.nav > li.active > a, .ct-rail.nav > li.active > a:hover, .ct-rail.nav > li.active > a:focus {
    z-index: 2; margin-right: calc(-1 * var(--bb-space-2)); background: var(--bb-surface); border-color: var(--bb-border); border-right: 1px solid var(--bb-surface); box-shadow: var(--bb-shadow-inset-edge); color: var(--bb-text); }
.ct-rail.nav > li.active .ct-ic { color: var(--bb-on-primary); background: linear-gradient(135deg, var(--bb-primary), var(--bb-accent)); border-color: transparent; }
.ct-rail.nav > li.active .ct-tx small { color: var(--bb-primary-text); }
.ct-rail.nav > li.active.is-due .ct-tx small { color: var(--bb-danger-text); }
/* tabs added by other modules arrive as plain links: give them the same footing */
.ct-rail.nav > li > a > i { width: 32px; text-align: center; color: var(--bb-text-muted); }

.ct-collapse { display: flex; align-items: center; gap: var(--bb-space-8); width: calc(100% - 0.55rem); margin: var(--bb-space-8) var(--bb-space-8) var(--bb-space-2) 0; padding: var(--bb-space-8) var(--bb-space-8); border: 0; border-radius: var(--bb-radius-md); background: transparent; color: var(--bb-text-body); font-size: var(--bb-text-sm); font-weight: 600; cursor: pointer; }
.ct-collapse:hover { color: var(--bb-text); background: var(--bb-surface); }
.ct-collapse svg { width: 15px; height: 15px; transition: transform 0.18s; }

.ct-pane.tab-content { min-width: 0; min-height: 420px; padding: var(--bb-space-16) var(--bb-space-20) var(--bb-space-20); background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: 0 var(--bb-radius-xl) var(--bb-radius-xl) var(--bb-radius-xl); box-shadow: var(--bb-shadow-xs); }
/* the pane is the one card: tables inside it do not need a second frame */
.ct-pane .bb-table-card { border: 0; box-shadow: none; border-radius: 0; background: transparent; }
.ct-pane > .tab-pane.active { animation: ct-in 0.2s ease-out; }
@keyframes ct-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ct-pane > .tab-pane.active { animation: none; } .ct-rail.nav > li > a, .ct-ic { transition: none; } }

/* compact: icons only (remembered), for wide tables */
.ct-shell.is-compact { grid-template-columns: 62px minmax(0, 1fr); }
.ct-shell.is-compact .ct-tx, .ct-shell.is-compact .ct-collapse span { display: none; }
.ct-shell.is-compact .ct-rail.nav > li > a { justify-content: center; padding: var(--bb-space-8) 0; }
.ct-shell.is-compact .ct-rail.nav > li.ct-group { padding: var(--bb-space-8) var(--bb-space-8) var(--bb-space-4); }
.ct-shell.is-compact .ct-group span { display: none; }
.ct-shell.is-compact .ct-rail.nav > li.ct-group:not(:first-child) { border-top: 1px solid var(--bb-border); margin: var(--bb-space-6) var(--bb-space-8) 0; padding: 0; }
.ct-shell.is-compact .ct-collapse { justify-content: center; width: calc(100% - 0.55rem); }
.ct-shell.is-compact .ct-collapse svg { transform: rotate(180deg); }

/* small screens: the index becomes a strip above the pane */
@media (max-width: 900px) {
    .ct-shell { display: block; }
    .ct-side { position: sticky; top: 0; z-index: 30; padding: var(--bb-space-6); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); margin-bottom: var(--bb-space-12); box-shadow: var(--bb-shadow-md); }
    .ct-rail.nav { display: flex; gap: var(--bb-space-4); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
    .ct-rail.nav::-webkit-scrollbar { display: none; }
    .ct-rail.nav > li { flex: 0 0 auto; scroll-snap-align: start; }
    .ct-rail.nav > li.ct-group, .ct-collapse { display: none; }
    .ct-rail.nav > li > a, .ct-shell.is-compact .ct-rail.nav > li > a { padding: var(--bb-space-6) var(--bb-space-12) var(--bb-space-6) var(--bb-space-8); margin: 0; border: 1px solid transparent; border-radius: var(--bb-radius-lg); justify-content: flex-start; }
    .ct-shell.is-compact .ct-tx { display: flex; }
    .ct-tx small { display: none; }
    .ct-rail.nav > li.active > a, .ct-rail.nav > li.active > a:hover, .ct-rail.nav > li.active > a:focus { margin-right: 0; border-color: var(--bb-primary-border-soft); background: var(--bb-primary-tint); box-shadow: none; }
    .ct-pane.tab-content { border-radius: var(--bb-radius-lg); padding: var(--bb-space-12); min-height: 320px; }
}

/* header strip at the top of the Sales / Purchases tabs */
.bb-tab-head { display: flex; align-items: center; justify-content: space-between; gap: var(--bb-space-12); flex-wrap: wrap; margin: var(--bb-space-4) 0 var(--bb-space-16); padding: var(--bb-space-6) var(--bb-space-8) 0; }
.bb-tab-title { display: flex; flex-direction: column; line-height: 1.25; }
.bb-tab-title b { font-size: var(--bb-text-lg); font-weight: 700; letter-spacing: -0.01em; color: var(--bb-text); }
.bb-tab-title span { font-size: var(--bb-text-sm); font-weight: 500; color: var(--bb-text-muted); }
.bb-tab-btn { display: inline-flex; align-items: center; gap: var(--bb-space-8); height: 36px; padding: 0 var(--bb-space-16); border-radius: var(--bb-radius-md); font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-on-primary); text-decoration: none;
    background: linear-gradient(135deg, var(--bb-primary) 0%, var(--bb-accent) 100%); box-shadow: var(--bb-shadow-sm); transition: transform 0.12s, box-shadow 0.12s; }
.bb-tab-btn:hover { color: var(--bb-on-fill); text-decoration: none; transform: translateY(-1px); box-shadow: var(--bb-shadow-md); }

/* stock report toolbar */
.bb-tab-bar { display: flex; align-items: flex-end; gap: var(--bb-space-16); flex-wrap: wrap; padding: var(--bb-space-12) var(--bb-space-16); margin-bottom: var(--bb-space-16); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); }
.bb-tab-bar .bb-tb-field { display: flex; flex-direction: column; gap: var(--bb-space-4); min-width: 240px; }
.bb-tab-bar label { margin: 0; font-size: var(--bb-text-xs); font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--bb-text-muted); }
.bb-tab-bar .select2-container { width: 100% !important; }
.bb-tab-bar-note { margin-left: auto; font-size: var(--bb-text-sm); font-weight: 500; color: var(--bb-text-muted); }

/* payments */
.ct-pane .pm-table tbody td { vertical-align: middle; }
.pm-nowrap { white-space: nowrap; }
.pm-when { display: block; font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-text); white-space: nowrap; }
.pm-sub { display: block; font-size: var(--bb-text-xs); font-weight: 500; line-height: 1.3; color: var(--bb-text-muted); }
.pm-ref { display: inline-block; font-family: var(--bb-font-mono); font-size: var(--bb-text-sm); font-weight: 700; padding: var(--bb-space-2) var(--bb-space-8); border-radius: var(--bb-radius-md); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); color: var(--bb-text-muted); }
.pm-amt { font-size: var(--bb-text-md); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--bb-text); }
.pm-for { font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-text); margin-right: var(--bb-space-6); }
a.pm-for:hover { color: var(--bb-primary-text); text-decoration: none; }
.pm-pill { display: inline-flex; align-items: center; font-size: var(--bb-text-xs); font-weight: 700; border-radius: var(--bb-radius-full); padding: var(--bb-space-2) var(--bb-space-8); white-space: nowrap; }
.pm-pill-method { background: var(--bb-surface-raised); color: var(--bb-text); border: 1px solid var(--bb-border); }
.pm-pill-ok { background: var(--bb-success-bg); color: var(--bb-success-text); } .pm-pill-info { background: var(--bb-info-bg); color: var(--bb-info-text); }
.pm-pill-warn { background: var(--bb-warning-bg); color: var(--bb-warning-text); } .pm-pill-muted { background: var(--bb-surface-raised); color: var(--bb-text-muted); border: 1px solid var(--bb-border); }
.pm-parent td { background: var(--bb-primary-tint); }
.pm-child td { background: var(--bb-surface-raised); }
.pm-child .pm-ref { margin-left: var(--bb-space-16); }
.pm-actions { display: flex; gap: var(--bb-space-4); white-space: nowrap; }
.pm-btn { display: inline-flex; align-items: center; gap: var(--bb-space-6); height: 28px; padding: 0 var(--bb-space-8); border-radius: var(--bb-radius-md); cursor: pointer; font-size: var(--bb-text-sm); font-weight: 700;
    --c: var(--bb-info); --cb: var(--bb-info-bg); --cl: var(--bb-info-border); --ct: var(--bb-info-text); background: var(--cb); color: var(--ct); border: 1px solid var(--cl); transition: background 0.12s, color 0.12s; }
.pm-btn i { font-size: var(--bb-text-sm); }
.pm-btn:hover { background: var(--c); color: var(--bb-on-fill); }
.pm-btn-edit { --c: var(--bb-accent-2); --cb: var(--bb-accent-2-bg); --cl: var(--bb-accent-2-border); --ct: var(--bb-accent-2-text); } .pm-btn-del { --c: var(--bb-danger); --cb: var(--bb-danger-bg); --cl: var(--bb-danger-border); --ct: var(--bb-danger-text); }
.pm-empty { text-align: center; padding: var(--bb-space-40) var(--bb-space-16) !important; color: var(--bb-text-muted); font-size: var(--bb-text-base); font-weight: 600; }
.pm-empty svg { width: 34px; height: 34px; margin-bottom: var(--bb-space-6); color: var(--bb-text-faint); }
.pm-pager { display: flex; justify-content: flex-end; margin-top: var(--bb-space-8); }

/* activity timeline */
.ac { list-style: none; margin: var(--bb-space-4) 0 0; padding: 0 0 0 var(--bb-space-4); position: relative; }
.ac::before { content: ''; position: absolute; left: 1.2rem; top: 0.6rem; bottom: 0.6rem; width: 2px; background: var(--bb-border); }
.ac-item { position: relative; display: flex; gap: var(--bb-space-16); padding: var(--bb-space-8) 0; }
.ac-dot { position: relative; z-index: 1; width: 2rem; height: 2rem; border-radius: var(--bb-radius-circle); flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--bb-surface); border: 2px solid var(--c); color: var(--c); }
.ac-dot svg { width: 13px; height: 13px; }
.ac-primary { --c: var(--bb-primary); } .ac-ok { --c: var(--bb-success); } .ac-danger { --c: var(--bb-danger-text); } .ac-info { --c: var(--bb-info); }
.ac-body { flex: 1; min-width: 0; padding: var(--bb-space-8) var(--bb-space-16); background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); }
.ac-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--bb-space-12); flex-wrap: wrap; }
.ac-title { font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-text); }
.ac-when { font-size: var(--bb-text-sm); font-weight: 600; color: var(--bb-text-muted); white-space: nowrap; }
.ac-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bb-space-6) var(--bb-space-8); margin-top: var(--bb-space-2); font-size: var(--bb-text-sm); font-weight: 500; color: var(--bb-text-muted); }
.ac-tag { font-size: var(--bb-text-xs); font-weight: 700; padding: var(--bb-space-2) var(--bb-space-8); border-radius: var(--bb-radius-full); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); color: var(--bb-text-muted); }
.ac-date { margin-left: auto; color: var(--bb-text-faint); }
.ac-note { margin-top: var(--bb-space-6); padding: var(--bb-space-6) var(--bb-space-8); border-radius: var(--bb-radius-md); background: var(--bb-surface-raised); font-size: var(--bb-text-sm); line-height: 1.5; color: var(--bb-text); overflow-wrap: anywhere; }
.ac-empty { text-align: center; padding: var(--bb-space-40) var(--bb-space-16); color: var(--bb-text-muted); font-size: var(--bb-text-md); font-weight: 600; }
.ac-empty svg { width: 36px; height: 36px; margin-bottom: var(--bb-space-6); color: var(--bb-text-faint); }

@media (max-width: 800px) { .lg-aging { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* == business locations list == */
.bl-page .um-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--bb-space-12); margin-bottom: var(--bb-space-16); }
@media (max-width: 767px) { .bl-page .um-kpis { grid-template-columns: repeat(2, 1fr); } }
.bl-page .um-kpi { padding: var(--bb-space-12) var(--bb-space-16); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--bb-surface-raised); }
.bl-page .um-kpi span { display: block; font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); }
.bl-page .um-kpi b { display: block; font-size: var(--bb-text-3xl); font-weight: 700; color: var(--bb-text); line-height: 1.25; }
.bl-page .um-kpi.is-ok { background: var(--dm-success-bg); border-color: var(--dm-success-border); } .bl-page .um-kpi.is-ok b { color: var(--dm-success-text); }
.bl-page .um-kpi.is-warn { background: var(--dm-warning-bg); border-color: var(--dm-warning-border); } .bl-page .um-kpi.is-warn b { color: var(--dm-warning-text); }
.bl-page .um-user { display: flex; align-items: center; gap: var(--bb-space-12); }
.bl-page .um-user small { display: block; margin-top: 2px; font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
.bl-page .um-av { width: 38px; height: 38px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--bb-radius-lg); background: var(--bb-primary-wash); color: var(--bb-primary-text); font-size: var(--bb-text-md); }
.bl-page .bl-addr b { display: block; font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-text); }
.bl-page .bl-addr small { display: block; font-size: var(--bb-text-sm); color: var(--bb-text-muted); }

/* == invoice schemes list == */
.inv-page .um-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--bb-space-12); margin-bottom: var(--bb-space-16); }
@media (max-width: 767px) { .inv-page .um-kpis { grid-template-columns: repeat(2, 1fr); } }
.inv-page .um-kpi { padding: var(--bb-space-12) var(--bb-space-16); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--bb-surface-raised); }
.inv-page .um-kpi span { display: block; font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); }
.inv-page .um-kpi b { display: block; font-size: var(--bb-text-3xl); font-weight: 700; color: var(--bb-text); line-height: 1.25; }
.inv-page .um-kpi b.inv-kpi-t { font-size: var(--bb-text-lg); padding: var(--bb-space-4) 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-page .um-kpi.is-ok { background: var(--dm-success-bg); border-color: var(--dm-success-border); } .inv-page .um-kpi.is-ok b { color: var(--dm-success-text); }
.inv-page .um-user { display: flex; align-items: center; gap: var(--bb-space-12); }
.inv-page .um-user small { display: block; margin-top: 2px; font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
.inv-page .um-av { width: 38px; height: 38px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--bb-radius-lg); background: var(--bb-primary-wash); color: var(--bb-primary-text); font-size: var(--bb-text-md); }
.inv-page .inv-next { padding: var(--bb-space-2) var(--bb-space-8); border-radius: var(--bb-radius-md); background: var(--bb-primary-tint); border: 1px solid var(--bb-primary-border-soft); font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-primary-text); }
.inv-page .inv-bar { display: flex; align-items: center; justify-content: flex-end; gap: var(--bb-space-16); flex-wrap: wrap; padding: 12px 4px; }
.inv-page .inv-bar small { display: block; margin-top: 2px; font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
.inv-page .inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--bb-space-16); padding: var(--bb-space-16) 0 var(--bb-space-16); }
.inv-page .inv-card { display: flex; flex-direction: column; border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--dm-surface); overflow: hidden; text-decoration: none !important; }
.inv-page .inv-card:hover { border-color: var(--bb-primary-border-soft); box-shadow: var(--bb-shadow-md); }
.inv-page .inv-thumb { position: relative; height: 400px; overflow: hidden; background: var(--dm-tint, var(--bb-border)); }
.inv-page .inv-thumb::after { content: ""; position: absolute; inset: 0; }
.inv-page .inv-thumb iframe { position: absolute; top: 10px; left: 0; border: 0; background: var(--dm-surface); transform-origin: 0 0; box-shadow: var(--bb-shadow-sm); pointer-events: none; }
.inv-page .inv-card-meta { display: flex; align-items: center; gap: var(--bb-space-8); padding: var(--bb-space-12) var(--bb-space-16); border-top: 1px solid var(--bb-border); }
.inv-page .inv-card-tx { flex: 1; min-width: 0; }
.inv-page .inv-card-tx b { display: block; font-size: var(--bb-text-md); font-weight: 700; color: var(--bb-text); }
.inv-page .inv-card-tx small { display: block; font-size: var(--bb-text-sm); color: var(--bb-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* == repair == */
.rp-setup { display: flex; align-items: center; gap: var(--bb-space-16); flex-wrap: wrap; padding: var(--bb-space-12) var(--bb-space-16); border-radius: var(--bb-radius-xl); border: 1px solid var(--bb-primary-border-soft, var(--bb-border)); background: var(--bb-primary-tint); }
.rp-setup-ic { width: 40px; height: 40px; flex: 0 0 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--bb-radius-lg); color: var(--bb-on-primary); background: linear-gradient(135deg, var(--bb-primary), var(--bb-accent)); }
.rp-setup-txt { flex: 1; min-width: 220px; display: grid; gap: var(--bb-space-2); }
.rp-setup-txt b { color: var(--bb-text); font-size: var(--bb-text-md); }
.rp-setup-txt span, .rp-setup-note { color: var(--bb-text-muted); font-size: var(--bb-text-base); }
.rp-setup-btn { height: 40px; padding: 0 var(--bb-space-20); border: 0; border-radius: var(--bb-radius-md); background: linear-gradient(135deg, var(--bb-primary), var(--bb-accent)); color: var(--bb-on-primary); font-weight: 700; font-size: var(--bb-text-base); cursor: pointer; }
.rp-setup-btn:focus-visible { outline: 2px solid var(--bb-primary); outline-offset: 2px; }
#job_sheet .table-bordered>thead>tr>th, #job_sheet .table-bordered>tbody>tr>th, #job_sheet .table-bordered>tfoot>tr>th,
#job_sheet .table-bordered>thead>tr>td, #job_sheet .table-bordered>tbody>tr>td, #job_sheet .table-bordered>tfoot>tr>td { border: 1px solid var(--bb-gray-900, #1b1b1e); }

/* == users and roles (group A) == */
.rl-page .um-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--bb-space-12); margin-bottom: var(--bb-space-16); }
@media (max-width: 767px) { .rl-page .um-kpis { grid-template-columns: repeat(2, 1fr); } }
.rl-page .um-kpi { padding: var(--bb-space-12) var(--bb-space-16); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--bb-surface-raised); }
.rl-page .um-kpi span { display: block; font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); }
.rl-page .um-kpi b { display: block; font-size: var(--bb-text-3xl); font-weight: 700; color: var(--bb-text); line-height: 1.25; }
.rl-page .um-kpi.is-ok { background: var(--dm-success-bg); border-color: var(--dm-success-border); }
.rl-page .um-kpi.is-ok b { color: var(--dm-success-text); }
.rl-page .um-kpi.is-warn { background: var(--dm-warning-bg); border-color: var(--dm-warning-border); }
.rl-page .um-kpi.is-warn b { color: var(--dm-warning-text); }
.rl-page .um-user { display: flex; align-items: center; gap: var(--bb-space-12); }
.rl-page .um-user small { display: block; margin-top: 2px; font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
.rl-page .um-av { width: 38px; height: 38px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--bb-radius-lg); background: var(--bb-primary-wash); color: var(--bb-primary-text); font-size: var(--bb-text-base); font-weight: 700; letter-spacing: .02em; }
.rl-page .rl-users { display: inline-flex; align-items: center; gap: var(--bb-space-6); padding: 2px var(--bb-space-8); border-radius: var(--bb-radius-full); background: var(--bb-primary-tint); border: 1px solid var(--bb-primary-border-soft); font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-primary-text); }
.rl-page .rl-meter { display: flex; align-items: center; gap: var(--bb-space-12); min-width: 180px; }
.rl-page .rl-bar { flex: 1; height: 6px; border-radius: var(--bb-radius-sm); background: var(--bb-border); overflow: hidden; }
.rl-page .rl-bar i { display: block; height: 100%; background: var(--bb-primary); }
.rl-page .rl-meter span { font-size: var(--bb-text-sm); color: var(--bb-text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rl-page .rl-meter b { color: var(--bb-text); }
.rl-page .rl-lock { font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
.um-page .um-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--bb-space-12); margin-bottom: var(--bb-space-16); }
@media (max-width: 767px) { .um-page .um-kpis { grid-template-columns: repeat(2, 1fr); } }
.um-page .um-kpi { padding: var(--bb-space-12) var(--bb-space-16); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--bb-surface-raised); }
.um-page .um-kpi span { display: block; font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); }
.um-page .um-kpi b { display: block; font-size: var(--bb-text-3xl); font-weight: 700; color: var(--bb-text); line-height: 1.25; }
.um-page .um-kpi.is-ok { background: var(--dm-success-bg); border-color: var(--dm-success-border); }
.um-page .um-kpi.is-ok b { color: var(--dm-success-text); }
.um-page .um-kpi.is-warn { background: var(--dm-warning-bg); border-color: var(--dm-warning-border); }
.um-page .um-kpi.is-warn b { color: var(--dm-warning-text); }
.um-page .um-user { display: flex; align-items: center; gap: var(--bb-space-12); }
.um-page .um-user small { display: block; font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
.um-page .um-av { width: 38px; height: 38px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--bb-radius-lg); background: var(--bb-primary-wash); color: var(--bb-primary-text); font-size: var(--bb-text-base); font-weight: 700; letter-spacing: .02em; }
.up-show .up-hero { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bb-space-20) var(--bb-space-24); margin-bottom: var(--bb-space-16); padding: var(--bb-space-20) var(--bb-space-24); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-xl); background: var(--dm-surface); }
.up-show .up-av { width: 76px; height: 76px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--bb-radius-xl); background: var(--bb-primary-wash); color: var(--bb-primary-text); font-size: var(--bb-text-3xl); font-weight: 700; }
.up-show .up-av.is-img { object-fit: cover; }
.up-show .up-id { flex: 1; min-width: 240px; }
.up-show .up-id h3 { margin: 0 0 var(--bb-space-6); font-size: var(--bb-text-3xl); font-weight: 700; color: var(--bb-text); }
.up-show .up-badges { display: flex; flex-wrap: wrap; gap: var(--bb-space-8); align-items: center; }
.up-show .up-facts { display: flex; flex-wrap: wrap; gap: var(--bb-space-4) var(--bb-space-24); margin-top: var(--bb-space-8); font-size: var(--bb-text-base); color: var(--bb-text-body); }
.up-show .up-facts i { margin-right: var(--bb-space-6); color: var(--bb-text-faint, var(--bb-text-faint)); }
.up-show .up-kpis { display: flex; gap: var(--bb-space-12); }
.up-show .up-kpis > div { min-width: 130px; padding: var(--bb-space-12) var(--bb-space-16); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--dm-surface); }
.up-show .up-kpis span { display: block; font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); }
.up-show .up-kpis b { font-size: var(--bb-text-2xl); font-weight: 700; color: var(--bb-text); }
.up-show .up-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--bb-space-16); padding-top: var(--bb-space-16); }
@media (max-width: 991px) { .up-show .up-grid { grid-template-columns: 1fr; } }
.up-show .up-card { border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--dm-surface); overflow: hidden; }
.up-show .up-h { padding: var(--bb-space-12) var(--bb-space-16); font-size: var(--bb-text-md); font-weight: 700; color: var(--bb-text); background: var(--bb-surface-raised); border-bottom: 1px solid var(--bb-border); }
.up-show .up-h i { margin-right: var(--bb-space-8); color: var(--bb-primary-text); }
.up-show .up-row { display: flex; justify-content: space-between; gap: var(--bb-space-16); padding: var(--bb-space-8) var(--bb-space-16); border-bottom: 1px dashed var(--bb-border); font-size: var(--bb-text-md); }
.up-show .up-row:last-child { border-bottom: 0; }
.up-show .up-row span { color: var(--bb-text-muted); flex: 0 0 42%; }
.up-show .up-row b { color: var(--bb-text); font-weight: 700; text-align: right; word-break: break-word; }
.up-show .up-none { color: var(--bb-border-strong, var(--bb-text-faint)); font-style: normal; font-weight: 400; }
.up { padding-top: var(--bb-space-16); }
.up .up-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: var(--bb-space-16); align-items: start; }
.up .up-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: var(--bb-space-16); }
.up .up-main { display: flex; flex-direction: column; gap: var(--bb-space-16); min-width: 0; margin: 0; }
.up .up-card { margin: 0; padding: var(--bb-space-16) var(--bb-space-20); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-xl); background: var(--dm-surface, #fff); box-shadow: var(--bb-shadow-xs); }
.up .up-card-h { display: flex; align-items: center; gap: var(--bb-space-12); margin-bottom: var(--bb-space-16); padding-bottom: var(--bb-space-12); border-bottom: 1px solid var(--bb-border); }
.up .up-card-h b { display: block; font-size: var(--bb-text-lg); font-weight: 700; color: var(--bb-text); }
.up .up-card-h small { display: block; font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
.up .up-ic { width: 34px; height: 34px; flex: 0 0 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--bb-radius-md); background: var(--bb-primary-tint); border: 1px solid var(--bb-primary-border-soft, var(--bb-border)); }
.up .up-ic svg { width: 17px; height: 17px; color: var(--bb-primary-text, #c2410c); }
.up .up-id { text-align: center; padding-top: var(--bb-space-24); background: linear-gradient(180deg, var(--bb-primary-tint) 0, var(--dm-surface, #fff) 90px); }
.up .up-avatar { width: 96px; height: 96px; margin: 0 auto var(--bb-space-12); border-radius: var(--bb-radius-circle); overflow: hidden; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--bb-primary, #ef7810), var(--bb-accent, #fdb434)); outline: 3px solid var(--bb-surface); box-shadow: var(--bb-shadow-md); }
.up .up-avatar img { width: 100%; height: 100%; object-fit: cover; }
.up .up-avatar span { font-size: var(--bb-text-4xl); font-weight: 700; color: var(--bb-on-fill); letter-spacing: .02em; }
.up .up-name { display: block; font-size: var(--bb-text-xl); font-weight: 700; color: var(--bb-text); }
.up .bb-chip.up-role { margin-top: var(--bb-space-6); padding: var(--bb-space-2) var(--bb-space-8); font-size: var(--bb-text-sm); font-weight: 700; }
.up .up-facts { margin: var(--bb-space-16) 0 0; text-align: left; border-top: 1px solid var(--bb-border); }
.up .up-facts div { display: flex; justify-content: space-between; gap: var(--bb-space-12); padding: var(--bb-space-8) 0; border-bottom: 1px dashed var(--bb-border); font-size: var(--bb-text-base); }
.up .up-facts dt { font-weight: 600; color: var(--bb-text-muted); }
.up .up-facts dd { margin: 0; font-weight: 700; color: var(--bb-text); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.up .up-since { display: block; margin-top: var(--bb-space-12); font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
.up .bb-field { margin-bottom: var(--bb-space-16); }
.up label { font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); margin-bottom: var(--bb-space-4); }
.up .bb-control { height: 40px; border-radius: var(--bb-radius-md) !important; }
.up textarea.bb-control { height: auto; }
.up .up-fields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--bb-space-16); }
.up .up-c2 { grid-column: span 2; }
.up .up-c5 { grid-column: span 5; }
.up .up-c6 { grid-column: span 6; }
.up .up-pw { position: relative; }
.up .up-pw .bb-control { padding-right: var(--bb-space-40) !important; }
.up .up-eye { position: absolute; right: 5px; top: 5px; width: 32px; height: 30px; border: 0; border-radius: var(--bb-radius-md); background: transparent; color: var(--bb-text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.up .up-eye:hover, .up .up-eye.is-on { color: var(--bb-primary-text, #c2410c); background: var(--bb-primary-tint); }
.up .up-eye svg { width: 16px; height: 16px; }
.up .up-meter { display: flex; align-items: center; gap: var(--bb-space-4); margin-top: var(--bb-space-8); }
.up .up-meter i { flex: 1; height: 5px; border-radius: var(--bb-radius-xl); background: var(--bb-border); transition: background .15s; }
.up .up-meter span { min-width: 52px; text-align: right; font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-text-muted); }
.up .up-meter[data-s="1"] i:nth-child(-n+1) { background: var(--bb-danger); }
.up .up-meter[data-s="2"] i:nth-child(-n+2) { background: var(--bb-warning); }
.up .up-meter[data-s="3"] i:nth-child(-n+3) { background: var(--bb-success); }
.up .up-meter[data-s="4"] i:nth-child(-n+4) { background: var(--bb-green-600); }
.up .up-match { display: block; min-height: 1.1em; margin-top: var(--bb-space-4); font-size: var(--bb-text-sm); font-weight: 700; }
.up .up-match.is-ok { color: var(--dm-success-text, #067647); }
.up .up-match.is-bad { color: var(--bb-danger-text, #b42318); }
.up .up-fold > summary { list-style: none; cursor: pointer; margin-bottom: 0; border-bottom: 0; padding-bottom: var(--bb-space-2); }
.up .up-fold > summary::-webkit-details-marker { display: none; }
.up .up-fold[open] > summary { margin-bottom: var(--bb-space-16); padding-bottom: var(--bb-space-12); border-bottom: 1px solid var(--bb-border); }
.up .up-chev { width: 18px; height: 18px; margin-left: auto; color: var(--bb-text-muted); transition: transform .15s; }
.up .up-fold[open] .up-chev { transform: rotate(180deg); }
.up .up-more { border: 0; box-shadow: none; background: transparent; }
.up .up-more > .tw-p-bb-16 { padding: 0 !important; }
.up .up-bar { position: sticky; bottom: 2.6rem; z-index: 20; display: flex; align-items: center; justify-content: flex-end; gap: var(--bb-space-16); }
.up .up-dirty:not([hidden]) { padding: var(--bb-space-8) var(--bb-space-12); border-radius: var(--bb-radius-md); background: var(--dm-tint, var(--bb-warning-bg)); }
.up .up-dirty { margin-right: auto; font-size: var(--bb-text-sm); font-weight: 700; color: var(--dm-warning-text, var(--bb-warning-text)); }
.up .up-dirty i { font-size: var(--bb-text-xs); vertical-align: middle; margin-right: var(--bb-space-4); }
@media (max-width: 991px) { .up .up-grid { grid-template-columns: 1fr; } .up .up-side { position: static; } }
@media (max-width: 640px) { .up .up-c2, .up .up-c5, .up .up-c6 { grid-column: 1 / -1; } }

/* == CRM == */
#contacts_login_dropdown::after { display: inline-block; width: 0; height: 0; margin-left: var(--bb-space-4); vertical-align: 0.255em; content: ""; border-top: 0.3em solid; border-right: 0.3em solid transparent; border-bottom: 0; border-left: 0.3em solid transparent; }
.fw-100 { font-weight: 400; }

/* == customer group list == */
        #customer_groups_table tbody td { height: 60px; padding-top: 0 !important; padding-bottom: 0 !important; vertical-align: middle; }
        #customer_groups_table thead th { white-space: nowrap; }
        a.cgl-ent { display: inline-flex; align-items: center; gap: var(--bb-space-12); color: inherit; text-decoration: none; border-radius: var(--bb-radius-md); margin: -4px -6px; padding: 4px 6px; transition: background 0.12s; }
        a.cgl-ent:hover { background: var(--bb-primary-tint); text-decoration: none; }
        a.cgl-ent:hover .cgl-name { color: var(--bb-primary-text); }
        .cgl-avatar { width: 34px; height: 34px; border-radius: var(--bb-radius-md); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: var(--bb-text-base); font-weight: 700; color: var(--av); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); }
        .cgl-avatar::before { content: attr(data-l); }
        .cgl-name { font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-text); }
        .cgl-pct { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--bb-text); }
        .cgl-none { color: var(--bb-text-body); }
        a.cgl-count { display: inline-flex; align-items: center; gap: var(--bb-space-6); height: 26px; padding: 0 var(--bb-space-12); border-radius: var(--bb-radius-full); font-size: var(--bb-text-sm); text-decoration: none; background: var(--bb-primary-tint); color: var(--bb-primary-text); border: 1px solid var(--bb-primary-border-soft); transition: background 0.12s, color 0.12s; }
        a.cgl-count svg { width: 13px; height: 13px; }
        a.cgl-count b { font-weight: 700; font-variant-numeric: tabular-nums; }
        a.cgl-count:hover { background: var(--bb-primary); color: var(--bb-on-primary); text-decoration: none; }
        a.cgl-count.is-zero { background: var(--bb-surface-raised); color: var(--bb-text-faint); border-color: var(--bb-border); }
        .cgl-actions { display: flex; align-items: center; gap: var(--bb-space-4); white-space: nowrap; }

/* == variation templates == */
/* Phone: each variation row becomes a card (name, values, used-by + actions) so nothing scrolls sideways */
@media (max-width: 767px) {
    #variation_table, #variation_table tbody, #variation_table tr, #variation_table td { display: block; width: 100% !important; }
    #variation_table thead { display: none; }
    #variation_table tr { padding: var(--bb-space-12, 12px) var(--bb-space-16, 16px); border-bottom: 1px solid var(--bb-border, currentColor); }
    #variation_table td { border: 0 !important; padding: var(--bb-space-4, 4px) 0 !important; white-space: normal; }
    #variation_table td:nth-child(3), #variation_table td:nth-child(4) { display: inline-block; width: auto !important; margin-right: var(--bb-space-8, 8px); }
    .variation_modal .modal-dialog { margin: var(--bb-space-8, 8px); }
    .variation_modal .modal-footer .btn, .variation_modal .modal-footer button { margin-bottom: var(--bb-space-4, 4px); }
}

/* == dashboard (home) == */
/* ═══════════════════════════════════════════════════════
   DASHBOARD v2 — every block is a card on --bb-background.
   Brand colours come from the --bb-* tokens in app.css.
   ═══════════════════════════════════════════════════════ */
.db-page { --db-radius: 12px; --db-gap: 1rem; }

/* ── Page header: title, who/when, period controls ───── */
.db-hero { padding: var(--bb-space-20) var(--bb-page-gutter) 0; }
.db-hero-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--bb-space-16); flex-wrap: wrap; }
.db-hero-title { font-size: var(--bb-text-3xl); font-weight: 700; color: var(--bb-text); letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
.db-hero-sub   { font-size: var(--bb-text-base); color: var(--bb-text-muted); font-weight: 500; margin-top: var(--bb-space-4); display: flex; gap: var(--bb-space-8); align-items: center; flex-wrap: wrap; }
.db-hero-sub .db-dot { width: 3px; height: 3px; border-radius: var(--bb-radius-circle); background: var(--bb-text-label); }
.db-hero-controls { display: flex; align-items: center; gap: var(--bb-space-8); flex-wrap: wrap; }
.db-hero-controls .select2-container--default .select2-selection--single {
    height: 34px; border: 1px solid var(--bb-border-input); border-radius: var(--bb-radius-md); background: var(--bb-surface); box-shadow: none;
}
.db-hero-controls .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 32px; font-size: var(--bb-text-base); font-weight: 500; color: var(--bb-text); padding-left: var(--bb-space-12); }
.db-hero-controls .select2-container--default .select2-selection--single .select2-selection__arrow { height: 32px; }

/* period switch (segmented control) + custom range button */
.db-presets {
    display: inline-flex; align-items: center; gap: var(--bb-space-2);
    background: var(--bb-surface-raised); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-md); padding: var(--bb-space-2);
}
.db-preset {
    height: 28px; padding: 0 var(--bb-space-12); border: 0; border-radius: var(--bb-radius-md);
    background: transparent; color: var(--bb-text-muted); font-size: var(--bb-text-sm); font-weight: 600;
    cursor: pointer; white-space: nowrap; transition: background 0.12s, color 0.12s;
}
.db-preset:hover { color: var(--bb-text); }
.db-preset.is-active { background: var(--bb-surface); color: var(--bb-text); box-shadow: var(--bb-shadow-xs); }
#dashboard_date_filter svg { flex-shrink: 0; color: var(--bb-text-muted); }
#db-range-label { font-variant-numeric: tabular-nums; }

/* ── Quick actions: one primary, the rest plain buttons ── */
.db-quick {
    display: flex; gap: var(--bb-space-8); padding: var(--bb-space-16) var(--bb-page-gutter) 0;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    min-width: 0; max-width: 100%; /* scroll inside the row, never widen the page */
}
.db-quick::-webkit-scrollbar { display: none; }
.db-quick-btn { flex: 0 0 auto; height: 36px; }
.db-quick-ic { display: flex; align-items: center; color: var(--bb-text-muted); }
.db-quick-ic svg { width: 15px; height: 15px; stroke: currentColor; }
.db-quick-sale .db-quick-ic { color: inherit; }

/* ── Body ─────────────────────────────────────────────── */
.db-body { padding: var(--bb-space-20) var(--bb-page-gutter) var(--bb-space-40); display: flex; flex-direction: column; gap: var(--bb-space-24); }
.db-section-label { display: flex; align-items: baseline; justify-content: space-between; gap: var(--bb-space-12); margin-bottom: var(--bb-space-12); }
.db-section-label > span:first-child {
    font-size: var(--bb-text-lg); font-weight: 700; color: var(--bb-text); letter-spacing: -0.01em; white-space: nowrap;
}
.db-section-label .db-section-action {
    font-size: var(--bb-text-sm); font-weight: 600; color: var(--bb-primary-text, #c2410c); text-decoration: none; white-space: nowrap;
}
.db-section-label .db-section-action:hover { text-decoration: underline; color: var(--bb-primary-dark); }

.db-card {
    background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--db-radius);
    box-shadow: var(--bb-shadow-xs);
}

/* ── Metric cards ─────────────────────────────────────── */
/* One panel, hairline-divided. Net profit is the tall lead cell on the left; the other cells are paired by column
   (sales over purchases, owed to you over owed by you, expense over the two returns). Colour sits on the deltas and
   the lead cell's edge only. 4 columns: hero 1.3fr + 3 x 1fr. */
.db-metrics-grid {
    display: grid; grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr)); grid-auto-rows: auto; gap: 1px;
    background: var(--bb-border); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); overflow: hidden;
}
.db-metric-card {
    position: relative; display: flex; flex-direction: column; min-width: 0; text-decoration: none;
    background: var(--bb-surface); padding: var(--bb-space-16) var(--bb-space-20);
    transition: background-color 0.15s;
}
.db-metric-card:hover { text-decoration: none; background: var(--bb-surface-hover); }
.db-metric-card:focus-visible { outline: 2px solid var(--bb-primary); outline-offset: -2px; text-decoration: none; }
.db-metric-top { display: flex; align-items: center; gap: var(--bb-space-8); margin-bottom: var(--bb-space-8); min-width: 0; }
.db-metric-icon { display: flex; flex-shrink: 0; }
.db-metric-icon svg { width: 14px; height: 14px; stroke: var(--dm-color, var(--bb-primary)); }
.db-metric-value {
    font-size: var(--bb-text-2xl); font-weight: 700; color: var(--bb-text); letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums; line-height: 1.2; min-height: 1.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.db-metric-value:empty::after, .db-skel {
    content: ''; display: block; height: 1.1rem; width: 60%; border-radius: var(--bb-radius-sm);
    background: linear-gradient(90deg, var(--bb-border) 0%, var(--bb-surface-hover) 50%, var(--bb-border) 100%);
    background-size: 200% 100%; animation: db-shimmer 1.4s ease-in-out infinite;
}
@keyframes db-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.db-metric-label {
    font-size: var(--bb-text-base); font-weight: 500; color: var(--bb-text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.db-metric-delta {
    display: flex; align-items: center; gap: var(--bb-space-4); margin-top: var(--bb-space-6);
    font-size: var(--bb-text-sm); font-weight: 600; color: var(--bb-text-muted); min-height: 1.1rem;
    font-variant-numeric: tabular-nums;
}
.db-metric-delta svg { width: 12px; height: 12px; stroke: currentColor; }
.db-metric-delta.is-up   { color: var(--bb-success-text); }
.db-metric-delta.is-down { color: var(--bb-danger-text); }
.db-metric-delta.is-flat { color: var(--bb-text-muted); }
.db-metric-delta.is-up.is-bad   { color: var(--bb-danger-text); }
.db-metric-delta.is-down.is-bad { color: var(--bb-success-text); }
.db-metric-sub { font-size: var(--bb-text-sm); color: var(--bb-text-muted); font-weight: 500; margin-top: var(--bb-space-4); }

/* lead cell: net profit, two rows tall, tinted, with a 3px edge in its colour */
.db-metric-hero { grid-row: span 2; justify-content: center; padding: var(--bb-space-24); --bb-edge-color: var(--dm-color); box-shadow: var(--bb-shadow-inset-edge); }
.db-metric-hero::before { content: ''; position: absolute; inset: 0; background: var(--bb-primary-glow); pointer-events: none; }
.db-metric-hero > * { position: relative; }
.db-metric-hero .db-metric-top { margin-bottom: var(--bb-space-12); }
.db-metric-hero .db-metric-label { font-size: var(--bb-text-md); color: var(--bb-text-body); }
.db-metric-hero .db-metric-value { font-size: var(--bb-text-4xl); letter-spacing: -0.03em; min-height: 2rem; }
.db-metric-hero .db-metric-sub { margin-top: var(--bb-space-12); }

/* the two returns share one cell, each a compact two-line row */
.db-metric-pair { display: grid; grid-template-rows: 1fr 1fr; gap: 1px; background: var(--bb-border); min-width: 0; }
.db-metric-pair .db-metric-card {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "top delta" "value value";
    align-content: center; padding: var(--bb-space-8) var(--bb-space-20);
}
.db-metric-pair .db-metric-top { grid-area: top; margin-bottom: 0; }
.db-metric-pair .db-metric-delta { grid-area: delta; margin-top: 0; }
.db-metric-pair .db-metric-value { grid-area: value; font-size: var(--bb-text-lg); min-height: 1.2rem; }

/* ── Attention tiles ──────────────────────────────────── */
/* --db-attn-cols is set by home.js (balanceAttention) from the tile count, never more than fit at 170px; auto-fit until then */
.db-attn-grid { display: grid; grid-template-columns: repeat(var(--db-attn-cols, auto-fit), minmax(170px, 1fr)); gap: var(--bb-space-12); }
.db-attn {
    display: flex; align-items: center; gap: var(--bb-space-12); text-decoration: none;
    background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-md);
    padding: var(--bb-space-12) var(--bb-space-16); color: var(--bb-text); transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.db-attn:hover { text-decoration: none; color: var(--bb-text); transform: translateY(-1px); box-shadow: var(--bb-shadow-md); border-color: var(--bb-border-strong); }
.db-attn-count {
    min-width: 42px; height: 42px; padding: 0 var(--bb-space-8); border-radius: var(--bb-radius-md); display: flex; align-items: center; justify-content: center;
    font-size: var(--bb-text-xl); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; flex-shrink: 0;
}
.db-attn-warning .db-attn-count { background: var(--bb-warning-bg); color: var(--bb-warning-text); }
.db-attn-danger  .db-attn-count { background: var(--bb-danger-bg);  color: var(--bb-danger-text); }
.db-attn-info    .db-attn-count { background: var(--bb-info-bg);    color: var(--bb-info-text); }
.db-attn-zero    .db-attn-count { background: var(--bb-surface-raised); color: var(--bb-text-label); }
.db-attn-zero { opacity: 0.72; }
.db-attn-label { font-size: var(--bb-text-sm); font-weight: 700; line-height: 1.2; }
.db-attn-sub   { font-size: var(--bb-text-xs); color: var(--bb-text-muted); font-weight: 600; margin-top: var(--bb-space-2); font-variant-numeric: tabular-nums; }
.db-attn-skel  { height: 60px; border-radius: var(--bb-radius-md); }
.db-attn-skel::after { height: 100%; width: 100%; border-radius: var(--bb-radius-md); }
.db-attn-empty {
    display: flex; align-items: center; gap: var(--bb-space-8); padding: var(--bb-space-12) var(--bb-space-16);
    background: var(--bb-success-bg); color: var(--bb-success-text); border-radius: var(--bb-radius-md); font-size: var(--bb-text-base); font-weight: 700;
}

/* ── Analytics row ────────────────────────────────────── */
.db-analytics { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: var(--db-gap); }
.db-card-hdr {
    display: flex; align-items: center; justify-content: space-between; gap: var(--bb-space-12);
    padding: var(--bb-space-12) var(--bb-space-16); border-bottom: 1px solid var(--bb-border);
}
.db-card-hdr-left { display: flex; align-items: center; gap: var(--bb-space-8); min-width: 0; }
.db-card-icon {
    width: 30px; height: 30px; border-radius: var(--bb-radius-md); flex-shrink: 0;
    background: var(--ci-bg, var(--bb-primary-glow));
    display: flex; align-items: center; justify-content: center;
}
.db-card-icon svg { width: 15px; height: 15px; stroke: var(--ci, var(--bb-primary)); }
.db-card-title { font-size: var(--bb-text-md); font-weight: 700; color: var(--bb-text); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-card-body { padding: var(--bb-space-16) var(--bb-space-16) var(--bb-space-16); }
.db-seg { display: inline-flex; gap: var(--bb-space-2); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-md); padding: var(--bb-space-2); }
.db-seg button {
    height: 26px; padding: 0 var(--bb-space-12); border: 0; border-radius: var(--bb-radius-md); background: transparent;
    font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); cursor: pointer; white-space: nowrap;
}
.db-seg button.is-active { background: var(--bb-surface); color: var(--bb-primary-text, #c2410c); box-shadow: var(--bb-shadow-xs); }
.db-chart-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--bb-space-8); margin-bottom: var(--bb-space-12); }
.db-chart-stat { background: var(--bb-surface-raised); border-radius: var(--bb-radius-md); padding: var(--bb-space-8) var(--bb-space-12); min-width: 0; }
.db-chart-stat-v { font-size: var(--bb-text-lg); font-weight: 700; color: var(--bb-text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; min-height: 1.2rem; overflow-wrap: anywhere; }
.db-chart-stat-l { font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-top: var(--bb-space-2); }
#db-sales-chart { height: 280px; min-height: 280px; position: relative; }
.db-chart-empty {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--bb-space-6);
    color: var(--bb-text-muted); font-size: var(--bb-text-base); font-weight: 600; background: var(--bb-surface);
}
.db-chart-empty svg { width: 28px; height: 28px; stroke: var(--bb-text-label); }

/* today panel */
.db-today-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--bb-space-8); }
.db-today-stat { background: var(--bb-surface-raised); border-radius: var(--bb-radius-md); padding: var(--bb-space-8) var(--bb-space-12); min-width: 0; }
.db-today-stat-v { font-size: var(--bb-text-lg); font-weight: 700; color: var(--bb-text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; min-height: 1.3rem; overflow-wrap: anywhere; }
.db-today-stat-l { font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-top: var(--bb-space-2); }
.db-today-stat.is-accent { background: var(--bb-primary-tint); }
.db-today-stat.is-accent .db-today-stat-v { color: var(--bb-primary-text); }
.db-top-title { font-size: var(--bb-text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--bb-text-muted); margin: var(--bb-space-16) 0 var(--bb-space-8); }
.db-top-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--bb-space-4); }
.db-top-item { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: var(--bb-space-8); font-size: var(--bb-text-sm); }
.db-top-rank { width: 20px; height: 20px; border-radius: var(--bb-radius-sm); background: var(--bb-surface-raised); color: var(--bb-text-muted); font-size: var(--bb-text-xs); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.db-top-item:first-child .db-top-rank { background: var(--bb-primary-tint); color: var(--bb-primary-text, #c2410c); }
.db-top-name { font-weight: 600; color: var(--bb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-top-qty  { font-size: var(--bb-text-xs); color: var(--bb-text-muted); font-weight: 600; }
.db-top-amt  { font-weight: 700; color: var(--bb-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-top-bar  { grid-column: 2 / 4; height: 3px; border-radius: var(--bb-radius-full); background: var(--bb-border); overflow: hidden; }
.db-top-bar i { display: block; height: 100%; background: var(--bb-primary); border-radius: var(--bb-radius-full); }
.db-top-empty { font-size: var(--bb-text-sm); color: var(--bb-text-muted); font-weight: 600; padding: var(--bb-space-8) 0; text-align: center; }

/* ── Overview (entities + business) ───────────────────── */
.db-overview-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--db-gap); }
.db-entity-stack { display: grid; grid-template-rows: repeat(3, 1fr); gap: var(--bb-space-8); }
.db-entity-card {
    display: flex; align-items: center; gap: var(--bb-space-12); text-decoration: none;
    background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-md); padding: var(--bb-space-12) var(--bb-space-16);
    color: var(--bb-text); transition: box-shadow 0.15s, border-color 0.15s;
}
.db-entity-card:hover { text-decoration: none; color: var(--bb-text); box-shadow: var(--bb-shadow-sm); border-color: var(--bb-border-strong); }
.db-entity-icon { width: 38px; height: 38px; border-radius: var(--bb-radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--ei-bg, var(--bb-primary-glow)); }
.db-entity-icon svg { width: 18px; height: 18px; stroke: var(--ei, var(--bb-primary)); }
.db-entity-count { font-size: var(--bb-text-2xl); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.db-entity-label { font-size: var(--bb-text-xs); color: var(--bb-text-muted); font-weight: 700; margin-top: var(--bb-space-2); text-transform: uppercase; letter-spacing: 0.08em; }
.db-entity-arrow { margin-left: auto; color: var(--bb-text-label); }
.db-biz-card { padding: var(--bb-space-16) var(--bb-space-20); display: flex; flex-direction: column; justify-content: center; }
.db-biz-top { display: flex; align-items: center; gap: var(--bb-space-16); width: 100%; }
.db-biz-logo { width: 60px; height: 60px; border-radius: var(--bb-radius-lg); object-fit: cover; flex-shrink: 0; border: 1px solid var(--bb-border); background: var(--bb-surface-raised); }
.db-biz-name { font-size: var(--bb-text-lg); font-weight: 700; color: var(--bb-text); letter-spacing: -0.02em; line-height: 1.2; }
.db-biz-meta { font-size: var(--bb-text-sm); color: var(--bb-text-muted); margin-top: var(--bb-space-2); font-weight: 500; overflow-wrap: anywhere; }
.bb-chip.db-biz-badge { font-size: var(--bb-text-xs); padding: var(--bb-space-2) var(--bb-space-8); margin-top: var(--bb-space-6); }
.db-biz-badge::before { content: ''; width: 6px; height: 6px; border-radius: var(--bb-radius-circle); background: var(--bb-success); animation: db-pulse 2s ease-in-out infinite; }
@keyframes db-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.85); } }
.db-pkg-section { margin-top: var(--bb-space-16); padding-top: var(--bb-space-12); border-top: 1px solid var(--bb-border); }
.db-pkg-header { display: flex; align-items: center; gap: var(--bb-space-6); font-size: var(--bb-text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--bb-text-muted); margin-bottom: var(--bb-space-8); }
.db-pkg-name { margin-left: auto; font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-primary-text, #c2410c); background: var(--bb-primary-tint); border: 1px solid var(--bb-primary-border-soft); border-radius: var(--bb-radius-full); padding: var(--bb-space-2) var(--bb-space-8); text-transform: none; letter-spacing: 0; white-space: nowrap; }
.db-pkg-validity { display: flex; align-items: center; gap: var(--bb-space-6); font-size: var(--bb-text-sm); font-weight: 600; color: var(--bb-text-muted); margin-bottom: var(--bb-space-6); }
.db-pkg-days { margin-left: auto; font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-success-text); background: var(--bb-success-bg); border-radius: var(--bb-radius-full); padding: var(--bb-space-2) var(--bb-space-8); }
.db-pkg-expiring .db-pkg-validity, .db-pkg-expiring .db-pkg-days { color: var(--bb-warning-text); }
.db-pkg-expiring .db-pkg-days { background: var(--bb-warning-bg); }
.db-pkg-expired .db-pkg-validity, .db-pkg-expired .db-pkg-days { color: var(--bb-danger-text); }
.db-pkg-expired .db-pkg-days { background: var(--bb-danger-bg); }
.db-pkg-bar-wrap { height: 4px; background: var(--bb-border); border-radius: var(--bb-radius-full); overflow: hidden; margin-bottom: var(--bb-space-8); }
.db-pkg-bar { height: 100%; background: linear-gradient(90deg, var(--bb-primary), var(--bb-accent)); border-radius: var(--bb-radius-full); }
.db-pkg-expired .db-pkg-bar { background: var(--bb-danger); }
.db-pkg-limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--bb-space-6); }
.db-pkg-limit-chip { display: flex; align-items: center; gap: var(--bb-space-6); background: var(--bb-surface-raised); border-radius: var(--bb-radius-md); padding: var(--bb-space-6) var(--bb-space-8); font-size: var(--bb-text-xs); color: var(--bb-text-muted); font-weight: 600; min-width: 0; }
.db-pkg-limit-chip svg { flex-shrink: 0; }
.db-pkg-limit-val { font-weight: 700; color: var(--bb-text); }
.db-pkg-limit-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Tables ───────────────────────────────────────────── */
.db-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--db-gap); }
.db-table-card { overflow: hidden; }
.db-table-hdr { display: flex; align-items: center; justify-content: space-between; gap: var(--bb-space-12); padding: var(--bb-space-12) var(--bb-space-16); background: var(--bb-surface-raised); border-bottom: 1px solid var(--bb-border); }
.db-table-hdr .db-card-title { font-size: var(--bb-text-base); }
.db-table-hdr-right { display: flex; align-items: center; gap: var(--bb-space-8); flex-shrink: 0; }
.db-table-hdr .select2-container--default .select2-selection--single { height: 28px; border-radius: var(--bb-radius-md); border-color: var(--bb-border-input); }
.db-table-hdr .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 28px; font-size: var(--bb-text-sm); }
.db-table-hdr .select2-container--default .select2-selection--single .select2-selection__arrow { height: 28px; }
.db-table-loc { min-width: 140px; }
.db-count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 var(--bb-space-6); border-radius: var(--bb-radius-full); background: var(--bb-primary-tint); color: var(--bb-primary-text, #c2410c); font-size: var(--bb-text-xs); font-weight: 700; font-variant-numeric: tabular-nums; }
.db-count-badge.is-zero { background: var(--bb-surface-raised); color: var(--bb-text-label); }
.db-view-all { font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-primary-text, #c2410c); text-decoration: none; white-space: nowrap; }
.db-view-all:hover { text-decoration: underline; color: var(--bb-primary-dark); }
.db-table-body { padding: var(--bb-space-8) var(--bb-space-12) var(--bb-space-12); overflow-x: auto; }
.db-table-card .db-table-body.bb-table-card { border: 0; border-radius: 0; box-shadow: none; padding: var(--bb-space-4) var(--bb-space-8) var(--bb-space-8); background: transparent; }
.db-table-body.bb-table-card { overflow-x: auto; }
.db-table-card .dataTables_wrapper > .dt-buttons { display: none !important; }
.db-table-card .dataTables_wrapper .dataTables_info { font-size: var(--bb-text-sm); color: var(--bb-text-muted); padding-top: var(--bb-space-8); }
.db-table-card .dataTables_wrapper .dataTables_paginate { padding-top: var(--bb-space-6); }
.db-table-card .dataTables_wrapper .dataTables_paginate .paginate_button { padding: var(--bb-space-2) var(--bb-space-8); font-size: var(--bb-text-sm); }
.db-table-card table.dataTable thead th { font-size: var(--bb-text-sm); white-space: nowrap; }
.db-table-card table.dataTable tbody td { font-size: var(--bb-text-sm); vertical-align: middle; }
.db-table-card .dataTables_empty { color: var(--bb-text-muted); font-size: var(--bb-text-sm); padding: var(--bb-space-24) var(--bb-space-8) !important; }
.db-sku { display: inline-block; font-size: var(--bb-text-xs); color: var(--bb-text-muted); font-weight: 600; background: var(--bb-surface-raised); border-radius: var(--bb-radius-sm); padding: 0 var(--bb-space-6); margin-left: var(--bb-space-4); vertical-align: 1px; }
.bb-table a.db-stock-name, .db-stock-name { font-weight: 600; color: var(--bb-text); }
.bb-table a.db-stock-name:hover { color: var(--bb-primary-text, #c2410c); }
#stock_alert_table tbody td:first-child { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
#stock_alert_table tbody td:not(:first-child) { white-space: nowrap; }
.bb-chip.db-pill { font-size: var(--bb-text-xs); font-weight: 700; padding: var(--bb-space-2) var(--bb-space-8); }
.db-table-card .add_payment_modal { white-space: nowrap; }

/* ── Stock alert + expiry: two equal cards, one card when expiry is off, stacked on narrow screens ── */
.db-stock-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--db-gap); align-items: stretch; }
.db-stock-row.is-single { grid-template-columns: minmax(0, 1fr); }
.db-stock-row > .db-table-card { display: flex; flex-direction: column; min-width: 0; }
.db-stock-row .db-table-hdr { flex-wrap: wrap; row-gap: var(--bb-space-8); min-height: 3.5rem; }
.db-stock-row .db-table-hdr-right { flex-shrink: 1; margin-left: auto; }
.db-stock-row .db-table-body { flex: 1; }
.db-stock-row .db-table-hdr-right { width: auto; flex-wrap: wrap; justify-content: flex-end; }
.db-stock-row .db-table-loc { flex: 1 1 9rem; }
/* auto layout: the columns share the card width; the place and status cells wrap instead of pushing the table wider */
.db-stock-row table.dataTable { table-layout: auto; }
#stock_alert_table tbody td:nth-child(2), #stock_expiry_alert_table tbody td:nth-child(2) { white-space: normal; overflow-wrap: anywhere; min-width: 7rem; line-height: 1.35; }
#stock_alert_table tbody td:first-child, #stock_expiry_alert_table tbody td:first-child { min-width: 8rem; }
.db-stock-row table.dataTable th, .db-stock-row table.dataTable td { padding-left: var(--bb-space-8) !important; padding-right: var(--bb-space-8) !important; }
.db-stock-row .db-sku { white-space: nowrap; }
.db-stock-row .dataTables_empty { text-align: center; padding: var(--bb-space-32) var(--bb-space-16) !important; }

/* ── Accordion cards (orders & shipments) ─────────────── */
.db-acc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--db-gap); align-items: start; }
/* an open card takes the full row for its wide table; a lone last card does too, so no half row is left empty */
.db-acc-grid > .db-acc.is-open, .db-acc-grid > .db-acc:last-child:nth-child(odd) { grid-column: 1 / -1; }
.db-acc { overflow: hidden; min-width: 0; transition: border-color 0.18s; }
.db-acc.is-open { border-color: var(--bb-primary-border); }
.db-acc-hdr {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--bb-space-12);
    padding: var(--bb-space-12) var(--bb-space-16); background: var(--bb-surface); border: 0; cursor: pointer; text-align: left;
}
.db-acc-hdr .db-table-hdr-right { width: auto; }
.db-acc-toggle { flex: 1; min-width: 0; display: flex; align-items: center; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.db-acc-toggle:focus-visible { outline: 2px solid var(--bb-primary); outline-offset: var(--bb-space-4); border-radius: var(--bb-radius-md); }
.db-acc-hdr:hover { background: var(--bb-surface-raised); }
.db-acc-hdr .db-acc-caret { box-sizing: content-box; padding: var(--bb-space-4); border-radius: var(--bb-radius-full); background: var(--bb-surface-raised); transition: transform 0.18s, background-color 0.18s, color 0.18s; color: var(--bb-text-muted); flex-shrink: 0; }
.db-acc-hdr:hover .db-acc-caret { background: var(--bb-primary-tint); color: var(--bb-primary-text, #c2410c); }
.db-acc.is-open .db-acc-hdr { background: var(--bb-surface-raised); border-bottom: 1px solid var(--bb-border); }
.db-acc.is-open .db-acc-caret { transform: rotate(180deg); background: var(--bb-primary-tint); color: var(--bb-primary-text, #c2410c); }
.db-acc .db-count-badge { min-width: 24px; height: 24px; font-size: var(--bb-text-sm); }
.db-acc .db-count-badge:empty { display: none; }
.db-acc:has(.db-count-badge.is-zero):not(.is-open) .db-card-icon { opacity: 0.55; }
.db-acc-body { display: none; }
.db-acc.is-open .db-acc-body { display: block; }
@media (prefers-reduced-motion: reduce) { .db-acc, .db-acc-hdr .db-acc-caret { transition: none; } }
.db-acc-hint { font-size: var(--bb-text-xs); color: var(--bb-text-muted); font-weight: 600; white-space: nowrap; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1200px) {
    .db-analytics { grid-template-columns: 1fr; }
    .db-overview-row { grid-template-columns: 1fr; }
    .db-entity-stack { grid-template-rows: none; grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
    .db-stock-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .db-acc-grid { grid-template-columns: minmax(0, 1fr); }
    .db-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .db-metric-hero { grid-column: span 2; grid-row: auto; }
    /* 6 cells after the lead: the last two take a full row each so no cell is left alone */
    .db-metric-card[data-metric="purchase_due"], .db-metric-pair { grid-column: span 2; }
    .db-two-col { grid-template-columns: 1fr; }
    .db-hero-inner { flex-direction: column; align-items: stretch; }
    .db-hero-controls { justify-content: flex-start; }
}
@media (max-width: 640px) {
    .db-hero { padding: var(--bb-space-16) var(--bb-page-gutter) var(--bb-space-16); }
    .db-hero-title { font-size: var(--bb-text-xl); }
    /* phones: every action visible, two per row, instead of a strip that hides the last ones off-screen */
    .db-quick { padding: var(--bb-space-12) var(--bb-page-gutter) 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
    .db-quick .db-quick-btn { min-width: 0; width: 100%; height: auto; min-height: 36px; white-space: normal; line-height: 1.2; text-align: center; }
    .db-body { padding: var(--bb-space-16) var(--bb-page-gutter) var(--bb-space-32); gap: var(--bb-space-16); }
    .db-metric-card { padding: var(--bb-space-12); }
    .db-metric-pair .db-metric-card { padding: var(--bb-space-8) var(--bb-space-12); }
    .db-metric-value { font-size: var(--bb-text-lg); } /* "Rs 1,717,399.00" fits a half-width card */
    .db-metric-hero { padding: var(--bb-space-16); }
    .db-metric-hero .db-metric-value { font-size: var(--bb-text-3xl); }
    .db-entity-stack { grid-template-columns: 1fr; }
    .db-chart-stats { grid-template-columns: 1fr 1fr; }
    .db-chart-stats .db-chart-stat:last-child { grid-column: span 2; }
    .db-attn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .db-presets { overflow-x: auto; max-width: 100%; }
    .db-card-hdr, .db-table-hdr { flex-wrap: wrap; }
    .db-table-hdr-right { width: 100%; justify-content: space-between; }
    .db-table-loc { flex: 1; }
    #db-sales-chart { height: 230px; min-height: 230px; }
    .db-biz-top { flex-wrap: wrap; }
    /* KPI labels wrap to 2 lines instead of one-line ellipsis; reserve 2 lines so cards in a row stay equal */
    .db-metric-label {
        white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
        line-height: 1.25; min-height: 2.5em; overflow-wrap: anywhere;
    }
    .db-metric-top { align-items: flex-start; }
    .db-metric-hero .db-metric-label, .db-metric-pair .db-metric-label { min-height: 0; }
    /* payment-due tables: no sideways scroll on phones; the Add payment column is left out (the reference opens the record) */
    #sales_payment_dues_table, #purchase_payment_dues_table { table-layout: auto; width: 100% !important; }
    #sales_payment_dues_table th, #purchase_payment_dues_table th,
    #sales_payment_dues_table td, #purchase_payment_dues_table td { padding-left: var(--bb-space-6) !important; padding-right: var(--bb-space-6) !important; }
    #sales_payment_dues_table th:nth-child(4), #purchase_payment_dues_table th:nth-child(4),
    #sales_payment_dues_table td:nth-child(4), #purchase_payment_dues_table td:nth-child(4) { display: none; }
    #sales_payment_dues_table tbody td:first-child, #purchase_payment_dues_table tbody td:first-child {
        white-space: normal !important; overflow-wrap: anywhere; line-height: 1.3; max-width: 8.5rem;
    }
    #sales_payment_dues_table tbody td:nth-child(2), #purchase_payment_dues_table tbody td:nth-child(2) { white-space: normal !important; overflow-wrap: anywhere; }
    #sales_payment_dues_table th:nth-child(3), #purchase_payment_dues_table th:nth-child(3),
    #sales_payment_dues_table tbody td:nth-child(3), #purchase_payment_dues_table tbody td:nth-child(3) { white-space: nowrap; text-align: right; }
    #sales_payment_dues_table tbody td:nth-child(3), #purchase_payment_dues_table tbody td:nth-child(3) { font-weight: 700; }
}
@media (max-width: 420px) {
    .db-attn-grid { grid-template-columns: 1fr; }
}
@media print {
    .db-quick, .db-hero-controls, .db-acc:not(.is-open) { display: none !important; }
}
.db-page .select2-container { width: 100% !important; }

/* == install modules (manage-modules) == */
.mod-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--bb-space-12); margin-bottom: var(--bb-space-16); }
.mod-kpis .um-kpi { padding: var(--bb-space-12) var(--bb-space-16); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--bb-surface-raised); }
.mod-kpis .um-kpi span { display: block; font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); }
.mod-kpis .um-kpi b { display: block; font-size: var(--bb-text-3xl); font-weight: 700; color: var(--bb-text); line-height: 1.25; }
.mod-kpis .um-kpi.is-ok { background: var(--dm-success-bg, var(--bb-success-bg)); border-color: var(--dm-success-border, #abefc6); } .mod-kpis .um-kpi.is-ok b { color: var(--dm-success-text, #067647); }
.mod-kpis .um-kpi.is-warn { background: var(--dm-tint, #fffaeb); border-color: var(--dm-warning-border, #fedf89); } .mod-kpis .um-kpi.is-warn b { color: var(--dm-primary-text, #b54708); }
#modules_table .um-user { display: flex; align-items: center; gap: var(--bb-space-12); }
#modules_table .um-av { width: 38px; height: 38px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--bb-radius-lg); background: var(--bb-primary-wash); color: var(--bb-primary-text); font-size: var(--bb-text-lg); }
.mod-name { min-width: 0; }
.mod-name b { display: block; font-size: var(--bb-text-md); font-weight: 700; color: var(--bb-text); }
.mod-name small { display: block; margin-top: var(--bb-space-2); font-size: var(--bb-text-sm); color: var(--bb-text-muted); line-height: 1.4; max-width: 520px; }
.mod-ver { display: inline-block; padding: var(--bb-space-2) var(--bb-space-8); border-radius: var(--bb-radius-md); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text); font-variant-numeric: tabular-nums; }
.mod-ver-next { margin-left: var(--bb-space-6); font-size: var(--bb-text-sm); font-weight: 700; color: var(--dm-primary-text, #b54708); white-space: nowrap; }
.mod-ver-next .fa { font-size: var(--bb-text-xs); }
.mod-muted { color: var(--bb-text-muted); }
.mod-caret { margin-left: var(--bb-space-4); font-size: var(--bb-text-xs); opacity: .7; }
#modules_table .bb-status.is-off { background: var(--dm-surface, var(--bb-gray-100, #f5f5f6)); color: var(--dm-body, var(--bb-gray-600, #5a5a5e)); border-color: var(--dm-border, var(--bb-gray-200, #e7e7ea)); }
#modules_table .bb-status.is-off .fa { color: var(--dm-muted, var(--bb-gray-500, #747477)) !important; background: none !important; }
#modules_table .bb-status.is-off .fa-circle { font-size: var(--bb-text-xs); }
.mod-row-missing .um-av { filter: grayscale(1); opacity: .7; }
.mod-row-missing .mod-name b { color: var(--bb-text-muted); }
#modules_table td { vertical-align: middle !important; }
#modules_table .bb-act-main[disabled] { opacity: .6; pointer-events: none; }
.mod-upload { margin-bottom: var(--bb-space-16); padding: var(--bb-space-16) var(--bb-space-16); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--dm-surface, #fff); }
.mod-upload-head { margin-bottom: var(--bb-space-12); }
.mod-upload-head b { display: block; font-size: var(--bb-text-lg); font-weight: 700; color: var(--bb-text); }
.mod-upload-head small { display: block; margin-top: var(--bb-space-2); font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
.mod-upload-foot { display: flex; justify-content: flex-end; gap: var(--bb-space-8); margin-top: var(--bb-space-12); }
@media (max-width: 767px) {
    .mod-kpis { grid-template-columns: repeat(2, 1fr); gap: var(--bb-space-8); }
    .mod-kpis .um-kpi { padding: var(--bb-space-8) var(--bb-space-12); }
    .mod-kpis .um-kpi b { font-size: var(--bb-text-2xl); }
    .mod-name small { display: none; }
}

/* == K2: cash-flow, spreadsheet, catalogue, barcode, backup == */
/* ── Page header count pill ──────────────────────────── */
.bc-count-pill {
display: inline-flex;
align-items: center;
padding: var(--bb-space-4) var(--bb-space-12);
background: var(--dm-tint);
color: var(--dm-primary-text);
font-size: var(--bb-text-xs);
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
border-radius: var(--bb-radius-xl);
border: 1px solid var(--dm-primary-border);
margin-left: var(--bb-space-8);
vertical-align: middle;
position: relative;
top: -2px;
}
/* ── Card ────────────────────────────────────────────── */
.bc-card {
background: var(--dm-surface);
border-radius: var(--bb-radius-lg);
border: 1px solid var(--dm-border);
box-shadow: var(--bb-shadow-xs);
overflow: hidden;
}
/* ── Toolbar ─────────────────────────────────────────── */
.bc-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--bb-space-12) var(--bb-space-20);
background: var(--dm-surface);
border-bottom: 1px solid var(--dm-border);
gap: var(--bb-space-12);
}
.bc-search-wrap {
position: relative;
flex: 1;
max-width: 300px;
}
.bc-search-icon {
position: absolute;
left: 0.7rem;
top: 50%;
transform: translateY(-50%);
color: var(--bb-text-faint);
pointer-events: none;
display: flex;
}
.bc-search-input {
width: 100%;
height: 36px;
padding: 0 var(--bb-space-12) 0 var(--bb-space-32);
border: 1px solid var(--dm-border);
border-radius: var(--bb-radius-md);
font-size: var(--bb-text-base);
color: var(--dm-text, var(--bb-text-strong));
background: var(--dm-surface);
outline: none;
transition: border-color 0.15s, box-shadow 0.15s;
}
.bc-search-input::placeholder { color: var(--dm-muted); }
.bc-search-input:focus {
border-color: var(--bb-primary);
box-shadow: var(--bb-shadow-ring);
}
/* ── Table ───────────────────────────────────────────── */
.bc-table-wrap { overflow-x: auto; }
#barcode_table {
width: 100% !important;
border-collapse: collapse;
font-size: var(--bb-text-base);
}
#barcode_table thead tr {
background: var(--dm-surface);
border-bottom: 2px solid var(--dm-border);
}
#barcode_table thead th {
padding: var(--bb-space-12) var(--bb-space-16);
font-size: var(--bb-text-xs);
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.07em;
color: var(--bb-text-body);
border: none !important;
white-space: nowrap;
}
#barcode_table thead th:nth-child(1) { width: 34%; }
#barcode_table thead th:nth-child(2) { width: 41%; }
#barcode_table thead th:nth-child(3) { width: 25%; text-align: right; padding-right: var(--bb-space-20); }
#barcode_table tbody tr {
border-bottom: 1px solid var(--dm-primary-border);
transition: background 0.1s;
position: relative;
}
#barcode_table tbody tr:last-child { border-bottom: none; }
#barcode_table tbody tr:hover { background: var(--dm-tint); }
#barcode_table tbody td {
padding: var(--bb-space-16) var(--bb-space-16);
border: none !important;
vertical-align: middle;
color: var(--dm-text, var(--bb-text-strong));
}
#barcode_table tbody td:last-child { text-align: right; padding-right: var(--bb-space-20); }
/* ── Name cell ───────────────────────────────────────── */
.bc-name {
font-weight: 600;
color: var(--dm-text, var(--bb-text));
font-size: var(--bb-text-md);
display: flex;
align-items: center;
gap: var(--bb-space-8);
flex-wrap: wrap;
}
.bc-badge-default {
display: inline-flex;
align-items: center;
gap: var(--bb-space-4);
padding: var(--bb-space-2) var(--bb-space-8);
font-size: var(--bb-text-xs);
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.07em;
background: var(--dm-success-bg);
color: var(--dm-success-text);
border-radius: var(--bb-radius-xl);
border: 1px solid var(--dm-success-border);
line-height: 1.4;
}
/* ── Description cell ────────────────────────────────── */
.bc-desc { color: var(--dm-body, var(--bb-text-muted)); line-height: 1.5; }
.bc-desc-empty { color: var(--bb-text-body); font-style: italic; font-size: var(--bb-text-sm); }
/* ── Action buttons ──────────────────────────────────── */
.bc-actions {
display: inline-flex;
align-items: center;
gap: var(--bb-space-4);
justify-content: flex-end;
}
.bc-btn {
display: inline-flex;
align-items: center;
gap: var(--bb-space-4);
padding: var(--bb-space-4) var(--bb-space-12);
font-size: var(--bb-text-sm);
font-weight: 500;
border-radius: var(--bb-radius-sm);
border: 1px solid transparent;
cursor: pointer;
text-decoration: none;
transition: all 0.13s;
line-height: 1.4;
white-space: nowrap;
background: none;
}
.bc-btn-edit {
background: var(--dm-info-bg);
color: var(--dm-info-text, var(--bb-info));
border-color: var(--dm-info-border);
}
.bc-btn-edit:hover { background: var(--dm-info-bg); color: var(--dm-info-text, var(--bb-info)); text-decoration: none; }
.bc-btn-delete {
background: var(--dm-danger-bg);
color: var(--bb-danger);
border-color: var(--dm-danger-border);
}
.bc-btn-delete:hover:not(:disabled) { background: var(--dm-danger-bg); color: var(--bb-danger-text); }
.bc-btn-delete:disabled { opacity: 0.35; cursor: not-allowed; }
.bc-btn-is-default {
background: var(--dm-success-bg);
color: var(--dm-success-text);
border-color: var(--dm-success-border);
cursor: default;
}
.bc-btn-set-default {
background: var(--dm-tint);
color: var(--dm-primary-text);
border-color: var(--bb-warning-border);
}
.bc-btn-set-default:hover { background: var(--dm-tint); color: var(--dm-primary-text); }
/* ── Processing overlay ──────────────────────────────── */
#barcode_table_processing {
background: var(--bb-glass) !important;
border: none !important;
box-shadow: none !important;
font-size: var(--bb-text-base);
color: var(--bb-primary-text);
font-weight: 600;
}
/* ── Footer ──────────────────────────────────────────── */
.bc-footer {
padding: var(--bb-space-12) var(--bb-space-20);
background: var(--dm-surface);
border-top: 1px solid var(--dm-border);
font-size: var(--bb-text-sm);
color: var(--bb-text-body);
display: flex;
align-items: center;
justify-content: space-between;
}
/* ── Empty state ─────────────────────────────────────── */
.bc-empty-state {
padding: var(--bb-space-48) var(--bb-space-24);
text-align: center;
}
.bc-empty-icon {
width: 48px;
height: 48px;
margin: 0 auto var(--bb-space-16);
background: var(--dm-tint);
border-radius: var(--bb-radius-circle);
display: flex;
align-items: center;
justify-content: center;
color: var(--bb-primary);
}
.bc-empty-title {
font-size: var(--bb-text-md);
font-weight: 700;
color: var(--dm-text, var(--bb-text));
margin-bottom: var(--bb-space-6);
}
.bc-empty-text {
font-size: var(--bb-text-base);
color: var(--bb-text-muted);
}
/* ── Hide default DataTable controls ─────────────────── */
#barcode_table_filter,
#barcode_table_length,
#barcode_table_wrapper .dataTables_filter,
#barcode_table_wrapper .dataTables_length,
#barcode_table_wrapper .dataTables_info { display: none !important; }
.cf-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--bb-space-12); margin-bottom: var(--bb-space-16); }
@media (max-width: 767px) { .cf-kpis { grid-template-columns: 1fr; } }
.cf-kpi { padding: var(--bb-space-16) var(--bb-space-16); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--bb-surface-raised); }
.cf-kpi span { display: block; font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); }
.cf-kpi b { display: block; margin-top: var(--bb-space-2); font-size: var(--bb-text-3xl); font-weight: 700; color: var(--bb-text); font-variant-numeric: tabular-nums; line-height: 1.2; }
.cf-kpi small { font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); }
.cf-kpi.is-in { background: var(--dm-success-bg, var(--bb-success-bg)); border-color: var(--dm-success-border, var(--bb-success-border)); } .cf-kpi.is-in b, .cf-kpi.is-in span { color: var(--dm-success-text, var(--bb-success-text)); }
.cf-kpi.is-out { background: var(--dm-danger-bg, var(--bb-danger-bg)); border-color: var(--dm-danger-border, var(--bb-danger-border)); } .cf-kpi.is-out b, .cf-kpi.is-out span { color: var(--dm-danger-text, var(--bb-danger-text)); }
.cf-kpi.is-net { background: var(--bb-primary-tint); border-color: var(--bb-primary-border-soft); } .cf-kpi.is-net b { color: var(--bb-primary-text); } .cf-kpi.is-net b.is-neg { color: var(--dm-danger-text, var(--bb-danger-text)); }
.cf-note { margin: calc(-1 * var(--bb-space-8)) 0 var(--bb-space-16); font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
#cash_flow_table > tbody > tr > td { height: 56px; padding-top: var(--bb-space-6); padding-bottom: var(--bb-space-6); vertical-align: middle; }
#cash_flow_table .cf-desc { max-width: 520px; line-height: 1.3; }
#cash_flow_table .cf-desc b { font-size: var(--bb-text-md); color: var(--bb-text); }
#cash_flow_table .cf-desc .cf-ref { margin-left: var(--bb-space-6); font-size: var(--bb-text-base); }
#cash_flow_table .cf-desc small { display: block; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
#cash_flow_table .cf-acct { display: inline-block; padding: var(--bb-space-2) var(--bb-space-8); border-radius: var(--bb-radius-full); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); font-size: var(--bb-text-sm); font-weight: 700; white-space: nowrap; }
#cash_flow_table .cf-none { color: var(--bb-text-label); }
#cash_flow_table td.cf-in { color: var(--dm-success-text, var(--bb-success-text)); font-weight: 700; } #cash_flow_table td.cf-out { color: var(--dm-danger-text, var(--bb-danger-text)); font-weight: 700; }

/* == superadmin (group H) == */
/* business/partials/modules */
.pm-h { font-size: var(--bb-text-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bb-text-muted); margin-bottom: var(--bb-space-8); }
.pm-h-sub { margin-top: var(--bb-space-16); }
.pm-muted { color: var(--bb-text-label); font-weight: 600; }
.pm-list { display: flex; flex-wrap: wrap; gap: var(--bb-space-8); }
.pm-mod { display: inline-flex; align-items: center; gap: var(--bb-space-6); padding: var(--bb-space-6) var(--bb-space-12); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-md); background: var(--bb-surface); font-size: var(--bb-text-base); }
.pm-mod b { font-weight: 700; color: var(--bb-text); }
.pm-mod-addon { border-color: var(--bb-info); }
.pm-mod-avail { border-style: dashed; }
.pm-mod-avail b { font-weight: 600; color: var(--bb-text-muted); }
.pm-price { font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-text-muted); }
.pm-pill { display: inline-flex; align-items: center; font-size: var(--bb-text-xs); font-weight: 700; border-radius: var(--bb-radius-full); padding: var(--bb-space-2) var(--bb-space-8); white-space: nowrap; }
.pm-pill-info { background: var(--bb-info-bg); color: var(--bb-info-text); }
.pm-pill-warn { background: var(--bb-warning-bg); color: var(--bb-warning-text); }
.pm-pill-muted { background: var(--bb-surface-raised); color: var(--bb-text-muted); border: 1px solid var(--bb-border); }
/* packages/partials/form_css */
/* stylelint-disable scale-unlimited/declaration-strict-value -- moved as-is from the page: shadow geometry, 50% radius, mono font have no token */
.pf-wrap { padding: var(--bb-space-16) var(--bb-space-24) 0; }
/* .pf is also the printer form in custom-style.css (max-width 920px) */
#package_form .pf { max-width: none; }
#package_form .pf { display: grid; grid-template-columns: 190px minmax(0, 1fr) 340px; gap: var(--bb-space-16); align-items: start; }
.pf-card { scroll-margin-top: 80px; }
.pf-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: var(--bb-space-2); padding: var(--bb-space-8); background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); }
.pf-nav-h { padding: var(--bb-space-4) var(--bb-space-8) var(--bb-space-8); font-size: var(--bb-text-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bb-text-muted); }
.pf-nav-a { display: flex; align-items: center; gap: var(--bb-space-8); padding: var(--bb-space-6) var(--bb-space-8); border-radius: var(--bb-radius-md); font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); text-decoration: none !important; }
.pf-nav-a span { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: var(--bb-radius-md); font-size: var(--bb-text-xs); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); color: var(--bb-text-muted); }
.pf-nav-a:hover { background: var(--bb-surface-raised); color: var(--bb-text); }
.pf-nav-a.is-on { background: var(--bb-primary-tint); color: var(--bb-primary-text); }
.pf-nav-a.is-on span { background: var(--bb-primary); border-color: var(--bb-primary); color: var(--bb-on-primary); }
.pf-nav-a.has-error span { background: var(--bb-danger-text); border-color: var(--bb-danger-text); color: var(--bb-on-fill); }
.pf-main { display: flex; flex-direction: column; gap: var(--bb-space-16); min-width: 0; }
.pf-card { background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); box-shadow: var(--bb-shadow-sm); padding: var(--bb-space-16) var(--bb-space-20) var(--bb-space-8); }
.pf-card-h { display: flex; align-items: center; gap: var(--bb-space-12); margin-bottom: var(--bb-space-16); padding-bottom: var(--bb-space-12); border-bottom: 1px solid var(--bb-border); }
.pf-ic { width: 34px; height: 34px; border-radius: var(--bb-radius-md); flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--bb-primary-tint); border: 1px solid var(--bb-primary-border-soft); }
.pf-ic svg { width: 17px; height: 17px; stroke: var(--bb-primary); }
.pf-card-t { font-size: var(--bb-text-md); font-weight: 700; letter-spacing: -0.01em; color: var(--bb-text); }
.pf-card-s { font-size: var(--bb-text-xs); font-weight: 500; color: var(--bb-text-muted); margin-top: 1px; }

.pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--bb-space-16); }
.pf-span2 { grid-column: span 2; }
.pf .bb-field { margin-bottom: var(--bb-space-16); }
.pf label { font-size: var(--bb-text-xs); font-weight: 700; letter-spacing: 0.02em; color: var(--bb-text-body); margin-bottom: var(--bb-space-4); }
.pf .bb-control { height: 40px; border-radius: var(--bb-radius-md) !important; font-size: var(--bb-text-base); box-shadow: none; }
.pf textarea.bb-control { height: auto; resize: vertical; }
.pf .bb-control:focus { border-color: var(--bb-primary) !important; box-shadow: var(--bb-shadow-ring); }
.pf .bb-iaddon { border-radius: var(--bb-radius-md) 0 0 var(--bb-radius-md); background: var(--bb-surface-raised); border-color: var(--bb-border-input); color: var(--bb-text-muted); min-width: 44px; }
.pf .bb-igroup .bb-control { border-radius: 0 var(--bb-radius-md) var(--bb-radius-md) 0 !important; }
.pf .select2-container--default .select2-selection--multiple { border-radius: var(--bb-radius-md); min-height: 40px; border-color: var(--bb-border-input); }

/* one price per billing period */
.pf-prices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bb-space-12); margin-bottom: var(--bb-space-16); }
.pf-price { padding: var(--bb-space-8) var(--bb-space-12); border-radius: var(--bb-radius-md); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); }
.pf-price:has(input:not(:placeholder-shown)) { border-color: var(--bb-primary-border-soft); background: var(--bb-primary-tint); }
.pf-price-l { display: block; margin-bottom: var(--bb-space-6); font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-text); }
.pf-price-hint { display: block; min-height: 1.1em; margin-top: var(--bb-space-4); font-size: var(--bb-text-xs); font-weight: 600; color: var(--bb-success); }
@media (max-width: 640px) { .pf-prices { grid-template-columns: 1fr; } }
.pf-period { display: flex; align-items: center; gap: var(--bb-space-8); flex-wrap: wrap; }
.pf-period .bb-control { width: 90px; flex: 0 0 90px; }
.pf-period select.bb-control { width: 140px; flex: 0 0 140px; }
.pf-every { font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-text-muted); }
.pf-presets { display: inline-flex; gap: var(--bb-space-2); margin-left: auto; padding: var(--bb-space-2); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-md); }
.pf-presets button { height: 30px; padding: 0 var(--bb-space-12); border: 0; border-radius: var(--bb-radius-md); background: transparent; font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-text-muted); cursor: pointer; }
.pf-presets button:hover, .pf-presets button.is-active { background: var(--bb-surface); color: var(--bb-primary-text); box-shadow: var(--bb-shadow-sm); }

.pf-limit { position: relative; display: flex; align-items: center; }
.pf-limit > svg { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--bb-primary-text); pointer-events: none; }
.pf-limit .bb-control { padding-left: var(--bb-space-40) !important; padding-right: var(--bb-space-48) !important; }
.pf-inf { position: absolute; right: 5px; height: 30px; min-width: 34px; border-radius: var(--bb-radius-md); border: 1px solid var(--bb-border); background: var(--bb-surface-raised); font-size: var(--bb-text-lg); font-weight: 700; line-height: 1; color: var(--bb-text-muted); cursor: pointer; }
.pf-inf:hover { background: var(--bb-primary-tint); color: var(--bb-primary-text); border-color: var(--bb-primary-border-soft); }

/* switches */
.pf-features, .pf-switches { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--bb-space-8); margin-bottom: var(--bb-space-16); }
.pf-feature-input { grid-column: 1 / -1; }
.pf-switch { display: flex; align-items: center; gap: var(--bb-space-12); margin: 0 !important; padding: var(--bb-space-8) var(--bb-space-12); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-md); background: var(--bb-surface-raised); cursor: pointer; font-size: var(--bb-text-base) !important; font-weight: 600 !important; letter-spacing: 0 !important; color: var(--bb-text) !important; transition: border-color 0.12s, background 0.12s; }
.pf-switch:hover { border-color: var(--bb-border-strong); }
.pf-switch input { position: absolute; opacity: 0; pointer-events: none; }
.pf-switch i { position: relative; flex-shrink: 0; width: 34px; height: 20px; border-radius: var(--bb-radius-full); background: var(--bb-border-strong); transition: background 0.15s; }
.pf-switch i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: var(--bb-radius-circle); background: var(--bb-surface); box-shadow: var(--bb-shadow-sm); transition: transform 0.15s; }
.pf-switch input:checked + i { background: var(--bb-primary); }
.pf-switch input:checked + i::after { transform: translateX(14px); }
.pf-switch input:focus-visible + i { outline: 2px solid var(--bb-primary); outline-offset: 2px; }
.pf-switch:has(input:checked) { border-color: var(--bb-primary-border-soft); background: var(--bb-primary-tint); }
.pf-note { margin: -0.4rem 0 var(--bb-space-16); font-size: var(--bb-text-xs); color: var(--bb-text-body); }
.pf-custom-link { padding-top: var(--bb-space-4); }
.pf-card-link { margin-left: auto; font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-primary-text); white-space: nowrap; }
.pf-empty { margin: 0 0 var(--bb-space-16); padding: var(--bb-space-16); border: 1px dashed var(--bb-border-strong); border-radius: var(--bb-radius-md); text-align: center; font-size: var(--bb-text-base); color: var(--bb-text-muted); }
.pf-achip { margin-left: auto; font-style: normal; font-size: var(--bb-text-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: var(--bb-space-2) var(--bb-space-6); border-radius: var(--bb-radius-full); color: var(--bb-info-text); background: var(--bb-info-bg); }

/* quick fill + comparison */
.pf-fill { margin: 0 0 var(--bb-space-16); padding: var(--bb-space-12) var(--bb-space-16); border-radius: var(--bb-radius-md); border: 1px dashed var(--bb-primary-border-soft); background: color-mix(in srgb, var(--bb-primary-tint) 55%, var(--bb-surface)); }
.pf-fill-t { display: flex; gap: var(--bb-space-8); align-items: flex-start; margin-bottom: var(--bb-space-8); }
.pf-fill-t svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: var(--bb-space-2); color: var(--bb-primary-text); }
.pf-fill-t b { display: block; font-size: var(--bb-text-base); color: var(--bb-text); }
.pf-fill-t span { display: block; font-size: var(--bb-text-xs); color: var(--bb-text); }
.pf-fill-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--bb-space-8); }
.pf .pf-fill-off { display: flex; flex-direction: column; gap: var(--bb-space-2); margin: 0; font-size: var(--bb-text-xs); color: var(--bb-text); }
.pf-fill-in { position: relative; display: block; }
.pf-fill-in input, .pf-fill-sel { width: 92px; height: 34px; padding: 0 var(--bb-space-24) 0 var(--bb-space-8) !important; border-radius: var(--bb-radius-md); border: 1px solid var(--bb-border-input); background: var(--bb-surface); font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-text); }
.pf-fill-sel { width: 120px; padding-right: var(--bb-space-6) !important; }
.pf-fill-in i { position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%); font-style: normal; font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text); pointer-events: none; }
.pf-fill-btn { height: 34px; padding: 0 var(--bb-space-16); border-radius: var(--bb-radius-md); border: 1px solid var(--bb-primary); background: var(--bb-surface); color: var(--bb-primary-text); font-size: var(--bb-text-sm); font-weight: 700; cursor: pointer; }
.pf-fill-btn:hover { background: var(--bb-primary); color: var(--bb-on-primary); }
.pf-fill-msg { min-height: 0; font-size: var(--bb-text-xs); font-weight: 600; color: var(--bb-danger-text); }
.pf-fill-msg:not(:empty) { margin-top: var(--bb-space-6); }
.pf-compare { width: 100%; margin-bottom: var(--bb-space-6); border-collapse: separate; border-spacing: 0; border: 1px solid var(--bb-border); border-radius: var(--bb-radius-md); overflow: hidden; font-size: var(--bb-text-sm); }
.pf-compare th { padding: var(--bb-space-6) var(--bb-space-12); background: var(--bb-surface-raised); font-size: var(--bb-text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bb-text-muted); text-align: right; }
.pf-compare td { padding: var(--bb-space-6) var(--bb-space-12); border-top: 1px solid var(--bb-border); text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--bb-text); }
.pf-compare th:first-child, .pf-compare td:first-child { text-align: left; }
.pf-compare tr.is-off td { color: var(--bb-text-muted); font-weight: 500; }
.pf-compare .c-save b { padding: var(--bb-space-2) var(--bb-space-6); border-radius: var(--bb-radius-full); background: var(--bb-success-bg); color: var(--bb-success-text); font-size: var(--bb-text-xs); }
.pf-compare .c-save b.is-bad { background: var(--bb-danger-bg); color: var(--bb-danger-text); }

/* add-ons per plan */
.pf-seg { display: inline-flex; flex-wrap: wrap; gap: var(--bb-space-2); padding: var(--bb-space-2); margin-bottom: var(--bb-space-12); border-radius: var(--bb-radius-md); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); }
.pf .pf-seg label { margin: 0; cursor: pointer; }
.pf-seg input { position: absolute; opacity: 0; pointer-events: none; }
.pf-seg span { display: block; padding: var(--bb-space-6) var(--bb-space-12); border-radius: var(--bb-radius-md); font-size: var(--bb-text-sm); font-weight: 700; letter-spacing: 0; color: var(--bb-text-muted); }
.pf-seg input:checked + span { background: var(--bb-surface); color: var(--bb-primary-text); box-shadow: var(--bb-shadow-sm); }
.pf-addons { display: flex; flex-direction: column; gap: var(--bb-space-8); margin-bottom: var(--bb-space-16); }
.pf-addon { display: flex; align-items: center; gap: var(--bb-space-12); padding: var(--bb-space-8) var(--bb-space-12); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-md); background: var(--bb-surface-raised); }
.pf-addon.is-off { opacity: 0.65; }
.pf-addon:has(.pf-tick-inc input:checked) { border-color: var(--bb-primary-border-soft); background: var(--bb-primary-tint); }
.pf-addon-i { flex: 1; min-width: 0; }
.pf-addon-i b { display: block; font-size: var(--bb-text-base); color: var(--bb-text); }
.pf-addon-i span { display: block; font-size: var(--bb-text-xs); color: var(--bb-text-muted); }
.pf-addon-i em { font-style: normal; color: var(--bb-danger-text); }
.pf .pf-tick { display: inline-flex; align-items: center; gap: var(--bb-space-6); margin: 0; cursor: pointer; font-size: var(--bb-text-xs); font-weight: 700; letter-spacing: 0; color: var(--bb-text); white-space: nowrap; }
.pf-tick input { position: absolute; opacity: 0; pointer-events: none; }
.pf-tick i { width: 18px; height: 18px; border-radius: var(--bb-radius-sm); border: 1.5px solid var(--bb-border-strong); background: var(--bb-surface); display: inline-flex; align-items: center; justify-content: center; }
.pf-tick input:checked + i { background: var(--bb-primary); border-color: var(--bb-primary); }
.pf-tick input:checked + i::after { content: ''; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.pf-tick input:focus-visible + i { outline: 2px solid var(--bb-primary); outline-offset: 2px; }
.pf-addons.is-all .pf-tick-buy { opacity: 0.45; pointer-events: none; }
.pf-addon.is-included .pf-tick-buy { opacity: 0.35; pointer-events: none; }

/* modules: one choice each */
.pf-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--bb-space-8); margin-bottom: var(--bb-space-16); }
.pf-mod { display: flex; align-items: center; gap: var(--bb-space-12); padding: var(--bb-space-8) var(--bb-space-8) var(--bb-space-8) var(--bb-space-12); border: 1px solid var(--bb-border); border-left: 3px solid var(--bb-border-strong); border-radius: var(--bb-radius-md); background: var(--bb-surface-raised); }
.pf-mod.is-included { border-left-color: var(--bb-success); }
.pf-mod.is-addon { border-left-color: var(--bb-info); }
.pf-mod.is-off { opacity: .8; }
.pf-mod-i { flex: 1; min-width: 0; }
.pf-mod-i b { display: block; font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-mod-i span { display: block; font-size: var(--bb-text-xs); color: var(--bb-text-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-mod-i em { font-style: normal; color: var(--bb-danger-text); }
.pf-mseg { display: inline-flex; flex-shrink: 0; gap: var(--bb-space-2); padding: var(--bb-space-2); border-radius: var(--bb-radius-md); background: var(--bb-surface); border: 1px solid var(--bb-border); }
.pf .pf-mseg label { margin: 0; cursor: pointer; }
.pf-mseg input { position: absolute; opacity: 0; pointer-events: none; }
.pf-mseg span { display: block; padding: var(--bb-space-4) var(--bb-space-8); border-radius: var(--bb-radius-md); font-size: var(--bb-text-xs); font-weight: 700; letter-spacing: 0; color: var(--bb-text-body); white-space: nowrap; }
.pf-mseg label:has(input[value=included]:checked) span { background: var(--bb-success-bg); color: var(--bb-success-text); }
.pf-mseg label:has(input[value=addon]:checked) span { background: var(--bb-info-bg); color: var(--bb-info-text); }
.pf-mseg label:has(input[value=off]:checked) span { background: var(--bb-surface-raised); color: var(--bb-text); box-shadow: inset 0 0 0 1px var(--bb-border-strong); }
.pf-mseg input:focus-visible + span { outline: 2px solid var(--bb-primary); outline-offset: 1px; }
.pf-mseg label.is-na { cursor: not-allowed; opacity: .4; }
.pf-mod-settings { padding-top: var(--bb-space-2); border-top: 1px dashed var(--bb-border); }

/* subscribers */
.pf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--bb-space-8); margin-bottom: var(--bb-space-16); }
.pf-stat { padding: var(--bb-space-12) var(--bb-space-12); border-radius: var(--bb-radius-md); border: 1px solid var(--bb-border); background: var(--bb-surface-raised); }
.pf-stat b { display: block; font-size: var(--bb-text-2xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--bb-text); font-variant-numeric: tabular-nums; }
.pf-stat span { font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-text-muted); }
.pf-stat.is-good b { color: var(--bb-success-text); }
.pf-stat.is-warn b { color: var(--bb-warning-text); }
.pf-impact-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bb-space-8); margin-bottom: var(--bb-space-12); }
.pf-impact-row .pf-switch { flex: 1 1 260px; }
.pf-btn-ghost { display: inline-flex; align-items: center; gap: var(--bb-space-6); height: 38px; padding: 0 var(--bb-space-16); border-radius: var(--bb-radius-md); border: 1px solid var(--bb-border-strong); background: var(--bb-surface); font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text); cursor: pointer; }
.pf-btn-ghost svg { width: 14px; height: 14px; }
.pf-btn-ghost:hover { border-color: var(--bb-primary); color: var(--bb-primary-text); }
.pf-btn-ghost:disabled { opacity: 0.6; cursor: wait; }
.pf-note-tight { margin: 0 0 var(--bb-space-12); }
.pf-impact { margin-bottom: var(--bb-space-16); padding: var(--bb-space-12) var(--bb-space-16); border-radius: var(--bb-radius-md); border: 1px solid var(--bb-border); background: var(--bb-surface-raised); font-size: var(--bb-text-sm); color: var(--bb-text); }
.pf-impact.is-change { border-color: color-mix(in srgb, var(--bb-warning) 40%, var(--bb-border)); background: var(--bb-warning-bg); }
.pf-impact ul { margin: var(--bb-space-6) 0 var(--bb-space-4); padding-left: var(--bb-space-16); }
.pf-impact li { margin: var(--bb-space-2) 0; }
.pf-impact li small { color: var(--bb-text-muted); font-weight: 600; }
.pf-impact p { margin: var(--bb-space-4) 0 0; font-size: var(--bb-text-xs); color: var(--bb-text-muted); }

/* live preview */
.pf-aside { position: sticky; top: 76px; }
.pf-preview { background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); box-shadow: var(--bb-shadow-sm); overflow: hidden; }
.pf-preview-h { padding: var(--bb-space-12) var(--bb-space-16); font-size: var(--bb-text-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bb-text-muted); background: var(--bb-surface-raised); border-bottom: 1px solid var(--bb-border); }
.pf-pv { position: relative; padding: var(--bb-space-16) var(--bb-space-20) var(--bb-space-16); }
.pf-pv::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--bb-border-strong); }
.pf-pv.is-popular::before { background: linear-gradient(90deg, var(--bb-primary), var(--bb-accent)); }
.pf-pv-pop { position: absolute; right: 0.9rem; top: 0.9rem; font-size: var(--bb-text-xs); font-weight: 700; padding: var(--bb-space-2) var(--bb-space-8); border-radius: var(--bb-radius-full); color: var(--bb-on-primary); background: linear-gradient(135deg, var(--bb-primary), var(--bb-accent)); }
.pf-pv-name { font-size: var(--bb-text-lg); font-weight: 700; letter-spacing: -0.015em; color: var(--bb-text); padding-right: var(--bb-space-64); min-height: 1.3rem; overflow-wrap: anywhere; }
.pf-pv-tags { display: flex; flex-wrap: wrap; gap: var(--bb-space-4); margin-top: var(--bb-space-6); min-height: 1.2rem; }
.pf-pv-tags span { font-size: var(--bb-text-xs); font-weight: 700; padding: var(--bb-space-2) var(--bb-space-8); border-radius: var(--bb-radius-full); }
.pf-pv-price { margin-top: var(--bb-space-8); font-size: var(--bb-text-3xl); font-weight: 700; letter-spacing: -0.03em; color: var(--bb-text); font-variant-numeric: tabular-nums; }
.pf-pv-price small { font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); letter-spacing: 0; }
.pf-pv-desc { margin: var(--bb-space-4) 0 0; min-height: 2.4rem; font-size: var(--bb-text-sm); line-height: 1.45; color: var(--bb-text-muted); overflow-wrap: anywhere; }
.pf-pv-limits { list-style: none; margin: var(--bb-space-12) 0 0; padding: var(--bb-space-6) 0 0; border-top: 1px solid var(--bb-border); }
.pf-pv-limits li { display: flex; align-items: center; gap: var(--bb-space-8); padding: var(--bb-space-6) 0; font-size: var(--bb-text-sm); font-weight: 600; color: var(--bb-text-muted); }
.pf-pv-limits li svg { width: 13px; height: 13px; color: var(--bb-primary-text); flex-shrink: 0; }
.pf-pv-limits li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-pv-limits li b { color: var(--bb-text); font-weight: 700; }
.pf-pv-periods { display: flex; flex-wrap: wrap; gap: var(--bb-space-2); margin-top: var(--bb-space-12); padding: var(--bb-space-2); border-radius: var(--bb-radius-md); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); }
.pf-pv-periods:empty { display: none; }
.pf-pv-periods button { flex: 1 1 auto; border: 0; background: transparent; padding: var(--bb-space-4) var(--bb-space-6); border-radius: var(--bb-radius-md); font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-text-muted); cursor: pointer; white-space: nowrap; }
.pf-pv-periods button em { font-style: normal; color: var(--bb-success-text); margin-left: var(--bb-space-2); }
.pf-pv-periods button.is-on { background: var(--bb-surface); color: var(--bb-primary-text); box-shadow: var(--bb-shadow-sm); }
.pf-pv-sub { min-height: 1.1em; font-size: var(--bb-text-xs); font-weight: 600; color: var(--bb-text-muted); }
.pf-pv-sub b { color: var(--bb-success-text); }
.pf-pv-feats { list-style: none; margin: var(--bb-space-8) 0 0; padding: var(--bb-space-8) 0 0; border-top: 1px solid var(--bb-border); }
.pf-pv-feats:empty { display: none; }
.pf-pv-feats li { display: flex; gap: var(--bb-space-6); align-items: baseline; padding: var(--bb-space-2) 0; font-size: var(--bb-text-xs); font-weight: 600; color: var(--bb-text); }
.pf-pv-feats li::before { content: '✓'; font-weight: 700; color: var(--bb-success-text); }
.pf-pv-feats li.is-more { color: var(--bb-text-muted); }
.pf-pv-feats li.is-more::before { content: ''; }
.pf-pv-inc { margin-top: var(--bb-space-8); padding: var(--bb-space-8) var(--bb-space-12); border-radius: var(--bb-radius-md); background: var(--bb-primary-tint); border: 1px solid var(--bb-primary-border-soft); }
.pf-pv-inc-h { font-size: var(--bb-text-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bb-primary-text); margin-bottom: var(--bb-space-2); }
.pf-pv-inc div div { font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-text); }
.pf-pv-inc div div::before { content: '+ '; color: var(--bb-primary-text); }

/* sticky action bar */
.pf-bar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: flex-end; gap: var(--bb-space-8); flex-wrap: wrap; margin: var(--bb-space-16) -1.5rem 0; padding: var(--bb-space-12) var(--bb-space-24);
    background: color-mix(in srgb, var(--bb-surface) 92%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--bb-border); box-shadow: var(--bb-shadow-sm); }
.pf-bar-hint { margin-right: auto; font-size: var(--bb-text-sm); font-weight: 500; color: var(--bb-text-muted); }
.pf-btn-cancel { display: inline-flex; align-items: center; height: 38px; padding: 0 var(--bb-space-16); border-radius: var(--bb-radius-md); font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-text-muted); background: var(--bb-surface); border: 1px solid var(--bb-border-strong); text-decoration: none; }
.pf-btn-cancel:hover { background: var(--bb-surface-raised); color: var(--bb-text); text-decoration: none; }
.pf-btn-save { display: inline-flex; align-items: center; gap: var(--bb-space-6); height: 38px; padding: 0 var(--bb-space-20); border: 0; border-radius: var(--bb-radius-md); cursor: pointer; font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-on-primary);
    background: linear-gradient(135deg, var(--bb-primary) 0%, var(--bb-accent) 100%); box-shadow: 0 2px 8px color-mix(in srgb, var(--bb-primary) 38%, transparent); transition: transform 0.12s, box-shadow 0.12s; }
.pf-btn-save svg { width: 15px; height: 15px; }
.pf-btn-save:hover { transform: translateY(-1px); box-shadow: 0 5px 14px color-mix(in srgb, var(--bb-primary) 45%, transparent); }
.pf-btn-save:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.pf .error, .pf label.error { color: var(--bb-danger-text); font-size: var(--bb-text-xs); font-weight: 600; margin-top: var(--bb-space-4); }

@media (max-width: 1400px) { #package_form .pf { grid-template-columns: minmax(0, 1fr) 320px; } .pf-nav { display: none; } }
@media (max-width: 1100px) { #package_form .pf { grid-template-columns: 1fr; } .pf-aside { position: static; order: 2; } .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .pf-wrap { padding: var(--bb-space-12) var(--bb-space-16) 0; } .pf-grid { grid-template-columns: 1fr; } .pf-span2 { grid-column: auto; } .pf-bar { margin: var(--bb-space-16) -1rem 0; padding: var(--bb-space-12) var(--bb-space-16); } .pf-presets { margin-left: 0; } }
/* stylelint-enable scale-unlimited/declaration-strict-value */

/* == superadmin r2 == */
/* stylelint-disable scale-unlimited/declaration-strict-value -- moved as-is from the page: shadow geometry has no token */
.er-period { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--bb-space-8); margin-bottom: var(--bb-space-16); }
.er-ranges { display: inline-flex; flex-wrap: wrap; gap: var(--bb-space-4); padding: var(--bb-space-4); border-radius: var(--bb-radius-lg); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); }
.er-range { padding: var(--bb-space-6) var(--bb-space-12); border-radius: var(--bb-radius-md); font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted) !important; text-decoration: none !important; }
.er-range:hover { color: var(--bb-text) !important; }
.er-range.is-on { background: var(--bb-surface); color: var(--bb-text) !important; box-shadow: 0 1px 3px rgb(var(--bb-gray-900-rgb, 27 27 30) / 0.12); }
.er-custom { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--bb-space-6); }
@media (max-width: 640px) { .er-ranges, .er-custom { width: 100%; } .er-custom .bb-control { flex: 1 1 110px; width: auto; min-width: 0; } }
.er-custom .bb-control { width: 120px; }
.er-card b span { font: inherit; text-transform: none; letter-spacing: inherit; color: inherit; }
.er-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--bb-space-12); margin-bottom: var(--bb-space-16); }
.er-card { display: flex; flex-direction: column; gap: var(--bb-space-2); padding: var(--bb-space-16) var(--bb-space-16); border-radius: var(--bb-radius-lg); background: var(--bb-surface); border: 1px solid var(--bb-border); }
.er-card > span { font-size: var(--bb-text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bb-text-muted); }
.er-card b { font-size: var(--bb-text-3xl); font-weight: 700; line-height: 1.15; color: var(--bb-text); font-variant-numeric: tabular-nums; }
.er-card small { font-size: var(--bb-text-xs); color: var(--bb-text-muted); }
.er-card-main { background: linear-gradient(135deg, var(--bb-primary-tint), var(--bb-surface)); border-color: var(--bb-primary-border-soft); }
.er-card-main b { color: var(--bb-primary-text); }
.er-card-warn b { color: var(--bb-warning-text); }
.er-card-now b { color: var(--bb-success-text); }
.er-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--bb-space-12); }
.er-panel { padding: var(--bb-space-16) var(--bb-space-16); border-radius: var(--bb-radius-lg); background: var(--bb-surface); border: 1px solid var(--bb-border); min-width: 0; }
.er-panel-wide { grid-column: 1 / -1; }
.er-panel h4 { margin: 0 0 var(--bb-space-12); font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-text); }
.er-panel h4 small { font-weight: 600; color: var(--bb-text-muted); }
.er-bars { display: flex; align-items: flex-end; gap: var(--bb-space-6); height: 220px; overflow-x: auto; }
.er-bar { flex: 1 0 52px; display: flex; flex-direction: column; align-items: center; height: 100%; gap: var(--bb-space-4); }
.er-bar-val { min-height: 1.1rem; font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-text-body); white-space: nowrap; }
.er-bar-track { flex: 1; width: 70%; display: flex; align-items: flex-end; border-radius: var(--bb-radius-md) var(--bb-radius-md) 0 0; background: var(--bb-surface-raised); }
.er-bar-fill { width: 100%; min-height: 0; border-radius: var(--bb-radius-md) var(--bb-radius-md) 0 0; background: linear-gradient(180deg, var(--bb-accent), var(--bb-primary)); }
.er-bar-label { font-size: var(--bb-text-xs); color: var(--bb-text-muted); white-space: nowrap; }
.er-row { display: grid; grid-template-columns: 1fr auto; gap: var(--bb-space-2) var(--bb-space-8); padding: var(--bb-space-6) 0; border-bottom: 1px solid var(--bb-border); font-size: var(--bb-text-base); }
.er-row:last-child { border-bottom: 0; }
.er-row-name { min-width: 0; color: var(--bb-text); font-weight: 600; }
.er-row-name small { font-weight: 500; color: var(--bb-text-muted); }
.er-row-amt { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--bb-text); white-space: nowrap; }
.er-row-bar { grid-column: 1 / -1; height: 4px; border-radius: var(--bb-radius-sm); background: var(--bb-surface-raised); overflow: hidden; }
.er-row-bar i { display: block; height: 100%; background: var(--bb-primary); border-radius: var(--bb-radius-sm); }
.er-row-total { border-top: 2px solid var(--bb-border-strong); }
.er-empty { margin: 0; font-size: var(--bb-text-base); color: var(--bb-text-muted); }
.er-note { margin-top: var(--bb-space-12); font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
.br-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--bb-space-12); margin-bottom: var(--bb-space-16); }
.br-card { display: flex; flex-direction: column; gap: var(--bb-space-2); padding: var(--bb-space-12) var(--bb-space-16); border-radius: var(--bb-radius-lg); background: var(--bb-surface); border: 1px solid var(--bb-border);
text-decoration: none !important; color: var(--bb-text) !important; transition: border-color 0.15s, box-shadow 0.15s; }
.br-card:hover { border-color: var(--bb-primary-border); box-shadow: 0 2px 10px var(--bb-primary-glow); }
.br-card b { font-size: var(--bb-text-3xl); font-weight: 700; line-height: 1.1; }
.br-card span { font-size: var(--bb-text-sm); font-weight: 600; color: var(--bb-text-muted); }
.br-card-expiring b { color: var(--bb-warning-text); }
.br-card-no_plan b { color: var(--bb-text-muted); }
.br-card-over_limit b { color: var(--bb-danger-text); }
.br-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bb-space-8); margin-bottom: var(--bb-space-12); }
.br-filters .bb-control { width: auto; min-width: 150px; }
.br-filters input[type=search] { min-width: 220px; }
.br-check { display: inline-flex; align-items: center; gap: var(--bb-space-6); margin: 0; font-size: var(--bb-text-base); font-weight: 600; color: var(--bb-text-body); cursor: pointer; }
.br-sub { display: block; font-size: var(--bb-text-xs); color: var(--bb-text-muted); }
.br-warn { color: var(--bb-warning-text); font-weight: 700; }
.br-meter { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.br-meter small { font-weight: 500; color: var(--bb-text-muted); }
.br-meter.is-over, .br-meter.is-over small { color: var(--bb-danger-text); }
.br-mods { font-size: var(--bb-text-sm); color: var(--bb-text-body); }
.br-mods .br-mods-t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; max-width: 210px; }
.br-check { margin-right: var(--bb-space-8); }
/* static table (no DataTables column chooser): products and registered date stay out of the way, the CSV export still has them */
.br-table th:nth-child(8), .br-table td:nth-child(8), .br-table th:nth-child(11), .br-table td:nth-child(11) { display: none; }
.br-note { margin-top: var(--bb-space-8); font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
/* status pills, as on the business page */
.bp-pill { display: inline-flex; align-items: center; font-size: var(--bb-text-xs); font-weight: 700; border-radius: var(--bb-radius-full); padding: var(--bb-space-2) var(--bb-space-8); white-space: nowrap; }
.bp-pill-ok { background: var(--bb-success-bg); color: var(--bb-success-text); }
.bp-pill-muted { background: var(--bb-surface-raised); color: var(--bb-text-muted); border: 1px solid var(--bb-border); }
/* stylelint-enable scale-unlimited/declaration-strict-value */

/* Modules/Superadmin/Resources/views/pricing/index.blade.php + subscription/choose.blade.php (cards: pricing/partials/cards) */
/* Plan cards as on the website (billbook-web PricingClient), in the app's tokens */
html:has(.pr), body:has(.pr) { background: var(--bb-background) !important; }
/* the auth header is written for a dark page */
body:has(.pr) .container-fluid a.tw-text-white, body:has(.pr) .container-fluid summary.tw-text-white { color: var(--bb-text) !important; }
body:has(.pr) .container-fluid .tw-border-white { border-color: var(--bb-border-darker) !important; background: var(--bb-surface); }

.pr { max-width: 1280px; margin: 0 auto; padding: var(--bb-space-64) var(--bb-space-16) var(--bb-space-48); }
.pr .display_currency { font-size: inherit !important; font-weight: inherit; color: inherit !important; }

.pr-head { text-align: center; margin-bottom: var(--bb-space-40); }
/* the brand logo, same height as the app sidebar (35px); light / dark files like the sidebar */
.pr-logo { display: inline-block; margin-bottom: var(--bb-space-16); }
.pr-logo img { display: block; height: 35px; width: auto; }
.pr-logo .pr-logo-d { display: none; }
html[data-bb-theme="dark"] .pr-logo .pr-logo-l { display: none; }
html[data-bb-theme="dark"] .pr-logo .pr-logo-d { display: block; }
.pr-head h1 { margin: 0; font-size: var(--bb-text-4xl); font-weight: 700; letter-spacing: -.02em; color: var(--bb-text); }
.pr-head p { margin: var(--bb-space-6) 0 0; font-size: var(--bb-text-lg); color: var(--bb-text-body); }

.pr-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--bb-space-20); align-items: stretch; }
.pr-card { display: flex; flex-direction: column; padding: var(--bb-space-24); border-radius: var(--bb-radius-xl); background: var(--bb-surface);
    border: 1px solid var(--bb-border); color: var(--bb-text); }
.pr-card.is-dark { background: var(--bb-ink); border-color: var(--bb-ink); color: var(--bb-on-ink); box-shadow: var(--bb-shadow-lg); }
html[data-bb-theme="dark"] .pr-card.is-dark { background: var(--bb-ink); border-color: var(--bb-primary-border); }

.pr-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bb-space-6); margin-bottom: var(--bb-space-4); }
.pr-top h2 { margin: 0 var(--bb-space-2) 0 0; font-size: var(--bb-text-xl); font-weight: 700; color: inherit; }
.pr-chip { padding: var(--bb-space-2) var(--bb-space-12); border-radius: var(--bb-radius-full); font-size: var(--bb-text-xs); font-weight: 700; }
.pr-chip-pop { background: var(--bb-info-glow); color: var(--bb-info-text); }
.pr-chip-offer { background: var(--bb-primary-glow); color: var(--bb-primary-text); }
/* on the dark (popular) card: light text */
.is-dark .pr-chip-pop { background: var(--bb-on-ink-a10); color: var(--bb-on-ink); }
.is-dark .pr-chip-offer { background: var(--bb-on-ink-a10); color: var(--bb-accent); }
.pr-desc { margin: 0 0 var(--bb-space-16); min-height: 2.6em; font-size: var(--bb-text-base); line-height: var(--bb-leading-normal); color: var(--bb-text-body); }
.is-dark .pr-desc { color: var(--bb-on-ink-muted); }

/* Month / year, per card */
.pr-cycle { display: inline-flex; align-self: flex-start; gap: var(--bb-space-2); padding: var(--bb-space-4); margin-bottom: var(--bb-space-16); border-radius: var(--bb-radius-md); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); }
.pr-cycle-gap { height: 38px; margin-bottom: var(--bb-space-16); }
.pr-cycle button { display: inline-flex; align-items: center; gap: var(--bb-space-4); height: 30px; padding: 0 var(--bb-space-12); border: 0 !important; border-radius: var(--bb-radius-md); background: transparent !important;
    font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted) !important; cursor: pointer; transition: background .12s, color .12s; }
/* the toggles are x-btn: its own colours are !important */
.pr-cycle button.is-on { background: var(--bb-primary) !important; color: var(--bb-on-primary) !important; }
.pr-cycle em { font-style: normal; font-size: var(--bb-text-xs); color: var(--bb-success-text); }
.is-dark .pr-cycle em { color: var(--bb-on-ink); }
.pr-cycle button.is-on em { color: var(--bb-on-primary); opacity: 1; }
.is-dark .pr-cycle { background: var(--bb-on-ink-a10); border-color: var(--bb-on-ink-a10); }
.is-dark .pr-cycle button { color: var(--bb-on-ink-muted) !important; }
.is-dark .pr-cycle button.is-on { color: var(--bb-on-primary) !important; }   /* white on orange is 2.85:1 */

.pr .pr-price { /* scoped: the POS product rows have a td.pr-price */  min-height: var(--bb-space-64); margin-bottom: var(--bb-space-20); }
.pr-amount b { display: block; font-size: var(--bb-text-4xl); line-height: var(--bb-leading-tight); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pr-amount p { margin: var(--bb-space-4) 0 0; font-size: var(--bb-text-base); color: var(--bb-text-muted); }
.is-dark .pr-amount p { color: var(--bb-on-ink-muted); }
.pr-amount s { font-variant-numeric: tabular-nums; }
.pr-amount p.pr-saving { font-weight: 700; color: var(--bb-success-text); }
.is-dark .pr-amount p.pr-saving { color: var(--bb-on-ink); }

.pr-cta { display: flex; align-items: center; justify-content: center; height: var(--bb-space-48); margin-bottom: var(--bb-space-24); border-radius: var(--bb-radius-lg); font-size: var(--bb-text-md); font-weight: 700;
    text-decoration: none !important; border: 1px solid var(--bb-primary); background: transparent; color: var(--bb-primary-text) !important; transition: background .12s; }
.pr-cta:hover { background: var(--bb-primary-tint); }
.is-dark .pr-cta { background: var(--bb-primary); color: var(--bb-on-primary) !important; }
.is-dark .pr-cta:hover { background: var(--bb-primary-hover); }
.pr-cta:focus-visible, .pr-cycle button:focus-visible { outline: 2px solid var(--bb-primary); outline-offset: 2px; }

.pr-limits, .pr-feats, .pr-addons { list-style: none; margin: 0; padding: 0; display: grid; }
.pr-limits { gap: var(--bb-space-6); margin-bottom: var(--bb-space-16); font-size: var(--bb-text-base); font-weight: 700; }
.pr-feats { gap: var(--bb-space-8); }
.pr-feats li { display: flex; align-items: flex-start; gap: var(--bb-space-8); font-size: var(--bb-text-base); line-height: var(--bb-leading-normal); color: var(--bb-text-body); }
.is-dark .pr-feats li { color: var(--bb-on-ink); }
.pr-feats svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: var(--bb-space-2); color: var(--bb-primary-text); }

.pr-more { margin-top: auto; padding-top: var(--bb-space-16); }
.pr-more > summary { display: flex; align-items: center; gap: var(--bb-space-6); padding-top: var(--bb-space-12); border-top: 1px dashed var(--bb-border-strong); cursor: pointer; list-style: none;
    font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-primary-text); }
.is-dark .pr-more > summary { border-top-color: var(--bb-on-ink-a20); color: var(--bb-accent); }
.pr-more > summary::-webkit-details-marker { display: none; }
.pr-more > summary::after { content: ''; width: 7px; height: 7px; margin-left: auto; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.pr-more[open] > summary::after { transform: rotate(-135deg); }
.pr-more > summary span { padding: 0 var(--bb-space-6); border-radius: var(--bb-radius-full); font-size: var(--bb-text-xs); background: var(--bb-primary-glow); }
.is-dark .pr-more > summary span { background: var(--bb-on-ink-a10); }
.pr-more > summary:focus-visible { outline: 2px solid var(--bb-primary); outline-offset: 2px; border-radius: var(--bb-radius-sm); }
.pr-addons { gap: var(--bb-space-4); margin-top: var(--bb-space-8); }
.pr-addons li { display: flex; justify-content: space-between; gap: var(--bb-space-12); padding: var(--bb-space-6) var(--bb-space-8); border-radius: var(--bb-radius-md); font-size: var(--bb-text-sm);
    background: var(--bb-surface-raised); color: var(--bb-text-body); }
.is-dark .pr-addons li { background: var(--bb-on-ink-a10); color: var(--bb-on-ink); }
.pr-addon-p { white-space: nowrap; font-weight: 700; }

.pr-note { margin: var(--bb-space-32) auto 0; max-width: 60ch; text-align: center; font-size: var(--bb-text-base); color: var(--bb-text-muted); }

@media (max-width: 1199px) { .pr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
    .pr { padding-top: var(--bb-space-64); }
    .pr-grid { grid-template-columns: 1fr; }
    .pr-desc, .pr .pr-price { min-height: 0; }
    .pr-cycle-gap { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pr * { transition: none !important; } }

/* "Choose your plan" (Modules/Superadmin/Resources/views/subscription/choose.blade.php): the in-app plan page, no sidebar */
.pr-choose { padding-top: var(--bb-space-24); }
.pr-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--bb-space-16); margin-bottom: var(--bb-space-24); }
.pr-bar .pr-logo { margin-bottom: 0; }
@media (max-width: 767px) { .pr-choose .pr-bar { padding-right: calc(var(--bb-space-48) + var(--bb-space-8)); } } /* clear the floating theme switch */
.pr-choose .pr-head { margin-bottom: var(--bb-space-24); }
.pr-now { margin: var(--bb-space-12) 0 0; font-size: var(--bb-text-base); color: var(--bb-text-body); }
.pr-now b { color: var(--bb-text); }
.pr-offers { display: grid; gap: var(--bb-space-12); max-width: 960px; margin: 0 auto var(--bb-space-32); }
.pr-offer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bb-space-12); padding: var(--bb-space-16) var(--bb-space-20); border-radius: var(--bb-radius-lg);
    background: var(--bb-success-bg); border: 1px solid var(--bb-success-border); color: var(--bb-text-body); }
.pr-offer.is-info { background: var(--bb-info-bg); border-color: var(--bb-info-border); }
.pr-offer.is-warning { background: var(--bb-warning-bg); border-color: var(--bb-warning-border); }
.pr-offer.is-danger { background: var(--bb-danger-bg); border-color: var(--bb-danger-border); }
.pr-offer-tx { flex: 1; min-width: 0; }
.pr-offer-tx b { display: block; font-size: var(--bb-text-md); color: var(--bb-text); }
.pr-chip-cur { background: var(--bb-success-bg); color: var(--bb-success-text); }
.is-dark .pr-chip-cur { background: var(--bb-on-ink-a10); color: var(--bb-on-ink); }
.pr-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--bb-space-8) var(--bb-space-24); margin-top: var(--bb-space-32); font-size: var(--bb-text-base); color: var(--bb-text-muted); }
.pr-foot a { color: var(--bb-primary-text); font-weight: 700; }

/* Stock count: fixed columns so the table fits the card at 1280px (name wraps, numbers keep a set width) */
#stock_count_table { table-layout: fixed; width: 100%; min-width: 47rem; }
#stock_count_table thead th:first-child { width: auto; }
/* Add opening stock pop-up: the long headers wrap and each box has a set width, so the Date box shows its full
   date and time (it was squeezed to one character) while Note and + still fit in the pop-up at 1280px */
.add_opening_stock_table.table > thead > tr > th,
.add_opening_stock_table.table > tbody > tr > td { padding: 8px 6px !important; white-space: normal !important; vertical-align: middle; }
.add_opening_stock_table.table .bb-control { padding-left: 6px !important; padding-right: 6px !important; }
.add_opening_stock_table .purchase_quantity { width: 4rem; }
.add_opening_stock_table .unit_price { width: 6rem; }
.add_opening_stock_table .os_exp_date { width: 6.5rem; }
.add_opening_stock_table input[name$="[lot_number]"] { width: 5.5rem; }
.add_opening_stock_table .os_date { width: 10.5rem; }
.add_opening_stock_table textarea { width: 7rem; }
#stock_count_table th:nth-child(2) { width: 10rem; }
#stock_count_table th:nth-child(3) { width: 9rem; }
#stock_count_table th:nth-child(4) { width: 9rem; }
#stock_count_table th:nth-child(5) { width: 7rem; }
#stock_count_table td { overflow-wrap: anywhere; }

/* Business Settings > Custom Labels: label input must not be squeezed by the Field Type select */
.custom_label_product_div .bb-igroup { display: flex; }
.custom_label_product_div .bb-igroup .bb-control { flex: 1 1 auto; width: auto; min-width: 0; float: none; }
.custom_label_product_div .bb-iaddon { width: auto; flex: 0 0 auto; }
.custom_label_product_div .bb-iaddon select { max-width: 110px; }

/* Modules/ProductCatalogue/Resources/views/catalogue/generate_qr.blade.php (Online Catalogue settings + QR studio; the stat strip is <x-dash.stats>) */
.oc-split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--bb-space-16); align-items: start; margin-top: var(--bb-space-16); }
.oc-aside { position: sticky; top: 76px; }
@media (max-width: 1200px) { .oc-split { grid-template-columns: 1fr; } .oc-aside { position: static; } }
.oc-off { display: flex; gap: var(--bb-space-8); align-items: center; margin-top: var(--bb-space-16); padding: var(--bb-space-12) var(--bb-space-16); border-radius: var(--bb-radius-lg); background: var(--bb-warning-bg); color: var(--bb-warning-text); font-weight: 600; font-size: var(--bb-text-md); border: 1px solid var(--bb-warning-border); }
.pc-card-h .oc-head-r { margin-left: auto; }

/* switches */
.oc-opt { display: flex !important; align-items: center; gap: var(--bb-space-12); margin: 0 !important; padding: var(--bb-space-8) var(--bb-space-12); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--bb-surface-raised); cursor: pointer; font-weight: 600 !important; font-size: var(--bb-text-md); color: var(--bb-text); transition: border-color 0.12s, background 0.12s; }
.oc-opt:hover { border-color: var(--bb-primary-border); }
.oc-opt:has(input:checked) { border-color: var(--bb-primary); background: var(--bb-primary-tint); }
.oc-opt input, .oc-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.oc-sw { position: relative; width: 34px; height: 20px; flex-shrink: 0; border-radius: var(--bb-radius-full); background: var(--bb-border-darker); transition: background 0.15s; }
.oc-sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: var(--bb-radius-circle); background: var(--bb-surface); box-shadow: var(--bb-shadow-xs); transition: transform 0.15s; }
input:checked + .oc-sw { background: var(--bb-primary); }
/* an inactive location is never live: its switch reads off and cannot be flipped (its saved choice is kept) */
.oc-locked { pointer-events: none; }
.oc-locked input:checked + .oc-sw { background: var(--bb-border-darker); }
.oc-locked input:checked + .oc-sw::after { transform: none; }
input:checked + .oc-sw::after { transform: translateX(14px); }
input:focus-visible + .oc-sw { outline: 2px solid var(--bb-primary); outline-offset: 2px; }
.oc-switch { display: inline-flex !important; align-items: center; gap: var(--bb-space-8); margin: 0 !important; cursor: pointer; font-weight: 600 !important; font-size: var(--bb-text-base); color: var(--bb-text-muted); position: relative; }
.oc-switch:has(input:checked) { color: var(--bb-success-text); }
.oc-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--bb-space-8); margin-bottom: var(--bb-space-16); }

/* links table */
.oc-links { width: 100%; border-collapse: collapse; }
.oc-links th { padding: var(--bb-space-8) var(--bb-space-12); font-size: var(--bb-text-sm); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--bb-text-muted); border-bottom: 1px solid var(--bb-border); text-align: left; white-space: nowrap; }
.oc-links td { padding: var(--bb-space-12); border-bottom: 1px solid var(--bb-border); vertical-align: middle; font-size: var(--bb-text-md); color: var(--bb-text); }
.oc-links tr:last-child td { border-bottom: 0; }
.oc-links .bb-num { text-align: right; font-variant-numeric: tabular-nums; }
.oc-loc b { display: block; }
.oc-loc a { display: inline-block; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
.oc-loc a:hover { color: var(--bb-primary); }
.oc-loc .oc-inactive { font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-danger-text); }
.oc-acts { display: flex; gap: var(--bb-space-4); justify-content: flex-end; }
.oc-ib { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--bb-radius-md); border: 1px solid var(--bb-border-strong); background: var(--bb-surface); color: var(--bb-text-muted) !important; cursor: pointer; transition: all 0.12s; }
.oc-ib:hover { border-color: var(--bb-primary); color: var(--bb-primary) !important; background: var(--bb-primary-tint); }
.oc-ib svg { width: 16px; height: 16px; }
.oc-table-wrap { overflow-x: auto; margin: -0.2rem -1.1rem var(--bb-space-6); }
@media (max-width: 700px) { .oc-hide-sm { display: none; } }

/* appearance */
.oc-swatches { display: flex; flex-wrap: wrap; gap: var(--bb-space-8); align-items: center; }
.oc-swatch { width: 32px; height: 32px; border-radius: var(--bb-radius-lg); border: 2px solid transparent; outline: 1px solid var(--bb-border); outline-offset: -1px; cursor: pointer; padding: 0; transition: transform 0.1s; }
.oc-swatch:hover { transform: scale(1.08); }
.oc-swatch.is-on { border-color: var(--bb-surface); outline: 2px solid var(--bb-text); outline-offset: 0; }
.oc-custom { position: relative; width: 32px; height: 32px; border-radius: var(--bb-radius-lg); overflow: hidden; border: 1px dashed var(--bb-border-darker); background: conic-gradient(var(--bb-danger), var(--bb-warning), var(--bb-success), var(--bb-info), var(--bb-primary), var(--bb-danger)); }
.oc-custom input { position: absolute; inset: -8px; width: 48px; height: 48px; opacity: 0; cursor: pointer; }
.oc-layouts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--bb-space-8); }
.oc-layout { display: flex !important; align-items: center; gap: var(--bb-space-12); margin: 0 !important; padding: var(--bb-space-12); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--bb-surface-raised); cursor: pointer; font-weight: 600 !important; font-size: var(--bb-text-md); position: relative; }
.oc-layout input { position: absolute; opacity: 0; }
.oc-layout:has(input:checked) { border-color: var(--bb-primary); background: var(--bb-primary-tint); }
.oc-layout i { display: grid; gap: var(--bb-space-4); width: 30px; flex-shrink: 0; }
.oc-layout i b { display: block; background: var(--bb-border-darker); border-radius: var(--bb-radius-sm); }
.oc-layout:has(input:checked) i b { background: var(--bb-primary); }
.oc-l-grid i { grid-template-columns: 1fr 1fr; } .oc-l-grid i b { height: 11px; }
.oc-l-list i b { height: 6px; }
.oc-help { display: block; margin-top: var(--bb-space-6); font-size: var(--bb-text-sm); color: var(--bb-text-muted); }

/* QR studio */
.oc-qr-prev { display: flex; justify-content: center; padding: var(--bb-space-16); border-radius: var(--bb-radius-xl); background-image: repeating-conic-gradient(var(--bb-surface-raised) 0 25%, var(--bb-surface) 0 50%); background-position: center; background-size: 18px 18px; border: 1px solid var(--bb-border); }
.oc-qr-prev img { width: 100%; max-width: 270px; height: auto; border-radius: var(--bb-radius-xl); box-shadow: var(--bb-shadow-md); }
.oc-seg { display: flex; padding: var(--bb-space-4); border-radius: var(--bb-radius-lg); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); }
.oc-seg label { flex: 1; margin: 0 !important; text-align: center; padding: var(--bb-space-6) var(--bb-space-4); border-radius: var(--bb-radius-md); font-size: var(--bb-text-sm); font-weight: 600 !important; color: var(--bb-text-muted); cursor: pointer; position: relative; }
.oc-seg input { position: absolute; opacity: 0; }
.oc-seg label:has(input:checked) { background: var(--bb-surface); color: var(--bb-text); box-shadow: var(--bb-shadow-xs); }
.oc-qr-btns { display: grid; grid-template-columns: 1fr 1fr; gap: var(--bb-space-8); margin-top: var(--bb-space-16); }
.oc-qr-btns .oc-wide { grid-column: 1 / -1; }
.oc-qr-url { display: flex; gap: var(--bb-space-6); margin-top: var(--bb-space-12); }
.oc-qr-url input { font-size: var(--bb-text-sm) !important; color: var(--bb-text-muted) !important; }
.oc-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--bb-space-12); }
.oc-color { display: block; width: 100%; height: 38px; padding: var(--bb-space-4); border: 1px solid var(--bb-border-input); border-radius: var(--bb-radius-lg); background: var(--bb-surface); cursor: pointer; -webkit-appearance: none; appearance: none; }
.oc-color::-webkit-color-swatch-wrapper { padding: 0; }
.oc-color::-webkit-color-swatch { border: 0; border-radius: var(--bb-radius-md); }
.oc-color::-moz-color-swatch { border: 0; border-radius: var(--bb-radius-md); }
#oc_qr_tmp { position: absolute; left: -9999px; top: 0; }

/* HMS booking status chips (h6.bb-badge-count.bg-*): soft fill + dark text in both themes (was inline in the old module tab bar) */
h6.bb-badge-count.bg-red { background: var(--bb-danger-bg) !important; color: var(--bb-danger-text) !important; }
h6.bb-badge-count.bg-green { background: var(--bb-success-bg) !important; color: var(--bb-success-text) !important; }
h6.bb-badge-count.bg-yellow { background: var(--bb-warning-bg) !important; color: var(--bb-warning-text) !important; }

/* resources/views/account_reports/payment_account_report.blade.php */
.pa-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--bb-space-12); margin-bottom: var(--bb-space-16); }
@media (max-width: 767px) { .pa-kpis { grid-template-columns: 1fr; } }
.pa-kpi { padding: var(--bb-space-16) var(--bb-space-16); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--bb-surface-raised); }
.pa-kpi span { display: block; font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); }
.pa-kpi b { display: block; margin-top: var(--bb-space-2); font-size: var(--bb-text-3xl); font-weight: 700; color: var(--bb-text); font-variant-numeric: tabular-nums; line-height: 1.2; }
.pa-kpi small { font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); }
.pa-kpi.is-ok { background: var(--dm-success-bg, var(--bb-success-bg)); border-color: var(--dm-success-border, #abefc6); } .pa-kpi.is-ok b { color: var(--dm-success-text, #067647); }
.pa-kpi.is-warn.has-gap { background: var(--dm-danger-bg, #fef3f2); border-color: var(--dm-danger-border, #fecdca); } .pa-kpi.is-warn.has-gap b { color: var(--dm-danger-text, #b42318); }
.pa-bulk { position: sticky; top: 8px; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--bb-space-12); margin-bottom: var(--bb-space-12); padding: var(--bb-space-12) var(--bb-space-16); border: 1px solid var(--bb-primary-border-soft, #fcd9b0); border-radius: var(--bb-radius-lg); background: var(--bb-primary-tint); box-shadow: var(--bb-shadow-md); }
.pa-bulk-n { font-size: var(--bb-text-md); color: var(--bb-text); } .pa-bulk-n b { font-size: var(--bb-text-2xl); color: var(--bb-primary-text); margin-right: var(--bb-space-4); }
.pa-bulk-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bb-space-8); }
.pa-bulk-ctl .bb-control { width: 240px; height: 40px; }
.pa-bulk-ctl .tw-dw-btn { height: 40px; min-height: 40px; border-radius: var(--bb-radius-md); font-weight: 700; }
.pa-acct { display: inline-block; padding: var(--bb-space-2) var(--bb-space-8); border-radius: var(--bb-radius-full); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); font-size: var(--bb-text-sm); font-weight: 700; white-space: nowrap; }
.pa-acct small { color: var(--bb-text-muted); font-weight: 600; }
.pa-acct.is-none { background: var(--dm-danger-bg, #fef3f2); border-color: var(--dm-danger-border, #fecdca); color: var(--dm-danger-text, #b42318); }
#payment_account_report td.text-right, #payment_account_report th.text-right { text-align: right; }
#payment_account_report tr.is-picked td { background: var(--bb-primary-tint); }
#payment_account_report .pa-check, #pa_check_all { width: 16px; height: 16px; cursor: pointer; accent-color: var(--bb-primary); }
.bb-act-main.is-link { background: var(--bb-primary-tint); color: var(--bb-primary-text) !important; border-color: var(--bb-primary-border-soft, #fcd9b0); }
.pa-all-text { padding: var(--bb-space-12) var(--bb-space-16); border-radius: var(--bb-radius-md); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); font-size: var(--bb-text-md); color: var(--bb-text-body); }

/* resources/views/customer_group/show.blade.php */
.cg { padding: var(--bb-space-16) var(--bb-space-24) var(--bb-space-40); display: flex; flex-direction: column; gap: var(--bb-space-16); }
.cg-back { display: inline-flex; align-items: center; gap: var(--bb-space-8); height: 38px; padding: 0 var(--bb-space-16); border-radius: var(--bb-radius-md); font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-text); background: var(--bb-surface); border: 1px solid var(--bb-border-strong); box-shadow: var(--bb-shadow-xs); text-decoration: none; transition: transform 0.12s, background 0.12s, color 0.12s; }
.cg-back svg { width: 15px; height: 15px; }
.cg-back:hover { text-decoration: none; transform: translateY(-1px); background: var(--bb-primary-tint); color: var(--bb-primary-text); }
.cg-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--bb-space-12); }
.cg-kpi { position: relative; display: flex; flex-direction: column; gap: var(--bb-space-2); padding: var(--bb-space-12) var(--bb-space-16); overflow: hidden; background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); box-shadow: var(--bb-shadow-xs); }
.cg-kpi::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--k); }
.cg-kpi-v { font-size: var(--bb-text-2xl); font-weight: 700; letter-spacing: -0.02em; color: var(--bb-text); font-variant-numeric: tabular-nums; line-height: 1.3; overflow-wrap: anywhere; }
.cg-kpi-l { font-size: var(--bb-text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--bb-text-muted); }

#group_members_table tbody td { height: 60px; padding-top: 0 !important; padding-bottom: 0 !important; vertical-align: middle; }
#group_members_table thead th { white-space: nowrap; }
a.cg-ent { display: flex; align-items: center; gap: var(--bb-space-12); min-width: 0; color: inherit; text-decoration: none; border-radius: var(--bb-radius-md); margin: -4px -6px; padding: 4px 6px; transition: background 0.12s; }
a.cg-ent:hover { background: var(--bb-primary-tint); text-decoration: none; }
a.cg-ent:hover .cg-name { color: var(--bb-primary-text); }
.cg-ent-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cg-avatar { width: 34px; height: 34px; border-radius: var(--bb-radius-md); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: var(--bb-text-base); font-weight: 700; color: var(--av); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); }
.cg-avatar::before { content: attr(data-l); }
.cg-name { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--bb-text-base); font-weight: 700; line-height: 1.25; color: var(--bb-text); }
.cg-sub { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--bb-text-xs); font-weight: 500; line-height: 1.25; color: var(--bb-text-muted); }
.cg-when { font-size: var(--bb-text-sm); font-weight: 600; line-height: 1.25; color: var(--bb-text); white-space: nowrap; }
.cg-link { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; font-size: var(--bb-text-sm); font-weight: 600; color: var(--bb-text); }
.cg-link:hover { color: var(--bb-primary-text); text-decoration: none; }
.cg-none { color: var(--bb-text-faint); }
.cg-pill { display: inline-flex; align-items: center; font-size: var(--bb-text-xs); font-weight: 700; border-radius: var(--bb-radius-full); padding: var(--bb-space-2) var(--bb-space-8); white-space: nowrap; }
.cg-pill-off { background: var(--bb-danger-bg); color: var(--bb-danger-text); margin-left: var(--bb-space-4); }
.cg-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cg-amt.is-due { color: var(--bb-danger-text); } .cg-amt.is-zero { color: var(--bb-text-faint); font-weight: 700; }
.cg-btn { display: inline-flex; align-items: center; gap: var(--bb-space-6); height: 28px; padding: 0 var(--bb-space-12); border-radius: var(--bb-radius-md); font-size: var(--bb-text-sm); font-weight: 700; text-decoration: none;
    --c: var(--bb-info); --cb: var(--bb-info-bg); --cl: var(--bb-info-border); --ct: var(--bb-info-text); background: var(--cb); color: var(--ct); border: 1px solid var(--cl); transition: background 0.12s, color 0.12s; }
.cg-btn:hover { background: var(--c); color: var(--bb-on-fill); text-decoration: none; }
.cg-add-btn { display: inline-flex; align-items: center; gap: var(--bb-space-8); height: 38px; padding: 0 var(--bb-space-16); border: 0; border-radius: var(--bb-radius-md); cursor: pointer; font-size: var(--bb-text-base); font-weight: 700; color: var(--bb-on-primary);
    background: linear-gradient(135deg, var(--bb-primary) 0%, var(--bb-accent) 100%); box-shadow: var(--bb-shadow-sm); transition: transform 0.12s, box-shadow 0.12s; }
.cg-add-btn svg { width: 15px; height: 15px; }
.cg-add-btn:hover { transform: translateY(-1px); box-shadow: var(--bb-shadow-md); }
.cg-actions { display: flex; align-items: center; gap: var(--bb-space-4); white-space: nowrap; }
.cg-btn-del { --c: var(--bb-danger); --cb: var(--bb-danger-bg); --cl: var(--bb-danger-border); --ct: var(--bb-danger-text); cursor: pointer; }
.cg-add-hint { margin: 0 0 var(--bb-space-16); font-size: var(--bb-text-base); line-height: 1.5; color: var(--bb-text-muted); }
.cg-opt { display: flex; align-items: center; justify-content: space-between; gap: var(--bb-space-8); }
.cg-opt-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--bb-text-base); font-weight: 600; }
.cg-opt-g { flex-shrink: 0; font-size: var(--bb-text-xs); font-weight: 700; padding: var(--bb-space-2) var(--bb-space-8); border-radius: var(--bb-radius-full); color: var(--dm-primary-text); background: var(--bb-warning-bg); }
#cg-add-modal .select2-container--default .select2-selection--multiple { min-height: 44px; border-radius: var(--bb-radius-md); border-color: var(--bb-border-input); }
#cg-add-modal .select2-container--default.select2-container--focus .select2-selection--multiple { border-color: var(--bb-primary); }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--bb-primary-tint); color: var(--bb-text); }
/* group list: the name is a link now */
a.cg-name-link { font-weight: 700; color: var(--bb-text); }
a.cg-name-link:hover { color: var(--bb-primary-text); text-decoration: none; }

@media (max-width: 900px) { .cg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cg { padding: var(--bb-space-12) var(--bb-space-16) var(--bb-space-32); } .cg-kpis { gap: var(--bb-space-8); } }

/* resources/views/purchase_requisition/show.blade.php */
.bb-detail .rq-pct { margin-left: auto; float: right; font-style: normal; font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-text-muted, var(--bb-gray-500, #747477)); }
.bb-detail .rq-bar { height: 6px; background: var(--bb-surface-raised, var(--bb-gray-150, #f0f0f1)); }
/* stylelint-disable-next-line scale-unlimited/declaration-strict-value -- no token with this exact value */
.bb-detail .rq-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--bb-accent, #fdb434), var(--bb-primary, #ef7810)); border-radius: 0 6px 6px 0; }

/* resources/views/stock_transfer/show.blade.php */
.bb-detail .stf-route { display: flex; align-items: stretch; gap: var(--bb-space-12); margin-top: var(--bb-space-16); flex-wrap: wrap; }
.bb-detail .stf-loc { flex: 1 1 220px; max-width: 360px; padding: var(--bb-space-12) var(--bb-space-16); background: var(--dm-surface, #fff); border: 1px solid var(--bb-border, #eee); border-radius: var(--bb-radius-lg); }
.bb-detail .stf-loc small { display: block; font-size: var(--bb-text-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--bb-text-muted, var(--bb-gray-400, #8f8f92)); }
.bb-detail .stf-loc b { display: block; font-size: var(--bb-text-md); color: var(--bb-text, var(--bb-gray-900, #1b1b1e)); }
.bb-detail .stf-loc span { font-size: var(--bb-text-sm); color: var(--bb-text-muted, var(--bb-gray-500, #747477)); }
.bb-detail .stf-arrow { display: flex; align-items: center; color: var(--bb-primary-text, #c2410c); font-size: var(--bb-text-3xl); }
.bb-detail .stf-steps { display: flex; gap: var(--bb-space-24); margin-top: var(--bb-space-16); flex-wrap: wrap; }
.bb-detail .stf-step { display: flex; align-items: center; gap: var(--bb-space-8); font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-label, var(--bb-gray-400, #8f8f92)); }
.bb-detail .stf-step i { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--bb-radius-circle); border: 2px solid var(--bb-border-strong, var(--bb-gray-300, #d4d4d7)); font-style: normal; font-size: var(--bb-text-xs); }
.bb-detail .stf-step i em { font-size: var(--bb-text-xs); }
.bb-detail .stf-step.is-done { color: var(--bb-text, var(--bb-gray-900, #1b1b1e)); }
.bb-detail .stf-step.is-done i { background: var(--bb-primary, #ef7810); border-color: var(--bb-primary, #ef7810); color: var(--bb-on-primary); }
.bb-detail .stf-step.is-now i { box-shadow: var(--bb-shadow-ring); }
@media print { .bb-detail .stf-steps { display: none; } }

/* resources/views/components/sa-page-header.blade.php */
.sa-ph { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--bb-space-16); margin: var(--bb-space-12) var(--bb-page-gutter) 0; padding: var(--bb-space-16) var(--bb-space-20);
background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); box-shadow: var(--bb-shadow-xs); position: relative; overflow: hidden; }
.sa-ph::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--bb-primary), var(--bb-accent)); }
.sa-ph-main { display: flex; align-items: center; gap: var(--bb-space-16); min-width: 0; }
.sa-ph-ic { width: 44px; height: 44px; border-radius: var(--bb-radius-lg); flex-shrink: 0; display: flex; align-items: center; justify-content: center;
background: linear-gradient(135deg, var(--bb-primary-tint) 0%, color-mix(in srgb, var(--bb-accent) 22%, transparent) 100%); border: 1px solid var(--bb-primary-border-soft, var(--bb-border)); }
.sa-ph-ic svg { width: 20px; height: 20px; stroke: var(--bb-primary); }
.sa-ph-txt { min-width: 0; }
.sa-ph-crumb { display: flex; align-items: center; gap: var(--bb-space-6); font-size: var(--bb-text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--bb-text-muted); margin-bottom: var(--bb-space-2); }
.sa-ph-crumb a { color: var(--bb-text-muted); text-decoration: none; }
.sa-ph-crumb a:hover { color: var(--bb-primary-text); }
.sa-ph-crumb svg { width: 10px; height: 10px; stroke: var(--bb-text-label); }
.sa-ph-title { margin: 0; font-size: var(--bb-text-2xl); font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; color: var(--bb-text); }
.sa-ph-sub { margin-top: var(--bb-space-4); font-size: var(--bb-text-base); font-weight: 500; color: var(--bb-text-body); }
.sa-ph-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bb-space-8); }
.sa-ph .sa-back, .sa-ph .sa-hbtn { display: inline-flex; align-items: center; gap: var(--bb-space-8); height: 38px; padding: 0 var(--bb-space-16); border-radius: var(--bb-radius-lg); font-size: var(--bb-text-base); font-weight: 700; cursor: pointer; text-decoration: none;
color: var(--bb-text); background: var(--bb-surface); border: 1px solid var(--bb-border-strong); box-shadow: var(--bb-shadow-xs); transition: transform 0.12s, box-shadow 0.12s, background 0.12s, color 0.12s, border-color 0.12s; }
.sa-ph .sa-back svg, .sa-ph .sa-hbtn svg, .sa-ph-actions > a > svg, .sa-ph-actions > button > svg { width: 15px; height: 15px; flex-shrink: 0; }
.sa-ph .sa-back:hover, .sa-ph .sa-hbtn:hover { text-decoration: none; transform: translateY(-1px); background: var(--bb-primary-tint); color: var(--bb-primary-text); border-color: var(--bb-primary-border-soft, var(--bb-primary)); box-shadow: var(--bb-shadow-sm); }
@media (max-width: 640px) { .sa-ph { margin: var(--bb-space-8) var(--bb-page-gutter) 0; padding: var(--bb-space-12) var(--bb-space-12); gap: var(--bb-space-8); } .sa-ph-title { font-size: var(--bb-text-xl); } .sa-ph-ic { width: 38px; height: 38px; } .sa-ph-actions { width: 100%; } .sa-ph-actions > a, .sa-ph-actions > button { flex: 1 1 calc(50% - 0.5rem); justify-content: center; } }

/* resources/views/purchase/create.blade.php */
.bb-hide-purchase-price .add_without_price_hide{display:none !important;}

/* resources/views/stock_adjustment/create.blade.php */
.bb-no-view-purchase-price .show_price_with_permission {
    display: none !important;
}

/* resources/views/activity_log/activities.blade.php (moved from the page <style>) */
/* stylelint-disable scale-unlimited/declaration-strict-value -- moved as-is from the page: raw values with no exact token */
.act { margin-top: var(--bb-space-6); }
.act-table { width: 100%; border-collapse: collapse; }
.act-table th { padding: var(--bb-space-8) var(--bb-space-12); font-size: var(--bb-text-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--bb-text-muted, var(--bb-gray-500, #747477)); background: var(--bb-surface-raised, var(--bb-gray-50, #fafafb)); border-bottom: 1px solid var(--bb-border, #eee); text-align: left; }
.act-table td { padding: var(--bb-space-8) var(--bb-space-12); border-bottom: 1px solid var(--bb-border, var(--bb-gray-150, #f0f0f1)); vertical-align: middle; font-size: var(--bb-text-sm); color: var(--bb-text-body, var(--bb-gray-600, #5a5a5e)); }
.act-table tbody tr:hover td { background: var(--bb-primary-tint, #fff7ed); }
.act-when b { display: block; font-size: var(--bb-text-sm); color: var(--bb-text, var(--bb-gray-900, #1b1b1e)); font-weight: 700; white-space: nowrap; }
.act-when small { display: block; font-size: var(--bb-text-xs); color: var(--bb-text-muted, var(--bb-gray-500, #747477)); }
.act-pill { display: inline-flex; align-items: center; gap: var(--bb-space-6); padding: var(--bb-space-4) var(--bb-space-12); border-radius: 999px; font-size: var(--bb-text-xs); font-weight: 700; white-space: nowrap; background: var(--bb-surface-raised, var(--bb-gray-150, #f0f0f1)); color: var(--bb-text-body, var(--bb-gray-600, #5a5a5e)); }
.act-pill.is-add { background: var(--dm-success-bg, #d1fadf); color: var(--dm-success-text, #05603a); } .act-pill.is-edit { background: var(--dm-info-bg, var(--bb-info-bg)); color: var(--dm-info-text, var(--bb-info, #2563eb)); }
.act-pill.is-del { background: var(--dm-danger-bg, #fee4e2); color: var(--dm-danger-text, #912018); } .act-pill.is-auth { background: var(--dm-warning-bg, #fef0c7); color: var(--dm-warning-text, #93370d); }
.act-by { display: inline-flex; align-items: center; gap: var(--bb-space-8); }
.act-av { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--bb-primary-tint, #fff7ed); color: var(--bb-primary-text, #c2410c); font-size: var(--bb-text-xs); font-weight: 700; }
.act-tag { margin-left: var(--bb-space-6); padding: 1px var(--bb-space-8); border-radius: 999px; background: var(--bb-surface-raised, var(--bb-gray-150, #f0f0f1)); border: 1px solid var(--bb-border, var(--bb-gray-200, #e7e7ea)); font-style: normal; font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-text-muted, var(--bb-gray-500, #747477)); }
.act-note span { display: block; }
.act-empty { padding: var(--bb-space-24) !important; text-align: center; color: var(--bb-text-muted, var(--bb-gray-500, #747477)); }
.act-empty i { margin-right: var(--bb-space-6); color: var(--bb-text-label, var(--bb-gray-300, #d4d4d7)); }
.act-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--bb-space-8); padding: var(--bb-space-12) var(--bb-space-4) 0; font-size: var(--bb-text-sm); color: var(--bb-text-muted, var(--bb-gray-500, #747477)); }
.act-pager .pagination { margin: 0; }
.act-nav { display: inline-flex; align-items: center; gap: var(--bb-space-8); }
.act-nav button { width: 32px; height: 32px; border: 1px solid var(--bb-border-strong, var(--bb-gray-300, #d4d4d7)); border-radius: 9px; background: var(--dm-surface, #fff); color: var(--bb-text-body, var(--bb-gray-600, #5a5a5e)); cursor: pointer; }
.act-nav button:hover:not(:disabled) { background: var(--bb-primary-tint, #fff7ed); color: var(--bb-primary-text, #c2410c); border-color: var(--bb-primary-border-soft, #fcd9b0); }
.act-nav button:disabled { opacity: .4; cursor: default; }
.act-page { font-weight: 700; color: var(--bb-text, var(--bb-gray-900, #1b1b1e)); }
@media print { .act-pager { display: none !important; } }
/* stylelint-enable scale-unlimited/declaration-strict-value */

/* resources/views/documents_and_notes/index.blade.php (moved from the page <style>) */
/* stylelint-disable scale-unlimited/declaration-strict-value -- moved as-is from the page: raw values with no exact token */
.dn-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--bb-space-12); flex-wrap: wrap; margin: var(--bb-space-4) 0 var(--bb-space-16); }
.dn-add { display: inline-flex; align-items: center; gap: var(--bb-space-8); height: 36px; padding: 0 var(--bb-space-16); border: 0; border-radius: var(--bb-radius-lg); cursor: pointer; font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-on-primary);
    background: linear-gradient(135deg, var(--bb-primary) 0%, var(--bb-accent) 100%); box-shadow: 0 2px 8px color-mix(in srgb, var(--bb-primary) 35%, transparent); transition: transform 0.12s, box-shadow 0.12s; }
.dn-add:hover { transform: translateY(-1px); box-shadow: 0 5px 14px color-mix(in srgb, var(--bb-primary) 45%, transparent); }
.dn-list table.dataTable thead { display: none; }
.dn-list table.dataTable { border: 0 !important; }
.dn-list table.dataTable tbody td { padding: var(--bb-space-4) 0 !important; border: 0 !important; background: transparent !important; }
.dn-card { display: flex; align-items: flex-start; gap: var(--bb-space-16); padding: var(--bb-space-16) var(--bb-space-16); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-xl); background: var(--dm-surface, #fff); }
.dn-card:hover { border-color: var(--bb-primary-border-soft, #fcd9b0); background: var(--bb-primary-tint); }
.dn-ic { width: 42px; height: 42px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--bb-surface-raised); border: 1px solid var(--bb-border); color: var(--bb-text-muted); }
.dn-ic.has-files { background: var(--bb-primary-tint); border-color: var(--bb-primary-border-soft, #fcd9b0); color: var(--bb-primary-text, #c2410c); }
.dn-body { flex: 1; min-width: 0; }
.dn-title { display: block; font-size: var(--bb-text-md); font-weight: 700; color: var(--bb-text) !important; cursor: pointer; text-decoration: none !important; }
.dn-title:hover { color: var(--bb-primary-text) !important; }
.dn-body p { margin: var(--bb-space-2) 0 .1rem; font-size: var(--bb-text-sm); color: var(--bb-text-body); line-height: 1.45; }
.dn-none { color: var(--bb-text-label, var(--bb-gray-400, #8f8f92)); }
.dn-chips { display: flex; flex-wrap: wrap; gap: var(--bb-space-6); margin-top: var(--bb-space-8); }
.dn-chip { display: inline-flex; align-items: center; gap: var(--bb-space-6); padding: 2px var(--bb-space-8); border-radius: 999px; background: var(--bb-surface-raised); border: 1px solid var(--bb-border); font-size: var(--bb-text-xs); font-weight: 700; color: var(--bb-text-body) !important; text-decoration: none !important; }
.dn-chip.is-file:hover { background: var(--bb-primary-tint); border-color: var(--bb-primary-border-soft, #fcd9b0); }
.dn-chip.is-private { background: var(--dm-danger-bg, #fef3f2); border-color: var(--dm-danger-border, #fecdca); color: var(--dm-danger-text, #b42318) !important; }
.dn-meta { margin-top: var(--bb-space-8); font-size: var(--bb-text-xs); color: var(--bb-text-muted); }
.dn-av { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; margin-right: var(--bb-space-4); border-radius: 6px; background: var(--bb-primary-tint); color: var(--bb-primary-text); font-size: var(--bb-text-xs); font-weight: 700; }
.dn-acts { display: flex; gap: var(--bb-space-4); flex-shrink: 0; }
.dn-act { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--bb-border-strong, var(--bb-gray-300, #d4d4d7)); border-radius: 9px; background: var(--dm-surface, #fff); color: var(--bb-text-body) !important; font-size: var(--bb-text-sm); cursor: pointer; text-decoration: none !important; }
.dn-act:hover { background: var(--bb-primary-tint); border-color: var(--bb-primary-border-soft, #fcd9b0); color: var(--bb-primary-text) !important; }
.dn-act.is-danger:hover { background: var(--dm-danger-bg, #fef3f2); border-color: var(--dm-danger-border, #fecdca); color: var(--dm-danger-text, #b42318) !important; }
.docus_note_modal .dropzone { display: block; min-height: 0; padding: var(--bb-space-12); border: 1.5px dashed var(--bb-border-strong, var(--bb-gray-300, #d4d4d7)) !important; border-radius: 12px; background: var(--bb-surface-raised, var(--bb-gray-100, #f5f5f6)) !important; cursor: pointer; }
.docus_note_modal .dropzone:hover { border-color: var(--bb-primary) !important; background: var(--bb-primary-tint) !important; }
.docus_note_modal .dropzone .dz-message { display: flex; align-items: center; justify-content: center; gap: var(--bb-space-12); margin: 0; padding: var(--bb-space-8); font-size: var(--bb-text-base); color: var(--bb-text-body); }
.dz-ic { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--bb-radius-lg); background: var(--dm-surface, #fff); border: 1px solid var(--bb-border); color: var(--bb-primary-text, #c2410c); font-size: var(--bb-text-lg); }
.dz-t b { color: var(--bb-primary-text, #c2410c); }
.docus_note_modal .dropzone .dz-preview { position: relative; display: flex; align-items: center; gap: var(--bb-space-8); margin: var(--bb-space-6) 0 0; padding: var(--bb-space-8) var(--bb-space-8); width: 100%; min-height: 0; border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--dm-surface, #fff); }
.dz-fi { width: 30px; height: 30px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--bb-primary-tint); color: var(--bb-primary-text); }
.dz-meta { flex: 1; min-width: 0; }
.dz-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--bb-text-sm); color: var(--bb-text); }
.dz-size { font-size: var(--bb-text-xs); color: var(--bb-text-muted); }
.dz-progress { height: 4px; margin-top: var(--bb-space-4); border-radius: 4px; background: var(--bb-border); overflow: hidden; }
.dz-upload { display: block; height: 100%; width: 0; background: var(--bb-primary); }
.dz-done .dz-progress { display: none; }
.dz-error-message { display: none; font-size: var(--bb-text-xs); color: var(--dm-danger-text, #b42318); }
.dz-error .dz-error-message, .dz-failed .dz-error-message { display: block; }
.dz-rm { width: 24px; height: 24px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--bb-text-muted) !important; font-size: var(--bb-text-lg); cursor: pointer; text-decoration: none !important; }
.dz-rm:hover { background: var(--dm-danger-bg, #fef3f2); color: var(--dm-danger-text, #b42318) !important; }
.dn-hint { display: block; margin-top: var(--bb-space-6); font-size: var(--bb-text-xs); color: var(--bb-text-muted); }
.dn-have { display: flex; flex-wrap: wrap; gap: var(--bb-space-6); margin-bottom: var(--bb-space-8); }
.docus_note_modal .checkbox { margin: 0; padding: var(--bb-space-8) var(--bb-space-12); border: 1px solid var(--bb-border); border-radius: 12px; background: var(--bb-surface-raised, var(--bb-gray-100, #f5f5f6)); }
/* stylelint-enable scale-unlimited/declaration-strict-value */

/* resources/views/layouts/partials/css.blade.php (moved from the page <style>) */
/* stylelint-disable scale-unlimited/declaration-strict-value -- moved as-is from the page: raw values with no exact token */
/*
* Pattern lock css
* Pattern direction
* http://ignitersworld.com/lab/patternLock.html
*/
.patt-wrap {
  z-index: 10;
}
.patt-circ.hovered {
  background-color: var(--dm-info-bg, #cde2f2);
  border: none;
}
.patt-circ.hovered .patt-dots {
  display: none;
}
.patt-circ.dir {
  background-image: url("../img/pattern-directionicon-arrow.png");
  background-position: center;
  background-repeat: no-repeat;
}
.patt-circ.e {
  -webkit-transform: rotate(0);
  transform: rotate(0);
}
.patt-circ.s-e {
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
}
.patt-circ.s {
  -webkit-transform: rotate(90deg);
  transform: rotate(90deg);
}
.patt-circ.s-w {
  -webkit-transform: rotate(135deg);
  transform: rotate(135deg);
}
.patt-circ.w {
  -webkit-transform: rotate(180deg);
  transform: rotate(180deg);
}
.patt-circ.n-w {
  -webkit-transform: rotate(225deg);
   transform: rotate(225deg);
}
.patt-circ.n {
  -webkit-transform: rotate(270deg);
  transform: rotate(270deg);
}
.patt-circ.n-e {
  -webkit-transform: rotate(315deg);
  transform: rotate(315deg);
}
/* stylelint-enable scale-unlimited/declaration-strict-value */

/* Balance sheet report (account_reports/balance_sheet); moved from the page <style>, scoped with :where() so specificity is unchanged */
:where(section.bs) .bs-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--bb-space-8) var(--bb-space-16); margin: var(--bb-space-16) 0 var(--bb-space-12); }
:where(section.bs) .bs-title b { font-size: var(--bb-text-xl); color: var(--bb-text); }
:where(section.bs) .bs-title span { font-size: var(--bb-text-md); color: var(--bb-text-muted); } :where(section.bs) .bs-title em { font-style: normal; font-weight: 700; color: var(--bb-text); }
:where(section.bs) .bs-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--bb-space-12); margin-bottom: var(--bb-space-16); }
@media (max-width: 767px) { :where(section.bs) .bs-kpis { grid-template-columns: 1fr; } }
:where(section.bs) .bs-kpi { padding: var(--bb-space-16) var(--bb-space-16); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--bb-surface-raised); }
:where(section.bs) .bs-kpi span { display: block; font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); }
:where(section.bs) .bs-kpi b { display: block; margin-top: var(--bb-space-2); font-size: var(--bb-text-3xl); font-weight: 700; color: var(--bb-text); font-variant-numeric: tabular-nums; line-height: 1.2; }
:where(section.bs) .bs-kpi small { font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); }
:where(section.bs) .bs-kpi.is-main { background: var(--bb-primary-tint); border-color: var(--bb-primary-border-soft, #fcd9b0); } :where(section.bs) .bs-kpi.is-main b { color: var(--bb-primary-text); }
:where(section.bs) .bs-kpi b.is-neg { color: var(--dm-danger-text, #b42318); }
:where(section.bs) .bs-mix { display: flex; height: 12px; overflow: hidden; border-radius: var(--bb-radius-full); background: var(--bb-surface-raised); border: 1px solid var(--bb-border); }
:where(section.bs) .bs-mix i { display: block; height: 100%; }
:where(section.bs) .bs-legend { display: flex; flex-wrap: wrap; gap: var(--bb-space-4) var(--bb-space-16); margin: var(--bb-space-8) 0 var(--bb-space-16); font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
:where(section.bs) .bs-legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: var(--bb-space-6); border-radius: var(--bb-radius-circle); background: var(--c, var(--bb-bs-legend-fallback)); }
:where(section.bs) .bs-legend b { color: var(--bb-text); }
:where(section.bs) .bs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--bb-space-16); align-items: start; }
@media (max-width: 991px) { :where(section.bs) .bs-grid { grid-template-columns: 1fr; } }
:where(section.bs) .bs-card { border: 1px solid var(--bb-border); border-radius: var(--bb-radius-xl); background: var(--dm-surface, #fff); overflow: hidden; }
:where(section.bs) .bs-h { padding: var(--bb-space-12) var(--bb-space-20); font-size: var(--bb-text-lg); font-weight: 700; color: var(--bb-text); background: var(--bb-surface-raised); border-bottom: 1px solid var(--bb-border); }
:where(section.bs) .bs-h i { margin-right: var(--bb-space-8); color: var(--bb-primary-text, #c2410c); }
:where(section.bs) .bs-sec { padding: var(--bb-space-12) var(--bb-space-20) var(--bb-space-4); font-size: var(--bb-text-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--bb-text-muted); }
:where(section.bs) .bs-row { display: flex; align-items: center; justify-content: space-between; gap: var(--bb-space-16); padding: var(--bb-space-8) var(--bb-space-20); border-bottom: 1px dashed var(--bb-border); font-size: var(--bb-text-md); color: var(--bb-text-body); }
:where(section.bs) .bs-row > span { flex: 1; min-width: 0; }
:where(section.bs) .bs-row span small { display: block; font-size: var(--bb-text-sm); color: var(--bb-text-label, var(--bb-gray-400, #8f8f92)); }
:where(section.bs) .bs-row b { font-variant-numeric: tabular-nums; color: var(--bb-text); white-space: nowrap; }
:where(section.bs) .bs-row .bs-bar { display: block; height: 4px; margin-top: var(--bb-space-4); border-radius: var(--bb-radius-sm); background: var(--bb-primary); opacity: .55; }
:where(section.bs) .bs-sub { display: flex; justify-content: space-between; padding: var(--bb-space-8) var(--bb-space-20); font-size: var(--bb-text-md); font-weight: 700; color: var(--bb-text); background: var(--bb-surface-raised); }
:where(section.bs) .bs-total { display: flex; justify-content: space-between; align-items: center; margin: var(--bb-space-8); padding: var(--bb-space-12) var(--bb-space-16); border-radius: var(--bb-radius-lg); background: var(--bb-primary-tint); border: 1px solid var(--bb-primary-border-soft, #fcd9b0); font-size: var(--bb-text-lg); font-weight: 700; color: var(--bb-text); }
:where(section.bs) .bs-total b { font-size: var(--bb-text-2xl); color: var(--bb-primary-text); font-variant-numeric: tabular-nums; }
:where(section.bs) .bs-note { margin-top: var(--bb-space-12); font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
:where(section.bs) .bs-load { color: var(--bb-text-label, var(--bb-gray-400, #8f8f92)); }
@media print { :where(section.bs) .bs-card, :where(section.bs) .bs-kpi { break-inside: avoid; } :where(section.bs) .bs-title { margin-top: 0; } }

/* Trial balance report (account_reports/trial_balance); moved from the page <style>, scoped with :where() so specificity is unchanged */
:where(section.tb) .tb-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--bb-space-8) var(--bb-space-16); margin: var(--bb-space-16) 0 var(--bb-space-12); }
:where(section.tb) .tb-title b { font-size: var(--bb-text-xl); color: var(--bb-text); }
:where(section.tb) .tb-title span { font-size: var(--bb-text-md); color: var(--bb-text-muted); } :where(section.tb) .tb-title em { font-style: normal; font-weight: 700; color: var(--bb-text); }
:where(section.tb) .tb-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--bb-space-12); margin-bottom: var(--bb-space-16); }
@media (max-width: 767px) { :where(section.tb) .tb-kpis { grid-template-columns: 1fr; } }
:where(section.tb) .tb-kpi { padding: var(--bb-space-16) var(--bb-space-16); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--bb-surface-raised); }
:where(section.tb) .tb-kpi span { display: block; font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); }
:where(section.tb) .tb-kpi b { display: block; margin-top: var(--bb-space-2); font-size: var(--bb-text-3xl); font-weight: 700; color: var(--bb-text); font-variant-numeric: tabular-nums; line-height: 1.2; }
:where(section.tb) .tb-kpi small { font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); }
:where(section.tb) .tb-kpi.is-main { background: var(--dm-success-bg, var(--bb-success-bg)); border-color: var(--dm-success-border, #abefc6); } :where(section.tb) .tb-kpi.is-main b { color: var(--dm-success-text, #067647); }
:where(section.tb) .tb-kpi.is-off { background: var(--dm-danger-bg, #fef3f2); border-color: var(--dm-danger-border, #fecdca); } :where(section.tb) .tb-kpi.is-off b { color: var(--dm-danger-text, #b42318); }
:where(section.tb) .tb-card { border: 1px solid var(--bb-border); border-radius: var(--bb-radius-xl); background: var(--dm-surface, #fff); overflow: hidden; }
:where(section.tb) .tb-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
:where(section.tb) .tb-table th, :where(section.tb) .tb-table td { padding: var(--bb-space-12) var(--bb-space-20); border-bottom: 1px solid var(--bb-border); font-size: var(--bb-text-md); }
:where(section.tb) .tb-table thead th { background: var(--bb-surface-raised); font-size: var(--bb-text-sm); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--bb-text-muted); }
:where(section.tb) .tb-table .r { text-align: right; width: 22%; }
:where(section.tb) .tb-table tr.tb-sec td { padding: var(--bb-space-12) var(--bb-space-20) var(--bb-space-4); border-bottom: 0; font-size: var(--bb-text-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--bb-primary-text); background: var(--dm-surface, #fff); }
:where(section.tb) .tb-table tr.tb-line:hover td { background: var(--bb-primary-tint); }
:where(section.tb) .tb-table td small { display: block; font-size: var(--bb-text-sm); color: var(--bb-text-label, var(--bb-gray-400, #8f8f92)); }
:where(section.tb) .tb-table td.dr, :where(section.tb) .tb-table td.cr { text-align: right; font-weight: 700; color: var(--bb-text); }
:where(section.tb) .tb-table td.is-empty { color: var(--bb-border-strong, var(--bb-gray-300, #d4d4d7)); font-weight: 400; }
:where(section.tb) .tb-table tfoot th { padding: var(--bb-space-16) var(--bb-space-20); background: var(--bb-primary-tint); border-top: 2px solid var(--bb-primary-border-soft, #fcd9b0); border-bottom: 0; font-size: var(--bb-text-lg); font-weight: 700; color: var(--bb-primary-text); }
:where(section.tb) .tb-note { margin-top: var(--bb-space-12); font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
:where(section.tb) .tb-load { color: var(--bb-text-label, var(--bb-gray-400, #8f8f92)); }
@media print { :where(section.tb) .tb-card, :where(section.tb) .tb-kpi { break-inside: avoid; } :where(section.tb) .tb-title { margin-top: 0; } }

/* Sales commission agents list (sales_commission_agent/index); moved from the page <style>, scoped with :where() so specificity is unchanged */
:where(section.ag-page) .um-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--bb-space-12); margin-bottom: var(--bb-space-16); }
    @media (max-width: 767px) { :where(section.ag-page) .um-kpis { grid-template-columns: repeat(2, 1fr); } }
    :where(section.ag-page) .um-kpi { padding: var(--bb-space-12) var(--bb-space-16); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-lg); background: var(--bb-surface-raised); }
    :where(section.ag-page) .um-kpi span { display: block; font-size: var(--bb-text-sm); font-weight: 700; color: var(--bb-text-muted); }
    :where(section.ag-page) .um-kpi b { display: block; font-size: var(--bb-text-3xl); font-weight: 700; color: var(--bb-text); line-height: 1.25; }
    :where(section.ag-page) .um-kpi.is-ok { background: var(--dm-success-bg); border-color: var(--dm-success-border); } :where(section.ag-page) .um-kpi.is-ok b { color: var(--dm-success-text); }
    :where(section.ag-page) .um-user { display: flex; align-items: center; gap: var(--bb-space-12); }
    :where(section.ag-page) .um-user small { display: block; margin-top: 2px; font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
    :where(section.ag-page) .um-av { width: 38px; height: 38px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--bb-radius-lg); background: var(--bb-primary-wash); color: var(--bb-primary-text); font-size: var(--bb-text-base); font-weight: 700; letter-spacing: .02em; }
    :where(section.ag-page) .ag-phone { white-space: nowrap; font-size: var(--bb-text-base); } :where(section.ag-page) .ag-phone i { margin-right: var(--bb-space-6); color: var(--bb-text-faint, var(--bb-text-faint)); }
    :where(section.ag-page) .ag-addr { display: block; max-width: 260px; font-size: var(--bb-text-base); color: var(--bb-text-body); }
    :where(section.ag-page) .ag-sales b { display: block; } :where(section.ag-page) .ag-sales small { display: block; font-size: var(--bb-text-sm); color: var(--bb-text-muted); }
    :where(section.ag-page) .ag-comm { color: var(--bb-primary-text); }

:where(section.bs) .bs-legend { --bb-bs-legend-fallback: #ccc; }

/* resources/views/legacy/modal.blade.php (the React UI's isolated frame for the old modals) */
html:has(body.bb-legacy-frame),
body.bb-legacy-frame {
    background: transparent !important;
    min-height: 0;
}
