/* The accent colour and its tints. These are the standard blue; the Screen Colour page replaces them for the signed-in user (BmsTheme.CssVariables). */
:root {
  --bms-accent-dark: #1f3a5f; --bms-accent-mid: #2d5282; --bms-accent: #1f5fa8; --bms-accent-link: #1f4d8f; --bms-accent-ring: #2d528233;
  --bms-tint-1: #f0f5fb; --bms-tint-2: #e8eef7; --bms-tint-3: #e3eefb; --bms-tint-4: #dfe9f7;
  /* Accent-coloured text on a page or a tint, and the focus outline: the dark shades on light pages. */
  --bms-accent-ink: var(--bms-accent-dark); --bms-focus: var(--bms-accent-mid);
  /* The header strip of an information tile (white text on it). */
  --bms-tone-info: var(--bms-accent);
  /* Dashboard tiles: the heading strip in a dark shade of the accent, the value area in a light shade (ThemePalettes.TileColours). */
  --bms-tile-head: #1250a2; --bms-tile-head-ink: #ffffff; --bms-tile-body: #eff5fd; --bms-tile-body-hover: #e6f0fc;
}
/* The colours of the pages, for Light and Soft. The Dark scheme replaces every one (BmsTheme.CssVariables, from ThemePalettes). */
:root {
  --bms-page: #f4f6f9; --bms-surface: #fff; --bms-surface-hover: #f5f8fc; --bms-head: #e9eef5; --bms-row-alt: #f3f6fa; --bms-panel: #eef2f7;
  --bms-faint: #eef1f5; --bms-neutral-bg: #eceff1; --bms-track: #eaecf0; --bms-scroll-thumb: #b5c0d0; --bms-scroll-track: #eef1f6;
  --bms-line: #dfe5ee; --bms-line-strong: #c5cfdd; --bms-line-input: #b9c4d4; --bms-line-input-2: #b9c4d3; --bms-card-line: #d5dce8;
  --bms-grid-line: #e3e8ef; --bms-chart-grid: #edeff2; --bms-help-line: #d8dbe0;
  --bms-ink: #1f2937; --bms-muted: #6b7a90; --bms-label: #4a5a70; --bms-label-2: #44546a; --bms-label-3: #5f6f86; --bms-faded: #8a95a5; --bms-disabled-ink: #7a8698;
  --bms-danger: #c62828; --bms-danger-ink: #b3261e; --bms-danger-bg: #fdecea;
  --bms-warning: #b26a00; --bms-warning-ink: #8a5300; --bms-warning-bg: #fff3e0; --bms-warning-bg-2: #fff4e0; --bms-overdue-bg: #fff4d6; --bms-pending-bg: #fff8e6;
  --bms-confirm-bg: #fff8ec; --bms-confirm-line: #f0c78a; --bms-notice-bg: #fff3cd; --bms-notice-ink: #5c4400;
  --bms-success: #2e7d32; --bms-success-ink: #1b5e20; --bms-check-ink: #1b6e3c; --bms-success-bg: #e8f5e9; --bms-success-bg-2: #e6f4ea;
  --bms-info-bg: #e3edf9; --bms-result-bg: #e8f1fb;
  --bms-callout-line: #1a73e8; --bms-callout-bg: #e8f0fe; --bms-callout-tip-line: #188038; --bms-callout-warn-line: #b06000; --bms-callout-warn-bg: #fef7e0;
  --bms-mark-bg: #fff19c;
}

html, body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; height: 100%; margin: 0; }
body { background: var(--bms-page); }

.bms-boot { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; color: var(--bms-accent-ink); }
.bms-boot-mark { font-size: 1.8rem; font-weight: 600; display: flex; align-items: center; gap: .6rem; }
.bms-boot-logo { width: 220px; max-width: 70vw; height: auto; }
.bms-boot-text { margin-top: .5rem; color: var(--bms-muted); }

#blazor-error-ui { background: var(--bms-notice-bg); color: var(--bms-notice-ink); bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 2000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

