/* Appearance tokens, ported from app-stack/mops, whose picker is these same
   six schemes. Straits is :root because it is the house look. Every other
   scheme re-points the same names, and the Booking Desk aliases
   (--tardis-blue, --old-gold, …) are var() references, so a scheme change
   flows through rules that never name a colour of their own.

   Grey is retired: theme.js sends anyone stored on it to Black. Terracotta
   and Verdant were renamed, not retired — Loro Piana and Gucci. */

/* Straits — the house look: navy chrome, cream paper, old-gold action. */
:root,
[data-theme="straits"] {
  color-scheme: light;

  --primary: #cdb14d;
  --primary-foreground: #000000;
  --background: #f9f4f1;
  --foreground: #172148;
  --card: #fffdfb;
  --card-foreground: #172148;
  --popover: #fffdfb;
  --popover-foreground: #172148;
  --muted: #f3ece6;
  --muted-foreground: #5c5648;
  --accent: #f3ece6;
  --accent-foreground: #172148;
  --secondary: #eee7d7;
  --secondary-foreground: #172148;
  --border: #e6ded6;
  --input: #e6ded6;
  --ring: #cdb14d;

  --sidebar: #172148;
  --sidebar-foreground: #f9f4f1;
  --sidebar-primary: #cdb14d;
  --sidebar-primary-foreground: #000000;
  --sidebar-accent: #cdb14d26;
  --sidebar-accent-foreground: #f3d16b;
  --sidebar-border: #24305c;
  --sidebar-ring: #cdb14d;

  --mops-base-white: #ffffff;
  --mops-base-black: #000000;
  --mops-background-50: #fffdfb;
  --mops-background-100: #f9f4f1;
  --mops-light-grey-50: #f3ece6;
  --mops-light-grey-100: #e6ded6;
  --mops-light-grey-200: #d8cec2;
  --mops-light-grey-300: #b6ab9c;
  --mops-light-grey-400: #948a7c;
  --mops-dark-grey-50: #7a7466;
  --mops-dark-grey-100: #4a4638;
  --mops-dark-grey-200: #172148;
  --mops-outline: #e6ded6;
  --mops-outline-50: #5c5648;
  --mops-primary-50: #f3d16b;
  --mops-primary-100: #e3c25c;
  --mops-primary-200: #d8bc55;
  --mops-primary-400: #aa8a40;
  --mops-success: #00a478;
  --mops-success-50: #ccede4;
  --mops-success-100: #00a478;
  --mops-error: #ff3b30;
  --mops-error-50: #ffd6d4;
  --mops-error-100: #ff938d;
  --mops-error-200: #ff3b30;
  --mops-warning-50: #ffe6cc;
  --mops-warning-100: #fb8007;
  --mops-misc-pink: #fff3f7;
  --mops-misc-light-blue: #d6e8ff;
  --mops-misc-blue: #4f8af3;
  --mops-misc-orange: #ffba06;

  --tardis-blue: var(--sidebar);
  --mississippi: var(--mops-outline-50);
  --sea-foam: var(--border);
  --honey: var(--mops-primary-400);
  --old-gold: var(--primary);
  --row-stripe: var(--muted);
  --warn-amber: #b06a00;
  --text-muted: var(--muted-foreground);

  --navbar-bg: var(--card);
  --navbar-fg: var(--foreground);
  --nav-link: var(--mops-dark-grey-50);
  --nav-link-hover: var(--foreground);
  --on-chrome: var(--sidebar-foreground);
  --link: #172148;
  --link-hover: #aa8a40;
  --btn-primary-bg: var(--sidebar);
  --btn-primary-fg: var(--sidebar-foreground);
}

/* Black — near-black chrome for night work. Gold is the only colour. */
[data-theme="black"] {
  color-scheme: dark;

  --primary: #cdb14d;
  --primary-foreground: #000000;
  --background: #0a0a0a;
  --foreground: #f5f5f5;
  --card: #161616;
  --card-foreground: #f5f5f5;
  --popover: #161616;
  --popover-foreground: #f5f5f5;
  --muted: #2a2a2a;
  --muted-foreground: #dcdcdc;
  --accent: #2a2a2a;
  --accent-foreground: #f5f5f5;
  --secondary: #2a2a2a;
  --secondary-foreground: #f5f5f5;
  --border: #2a2a2a;
  --input: #2a2a2a;
  --ring: #cdb14d;

  --sidebar: #050505;
  --sidebar-foreground: #f5f5f5;
  --sidebar-primary: #cdb14d;
  --sidebar-primary-foreground: #000000;
  --sidebar-accent: #cdb14d26;
  --sidebar-accent-foreground: #f3d16b;
  --sidebar-border: #2a2a2a;
  --sidebar-ring: #cdb14d;

  --mops-background-50: #161616;
  --mops-background-100: #0a0a0a;
  --mops-light-grey-50: #1f1f1f;
  --mops-light-grey-100: #2a2a2a;
  --mops-light-grey-200: #3a3a3a;
  --mops-light-grey-300: #5c5c5c;
  --mops-light-grey-400: #7a7a7a;
  --mops-dark-grey-50: #bdbdbd;
  --mops-dark-grey-100: #cfcfcf;
  --mops-dark-grey-200: #f5f5f5;
  --mops-outline: #2a2a2a;
  --mops-outline-50: #dcdcdc;
  --mops-primary-50: #f3d16b;
  --mops-primary-100: #e3c25c;
  --mops-primary-200: #d8bc55;
  --mops-primary-400: #aa8a40;

  --warn-amber: #fb8007;
  --link: #f3d16b;
  --link-hover: #cdb14d;
  --btn-primary-bg: var(--primary);
  --btn-primary-fg: var(--primary-foreground);
}

/* Gucci — bottle-green chrome on canvas tan, with the web stripe red as the
   accent. Desk-only; not a middle-office scheme. */
[data-theme="gucci"] {
  color-scheme: light;

  --primary: #14432c;
  --primary-foreground: #faf6ec;
  --background: #efe6d2;
  --foreground: #2b2115;
  --card: #faf6ec;
  --card-foreground: #2b2115;
  --popover: #faf6ec;
  --popover-foreground: #2b2115;
  --muted: #e5d9bf;
  --muted-foreground: #5c4f3a;
  --accent: #e5d9bf;
  --accent-foreground: #2b2115;
  --secondary: #dbcaa9;
  --secondary-foreground: #2b2115;
  --border: #b08d57;
  --input: #b08d57;
  --ring: #b08d57;

  --sidebar: #14432c;
  --sidebar-foreground: #efe6d2;
  --sidebar-primary: #1b5e3f;
  --sidebar-primary-foreground: #faf6ec;
  --sidebar-accent: #00000038;
  --sidebar-accent-foreground: #e8c98a;
  --sidebar-border: #0e3120;
  --sidebar-ring: #b08d57;

  --mops-background-50: #faf6ec;
  --mops-background-100: #efe6d2;
  --mops-light-grey-50: #e5d9bf;
  --mops-light-grey-100: #b08d57;
  --mops-light-grey-200: #a07d49;
  --mops-light-grey-300: #856541;
  --mops-light-grey-400: #6b5134;
  --mops-dark-grey-50: #5c4f3a;
  --mops-dark-grey-100: #3d3223;
  --mops-dark-grey-200: #2b2115;
  --mops-outline: #b08d57;
  --mops-outline-50: #5c4f3a;
  --mops-primary-50: #e8c98a;
  --mops-primary-100: #b08d57;
  --mops-primary-200: #a07d49;
  --mops-primary-400: #856541;

  --tardis-blue: var(--sidebar);
  --mississippi: var(--mops-outline-50);
  --sea-foam: var(--border);
  --honey: var(--mops-primary-400);
  --old-gold: var(--mops-primary-200);
  --row-stripe: var(--muted);
  --warn-amber: #8a5410;
  --text-muted: var(--muted-foreground);

  --navbar-bg: var(--card);
  --navbar-fg: var(--foreground);
  --nav-link: var(--mops-dark-grey-50);
  --nav-link-hover: var(--foreground);
  --on-chrome: var(--sidebar-foreground);
  --link: var(--foreground);
  --link-hover: var(--primary);
  --btn-primary-bg: var(--primary);
  --btn-primary-fg: var(--primary-foreground);
}

/* Loro Piana — vicuña and burgundy on undyed cashmere. Quiet by design:
   the metallics are bronze rather than gold. Desk-only. */
[data-theme="loropiana"] {
  color-scheme: light;

  --primary: #5e2430;
  --primary-foreground: #fbf7ef;
  --background: #f2ece0;
  --foreground: #33291f;
  --card: #fbf7ef;
  --card-foreground: #33291f;
  --popover: #fbf7ef;
  --popover-foreground: #33291f;
  --muted: #e7dfcd;
  --muted-foreground: #6b5f4c;
  --accent: #e7dfcd;
  --accent-foreground: #33291f;
  --secondary: #ddd2b8;
  --secondary-foreground: #33291f;
  --border: #cfc3ad;
  --input: #cfc3ad;
  --ring: #8c7355;

  --sidebar: #5e2430;
  --sidebar-foreground: #f2ece0;
  --sidebar-primary: #7a3040;
  --sidebar-primary-foreground: #fbf7ef;
  --sidebar-accent: #ffffff1a;
  --sidebar-accent-foreground: #e3d6bb;
  --sidebar-border: #4a1c26;
  --sidebar-ring: #8c7355;

  --mops-background-50: #fbf7ef;
  --mops-background-100: #f2ece0;
  --mops-light-grey-50: #e7dfcd;
  --mops-light-grey-100: #cfc3ad;
  --mops-light-grey-200: #b8ab92;
  --mops-light-grey-300: #a8977c;
  --mops-light-grey-400: #8c7355;
  --mops-dark-grey-50: #6b5f4c;
  --mops-dark-grey-100: #4a4031;
  --mops-dark-grey-200: #33291f;
  --mops-outline: #cfc3ad;
  --mops-outline-50: #6b5f4c;
  --mops-primary-50: #d9cbb0;
  --mops-primary-100: #a8977c;
  --mops-primary-200: #8c7355;
  --mops-primary-400: #6d5942;

  --tardis-blue: var(--sidebar);
  --mississippi: var(--mops-outline-50);
  --sea-foam: var(--border);
  --honey: var(--mops-primary-400);
  --old-gold: var(--mops-primary-200);
  --row-stripe: var(--muted);
  --warn-amber: #8a5410;
  --text-muted: var(--muted-foreground);

  --navbar-bg: var(--card);
  --navbar-fg: var(--foreground);
  --nav-link: var(--mops-dark-grey-50);
  --nav-link-hover: var(--foreground);
  --on-chrome: var(--sidebar-foreground);
  --link: var(--foreground);
  --link-hover: var(--primary);
  --btn-primary-bg: var(--primary);
  --btn-primary-fg: var(--primary-foreground);
}

/* Miu Miu — the one scheme with PALE chrome, and that is the point of it.
   Powder blue cannot be the primary (nothing readable sits on it at this
   size), so the primary is the slate-teal ink and the blue does the chrome
   and the tints. Desk-only. */
