/* ==========================================================================
   BuildTrack Design System — Components & Motion  (v1.0)
   Requires tokens.css. Class prefix: .bt-
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  background-color: var(--bt-bg);
  background-image:
    linear-gradient(var(--bt-bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bt-bg-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--bt-text);
  font-family: var(--bt-font-ui);
  font-size: var(--bt-text-base);
  line-height: var(--bt-leading-body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--bt-dur-slow) var(--bt-ease-std),
              color var(--bt-dur-slow) var(--bt-ease-std);
}

h1, h2, h3, h4 {
  font-family: var(--bt-font-display);
  font-weight: 600;
  line-height: var(--bt-leading-tight);
  letter-spacing: 0.01em;
  margin: 0;
}
h1 { font-size: var(--bt-text-2xl); }
h2 { font-size: var(--bt-text-xl); }
h3 { font-size: var(--bt-text-lg); }
h4 { font-size: var(--bt-text-md); }
p  { margin: 0; max-width: 72ch; }

.bt-muted { color: var(--bt-text-muted); }
.bt-data  { font-family: var(--bt-font-data); font-size: .92em; letter-spacing: -0.01em; }

:focus-visible { outline: none; box-shadow: var(--bt-focus); border-radius: var(--bt-radius-sm); }

/* ---------- Panel: the base container. Corner ticks = blueprint registration ---------- */
.bt-panel {
  position: relative;
  background: var(--bt-surface);
  border: 1px solid var(--bt-line);
  border-radius: var(--bt-radius-md);
  box-shadow: var(--bt-shadow-1);
  padding: var(--bt-space-5);
}
.bt-panel--ticked::before, .bt-panel--ticked::after {
  content: ""; position: absolute; width: 10px; height: 10px;
  border-color: var(--bt-line-strong); border-style: solid; pointer-events: none;
}
.bt-panel--ticked::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-top-left-radius: var(--bt-radius-md); }
.bt-panel--ticked::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-bottom-right-radius: var(--bt-radius-md); }
.bt-panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--bt-space-3);
  margin-bottom: var(--bt-space-4);
}
.bt-panel__title { font-family: var(--bt-font-display); font-size: var(--bt-text-md); font-weight: 600; }

/* ---------- Buttons ---------- */
.bt-btn {
  --_bg: var(--bt-raised); --_fg: var(--bt-text); --_bd: var(--bt-line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--bt-space-2);
  min-height: var(--bt-hit-min); padding: 0 var(--bt-space-4);
  background: var(--_bg); color: var(--_fg);
  border: 1px solid var(--_bd); border-radius: var(--bt-radius-sm);
  font: 600 var(--bt-text-sm)/1 var(--bt-font-ui); letter-spacing: .01em;
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: background-color var(--bt-dur-fast) var(--bt-ease-std),
              border-color var(--bt-dur-fast) var(--bt-ease-std),
              box-shadow var(--bt-dur-fast) var(--bt-ease-std),
              transform var(--bt-dur-instant) var(--bt-ease-std);
}
.bt-btn:hover  { border-color: var(--bt-text-faint); }
.bt-btn:active { transform: translateY(1px) scale(.985); }
.bt-btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.bt-btn--primary { --_bg: var(--bt-accent); --_fg: var(--bt-text-on-accent); --_bd: var(--bt-accent); }
.bt-btn--primary:hover { --_bg: var(--bt-accent-hover); --_bd: var(--bt-accent-hover); box-shadow: var(--bt-accent-glow); }
.bt-btn--primary:active { --_bg: var(--bt-accent-press); }

.bt-btn--ghost { --_bg: transparent; --_bd: transparent; color: var(--bt-text-muted); }
.bt-btn--ghost:hover { --_bg: var(--bt-raised); color: var(--bt-text); border-color: transparent; }

.bt-btn--danger { --_bg: transparent; --_fg: var(--bt-fail); --_bd: color-mix(in srgb, var(--bt-fail) 55%, transparent); }
.bt-btn--danger:hover { --_bg: var(--bt-fail-soft); border-color: var(--bt-fail); }

