/* ══════════════════════════════════════════════════════════════════
   InfraDesk × Birad Design System — token layer + "bd-" component layer
   ══════════════════════════════════════════════════════════════════

   WHAT THIS FILE IS
   ------------------
   The production token + component layer converted from
   BiradDesignSystem.md / BiradDesignSystemPreview.html into something
   InfraDesk (PHP 8+, MySQL, Tailwind CDN, no build step) can load
   directly, today, without breaking any of the ~30 existing pages.

   NAMESPACE RULE (read this before adding a class)
   --------------------------------------------------
   Every component class in this file is prefixed `bd-` (Birad Design).
   InfraDesk's legacy stylesheet (modern-dashboard.css + the inline
   <style> in header.php) already owns the UNPREFIXED names .btn,
   .card, .badge, .input, .table etc. with a completely different,
   hardcoded-hex, dark-only implementation. Reusing those bare names
   here would silently reskin every existing page the moment this file
   is linked. Using `bd-` instead means this file is purely ADDITIVE —
   it can be <link>ed site-wide immediately, and pages migrate to the
   `bd-*` classes one at a time, on purpose, whenever they're touched.

   The custom-property TOKENS themselves (--background, --primary,
   --border, etc.) are intentionally left UNPREFIXED, exactly as named
   in BiradDesignSystem.md §3, because nothing in InfraDesk currently
   defines a variable with those names (the legacy system uses --md-*
   exclusively) — see the compatibility bridge at the bottom of this
   token block, which points the legacy --md-* names at these new
   tokens so the two systems share one source of truth going forward
   instead of drifting apart.

   See docs/design-system/InfraDeskDesignSystem.md for the full guide,
   docs/design-system/COMPONENT_MAPPING.md for the Birad → InfraDesk
   component/class mapping, and docs/design-system/preview.html for a
   live, browsable reference of every class below.
   ══════════════════════════════════════════════════════════════════ */

/* Scoped box-sizing reset — every bd-* component below sizes padding/
   border and width:100% together. Without this, a field like .bd-input
   (width:100%, padding:0 12px, border:1px) renders ~26px WIDER than its
   parent and overflows the card/container. Scoped to [class*="bd-"]
   instead of a global `*` reset, per the additive/namespace rule above. */
[class*="bd-"]{ box-sizing: border-box; }

/* ────────────────────────────────────────────────────────────────
   1. DESIGN TOKENS — transcribed from BiradDesignSystem.md §3
   Light = :root, Dark = .dark (InfraDesk boots with class="dark" on
   <html>, matching Birad's own documented default).
   ──────────────────────────────────────────────────────────────── */