[data-theme="miumiu"] {
  color-scheme: light;

  --primary: #1f3640;
  --primary-foreground: #f4f5f3;
  --background: #f4f5f3;
  --foreground: #232a2b;
  --card: #ffffff;
  --card-foreground: #232a2b;
  --popover: #ffffff;
  --popover-foreground: #232a2b;
  --muted: #e6eae8;
  --muted-foreground: #5b6567;
  --accent: #e6eae8;
  --accent-foreground: #232a2b;
  --secondary: #d8e0df;
  --secondary-foreground: #232a2b;
  --border: #cdd5d4;
  --input: #cdd5d4;
  --ring: #8c9b9e;

  --sidebar: #aec9d6;
  --sidebar-foreground: #1f3640;
  --sidebar-primary: #1f3640;
  --sidebar-primary-foreground: #f4f5f3;
  --sidebar-accent: #ffffffb0;
  --sidebar-accent-foreground: #1f3640;
  --sidebar-border: #93b3c2;
  --sidebar-ring: #1f3640;

  --mops-background-50: #ffffff;
  --mops-background-100: #f4f5f3;
  --mops-light-grey-50: #e6eae8;
  --mops-light-grey-100: #cdd5d4;
  --mops-light-grey-200: #b3bfbf;
  --mops-light-grey-300: #8c9b9e;
  --mops-light-grey-400: #6d7b7d;
  --mops-dark-grey-50: #5b6567;
  --mops-dark-grey-100: #384244;
  --mops-dark-grey-200: #232a2b;
  --mops-outline: #cdd5d4;
  --mops-outline-50: #5b6567;
  --mops-primary-50: #c3cfc0;
  --mops-primary-100: #aec9d6;
  --mops-primary-200: #8c9b9e;
  --mops-primary-400: #1f3640;

  --tardis-blue: var(--sidebar);
  --mississippi: var(--mops-outline-50);
  --sea-foam: var(--border);
  --honey: var(--mops-primary-400);
  --old-gold: var(--mops-primary-200);
  --row-stripe: var(--muted);
  --warn-amber: #8a5410;
  --text-muted: var(--muted-foreground);

  --navbar-bg: var(--sidebar);
  --navbar-fg: var(--sidebar-foreground);
  --nav-link: color-mix(in srgb, var(--sidebar-foreground) 72%, var(--sidebar));
  --nav-link-hover: var(--sidebar-foreground);
  --on-chrome: var(--sidebar-foreground);
  --link: var(--foreground);
  --link-hover: var(--primary);
  --btn-primary-bg: var(--primary);
  --btn-primary-fg: var(--primary-foreground);
}

/* Rolex — forest-green chrome, champagne gold. Dark. Desk-only. */
[data-theme="rolex"] {
  color-scheme: dark;

  --primary: #cda44e;
  --primary-foreground: #0b0f0d;
  --background: #0b0f0d;
  --foreground: #f2ede2;
  --card: #101512;
  --card-foreground: #f2ede2;
  --popover: #101512;
  --popover-foreground: #f2ede2;
  --muted: #12211a;
  --muted-foreground: #a8b0a4;
  --accent: #12211a;
  --accent-foreground: #f2ede2;
  --secondary: #12211a;
  --secondary-foreground: #f2ede2;
  --border: #26302a;
  --input: #26302a;
  --ring: #cda44e;

  --sidebar: #07472f;
  --sidebar-foreground: #f2ede2;
  --sidebar-primary: #cda44e;
  --sidebar-primary-foreground: #0b0f0d;
  --sidebar-accent: #cda44e26;
  --sidebar-accent-foreground: #d4ac57;
  --sidebar-border: #0a5c3c;
  --sidebar-ring: #cda44e;

  --mops-base-white: #f2ede2;
  --mops-base-black: #0b0f0d;
  --mops-background-50: #101512;
  --mops-background-100: #0b0f0d;
  --mops-light-grey-50: #12211a;
  --mops-light-grey-100: #26302a;
  --mops-light-grey-200: #35443c;
  --mops-light-grey-300: #5a6a62;
  --mops-light-grey-400: #7a8a80;
  --mops-dark-grey-50: #a8b0a4;
  --mops-dark-grey-100: #c8cfc6;
  --mops-dark-grey-200: #f2ede2;
  --mops-outline: #26302a;
  --mops-outline-50: #a8b0a4;
  --mops-primary-50: #d4ac57;
  --mops-primary-100: #cda44e;
  --mops-primary-200: #cda44e;
  --mops-primary-400: #a8843a;
  --mops-success: #3d9a6a;
  --mops-success-50: #1a3d2c;
  --mops-success-100: #3d9a6a;
  --mops-error: #e05a4a;
  --mops-error-50: #3d1a16;
  --mops-error-100: #e8887c;
  --mops-error-200: #e05a4a;
  --mops-warning-50: #3d2e14;
  --mops-warning-100: #d4ac57;
  --mops-misc-pink: #2a1c1c;
  --mops-misc-orange: #d4ac57;

  --tardis-blue: var(--sidebar);
  --mississippi: var(--mops-outline-50);
  --sea-foam: var(--border);
  --honey: var(--mops-primary-50);
  --old-gold: var(--primary);
  --row-stripe: var(--muted);
  --warn-amber: #d4ac57;
  --text-muted: var(--muted-foreground);

  --navbar-bg: var(--sidebar);
  --navbar-fg: var(--sidebar-foreground);
  --nav-link: #cda44e;
  --nav-link-hover: #d4ac57;
  --on-chrome: var(--sidebar-foreground);
  --link: #cda44e;
  --link-hover: #d4ac57;
  --btn-primary-bg: var(--primary);
  --btn-primary-fg: var(--primary-foreground);
}

/* Bootstrap 5.3 reads these for forms, links, muted text. Point them at
   the active scheme so a picker change is not just the page background. */
html[data-theme] {
  --bs-body-bg: var(--background);
  --bs-body-color: var(--foreground);
  --bs-secondary-color: var(--muted-foreground);
  --bs-border-color: var(--border);
  --bs-tertiary-bg: var(--muted);
  --bs-emphasis-color: var(--foreground);
  --bs-heading-color: var(--foreground);
  --bs-link-color: var(--link);
  --bs-link-hover-color: var(--link-hover);
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--foreground);
}

/* --- nav / chrome --- */
.sib-navbar {
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--sea-foam);
}
.sib-title {
  color: var(--navbar-fg);
  font-weight: 700;
  font-size: 1.15rem;
}
.sib-divider {
  width: 2px;
  height: 30px;
  background: var(--sea-foam);
  display: inline-block;
}
.sib-filename {
  color: var(--mississippi);
  font-size: .85rem;
}
.sib-rule { height: 3px; background: var(--old-gold); }

/* Navy wordmark on a dark bar disappears; invert on black/rolex. Loro Piana
   and Gucci tint it so the house navy does not leak. Miu Miu is the one pale
   chrome, so the artwork is left alone. */
[data-theme="black"] .sib-navbar .navbar-brand img,
[data-theme="rolex"] .sib-navbar .navbar-brand img {
  filter: brightness(0) invert(1);
}
[data-theme="loropiana"] .sib-navbar .navbar-brand img {
  filter: brightness(0) saturate(100%) invert(14%) sepia(35%) saturate(800%) hue-rotate(345deg);
}
[data-theme="gucci"] .sib-navbar .navbar-brand img {
  filter: brightness(0) saturate(100%) invert(22%) sepia(42%) saturate(1200%) hue-rotate(128deg);
}

/* --- gold call-to-action --- */
.btn-gold {
  background: var(--old-gold);
  border-color: var(--old-gold);
  color: var(--primary-foreground);
  font-weight: 700;
}
.btn-gold:hover, .btn-gold:focus {
  background: var(--honey);
  border-color: var(--honey);
  color: var(--primary-foreground);
}
.btn-gold:disabled { opacity: .55; }

.btn-primary {
  --bs-btn-color: var(--btn-primary-fg);
  --bs-btn-bg: var(--btn-primary-bg);
  --bs-btn-border-color: var(--btn-primary-bg);
  --bs-btn-hover-color: var(--btn-primary-fg);
  --bs-btn-hover-bg: var(--honey);
  --bs-btn-hover-border-color: var(--honey);
  --bs-btn-active-color: var(--btn-primary-fg);
  --bs-btn-active-bg: var(--honey);
  --bs-btn-active-border-color: var(--honey);
  --bs-btn-disabled-color: var(--btn-primary-fg);
  --bs-btn-disabled-bg: var(--btn-primary-bg);
  --bs-btn-disabled-border-color: var(--btn-primary-bg);
}

.btn-outline-primary {
  --bs-btn-color: var(--link);
  --bs-btn-border-color: var(--link);
  --bs-btn-hover-color: var(--btn-primary-fg);
  --bs-btn-hover-bg: var(--btn-primary-bg);
  --bs-btn-hover-border-color: var(--btn-primary-bg);
  --bs-btn-active-color: var(--btn-primary-fg);
  --bs-btn-active-bg: var(--btn-primary-bg);
  --bs-btn-active-border-color: var(--btn-primary-bg);
}

.sib-navbar .btn-outline-light {
  color: var(--navbar-fg);
  border-color: var(--sea-foam);
}
.sib-navbar .btn-outline-light:hover {
  background: var(--mississippi);
  border-color: var(--mississippi);
  color: var(--on-chrome);
}
.sib-navbar .navbar-text,
.sib-navbar .text-muted {
  color: var(--text-muted) !important;
}

.sib-heading { color: var(--navbar-fg); font-weight: 700; }

.sib-card { border: 1px solid var(--sea-foam); border-radius: 10px; }

/* --- review table --- */
.sib-table-wrap {
  border: 1px solid var(--sea-foam);
  border-radius: 8px;
  background: var(--card);
  max-height: calc(100vh - 230px);
  overflow: auto;
}
.sib-table {
  --bs-table-bg: var(--card);
  --bs-table-color: var(--foreground);
  --bs-table-border-color: var(--sea-foam);
  --bs-table-striped-bg: var(--row-stripe);
  color: var(--foreground);
}
.sib-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--tardis-blue);
  color: var(--on-chrome);
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}
.sib-table tbody td { font-size: .85rem; }
.sib-table tbody tr:nth-child(even) { background: var(--row-stripe); }
/* Faint gold column separators. Own-item rows used to paint a 3px gold
   inset on every cell, which read as thick column rules. */
.sib-table > :not(caption) > * > * {
  border-right: 1px solid color-mix(in srgb, var(--old-gold) 28%, transparent);
}
.sib-table > :not(caption) > * > *:last-child { border-right: 0; }

/* category colouring (mirrors the desktop foreground tags) */
.sib-table tr.cat-blocked td { color: var(--warn-amber); }
.sib-table tr.cat-info td    { color: var(--text-muted); }

.sib-result { font-family: "Consolas", monospace; font-size: .78rem; }
.sib-result-ok  { color: var(--mops-success); font-weight: 600; }
.sib-result-err { color: var(--mops-error); font-weight: 600; }
.sib-result-dup { color: var(--warn-amber); font-weight: 600; }
.sib-result-dry { color: var(--text-muted); }

.sib-mambu-link {
  font-size: .78rem;
  white-space: nowrap;
}