.bt-btn--floor { min-height: var(--bt-hit-floor); font-size: var(--bt-text-md); padding: 0 var(--bt-space-6); }
.bt-btn--icon  { width: var(--bt-hit-min); padding: 0; }

.bt-btn.is-loading { color: transparent; position: relative; pointer-events: none; }
.bt-btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--_fg); border-right-color: transparent;
  animation: bt-spin 700ms linear infinite;
}

/* ---------- Inputs ---------- */
.bt-field { display: grid; gap: 6px; }
.bt-label { font-size: var(--bt-text-sm); font-weight: 600; color: var(--bt-text-muted); }
.bt-hint  { font-size: var(--bt-text-xs); color: var(--bt-text-faint); }
.bt-input, .bt-select, .bt-textarea {
  width: 100%; min-height: var(--bt-hit-min); padding: 0 var(--bt-space-3);
  background: var(--bt-raised); color: var(--bt-text);
  border: 1px solid var(--bt-line); border-radius: var(--bt-radius-sm);
  font: 500 var(--bt-text-base) var(--bt-font-ui);
  transition: border-color var(--bt-dur-fast) var(--bt-ease-std), box-shadow var(--bt-dur-fast) var(--bt-ease-std);
}
.bt-textarea { padding: var(--bt-space-3); min-height: 96px; resize: vertical; }
.bt-input::placeholder, .bt-textarea::placeholder { color: var(--bt-text-faint); }
.bt-input:hover, .bt-select:hover, .bt-textarea:hover { border-color: var(--bt-line-strong); }
.bt-input:focus, .bt-select:focus, .bt-textarea:focus {
  outline: none; border-color: var(--bt-accent); box-shadow: 0 0 0 3px var(--bt-accent-soft);
}
.bt-field.is-error .bt-input { border-color: var(--bt-fail); box-shadow: 0 0 0 3px var(--bt-fail-soft); }
.bt-field.is-error .bt-hint  { color: var(--bt-fail); }

/* Toggle switch — snaps with slight overshoot */
.bt-switch { position: relative; display: inline-flex; align-items: center; gap: var(--bt-space-3); cursor: pointer; min-height: var(--bt-hit-min); }
.bt-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bt-switch__track {
  width: 44px; height: 24px; border-radius: 12px; background: var(--bt-line-strong); position: relative;
  transition: background-color var(--bt-dur-base) var(--bt-ease-std);
}
.bt-switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--bt-text); transition: transform var(--bt-dur-base) var(--bt-ease-snap);
}
.bt-switch input:checked + .bt-switch__track { background: var(--bt-accent); }
.bt-switch input:checked + .bt-switch__track::after { transform: translateX(20px); background: var(--bt-text-on-accent); }
.bt-switch input:focus-visible + .bt-switch__track { box-shadow: var(--bt-focus); }

/* Checklist item (QC) */
.bt-check {
  display: flex; align-items: center; gap: var(--bt-space-3);
  min-height: var(--bt-hit-floor); padding: 0 var(--bt-space-4);
  background: var(--bt-raised); border: 1px solid var(--bt-line); border-radius: var(--bt-radius-sm);
  cursor: pointer; transition: border-color var(--bt-dur-fast), background-color var(--bt-dur-fast);
}
.bt-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bt-check__box {
  flex: none; width: 26px; height: 26px; border-radius: var(--bt-radius-xs);
  border: 2px solid var(--bt-line-strong); display: grid; place-items: center;
  transition: background-color var(--bt-dur-fast), border-color var(--bt-dur-fast);
}
.bt-check__box svg { width: 16px; height: 16px; stroke: var(--bt-text-on-accent); stroke-width: 3; fill: none;
  stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset var(--bt-dur-base) var(--bt-ease-out); }