.bms-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bms-nowrap { white-space: nowrap; }
.bms-muted { color: var(--mud-palette-text-secondary); }
.bms-page { padding: 12px 16px 32px 16px; max-width: 1400px; margin: 0 auto; }
.bms-page-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.bms-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 8px; }
/* A wide table scrolls sideways inside its own box; the edge shadows show that more lies beyond the visible part. */
.bms-table-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  background:
    linear-gradient(to right, var(--bms-surface) 30%, rgba(255,255,255,0)) left center / 40px 100% no-repeat local,
    linear-gradient(to left, var(--bms-surface) 30%, rgba(255,255,255,0)) right center / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.28), rgba(0,0,0,0)) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.28), rgba(0,0,0,0)) right center / 12px 100% no-repeat scroll;
}
.bms-table-scroll::-webkit-scrollbar { height: 10px; }
.bms-table-scroll::-webkit-scrollbar-thumb { background: var(--bms-scroll-thumb); border-radius: 5px; }
.bms-table-scroll::-webkit-scrollbar-track { background: var(--bms-scroll-track); }
/* Denser cells for the registers with many columns, so the amount columns fit beside the menu on a laptop. */
.bms-report-table.bms-compact { font-size: .8rem; }
.bms-report-table.bms-compact th { padding: 5px 6px; }
.bms-report-table.bms-compact td { padding: 4px 6px; }
.bms-tile { height: 100%; }
.bms-tile .value { font-size: 1.4rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.bms-lock { position: fixed; inset: 0; background: var(--bms-accent-dark); color: #fff; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px; }

@media (max-width: 599px) {
  .bms-page { padding: 8px 8px 24px 8px; }
  .bms-hide-xs { display: none !important; }
}

.bms-signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(160deg, var(--bms-accent-dark) 0%, var(--bms-accent-mid) 100%); }
.bms-signin-card { width: 100%; max-width: 400px; }

/* Report tables (ReportTable.razor and the module pages that show a grid of figures). */
.bms-report-table { border-collapse: collapse; width: 100%; font-size: .85rem; }
.bms-report-table th { position: sticky; top: 0; background: var(--bms-head); text-align: left; padding: 6px 10px; white-space: nowrap; border-bottom: 2px solid var(--bms-line-strong); }
.bms-report-table td { padding: 5px 10px; border-bottom: 1px solid var(--bms-grid-line); }
.bms-report-table th.bms-num, .bms-report-table td.bms-num { text-align: right; }
.bms-report-table tr.bms-report-subtotal td { font-weight: 600; background: var(--bms-row-alt); }
.bms-report-table tr.bms-report-total td { font-weight: 700; background: var(--bms-head); border-top: 2px solid var(--bms-line-strong); }
.bms-report-table tr.bms-report-muted td { color: var(--bms-faded); }
.bms-report-table tr.bms-report-warning td { color: var(--bms-warning); }
.bms-report-table tr.bms-report-drill { cursor: pointer; }
.bms-report-table tr.bms-report-drill:hover td { background: var(--bms-tint-1); }
.bms-report-table a.bms-figure-link { color: var(--mud-palette-primary); text-decoration: underline dotted; cursor: pointer; }

/* Tax report pages (GST Reports, TDS Register & Summary): filter bars, totals lines, notes. */
.tax-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.tax-field { flex: 1 1 150px; max-width: 260px; min-width: 130px; margin: 0 !important; }
.tax-field-wide { flex-basis: 220px; max-width: 340px; }
.tax-run { flex: 0 0 auto; }
.tax-totals { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; align-items: center; padding: 6px 8px; background: var(--bms-panel); border-radius: 4px; font-size: .85rem; }
.tax-total-items { display: flex; flex-wrap: wrap; gap: 4px 14px; font-variant-numeric: tabular-nums; }
.tax-total { white-space: nowrap; }
.tax-negative { color: var(--bms-danger); }
.tax-notes { padding-left: 1.2rem; margin: 0; }
.tax-notes li { margin-bottom: .5rem; }
@media (max-width: 599px) {
  .tax-field, .tax-field-wide { flex-basis: 100%; max-width: none; }
}
.tax-panel { padding-top: 8px; }
.tax-radios { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 6px; }
.tax-radio { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; cursor: pointer; }
/* Native form controls on the module pages (period pickers, filters): sized for touch, same look everywhere. */
.bms-native { font: inherit; padding: 6px 8px; min-height: 36px; border: 1px solid var(--bms-line-strong); border-radius: 4px; background: var(--bms-surface); color: inherit; max-width: 100%; }
.bms-only-xs { display: none; }
@media (max-width: 599px) { .bms-only-xs { display: block; } }

/* Dashboard */
.dash-field { display: flex; flex-direction: column; gap: 2px; }
.dash-field-label { font-size: .72rem; color: var(--mud-palette-text-secondary); }
/* The classic dashboard: every band on one grid of four equal columns (two on a tablet, one on a phone). Each tile follows the screen
   colour, a heading strip in a dark shade of the accent over a value area in a light shade, with a bar down its left edge in the colour
   of its state (green good, accent information, amber attention, red loss or problem, grey neutral). */
.dash-band { margin-top: 14px; }
.dash-band-heading { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--bms-accent-ink); background: var(--bms-tint-2);
    border-radius: 12px; padding: 4px 12px; margin: 0 0 8px 0; }