/* --- activity log --- */
.sib-activity-table-wrap { background: var(--card); }
.sib-activity-table thead th {
  background: var(--tardis-blue);
  color: var(--on-chrome);
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}
.sib-activity-sort {
  color: color-mix(in srgb, var(--on-chrome) 85%, transparent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.sib-activity-sort:hover {
  color: var(--on-chrome);
  text-decoration: underline;
}
.sib-activity-sort-active {
  color: var(--on-chrome);
  font-weight: 700;
}
.sib-activity-sort-icon {
  font-size: .65rem;
  opacity: .9;
}

.sib-mono   { font-family: "Consolas", monospace; }

/* --- client-report-web --- */
.card {
  border: 1px solid var(--sea-foam);
  border-radius: 10px;
  background: var(--card);
  color: var(--card-foreground);
}
.sib-card-header {
  background: var(--tardis-blue);
  color: var(--on-chrome);
  font-weight: 600;
  font-size: .95rem;
}
/* --- client picker ---
   Rows are their own layout rather than Bootstrap's .form-check: setting
   `padding: 1px 0` on .form-check zeroed its padding-left while the input kept
   its -1.5em margin, which dragged every checkbox outside the scroll container
   and clipped it to a sliver. Flex avoids that whole negative-margin dance. */
.client-list {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--sea-foam);
  border-radius: 8px;
  background: var(--card);
}
.client-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .3rem .6rem;
  font-size: .9rem;
  cursor: pointer;
  border-bottom: 1px solid var(--muted);
  margin: 0;
}
.client-row:last-child { border-bottom: 0; }
.client-row:hover { background: var(--row-stripe); }
.client-row input { flex: 0 0 auto; width: 1.05rem; height: 1.05rem; margin: 0; }
/* Selected rows must be obvious at a glance while scrolling a 400-row list --
   the checkbox alone is too small to scan. */
.client-row.is-selected {
  background: color-mix(in srgb, var(--old-gold) 16%, var(--card));
  font-weight: 600;
  color: var(--foreground);
  box-shadow: inset 3px 0 0 var(--old-gold);
}
.client-count { font-variant-numeric: tabular-nums; }
/* The job page's stage checklist. */
.stage-mark { font-size: .9rem; }

/* --- results page --- */
.sib-result-block {
  background: var(--card);
  border: 1px solid var(--sea-foam);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 16px;
}
.sib-result-block ul li { padding: 2px 0; }

/* --- internal-transfer additions ---
   Kept at the bottom so the shared block above stays byte-identical to
   client-report-web/static/style.css and can be diffed against it. */

/* Sortable column headers sit on the dark table header, so they need light
   text -- Bootstrap's default link blue is unreadable there. */
.sib-sort { color: var(--on-chrome); text-decoration: none; white-space: nowrap; }
.sib-sort:hover { color: var(--old-gold); text-decoration: underline; }
.sib-sort.is-active { color: var(--old-gold); }

/* The client rows here are single-select radios rather than checkboxes; same
   layout, but the radio needs the same explicit sizing the checkbox got. */
.client-row input[type="radio"] { flex: 0 0 auto; width: 1.05rem; height: 1.05rem; margin: 0; }

/* Danger variant of the result block, for the orphaned-transfer warning. */
.sib-result-block.border-danger { border-color: var(--mops-error); border-width: 2px; }

/* --- booking-desk additions ---
   Appended, so everything above stays diffable against
   internal-transfer-web/static/style.css and client-report-web's shared block. */

/* Sandbox warning. Amber, uppercase, above the chrome — unmissable on
   purpose. Production has no environment strip. */
.env-banner {
  text-align: center;
  font-weight: 700;
  letter-spacing: .08em;
  padding: .45rem;
  font-size: .85rem;
  text-transform: uppercase;
}
.env-banner.sandbox { background: #92400e; color: var(--mops-base-white); }

/* Menu items — chips, not body copy. A gold underline alone vanished on
   the dark bar; the active route is a filled gold pill. */
.sib-navbar {
  padding-top: .5rem;
  padding-bottom: .5rem;
}
.sib-navbar .navbar-brand {
  margin-right: 1.5rem;
}
.sib-navbar .sib-nav {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem .35rem;
}
.sib-navbar .nav-link {
  color: var(--navbar-fg);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.2;
  padding: .45rem .9rem;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.sib-navbar .nav-link:hover,
.sib-navbar .nav-link:focus-visible {
  color: var(--navbar-fg);
  background: color-mix(in srgb, var(--old-gold) 22%, transparent);
  border-color: color-mix(in srgb, var(--old-gold) 50%, transparent);
}
.sib-navbar .nav-link.active {
  color: var(--primary-foreground);
  background: var(--old-gold);
  border-color: var(--old-gold);
  box-shadow: none;
}

/* Definition lists carry most of the review and detail screens. */
dt { font-weight: 600; color: var(--mississippi); }
code { color: var(--foreground); font-weight: 600; }
table td, table th { vertical-align: middle; }

/* A queue row whose value date has passed: the item cannot post as entered, and
   that has to be visible while scanning rather than on opening it. */
tr.is-stale td { color: var(--warn-amber); }

.empty-state {
  background: var(--card);
  border: 1px dashed var(--sea-foam);
  border-radius: 12px;
  padding: 2.2rem 1.6rem;
  max-width: 36rem;
}
.kind-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .15rem .45rem;
  border-radius: 4px;
  white-space: nowrap;
}
.kind-badge.kind-fee {
  background: var(--mops-misc-light-blue);
  color: #172148;
}
.kind-badge.kind-trade {
  background: var(--tardis-blue);
  color: var(--on-chrome);
}
.kind-badge.kind-transfer {
  background: var(--muted);
  color: var(--foreground);
}
.kind-badge.kind-fx {
  background: var(--sea-foam);
  color: #172148;
}
[data-theme="loropiana"] .kind-badge.kind-fee,
[data-theme="loropiana"] .kind-badge.kind-fx {
  color: var(--foreground);
}
[data-theme="gucci"] .kind-badge.kind-fee,
[data-theme="gucci"] .kind-badge.kind-fx {
  color: var(--foreground);
}
[data-theme="rolex"] .kind-badge.kind-fx {
  color: var(--foreground);
}
tr.is-mine td:first-child { box-shadow: inset 3px 0 0 var(--old-gold); }
.sib-table thead th.sib-sortable {
  cursor: pointer;
  user-select: none;
}
.sib-table thead th.sib-sortable:hover { color: var(--old-gold); }
.sib-table thead th.sib-sortable.is-sorted { color: var(--old-gold); }
.sib-sort-ind {
  font-size: .65rem;
  opacity: .9;
  margin-left: .15rem;
}
.ticket-preview {
  background: var(--muted);
  border: 1px solid var(--sea-foam);
  border-radius: 8px;
  padding: .7rem .9rem;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}
.ticket-preview .ok { color: var(--mops-success); font-weight: 700; }
.ticket-preview .off { color: var(--mops-error-200); font-weight: 700; }
.sib-mono, .text-end.sib-mono { font-variant-numeric: tabular-nums; }
select.form-select[size] { min-height: 14rem; }
.form-label { font-weight: 600; color: var(--mississippi); font-size: .82rem; }

.form-control, .form-select {
  background-color: var(--card);
  color: var(--foreground);
  border-color: var(--input);
}
.form-control:focus, .form-select:focus {
  background-color: var(--card);
  color: var(--foreground);
  border-color: var(--ring);
  box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--ring) 25%, transparent);
}
.form-control::placeholder { color: var(--text-muted); }