.bt-check:has(input:checked) { border-color: color-mix(in srgb, var(--bt-pass) 45%, transparent); background: var(--bt-pass-soft); }
.bt-check input:checked + .bt-check__box { background: var(--bt-pass); border-color: var(--bt-pass); }
.bt-check input:checked + .bt-check__box svg { stroke-dashoffset: 0; }
.bt-check input:focus-visible + .bt-check__box { box-shadow: var(--bt-focus); }

/* ---------- Status: LED + badge ---------- */
.bt-led { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--bt-idle); }
.bt-led--pass   { background: var(--bt-pass);   box-shadow: var(--bt-led-pass); }
.bt-led--fail   { background: var(--bt-fail);   box-shadow: var(--bt-led-fail); }
.bt-led--active { background: var(--bt-active); box-shadow: var(--bt-led-active); }
.bt-led--warn   { background: var(--bt-warn);   box-shadow: var(--bt-led-warn); }
.bt-led--live   { animation: bt-pulse 1.8s var(--bt-ease-std) infinite; }

.bt-badge {
  flex: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 8px; border-radius: var(--bt-radius-xs);
  font-size: var(--bt-text-xs); font-weight: 600; letter-spacing: .02em;
  background: var(--bt-idle-soft); color: var(--bt-text-muted);
}
.bt-badge--pass   { background: var(--bt-pass-soft);   color: var(--bt-pass); }
.bt-badge--fail   { background: var(--bt-fail-soft);   color: var(--bt-fail); }
.bt-badge--active { background: var(--bt-active-soft); color: var(--bt-active); }
.bt-badge--warn   { background: var(--bt-warn-soft);   color: var(--bt-accent-text); }
.bt-badge--blocked{ background: var(--bt-hazard); color: transparent; position: relative; padding: 0 2px; }
.bt-badge--blocked > span {
  color: var(--bt-text); background: var(--bt-surface); padding: 0 6px; height: 20px;
  display: inline-flex; align-items: center; border-radius: 1px;
}

/* ---------- KPI readout ---------- */
.bt-kpi { display: grid; gap: 2px; }
.bt-kpi__label { font-size: var(--bt-text-sm); color: var(--bt-text-muted); }
.bt-kpi__value {
  font-family: var(--bt-font-display); font-weight: 700; font-size: var(--bt-text-3xl);
  line-height: 1; letter-spacing: -0.01em;
}
.bt-kpi__unit { font-size: .45em; font-weight: 600; color: var(--bt-text-muted); margin-left: 4px; letter-spacing: 0; }
.bt-kpi__delta { font-size: var(--bt-text-xs); font-weight: 600; }
.bt-kpi__delta.up { color: var(--bt-pass); } .bt-kpi__delta.down { color: var(--bt-fail); }

/* Value-changed flash: add .bt-flash for one cycle when live data updates */
.bt-flash { animation: bt-flash var(--bt-dur-flash) var(--bt-ease-out); }

/* Meter / progress */
.bt-meter { height: 6px; background: var(--bt-raised); border-radius: 3px; overflow: hidden; }
.bt-meter > i { display: block; height: 100%; background: var(--bt-active); border-radius: inherit;
  transform-origin: left; transition: width var(--bt-dur-slow) var(--bt-ease-out); }
.bt-meter--pass > i { background: var(--bt-pass); }
.bt-meter--warn > i { background: var(--bt-warn); }

/* ---------- Table ---------- */
.bt-table-wrap { overflow-x: auto; border: 1px solid var(--bt-line); border-radius: var(--bt-radius-md); background: var(--bt-surface); }
.bt-table { width: 100%; border-collapse: collapse; font-size: var(--bt-text-sm); }
.bt-table th {
  position: sticky; top: 0; z-index: 1; text-align: left; white-space: nowrap;
  padding: 10px var(--bt-space-4); background: var(--bt-surface);
  color: var(--bt-text-muted); font-weight: 600; border-bottom: 1px solid var(--bt-line-strong);
}
.bt-table td { padding: 12px var(--bt-space-4); border-bottom: 1px solid var(--bt-line); white-space: nowrap; }
.bt-table tbody tr { transition: background-color var(--bt-dur-fast) var(--bt-ease-std); }
.bt-table tbody tr:hover { background: var(--bt-raised); }
.bt-table tbody tr.is-selected { background: var(--bt-accent-soft); box-shadow: inset 3px 0 0 var(--bt-accent); }
.bt-table td.num, .bt-table th.num { text-align: right; }