:root{
  --background: oklch(0.982 0.004 297.7);
  --foreground: oklch(0.265 0.072 287.3);

  --surface: oklch(0.966 0.005 297.7);
  --surface-foreground: oklch(0.265 0.072 287.3);

  --elevated: oklch(1 0 0);

  --card: oklch(1 0 0);
  --card-foreground: oklch(0.265 0.072 287.3);

  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.265 0.072 287.3);

  --primary: oklch(0.516 0.13 291);
  --primary-foreground: oklch(0.985 0.004 297.7);

  --secondary: oklch(0.945 0.012 293);
  --secondary-foreground: oklch(0.34 0.085 288);

  --muted: oklch(0.949 0.008 295);
  --muted-foreground: oklch(0.51 0.038 288);

  --accent: oklch(0.62 0.098 208);
  --accent-foreground: oklch(0.985 0.004 297.7);

  --destructive: oklch(0.55 0.212 21);
  --destructive-foreground: oklch(0.985 0.004 297.7);

  --success: oklch(0.55 0.12 168);
  --success-foreground: oklch(0.985 0.004 297.7);

  --warning: oklch(0.62 0.14 68);
  --warning-foreground: oklch(0.185 0.04 68);

  --info: oklch(0.62 0.098 208);
  --info-foreground: oklch(0.985 0.004 297.7);

  --border: oklch(0.905 0.014 293);
  --border-strong: oklch(0.83 0.026 291);
  --input: oklch(0.905 0.014 293);
  --ring: oklch(0.62 0.098 208);

  /* chart colors — indigo -> lavender -> cyan (light) */
  --chart-1: oklch(0.516 0.13 291);
  --chart-2: oklch(0.62 0.098 208);
  --chart-3: oklch(0.62 0.14 68);
  --chart-4: oklch(0.55 0.12 168);
  --chart-5: oklch(0.42 0.09 289);

  /* radius scale — base 14px */
  --radius: 0.875rem;
  --radius-sm: calc(var(--radius) - 6px);
  --radius-md: calc(var(--radius) - 3px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);
  --radius-3xl: calc(var(--radius) + 12px);
  --radius-4xl: calc(var(--radius) + 16px);

  /* glossy-tech effect tokens (light) */
  --glass-bg: oklch(1 0 0 / 62%);
  --glass-border: oklch(1 0 0 / 40%);
  --glass-blur: 14px;
  --gradient-primary: linear-gradient(135deg, oklch(0.516 0.13 291), oklch(0.62 0.098 208));
  --gradient-surface: linear-gradient(to bottom, oklch(1 0 0 / 55%), oklch(1 0 0 / 25%));
  --gradient-edge: linear-gradient(90deg, transparent, oklch(0.985 0.004 297.7 / 70%), transparent);
  --glow-primary: 0 0 0 4px oklch(0.516 0.13 291 / 22%);
  --glow-accent: 0 0 0 4px oklch(0.62 0.098 208 / 24%);
  --shadow-elevated: 0 20px 45px -20px oklch(0.265 0.072 287.3 / 22%), 0 2px 8px oklch(0.265 0.072 287.3 / 6%);
  --shadow-glow: 0 8px 30px -6px oklch(0.516 0.13 291 / 35%);

  --font-display: 'Jost', ui-sans-serif, system-ui, sans-serif;
  --font-sans: 'Jost', ui-sans-serif, system-ui, sans-serif;
}

.dark{
  --background: oklch(0.169 0.037 289.5);
  --foreground: oklch(0.966 0.005 297.7);

  --surface: oklch(0.218 0.052 289.9);
  --surface-foreground: oklch(0.966 0.005 297.7);

  --elevated: oklch(0.265 0.072 287.3);

  --card: oklch(0.245 0.062 288);
  --card-foreground: oklch(0.966 0.005 297.7);

  --popover: oklch(0.245 0.062 288);
  --popover-foreground: oklch(0.966 0.005 297.7);

  --primary: oklch(0.579 0.1 292.7);
  --primary-foreground: oklch(0.985 0.004 297.7);

  --secondary: oklch(0.308 0.083 287.1);
  --secondary-foreground: oklch(0.966 0.005 297.7);

  --muted: oklch(0.288 0.07 288);
  --muted-foreground: oklch(0.72 0.03 293);

  --accent: oklch(0.764 0.093 207.9);
  --accent-foreground: oklch(0.169 0.037 289.5);

  --destructive: oklch(0.65 0.19 22);
  --destructive-foreground: oklch(0.985 0.004 297.7);

  --success: oklch(0.75 0.13 168);
  --success-foreground: oklch(0.169 0.037 289.5);

  --warning: oklch(0.8 0.14 78);
  --warning-foreground: oklch(0.185 0.04 68);

  --info: oklch(0.764 0.093 207.9);
  --info-foreground: oklch(0.169 0.037 289.5);

  --border: oklch(0.966 0.005 297.7 / 12%);
  --border-strong: oklch(0.966 0.005 297.7 / 24%);
  --input: oklch(0.966 0.005 297.7 / 12%);
  --ring: oklch(0.764 0.093 207.9);

  --chart-1: oklch(0.579 0.1 292.7);
  --chart-2: oklch(0.764 0.093 207.9);
  --chart-3: oklch(0.8 0.14 78);
  --chart-4: oklch(0.75 0.13 168);
  --chart-5: oklch(0.68 0.09 289);

  --glass-bg: oklch(0.265 0.072 287.3 / 40%);
  --glass-border: oklch(0.966 0.005 297.7 / 14%);
  --gradient-primary: linear-gradient(135deg, oklch(0.579 0.1 292.7), oklch(0.764 0.093 207.9));
  --gradient-surface: linear-gradient(to bottom, oklch(0.966 0.005 297.7 / 8%), oklch(0.966 0.005 297.7 / 2%));
  --gradient-edge: linear-gradient(90deg, transparent, oklch(0.966 0.005 297.7 / 30%), transparent);
  --glow-primary: 0 0 0 4px oklch(0.579 0.1 292.7 / 28%);
  --glow-accent: 0 0 0 4px oklch(0.764 0.093 207.9 / 26%);
  --shadow-elevated: 0 24px 55px -22px oklch(0 0 0 / 55%), 0 2px 10px oklch(0 0 0 / 30%);
  --shadow-glow: 0 10px 34px -6px oklch(0.579 0.1 292.7 / 45%);
}