/* --- appearance picker (header, next to username/logout) --- */
.sib-appearance-btn {
  color: var(--nav-link);
  border: 1px solid var(--sea-foam);
  background: transparent;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .4rem;
}
.sib-appearance-btn:hover,
.sib-appearance-btn:focus,
.sib-appearance-btn[aria-expanded="true"] {
  color: var(--nav-link-hover);
  border-color: var(--old-gold);
  background: var(--muted);
}
.sib-appearance-menu {
  width: 16rem;
  background: var(--popover);
  color: var(--popover-foreground);
  border-color: var(--sea-foam);
}
.sib-appearance-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.sib-appearance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}
.sib-appearance-opt {
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid var(--sea-foam);
  border-radius: .5rem;
  padding: .45rem .55rem;
  background: transparent;
  color: var(--foreground);
  font-size: .75rem;
  font-weight: 600;
  text-align: left;
  width: 100%;
}
.sib-appearance-opt:hover { border-color: var(--mops-light-grey-200); }
.sib-appearance-opt:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 40%, transparent);
}
.sib-appearance-opt.is-active {
  border-color: var(--old-gold);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent);
}
.sib-swatch {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: .35rem;
  border: 1px solid;
  flex-shrink: 0;
  position: relative;
}
.sib-swatch-straits { background: #172148; border-color: #cdb14d; }
.sib-swatch-black { background: #0a0a0a; border-color: #cdb14d; }
.sib-swatch-gucci { background: #14432c; border-color: #b3122c; }
.sib-swatch-loropiana { background: #5e2430; border-color: #a8977c; }
.sib-swatch-miumiu { background: #aec9d6; border-color: #1f3640; }
.sib-swatch-rolex { background: #07472f; border-color: #cda44e; }
.sib-appearance-opt.is-active .sib-swatch::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #cdb14d;
  font-size: .7rem;
  font-weight: 800;
  line-height: 1;
}

/* ============================================================================
   GUI redesign layer (bd-*)
   ----------------------------------------------------------------------------
   Presentation only. Everything below is new class names and new custom
   properties, so the blocks above stay byte-identical with the other desk
   apps and still diff against them.

   The tokens are declared once per scheme and are all var() references or
   color-mix() of tokens that already exist, so a scheme change flows through
   and no rule below names a colour of its own.
   ========================================================================== */

:root,
[data-theme="straits"] {
  --bd-page: var(--background);
  --bd-card: var(--mops-base-white);
  --bd-inset: var(--mops-base-white);
  --bd-border: var(--border);
  --bd-border-soft: color-mix(in srgb, var(--border) 60%, var(--card));
  --bd-text: var(--foreground);
  --bd-muted: var(--muted-foreground);
  --bd-muted-2: color-mix(in srgb, var(--mops-dark-grey-50) 80%, var(--foreground));
  --bd-accent: var(--primary);
  --bd-accent-strong: var(--mops-primary-400);
  --bd-accent-text: color-mix(in srgb, var(--mops-primary-400) 62%, var(--foreground));
  --bd-accent-tint: color-mix(in srgb, var(--primary) 16%, var(--card));
  --bd-accent-tint-soft: color-mix(in srgb, var(--primary) 9%, var(--card));
  --bd-danger: var(--mops-error);
  --bd-danger-text: color-mix(in srgb, var(--mops-error) 70%, var(--foreground));
  --bd-danger-tint: color-mix(in srgb, var(--mops-error) 12%, var(--card));
  --bd-success-text: color-mix(in srgb, var(--mops-success) 80%, var(--foreground));
  --bd-success-tint: color-mix(in srgb, var(--mops-success) 14%, var(--card));
  --bd-warning-text: var(--warn-amber);
  --bd-warning-tint: color-mix(in srgb, var(--mops-warning-100) 16%, var(--card));
  --bd-info-text: color-mix(in srgb, var(--mops-misc-blue) 62%, var(--foreground));
  --bd-info-tint: color-mix(in srgb, var(--mops-misc-blue) 14%, var(--card));
  --bd-zero: #a8a29a;
  --bd-btn-fill: var(--sidebar);
  --bd-btn-fg: var(--sidebar-foreground);
  --bd-btn-fill-hover: color-mix(in srgb, var(--sidebar) 88%, var(--primary));
  --bd-card-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  --bd-hover: color-mix(in srgb, var(--muted) 70%, var(--card));
}

[data-theme="black"] {
  --bd-page: var(--background);
  --bd-card: var(--card);
  --bd-inset: color-mix(in srgb, var(--background) 55%, var(--card));
  --bd-border: var(--border);
  --bd-border-soft: color-mix(in srgb, var(--border) 65%, var(--card));
  --bd-text: var(--foreground);
  --bd-muted: var(--muted-foreground);
  --bd-muted-2: var(--mops-dark-grey-50);
  --bd-accent: var(--primary);
  --bd-accent-strong: var(--primary);
  --bd-accent-text: var(--mops-primary-50);
  --bd-accent-tint: color-mix(in srgb, var(--primary) 18%, var(--card));
  --bd-accent-tint-soft: color-mix(in srgb, var(--primary) 10%, var(--card));
  --bd-danger: var(--mops-error);
  --bd-danger-text: var(--mops-error-100);
  --bd-danger-tint: color-mix(in srgb, var(--mops-error) 22%, var(--card));
  --bd-success-text: color-mix(in srgb, var(--mops-success) 55%, var(--foreground));
  --bd-success-tint: color-mix(in srgb, var(--mops-success) 24%, var(--card));
  --bd-warning-text: var(--mops-misc-orange);
  --bd-warning-tint: color-mix(in srgb, var(--mops-warning-100) 24%, var(--card));
  --bd-info-text: color-mix(in srgb, var(--mops-misc-light-blue) 70%, var(--foreground));
  --bd-info-tint: color-mix(in srgb, var(--mops-misc-blue) 22%, var(--card));
  --bd-zero: color-mix(in srgb, var(--foreground) 42%, var(--card));
  --bd-btn-fill: var(--primary);
  --bd-btn-fg: var(--primary-foreground);
  --bd-btn-fill-hover: var(--mops-primary-50);
  --bd-card-shadow: none;
  --bd-hover: color-mix(in srgb, var(--muted) 55%, var(--card));
}

[data-theme="gucci"] {
  --bd-page: var(--background);
  --bd-card: var(--mops-base-white);
  --bd-inset: var(--mops-base-white);
  --bd-border: var(--border);
  --bd-border-soft: color-mix(in srgb, var(--border) 60%, var(--card));
  --bd-text: var(--foreground);
  --bd-muted: var(--muted-foreground);
  --bd-muted-2: color-mix(in srgb, var(--mops-dark-grey-50) 80%, var(--foreground));
  --bd-accent: #b3122c;
  --bd-accent-strong: var(--primary);
  --bd-accent-text: color-mix(in srgb, #b3122c 62%, var(--foreground));
  --bd-accent-tint: color-mix(in srgb, #b3122c 14%, var(--card));
  --bd-accent-tint-soft: color-mix(in srgb, #b3122c 8%, var(--card));
  --bd-danger: var(--mops-error);
  --bd-danger-text: color-mix(in srgb, var(--mops-error) 70%, var(--foreground));
  --bd-danger-tint: color-mix(in srgb, var(--mops-error) 12%, var(--card));
  --bd-success-text: color-mix(in srgb, var(--mops-success) 80%, var(--foreground));
  --bd-success-tint: color-mix(in srgb, var(--mops-success) 14%, var(--card));
  --bd-warning-text: #8a5410;
  --bd-warning-tint: color-mix(in srgb, var(--mops-warning-100) 16%, var(--card));
  --bd-info-text: color-mix(in srgb, var(--mops-misc-blue) 62%, var(--foreground));
  --bd-info-tint: color-mix(in srgb, var(--mops-misc-blue) 14%, var(--card));
  --bd-zero: #a2937a;
  --bd-btn-fill: var(--primary);
  --bd-btn-fg: var(--primary-foreground);
  --bd-btn-fill-hover: color-mix(in srgb, var(--primary) 82%, #0e3120);
  --bd-card-shadow: 0 1px 2px rgba(43, 33, 21, 0.07);
  --bd-hover: color-mix(in srgb, var(--muted) 70%, var(--card));
}

[data-theme="loropiana"] {
  --bd-page: var(--background);
  --bd-card: var(--mops-base-white);
  --bd-inset: var(--mops-base-white);
  --bd-border: var(--border);
  --bd-border-soft: color-mix(in srgb, var(--border) 60%, var(--card));
  --bd-text: var(--foreground);
  --bd-muted: var(--muted-foreground);
  --bd-muted-2: color-mix(in srgb, var(--mops-dark-grey-50) 80%, var(--foreground));
  --bd-accent: var(--primary);
  --bd-accent-strong: var(--primary);
  --bd-accent-text: color-mix(in srgb, var(--primary) 58%, var(--foreground));
  --bd-accent-tint: color-mix(in srgb, var(--primary) 16%, var(--card));
  --bd-accent-tint-soft: color-mix(in srgb, var(--primary) 9%, var(--card));
  --bd-danger: var(--mops-error);
  --bd-danger-text: color-mix(in srgb, var(--mops-error) 70%, var(--foreground));
  --bd-danger-tint: color-mix(in srgb, var(--mops-error) 12%, var(--card));
  --bd-success-text: color-mix(in srgb, var(--mops-success) 80%, var(--foreground));
  --bd-success-tint: color-mix(in srgb, var(--mops-success) 14%, var(--card));
  --bd-warning-text: #8a5410;
  --bd-warning-tint: color-mix(in srgb, var(--mops-warning-100) 16%, var(--card));
  --bd-info-text: color-mix(in srgb, var(--mops-misc-blue) 62%, var(--foreground));
  --bd-info-tint: color-mix(in srgb, var(--mops-misc-blue) 14%, var(--card));
  --bd-zero: #a39884;
  --bd-btn-fill: var(--primary);
  --bd-btn-fg: var(--primary-foreground);
  --bd-btn-fill-hover: color-mix(in srgb, var(--primary) 82%, #3a1620);
  --bd-card-shadow: 0 1px 2px rgba(51, 41, 31, 0.07);
  --bd-hover: color-mix(in srgb, var(--muted) 70%, var(--card));
}

[data-theme="miumiu"] {
  --bd-page: var(--background);
  --bd-card: var(--mops-base-white);
  --bd-inset: var(--mops-base-white);
  --bd-border: var(--border);
  --bd-border-soft: color-mix(in srgb, var(--border) 60%, var(--card));
  --bd-text: var(--foreground);
  --bd-muted: var(--muted-foreground);
  --bd-muted-2: color-mix(in srgb, var(--mops-dark-grey-50) 80%, var(--foreground));
  --bd-accent: #8c9b9e;
  --bd-accent-strong: var(--primary);
  --bd-accent-text: color-mix(in srgb, #1f3640 70%, var(--foreground));
  --bd-accent-tint: color-mix(in srgb, #aec9d6 40%, var(--card));
  --bd-accent-tint-soft: color-mix(in srgb, #aec9d6 20%, var(--card));
  --bd-danger: var(--mops-error);
  --bd-danger-text: color-mix(in srgb, var(--mops-error) 70%, var(--foreground));
  --bd-danger-tint: color-mix(in srgb, var(--mops-error) 12%, var(--card));
  --bd-success-text: color-mix(in srgb, var(--mops-success) 80%, var(--foreground));
  --bd-success-tint: color-mix(in srgb, var(--mops-success) 14%, var(--card));
  --bd-warning-text: #8a5410;
  --bd-warning-tint: color-mix(in srgb, var(--mops-warning-100) 16%, var(--card));
  --bd-info-text: color-mix(in srgb, var(--mops-misc-blue) 62%, var(--foreground));
  --bd-info-tint: color-mix(in srgb, var(--mops-misc-blue) 14%, var(--card));
  --bd-zero: #97a3a4;
  --bd-btn-fill: var(--primary);
  --bd-btn-fg: var(--primary-foreground);
  --bd-btn-fill-hover: color-mix(in srgb, var(--primary) 82%, #0d1a1f);
  --bd-card-shadow: 0 1px 2px rgba(35, 42, 43, 0.07);
  --bd-hover: color-mix(in srgb, var(--muted) 70%, var(--card));
}

[data-theme="rolex"] {
  --bd-page: var(--background);
  --bd-card: var(--card);
  --bd-inset: color-mix(in srgb, var(--background) 55%, var(--card));
  --bd-border: var(--border);
  --bd-border-soft: color-mix(in srgb, var(--border) 65%, var(--card));
  --bd-text: var(--foreground);
  --bd-muted: var(--muted-foreground);
  --bd-muted-2: var(--mops-dark-grey-50);
  --bd-accent: var(--primary);
  --bd-accent-strong: var(--primary);
  --bd-accent-text: var(--mops-primary-50);
  --bd-accent-tint: color-mix(in srgb, var(--primary) 18%, var(--card));
  --bd-accent-tint-soft: color-mix(in srgb, var(--primary) 10%, var(--card));
  --bd-danger: var(--mops-error);
  --bd-danger-text: var(--mops-error-100);
  --bd-danger-tint: color-mix(in srgb, var(--mops-error) 22%, var(--card));
  --bd-success-text: color-mix(in srgb, var(--mops-success) 55%, var(--foreground));
  --bd-success-tint: color-mix(in srgb, var(--mops-success) 24%, var(--card));
  --bd-warning-text: var(--mops-misc-orange);
  --bd-warning-tint: color-mix(in srgb, var(--mops-warning-100) 24%, var(--card));
  --bd-info-text: color-mix(in srgb, var(--mops-misc-light-blue) 70%, var(--foreground));
  --bd-info-tint: color-mix(in srgb, var(--mops-misc-blue) 22%, var(--card));
  --bd-zero: color-mix(in srgb, var(--foreground) 42%, var(--card));
  --bd-btn-fill: var(--primary);
  --bd-btn-fg: var(--primary-foreground);
  --bd-btn-fill-hover: var(--mops-primary-50);
  --bd-card-shadow: none;
  --bd-hover: color-mix(in srgb, var(--muted) 55%, var(--card));
}

/* One sans family for UI text, one mono for every machine value. The app had
   Segoe UI / Consolas and no second family, so IBM Plex is loaded and both
   stacks fall back to what was already here if the CDN is unreachable. */
:root {
  --bd-sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --bd-mono: "IBM Plex Mono", "Consolas", ui-monospace, monospace;
}

body { font-family: var(--bd-sans); }

.bd-mono {
  font-family: var(--bd-mono);
  font-variant-numeric: tabular-nums;
}

/* --- top bar ------------------------------------------------------------- */
.bd-topbar {
  /* 56px at every width the desk is actually used at. min-height rather than
     height because the six nav items wrap on a narrow window, and a fixed
     height let the wrapped row spill over the page below it. */
  min-height: 56px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 6px 28px;
  background: var(--bd-card);
  border-bottom: 1px solid var(--bd-border);
}
[data-theme="rolex"] .bd-topbar {
  background: var(--sidebar);
  border-bottom-color: var(--sidebar-border);
}
[data-theme="rolex"] .bd-brand { color: var(--sidebar-foreground); }
[data-theme="rolex"] .bd-brand__rule {
  background: color-mix(in srgb, var(--sidebar-foreground) 22%, var(--sidebar));
}
[data-theme="rolex"] .bd-nav__item { color: var(--primary); }
[data-theme="rolex"] .bd-nav__item:hover,
[data-theme="rolex"] .bd-nav__item:focus-visible {
  background: color-mix(in srgb, var(--primary) 14%, var(--sidebar));
  color: var(--mops-primary-50);
}
[data-theme="rolex"] .bd-nav__item.is-active {
  background: color-mix(in srgb, var(--primary) 18%, var(--sidebar));
  color: var(--mops-primary-50);
}
[data-theme="rolex"] .bd-nav__item.is-active .bd-nav__count {
  background: var(--sidebar-foreground);
  color: var(--sidebar);
}
[data-theme="rolex"] .bd-user__name { color: var(--muted-foreground); }
[data-theme="rolex"] .bd-avatar {
  background: color-mix(in srgb, var(--primary) 18%, var(--sidebar));
  color: var(--mops-primary-50);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--sidebar));
}

/* Miu Miu is the one PALE chrome, and that is the point of the scheme: the
   bar takes the powder blue and the type on it goes dark, the inverse of
   every other coloured-chrome theme. */
[data-theme="miumiu"] .bd-topbar {
  background: var(--sidebar);
  border-bottom-color: var(--sidebar-border);
}
[data-theme="miumiu"] .bd-brand { color: var(--sidebar-foreground); }
[data-theme="miumiu"] .bd-brand__rule {
  background: color-mix(in srgb, var(--sidebar-foreground) 22%, var(--sidebar));
}
[data-theme="miumiu"] .bd-nav__item { color: var(--sidebar-foreground); }
[data-theme="miumiu"] .bd-nav__item:hover,
[data-theme="miumiu"] .bd-nav__item:focus-visible {
  background: color-mix(in srgb, var(--mops-base-white) 55%, var(--sidebar));
  color: var(--sidebar-foreground);
}
[data-theme="miumiu"] .bd-nav__item.is-active {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
}
[data-theme="miumiu"] .bd-nav__item.is-active .bd-nav__count {
  background: var(--sidebar-accent-foreground);
  color: var(--mops-base-white);
}
[data-theme="miumiu"] .bd-user__name {
  color: color-mix(in srgb, var(--sidebar-foreground) 75%, var(--sidebar));
}
[data-theme="miumiu"] .bd-avatar {
  background: color-mix(in srgb, var(--mops-base-white) 60%, var(--sidebar));
  color: var(--sidebar-foreground);
  border-color: var(--sidebar-border);
}

/* --- Gucci "web" stripe --------------------------------------------------- */
/* Ported from MOPS (ftagib-middle-office), same as revenue-system-web. There
   the green-red-green web band sits on the sidebar's trailing edge; this app
   has a horizontal top bar, so the faithful analog is a 9px ribbon flush under
   the header. Scoped to the Gucci theme only, painted on a pseudo-element so
   the chrome markup stays theme-agnostic and nothing is rendered for the other
   five schemes.

   The three hexes are the brand web colours — a house cue, like the logo, not
   a theme token — which is the one place a literal colour is justified (MOPS
   hardcodes the same). Decorative red is confined to here and never sits next
   to a status, so the danger token stays the only load-bearing red. */
.bd-topbar { position: relative; }
[data-theme="gucci"] .bd-topbar::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 9px;
  pointer-events: none;
  z-index: 5;
  background: linear-gradient(
    to bottom,
    #1b5e3f 0 3px,
    #b3122c 3px 6px,
    #1b5e3f 6px 9px
  );
}

.bd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--bd-text);
  flex: 0 0 auto;
}
.bd-brand__logo {
  height: 26px;
  width: auto;
  display: block;
  flex: 0 0 auto;
}
/* The wordmark is navy artwork; on the dark schemes it would sit on a
   near-black or forest bar and vanish, so it is knocked out to white there.
   Loro Piana and Gucci tint it so the house navy does not leak. Miu Miu's
   chrome is pale, so the navy artwork reads as it is. */
[data-theme="black"] .bd-brand__logo,
[data-theme="rolex"] .bd-brand__logo { filter: brightness(0) invert(1); }
[data-theme="loropiana"] .bd-brand__logo {
  filter: brightness(0) saturate(100%) invert(14%) sepia(35%) saturate(800%) hue-rotate(345deg);
}
[data-theme="gucci"] .bd-brand__logo {
  filter: brightness(0) saturate(100%) invert(22%) sepia(42%) saturate(1200%) hue-rotate(128deg);
}

/* Separates the bank from the product: the logo is Straits, the words after it
   are which of its tools you are in. */
.bd-brand__rule {
  width: 1px;
  height: 20px;
  background: var(--bd-border);
  flex: 0 0 auto;
}
.bd-brand__name { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }

.bd-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  justify-content: center;
  flex-wrap: wrap;
}
.bd-nav__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  padding: 6px 12px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--bd-muted);
  white-space: nowrap;
}
.bd-nav__item:hover,
.bd-nav__item:focus-visible {
  background: var(--bd-hover);
  color: var(--bd-text);
}
.bd-nav__item.is-active {
  background: var(--bd-accent-tint);
  color: var(--bd-accent-text);
  font-weight: 600;
}
.bd-nav__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25em;
  height: 1.25em;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: var(--primary);
  color: var(--primary-foreground);
}
.bd-nav__item.is-active .bd-nav__count {
  background: var(--bd-text);
  color: var(--bd-card);
}

.bd-user { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.bd-user__name { font-size: 13px; color: var(--bd-muted); }
.bd-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  background: var(--bd-accent-tint);
  color: var(--bd-accent-text);
  border: 1px solid var(--bd-border);
  padding: 0;
}
.bd-avatar:hover, .bd-avatar[aria-expanded="true"] { border-color: var(--bd-accent); }
.bd-usermenu {
  background: var(--bd-card);
  border: 1px solid var(--bd-border);
  border-radius: 8px;
  min-width: 180px;
  padding: 6px;
}
.bd-usermenu__meta {
  font-size: 12px;
  color: var(--bd-muted-2);
  padding: 6px 10px 8px;
  border-bottom: 1px solid var(--bd-border-soft);
  margin-bottom: 6px;
  word-break: break-word;
}
.bd-usermenu__item {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 13.5px;
  padding: 7px 10px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--bd-text);
  text-decoration: none;
}
.bd-usermenu__item:hover { background: var(--bd-hover); color: var(--bd-text); }

/* --- page header + step rail --------------------------------------------- */
.bd-page { padding: 26px 28px 0; }
.bd-page--pad { padding-bottom: 28px; }
.bd-pagehead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.bd-pagehead__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
  color: var(--bd-text);
}
.bd-pagehead__desc {
  max-width: 560px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--bd-muted);
  margin: 0;
  text-wrap: pretty;
}

.bd-steps { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.bd-steps__item { display: flex; align-items: center; gap: 6px; }
.bd-steps__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bd-muted-2);
  flex: 0 0 auto;
}
.bd-steps__label {
  font-family: var(--bd-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bd-muted-2);
}
.bd-steps__item.is-done .bd-steps__dot { background: var(--bd-text); }
.bd-steps__item.is-done .bd-steps__label { color: var(--bd-text); }
.bd-steps__item.is-current .bd-steps__dot { background: var(--bd-accent-strong); }
.bd-steps__item.is-current .bd-steps__label { color: var(--bd-accent-text); }
.bd-steps__line {
  width: 26px;
  height: 1px;
  background: var(--bd-border);
  flex: 0 0 auto;
}

/* --- layout -------------------------------------------------------------- */
/* Spacing between page blocks is a flex/grid gap, set once here. Override
   --bd-gap on a container to change it for that page.
     .bd-stack        blocks one under another (cards, tables, forms), 20px apart
     .bd-stack--sm    the same, 12px apart (blocks inside a card)
     .bd-stack--lg    the same, 28px apart (page sections)
     .bd-row2         two columns side by side, one column under 1200px
     .bd-split        fixed 440px column + the rest (form beside a list)
     .bd-col          a column inside .bd-split / .bd-row2
   Cards left directly one after another without a stack still get the gap
   (the ~ rule below), so older pages don't run together. */
.bd-stack { display: flex; flex-direction: column; gap: var(--bd-gap, 20px); min-width: 0; }
.bd-stack--sm { --bd-gap: 12px; }
.bd-stack--lg { --bd-gap: 28px; }
.bd-card ~ .bd-card { margin-top: var(--bd-gap, 20px); }
:is(.bd-stack, .bd-col, .bd-row2, .bd-split, .bd-grid) > .bd-card ~ .bd-card { margin-top: 0; }

.bd-split {
  display: grid;
  grid-template-columns: 440px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}
.bd-col { display: flex; flex-direction: column; gap: var(--bd-gap, 20px); min-width: 0; }
.bd-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1200px) {
  .bd-split { grid-template-columns: minmax(0, 1fr); }
  .bd-row2 { grid-template-columns: minmax(0, 1fr); }
}