/* ---------- Tabs: sliding indicator ---------- */
.bt-tabs { position: relative; display: flex; gap: var(--bt-space-1); border-bottom: 1px solid var(--bt-line); }
.bt-tab {
  appearance: none; background: none; border: 0; cursor: pointer;
  min-height: var(--bt-hit-min); padding: 0 var(--bt-space-4);
  font: 600 var(--bt-text-sm) var(--bt-font-ui); color: var(--bt-text-muted);
  transition: color var(--bt-dur-fast);
}
.bt-tab:hover { color: var(--bt-text); }
.bt-tab[aria-selected="true"] { color: var(--bt-text); }
.bt-tabs__ink {
  position: absolute; bottom: -1px; height: 2px; background: var(--bt-accent);
  transition: transform var(--bt-dur-base) var(--bt-ease-out), width var(--bt-dur-base) var(--bt-ease-out);
}

/* ---------- Overlays: modal, drawer, toast ---------- */
.bt-scrim {
  position: fixed; inset: 0; z-index: 50; background: var(--bt-overlay);
  backdrop-filter: blur(3px); opacity: 0; pointer-events: none;
  transition: opacity var(--bt-dur-base) var(--bt-ease-std);
}
.bt-scrim.is-open { opacity: 1; pointer-events: auto; }

.bt-modal {
  position: fixed; z-index: 51; left: 50%; top: 50%; width: min(520px, calc(100vw - 32px));
  background: var(--bt-surface); border: 1px solid var(--bt-line-strong); border-radius: var(--bt-radius-lg);
  box-shadow: var(--bt-shadow-3); padding: var(--bt-space-6);
  opacity: 0; transform: translate(-50%, -48%) scale(.97); pointer-events: none;
  transition: opacity var(--bt-dur-base) var(--bt-ease-in), transform var(--bt-dur-base) var(--bt-ease-in);
}
.bt-modal.is-open {
  opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto;
  transition: opacity var(--bt-dur-slow) var(--bt-ease-out), transform var(--bt-dur-slow) var(--bt-ease-out);
}

.bt-drawer {
  position: fixed; z-index: 51; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  background: var(--bt-surface); border-left: 1px solid var(--bt-line-strong); box-shadow: var(--bt-shadow-3);
  padding: calc(var(--bt-space-6) + env(safe-area-inset-top, 0px)) var(--bt-space-6) var(--bt-space-6);
  transform: translateX(102%); transition: transform var(--bt-dur-base) var(--bt-ease-in);
  display: flex; flex-direction: column; gap: var(--bt-space-5); overflow-y: auto;
}
.bt-drawer.is-open { transform: translateX(0); transition: transform var(--bt-dur-slow) var(--bt-ease-out); }

.bt-toasts {
  position: fixed; z-index: 60; right: var(--bt-space-4);
  bottom: calc(var(--bt-space-4) + env(safe-area-inset-bottom, 0px));
  display: grid; gap: var(--bt-space-2); width: min(360px, calc(100vw - 32px));
}
.bt-toast {
  display: flex; align-items: flex-start; gap: var(--bt-space-3);
  padding: var(--bt-space-3) var(--bt-space-4); background: var(--bt-raised);
  border: 1px solid var(--bt-line-strong); border-left: 3px solid var(--bt-pass);
  border-radius: var(--bt-radius-sm); box-shadow: var(--bt-shadow-2); font-size: var(--bt-text-sm);
  animation: bt-toast-in var(--bt-dur-slow) var(--bt-ease-out) both;
}
.bt-toast--fail { border-left-color: var(--bt-fail); }
.bt-toast--warn { border-left-color: var(--bt-warn); }
.bt-toast.is-leaving { animation: bt-toast-out var(--bt-dur-base) var(--bt-ease-in) both; }
.bt-toast .bt-led { margin-top: 6px; }

