/* ═══════════════════════════════════════════════════════════════
   BatFast OMS — Component layer (2026 rebrand)
   Sits on Bootstrap 5.3 + tokens.css. Loaded AFTER Bootstrap.
   Sections:
     1. Base + type            9. Tables (+ DataTables)
     2. Navbar                10. Pipeline stepper
     3. Loader                11. Tabs
     4. Page scaffold         12. Kanban
     5. Cards + stats         13. Checklists / progress
     6. Buttons               14. Toasts / modals
     7. Badges (status etc.)  15. Empty / gating / skeleton
     8. Toolbar + inputs      16. Bootstrap re-theme + legacy compat
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Base + type ────────────────────────────────────────── */
* { outline-color: var(--bf-orange); }
html { scroll-behavior: auto; scrollbar-gutter: stable; }
body {
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  color: var(--bf-graphite);
  background: var(--bf-bg);
  margin: 0;
  line-height: 1.55;
  transition: background .35s var(--ease-standard), color .35s var(--ease-standard);
}

.bf-display {
  font-family: var(--ff-display);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: .02em;
  font-weight: 500;
  line-height: 1.05;
}
.bf-kicker {
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--bf-muted);
}
.bf-page-title { font-size: var(--fs-title); color: var(--bf-blue); margin: 0; position: relative; padding-bottom: 6px; }
body.workshop .bf-page-title { color: #fff; }
.bf-page-title::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 56px; height: 4px; background: var(--bf-orange);
  transform-origin: left; animation: bfUnderline .55s var(--ease-standard) both .15s;
}
@keyframes bfUnderline { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bf-mono { font-variant-numeric: tabular-nums; }

h1, h2, h3, h4, h5, h6 { font-family: var(--ff-body); font-weight: 700; color: var(--bf-blue); }
body.workshop h1, body.workshop h2, body.workshop h3,
body.workshop h4, body.workshop h5, body.workshop h6 { color: #E8F1F7; }

/* ── 2. Navbar ─────────────────────────────────────────────── */
.bf-nav {
  display: flex; align-items: stretch; gap: 12px;
  background: var(--bf-blue);
  height: 56px; padding: 0 18px 0 14px;
  position: sticky; top: 0; z-index: 1030;
  box-shadow: 0 2px 10px rgba(10,42,60,.25);
}
body.workshop .bf-nav { background: #071A26; }
.bf-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding-right: 6px; }
.bf-brand img { height: 26px; }
.bf-brand-div { width: 1px; height: 24px; background: rgba(255,255,255,.28); }
.bf-brand-oms {
  font-family: var(--ff-display); font-style: italic; text-transform: uppercase;
  font-size: 1.18rem; color: #fff; letter-spacing: .04em; padding-right: 4px;
}
/* No overflow on the desktop link rail: overflow-x:auto forces overflow-y:auto
   too, which clips the dropdown menus that hang below the 56px bar. */
.bf-nav-links { display: flex; align-items: stretch; flex: 1; gap: 2px; min-width: 0; scrollbar-width: none; }
.bf-nav-links::-webkit-scrollbar { display: none; }
.bf-nav-burger { display: none; }
.bf-nav-link {
  display: flex; align-items: center; padding: 0 13px;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.78); text-decoration: none; white-space: nowrap;
  background: none; border: 0; cursor: pointer;
  border-bottom: 3px solid transparent; border-top: 3px solid transparent;
  transition: color .15s, border-color .2s;
}
.bf-nav-link:hover { color: #fff; }
.bf-nav-link.active { color: #fff; border-bottom-color: var(--bf-orange); }
.bf-nav-item.dropdown { display: flex; }
.bf-nav-link.dropdown-toggle::after { margin-left: 7px; opacity: .6; }
.bf-nav-right { display: flex; align-items: center; gap: 8px; }

.bf-icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: var(--r-sm);
  border: 0; background: rgba(255,255,255,.08); color: rgba(255,255,255,.85);
  font-size: .95rem; cursor: pointer; transition: background .15s, color .15s;
  display: inline-grid; place-items: center;
}
.bf-icon-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.bf-icon-btn.on { background: var(--bf-orange); color: #fff; }
.bf-notif-dot {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px;
  background: var(--bf-orange); color: #fff; border-radius: var(--r-pill);
  font-size: .62rem; font-weight: 700; line-height: 17px; padding: 0 4px;
  border: 2px solid var(--bf-blue);
}
.bf-user {
  display: flex; align-items: center; gap: 9px;
  background: none; border: 0; color: #fff; cursor: pointer; padding: 4px 6px;
  border-radius: var(--r-sm); text-decoration: none;
}
.bf-user:hover { background: rgba(255,255,255,.08); color: #fff; }
.bf-user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.bf-user-meta strong { font-size: .78rem; }
.bf-user-meta em { font-style: normal; font-size: .65rem; color: rgba(255,255,255,.62); text-transform: uppercase; letter-spacing: .06em; }
.bf-user .fa-chevron-down { font-size: .6rem; opacity: .6; }
.bf-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bf-orange); color: #fff;
  display: grid; place-items: center; font-size: .72rem; font-weight: 700;
  overflow: hidden; flex-shrink: 0;
}
.bf-avatar img { width: 100%; height: 100%; object-fit: cover; }

.bf-dropdown {
  border: 1px solid var(--bf-border); border-radius: var(--r-md);
  box-shadow: var(--sh-raised); padding: 6px; min-width: 200px;
  font-size: .83rem; background: var(--bf-surface); color: var(--bf-graphite);
  animation: bfDropIn .16s var(--ease-standard);
}
/* Opacity only — Bootstrap/Popper positions the menu with `transform`, so
   animating transform here clobbers it and the menu jumps from the wrong
   spot to the right one. Fade in place instead. */
@keyframes bfDropIn { from { opacity: 0; } to { opacity: 1; } }
.bf-dropdown .dropdown-item { border-radius: var(--r-xs); font-weight: 600; padding: 7px 10px; color: var(--bf-graphite); }
.bf-dropdown .dropdown-item:hover { background: var(--bf-blue-tint); color: var(--bf-blue); }
body.workshop .bf-dropdown .dropdown-item:hover { color: #fff; }
.bf-dropdown .dropdown-item.active { background: var(--bf-blue); color: #fff; }
.bf-drop-label { font-size: .62rem; font-weight: 700; letter-spacing: .09em; color: var(--bf-muted); padding: 6px 10px 3px; text-transform: uppercase; }

.bf-notif-menu { width: 330px; padding: 0; overflow: hidden; max-height: 420px; overflow-y: auto; }
.bf-notif-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: .66rem; font-weight: 700; letter-spacing: .09em; border-bottom: 1px solid var(--bf-border); color: var(--bf-muted); text-transform: uppercase; }
.bf-notif-head a { color: var(--bf-orange); text-decoration: none; letter-spacing: 0; }
.bf-notif { display: flex; gap: 10px; padding: 11px 14px; text-decoration: none; color: var(--bf-graphite); border-bottom: 1px solid var(--bf-border); cursor: pointer; }
.bf-notif:last-child { border-bottom: 0; }
.bf-notif:hover { background: var(--bf-surface-alt); }
.bf-notif div { font-size: .78rem; line-height: 1.35; }
.bf-notif div span { display: block; color: var(--bf-muted); font-size: .68rem; margin-top: 1px; }
.bf-notif-ic { font-size: 1rem; padding-top: 2px; }
.bf-notif-ic.qc-fail { color: var(--bf-danger); }
.bf-notif-ic.ok { color: var(--bf-success); }
.bf-notif-ic.warn { color: var(--bf-warning); }
.bf-notif.unread { background: var(--bf-blue-tint); }

/* ── 3. Loader ─────────────────────────────────────────────── */
.bf-loader {
  position: fixed; inset: 0; z-index: 2000;
  background: var(--bf-blue);
  display: grid; place-content: center; justify-items: center; gap: 26px;
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease-standard);
}
.bf-loader.show { opacity: 1; pointer-events: auto; }
.bf-loader-rig { position: relative; width: 150px; height: 150px; }
.bf-loader-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px dashed rgba(255,255,255,.38);
  animation: bfSpin 9s linear infinite;
}
.bf-loader-orbit { position: absolute; inset: 0; animation: bfSpin 1.15s cubic-bezier(.45,.1,.55,.9) infinite; }
.bf-loader-ball {
  position: absolute; top: -9px; left: 50%; margin-left: -9px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bf-orange);
  box-shadow: 0 0 0 0 rgba(236,101,51,.55);
  animation: bfBallPulse 1.15s infinite;
}
.bf-loader-logo { width: 86px; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.bf-loader-word {
  font-family: var(--ff-display); font-style: italic; text-transform: uppercase;
  color: #fff; font-size: 1.15rem; letter-spacing: .14em;
}
.bf-loader-word span { animation: bfDots 1.2s infinite; display: inline-block; }
.bf-loader-word span:nth-child(2) { animation-delay: .18s; }
.bf-loader-word span:nth-child(3) { animation-delay: .36s; }
@keyframes bfSpin { to { transform: rotate(360deg); } }
@keyframes bfBallPulse { 50% { box-shadow: 0 0 0 9px rgba(236,101,51,0); } }
@keyframes bfDots { 0%,60%,100% { opacity: .25; } 30% { opacity: 1; } }

/* ── 4. Page scaffold ──────────────────────────────────────── */
/* fill-mode: backwards (not both) — applies the from-state before start to
   avoid a flash, but reverts to base (transform: none) after the animation so
   .bf-main does NOT remain a containing block that would trap fixed-position
   modals beneath their backdrop. (Modals are also reparented to <body> in
   oms.js as the primary safeguard.) */
.bf-main { padding: 22px 26px 70px; max-width: 1640px; margin: 0 auto; animation: bfPageIn .4s var(--ease-standard) backwards; }
@keyframes bfPageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.bf-version { text-align: center; font-size: .66rem; letter-spacing: .06em; color: var(--bf-muted); padding: 0 0 18px; margin-top: -48px; }
.bf-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.bf-page-head .bf-kicker { margin-bottom: 4px; }

/* ── 5. Cards + stats ──────────────────────────────────────── */
.bf-card {
  background: var(--bf-surface);
  border: 1px solid var(--bf-border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-card);
}
.bf-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 18px; border-bottom: 1px solid var(--bf-border);
  font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--bf-blue);
}
body.workshop .bf-card-head { color: #cfe2ee; }
.bf-card-body { padding: 18px; }

/* Stat cards */
.bf-stat {
  display: block; text-decoration: none;
  background: var(--bf-surface); border: 1px solid var(--bf-border); border-radius: var(--r-md);
  padding: 14px 16px 12px; position: relative; overflow: hidden;
  box-shadow: var(--sh-card); color: var(--bf-graphite);
  transition: transform .18s var(--ease-standard), box-shadow .18s;
}
.bf-stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--stat-accent, var(--bf-blue)); }
.bf-stat:hover { transform: translateY(-2px); box-shadow: var(--sh-raised); color: var(--bf-graphite); }
.bf-stat .lbl { font-size: var(--fs-micro); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bf-muted); }
.bf-stat .val {
  font-family: var(--ff-display); font-style: italic;
  font-size: 2.1rem; line-height: 1.1; color: var(--bf-blue); margin-top: 2px;
}
body.workshop .bf-stat .val { color: #fff; }
.bf-stat .sub { font-size: .72rem; color: var(--bf-muted); }
.bf-stat .ic { position: absolute; right: 12px; bottom: 10px; font-size: 1.5rem; color: var(--stat-accent, var(--bf-blue)); opacity: .18; }

/* ── 6. Buttons ────────────────────────────────────────────── */
.btn { font-family: var(--ff-body); }
.bf-btn-primary, .bf-btn-blue, .bf-btn-ghost, .bf-btn-danger, .bf-btn-success {
  font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  border-radius: var(--r-sm); padding: .55rem 1.05rem; border: 1.5px solid transparent;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.bf-btn-primary { background: var(--bf-orange); color: #fff; }
.bf-btn-primary:hover, .bf-btn-primary:focus { background: var(--bf-orange-deep); color: #fff; }
.bf-btn-blue { background: var(--bf-blue); color: #fff; }
.bf-btn-blue:hover, .bf-btn-blue:focus { background: var(--bf-blue-deep); color: #fff; }
.bf-btn-ghost { background: transparent; color: var(--bf-blue); border-color: var(--bf-border-strong); }
.bf-btn-ghost:hover, .bf-btn-ghost:focus { border-color: var(--bf-blue); color: var(--bf-blue); background: var(--bf-blue-tint); }
body.workshop .bf-btn-ghost { color: #cfe2ee; }
body.workshop .bf-btn-ghost:hover { color: #fff; }
.bf-btn-danger { background: var(--bf-scarlet); color: #fff; }
.bf-btn-danger:hover, .bf-btn-danger:focus { background: var(--bf-cherry); color: #fff; }
.bf-btn-success { background: var(--bf-success); color: #fff; }
.bf-btn-success:hover, .bf-btn-success:focus { background: #0E5F46; color: #fff; }
.btn.sm { padding: .32rem .7rem; font-size: .68rem; }
.bf-pressed { animation: bfBounce .3s var(--ease-bounce); }
@keyframes bfBounce { 0% { transform: scale(1); } 40% { transform: scale(.95); } 100% { transform: scale(1); } }

/* The single pulsing CTA per page */
.bf-pulse { position: relative; }
.bf-pulse::after {
  content: ''; position: absolute; inset: -2px; border-radius: inherit;
  border: 2px solid var(--bf-orange);
  animation: bfPulse 2s var(--ease-standard) infinite;
  pointer-events: none;
}
@keyframes bfPulse {
  0% { opacity: .85; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(1.18, 1.45); }
}

/* ── 7. Badges ─────────────────────────────────────────────── */
/* Status badges — Phase Families across the real pipeline */
.bf-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .67rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--r-xs); white-space: nowrap;
  border: 1px solid transparent;
}
.bf-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.st-draft            { background: var(--st-draft-bg); color: var(--st-draft-fg); border: 1px dashed var(--st-draft-bd); }
.st-commercial_review{ background: var(--st-commercial_review-bg); color: var(--st-commercial_review-fg); }
.st-approved         { background: var(--st-approved-bg); color: var(--st-approved-fg); }
.st-ordering         { background: var(--st-ordering-bg); color: var(--st-ordering-fg); }
.st-assembly         { background: var(--st-assembly-bg); color: var(--st-assembly-fg); }
.st-qc_assembly      { background: var(--st-qc_assembly-bg); color: var(--st-qc_assembly-fg); }
.st-packed           { background: var(--st-packed-bg); color: var(--st-packed-fg); }
.st-shipped          { background: var(--st-shipped-bg); color: var(--st-shipped-fg); }
.st-on_site          { background: var(--st-on_site-bg); color: var(--st-on_site-fg); }
.st-installation     { background: var(--st-installation-bg); color: var(--st-installation-fg); }
.st-qc_installation  { background: var(--st-qc_installation-bg); color: var(--st-qc_installation-fg); }
.st-commissioned     { background: var(--st-commissioned-bg); color: var(--st-commissioned-fg); }
.st-training         { background: var(--st-training-bg); color: var(--st-training-fg); }
.st-go_live          { background: var(--st-go_live-bg); color: var(--st-go_live-fg); }
.st-go_live::before  { animation: bfLiveBlink 1.6s infinite; }
@keyframes bfLiveBlink { 50% { opacity: .25; } }
.st-qc_post_go_live  { background: var(--st-qc_post_go_live-bg); color: var(--st-qc_post_go_live-fg); }
.st-complete         { background: var(--st-complete-bg); color: var(--st-complete-fg); }
.st-cancelled        { background: var(--st-cancelled-bg); color: var(--st-cancelled-fg); text-decoration: line-through; }

/* Proposition badges — sub-brand colourways with notched corner */
.bf-prop {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 14px 3px 7px; border-radius: var(--r-xs); white-space: nowrap;
  color: #fff; clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
}
.prop-cricket_social, .prop-baseball_social, .prop-shot, .prop-social,
.prop-cricket, .prop-baseball { background: var(--prop-social); }
.prop-perform, .prop-smart_play, .prop-smartplay { background: var(--prop-blue); }
.prop-tour { background: #11815F; }

/* Module chips */
.bf-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .7rem; font-weight: 600; padding: 3px 10px;
  border-radius: var(--r-pill); background: var(--bf-blue-tint); color: var(--bf-blue);
  border: 1px solid transparent;
}
body.workshop .bf-chip { color: #cfe2ee; }
a.bf-chip { text-decoration: none; transition: border-color .15s; }
a.bf-chip:hover { border-color: var(--bf-blue-light); }

/* QC / lead-time / conflict */
.bf-qc { display: inline-flex; align-items: center; gap: 5px; font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: var(--r-xs); }
.bf-qc.pass { background: var(--bf-success-tint); color: var(--bf-success); }
.bf-qc.fail { background: var(--bf-danger-tint); color: var(--bf-danger); }
.bf-qc.na { background: var(--bf-surface-alt); color: var(--bf-muted); }
.bf-qc.pending { background: var(--bf-surface-alt); color: var(--bf-muted); border: 1px dashed var(--bf-border-strong); }
body.workshop .bf-qc.pass { background: #0E3D2E; color: #6FE3BE; }
body.workshop .bf-qc.fail { background: #4A0A1E; color: #FF9DB4; }
body.workshop .bf-qc.pending { background: transparent; color: var(--bf-muted); }
.bf-lt { font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: var(--r-xs); display: inline-block; }
.bf-lt.ok { color: var(--lt-ok); background: var(--bf-success-tint); }
.bf-lt.warn { color: var(--lt-warn); background: var(--bf-warning-tint); }
.bf-lt.crit { color: #fff; background: var(--lt-crit); }
body.workshop .bf-lt.ok { background: #0E3D2E; color: #6FE3BE; }
body.workshop .bf-lt.warn { background: #4D3D08; color: #FFDF8E; }
.bf-conflict { color: var(--bf-danger); cursor: help; }
.bf-conflict.warn { color: var(--bf-warning); }

/* ── 8. Toolbar + inputs ───────────────────────────────────── */
.bf-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.bf-search { position: relative; }
.bf-search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--bf-muted); font-size: .78rem; }
.bf-search input { padding-left: 32px; }
.bf-input, .bf-select {
  font-family: var(--ff-body); font-size: .82rem; font-weight: 500;
  border: 1.5px solid var(--bf-border-strong); border-radius: var(--r-sm);
  padding: 7px 11px; background: var(--bf-surface); color: var(--bf-graphite);
  transition: border-color .15s, box-shadow .15s;
}
.bf-input:focus, .bf-select:focus { border-color: var(--bf-orange); box-shadow: 0 0 0 3px rgba(236,101,51,.18); outline: 0; }
.bf-label { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--bf-muted); margin-bottom: 4px; display: block; }

/* ── 9. Tables ─────────────────────────────────────────────── */
.bf-table-wrap { overflow-x: auto; }
.bf-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-table); }
.bf-table thead th {
  background: var(--bf-blue); color: #fff;
  font-size: .65rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: 9px 14px; text-align: left; white-space: nowrap;
  position: sticky; top: 0; z-index: 5;
}
body.workshop .bf-table thead th { background: #0D2E42; }
.bf-table thead th:first-child { border-radius: var(--r-sm) 0 0 0; }
.bf-table thead th:last-child { border-radius: 0 var(--r-sm) 0 0; }
.bf-table tbody td {
  padding: 10px 14px; border-bottom: 1px solid var(--bf-border);
  background: var(--bf-surface); vertical-align: middle;
}
.bf-table tbody tr { transition: background .12s; cursor: default; }
.bf-table tbody tr:hover td { background: var(--bf-blue-tint); }
.bf-table tbody tr.bf-rowlink { cursor: pointer; }
.bf-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.bf-table .bf-ref { font-weight: 700; color: var(--bf-blue); }
body.workshop .bf-table .bf-ref { color: #8FC1E3; }
.bf-table tr.bf-child td { background: var(--bf-surface-alt); font-size: .78rem; }
.bf-table tr.bf-child td:first-child { padding-left: 34px; }
.bf-table.dense td, .bf-table.dense th { padding: 7px 10px; font-size: .76rem; }
/* Bootstrap compact tables (modals, inner lists) use the same cell rhythm as .bf-table.dense */
.table-sm > :not(caption) > * > * { padding: 7px 10px; }
.bf-ref { font-weight: 700; color: var(--bf-blue); }
body.workshop .bf-ref { color: #8FC1E3; }

/* DataTables re-theme (legacy pages still on DataTables) */
table.dataTable { font-size: var(--fs-table) !important; border-collapse: separate !important; border-spacing: 0; }
table.dataTable thead th, table.dataTable thead td {
  background: var(--bf-blue) !important; color: #fff !important;
  font-size: .65rem !important; font-weight: 700 !important; letter-spacing: .07em; text-transform: uppercase;
  border-bottom: 0 !important; padding: 9px 14px;
}
body.workshop table.dataTable thead th { background: #0D2E42 !important; }
table.dataTable tbody td { background: var(--bf-surface); border-bottom: 1px solid var(--bf-border); color: var(--bf-graphite); }
table.dataTable.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: var(--bf-surface); box-shadow: none; color: var(--bf-graphite); }
table.dataTable.table-striped > tbody > tr:hover > *,
table.dataTable > tbody > tr:hover > * { background-color: var(--bf-blue-tint) !important; }
table.dataTable.table-bordered { border: 0 !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--bf-orange) !important; border-color: var(--bf-orange) !important; color: #fff !important; border-radius: var(--r-xs);
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--bf-orange-tint) !important; border-color: var(--bf-orange) !important; color: var(--bf-orange-deep) !important; border-radius: var(--r-xs);
}
.dataTables_wrapper .dataTables_paginate .paginate_button { color: var(--bf-graphite) !important; }
.dataTables_info, .dataTables_length, .dataTables_filter { font-size: .78rem; color: var(--bf-muted) !important; }
.dataTables_wrapper label { color: var(--bf-muted); }
.dataTables_filter input, .dataTables_length select {
  border: 1.5px solid var(--bf-border-strong) !important; border-radius: var(--r-sm) !important;
  background: var(--bf-surface) !important; color: var(--bf-graphite) !important;
  padding: 5px 9px !important; font-size: .8rem !important;
}
.dataTables_filter input:focus { border-color: var(--bf-orange) !important; box-shadow: 0 0 0 3px rgba(236,101,51,.18) !important; outline: 0; }

/* ── 10. Pipeline stepper ──────────────────────────────────── */
.bf-pipe { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 8px 2px 2px; }
.bf-pipe-step { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 78px; position: relative; flex: 1; }
.bf-pipe-step::before {
  content: ''; position: absolute; top: 10px; left: -50%; width: 100%; height: 3px;
  background: var(--bf-border);
}
.bf-pipe-step:first-child::before { display: none; }
.bf-pipe-step.done::before, .bf-pipe-step.now::before { background: var(--step-c, var(--bf-blue)); }
.bf-pipe-dot {
  width: 21px; height: 21px; border-radius: 50%; z-index: 1;
  background: var(--bf-surface); border: 3px solid var(--bf-border);
  display: grid; place-items: center; font-size: .55rem; color: #fff;
  transition: transform .2s var(--ease-bounce);
}
.bf-pipe-step.done .bf-pipe-dot { background: var(--step-c, var(--bf-blue)); border-color: var(--step-c, var(--bf-blue)); }
.bf-pipe-step.now .bf-pipe-dot {
  border-color: var(--step-c, var(--bf-blue)); transform: scale(1.25);
  box-shadow: 0 0 0 0 rgba(236,101,51,.4); animation: bfStepPulse 2s infinite;
}
@keyframes bfStepPulse { 50% { box-shadow: 0 0 0 7px rgba(236,101,51,0); } }
.bf-pipe-lbl { font-size: .6rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--bf-muted); text-align: center; line-height: 1.25; }
.bf-pipe-step.now .bf-pipe-lbl { color: var(--bf-graphite); }
.bf-pipe-step.done .bf-pipe-lbl { color: var(--step-c, var(--bf-blue)); }
.bf-pipe-step.clickable { cursor: pointer; }

/* ── 11. Tabs ──────────────────────────────────────────────── */
.bf-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--bf-border); overflow-x: auto; }
.bf-tab {
  border: 0; background: none; padding: 10px 16px 9px; cursor: pointer;
  font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--bf-muted); border-bottom: 3px solid transparent; margin-bottom: -2px;
  white-space: nowrap; transition: color .15s; display: flex; align-items: center; gap: 7px;
}
.bf-tab:hover { color: var(--bf-blue); }
body.workshop .bf-tab:hover { color: #fff; }
.bf-tab.active { color: var(--bf-blue); border-bottom-color: var(--bf-orange); }
body.workshop .bf-tab.active { color: #fff; }
.bf-tab .cnt { background: var(--bf-blue-tint); color: var(--bf-blue); border-radius: var(--r-pill); font-size: .62rem; padding: 0 6px; }
body.workshop .bf-tab .cnt { color: #cfe2ee; }
.bf-tabpane { display: none; animation: bfPageIn .3s var(--ease-standard); }
.bf-tabpane.active { display: block; }

/* Bootstrap nav-tabs re-theme (pages still on .nav-tabs) */
.nav-tabs { border-bottom: 2px solid var(--bf-border); gap: 2px; }
.nav-tabs .nav-link {
  border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; border-radius: 0;
  font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--bf-muted); transition: color .15s; background: none;
}
.nav-tabs .nav-link:hover { color: var(--bf-blue); border-color: transparent; border-bottom-color: var(--bf-border-strong); }
.nav-tabs .nav-link.active { color: var(--bf-blue); background: none; border-color: transparent; border-bottom: 3px solid var(--bf-orange); }
body.workshop .nav-tabs .nav-link.active, body.workshop .nav-tabs .nav-link:hover { color: #fff; }
.nav-pills .nav-link { color: var(--bf-blue); font-weight: 600; }
.nav-pills .nav-link.active { background-color: var(--bf-blue); color: #fff; }

/* ── 12. Kanban ────────────────────────────────────────────── */
.bf-board { display: grid; gap: 14px; align-items: start; }
.bf-lane { background: var(--bf-surface-alt); border: 1px solid var(--bf-border); border-radius: var(--r-md); display: flex; flex-direction: column; min-height: 200px; }
.bf-lane-head {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--bf-blue); border-bottom: 2px solid var(--lane-c, var(--bf-border-strong));
}
body.workshop .bf-lane-head { color: #cfe2ee; }
.bf-lane-count { margin-left: auto; background: var(--bf-surface); border: 1px solid var(--bf-border); border-radius: var(--r-pill); padding: 0 8px; font-size: .68rem; }
.bf-lane-body { padding: 10px; display: flex; flex-direction: column; gap: 9px; flex: 1; min-height: 90px; border-radius: 0 0 var(--r-md) var(--r-md); transition: background .15s, box-shadow .15s; }
.bf-lane-body.dragover { background: var(--bf-orange-tint); box-shadow: inset 0 0 0 2px var(--bf-orange); }
.bf-kanban-card {
  background: var(--bf-surface); border: 1px solid var(--bf-border); border-left: 4px solid var(--card-c, var(--bf-blue-light));
  border-radius: var(--r-sm); padding: 10px 12px; cursor: grab; user-select: none;
  box-shadow: var(--sh-card); font-size: .8rem;
  transition: transform .15s var(--ease-standard), box-shadow .15s, opacity .15s;
}
.bf-kanban-card:hover { transform: translateY(-2px); box-shadow: var(--sh-raised); }
.bf-kanban-card.dragging { opacity: .45; transform: rotate(2deg) scale(1.02); cursor: grabbing; }
.bf-kanban-card.dropped { animation: bfDropFlash .6s var(--ease-overshoot); }
@keyframes bfDropFlash { 0% { transform: scale(1.05); box-shadow: 0 0 0 3px rgba(236,101,51,.5); } 100% { transform: none; } }
.bf-kanban-card .t { font-weight: 700; color: var(--bf-graphite); display: flex; justify-content: space-between; gap: 8px; }
.bf-kanban-card .m { color: var(--bf-muted); font-size: .72rem; margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bf-kanban-card.selected { border-color: var(--bf-orange); box-shadow: 0 0 0 2px rgba(236,101,51,.25); }
body.workshop .bf-kanban-card { padding: 14px 14px; font-size: .92rem; }

/* ── 13. Checklists / progress ─────────────────────────────── */
.bf-check-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border: 1px solid var(--bf-border); border-radius: var(--r-sm); background: var(--bf-surface);
  cursor: pointer; transition: border-color .15s, background .2s;
  min-height: var(--touch);
}
.bf-check-row:hover { border-color: var(--bf-blue-light); }
.bf-check-row.done { background: var(--bf-success-tint); border-color: rgba(19,122,91,.3); }
body.workshop .bf-check-row.done { background: #0E3D2E; }
.bf-check-box {
  width: 22px; height: 22px; border-radius: var(--r-xs); flex-shrink: 0;
  border: 2px solid var(--bf-border-strong); display: grid; place-items: center;
  color: #fff; font-size: .7rem; transition: all .2s var(--ease-bounce); background: var(--bf-surface);
}
.bf-check-row.done .bf-check-box { background: var(--bf-success); border-color: var(--bf-success); transform: scale(1.05); }
.bf-check-row.done .bf-check-lbl { text-decoration: line-through; color: var(--bf-muted); }

.bf-progress { height: 8px; background: var(--bf-border); border-radius: var(--r-pill); overflow: hidden; }
.bf-progress > span { display: block; height: 100%; background: var(--bf-success-bright); border-radius: var(--r-pill); transition: width .7s var(--ease-standard); }
.bf-progress.orange > span { background: var(--bf-orange); }
.progress-bar { background-color: var(--bf-orange); }

/* ── 14. Toasts / modals ───────────────────────────────────── */
.bf-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 2100; display: flex; flex-direction: column; gap: 10px; }
.bf-toast {
  display: flex; align-items: center; gap: 11px;
  background: var(--bf-blue); color: #fff;
  padding: 12px 14px; border-radius: var(--r-md); box-shadow: var(--sh-modal);
  font-size: .82rem; font-weight: 600; min-width: 290px; max-width: 400px;
  border-left: 4px solid var(--bf-steel);
  animation: bfToastIn .45s var(--ease-overshoot) both;
}
.bf-toast.success { border-left-color: var(--bf-success-bright); }
.bf-toast.success i { color: var(--bf-success-bright); }
.bf-toast.danger { border-left-color: #FF6B8E; }
.bf-toast.danger i { color: #FF6B8E; }
.bf-toast.warning { border-left-color: var(--bf-warning-bright); }
.bf-toast.warning i { color: var(--bf-warning-bright); }
.bf-toast.info { border-left-color: var(--bf-orange); }
.bf-toast.info i { color: var(--bf-orange); }
.bf-toast-x { margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.55); cursor: pointer; }
.bf-toast-x:hover { color: #fff; }
.bf-toast.out { animation: bfToastOut .3s var(--ease-standard) both; }
@keyframes bfToastIn { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes bfToastOut { to { opacity: 0; transform: translateX(40px); } }
/* Legacy Bootstrap toast container (notifications etc.) */
#toastContainer { position: fixed; right: 18px; bottom: 18px; z-index: 2100; display: flex; flex-direction: column; gap: 10px; }

.bf-modal-wrap {
  position: fixed; inset: 0; z-index: 1100; background: rgba(10,42,60,.55);
  display: grid; place-items: center; padding: 20px;
  opacity: 0; transition: opacity .25s;
}
.bf-modal-wrap.show { opacity: 1; }
.bf-modal {
  background: var(--bf-surface); border-radius: var(--r-md); box-shadow: var(--sh-modal);
  width: min(480px, 100%); transform: translateY(24px) scale(.97); transition: transform .3s var(--ease-overshoot);
  overflow: hidden;
}
.bf-modal-wrap.show .bf-modal { transform: none; }
.bf-modal.lg { width: min(760px, 100%); }
.bf-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--bf-blue); color: #fff;
  font-family: var(--ff-display); font-style: italic; text-transform: uppercase; font-size: 1.02rem; letter-spacing: .03em;
}
.bf-modal-x { background: none; border: 0; color: rgba(255,255,255,.7); cursor: pointer; font-size: 1rem; }
.bf-modal-x:hover { color: #fff; }
.bf-modal-body { padding: 20px 18px; font-size: .85rem; }
.bf-modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 13px 18px; border-top: 1px solid var(--bf-border); background: var(--bf-surface-alt); }

/* Bootstrap modal re-theme (pages still on .modal) */
.modal-content { background: var(--bf-surface); color: var(--bf-graphite); border: 0; border-radius: var(--r-md); box-shadow: var(--sh-modal); overflow: hidden; }
.modal-header {
  background: var(--bf-blue); color: #fff; border-bottom: 0;
  font-family: var(--ff-display); padding: 14px 18px;
}
.modal-header .modal-title { font-family: var(--ff-display); font-style: italic; text-transform: uppercase; font-size: 1.02rem; letter-spacing: .03em; color: #fff; }
.modal-header .btn-close {
  filter: invert(1) brightness(2); opacity: .7;
  box-sizing: border-box; width: var(--touch); height: var(--touch); padding: 0; margin: -12px -12px -12px auto;
}
.modal-header .btn-close:hover { opacity: 1; }
.modal-body { padding: 20px 18px; }
.modal-footer { border-top: 1px solid var(--bf-border); background: var(--bf-surface-alt); padding: 13px 18px; gap: 9px; }
.modal-footer > * { margin: 0; }
/* same entrance and backdrop as .bf-modal */
.modal-backdrop { --bs-backdrop-bg: #0A2A3C; --bs-backdrop-opacity: .55; }
.modal.fade .modal-dialog { transform: translateY(24px) scale(.97); transition: transform .3s var(--ease-overshoot); }
.modal.show .modal-dialog { transform: none; }
@media (prefers-reduced-motion: reduce) { .modal.fade .modal-dialog { transition: none; } }

/* ── 15. Empty / gating / skeleton ─────────────────────────── */
.bf-empty {
  text-align: center; padding: 46px 20px; color: var(--bf-muted);
  border: 2px dashed var(--bf-border-strong); border-radius: var(--r-md); background: var(--bf-surface);
}
.bf-empty i { font-size: 1.9rem; color: var(--bf-border-strong); margin-bottom: 10px; display: block; }
.bf-empty .bf-display { font-size: 1.1rem; color: var(--bf-blue); margin-bottom: 4px; }
body.workshop .bf-empty .bf-display { color: #cfe2ee; }
.bf-empty p { font-size: .8rem; max-width: 340px; margin: 0 auto 14px; }

.bf-gated { position: relative; }
.bf-gated > * { visibility: hidden; }
.bf-gated::after {
  content: '\f070  Hidden for your role';
  font-family: 'Font Awesome 6 Free', var(--ff-body); font-weight: 900;
  visibility: visible; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .62rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--bf-muted); background: repeating-linear-gradient(45deg, var(--bf-surface-alt), var(--bf-surface-alt) 6px, transparent 6px, transparent 12px);
  border-radius: var(--r-xs);
}
td.bf-gated::after, span.bf-gated::after { content: '\f070'; }

/* ── 16. Bootstrap re-theme + legacy compat ────────────────── */
/* Buttons */
.btn-primary { background-color: var(--bf-orange); border-color: var(--bf-orange); font-weight: 700; }
.btn-primary:hover, .btn-primary:focus { background-color: var(--bf-orange-deep); border-color: var(--bf-orange-deep); }
.btn-primary:active { background-color: var(--bf-orange-deep) !important; border-color: var(--bf-orange-deep) !important; }
.btn-outline-primary { color: var(--bf-blue); border-color: var(--bf-border-strong); font-weight: 600; }
.btn-outline-primary:hover { background-color: var(--bf-blue-tint); border-color: var(--bf-blue); color: var(--bf-blue); }
.btn-secondary { background-color: var(--bf-blue); border-color: var(--bf-blue); }
.btn-secondary:hover { background-color: var(--bf-blue-deep); border-color: var(--bf-blue-deep); }
.btn-link { color: var(--bf-orange-deep); }
a { color: var(--bf-blue-light); }
a:hover { color: var(--bf-blue); }
body.workshop a { color: #8FC1E3; }
body.workshop a:hover { color: #fff; }

/* Cards */
.card { background: var(--bf-surface); border: 1px solid var(--bf-border); border-radius: var(--r-md); box-shadow: var(--sh-card); color: var(--bf-graphite); }
.card-header {
  background: var(--bf-surface); border-bottom: 1px solid var(--bf-border);
  font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bf-blue);
}
body.workshop .card-header { color: #cfe2ee; }

/* Forms */
.form-control, .form-select {
  background-color: var(--bf-surface); color: var(--bf-graphite);
  border: 1.5px solid var(--bf-border-strong); border-radius: var(--r-sm);
  font-size: .82rem; font-weight: 500;
}
.form-control:focus, .form-select:focus {
  background-color: var(--bf-surface); color: var(--bf-graphite);
  border-color: var(--bf-orange); box-shadow: 0 0 0 3px rgba(236,101,51,.18);
}
.form-control::placeholder { color: var(--bf-muted); opacity: .7; }
.form-control, .form-select, .form-control-sm, .form-select-sm { line-height: 1.5; }
.form-label { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--bf-muted); margin-bottom: 5px; }

/* Select caret recoloured to brand blue */
.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%230F3B52' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
body.workshop .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23cfe2ee' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

/* Checkboxes, radios, switches */
.form-check-input {
  border: 1.5px solid var(--bf-border-strong); background-color: var(--bf-surface);
  width: 1.05em; height: 1.05em; margin-top: .15em; cursor: pointer; transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.form-check-input:checked { background-color: var(--bf-orange); border-color: var(--bf-orange); }
.form-check-input:focus { border-color: var(--bf-orange); box-shadow: 0 0 0 3px rgba(236,101,51,.18); }
.form-check-input:checked[type=radio] { background-color: var(--bf-orange); }
.form-switch .form-check-input:checked { background-color: var(--bf-success); border-color: var(--bf-success); }
.form-check-label { font-size: .82rem; cursor: pointer; }

/* Input groups + addons */
.input-group-text {
  background: var(--bf-surface-alt); border: 1.5px solid var(--bf-border-strong);
  color: var(--bf-muted); font-size: .8rem; border-radius: var(--r-sm);
}
.input-group .form-control, .input-group .form-select { border-color: var(--bf-border-strong); }
.input-group:focus-within .input-group-text { border-color: var(--bf-orange); }

/* Range slider */
.form-range::-webkit-slider-thumb { background: var(--bf-orange); }
.form-range::-moz-range-thumb { background: var(--bf-orange); }

/* Small-size parity (DataTables/admin use form-control-sm) */
.form-control-sm, .form-select-sm { border-radius: var(--r-xs); font-size: .78rem; }

/* ── Controls: one size scale for touch (workshop tablets) ────
   Fields and buttons are at least --touch (44px) tall; the small variants (.sm, -sm) are 36px for dense
   toolbars and table rows. Inline text links (.btn-link) keep their text size. */
.form-control, .form-select, .bf-input, .bf-select { min-height: var(--touch); padding: 9px 12px; font-size: .875rem; }
.form-select, .bf-select { padding-right: 34px; }
.bf-select {
  appearance: none; -webkit-appearance: none;
  background: var(--bf-surface) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%230F3B52' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat right 12px center / 14px 10px;
}
textarea.form-control, textarea.bf-input { min-height: 88px; }
.form-control-sm, .form-select-sm, .bf-input.sm, .bf-select.sm { min-height: 36px; padding: 6px 10px; font-size: .8rem; }
.form-select-sm, .bf-select.sm { padding-right: 30px; }
.bf-search input { padding-left: 34px; }
.form-control:disabled, .form-select:disabled, .bf-input:disabled, .bf-select:disabled {
  background-color: var(--bf-surface-alt); color: var(--bf-disabled); border-color: var(--bf-border); cursor: not-allowed;
}
.form-control.is-invalid, .form-select.is-invalid, .bf-input.is-invalid, .bf-select.is-invalid { border-color: var(--bf-scarlet); }
.form-control.is-invalid:focus, .bf-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(200, 30, 40, .18); }
.invalid-feedback { font-size: .74rem; font-weight: 600; color: var(--bf-scarlet); }

.btn:not(.btn-link), .bf-btn-primary, .bf-btn-blue, .bf-btn-ghost, .bf-btn-danger, .bf-btn-success {
  min-height: var(--touch); display: inline-flex; align-items: center; justify-content: center;
}
.btn.sm:not(.btn-link), .btn-sm:not(.btn-link) { min-height: 36px; }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; }
.btn-close { box-sizing: content-box; padding: 14px; margin: -10px -10px -10px auto; }

/* Checkboxes and radios: a 22px box, the whole label is the tap target */
.form-check { display: flex; align-items: center; gap: 10px; min-height: 36px; padding-left: 0; margin-bottom: 4px; }
.form-check-inline { display: inline-flex; margin-right: 16px; }
.form-check .form-check-input { float: none; margin: 0; flex: 0 0 auto; }
.form-check-input { width: 22px; height: 22px; margin-top: 0; border-width: 2px; }
.form-check-input[type=checkbox] { border-radius: var(--r-xs); }
.form-switch { padding-left: 0; }
.form-switch .form-check-input { width: 44px; height: 24px; margin-left: 0; border-radius: var(--r-pill); }
input[type=checkbox]:not(.form-check-input), input[type=radio]:not(.form-check-input) {
  accent-color: var(--bf-orange); width: 20px; height: 20px; vertical-align: middle; cursor: pointer;
}

/* Segmented control (original .opt-tab): a pill of options, one on. Buttons, links or radio + label pairs. */
.bf-seg { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--bf-border-strong); border-radius: var(--r-pill);
          overflow: hidden; background: var(--bf-surface); }
.bf-seg > button, .bf-seg > a, .bf-seg > label {
  border: 0; background: none; min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bf-muted);
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s;
}
.bf-seg > * + * { border-left: 1.5px solid var(--bf-border); }
.bf-seg > button:hover, .bf-seg > a:hover, .bf-seg > label:hover { color: var(--bf-blue); background: var(--bf-blue-tint); }
.bf-seg > .active, .bf-seg > [aria-pressed=true], .bf-seg > input:checked + label { background: var(--bf-blue); color: #fff; }
.bf-seg > input { position: absolute; opacity: 0; pointer-events: none; }
body.workshop .bf-seg { background: transparent; }
body.workshop .bf-seg > .active { background: var(--bf-orange); }

/* Menus and pagination at touch size */
.dropdown-item { min-height: 40px; display: flex; align-items: center; }
.page-link { min-width: 36px; min-height: 36px; display: flex; align-items: center; justify-content: center; }

/* BOM / child rows: the original's left accent */
.bf-table tr.bf-child td:first-child, tr.bom-child-row td:first-child { box-shadow: inset 3px 0 0 var(--bf-blue-light); }

/* ── Pagination (Bootstrap .pagination + DataTables) ───────── */
.pagination { gap: 4px; }
.page-link {
  border: 1px solid var(--bf-border); border-radius: var(--r-xs) !important;
  color: var(--bf-blue); font-size: .76rem; font-weight: 700; padding: .35rem .65rem;
  background: var(--bf-surface); transition: background .15s, border-color .15s, color .15s;
}
.page-link:hover { background: var(--bf-orange-tint); border-color: var(--bf-orange); color: var(--bf-orange-deep); }
.page-link:focus { box-shadow: 0 0 0 3px rgba(236,101,51,.18); }
.page-item.active .page-link { background: var(--bf-orange); border-color: var(--bf-orange); color: #fff; }
.page-item.disabled .page-link { background: var(--bf-surface-alt); color: var(--bf-disabled); border-color: var(--bf-border); }
body.workshop .page-link { color: #cfe2ee; }

/* Dropdowns (generic Bootstrap) */
.dropdown-menu { border: 1px solid var(--bf-border); border-radius: var(--r-md); box-shadow: var(--sh-raised); font-size: .83rem; background: var(--bf-surface); color: var(--bf-graphite); }
.dropdown-item { font-weight: 600; color: var(--bf-graphite); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--bf-blue-tint); color: var(--bf-blue); }
.dropdown-item.active { background: var(--bf-blue); color: #fff; }
.dropdown-divider { border-color: var(--bf-border); }

/* Legacy lead-time badges */
.lt-green  { background: var(--bf-success-tint); color: var(--lt-ok); }
.lt-amber  { background: var(--bf-warning-tint); color: var(--lt-warn); }
.lt-red    { background: var(--lt-crit); color: #fff; }

/* Legacy module / QC headers */
.qc-module-header { background: var(--bf-blue-tint); color: var(--bf-blue); padding: 5px 12px; border-radius: var(--r-xs);
                    font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-top: 1rem; }
.qc-module-header:first-child { margin-top: 0; }
body.workshop .qc-module-header { color: #cfe2ee; }

/* Legacy QC result buttons */
.qc-fail  { background: var(--bf-danger) !important; color: #fff !important; }
.qc-row { border-bottom: 1px solid var(--bf-border); padding: 8px 6px; font-size: .85rem; }
.qc-row:last-child { border-bottom: none; }
.qc-photo-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: var(--r-sm); cursor: pointer; border: 1px solid var(--bf-border); }
.qc-removed { opacity: .4; text-decoration: line-through; }

.kanban-crate-group { margin-bottom: 6px; }
.kanban-crate-label { font-size: .66rem; font-weight: 700; color: var(--bf-blue); padding: 2px 8px;
                      background: var(--bf-blue-tint); border-radius: var(--r-xs); margin-bottom: 3px; display: inline-block; }
/* Assembly groups: same shape as crate groups, tinted orange to distinguish a
   logical assembly grouping from a physical crate. */
.kanban-asm-group { border-left: 2px solid var(--bf-orange); padding-left: 5px; }
.kanban-asm-group > .kanban-crate-label { color: var(--bf-orange-deep); background: var(--bf-orange-tint); }

/* Legacy BOM rows (order items tab) */
.item-row td { vertical-align: middle; }

/* Legacy colour utilities → new palette */
.text-bf-crimson  { color: var(--bf-orange-deep) !important; }

/* Workshop-mode safety net for Bootstrap utility text colours */
body.workshop .text-muted { color: var(--bf-muted) !important; }
body.workshop .card, body.workshop .modal-content { color: var(--bf-graphite); }

/* ── Utilities ─────────────────────────────────────────────── */
.bf-grid { display: grid; gap: 14px; }
.bf-flex { display: flex; gap: 10px; align-items: center; }
.bf-muted { color: var(--bf-muted); }
.bf-right { margin-left: auto; }
.bf-divider { height: 1px; background: var(--bf-border); margin: 16px 0; }
::selection { background: var(--bf-orange); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bf-border-strong); border-radius: 6px; border: 2px solid var(--bf-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--bf-orange); }

/* ── Print ─────────────────────────────────────────────────── */
@media print {
  .bf-nav, .navbar, .sidebar, #toastContainer, .bf-toasts, .bf-loader,
  .no-print, .btn { display: none !important; }
  body { background: #fff !important; color: #000 !important; font-size: 11pt; }
  .card, .bf-card { border: 1px solid #ccc; box-shadow: none; }
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .bf-pulse::after, .bf-loader-orbit, .bf-loader-ring, .bf-loader-ball,
  .st-go_live::before, .bf-pipe-step.now .bf-pipe-dot { animation: none; }
  .bf-main, .bf-tabpane, .bf-page-title::after { animation-duration: .01s; }
}

/* ── Responsive ────────────────────────────────────────────── */
/* Collapse the link rail to a hamburger early enough that the widest (admin)
   nav never overflows into the right-hand controls — the desktop rail has no
   horizontal scroll anymore (it clipped the dropdowns), so it must fully fit. */
@media (max-width: 1149.98px) {
  .bf-nav { gap: 6px; padding: 0 10px; }
  /* Logo stays left; push the controls (bell, user, burger) to the right so
     the hamburger sits hard against the right edge. The link rail is absolute
     here, so without this the row would left-pack. */
  .bf-nav .bf-brand { margin-right: auto; }

  /* Hamburger toggle (hidden on desktop, shown here) — last, far right */
  .bf-nav-burger {
    display: inline-grid; place-items: center; order: 9;
    width: 40px; height: 40px; border: 0; cursor: pointer;
    background: rgba(255,255,255,.10); color: #fff;
    border-radius: var(--r-sm); font-size: 1.05rem;
  }
  .bf-nav-burger:hover { background: rgba(255,255,255,.18); }

  /* Link rail becomes a slide-down panel under the bar */
  .bf-nav-links {
    position: absolute; top: 56px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bf-blue); padding: 8px;
    max-height: calc(100vh - 56px); overflow-y: auto;
    box-shadow: 0 14px 26px rgba(10,42,60,.35);
    display: none; z-index: 1031;
  }
  body.workshop .bf-nav-links { background: #071A26; }
  .bf-nav.nav-open .bf-nav-links { display: flex; animation: bfNavSheet .22s var(--ease-standard); }
  @keyframes bfNavSheet { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

  .bf-nav-link {
    width: 100%; justify-content: flex-start;
    padding: 12px 14px; font-size: .8rem; border-radius: var(--r-xs);
    border-top: 0; border-bottom: 0; border-left: 3px solid transparent;
  }
  .bf-nav-link.active {
    border-bottom-color: transparent; border-left-color: var(--bf-orange);
    background: rgba(255,255,255,.07);
  }
  .bf-nav-item.dropdown { flex-direction: column; align-items: stretch; }
  .bf-nav-link.dropdown-toggle { justify-content: space-between; }

  /* Group menus render inline in the panel (override Popper inline styles) */
  .bf-nav-links .dropdown-menu {
    position: static !important; transform: none !important; inset: auto !important;
    float: none; width: 100%; margin: 0 0 4px 8px !important;
    border: 0; background: rgba(255,255,255,.06); box-shadow: none;
    animation: none; padding: 4px;
  }
  .bf-nav-links .dropdown-item { color: rgba(255,255,255,.85); }
  .bf-nav-links .dropdown-item:hover,
  .bf-nav-links .dropdown-item:focus { background: rgba(255,255,255,.12); color: #fff; }
  .bf-nav-links .dropdown-item.active { background: var(--bf-orange); color: #fff; }
  .bf-nav-links .dropdown-item i { color: rgba(255,255,255,.55) !important; }
  .bf-nav-links .dropdown-divider { border-color: rgba(255,255,255,.15); }
}

@media (max-width: 991.98px) {
  .bf-main { padding: 16px 14px 60px; }
  .bf-user-meta { display: none; }
}

/* ── Start-of-session popup (onboarding.js): what's new and training progress ── */
.ob-news, .ob-training { margin-bottom: var(--sp-4); }
.ob-news:last-child, .ob-training:last-child { margin-bottom: 0; }
.ob-item { border-left: 3px solid var(--bf-orange); padding: 2px 0 2px 10px; margin: 8px 0; }
.ob-progress { display: flex; align-items: center; gap: var(--sp-3); margin: 6px 0 10px; }
.ob-progress .bf-progress { flex: 1; }
.ob-due { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.ob-due li { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 32px; }
.ob-tag { font-size: var(--fs-micro); font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill);
          background: var(--bf-orange-tint); color: var(--bf-orange-deep); white-space: nowrap; }
.ob-tag.update { background: var(--bf-warning-tint); color: var(--bf-warning); }

/* ── Assistant panel (assistant.js), on every page ── */
#bfAsst .asst-fab { position: fixed; right: 20px; bottom: 20px; z-index: 1040; width: 52px; height: 52px;
                    border: 0; border-radius: var(--r-pill); background: var(--bf-orange); color: #fff;
                    box-shadow: var(--sh-raised); font-size: 1.25rem; }
#bfAsst .asst-fab:hover { background: var(--bf-orange-deep); }
#bfAsst.open .asst-fab { display: none; }
#bfAsst .asst-panel { position: fixed; right: 20px; bottom: 20px; z-index: 1041; width: 380px;
                      height: min(620px, calc(100vh - 100px)); display: none; flex-direction: column;
                      background: var(--bf-surface); border: 1px solid var(--bf-border); border-radius: var(--r-md);
                      box-shadow: var(--sh-modal); }
#bfAsst.open .asst-panel { display: flex; }
.asst-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 16px; background: var(--bf-blue);
             color: #fff; border-radius: var(--r-md) var(--r-md) 0 0; }
.asst-head strong { flex: 1; font-family: var(--ff-display); font-style: italic; text-transform: uppercase;
                    letter-spacing: .02em; }
.asst-head button { min-width: 40px; min-height: 40px; border: 0; background: transparent; color: rgba(255,255,255,.85);
                    border-radius: var(--r-sm); position: relative; }
.asst-head button:hover { background: rgba(255,255,255,.12); color: #fff; }
.asst-mem-count { position: absolute; top: 4px; right: 4px; font-size: var(--fs-micro); font-weight: 700;
                  color: var(--bf-orange); }
.asst-mem { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--bf-border); background: var(--bf-surface-alt);
            max-height: 180px; overflow: auto; }
.asst-mem ul { list-style: none; padding: 0; margin: 6px 0 0; font-size: var(--fs-small); }
.asst-mem li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.asst-forget { border: 0; background: transparent; color: var(--bf-muted); min-width: 32px; min-height: 32px;
               font-size: 1.1rem; }
.asst-forget:hover { color: var(--bf-danger); }
.asst-msgs { flex: 1; overflow-y: auto; padding: var(--sp-4); display: flex; flex-direction: column; gap: 10px;
             font-size: var(--fs-body); }
.asst-msg { max-width: 88%; padding: 8px 12px; border-radius: var(--r-md); line-height: 1.45; overflow-wrap: anywhere; }
.asst-msg p { margin: 0 0 6px; } .asst-msg p:last-child { margin: 0; }
.asst-msg ul { margin: 0 0 6px; padding-left: 18px; } .asst-msg ul:last-child { margin-bottom: 0; }
.asst-msg.user { align-self: flex-end; background: var(--bf-blue); color: #fff; white-space: pre-wrap; }
.asst-msg.assistant { align-self: flex-start; background: var(--bf-blue-tint); color: var(--bf-graphite); }
.asst-msg.error { background: var(--bf-warning-tint); color: var(--bf-warning); }
.asst-empty { color: var(--bf-muted); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.asst-chip { border: 1px solid var(--bf-border-strong); background: var(--bf-surface); color: var(--bf-blue);
             border-radius: var(--r-pill); padding: 6px 12px; font-size: var(--fs-small); text-align: left;
             min-height: 36px; }
.asst-chip:hover { border-color: var(--bf-orange); color: var(--bf-orange-deep); }
.asst-typing span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%;
                    background: var(--bf-muted); animation: asst-dot 1s infinite ease-in-out; }
.asst-typing span:nth-child(2) { animation-delay: .15s; } .asst-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes asst-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.asst-form { display: flex; gap: 8px; padding: var(--sp-3); border-top: 1px solid var(--bf-border); }
.asst-form textarea { flex: 1; resize: none; border: 1px solid var(--bf-border-strong); border-radius: var(--r-sm);
                      padding: 8px 10px; font: inherit; font-size: var(--fs-body); background: var(--bf-surface);
                      color: var(--bf-graphite); }
.asst-form .btn { min-width: 44px; }
.asst-foot { font-size: var(--fs-micro); color: var(--bf-muted); padding: 0 var(--sp-3) var(--sp-2); }
body.workshop .asst-msg.assistant { color: var(--bf-graphite); }
@media (max-width: 575.98px) {
  #bfAsst .asst-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .asst-head { border-radius: 0; }
  #bfAsst .asst-fab { right: 14px; bottom: 14px; }
}
.asst-prop { align-self: stretch; border: 1px solid var(--bf-orange); border-radius: var(--r-md); padding: 10px 12px;
             background: var(--bf-orange-tint); font-size: var(--fs-small); }
.asst-prop p { margin: 4px 0 8px; overflow-wrap: anywhere; color: var(--bf-graphite); }
.asst-prop-actions { display: flex; justify-content: flex-end; gap: 8px; }
.asst-prop-actions .btn { min-height: 36px; min-width: 84px; }
.asst-prop-asked { color: var(--bf-muted) !important; font-size: var(--fs-micro); }
.asst-prop-err { color: var(--bf-danger) !important; }
.asst-prop-state { font-weight: 700; color: var(--bf-muted); }
.asst-prop-state.done { color: var(--bf-success); }
@media print { #bfAsst { display: none; } }