/* --- card ---------------------------------------------------------------- */
.bd-card {
  background: var(--bd-card);
  border: 1px solid var(--bd-border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--bd-card-shadow);
  min-width: 0;
}
.bd-card__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}
.bd-card__num {
  font-family: var(--bd-mono);
  font-size: 11px;
  color: var(--bd-muted-2);
  letter-spacing: 0.06em;
}
.bd-card__title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--bd-text);
}
.bd-card__body { display: flex; flex-direction: column; gap: 16px; }

/* --- field --------------------------------------------------------------- */
.bd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.bd-grid--1 { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) { .bd-grid { grid-template-columns: minmax(0, 1fr); } }

.bd-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.bd-field__label {
  display: flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--bd-text);
}
/* The dot is the whole required/optional signal — no asterisks, and no
   parenthetical optional marker tacked onto a label. */
.bd-req {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--bd-accent-strong);
  margin-left: 6px;
  flex: 0 0 auto;
}
.bd-help {
  font-size: 12px;
  line-height: 1.45;
  color: var(--bd-muted-2);
  text-wrap: pretty;
}
.bd-help input[type="checkbox"] {
  margin-right: 6px;
  vertical-align: -2px;
}
.bd-help code, .bd-help .bd-mono {
  font-family: var(--bd-mono);
  font-size: 11.5px;
  color: var(--bd-muted);
  font-weight: 400;
}
.bd-help--danger { color: var(--bd-danger-text); }
.bd-field.is-invalid .bd-help { color: var(--bd-danger-text); }
.bd-field.is-invalid .bd-input,
.bd-field.is-invalid .bd-select,
.bd-field.is-invalid .bd-amount { border-color: var(--bd-danger); }

/* --- controls ------------------------------------------------------------ */
.bd-input, .bd-select, .bd-textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--bd-border);
  border-radius: 8px;
  background: var(--bd-inset);
  color: var(--bd-text);
  font-family: var(--bd-sans);
  font-size: 13.5px;
  outline: none;
}
.bd-input.bd-mono, .bd-select.bd-mono { font-family: var(--bd-mono); }
.bd-textarea {
  height: 64px;
  padding: 10px 12px;
  line-height: 1.45;
  resize: vertical;
}
.bd-input--sm { height: 38px; }
.bd-input::placeholder, .bd-textarea::placeholder { color: var(--bd-muted-2); }