/* ---------- Skeleton loader ---------- */
.bt-skel {
  display: block; border-radius: var(--bt-radius-xs); background: var(--bt-raised);
  background-image: linear-gradient(90deg, transparent 0, color-mix(in srgb, var(--bt-text) 6%, transparent) 50%, transparent 100%);
  background-size: 200% 100%; background-repeat: no-repeat;
  animation: bt-shimmer 1.4s linear infinite;
}

/* ---------- Dropzone ---------- */
.bt-drop {
  display: grid; place-items: center; gap: var(--bt-space-2); text-align: center;
  min-height: 140px; padding: var(--bt-space-5);
  border: 2px dashed var(--bt-line-strong); border-radius: var(--bt-radius-md);
  color: var(--bt-text-muted); cursor: pointer;
  transition: border-color var(--bt-dur-fast), background-color var(--bt-dur-fast);
}
.bt-drop:hover, .bt-drop.is-over { border-color: var(--bt-accent); background: var(--bt-accent-soft); color: var(--bt-text); }

/* ---------- Entrance choreography ----------
   Add .bt-enter to a container; children with .bt-enter__item stagger in.
   Use once per view change, never on scroll for every section.  */
.bt-enter .bt-enter__item {
  animation: bt-rise var(--bt-dur-slow) var(--bt-ease-out) both;
  animation-delay: calc(min(var(--i, 0), 8) * var(--bt-stagger));
}
.bt-view-enter { animation: bt-view-in var(--bt-dur-slow) var(--bt-ease-out) both; }