.dash-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1099px) { .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .dash-tiles { grid-template-columns: minmax(0, 1fr); } }
.dash-tile { position: relative; display: flex; flex-direction: column; background: var(--bms-tile-body); border: 1px solid var(--bms-line); border-left: 5px solid var(--dash-tone); border-radius: 8px; overflow: hidden; min-height: 112px;
    --dash-tone: #5f6b7a; }
.dash-tile.dash-tone-good { --dash-tone: #188038; }
.dash-tile.dash-tone-info { --dash-tone: var(--bms-tone-info); }
.dash-tile.dash-tone-attention { --dash-tone: #b06000; }
.dash-tile.dash-tone-bad { --dash-tone: #c5221f; }
.dash-tile-main { display: flex; flex-direction: column; flex: 1 1 auto; color: inherit; text-decoration: none; }
a.dash-tile-main:hover .dash-tile-body { background: var(--bms-tile-body-hover); }
a.dash-tile-main:hover { box-shadow: inset 0 0 0 1px var(--dash-tone); }
.dash-tile-label { background: var(--bms-tile-head); color: var(--bms-tile-head-ink); font-size: .7rem; font-weight: 700; letter-spacing: .04em; padding: 7px 40px 7px 12px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-tile-body { flex: 1 1 auto; padding: 6px 12px 10px 12px; }
.dash-tile-value { font-size: 1.55rem; font-weight: 600; margin: 2px 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dash-tile-value.dash-unavailable { font-size: 1.1rem; color: var(--mud-palette-text-secondary); margin: 6px 0; }
.dash-tile-caption { font-size: .78rem; color: var(--mud-palette-text-secondary); }
.dash-negative { color: var(--bms-danger) !important; }
.dash-warning { color: var(--bms-warning) !important; }
.dash-tile-info { position: absolute; top: 4px; right: 6px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(255,255,255,.8); background: rgba(255,255,255,.18);
    color: #fff; font-size: .75rem; font-style: italic; cursor: pointer; line-height: 1; padding: 0; }
.dash-tile-info:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.dash-tile-tip { border-top: 1px solid var(--bms-grid-line); padding: 8px 12px 10px 12px; font-size: .8rem; }
.dash-tip-title { font-weight: 600; margin-bottom: 4px; }
.dash-tip-table { width: 100%; border-collapse: collapse; }
.dash-tip-table td { padding: 1px 0; vertical-align: top; }
.dash-tip-table td.bms-num { padding-left: 12px; }
.dash-tip-indent { padding-left: 14px !important; }
.dash-tip-bold td { font-weight: 600; }
.dash-tip-note { margin-top: 5px; color: var(--mud-palette-text-secondary); }
.dash-progress { height: 6px; background: var(--bms-track); border-radius: 3px; margin: 3px 0 5px; }
.dash-progress-fill { height: 100%; border-radius: 3px; min-width: 3px; background: var(--bms-accent); }
.dash-progress-fill.dash-tone-good { background: #2e7d32; }
.dash-progress-fill.dash-tone-attention { background: #e08600; }
.dash-progress-fill.dash-tone-bad { background: #c62828; }
.dash-middle { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
@media (max-width: 899px) { .dash-middle { grid-template-columns: 1fr; } }
.dash-card { padding: 12px 14px; }
.dash-wide { margin-top: 12px; }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.dash-card-title { font-size: 1rem; font-weight: 600; margin: 0; }
.dash-hint { font-size: .78rem; }
.dash-badge { display: inline-block; border-radius: 9px; padding: 1px 8px; font-size: .78rem; font-weight: 600; background: var(--bms-tint-2); color: var(--bms-accent); }
.dash-badge.dash-sev-critical, .dash-badge.dash-band-over { background: var(--bms-danger-bg); color: var(--bms-danger); }
.dash-badge.dash-sev-warning, .dash-badge.dash-band-watch { background: var(--bms-warning-bg); color: var(--bms-warning); }
.dash-badge.dash-band-good { background: var(--bms-success-bg); color: var(--bms-success); }
.dash-badge.dash-band-none { background: transparent; color: var(--mud-palette-text-secondary); }
.dash-allclear { background: var(--bms-success-bg); color: var(--bms-success); border-radius: 4px; padding: 8px 10px; }
.dash-alerts, .dash-activity { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; }
.dash-alert { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; border-radius: 4px; padding: 8px 10px; margin-bottom: 6px; background: var(--bms-tint-2); }
.dash-alert.dash-sev-critical { background: var(--bms-danger-bg); }
.dash-alert.dash-sev-warning { background: var(--bms-warning-bg); }
.dash-alert-sev { font-size: .68rem; font-weight: 700; margin-right: 4px; }
.dash-alert.dash-sev-critical .dash-alert-sev { color: var(--bms-danger); }
.dash-alert.dash-sev-warning .dash-alert-sev { color: var(--bms-warning); }
.dash-alert.dash-sev-info .dash-alert-sev { color: var(--bms-accent); }
.dash-alert-detail { font-size: .8rem; color: var(--mud-palette-text-secondary); margin-top: 2px; }
.dash-link { color: var(--bms-accent); font-size: .85rem; white-space: nowrap; padding: 6px 4px; }
.dash-activity-row { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--bms-faint); font-size: .8rem; }
.dash-activity-time { color: var(--mud-palette-text-secondary); white-space: nowrap; min-width: 84px; }
.dash-activity-action { font-weight: 600; }
.dash-activity-details { display: block; overflow: hidden; text-overflow: ellipsis; }
.dash-sort { all: unset; cursor: pointer; white-space: nowrap; }
.dash-cc th, .dash-cc td { white-space: nowrap; }
.dash-sticky { position: sticky; left: 0; background: var(--bms-surface); z-index: 1; }
.dash-cc th.dash-sticky { background: var(--bms-head); z-index: 2; }
.dash-cc tr.bms-report-total .dash-sticky { background: var(--bms-head); }
.dash-cc-name { font-weight: 600; }
.dash-cc-client { font-size: .75rem; }
.dash-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .75rem; color: var(--mud-palette-text-secondary); }
.dash-swatch { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.dash-spend { fill: #e08600; background: #e08600; }
.dash-other { fill: #f2c27a; background: #f2c27a; }
.dash-billed { fill: #2e7d32; background: #2e7d32; }
.dash-budget { background: repeating-linear-gradient(90deg, var(--bms-ink) 0 3px, transparent 3px 5px); height: 3px !important; vertical-align: 3px; width: 16px; }
.dash-budget-line { stroke: var(--bms-ink); stroke-width: 2; stroke-dasharray: 3 2; }
.dash-trend { width: 100%; height: auto; max-height: 260px; }
.dash-grid { stroke: var(--bms-chart-grid); }
.dash-grid-base { stroke: var(--bms-line-strong); }
.dash-axis { font-size: 10.5px; fill: var(--bms-muted); }
.dash-axis-current { font-weight: 700; fill: var(--bms-ink); }
.dash-future { opacity: .35; }
.dash-status { margin-top: 12px; font-size: .78rem; }

/* Approval Inbox */
.inbox-counts { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 6px 0; }
.inbox-count-chip { background: var(--bms-tint-2); color: var(--bms-accent-ink); border-radius: 14px; padding: 3px 12px; font-size: .85rem; }
.inbox-count-mine { background: var(--bms-warning-bg); color: var(--bms-warning-ink); }
.inbox-search { flex: 1 1 220px; max-width: 420px; }
.inbox-search input { width: 100%; box-sizing: border-box; }
.inbox-check { display: flex; align-items: center; gap: 6px; min-height: 36px; font-size: .9rem; }
.inbox-check input { width: 18px; height: 18px; }
.inbox-empty { text-align: center; color: var(--mud-palette-text-secondary); padding: 40px 12px; max-width: 520px; margin: 0 auto; }
.inbox-row { cursor: pointer; }
.inbox-row:hover td { background: var(--bms-tint-1); }
.inbox-selected td { background: var(--bms-tint-3) !important; }
.inbox-chip { display: inline-block; background: var(--bms-tint-2); color: var(--bms-accent-ink); border-radius: 10px; padding: 1px 9px; font-size: .75rem; font-weight: 600; }
.inbox-chip-mine { background: var(--bms-warning-bg); color: var(--bms-warning-ink); }
.inbox-cards { display: none; flex-direction: column; gap: 8px; }
.inbox-card { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 3px; background: var(--bms-surface); border: 1px solid var(--bms-line); border-left: 4px solid var(--bms-line-strong); border-radius: 8px; padding: 10px 12px; cursor: pointer; min-height: 44px; }
.inbox-card-mine { border-left-color: #e08600; }
.inbox-card.inbox-selected { background: var(--bms-tint-3); }
.inbox-card-top { display: flex; gap: 6px; flex-wrap: wrap; }
.inbox-card-no { font-weight: 600; font-size: 1.05rem; }
.inbox-card-amount { text-align: left; font-size: 1.15rem; font-weight: 600; }
.inbox-card-summary, .inbox-card-meta { font-size: .8rem; color: var(--mud-palette-text-secondary); }
.inbox-detail { margin-top: 12px; background: var(--bms-surface); border: 1px solid var(--bms-line); border-radius: 8px; padding: 12px 14px; }
.inbox-detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.inbox-back { display: none !important; }
.inbox-detail-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.05rem; }
.inbox-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; margin: 0 0 8px 0; }
.inbox-facts dt { font-size: .72rem; color: var(--mud-palette-text-secondary); }
.inbox-facts dd { margin: 0; overflow-wrap: anywhere; }
.inbox-facts dd.bms-num { text-align: left; font-weight: 600; }
.inbox-impact { border: 1px solid var(--bms-line); border-left: 4px solid var(--bms-line-strong); border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; font-size: .85rem; }
.inbox-sev-ok { border-left-color: var(--bms-success); }
.inbox-sev-warn { border-left-color: #e08600; }
.inbox-sev-danger { border-left-color: var(--bms-danger); }
.inbox-sev-info { border-left-color: var(--bms-accent); }
.inbox-impact-head { font-weight: 600; margin-bottom: 2px; }
.inbox-line-danger td { color: var(--bms-danger); }
.inbox-line-warn td { color: var(--bms-warning); }
.inbox-actions { display: flex; flex-direction: column; gap: 6px; }
.inbox-remarks { width: 100%; box-sizing: border-box; resize: vertical; }
.inbox-remarks-label { font-size: .8rem; color: var(--mud-palette-text-secondary); }
.inbox-error { color: var(--bms-danger); font-size: .85rem; }
.inbox-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.inbox-links { display: flex; gap: 16px; flex-wrap: wrap; }
.inbox-linkbutton { all: unset; cursor: pointer; color: var(--bms-accent); font-size: .85rem; padding: 6px 4px; }
.inbox-note { font-size: .8rem; }
.inbox-history { margin-top: 10px; border-top: 1px solid var(--bms-grid-line); padding-top: 8px; }

@media (max-width: 599px) {
  .inbox-cards { display: flex; }
  .inbox-detail { display: none; margin: 0; }
  .inbox-detail.inbox-detail-open { display: block; position: fixed; inset: 0; z-index: 1300; overflow-y: auto; border: none; border-radius: 0; padding: 12px 14px 28px 14px; }
  .inbox-back { display: inline-flex !important; }
  .inbox-facts { grid-template-columns: 1fr 1fr; }
  .inbox-buttons .mud-button-root { flex: 1 1 42%; min-height: 52px; font-size: 1.05rem; }
  .inbox-actions { position: sticky; bottom: 0; background: var(--bms-surface); padding: 8px 0 4px; box-shadow: 0 -8px 8px -8px rgba(0,0,0,.25); z-index: 2; }
  .inbox-remarks { min-height: 56px; }
  .inbox-card-amount { font-size: 1.25rem; }
}
.inbox-confirm { border: 1px solid var(--bms-confirm-line); background: var(--bms-confirm-bg); border-radius: 6px; padding: 10px 12px; }
.inbox-confirm-text { margin-bottom: 8px; font-weight: 600; }
@media (max-width: 599px) {
  .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dash-tile-main { padding: 8px 28px 6px 10px; }
  .dash-tile-value { font-size: 1.2rem; }
  .dash-tile-caption { font-size: .72rem; }
  .dash-tile-info { width: 22px; height: 22px; top: 4px; right: 4px; }
}
@media (max-width: 599px) { .dash-trend { min-width: 560px; } }
/* Finance and voucher report pages: filters, key figures, pagers and the statement tables. */
.bms-datebox { display: flex; align-items: center; gap: 2px; }
.bms-datebox .mud-input-control { flex: 1 1 auto; min-width: 0; }
.bms-field { flex: 1 1 150px; min-width: 140px; max-width: 220px; }
.bms-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 8px 0; }
.bms-tone-danger { color: var(--mud-palette-error); }
.bms-tone-success { color: var(--mud-palette-success); }
.bms-pager { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; margin-top: 4px; }
.bms-sidebar-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.bms-facts { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: .85rem; }
.bms-bad { color: var(--bms-danger-ink); }
.bms-warn { color: var(--bms-warning); }
.bms-report-table tr.bms-row-selected td { background: var(--bms-info-bg); }
.bms-report-table.bms-fin tfoot td { font-weight: 700; background: var(--bms-head); border-top: 2px solid var(--bms-line-strong); }
.bms-report-table tr.bms-report-heading td { font-weight: 700; background: var(--bms-head); }
.bms-report-table tr.bms-report-result td { font-weight: 700; background: var(--bms-result-bg); }
.bms-report-table tr.bms-report-detail td { font-style: italic; }
.bms-report-table tr.bms-report-check td { font-weight: 600; color: var(--bms-check-ink); background: var(--bms-success-bg-2); }
.bms-report-table tr.bms-report-check-bad td { color: var(--bms-danger-ink); background: var(--bms-danger-bg); }
.bms-report-table .bms-twisty { display: inline-block; width: 1.1rem; color: var(--mud-palette-text-secondary); }
.bms-report-table tr.bms-report-opening td { font-style: italic; background: var(--bms-row-alt); }
.bms-report-table td.bms-wrap { white-space: normal; min-width: 180px; }
.bms-report-table.bms-fin { white-space: nowrap; }
.bms-filter-note { margin-top: 4px; }
.bms-filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; align-items: center; }
.bms-filter-grid > .bms-span2 { grid-column: span 2; }
@media (max-width: 599px) { .bms-filter-grid > .bms-span2 { grid-column: span 1; } }
html, body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; height: 100%; margin: 0; }
body { background: var(--bms-page); }

.bms-boot { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; color: var(--bms-accent-ink); }
.bms-boot-mark { font-size: 1.8rem; font-weight: 600; display: flex; align-items: center; gap: .6rem; }
.bms-boot-logo { width: 220px; max-width: 70vw; height: auto; }
.bms-boot-text { margin-top: .5rem; color: var(--bms-muted); }

#blazor-error-ui { background: var(--bms-notice-bg); color: var(--bms-notice-ink); bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 2000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

.bms-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bms-nowrap { white-space: nowrap; }
.bms-muted { color: var(--mud-palette-text-secondary); }
.bms-page { padding: 12px 16px 32px 16px; max-width: 1400px; margin: 0 auto; }
.bms-page-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.bms-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 8px; }
.bms-table-scroll { overflow-x: auto; }
.bms-tile { height: 100%; }
.bms-tile .value { font-size: 1.4rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.bms-lock { position: fixed; inset: 0; background: var(--bms-accent-dark); color: #fff; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px; }

@media (max-width: 599px) {
  .bms-page { padding: 8px 8px 24px 8px; }
  .bms-hide-xs { display: none !important; }
}

.bms-signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(160deg, var(--bms-accent-dark) 0%, var(--bms-accent-mid) 100%); }
.bms-signin-card { width: 100%; max-width: 400px; }

/* Report tables (ReportTable.razor and the module pages that show a grid of figures). */
.bms-report-table { border-collapse: collapse; width: 100%; font-size: .85rem; }
.bms-report-table th { position: sticky; top: 0; background: var(--bms-head); text-align: left; padding: 6px 10px; white-space: nowrap; border-bottom: 2px solid var(--bms-line-strong); }
.bms-report-table td { padding: 5px 10px; border-bottom: 1px solid var(--bms-grid-line); }
.bms-report-table th.bms-num, .bms-report-table td.bms-num { text-align: right; }
.bms-report-table tr.bms-report-subtotal td { font-weight: 600; background: var(--bms-row-alt); }
.bms-report-table tr.bms-report-total td { font-weight: 700; background: var(--bms-head); border-top: 2px solid var(--bms-line-strong); }
.bms-report-table tr.bms-report-muted td { color: var(--bms-faded); }
.bms-report-table tr.bms-report-warning td { color: var(--bms-warning); }
.bms-report-table tr.bms-report-drill { cursor: pointer; }
.bms-report-table tr.bms-report-drill:hover td { background: var(--bms-tint-1); }

/* Form fields written as plain elements so the box a user types in is the element a script drives. */
.bms-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bms-field > label, .bms-label { font-size: .75rem; font-weight: 600; color: var(--bms-label); }
.bms-input { width: 100%; box-sizing: border-box; min-height: 38px; padding: 6px 10px; font: inherit; font-size: .9rem; color: inherit; background: var(--bms-surface); border: 1px solid var(--bms-line-input); border-radius: 4px; }
.bms-input:focus { outline: 2px solid var(--bms-focus); outline-offset: -1px; border-color: var(--bms-focus); }
.bms-input:disabled { background: var(--bms-faint); color: var(--bms-disabled-ink); }
.bms-input.bms-num { text-align: right; }
textarea.bms-input { min-height: 64px; resize: vertical; }
/* Terms & Conditions of an order: the full width of the card, about ten lines high, taller by dragging. */
textarea.bms-terms { width: 100%; box-sizing: border-box; min-height: 14rem; line-height: 1.45; font: inherit; }
.bms-terms-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.bms-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 12px; align-items: end; margin-bottom: 8px; }
.bms-filters .bms-check { align-self: center; }
.bms-check { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; min-height: 38px; cursor: pointer; }
.bms-check input { width: 18px; height: 18px; }
.bms-actionbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.bms-statusline { font-size: .85rem; color: var(--bms-label); margin: 4px 0; min-height: 1.2em; }
.bms-totalsline { font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; margin: 4px 0; }
.bms-error { color: var(--bms-danger-ink); font-size: .9rem; white-space: pre-line; }
.bms-warn { color: var(--bms-warning-ink); font-size: .9rem; }
.bms-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 14px; }
.bms-span-all { grid-column: 1 / -1; }

/* A table that turns into a list of cards on a phone (one set of elements, so scripts see one set of test ids). */
.bms-grid { border-collapse: collapse; width: 100%; font-size: .85rem; }
.bms-grid th { position: sticky; top: 0; background: var(--bms-head); text-align: left; padding: 6px 8px; border-bottom: 2px solid var(--bms-line-strong); vertical-align: bottom; }
.bms-grid td { padding: 6px 8px; border-bottom: 1px solid var(--bms-grid-line); vertical-align: top; }
.bms-grid .bms-num { text-align: right; }
.bms-grid tbody tr.bms-selectable { cursor: pointer; }
.bms-grid tbody tr.bms-selectable:hover td { background: var(--bms-tint-1); }
.bms-grid tbody tr.bms-selected td { background: var(--bms-tint-4); }
.bms-grid tbody tr.bms-row-overdue td { background: var(--bms-overdue-bg); }
.bms-grid tbody tr.bms-row-held td { color: var(--bms-faded); }
.bms-grid tfoot td { font-weight: 700; background: var(--bms-head); border-top: 2px solid var(--bms-line-strong); }
.bms-grid a { color: var(--bms-accent-link); }

@media (max-width: 599px) {
  .bms-cards thead { display: none; }
  .bms-cards, .bms-cards tbody, .bms-cards tfoot, .bms-cards tr, .bms-cards td { display: block; width: 100%; box-sizing: border-box; }
  .bms-cards tbody tr { background: var(--bms-surface); border: 1px solid var(--bms-card-line); border-radius: 8px; margin-bottom: 8px; padding: 6px 4px; }
  .bms-cards tbody tr.bms-selected { border-color: var(--bms-focus); box-shadow: 0 0 0 2px var(--bms-accent-ring); }
  .bms-cards tbody tr.bms-row-overdue { background: var(--bms-overdue-bg); }
  .bms-cards tbody tr.bms-row-overdue td, .bms-cards tbody tr.bms-selected td { background: transparent; }
  .bms-cards td { display: flex; justify-content: space-between; gap: 12px; border-bottom: none; padding: 3px 8px; text-align: right; }
  .bms-cards td::before { content: attr(data-label); font-weight: 600; color: var(--bms-label); text-align: left; flex: 0 0 38%; }
  .bms-cards td[data-label=""]::before { content: none; }
  .bms-cards td.bms-num { text-align: right; }
  .bms-cards tfoot tr { background: var(--bms-head); border-radius: 8px; padding: 6px 4px; }
  .bms-actionbar > * { flex: 1 1 44%; min-height: 44px; }
  .bms-cards .mud-button-root { min-height: 44px; }
  .bms-input { min-height: 44px; font-size: 1rem; }
  .bms-check { min-height: 44px; }
  .bms-filters { grid-template-columns: 1fr 1fr; }
  .bms-form-grid { grid-template-columns: 1fr; }
  .bms-dialog.mud-dialog { width: 100vw !important; max-width: 100vw !important; height: 100vh; max-height: 100vh !important; margin: 0 !important; border-radius: 0; }
  .bms-dialog .mud-dialog-content { max-height: none; }
}

/* Vouchers (Voucher Management list, view and entry form). */
.vch-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vch-field > label, .vch-label { font-size: .75rem; color: var(--mud-palette-text-secondary); }
.vch-input, .vch-select, .vch-textarea { width: 100%; box-sizing: border-box; min-height: 38px; padding: 6px 10px; border: 1px solid var(--mud-palette-lines-inputs, #bdbdbd); border-radius: 4px; background: var(--mud-palette-surface, #fff); color: var(--mud-palette-text-primary); font: inherit; }
.vch-textarea { min-height: 64px; resize: vertical; }
.vch-input:focus, .vch-select:focus, .vch-textarea:focus { outline: 2px solid var(--mud-palette-primary); outline-offset: -1px; }
.vch-input[readonly] { background: var(--mud-palette-background-gray, #f0f2f5); }
.vch-input:disabled, .vch-select:disabled { background: var(--mud-palette-background-gray, #f0f2f5); color: var(--mud-palette-text-disabled); }
.vch-input.vch-num { text-align: right; font-variant-numeric: tabular-nums; }
.vch-input.vch-invalid, .vch-select.vch-invalid { border-color: var(--mud-palette-error); }
.vch-error { color: var(--mud-palette-error); font-size: .8rem; }
.vch-hint { color: var(--mud-palette-text-secondary); font-size: .75rem; }
.vch-warn { color: var(--bms-warning); }
.vch-strong { font-weight: 600; }

.vch-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 8px; }
.vch-filters .vch-field { flex: 0 1 170px; }
.vch-filters .vch-field.vch-grow { flex: 1 1 240px; }
.vch-filters .vch-field.vch-date { flex: 0 1 130px; }
.vch-filters .vch-field.vch-buttons { flex: 0 0 auto; flex-direction: row; gap: 6px; }
.vch-table td, .vch-table th { vertical-align: top; padding: 5px 7px; }
.vch-sort { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; cursor: pointer; color: inherit; white-space: nowrap; }
.vch-particulars { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vch-actions-col { width: 40px; text-align: right; }
.vch-pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.vch-pager-spacer { flex: 1 1 auto; }
.vch-page-size { width: auto; min-height: 30px; padding: 2px 6px; }
.vch-totals { margin-top: 8px; text-align: right; font-weight: 600; word-break: break-word; }

.vch-card { background: var(--mud-palette-surface, #fff); border: 1px solid var(--mud-palette-lines-default, #e0e0e0); border-radius: 6px; padding: 12px; margin-bottom: 12px; }
.vch-card-title { font-weight: 600; margin-bottom: 8px; color: var(--mud-palette-primary); }
.vch-grid { display: grid; gap: 10px 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.vch-grid .vch-wide { grid-column: 1 / -1; }
.bms-datefield { display: inline-flex; gap: 6px; align-items: center; max-width: 100%; }
.bms-datefield > input[type=text] { flex: 1 1 auto; min-width: 0; width: 9.5em; }
.vch-date-row { display: flex; gap: 6px; align-items: center; }
.vch-date-row .vch-input { flex: 1 1 auto; }
.vch-date-pick { flex: 0 0 auto; width: 44px; min-height: 38px; padding: 0 4px; border: 1px solid var(--mud-palette-lines-inputs, #bdbdbd); border-radius: 4px; background: var(--mud-palette-surface, #fff); color: var(--mud-palette-text-primary); }
.vch-check { display: flex; align-items: center; gap: 8px; min-height: 38px; }
.vch-check input { width: 20px; height: 20px; }

.vch-line { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; border: 1px solid var(--mud-palette-lines-default, #e0e0e0); border-radius: 6px; padding: 10px; margin-bottom: 8px; background: var(--mud-palette-surface, #fff); }
.vch-line .c-no { grid-column: span 1; align-self: center; font-weight: 600; }
.vch-line .c-kind { grid-column: span 2; }
.vch-line .c-item { grid-column: span 4; }
.vch-line .c-unit { grid-column: span 2; }
.vch-line .c-cc { grid-column: span 3; }
.vch-line .c-qty, .vch-line .c-rate, .vch-line .c-tax, .vch-line .c-amount, .vch-line .c-taxamt, .vch-line .c-net { grid-column: span 2; }
.vch-line .c-note { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.vch-line .c-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.vch-calc { min-height: 38px; display: flex; align-items: center; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.vch-calc.vch-net { font-weight: 600; }
.vch-line-ledger .c-item { grid-column: span 4; }

.vch-totals-box { max-width: 460px; margin-left: auto; }
.vch-totals-box .row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.vch-totals-box .row.vch-total-main { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--mud-palette-lines-default, #e0e0e0); margin-top: 4px; padding-top: 6px; }
.vch-totals-box .row span:last-child { font-variant-numeric: tabular-nums; text-align: right; }

.vch-buttons-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.vch-view-grid { display: grid; gap: 6px 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.vch-view-grid .k { font-size: .75rem; color: var(--mud-palette-text-secondary); }
.vch-view-grid .v { font-weight: 600; word-break: break-word; }

@media (max-width: 959px) {
  .vch-line .c-no { grid-column: span 2; }
  .vch-line .c-kind { grid-column: span 4; }
  .vch-line .c-item { grid-column: span 12; }
  .vch-line .c-unit { grid-column: span 6; }
  .vch-line .c-cc { grid-column: span 6; }
  .vch-line .c-qty, .vch-line .c-rate { grid-column: span 6; }
  .vch-line .c-tax { grid-column: span 4; }
  .vch-line .c-amount, .vch-line .c-taxamt, .vch-line .c-net { grid-column: span 4; }
}

@media (max-width: 599px) {
  .vch-input, .vch-select, .vch-textarea, .vch-date-pick { min-height: 48px; font-size: 16px; }
  .vch-check { min-height: 48px; }
  .vch-filters .vch-field, .vch-filters .vch-field.vch-grow, .vch-filters .vch-field.vch-date { flex: 1 1 100%; }
  .vch-filters .vch-field.vch-buttons { flex: 1 1 100%; }
  .vch-filters .vch-field.vch-date { flex: 1 1 calc(50% - 4px); }
  .vch-line .c-no { grid-column: span 3; }
  .vch-line .c-kind { grid-column: span 9; }
  .vch-line .c-qty, .vch-line .c-rate, .vch-line .c-tax, .vch-line .c-amount, .vch-line .c-taxamt, .vch-line .c-net { grid-column: span 6; }
  .vch-buttons-bar { justify-content: stretch; }
  .vch-buttons-bar.vch-sticky { position: sticky; bottom: 0; background: var(--mud-palette-background, #f4f6f9); padding: 8px 0; z-index: 5; }
  .vch-buttons-bar > * { flex: 1 1 calc(50% - 8px); }
  .vch-buttons-bar.vch-sticky > * { flex: 1 1 28%; min-width: 0; padding-left: 4px; padding-right: 4px; }
  .vch-totals-box { max-width: none; }
  .vch-totals { text-align: left; }
  /* The list table becomes a card per voucher. */
  .vch-table thead { display: none; }
  .vch-table, .vch-table tbody, .vch-table tr, .vch-table td { display: block; width: 100%; box-sizing: border-box; }
  .vch-table tr.vch-row { border: 1px solid var(--mud-palette-lines-default, #e0e0e0); border-radius: 6px; margin-bottom: 8px; padding: 6px 10px; background: var(--mud-palette-surface, #fff); position: relative; }
  .vch-table td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .vch-table td::before { content: attr(data-label); color: var(--mud-palette-text-secondary); font-size: .75rem; text-align: left; flex: 0 0 38%; }
  .vch-table td:empty { display: none; }
  .vch-table td.vch-actions-col { position: absolute; top: 2px; right: 2px; width: auto; padding: 0; }
  .vch-table td.vch-actions-col::before { content: none; }
  .vch-particulars { max-width: none; white-space: normal; }
}
.vch-date-pick::-webkit-datetime-edit { display: none; }
.vch-date-pick::-webkit-calendar-picker-indicator { margin: 0; cursor: pointer; }
.vch-filters-more { display: contents; }
.vch-filters-toggle { display: none; }
@media (max-width: 599px) {
  .vch-filters-toggle { display: inline-flex; flex: 0 0 auto; }
  .vch-filters-more { display: none; }
  .vch-filters-more.open { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
  .vch-table td:first-child { padding-right: 32px; }
  .vch-filters .vch-field.vch-grow { flex: 1 1 calc(100% - 110px); }
}
@media (max-width: 599px) { .bms-filter-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; } }
.bms-only-xs { display: none !important; }
@media (max-width: 599px) {
  .bms-only-xs { display: inline-flex !important; }
  .bms-collapsed-xs { display: none; }
}

/* Master lists and their edit dialogs (src/BMS.Web/Masters). */
.bms-badge { display: inline-block; border-radius: 10px; padding: 1px 9px; font-size: .75rem; font-weight: 600; white-space: nowrap; background: var(--bms-tint-2); color: var(--bms-accent-ink); }
.bms-badge-active { background: var(--bms-success-bg); color: var(--bms-success); }
.bms-badge-inactive { background: var(--bms-neutral-bg); color: var(--bms-muted); }
.bms-badge-closed { background: var(--bms-warning-bg); color: var(--bms-warning-ink); }
.bms-badge-info { background: var(--bms-tint-3); color: var(--bms-accent); }
.bms-grid tbody tr.bms-row-inactive td { color: var(--bms-faded); }
.bms-hint { color: var(--mud-palette-text-secondary); font-size: .75rem; }
.bms-hint-warn { color: var(--bms-warning); }
.bms-upper { text-transform: uppercase; }
.bms-error-panel { background: var(--bms-danger-bg); border-radius: 4px; padding: 8px 10px; }
.bms-error-list { margin: 0; padding-left: 1.1rem; }
.bms-note { border-radius: 4px; padding: 8px 10px; font-size: .85rem; background: var(--bms-tint-2); color: var(--bms-accent-ink); }
.bms-note-warning { background: var(--bms-warning-bg); color: var(--bms-warning-ink); }
.bms-note-error { background: var(--bms-danger-bg); color: var(--bms-danger-ink); }
.bms-detail { background: var(--bms-surface); border: 1px solid var(--bms-line); border-radius: 6px; padding: 10px 14px; margin-top: 10px; font-size: .85rem; }
.bms-detail-title { font-weight: 600; margin-bottom: 4px; }
.bms-detail-grid { display: grid; grid-template-columns: 110px 1fr; gap: 4px 14px; }
.bms-detail-grid > dt { font-weight: 600; color: var(--bms-label); }
.bms-detail-grid > dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.bms-logo-box { width: 170px; height: 64px; border: 1px solid var(--bms-line-strong); border-radius: 3px; display: flex; align-items: center; justify-content: center; background: var(--bms-surface); }
.bms-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bms-logo-box.bms-logo-square { width: 64px; overflow: hidden; }
.bms-logo-box.bms-logo-square img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.bms-file-button { display: inline-flex; align-items: center; min-height: 31px; padding: 3px 10px; border: 1px solid var(--bms-line-input); border-radius: 4px; background: var(--bms-surface); font-size: .8125rem; font-weight: 500; letter-spacing: .02em; cursor: pointer; }
.bms-file-button:hover { background: var(--bms-tint-1); }
.bms-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
@media (max-width: 599px) {
  .bms-detail-grid { grid-template-columns: 1fr; }
}

/* The heading of a menu group: a click folds the group open or shut. */
/* The menu: the module drop-down at the top, the chosen menu's sections under it, Settings fixed at the bottom of the drawer. */
.bms-drawer-body { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.bms-nav { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.bms-nav-module { padding: 10px 10px 4px; }
.bms-module-select { width: 100%; box-sizing: border-box; padding: 7px 10px; border-radius: 6px; border: 1px solid var(--bms-tint-3); background: var(--bms-tint-1);
    color: inherit; font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; }
.bms-module-select:focus-visible { outline: 2px solid var(--bms-focus); outline-offset: 1px; }
.bms-nav-search { padding: 6px 12px 2px; }
.bms-menu-search { width: 100%; box-sizing: border-box; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--bms-tint-3); background: transparent;
    color: inherit; font: inherit; font-size: .9rem; }
.bms-menu-search:focus-visible { outline: 2px solid var(--bms-focus); outline-offset: 1px; }
.bms-nav-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.bms-navsection { margin: 10px 16px 2px; color: var(--bms-muted); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.bms-settings-button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; margin: 4px 6px; padding: 8px 14px; border-radius: 4px;
    border-top: 1px solid var(--bms-tint-2); cursor: pointer; font-weight: 600; }
.bms-settings-button:hover { background: var(--bms-tint-1); }
.bms-settings-button:focus-visible { outline: 2px solid var(--bms-focus); outline-offset: -2px; }
.bms-settings-active { background: var(--bms-tint-2); color: var(--bms-accent-ink); }
.bms-settings-button span { font-size: 1.1rem; }
/* A coloured menu (Screen Colour: "Colour the menu too"): the drawer and its entries in the menu colours of the scheme (--bms-nav-*). */
.bms-menu-coloured, .bms-menu-coloured .mud-drawer-content { background-color: var(--bms-nav-bg) !important; color: var(--bms-nav-ink); }
.bms-menu-coloured .mud-nav-link { color: var(--bms-nav-ink) !important; }
.bms-menu-coloured .mud-nav-link:hover { background-color: var(--bms-nav-hover) !important; }
.bms-menu-coloured .mud-nav-link.active { background-color: var(--bms-nav-active) !important; color: var(--bms-nav-ink) !important; font-weight: 600; }
.bms-menu-coloured .bms-navsection, .bms-menu-coloured [data-testid=footer-version] { color: var(--bms-nav-muted) !important; }
.bms-menu-coloured .bms-settings-button { color: var(--bms-nav-ink); border-top-color: var(--bms-nav-hover); }
.bms-menu-coloured .bms-settings-button:hover { background: var(--bms-nav-hover); }
.bms-menu-coloured .bms-settings-active { background: var(--bms-nav-active); color: var(--bms-nav-ink); }
.bms-menu-coloured .bms-module-select { background: var(--bms-nav-hover); color: var(--bms-nav-ink); border-color: var(--bms-nav-muted); }
.bms-menu-coloured .bms-module-select option { background: var(--bms-surface); color: var(--bms-ink); }
.bms-menu-coloured .bms-menu-search { color: var(--bms-nav-ink); border-color: var(--bms-nav-muted); }

/* The company logo in the header bar, on a white tile so a logo drawn for white paper reads on the coloured bar. */
.bms-header-logo { display: inline-flex; align-items: center; background: #fff; border-radius: 4px; padding: 2px 6px; height: 34px; flex: 0 0 auto; }
.bms-header-logo img { max-height: 30px; max-width: 140px; object-fit: contain; display: block; }
/* The company switch in the header (more than one company): the company the user works in. */
.bms-company-switch { background: rgba(255,255,255,.12); color: inherit; border: 1px solid rgba(255,255,255,.6); border-radius: 4px; padding: 3px 6px; font: inherit;
    font-size: .875rem; font-weight: 600; max-width: 260px; min-width: 0; text-overflow: ellipsis; cursor: pointer; }
.bms-company-switch option { color: #1f2937; background: #fff; }
.bms-company-switch:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* The account button in the header: the user's photo in a circle, or their initials. */
.bms-avatar { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.85); padding: 0; margin: 0 4px; overflow: hidden; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.18); color: inherit; font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1; }
.bms-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bms-avatar:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* The zoom of the app bar: A-, the percentage (a click gives 100%) and A+, on the colour of the bar. */
.bms-zoom { display: inline-flex; align-items: center; gap: 2px; margin: 0 8px 0 12px; white-space: nowrap; }
.bms-zoom-button { border: 1px solid rgba(255,255,255,.55); background: rgba(255,255,255,.12); color: inherit; font-family: inherit; font-size: .8125rem;
    font-weight: 600; line-height: 1; min-width: 32px; height: 28px; padding: 0 6px; border-radius: 4px; cursor: pointer; }
.bms-zoom-button:hover:not(:disabled) { background: rgba(255,255,255,.26); }
.bms-zoom-button:disabled { opacity: .45; cursor: default; }
.bms-zoom-button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.bms-zoom-value { min-width: 50px; font-weight: 500; }

/* Printing (the Print button of every page, or the browser's own Ctrl+P): only the page itself, with its heading, full tables and no buttons. */
.bms-printonly { display: none; }
@media print {
  /* A print is the page at its own size, whatever the zoom on screen. */
  html { zoom: 1 !important; }
    .mud-appbar, .mud-drawer, .mud-snackbar-provider, .mud-overlay, .bms-noprint, .bms-actionbar,
    .mud-button-root, .mud-icon-button, .mud-menu, .mud-pagination, .bms-boot { display: none !important; }
    .bms-printonly { display: block !important; }
    .bms-print-heading { font-size: 11px; color: #444; border-bottom: 1px solid #999; margin: 0 0 8px; padding-bottom: 4px; }
    .mud-main-content { padding: 0 !important; margin: 0 !important; }
    .mud-layout, .mud-main-content, .bms-page { height: auto !important; overflow: visible !important; }
    .bms-table-scroll { overflow: visible !important; max-height: none !important; }
    table { page-break-inside: auto; }
    thead { display: table-header-group; }
    tr { page-break-inside: avoid; }
    body { background: #fff !important; color: #000 !important; }
    /* Dark pages print light: the MudBlazor colours of a light page (the app's own variables are dark on the screen only). */
    html:root { color-scheme: light; --mud-palette-background: #fff; --mud-palette-surface: #fff; --mud-palette-background-gray: #f5f5f5;
        --mud-palette-text-primary: #424242; --mud-palette-text-secondary: rgba(0,0,0,.54); --mud-palette-lines-default: rgba(0,0,0,.12);
        --mud-palette-table-lines: #e0e0e0; --mud-palette-divider: #e0e0e0; }
    a { color: inherit !important; text-decoration: none !important; }
}
.bms-term-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.bms-term-row input[type=checkbox] { margin-top: 8px; }
.bms-term-no { min-width: 2rem; padding-top: 6px; color: var(--mud-palette-text-secondary); }
textarea.bms-term-text { flex: 1; min-width: 0; box-sizing: border-box; line-height: 1.4; font: inherit; resize: vertical; }
.bms-term-off textarea.bms-term-text { opacity: .6; }
.bms-drawer-logo { display: block; height: 80px; width: auto; max-width: calc(100% - 32px); margin: 14px auto 8px; filter: drop-shadow(2px 3px 2px rgba(0, 0, 0, .45)) drop-shadow(-1px -1px 0 rgba(255, 255, 255, .3)); }

/* Vendor portal: the progress line of an invoice (done steps in the accent, the current one bold), its facts, payments and history. */
.vp-steps { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 0 0 10px 0; }
.vp-step { font-size: .75rem; padding: 4px 10px; border-radius: 12px; background: var(--bms-neutral-bg); color: var(--bms-muted); }
.vp-step.vp-done { background: var(--bms-tint-3); color: var(--bms-accent-ink); }
.vp-step.vp-current { background: var(--bms-accent); color: #fff; font-weight: 700; }
.vp-stage { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.vp-reason { color: var(--bms-danger-ink); }
.vp-facts { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 0 0 10px 0; }
.vp-facts dt { color: var(--bms-label); }
.vp-facts dd { margin: 0; }
.vp-facts dd.bms-num { text-align: left; font-variant-numeric: tabular-nums; }
.vp-heading { font-size: .95rem; font-weight: 600; margin: 12px 0 6px 0; }
.vp-table { width: 100%; }
.vp-history { list-style: none; padding: 0; margin: 0; }
.vp-history li { padding: 4px 0; border-bottom: 1px solid var(--bms-grid-line); }
.vp-shell { min-height: 100vh; background: var(--bms-page); }
.vp-bar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--bms-accent-dark); color: #fff; flex-wrap: wrap; }
.vp-bar .vp-title { font-weight: 600; font-size: 1.05rem; }
.vp-bar .vp-party { opacity: .9; font-size: .85rem; }
.vp-bar .vp-spacer { flex: 1 1 auto; }
.vp-bar button { background: transparent; border: 1px solid rgba(255,255,255,.7); color: #fff; border-radius: 4px; padding: 4px 10px; cursor: pointer; }
.vp-tabs { display: flex; gap: 4px; padding: 8px 16px 0 16px; flex-wrap: wrap; border-bottom: 1px solid var(--bms-line); background: var(--bms-surface); }
.vp-tabs button { background: transparent; border: none; padding: 8px 14px; cursor: pointer; color: var(--bms-ink); border-bottom: 3px solid transparent; }
.vp-tabs button.vp-active { border-bottom-color: var(--bms-accent); font-weight: 600; color: var(--bms-accent-ink); }
.vp-body { padding: 16px; max-width: 1100px; }
.vp-card { background: var(--bms-surface); border: 1px solid var(--bms-line); border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
.vp-list { width: 100%; }
.vp-list tr { cursor: pointer; }
.vp-list tr.vp-selected td { background: var(--bms-tint-2); }
@media (max-width: 599px) { .vp-body { padding: 10px; } .vp-facts { grid-template-columns: 1fr; } }