.bd-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 18px, calc(100% - 12px) 18px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.bd-select:disabled, .bd-input:disabled, .bd-textarea:disabled,
.bd-input[readonly] {
  opacity: .6;
  cursor: not-allowed;
}
.bd-input[readonly]:focus, .bd-input:disabled:focus {
  border-color: inherit;
  box-shadow: none;
}

.bd-input:focus, .bd-select:focus, .bd-textarea:focus,
.bd-amount:focus-within {
  border-color: var(--bd-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bd-accent) 12%, transparent);
}
/* The 12% glow is deliberately quiet for mouse users; a keyboard user needs
   something that survives a glance, so focus-visible adds a real ring. */
.bd-input:focus-visible, .bd-select:focus-visible, .bd-textarea:focus-visible,
.bd-optbtn:focus-visible, .bd-btn:focus-visible, .bd-seg__label:focus-within,
.bd-nav__item:focus-visible, .bd-avatar:focus-visible,
.bd-optional__head:focus-visible {
  outline: 2px solid var(--bd-accent);
  outline-offset: 2px;
}

/* amount: mono value left, currency in an attached right segment */
.bd-amount {
  display: flex;
  align-items: stretch;
  height: 40px;
  border: 1px solid var(--bd-border);
  border-radius: 8px;
  background: var(--bd-inset);
  overflow: hidden;
}
.bd-amount > .bd-input {
  border: 0;
  height: auto;
  border-radius: 0;
  background: transparent;
  font-family: var(--bd-mono);
  font-size: 15px;
  min-width: 0;
}
.bd-amount > .bd-input:focus { box-shadow: none; }
.bd-amount__ccy {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-left: 1px solid var(--bd-border);
  background: var(--bd-hover);
  font-family: var(--bd-mono);
  font-size: 13px;
  color: var(--bd-muted);
  white-space: nowrap;
}

/* date: mono digits, plus a today tag when the value is today */
.bd-date { position: relative; display: flex; align-items: center; }
.bd-date > .bd-input { font-family: var(--bd-mono); font-size: 13px; padding-right: 52px; }
input[data-datepicker] { font-family: var(--bd-mono); }
.bd-date__today {
  position: absolute;
  right: 10px;
  font-size: 12px;
  color: var(--bd-muted-2);
  pointer-events: none;
}

/* Air Datepicker 3.5.3 — map library tokens onto the live appearance scheme
   so Straits / Grey / Black / Terracotta / Verdant all look native. */
.air-datepicker,
.air-datepicker.bd-datepicker-pop {
  --adp-font-family: inherit;
  --adp-font-size: 13px;
  --adp-background-color: var(--popover);
  --adp-background-color-hover: var(--bd-hover);
  --adp-background-color-active: var(--bd-accent-tint);
  --adp-color: var(--popover-foreground);
  --adp-color-secondary: var(--bd-muted);
  --adp-accent-color: var(--bd-accent);
  --adp-color-current-date: var(--bd-accent-text);
  --adp-color-other-month: color-mix(in srgb, var(--bd-muted) 55%, var(--popover));
  --adp-color-other-month-hover: var(--bd-muted);
  --adp-color-disabled: var(--bd-muted-2);
  --adp-border-color: var(--bd-border);
  --adp-border-color-inner: var(--bd-border-soft);
  --adp-border-radius: 10px;
  --adp-nav-arrow-color: var(--bd-muted);
  --adp-nav-color-secondary: var(--bd-muted);
  --adp-day-name-color: var(--bd-muted);
  --adp-day-name-color-hover: var(--bd-text);
  --adp-cell-background-color-hover: var(--bd-hover);
  --adp-cell-background-color-selected: var(--bd-btn-fill);
  --adp-cell-background-color-selected-hover: var(--bd-btn-fill-hover);
  --adp-cell-border-radius: 8px;
  --adp-btn-color: var(--bd-accent-text);
  --adp-btn-color-hover: var(--bd-text);
  --adp-btn-background-color-hover: var(--bd-hover);
  --adp-btn-background-color-active: var(--bd-accent-tint);
  --adp-z-index: 1080;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--bd-text) 14%, transparent);
}
.air-datepicker-cell.-selected-,
.air-datepicker-cell.-selected-.-current-,
.air-datepicker-cell.-selected-.-focus- {
  color: var(--bd-btn-fg);
  background: var(--bd-btn-fill);
}
.air-datepicker-nav--title:hover,
.air-datepicker-nav--action:hover {
  background: var(--bd-hover);
}
.air-datepicker-buttons {
  border-top: 1px solid var(--bd-border-soft);
}
.air-datepicker-button {
  color: var(--bd-accent-text);
}
.air-datepicker--pointer {
  background: var(--popover);
  border: 1px solid var(--bd-border);
}

/* Sat/Sun stay clickable when in range. Air Datepicker 3.5.3 puts
   -weekend- on Sa/Su headers (weekday index); vendor CSS does not
   paint that class. Week starts Monday (firstDay: 1), so Sat is the
   6th column and Sun the 7th — same taupe chip as the headers, also
   on disabled and other-month cells in those columns (trade date
   max=today greys out future Sat/Sun). Not an SG holiday calendar,
   not blocked. Selected / today keep their own rules. */
.air-datepicker-body--cells.-days- .air-datepicker-cell.-day-:nth-child(7n+6):not(.-selected-):not(.-current-),
.air-datepicker-body--cells.-days- .air-datepicker-cell.-day-:nth-child(7n):not(.-selected-):not(.-current-) {
  color: var(--bd-muted);
  background: color-mix(in srgb, var(--bd-muted) 22%, var(--popover));
  border-radius: 6px;
}
.air-datepicker-body--cells.-days- .air-datepicker-cell.-day-.-focus-:nth-child(7n+6):not(.-selected-):not(.-current-),
.air-datepicker-body--cells.-days- .air-datepicker-cell.-day-.-focus-:nth-child(7n):not(.-selected-):not(.-current-) {
  background: color-mix(in srgb, var(--bd-muted) 32%, var(--popover));
}
.air-datepicker .air-datepicker-body--day-name.-weekend- {
  color: var(--bd-muted-2);
  background: color-mix(in srgb, var(--bd-muted) 22%, var(--popover));
  border-radius: 6px;
}

/* reference: auto-filled badge while the generated default still stands */
.bd-withbadge { position: relative; display: flex; align-items: center; }
.bd-withbadge > .bd-input { padding-right: 96px; }
.bd-badge {
  position: absolute;
  right: 8px;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--bd-accent-tint);
  color: var(--bd-accent-text);
  pointer-events: none;
  white-space: nowrap;
}

/* segmented control (direction, side) */
.bd-seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--bd-border);
  border-radius: 8px;
  background: var(--bd-inset);
}
.bd-seg__label {
  position: relative;
  display: block;
  text-align: center;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--bd-muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bd-seg__label input { position: absolute; opacity: 0; pointer-events: none; }
.bd-seg__label:hover { color: var(--bd-text); }
.bd-seg__label.is-on {
  background: var(--bd-btn-fill);
  color: var(--bd-btn-fg);
  font-weight: 600;
}
@media (max-width: 760px) {
  .bd-seg { grid-auto-flow: row; grid-auto-columns: auto; }
}

/* --- client picker ------------------------------------------------------- */
.bd-picker { display: flex; flex-direction: column; gap: 7px; }
.bd-search { position: relative; display: flex; align-items: center; }
.bd-search__glyph {
  position: absolute;
  left: 12px;
  color: var(--bd-muted-2);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.bd-search > .bd-input { padding-left: 34px; }
.bd-list {
  border: 1px solid var(--bd-border);
  border-radius: 8px;
  background: var(--bd-inset);
  overflow: hidden;
}
.bd-list__scroll { max-height: 260px; overflow-y: auto; }
.bd-picker--compact .bd-list__scroll { max-height: 200px; }
.bd-optbtn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid var(--bd-border-soft);
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--bd-text);
  text-align: left;
  cursor: pointer;
}
.bd-optbtn:first-child { border-top: 0; }
.bd-optbtn:hover, .bd-optbtn.is-cursor { background: var(--bd-hover); }
.bd-optbtn__name { font-size: 13.5px; min-width: 0; overflow-wrap: anywhere; }
.bd-optbtn__id {
  font-family: var(--bd-mono);
  font-size: 12px;
  color: var(--bd-muted-2);
  flex: 0 0 auto;
}
.bd-optbtn[aria-selected="true"] {
  background: var(--bd-accent-tint-soft);
  border-left-color: var(--bd-accent);
}
.bd-optbtn[aria-selected="true"] .bd-optbtn__name { font-weight: 500; }
.bd-optbtn[aria-selected="true"] .bd-optbtn__id { color: var(--bd-accent-text); }
.bd-list__foot {
  padding: 8px 12px;
  border-top: 1px solid var(--bd-border-soft);
  font-size: 12px;
  color: var(--bd-muted-2);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.bd-list__reload {
  color: var(--bd-accent-text);
  text-decoration: none;
  white-space: nowrap;
  font-size: 12px;
}
.bd-list__reload:hover { text-decoration: underline; }

/* --- optional group ------------------------------------------------------ */
.bd-optional {
  border-top: 1px solid var(--bd-border-soft);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bd-optional__head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--bd-muted);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.bd-chip {
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid var(--bd-border);
  border-radius: 4px;
  color: var(--bd-muted-2);
  white-space: nowrap;
}
.bd-optional__caret { margin-left: auto; color: var(--bd-muted-2); font-size: 11px; }
.bd-optional__body { display: flex; flex-direction: column; gap: 16px; }

/* --- sticky action bar --------------------------------------------------- */
.bd-actionbar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  /* Negates the 28px page gutter so the bar spans the form region edge to
     edge, and keeps its own 28px padding inside that. */
  margin: 20px -28px 0;
  padding: 14px 28px;
  background: var(--bd-card);
  border-top: 1px solid var(--bd-border);
}
.bd-actionbar__summary {
  font-size: 13px;
  color: var(--bd-muted);
  min-width: 0;
  text-wrap: pretty;
}
.bd-actionbar__summary strong {
  font-family: var(--bd-mono);
  font-weight: 400;
  color: var(--bd-text);
}
.bd-actionbar__buttons { display: flex; align-items: center; gap: 10px; }