/* ---------- Keyframes ---------- */
@keyframes bt-rise    { from { opacity: 0; transform: translateY(var(--bt-rise)); } to { opacity: 1; transform: none; } }
@keyframes bt-view-in { from { opacity: 0; transform: translateY(calc(var(--bt-rise) * .75)); } to { opacity: 1; transform: none; } }
@keyframes bt-fade    { from { opacity: 0; } to { opacity: 1; } }
@keyframes bt-pulse   { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes bt-spin    { to { transform: rotate(360deg); } }
@keyframes bt-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
@keyframes bt-flash   { 0% { background-color: var(--bt-accent-soft); box-shadow: inset 0 0 0 1px var(--bt-accent); } 100% { background-color: transparent; box-shadow: inset 0 0 0 1px transparent; } }
@keyframes bt-toast-in  { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes bt-toast-out { to { opacity: 0; transform: translateX(24px); } }

/* Theme switch crossfade (View Transitions API, progressive) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--bt-dur-slow); animation-timing-function: var(--bt-ease-std); }

@media (prefers-reduced-motion: reduce) {
  .bt-led--live, .bt-skel { animation: none; }
  .bt-btn:active { transform: none; }
}

/* ==========================================================================
   "Launch" layer — overrides and additions on top of the base components
   ========================================================================== */

body {
  background-image: var(--bt-mesh);
  background-attachment: fixed;
  background-size: auto;
}

/* Glass panels with a hover lift (opt in with .bt-panel--lift for interactive cards) */
.bt-panel {
  backdrop-filter: blur(var(--bt-glass-blur)); -webkit-backdrop-filter: blur(var(--bt-glass-blur));
  box-shadow: var(--bt-shadow-2);
  transition: transform var(--bt-dur-base) var(--bt-ease-out), box-shadow var(--bt-dur-base) var(--bt-ease-out), border-color var(--bt-dur-base);
}
.bt-panel--lift:hover { transform: translateY(-3px); box-shadow: var(--bt-shadow-lift); border-color: var(--bt-line-strong); }
.bt-panel--ticked::before, .bt-panel--ticked::after { display: none; }
.bt-panel--glow { position: relative; }
.bt-panel--glow::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; z-index: 0;
  background: linear-gradient(135deg, rgba(107,145,255,.45), transparent 35%, transparent 65%, rgba(20,184,166,.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; padding: 1px;
}

/* Buttons: pill, gradient primary, gold save */
.bt-btn { border-radius: var(--bt-radius-pill); padding: 0 var(--bt-space-5); font-weight: 700; letter-spacing: 0; }
.bt-btn--icon { padding: 0; }
.bt-btn:hover { transform: translateY(-1px); }
.bt-btn:active { transform: translateY(0) scale(.97); }
.bt-btn--primary { background: var(--bt-accent-grad); border-color: transparent; box-shadow: 0 8px 24px rgba(79,124,255,.35), 0 1px 0 rgba(255,255,255,.25) inset; }
.bt-btn--primary:hover { background: var(--bt-accent-grad); box-shadow: var(--bt-accent-glow), 0 1px 0 rgba(255,255,255,.3) inset; filter: brightness(1.06); }

.bt-btn--save {
  position: relative; overflow: hidden; isolation: isolate;
  --_bg: var(--bt-gold-grad); --_fg: var(--bt-gold-text-on); --_bd: transparent;
  background: var(--bt-gold-grad); color: var(--bt-gold-text-on);
  box-shadow: var(--bt-gold-glow), 0 1px 0 rgba(255,255,255,.55) inset, 0 -2px 0 rgba(0,0,0,.12) inset;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.bt-btn--save::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.75) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: bt-shine var(--bt-dur-shine) var(--bt-ease-std) infinite;
}
.bt-btn--save:hover { box-shadow: var(--bt-gold-glow-hover), 0 1px 0 rgba(255,255,255,.6) inset; filter: brightness(1.04); }
.bt-btn--save:hover::before { animation-duration: 900ms; }
.bt-btn--save[disabled] { animation: none; box-shadow: none; filter: saturate(.4); }
.bt-btn--save[disabled]::before { animation: none; }
.bt-btn--save.is-loading::after { border-color: var(--bt-gold-text-on); border-right-color: transparent; }

/* Inputs: softer, glow on focus */
.bt-input, .bt-select, .bt-textarea { border-radius: var(--bt-radius-sm); background: color-mix(in srgb, var(--bt-raised) 70%, transparent); }
.bt-input:focus, .bt-select:focus, .bt-textarea:focus { box-shadow: 0 0 0 4px var(--bt-accent-soft), 0 8px 24px rgba(79,124,255,.18); }
.bt-switch__track::after { box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.bt-switch input:checked + .bt-switch__track { background: var(--bt-accent-grad); box-shadow: 0 4px 14px rgba(79,124,255,.45); }
.bt-switch input:checked + .bt-switch__track::after { background: #fff; }
.bt-check { border-radius: var(--bt-radius-sm); }
.bt-check__box { border-radius: 8px; }
.bt-check:has(input:checked) { box-shadow: 0 8px 24px rgba(52,211,153,.18); }

/* Status: pills */
.bt-badge { border-radius: var(--bt-radius-pill); height: 26px; padding: 0 10px; }
.bt-badge--blocked { border-radius: var(--bt-radius-pill); padding: 0 3px; }
.bt-badge--blocked > span { border-radius: var(--bt-radius-pill); height: 20px; padding: 0 8px; }
.bt-led { width: 9px; height: 9px; }

/* KPI: gradient numerals, glow on change */
.bt-kpi__value {
  font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--bt-text) 30%, var(--bt-accent-text) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bt-kpi__unit { -webkit-text-fill-color: var(--bt-text-muted); }
.bt-kpi__value.bt-flash { animation: bt-flash-glow var(--bt-dur-flash) var(--bt-ease-out); }
@keyframes bt-flash-glow { 0% { filter: drop-shadow(0 0 18px rgba(107,145,255,.9)); } 100% { filter: drop-shadow(0 0 0 transparent); } }
.bt-meter { height: 8px; border-radius: 4px; }
.bt-meter > i { background: var(--bt-accent-grad); box-shadow: 0 0 12px rgba(79,124,255,.5); }
.bt-meter--pass > i { background: linear-gradient(90deg, #6EE7B7, var(--bt-pass)); box-shadow: 0 0 12px rgba(52,211,153,.5); }
.bt-meter--warn > i { background: linear-gradient(90deg, #FDE68A, var(--bt-warn)); box-shadow: 0 0 12px rgba(251,191,36,.5); }

/* Table */
.bt-table-wrap { border-radius: var(--bt-radius-md); backdrop-filter: blur(var(--bt-glass-blur)); box-shadow: var(--bt-shadow-2); }
.bt-table th { background: color-mix(in srgb, var(--bt-raised) 60%, transparent); backdrop-filter: blur(8px); }
.bt-table tbody tr:hover { background: var(--bt-accent-soft); }
.bt-table tbody tr.is-selected { background: var(--bt-accent-soft); box-shadow: inset 4px 0 0 var(--bt-accent), 0 0 24px rgba(79,124,255,.2); }

/* Tabs: pill segment instead of underline */
.bt-tabs { border-bottom: 0; background: color-mix(in srgb, var(--bt-raised) 55%, transparent); padding: 4px; border-radius: var(--bt-radius-pill); border: 1px solid var(--bt-line); }
.bt-tab { border-radius: var(--bt-radius-pill); min-height: 36px; position: relative; z-index: 1; }
.bt-tabs__ink { top: 4px; bottom: 4px; height: auto; border-radius: var(--bt-radius-pill); background: var(--bt-accent-grad); box-shadow: 0 6px 18px rgba(79,124,255,.4); transition: transform var(--bt-dur-base) var(--bt-ease-snap), width var(--bt-dur-base) var(--bt-ease-out); }
.bt-tab[aria-selected="true"] { color: #fff; }

/* Overlays */
.bt-scrim { backdrop-filter: blur(10px) saturate(1.2); }
.bt-modal { border-radius: var(--bt-radius-lg); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); transform: translate(-50%, -46%) scale(.94); }
.bt-modal.is-open { transition-timing-function: var(--bt-ease-snap); }
.bt-drawer { border-radius: var(--bt-radius-lg) 0 0 var(--bt-radius-lg); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.bt-toast { border-radius: var(--bt-radius-md); border-left-width: 1px; backdrop-filter: blur(16px); box-shadow: var(--bt-shadow-2), 0 0 0 1px var(--bt-line); padding: var(--bt-space-4) var(--bt-space-5); }
.bt-toast .bt-led { box-shadow: var(--bt-led-pass); }
.bt-toast--fail .bt-led { box-shadow: var(--bt-led-fail); }
.bt-toast--warn .bt-led { box-shadow: var(--bt-led-warn); }
@keyframes bt-toast-in { from { opacity: 0; transform: translateY(20px) scale(.94); } to { opacity: 1; transform: none; } }
.bt-toast { animation-timing-function: var(--bt-ease-snap); }

.bt-drop { border-radius: var(--bt-radius-md); }
.bt-drop:hover, .bt-drop.is-over { box-shadow: 0 0 0 4px var(--bt-accent-soft); }
.bt-skel { border-radius: var(--bt-radius-sm); }

/* Entrance: more travel, springier */
.bt-enter .bt-enter__item { animation-timing-function: var(--bt-ease-out); }
@keyframes bt-shine { 0% { transform: translateX(-120%); } 45%, 100% { transform: translateX(120%); } }

@media (prefers-reduced-motion: reduce) {
  .bt-btn--save::before { animation: none; }
  .bt-panel--lift:hover, .bt-btn:hover { transform: none; }
}