/* ────────────────────────────────────────────────────────────────
   1b. LEGACY BRIDGE — points the existing --md-* tokens (consumed by
   modern-dashboard.css and header.php's inline critical CSS) at the
   new semantic tokens, so a page can mix legacy .md-* classes and new
   .bd-* classes without two disagreeing color systems on screen at
   once. Intentionally approximate, not exact, for the handful of
   tokens with no 1:1 Birad equivalent (e.g. --md-card is a translucent
   overlay color in the legacy system; --card here is opaque) — see
   docs/design-system/InfraDeskDesignSystem.md "Legacy bridge" for the
   full rationale per token.
   ──────────────────────────────────────────────────────────────── */
.dark{
  --md-bg: var(--background);
  --md-bg-elevated: var(--elevated);
  --md-border: var(--border);
  --md-border-soft: var(--border-strong);
  --md-accent: var(--primary);
  --md-accent-hover: var(--primary);
  --md-purple: var(--primary);
  --md-purple-soft: var(--primary);
  --md-cyan: var(--accent);
  --md-cyan-soft: var(--accent);
  --md-success: var(--success);
  --md-warning: var(--warning);
  --md-danger: var(--destructive);
  --md-info: var(--info);
  --md-text: var(--foreground);
  --md-text-muted: var(--muted-foreground);
  --md-gradient-1: var(--gradient-primary);
  --md-glow-purple: var(--shadow-glow);
  --md-glow-cyan: var(--glow-accent);
}

/* ────────────────────────────────────────────────────────────────
   2. UTILITIES — BiradDesignSystem.md §3.7
   ──────────────────────────────────────────────────────────────── */
.bd-glass{
  background: var(--glass-bg);
  background-image: var(--gradient-surface);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  box-shadow: var(--shadow-elevated);
}
.bd-edge{ position: relative; overflow: hidden; }
.bd-edge::before{
  content:""; position:absolute; top:0; left:0; right:0; height:1px;
  background: var(--gradient-edge);
}
.bd-gradient{ background-image: var(--gradient-primary); }
.bd-gradient-text{
  background-image: var(--gradient-primary);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bd-shadow-elevated{ box-shadow: var(--shadow-elevated); }
.bd-shadow-glow{ box-shadow: var(--shadow-glow); }

/* Focus rings — every interactive .bd-* control below resolves its
   focus state through this one utility, per requirement "fix keyboard
   navigation / focus states" instead of relying on the browser default
   (invisible against dark surfaces) or removing the outline outright. */
.bd-focus{ outline: none; }
.bd-focus:focus-visible{
  outline: none;
  box-shadow: var(--glow-accent);
  border-color: var(--ring);
}

/* Screen-reader-only text — visually hidden, still announced by AT. */
.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* ────────────────────────────────────────────────────────────────
   3. BUTTONS — BiradDesignSystem.md §5.1
   ──────────────────────────────────────────────────────────────── */
.bd-btn{
  font-family: var(--font-sans);
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  height: 40px; padding: 0 16px;
  color: inherit;
  transition: filter .15s ease, transform .1s ease, background-color .15s ease, opacity .15s ease;
  white-space: nowrap;
  text-decoration: none;
}
.bd-btn svg{ width:16px; height:16px; flex-shrink:0; }
.bd-btn:active{ transform: translateY(1px); }
.bd-btn-sm{ height:32px; padding:0 12px; font-size:12.5px; border-radius: var(--radius-md); }
.bd-btn-lg{ height:44px; padding:0 22px; font-size:14.5px; }
.bd-btn-icon{ height:40px; width:40px; padding:0; border-radius: var(--radius-lg); }
.bd-btn-icon.bd-btn-sm{ height:32px; width:32px; }

.bd-btn-default{ background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-glow); }
.bd-btn-default:hover{ filter: brightness(1.08); transform: translateY(-1px); }

