/*
 * operator-portal — Tabler token bridge (Tabler programme B1). ⭐ THE PIÈCE MAÎTRESSE.
 *
 * Direction of the wiring — and this is the whole point:
 *   Tabler's --tblr-* variables  →  CONSUME  →  our semantic tokens (tokens-semantic.css).
 *
 * So the source of truth stays OURS. operator-portal already themes per tenant (wafacash/lanacash)
 * by redefining --color-*/--brand-* — via ThemeController's /theme/{t}.css endpoint and the static
 * tenant/{slug}/theme.css overrides (ThemeModelAdvice resolves the slug from subdomain→realm, JWT
 * fallback). Because every Tabler component reads --tblr-* which here points at --color-*, a tenant
 * override flows into Tabler automatically. ⛔ The reverse — our tokens expressed as var(--tblr-*) —
 * would let Tabler own the palette and kill per-tenant theming; TokenBridgeDirectionGuardTest fails
 * the build on any such reversal.
 *
 * Load order (see login.html + layout/shell.html): tokens-primitive → tokens-semantic →
 * /theme/{t}.css → tabler(.rtl).min.css → THIS → portal.css. This block comes AFTER tabler's own
 * :root defaults (so the cascade makes these overrides win) and BEFORE portal.css (so portal.css
 * component styles stay authoritative for the not-yet-migrated screens — B1 is ⛔ not a big-bang).
 */

:root {
  /* Surface + text */
  --tblr-body-bg:         var(--color-bg);
  --tblr-body-color:      var(--color-text);
  --tblr-border-color:    var(--line);
  --tblr-secondary-color: var(--color-secondary);

  /* Brand accent — the hue is owned by --color-primary (tenant-overridable). The rgb triplet is
   * only used by Tabler for alpha-glows; CSS cannot derive a triplet from a hex custom property, so
   * this mirrors the B3G default #1E84C5 (glows stay B3G-hued even under a tenant theme — a minor
   * cosmetic on shadows only; the solid colour follows the tenant via --tblr-primary above). */
  --tblr-primary:      var(--color-primary);
  --tblr-primary-rgb:  30, 132, 197;
  --tblr-link-color:   var(--color-primary);

  /* Secondary — the base var that the `bg-secondary-lt` badges (RECEIVED_NOT_ROUTED / WITHDRAWN /
   * unknown-status) and secondary buttons read via color-mix. B5 completion: without this the
   * secondary-tinted surfaces kept Tabler's default grey and ignored a tenant's --color-secondary.
   * ⚠️ CSS limit: `text-secondary` uses --tblr-secondary-rgb (a triplet) which cannot be derived from
   * a hex custom property — it keeps Tabler's default; documented in the conversion pattern, ⛔ not
   * bricolé with a fragile per-tenant override. */
  --tblr-secondary:    var(--color-secondary);

  /* Status */
  --tblr-danger:   var(--color-danger);
  --tblr-success:  var(--color-success);
  --tblr-warning:  var(--color-warning);
  --tblr-info:     var(--color-info);

  /* Shape + type */
  --tblr-border-radius:      var(--radius-md);
  --tblr-border-radius-sm:   var(--radius-sm);
  --tblr-border-radius-pill: var(--radius-pill);
  --tblr-font-sans-serif:    var(--font-family);
}

/* Focus ring uses our semantic focus token so keyboard focus is a first-class, themeable state. */
.btn:focus-visible,
.form-control:focus,
.form-select:focus {
  box-shadow: var(--focus-ring);
}