.bd-btn {
  font-family: var(--bd-sans);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.bd-btn--ghost {
  padding: 9px 16px;
  border-color: var(--bd-border);
  background: transparent;
  color: var(--bd-text);
}
.bd-btn--ghost:hover { background: var(--bd-hover); color: var(--bd-text); }
.bd-btn--primary {
  padding: 9px 20px;
  background: var(--bd-btn-fill);
  color: var(--bd-btn-fg);
}
.bd-btn--primary:hover:not(:disabled) {
  background: var(--bd-btn-fill-hover);
  color: var(--bd-btn-fg);
}
.bd-btn:disabled, .bd-btn.is-disabled { opacity: .6; cursor: not-allowed; }

/* --- tables (queue / activity) ------------------------------------------- */
.bd-tablewrap {
  background: var(--bd-card);
  border: 1px solid var(--bd-border);
  border-radius: 12px;
  overflow: auto;
  max-height: calc(100vh - 260px);
  box-shadow: var(--bd-card-shadow);
}
.bd-table { width: 100%; border-collapse: collapse; }
.bd-table thead th {
  height: 40px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bd-card);
  border-bottom: 1px solid var(--bd-border);
  font-family: var(--bd-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bd-muted-2);
  text-align: left;
  padding: 0 14px;
  white-space: nowrap;
}
.bd-table tbody td {
  height: 44px;
  padding: 0 14px;
  border-top: 1px solid var(--bd-border-soft);
  font-size: 13.5px;
  color: var(--bd-text);
  vertical-align: middle;
}
.bd-table tbody tr:hover td { background: var(--bd-hover); }
.bd-table .bd-num {
  text-align: right;
  font-family: var(--bd-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bd-table th.bd-num { text-align: right; }
/* Totals row: the same size and spacing as a body row, set apart by weight and a rule. */
.bd-table tfoot th, .bd-table tfoot td {
  height: 44px;
  padding: 0 14px;
  border-top: 1px solid var(--bd-border);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--bd-text);
  vertical-align: middle;
}
.bd-table tfoot .bd-num { font-family: var(--bd-mono); text-align: right; }
.bd-table .bd-when {
  font-family: var(--bd-mono);
  font-size: 13px;
  white-space: nowrap;
}
.bd-table th.bd-sortable { cursor: pointer; user-select: none; }
.bd-table th.bd-sortable:hover, .bd-table th.is-sorted { color: var(--bd-accent-text); }
.bd-table tr.is-mine td:first-child { box-shadow: inset 2px 0 0 var(--bd-accent); }
.bd-table tr.is-stale td { color: var(--bd-warning-text); }
.bd-table a { color: var(--bd-text); text-decoration: underline; text-underline-offset: 2px; }
.bd-table a:hover { color: var(--bd-accent-text); }
.bd-sort-ind { font-size: 10px; margin-left: 4px; }

.bd-pill {
  display: inline-block;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
  background: var(--bd-hover);
  color: var(--bd-muted);
}
.bd-pill--success { background: var(--bd-success-tint); color: var(--bd-success-text); }
.bd-pill--warning { background: var(--bd-warning-tint); color: var(--bd-warning-text); }
.bd-pill--danger  { background: var(--bd-danger-tint);  color: var(--bd-danger-text); }
.bd-pill--accent  { background: var(--bd-accent-tint);  color: var(--bd-accent-text); }

.bd-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.bd-toolbar__tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bd-toolbar .bd-search { width: 22rem; max-width: 100%; }
.bd-empty {
  text-align: center;
  font-size: 13.5px;
  color: var(--bd-muted);
  padding: 28px 20px;
}
.bd-empty__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

/* [hidden] has to beat the display: flex/grid above, or the funding page's
   direction-specific blocks and the picker's filtered-out rows stay on screen. */
.bd-card[hidden], .bd-card__body[hidden], .bd-col[hidden], .bd-row2[hidden],
.bd-grid[hidden], .bd-field[hidden], .bd-optional[hidden],
.bd-optional__body[hidden], .bd-optbtn[hidden], .bd-picker[hidden],
.bd-seg[hidden], .bd-amount[hidden], .bd-date[hidden], .bd-withbadge[hidden],
.bd-search[hidden], .bd-toolbar[hidden], .bd-actionbar[hidden] {
  display: none;
}
/* The row that is actually first after filtering owns the flush top edge. */
.bd-optbtn.is-first { border-top: 0; }
.bd-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .bd-grid--3 { grid-template-columns: minmax(0, 1fr); } }

/* Units, price and totals line up on the decimal point, so they are mono and
   right-aligned wherever they are typed as well as wherever they are shown. */
.bd-input--num { text-align: right; }

/* The live ticket cross-check under the total. */
.bd-preview {
  background: var(--bd-hover);
  border: 1px solid var(--bd-border-soft);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--bd-mono);
  font-size: 12px;
  color: var(--bd-muted);
  font-variant-numeric: tabular-nums;
}
.bd-preview[hidden] { display: none; }
.bd-preview strong { color: var(--bd-text); font-weight: 600; }
.bd-preview .ok { color: var(--bd-success-text); font-weight: 600; }
.bd-preview .off { color: var(--bd-danger-text); font-weight: 600; }

/* Desk.sortTable paints its own class names; alias them onto the new table so
   the sorting JS keeps working untouched. */
.bd-table th.sib-sortable { cursor: pointer; user-select: none; }
.bd-table th.sib-sortable:hover,
.bd-table th.is-sorted { color: var(--bd-accent-text); }
.bd-table .sib-sort-ind { font-size: 10px; margin-left: 4px; }

/* Advice modal: iframe keeps Mambu's CSS out of the desk. */
#adviceModal .modal-content {
  background: var(--card);
  color: var(--card-foreground);
  border-color: var(--border);
}
#adviceModal .modal-header,
#adviceModal .modal-footer {
  border-color: var(--border);
}
.bd-advice-frame {
  width: 100%;
  min-height: min(70vh, 720px);
  border: 0;
  background: #fff;
}
.bd-table tbody tr.is-clickable { cursor: pointer; }
.bd-table tbody tr.is-selected td {
  background: var(--bd-accent-tint);
}
.bd-tablewrap--short { max-height: 360px; }
.bd-table td.bd-empty {
  text-align: center;
  color: var(--bd-muted);
  font-size: 13.5px;
}
.bd-fieldset {
  border-top: 1px solid var(--bd-border-soft);
  padding-top: 12px;
  margin-top: 12px;
}
.bd-fieldset:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.bd-fieldset__title {
  font-size: 13.5px;
  font-weight: 600;
  margin: 0 0 10px;
}
.bd-field__row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.bd-field__row .bd-input,
.bd-field__row .bd-select { flex: 1 1 auto; }
.bd-btn--tiny {
  padding: 6px 10px;
  font-size: 12px;
  flex: 0 0 auto;
}
.bd-muted { color: var(--bd-muted); font-size: 11.5px; }
.bd-advice-loading {
  padding: 2.5rem 1rem;
  text-align: center;
}

/* --- authorization holds ------------------------------------------------- */
.bd-help--ok { color: var(--bd-success-text); }
.bd-pair {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 10px;
  align-items: start;
}
.bd-amountbox { font-family: var(--bd-mono); font-size: 15px; }
.bd-ccybox {
  text-align: center;
  font-family: var(--bd-mono);
  font-size: 13.5px;
}
.bd-today {
  position: absolute;
  right: 34px;
  font-size: 12px;
  color: var(--bd-muted-2);
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 4px;
  cursor: pointer;
}
.bd-today:hover { color: var(--bd-accent-text); text-decoration: underline; }
.bd-today.is-on { cursor: default; text-decoration: none; color: var(--bd-muted-2); }
.bd-divided {
  border-top: 1px solid var(--bd-border-soft);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bd-btn--danger {
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  border-color: var(--bd-border);
  background: transparent;
  color: var(--bd-muted);
}
.bd-btn--danger:hover:not(:disabled) {
  border-color: var(--bd-danger);
  color: var(--bd-danger-text);
  background: var(--bd-danger-tint);
}
.bd-cardfoot {
  position: sticky;
  bottom: 0;
  margin: 4px -18px -18px;
  padding: 14px 18px;
  background: var(--bd-card);
  border-top: 1px solid var(--bd-border);
  border-radius: 0 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bd-cardfoot__summary {
  font-size: 13px;
  color: var(--bd-muted);
  margin: 0;
  text-wrap: pretty;
}
.bd-cardfoot__summary strong {
  font-family: var(--bd-mono);
  font-weight: 400;
  color: var(--bd-text);
}
.bd-cardfoot__buttons { display: flex; align-items: center; gap: 10px; }
.bd-cardfoot__buttons .bd-btn--primary { flex: 1 1 auto; justify-content: center; }
.bd-search--holds { width: 260px; max-width: 100%; }
.bd-select--tool { width: auto; min-width: 8.5rem; }
.bd-card--flush { padding: 0; }
.bd-card--flush .bd-card__head {
  padding: 18px 18px 0;
  margin-bottom: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.bd-card__count {
  font-family: var(--bd-mono);
  font-size: 12px;
  color: var(--bd-muted-2);
  margin-left: auto;
}
.bd-card__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.bd-grid-table {
  --bd-holds-cols:
    minmax(0, 1.1fr) 72px minmax(0, 1.6fr) 120px 52px 104px
    minmax(0, 1.2fr) 96px 88px;
  display: block;
  width: 100%;
  border-collapse: collapse;
}
.bd-grid-table thead, .bd-grid-table tbody { display: block; }
.bd-grid-table tr {
  display: grid;
  grid-template-columns: var(--bd-holds-cols);
  align-items: center;
}
.bd-grid-table thead tr {
  height: 40px;
  background: var(--bd-hover);
  border-top: 1px solid var(--bd-border);
  border-bottom: 1px solid var(--bd-border);
  position: sticky;
  top: 0;
  z-index: 2;
}
.bd-grid-table th {
  font-family: var(--bd-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bd-muted-2);
  text-align: left;
  padding: 0 12px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bd-grid-table tbody tr {
  height: 44px;
  border-bottom: 1px solid var(--bd-border-soft);
  white-space: nowrap;
}
.bd-grid-table tbody tr:hover { background: var(--bd-hover); }
.bd-grid-table td {
  font-size: 13.5px;
  color: var(--bd-text);
  padding: 0 12px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.bd-grid-table th:first-child, .bd-grid-table td:first-child { padding-left: 18px; }
.bd-grid-table th:last-child, .bd-grid-table td:last-child { padding-right: 18px; }
.bd-grid-table .bd-num {
  text-align: right;
  font-family: var(--bd-mono);
  font-variant-numeric: tabular-nums;
}
.bd-grid-table .bd-cell-action {
  display: flex;
  justify-content: flex-end;
  overflow: visible;
}
.bd-grid-table .bd-cell-when { font-size: 12.5px; }
.bd-grid-table tr.bd-emptyrow { display: block; height: auto; border-bottom: 0; }
.bd-grid-table tr.bd-emptyrow td {
  display: block;
  width: 100%;
  white-space: normal;
  text-align: center;
  font-size: 13.5px;
  color: var(--bd-muted);
  padding: 28px 20px;
}
.bd-rowlink {
  font-family: var(--bd-mono);
  color: var(--link);
  text-decoration: none;
}
.bd-rowlink:hover { color: var(--link-hover); text-decoration: underline; }
.bd-scroll { max-height: calc(100vh - 320px); overflow: auto; }
.bd-cardfoot--table {
  padding: 8px 18px 14px;
  border-top: 1px solid var(--bd-border-soft);
  font-size: 12.5px;
  color: var(--bd-muted-2);
}
.bd-table .bd-when {
  font-family: var(--bd-mono);
  font-size: 13px;
  white-space: nowrap;
}
.bd-table td.bd-detail {
  font-size: 12.5px;
  color: var(--bd-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
  width: 100%;
}
.bd-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 16px;
}
.bd-pager__group { display: flex; align-items: center; gap: 8px; }
.bd-pager__at { font-size: 12.5px; color: var(--bd-muted-2); }
.bd-empty {
  text-align: center;
  font-size: 13.5px;
  color: var(--bd-muted);
  padding: 28px 20px;
}

/* ── the assistant panel ───────────────────────────────────────────────────
   Tokens only, no literal colours: the six schemes re-point the same names, so
   a rule written against --card and --border reads correctly in Grey, Black and
   Rolex without a second block.

   z-index sits BELOW the datepicker's --adp-z-index (1080). A date popover on
   an entry form must never be covered by the bubble. */

.bd-assist__bubble {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1070;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--sidebar);
  color: var(--sidebar-foreground);
  box-shadow: 0 6px 20px rgb(0 0 0 / 18%);
  cursor: pointer;
}

.bd-assist__bubble:hover { background: var(--primary); color: var(--primary-foreground); }
.bd-assist__bubble:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.bd-assist {
  position: fixed;
  right: 20px;
  bottom: 78px;
  z-index: 1070;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 40px));
  max-height: min(620px, calc(100vh - 130px));
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgb(0 0 0 / 22%);
  overflow: hidden;
}

.bd-assist__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}

.bd-assist__title { font-weight: 600; font-size: 13.5px; }

.bd-assist__env {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.bd-assist__env--prod { background: var(--primary); color: var(--primary-foreground); }

.bd-assist__close {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--muted-foreground);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.bd-assist__close:hover { color: var(--foreground); }

.bd-assist__log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13px;
  line-height: 1.45;
}

.bd-assist__hint,
.bd-assist__note,
.bd-assist__tools {
  color: var(--muted-foreground);
  font-size: 12px;
  margin: 0;
}

.bd-assist__msg { max-width: 100%; }
.bd-assist__msg p { margin: 0; }

.bd-assist__msg--me {
  align-self: flex-end;
  background: var(--secondary);
  color: var(--secondary-foreground);
  border-radius: 10px 10px 2px 10px;
  padding: 7px 10px;
  max-width: 88%;
}

.bd-assist__msg--bot {
  background: var(--muted);
  border-radius: 10px 10px 10px 2px;
  padding: 7px 10px;
  max-width: 92%;
}

.bd-assist__msg--err {
  background: var(--muted);
  border-left: 3px solid var(--bd-danger);
  border-radius: 4px;
  padding: 7px 10px;
}

.bd-assist__thinking { color: var(--muted-foreground); }
.bd-assist__tools { margin-top: 6px; font-style: italic; }

/* The ticket. Deliberately looks like a document rather than a chat bubble —
   it is the thing the operator is being asked to check. */
.bd-assist__ticket {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  padding: 10px;
}

.bd-assist__ticket-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .04em;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.bd-assist__ticket-head .bd-assist__env { margin-left: auto; }

.bd-assist__why { margin: 0 0 8px; font-size: 12.5px; }

.bd-assist__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  font-size: 12.5px;
  border-bottom: 1px dotted var(--border);
}