.bd-btn-premium{ background-image: var(--gradient-primary); color: var(--primary-foreground); box-shadow: var(--shadow-glow); }
.bd-btn-premium:hover{ filter: brightness(1.12) saturate(1.1); transform: translateY(-1px); }

.bd-btn-secondary{ background: var(--secondary); color: var(--secondary-foreground); }
.bd-btn-secondary:hover{ filter: brightness(1.06); }

.bd-btn-outline{ background: transparent; border-color: var(--border-strong); color: var(--foreground); }
.bd-btn-outline:hover{ background: var(--secondary); }

.bd-btn-glass{ background: var(--glass-bg); background-image: var(--gradient-surface); border-color: var(--glass-border); color: var(--foreground); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.bd-btn-glass:hover{ filter: brightness(1.05); }

.bd-btn-ghost{ background: transparent; color: var(--foreground); }
.bd-btn-ghost:hover{ background: var(--secondary); }

.bd-btn-link{ background: transparent; color: var(--accent); height:auto; padding:0; text-decoration:none; }
.bd-btn-link:hover{ text-decoration: underline; }

.bd-btn-destructive{ background: var(--destructive); color: var(--destructive-foreground); }
.bd-btn-destructive:hover{ filter: brightness(1.08); }

/* Solid accent (cyan) fill — same recipe as bd-btn-default, just built on
   --accent/--accent-foreground instead of --primary/--primary-foreground.
   Added for the Tasks Kanban's per-status primary action (Pause/Resume),
   which needs a second solid brand color beyond lavender — still 100%
   token-driven, no new hex introduced. */
.bd-btn-accent{ background: var(--accent); color: var(--accent-foreground); box-shadow: var(--shadow-glow); }
.bd-btn-accent:hover{ filter: brightness(1.08); transform: translateY(-1px); }

.bd-btn-block{ width:100%; }

.bd-btn:disabled, .bd-btn[aria-disabled="true"]{ opacity:.45; pointer-events:none; }
.bd-spin{ animation: bd-spin 1s linear infinite; }
@keyframes bd-spin{ to{ transform: rotate(360deg); } }

/* ────────────────────────────────────────────────────────────────
   4. FORM CONTROLS — BiradDesignSystem.md §5.2 / §5.3
   ──────────────────────────────────────────────────────────────── */
.bd-field{ display:flex; flex-direction:column; gap:6px; width:100%; }
.bd-label{ font-size:13px; font-weight:500; color: var(--foreground); }
.bd-label.bd-muted{ color: var(--muted-foreground); }
.bd-label.bd-err{ color: var(--destructive); }
.bd-input-wrap{ position:relative; }
.bd-input, .bd-textarea, .bd-select{
  width:100%; font-family: var(--font-sans); font-size: 13.5px;
  background: var(--background); color: var(--foreground);
  border: 1px solid var(--input); border-radius: var(--radius-lg);
  padding: 0 12px; height: 40px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.bd-input:focus-visible, .bd-textarea:focus-visible, .bd-select:focus-visible{ box-shadow: var(--glow-accent); border-color: var(--ring); }
.bd-input.bd-with-icon{ padding-left: 34px; }
.bd-input-wrap svg.bd-leading{ position:absolute; left:11px; top:50%; transform:translateY(-50%); color: var(--muted-foreground); width:15px; height:15px; pointer-events:none; }
.bd-textarea{ height:auto; padding:10px 12px; min-height:76px; resize:vertical; }
.bd-input:disabled, .bd-textarea:disabled, .bd-select:disabled{ opacity:.5; cursor:not-allowed; }
.bd-input.bd-err, .bd-input[aria-invalid="true"]{ border-color: var(--destructive); }
.bd-input.bd-err:focus-visible, .bd-input[aria-invalid="true"]:focus-visible{ box-shadow: 0 0 0 4px color-mix(in oklch, var(--destructive) 20%, transparent); }
.bd-helper{ font-size:12px; color: var(--muted-foreground); }
.bd-helper.bd-err{ color: var(--destructive); }
.bd-select{
  appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat:no-repeat; background-position:right 12px center; padding-right:32px;
}

.bd-check-row, .bd-radio-row, .bd-switch-row{ display:flex; align-items:center; gap:9px; }
/* Real <input type="checkbox"/radio">, visually replaced — never a <div>
   with an onclick handler, so screen readers and keyboards get native
   semantics and Space/Enter toggling for free. */
.bd-checkbox, .bd-radio{
  appearance:none; margin:0; flex:none; cursor:pointer;
  width:18px; height:18px; border:1.5px solid var(--border-strong); background: var(--background);
  display:inline-flex; align-items:center; justify-content:center;
}
.bd-checkbox{ border-radius: var(--radius-sm); }
.bd-radio{ border-radius:50%; }
.bd-checkbox:checked, .bd-radio:checked{ background: var(--primary); border-color: var(--primary); }
.bd-checkbox:disabled, .bd-radio:disabled{ opacity:.45; cursor:not-allowed; }
.bd-checkbox:focus-visible, .bd-radio:focus-visible{ outline:none; box-shadow: var(--glow-accent); }

.bd-switch{ appearance:none; margin:0; cursor:pointer; flex:none;
  width:38px; height:22px; border-radius:999px; background: var(--muted); position:relative; transition: background .15s ease; }
.bd-switch:checked{ background: var(--primary); }
.bd-switch::before{ content:""; position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%; background: var(--card); box-shadow:0 1px 3px rgba(0,0,0,.25); transition: left .15s ease; }
.bd-switch:checked::before{ left:18px; }
.bd-switch:disabled{ opacity:.45; cursor:not-allowed; }
.bd-switch:focus-visible{ outline:none; box-shadow: var(--glow-accent); }

/* ────────────────────────────────────────────────────────────────
   5. BADGES & AVATARS — BiradDesignSystem.md §5.4
   ──────────────────────────────────────────────────────────────── */
.bd-badge{
  display:inline-flex; align-items:center; gap:5px;
  border-radius:999px; font-size:11.5px; font-weight:600;
  padding:3.5px 11px; line-height:1.3; border:1px solid transparent; white-space:nowrap;
}
.bd-badge svg{ width:12px; height:12px; }
.bd-badge-default{ background: var(--primary); color: var(--primary-foreground); }
.bd-badge-premium{ background-image: var(--gradient-primary); color: var(--primary-foreground); }
.bd-badge-secondary{ background: var(--secondary); color: var(--secondary-foreground); }
.bd-badge-accent{ background: var(--accent); color: var(--accent-foreground); }
.bd-badge-success{ background: var(--success); color: var(--success-foreground); }
.bd-badge-warning{ background: var(--warning); color: var(--warning-foreground); }
.bd-badge-info{ background: var(--info); color: var(--info-foreground); }
.bd-badge-destructive{ background: var(--destructive); color: var(--destructive-foreground); }
.bd-badge-outline{ background: transparent; border-color: var(--border-strong); color: var(--foreground); }

.bd-avatar{
  border-radius:50%; display:inline-flex; align-items:center; justify-content:center;
  background-image: var(--gradient-primary); color: var(--primary-foreground);
  font-size:12px; font-weight:600; flex:none; overflow:hidden; border:2px solid var(--background);
}
.bd-avatar-7{ width:28px; height:28px; font-size:10.5px; }
.bd-avatar-10{ width:40px; height:40px; }
.bd-avatar-14{ width:56px; height:56px; font-size:16px; }
.bd-avatar-stack{ display:flex; }
.bd-avatar-stack .bd-avatar{ margin-left:-11px; }
.bd-avatar-stack .bd-avatar:first-child{ margin-left:0; }

/* ────────────────────────────────────────────────────────────────
   6. CARDS — BiradDesignSystem.md §5.7
   ──────────────────────────────────────────────────────────────── */
.bd-card{ border-radius: var(--radius-2xl); padding:22px; display:flex; flex-direction:column; }
.bd-card-default{ background: var(--card); color: var(--card-foreground); border:1px solid var(--border); box-shadow: var(--shadow-elevated); }
.bd-card-premium{ box-shadow: var(--shadow-glow); outline:1px solid color-mix(in oklch, var(--accent) 25%, transparent); }
.bd-card-flat{ background: var(--surface); color: var(--surface-foreground); border:1px solid var(--border); }
.bd-card h3, .bd-card .bd-card-title{ font-size:16px; font-weight:600; display:flex; align-items:center; gap:8px; margin:0 0 6px; }
.bd-card .bd-card-desc{ font-size:13px; color: var(--muted-foreground); margin:0 0 16px; }
.bd-card .bd-card-content{ font-size:13.5px; flex:1; }
.bd-card .bd-card-foot{ margin-top:16px; }

/* ────────────────────────────────────────────────────────────────
   7. ALERTS & PROGRESS — BiradDesignSystem.md §5.9
   ──────────────────────────────────────────────────────────────── */
.bd-alert{ display:flex; gap:12px; padding:14px 16px; border-radius: var(--radius-lg); border:1px solid var(--border); font-size:13px; }
.bd-alert svg{ width:18px; height:18px; flex:none; margin-top:1px; }
.bd-alert-title{ font-weight:600; font-size:13.5px; margin-bottom:2px; }
.bd-alert-default{ background: var(--card); border-color: var(--border); }
.bd-alert-destructive{ background: color-mix(in oklch, var(--destructive) 10%, var(--background)); border-color: color-mix(in oklch, var(--destructive) 40%, transparent); color: var(--destructive); }
.bd-alert-info{ background: color-mix(in oklch, var(--info) 10%, var(--background)); border-color: color-mix(in oklch, var(--info) 40%, transparent); }
.bd-alert-success{ background: color-mix(in oklch, var(--success) 10%, var(--background)); border-color: color-mix(in oklch, var(--success) 40%, transparent); }
.bd-alert-warning{ background: color-mix(in oklch, var(--warning) 12%, var(--background)); border-color: color-mix(in oklch, var(--warning) 40%, transparent); }
.bd-alert-info svg{ color: var(--info); } .bd-alert-success svg{ color: var(--success); } .bd-alert-warning svg{ color: var(--warning); } .bd-alert-destructive svg{ color: var(--destructive); }

.bd-progress{ width:100%; height:8px; border-radius:999px; background: var(--muted); overflow:hidden; }
.bd-progress[role="progressbar"]{ /* aria-valuenow/min/max set inline by caller */ }
.bd-progress .bd-progress-fill{ height:100%; background-image: var(--gradient-primary); border-radius:999px; }

.bd-skeleton{ background: var(--muted); border-radius: var(--radius-md); position:relative; overflow:hidden; }
.bd-skeleton::after{ content:""; position:absolute; inset:0; background:linear-gradient(90deg, transparent, color-mix(in oklch, var(--foreground) 8%, transparent), transparent); animation: bd-shimmer 1.6s infinite; }
@keyframes bd-shimmer{ from{ transform:translateX(-100%); } to{ transform:translateX(100%); } }

/* ────────────────────────────────────────────────────────────────
   8. TABS & ACCORDION — BiradDesignSystem.md §5.8
   Tabs use a real <div role="tablist"> / role="tab" / role="tabpanel">
   contract (see UI::tabs() in app/helpers/UI.php) with roving tabindex
   + arrow-key navigation per the WAI-ARIA APG, not click-only <div>s.
   ──────────────────────────────────────────────────────────────── */
.bd-tabs-list{ display:flex; gap:4px; background: var(--muted); border-radius: var(--radius-lg); padding:4px; width:fit-content; }
.bd-tabs-list.bd-stretch{ width:100%; }
.bd-tab{
  padding:8px 18px; border-radius: var(--radius-md); font-size:13px; font-weight:500;
  cursor:pointer; color: var(--muted-foreground); flex:none; text-align:center;
  background:transparent; border:1px solid transparent;
}
.bd-tabs-list.bd-stretch .bd-tab{ flex:1; }
.bd-tab[aria-selected="true"]{ background: var(--card); color: var(--foreground); box-shadow: var(--shadow-elevated); }
.bd-tab:focus-visible{ outline:none; box-shadow: var(--glow-accent); }
.bd-tab-panel{ margin-top:16px; font-size:13.5px; color: var(--muted-foreground); background: var(--card); border:1px solid var(--border); border-radius: var(--radius-lg); padding:16px; }
.bd-tab-panel:focus-visible{ outline:none; box-shadow: var(--glow-accent); }

/* Accordion built on native <details>/<summary> — expand/collapse,
   Enter/Space toggling and screen-reader state come from the browser,
   zero JS required. */
.bd-accordion-item{ border-bottom:1px solid var(--border); }
.bd-accordion-item:last-child{ border-bottom:none; }
.bd-accordion-item > summary{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:16px 4px; cursor:pointer; font-size:14px; font-weight:500; list-style:none;
}
.bd-accordion-item > summary::-webkit-details-marker{ display:none; }
.bd-accordion-item > summary svg{ width:16px; height:16px; color: var(--muted-foreground); transition: transform .2s ease; flex-shrink:0; }
.bd-accordion-item[open] > summary svg{ transform: rotate(180deg); }
.bd-accordion-item > summary:focus-visible{ outline:none; box-shadow: var(--glow-accent); border-radius: var(--radius-sm); }
.bd-accordion-body{ padding:0 4px 16px; font-size:13.5px; color: var(--muted-foreground); }

/* ────────────────────────────────────────────────────────────────
   9. DROPDOWN MENU & SELECT TRIGGER — BiradDesignSystem.md §5.5
   Built on native <details>/<summary> too: summary is the trigger
   (native button semantics + Enter/Space/click), the menu itself gets
   role="menu"/role="menuitem" so assistive tech announces it as a
   menu, and arrow-key roving is added by the small helper script in
   docs/design-system/preview.html (progressive enhancement — the menu
   is fully open/closable and clickable without any JS at all).
   ──────────────────────────────────────────────────────────────── */
.bd-menu-wrap{ position:relative; display:inline-block; }
.bd-menu-wrap > summary{ list-style:none; cursor:pointer; }
.bd-menu-wrap > summary::-webkit-details-marker{ display:none; }
.bd-menu-wrap > summary:focus-visible{ outline:none; box-shadow: var(--glow-accent); border-radius: var(--radius-lg); }
.bd-menu{
  position:absolute; top:calc(100% + 6px); left:0; z-index:50;
  width:220px; border-radius: var(--radius-lg); background: var(--popover);
  border:1px solid var(--border); box-shadow: var(--shadow-elevated); padding:6px; font-size:13px;
}
.bd-menu-label{ font-size:11px; text-transform:uppercase; letter-spacing:.06em; color: var(--muted-foreground); padding:6px 10px 4px; }
.bd-menu-sep{ height:1px; background: var(--border); margin:5px 2px; border:none; }
.bd-menu-item{
  display:flex; width:100%; align-items:center; justify-content:space-between; gap:10px;
  padding:8px 10px; border-radius: var(--radius-sm); cursor:pointer;
  background:transparent; border:none; color: var(--foreground); font: inherit; text-align:left;
  text-decoration:none;
}
.bd-menu-item:hover, .bd-menu-item:focus-visible{ background: var(--secondary); outline:none; }
.bd-menu-item.bd-destructive{ color: var(--destructive); }
.bd-menu-item .bd-shortcut{ font-size:11px; color: var(--muted-foreground); }
.bd-menu-item .bd-left{ display:flex; align-items:center; gap:9px; }

.bd-select-trigger{
  width:100%; height:40px; display:flex; align-items:center; justify-content:space-between; gap:8px;
  border:1px solid var(--input); border-radius: var(--radius-lg); background: var(--background);
  padding:0 12px; font-size:13.5px; cursor:pointer; color: var(--foreground); font: inherit;
}
.bd-select-trigger:disabled{ opacity:.5; cursor:not-allowed; }
.bd-select-trigger svg{ width:15px; height:15px; color: var(--muted-foreground); flex-shrink:0; }
.bd-select-trigger:focus-visible{ outline:none; box-shadow: var(--glow-accent); border-color: var(--ring); }

/* ────────────────────────────────────────────────────────────────
   10. DIALOG — BiradDesignSystem.md §5.6
   Built on the native <dialog> element via UI::dialog() so Esc-to-
   close, focus trapping, the ::backdrop, and assistive-tech modal
   semantics all come from the browser instead of hand-rolled JS.
   ──────────────────────────────────────────────────────────────── */
.bd-dialog{
  width:100%; max-width:420px; border-radius: var(--radius-2xl); background: var(--popover);
  color: var(--popover-foreground); border:1px solid var(--border); box-shadow: var(--shadow-elevated);
  padding:22px; margin:auto;
}
.bd-dialog::backdrop{ background: color-mix(in oklch, var(--background) 60%, transparent); backdrop-filter: blur(4px); }
.bd-dialog h2, .bd-dialog .bd-dialog-title{ font-size:16px; font-weight:600; margin:0 0 6px; }
.bd-dialog p, .bd-dialog .bd-dialog-desc{ font-size:13px; color: var(--muted-foreground); margin:0 0 18px; }
.bd-dialog .bd-dialog-foot{ display:flex; justify-content:flex-end; gap:10px; }

/* ────────────────────────────────────────────────────────────────
   11. TOGGLES & SEPARATORS — BiradDesignSystem.md §5.10
   ──────────────────────────────────────────────────────────────── */
.bd-toggle{
  height:36px; padding:0 12px; border-radius: var(--radius-md); display:inline-flex; align-items:center;
  justify-content:center; gap:6px; font-size:13px; cursor:pointer; background:transparent; border:1px solid transparent;
  color: var(--foreground); font: inherit;
}
.bd-toggle.bd-outline{ border-color: var(--border-strong); }
.bd-toggle[aria-pressed="true"]{ background: var(--secondary); }
.bd-toggle:focus-visible{ outline:none; box-shadow: var(--glow-accent); }
.bd-toggle-group{ display:inline-flex; border:1px solid var(--border-strong); border-radius: var(--radius-md); overflow:hidden; }
.bd-toggle-group .bd-toggle{ border-radius:0; border:none; border-right:1px solid var(--border-strong); }
.bd-toggle-group .bd-toggle:last-child{ border-right:none; }

.bd-sep-h{ height:1px; background: var(--border); width:100%; border:none; }
.bd-sep-v{ width:1px; background: var(--border); height:32px; border:none; }

/* ────────────────────────────────────────────────────────────────
   12. TABLE — BiradDesignSystem.md §5.11
   ──────────────────────────────────────────────────────────────── */
.bd-table-wrap{ border-radius: var(--radius-2xl); overflow:hidden; border:1px solid var(--border); background: var(--card); }
.bd-table-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 20px; flex-wrap:wrap; }
.bd-table-toolbar h2, .bd-table-toolbar .bd-table-title{ font-size:15px; font-weight:600; margin:0; }
.bd-table{ width:100%; border-collapse:collapse; font-size:13px; }
.bd-table th{ text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.05em; color: var(--muted-foreground); font-weight:600; padding:10px 20px; border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.bd-table td{ padding:13px 20px; border-bottom:1px solid var(--border); }
.bd-table tbody tr:last-child td{ border-bottom:none; }
.bd-table tbody tr:hover td{ background: color-mix(in oklch, var(--foreground) 3%, transparent); }
.bd-table .bd-row-actions{ display:flex; justify-content:flex-end; }
.bd-table caption{ text-align:left; padding:16px 20px 0; font-size:12px; color: var(--muted-foreground); }

/* ────────────────────────────────────────────────────────────────
   13. INFRADESK DOMAIN SEMANTICS
   Maps InfraDesk's real vocabulary (issue status/priority, ping
   monitor up/down) onto the token palette via color-mix(), the same
   technique Birad itself uses for tinted alerts — so these badges
   never hardcode a color, they only ever reference a semantic token.
   Use via UI::statusBadge()/UI::priorityBadge()/UI::upDownBadge() in
   app/helpers/UI.php.
   ──────────────────────────────────────────────────────────────── */
.bd-badge-tint{ border:1px solid transparent; background-color: color-mix(in oklch, var(--bd-tint) 16%, var(--background)); border-color: color-mix(in oklch, var(--bd-tint) 38%, transparent); color: var(--bd-tint); }
.bd-tint-primary{ --bd-tint: var(--primary); }
.bd-tint-accent{ --bd-tint: var(--accent); }
.bd-tint-success{ --bd-tint: var(--success); }
.bd-tint-warning{ --bd-tint: var(--warning); }
.bd-tint-destructive{ --bd-tint: var(--destructive); }
.bd-tint-muted{ --bd-tint: var(--muted-foreground); }
