/* WB Enterprise OS Design Tokens — v17.5.0 (Step 6) */
:root{
  /* Brand */
  --wb-color-primary:var(--wb-primary,#2563eb);
  --wb-color-primary-hover:color-mix(in srgb,var(--wb-color-primary) 84%,#000);
  --wb-color-primary-soft:color-mix(in srgb,var(--wb-color-primary) 10%,#fff);
  --wb-color-secondary:var(--wb-secondary,#4f46e5);
  --wb-color-accent:var(--wb-accent,#06b6d4);

  /* Semantic */
  --wb-color-success:var(--wb-success,#16a34a);
  --wb-color-warning:var(--wb-warning,#f59e0b);
  --wb-color-danger:var(--wb-danger,#dc2626);
  --wb-color-info:#0ea5e9;

  /* Neutral surfaces */
  --wb-color-canvas:var(--wb-background,#f4f7fb);
  --wb-color-surface:var(--wb-surface,#ffffff);
  --wb-color-surface-raised:#ffffff;
  --wb-color-surface-subtle:#f8fafc;
  --wb-color-border:#e4e9f2;
  --wb-color-border-strong:#d0d7e2;
  --wb-color-text:#101828;
  --wb-color-text-muted:#667085;
  --wb-color-text-subtle:#98a2b3;
  --wb-color-inverse:#ffffff;

  /* Typography */
  --wb-font-family:var(--wb-font,Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif);
  --wb-font-size-xs:.6875rem;
  --wb-font-size-sm:.75rem;
  --wb-font-size-md:.875rem;
  --wb-font-size-lg:1rem;
  --wb-font-size-xl:1.25rem;
  --wb-font-size-2xl:1.5rem;
  --wb-font-weight-regular:400;
  --wb-font-weight-medium:500;
  --wb-font-weight-semibold:600;
  --wb-font-weight-bold:700;
  --wb-line-height-tight:1.2;
  --wb-line-height-normal:1.5;

  /* Spacing scale */
  --wb-space-0:0;
  --wb-space-1:4px;
  --wb-space-2:8px;
  --wb-space-3:12px;
  --wb-space-4:16px;
  --wb-space-5:20px;
  --wb-space-6:24px;
  --wb-space-8:32px;
  --wb-space-10:40px;
  --wb-space-12:48px;

  /* Radius */
  --wb-radius-xs:calc(var(--wb-radius,14px) * .42);
  --wb-radius-sm:calc(var(--wb-radius,14px) * .64);
  --wb-radius-md:var(--wb-radius,14px);
  --wb-radius-lg:calc(var(--wb-radius,14px) * 1.28);
  --wb-radius-xl:calc(var(--wb-radius,14px) * 1.64);
  --wb-radius-pill:999px;

  /* Elevation */
  --wb-shadow-xs:0 1px 2px rgba(15,23,42,.05);
  --wb-shadow-sm:0 4px 14px rgba(15,23,42,.06);
  --wb-shadow-md:var(--wb-shadow,0 8px 30px rgba(15,23,42,.07));
  --wb-shadow-lg:0 18px 45px rgba(15,23,42,.13);
  --wb-focus-ring:0 0 0 3px color-mix(in srgb,var(--wb-color-primary) 18%,transparent);

  /* Motion */
  --wb-duration-fast:120ms;
  --wb-duration-normal:180ms;
  --wb-duration-slow:280ms;
  --wb-ease-standard:cubic-bezier(.2,.8,.2,1);
  --wb-ease-emphasized:cubic-bezier(.2,.9,.25,1.15);

  /* Layout */
  --wb-control-height-sm:32px;
  --wb-control-height-md:40px;
  --wb-control-height-lg:48px;
  --wb-content-max:1680px;
  --wb-grid-gap:var(--wb-space-4);
}

body.wb-enterprise-shell{
  --wb-shell-bg:var(--wb-color-canvas);
  --wb-shell-surface:var(--wb-color-surface);
  --wb-shell-text:var(--wb-color-text);
  --wb-shell-muted:var(--wb-color-text-muted);
  --wb-shell-border:var(--wb-color-border);
  --wb-shell-primary:var(--wb-color-primary);
  --wb-shell-primary-soft:var(--wb-color-primary-soft);
  --wb-shell-radius:var(--wb-radius-md);
  --wb-shell-shadow:var(--wb-shadow-md);
  font-family:var(--wb-font-family)!important;
}

/* Token bridge for native RISE components */
body.wb-enterprise-shell .card,
body.wb-enterprise-shell .panel,
body.wb-enterprise-shell .modal-content,
body.wb-enterprise-shell .dropdown-menu{
  border-color:var(--wb-color-border)!important;
  border-radius:var(--wb-radius-md)!important;
  background:var(--wb-color-surface)!important;
  box-shadow:var(--wb-shadow-md)!important;
}
body.wb-enterprise-shell .btn{
  min-height:var(--wb-control-height-md);
  border-radius:var(--wb-radius-sm)!important;
  transition:background var(--wb-duration-normal) var(--wb-ease-standard),border-color var(--wb-duration-normal) var(--wb-ease-standard),transform var(--wb-duration-fast) var(--wb-ease-standard)!important;
}
body.wb-enterprise-shell .btn-primary{
  background:var(--wb-color-primary)!important;
  border-color:var(--wb-color-primary)!important;
  color:var(--wb-color-inverse)!important;
}
body.wb-enterprise-shell .btn-primary:hover{background:var(--wb-color-primary-hover)!important;border-color:var(--wb-color-primary-hover)!important;transform:translateY(-1px)}
body.wb-enterprise-shell .form-control,
body.wb-enterprise-shell input,
body.wb-enterprise-shell select,
body.wb-enterprise-shell textarea{
  border-color:var(--wb-color-border-strong)!important;
  border-radius:var(--wb-radius-sm)!important;
}
body.wb-enterprise-shell .form-control:focus,
body.wb-enterprise-shell input:focus,
body.wb-enterprise-shell select:focus,
body.wb-enterprise-shell textarea:focus{
  border-color:var(--wb-color-primary)!important;
  box-shadow:var(--wb-focus-ring)!important;
}
body.wb-enterprise-shell .text-muted{color:var(--wb-color-text-muted)!important}
body.wb-enterprise-shell a{transition:color var(--wb-duration-fast) var(--wb-ease-standard)}

/* Density tokens */
body.wb-enterprise-shell[data-wb-density="compact"]{
  --wb-control-height-sm:28px;--wb-control-height-md:34px;--wb-control-height-lg:42px;
  --wb-grid-gap:var(--wb-space-3);
}
body.wb-enterprise-shell[data-wb-density="comfortable"]{
  --wb-control-height-sm:32px;--wb-control-height-md:40px;--wb-control-height-lg:48px;
  --wb-grid-gap:var(--wb-space-4);
}
body.wb-enterprise-shell[data-wb-density="spacious"]{
  --wb-control-height-sm:36px;--wb-control-height-md:46px;--wb-control-height-lg:54px;
  --wb-grid-gap:var(--wb-space-6);
}

/* Dark semantic remapping */
body.wb-enterprise-shell.wb-shell-night{
  --wb-color-canvas:#0b1320;
  --wb-color-surface:#111c2d;
  --wb-color-surface-raised:#17243a;
  --wb-color-surface-subtle:#121d2f;
  --wb-color-border:#27364c;
  --wb-color-border-strong:#354861;
  --wb-color-text:#edf4ff;
  --wb-color-text-muted:#a6b5c9;
  --wb-color-text-subtle:#7f91aa;
  --wb-color-primary-soft:color-mix(in srgb,var(--wb-color-primary) 22%,#111c2d);
  --wb-shadow-xs:0 1px 2px rgba(0,0,0,.22);
  --wb-shadow-sm:0 5px 18px rgba(0,0,0,.22);
  --wb-shadow-md:0 12px 34px rgba(0,0,0,.28);
  --wb-shadow-lg:0 24px 60px rgba(0,0,0,.36);
}

/* Plugin author utility API */
.wb-surface{background:var(--wb-color-surface);border:1px solid var(--wb-color-border);border-radius:var(--wb-radius-md);box-shadow:var(--wb-shadow-sm)}
.wb-stack{display:flex;flex-direction:column;gap:var(--wb-space-4)}
.wb-cluster{display:flex;align-items:center;flex-wrap:wrap;gap:var(--wb-space-3)}
.wb-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:var(--wb-grid-gap)}
.wb-text-muted{color:var(--wb-color-text-muted)}
.wb-token-primary{color:var(--wb-color-primary)}
.wb-bg-primary-soft{background:var(--wb-color-primary-soft)}

@media (prefers-reduced-motion:reduce){
  :root{--wb-duration-fast:1ms;--wb-duration-normal:1ms;--wb-duration-slow:1ms}
}