.bd-assist__row:last-of-type { border-bottom: 0; }
.bd-assist__row span { color: var(--muted-foreground); flex: 0 0 auto; }
.bd-assist__row b { font-weight: 600; text-align: right; word-break: break-word; }
.bd-assist__row--bad b { color: var(--bd-danger-text); }

.bd-assist__warn {
  margin: 8px 0 0;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 4px;
  background: var(--muted);
  border-left: 3px solid var(--primary);
}

.bd-assist__note { margin: 8px 0; }

.bd-assist__confirm {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 600;
  background: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
}

.bd-assist__confirm:hover { filter: brightness(1.05); }
.bd-assist__confirm:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.bd-assist__ask {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
  background: var(--muted);
}

.bd-assist__input {
  flex: 1 1 auto;
  resize: none;
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--input);
  border-radius: 6px;
  background: var(--card);
  color: var(--card-foreground);
}

.bd-assist__input:focus { outline: 2px solid var(--ring); outline-offset: -1px; }

.bd-assist__send {
  flex: 0 0 auto;
  align-self: flex-end;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  background: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
}

.bd-assist__send:disabled { opacity: .55; cursor: default; }

@media (max-width: 560px) {
  .bd-assist {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 70px;
  }
}

/* The entry screens carry a sticky action bar across the foot of the page.
   A chat bubble parked on top of "Continue to review" is the worst place it
   could be, so lift both bubble and panel clear of it wherever one exists. */
body:has(.bd-actionbar) .bd-assist__bubble { bottom: 92px; }

body:has(.bd-actionbar) .bd-assist {
  bottom: 150px;
  max-height: min(620px, calc(100vh - 200px));
}

@media (max-width: 560px) {
  body:has(.bd-actionbar) .bd-assist { bottom: 142px; }
}

/* The one line in the panel that is not the operator's to restyle or reword:
   what this thing cannot do. Muted, but always there. */
.bd-assist__hint--fixed {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dotted var(--border);
  font-style: italic;
}

/* The one instruction the operator has to carry off the result page. It sat in
   a bullet list at the foot, which is where reading stops once "created" has
   been seen — a client with no passport on file is not a finished KYC file. */
.bd-todo {
  border-left: 4px solid currentColor;
  padding: 1rem 1.15rem;
}
.bd-todo__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 .35rem;
}

/* A form that is working. The spinner is the only moving thing on the page, so
   it has to be legible without being a distraction — an operator watching a
   sixty-second read needs to know it is alive, not be entertained. */
.bd-busy {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .6rem;
  font-weight: 600;
}
.bd-busy::before {
  content: "";
  width: .85em;
  height: .85em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: bd-spin .7s linear infinite;
  flex: none;
}
@keyframes bd-spin { to { transform: rotate(360deg); } }

/* Respect a reader who has asked the OS for no motion. The message still
   appears and still counts up; only the spin stops. */
@media (prefers-reduced-motion: reduce) {
  .bd-busy::before { animation: none; }
}

form.is-busy { opacity: .75; }
form.is-busy [type="submit"] { cursor: progress; }

/* Copy-to-clipboard on the amendment diff. The value is keyed into Mambu by
   hand — this screen does not write — so the button sits with the value rather
   than in a column of its own, and stays quiet until hovered. */
.bd-copyrow {
  display: inline-flex;
  align-items: baseline;
  gap: .5rem;
}
.bd-copyrow__value { overflow-wrap: anywhere; }

.bd-copy {
  flex: none;
  border: 1px solid currentColor;
  border-radius: .25rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .78em;
  line-height: 1.4;
  padding: 0 .45em;
  cursor: pointer;
  opacity: .45;
  transition: opacity .12s ease;
}
.bd-copyrow:hover .bd-copy,
.bd-copy:focus-visible { opacity: 1; }
.bd-copy.is-copied { opacity: 1; font-weight: 700; }
.bd-copy.is-copyfailed { opacity: 1; font-weight: 700; }

/* The one action on the amendment confirm step. It sat directly under the
   client field looking like a chip; a primary button needs room to read as the
   thing you are meant to press. */
.bd-amend__go {
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--bd-rule, rgba(0,0,0,.12));
}

/* Indeterminate progress. It travels rather than filling: the browser cannot
   know how far through a server-side read it is, and a bar showing a fraction
   would be inventing one. What it says is "alive". */
.bd-progress {
  /* The field wrapper this is inserted into is a COLUMN flex container, so
     flex-basis lands on the height axis: `flex: 0 0 100%` resolved the height
     against a container with none and collapsed the bar to nothing. `flex:
     none` leaves the explicit height alone. */
  flex: none;
  align-self: stretch;
  width: 100%;
  height: 3px;
  margin-top: .7rem;
  border-radius: 2px;
  background: currentColor;
  opacity: .18;
  overflow: hidden;
}
.bd-progress__run {
  display: block;
  width: 32%;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  opacity: 1;
  animation: bd-run 1.4s ease-in-out infinite;
}
@keyframes bd-run {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(420%); }
}
@media (prefers-reduced-motion: reduce) {
  /* Still visible, still says "working", just does not travel. */
  .bd-progress__run { animation: none; width: 100%; opacity: .5; }
}

.bd-filenote { margin-top: .4rem; font-weight: 600; }
.bd-filenote.is-toobig { color: var(--bd-danger, #b3261e); }

/* A field the reader could not fill. Marked, not shouted: it is a place to
   look, not an error — the value may genuinely be blank on the paper. The mark
   clears the moment the operator types, because a highlight that survives being
   answered teaches people to ignore highlights. */
.bd-input[data-blank], .bd-select[data-blank] {
  /* --bd-warn was never defined. Every theme fell through to a hardcoded amber
     and an 8%-opacity 3px stripe, which is why this was nearly invisible on a
     45-field screen. --bd-warning-text and --bd-warning-tint are real, and
     carry the right colour in all six themes including the dark ones. */
  border-color: var(--bd-warning-text);
  border-left: 4px solid var(--bd-warning-text);
  background-color: var(--bd-warning-tint);
  box-shadow: 0 0 0 1px var(--bd-warning-text) inset;
}

/* Answering one should feel like answering it: the bar stays so the row is
   still findable while they type, the fill and the ring go. */
.bd-input[data-blank]:focus, .bd-select[data-blank]:focus {
  background-color: var(--card, transparent);
  box-shadow: none;
}

/* The label too, so the gap is visible while scrolling past at speed rather
   than only once the field itself is on screen. */
.bd-field:has([data-blank]) > label,
.bd-field:has([data-blank]) .bd-field__label {
  color: var(--bd-warning-text);
  font-weight: 700;
}
.bd-field:has([data-blank]) > label::after,
.bd-field:has([data-blank]) .bd-field__label::after {
  content: " — empty";
  font-weight: 600;
  opacity: .85;
}
.bd-blanks { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.bd-blanks__next { margin-left: auto; }
.bd-group__drop { margin-top: .5rem; opacity: .7; font-size: .85em; }
.bd-group__drop:hover { opacity: 1; }

/* Names are stored in capitals — 432 of 432 live clients — so they are typed in
   capitals too. Display only: _name() uppercases server-side whatever arrives,
   and a field that looks different from what it saves is its own small lie. */
.bd-input--caps { text-transform: uppercase; }

/* --- combo box: a searchable <select data-combo> (static/combo.js) -------- */
.bd-combo { position: relative; min-width: 0; }
.bd-combo__input { width: 100%; padding-right: 36px; text-overflow: ellipsis; }
.bd-combo__toggle {
  position: absolute; top: 0; right: 0; bottom: 0; width: 34px;
  border: 0; background: transparent; color: var(--bd-text); cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 12px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.bd-combo.is-open .bd-combo__toggle { transform: rotate(180deg); }
.bd-combo__list {
  position: absolute; z-index: 1050; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 320px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none;
  background: var(--bd-card); border: 1px solid var(--bd-border); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
}
.bd-combo__item, .bd-combo__empty { padding: 7px 10px; border-radius: 6px; font-size: 13.5px; line-height: 1.35; }
.bd-combo__item { cursor: pointer; color: var(--bd-text); }
.bd-combo__item:hover, .bd-combo__item.is-active { background: var(--bd-hover); }
.bd-combo__item.is-selected { color: var(--bd-accent-text); font-weight: 600; }
.bd-combo__empty { color: var(--bd-muted); }
