/*
 * Wanda Workspace Design System
 * Minimal, authoritative, clean — inspired by Anthropic / OpenAI
 * Use w-* classes across all authenticated workspace pages.
 */

/* ── L8: Typography Tokens ───────────────────────────────────── */
:root {
  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --font-serif:   'Source Serif 4', Georgia, serif;
  --font-mono:    'DM Mono', 'SFMono-Regular', Menlo, monospace;
}

/* Utility classes */
.font-serif  { font-family: var(--font-serif) !important; }
.font-mono   { font-family: var(--font-mono)  !important; }
.font-sans   { font-family: var(--font-sans)  !important; }

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --w-brand:        #0e8675;
  --w-brand-dark:   #0a6a5d;
  --w-brand-light:  #def5f1;
  --w-action:       #0e8675;
  --w-action-dark:  #0a6a5d;
  --w-bg:           hsl(38, 18%, 95%);    /* warm parchment */
  --w-bg-subtle:    hsl(38, 14%, 92%);   /* deeper parchment */
  --w-border:       hsl(38, 15%, 88%);
  --w-text:         #0e1a26;
  --w-muted:        hsl(30, 8%, 48%);
  --w-nav-hover:    hsl(38, 12%, 91%);
  --w-nav-active:   hsl(38, 12%, 88%);
  --w-nav-active-border: var(--w-brand);
  --w-sidebar-w:    260px;
  --w-sidebar-collapsed-w: 84px;
  --w-radius:       8px;
  --w-radius-sm:    6px;

  /* ── Semantic state tokens ──────────────────────────────────── */
  --w-danger:              hsl(0, 72%, 55%);
  --w-danger-dark:         hsl(0, 72%, 40%);
  --w-danger-light:        hsl(0, 70%, 95%);
  --w-danger-border:       hsl(0, 70%, 80%);
  --w-danger-text:         hsl(0, 72%, 28%);

  --w-status-error-bg:     hsl(0, 70%, 97%);
  --w-status-error-border: hsl(0, 70%, 80%);
  --w-status-error-text:   hsl(0, 72%, 28%);

  --w-status-success-bg:     hsl(142, 70%, 95%);
  --w-status-success-border: hsl(142, 50%, 68%);
  --w-status-success-text:   hsl(142, 60%, 22%);

  /* ── Remap Connexus design-system.css variables to Senera teal ── */
  /* design-system.css defines --color-connexus-blue* and --text-link* which
     leak Connexus blue into Senera workspace. Override them at root level. */
  --color-connexus-blue:       #0e8675;
  --color-connexus-blue-dark:  #0a6a5d;
  --color-connexus-blue-light: #3da897;
  --color-connexus-blue-subtle:#def5f1;
  --color-brand-primary:       #0e8675;
  --text-link:                 #0e8675;
  --text-link-hover:           #0a6a5d;
}

/* ── Bootstrap Blue Override — remap to brand teal ───────────── */
.btn-primary,
.btn-primary:visited {
  background-color: hsl(172,55%,32%) !important;
  border-color: hsl(172,55%,32%) !important;
  color: #fff !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
  background-color: hsl(172,55%,26%) !important;
  border-color: hsl(172,55%,26%) !important;
  color: #fff !important;
}
.btn-link,
.btn-link:visited {
  color: hsl(172,55%,32%) !important;
  text-decoration: none;
}
.btn-link:hover,
.btn-link:focus {
  color: hsl(172,55%,26%) !important;
}
/* ── Global link reset — override Bootstrap blue + design-system.css Connexus blue ── */
/*
 * ROOT CAUSE (3 sources of blue link styling):
 *   1. bootstrap.min.css  → a { color: #0d6efd; text-decoration: underline }
 *   2. design-system.css  → a:not(.btn)... { color: var(--color-connexus-blue) }
 *      plus ::after pseudo-element animated underline on hover
 *   3. design-system.css  → a:hover { color: var(--color-connexus-blue-dark) }
 *
 * Strategy: Override text-decoration and ::after underline globally in workspace.
 *           Override color only on plain links — NOT on styled buttons/nav.
 */
a:not([class]),
a:not([class]):visited,
.text-primary,
.text-info {
  color: var(--w-brand) !important;
}

/* 1. Kill text-decoration: underline from Bootstrap on all workspace links */
.w-shell a,
.w-shell a:link,
.w-shell a:visited,
.w-shell a:hover,
.w-shell a:active,
.workspace-main a,
.workspace-main a:link,
.workspace-main a:visited,
.workspace-main a:hover,
.workspace-main a:active,
.workspace-layout a,
.workspace-layout a:link,
.workspace-layout a:visited,
.workspace-layout a:hover,
.workspace-layout a:active {
  text-decoration: none !important;
}

/* 2. Kill the design-system.css ::after animated underline globally.
 *    Targets body.w-body (WorkspaceLayout) and body.workspace-body (Layout)
 *    to catch modals/overlays that sit outside .w-shell on <body>. */
body.w-body a::after,
body.workspace-body a::after,
.w-shell a::after,
.workspace-main a::after,
.workspace-layout a::after {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* 3. Override Connexus blue on hover — but EXCLUDE buttons with explicit colors.
 *    The :not() selectors prevent overriding styled buttons/CTAs. */
body.w-body a:not([class*="btn"]):not([class*="cta"]):not([class*="primary"]):hover,
body.workspace-body a:not([class*="btn"]):not([class*="cta"]):not([class*="primary"]):hover,
.w-shell a:not([class*="btn"]):not([class*="cta"]):not([class*="primary"]):hover,
.workspace-main a:not([class*="btn"]):not([class*="cta"]):not([class*="primary"]):hover {
  color: var(--w-brand-dark, #0a6a5d);
}
/* Body-level text-decoration kill for modals/overlays outside .w-shell */
body.w-body a,
body.w-body a:hover,
body.workspace-body a,
body.workspace-body a:hover {
  text-decoration: none !important;
}
/* Ensure ALL primary/CTA buttons always have white text */
body.w-body a[class*="primary"],
body.w-body a[class*="primary"]:hover,
body.w-body a[class*="primary"]:visited,
body.w-body a[class*="cta"],
body.w-body a[class*="cta"]:hover {
  color: #fff !important;
}

/* ── Body / Shell ────────────────────────────────────────────── */
.w-body {
  background: var(--w-bg-subtle);
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  letter-spacing: -0.006em;
  color: var(--w-text);
}

.w-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.w-ops-utility {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--w-border);
  border-radius: 999px;
  padding: 6px 8px 6px 12px;
  box-shadow: 0 8px 20px -18px rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(6px);
}

.w-ops-user {
  font-size: 12px;
  color: var(--w-muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Ambient Aura (Dynamic Backgrounds) ──────────────────────── */
@keyframes w-aura-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(10%, -10%) scale(1.1); }
  66% { transform: translate(-5%, 5%) scale(0.9); }
}

.readiness-hero-card {
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.readiness-hero-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(14, 134, 117, 0.08) 0%, transparent 50%);
  animation: w-aura-float 12s infinite linear;
  z-index: -1;
  pointer-events: none;
}

/* ── Liquid Tab Indicator ────────────────────────────────────── */
.soph-tab-container {
  position: relative;
  display: flex;
  gap: 40px;
}

.soph-tab-indicator {
  position: absolute;
  bottom: -2px;
  height: 2px;
  background: var(--w-brand);
  transition: all 0.4s var(--w-spring);
  pointer-events: none;
}

/* ── Ripple Status ───────────────────────────────────────────── */
@keyframes w-ripple {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.bg-green-100 {
  position: relative;
}

.bg-green-100::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  animation: w-ripple 2s infinite;
}

/* ── 3D Card Prep ────────────────────────────────────────────── */
.soph-stat-card, .soph-module-row {
  transform-style: preserve-3d;
  perspective: 1000px;
}
:root {
  --w-ease-out: cubic-bezier(0.16, 1, 0.3, 1); /* Quintic easing */
  --w-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --w-spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy effect */
}

/* Global Reset for Buttons — no underlines, no jiggle */
button:hover,
.w-btn:hover,
a.w-btn:hover,
.w-nav-item:hover,
.soph-tab:hover,
.w-dash-view-all:hover {
  text-decoration: none !important;
}
/* ── Nuclear: kill ALL hover translate/scale jiggle in workspace ── */
/* Buttons, links, cards, tiles — nothing should move on hover. */
/* IMPORTANT: :not([class*="react-flow"]) excludes React Flow nodes    */
/* which rely on transform: translate() for canvas positioning.        */
body.w-body a:hover,
body.w-body button:hover,
body.w-body .w-btn:hover,
body.w-body .w-card:hover,
body.w-body .card:hover,
body.w-body .card-interactive:hover,
body.w-body .hover-lift:hover,
body.w-body [class*="tile"]:not([class*="react-flow"]):hover,
body.w-body [class*="card"]:not([class*="react-flow"]):hover,
body.w-body [class*="btn"]:not([class*="react-flow"]):hover,
body.w-body [class*="module"]:not([class*="react-flow"]):hover,
body.w-body [class*="stat"]:not([class*="react-flow"]):hover,
body.w-body [class*="row"]:not([class*="react-flow"]):hover,
body.workspace-body a:hover,
body.workspace-body button:hover,
body.workspace-body [class*="btn"]:not([class*="react-flow"]):hover,
body.workspace-body [class*="card"]:not([class*="react-flow"]):hover {
  transform: none !important;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* ── Entrance Animations ─────────────────────────────────────── */
@keyframes w-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Card Shine Effect ───────────────────────────────────────── */
@keyframes w-shine {
  from { left: -100%; }
  to { left: 100%; }
}

.soph-stat-card,
.soph-module-row,
.w-card {
  position: relative;
  overflow: hidden;
}

.soph-stat-card::after,
.soph-module-row::after,
.w-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
  transform: skewX(-25deg);
  pointer-events: none;
}

.soph-stat-card:hover::after,
.soph-module-row:hover::after,
.w-card:hover::after {
  animation: w-shine 0.8s var(--w-ease-out);
}

.soph-stat-card,
.soph-module-row {
  animation: w-fade-in-up 0.6s var(--w-ease-out) both;
}

/* Staggered delays for the first 10 items */
.soph-stat-card:nth-child(1) { animation-delay: 0.05s; }
.soph-stat-card:nth-child(2) { animation-delay: 0.10s; }
.soph-stat-card:nth-child(3) { animation-delay: 0.15s; }

.soph-module-row:nth-child(1) { animation-delay: 0.20s; }
.soph-module-row:nth-child(2) { animation-delay: 0.25s; }
.soph-module-row:nth-child(3) { animation-delay: 0.30s; }
.soph-module-row:nth-child(4) { animation-delay: 0.35s; }
.soph-module-row:nth-child(5) { animation-delay: 0.40s; }

/* ── Tactile Feedback ────────────────────────────────────────── */
.soph-module-row, .soph-stat-card {
  transition: transform 0.2s var(--w-ease-out), box-shadow 0.2s var(--w-ease-out), background-color 0.2s var(--w-ease-out);
}

.soph-module-row:active {
  transform: scale(0.995);
}

/* ── Sidebar Motion ──────────────────────────────────────────── */
.w-nav-item .material-symbols-outlined {
  transition: transform 0.3s var(--w-spring);
}

.w-nav-item:hover .material-symbols-outlined {
  /* transform removed — no jiggle */
  color: var(--w-brand);
}

/* ── Progress Bar Animation ───────────────────────────────────── */
@keyframes w-progress-fill {
  from { width: 0%; }
}

.sophisticated-dash .bg-brand {
  animation: w-progress-fill 1.2s var(--w-ease-out) both;
  transform-origin: left;
}
.w-sidebar {
  background: #ffffff;
  border-right: 1px solid #e8ebef;
  padding: 12px 10px 10px;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: var(--w-sidebar-w);
  min-width: var(--w-sidebar-w);
  flex-shrink: 0;
}

.dark .w-sidebar {
  background: #020617;
  border-color: #1e293b;
}

.w-sidebar.collapsed {
  width: var(--w-sidebar-collapsed-w);
  min-width: var(--w-sidebar-collapsed-w);
  padding-left: 10px;
  padding-right: 10px;
}

.w-sidebar-brand {
  padding: 6px 8px 24px 8px;
}

.w-sidebar-brand-card {
  display: block;
  text-decoration: none;
  color: var(--w-text);
}

.w-sidebar-brand-card,
.w-sidebar-brand-card:visited,
.w-sidebar-brand-card:hover,
.w-sidebar-brand-card:focus,
.w-sidebar-brand-card:active {
  color: var(--w-text) !important;
  text-decoration: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  background: none !important;
  opacity: 1 !important;
}

.w-sidebar-brand-mark {
  display: none;
}

.w-sidebar-brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.w-sidebar-brand-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #35524a;
}

.w-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.w-nav-primary,
.w-sidebar-footer-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.w-sidebar-section {
  margin-top: 14px;
}

.w-sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 6px;
}

.w-sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6b7280;
}

.w-sidebar-section-chevron {
  color: #6b7280;
  font-size: 14px;
}

.w-sidebar-section-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.w-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #374151;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  line-height: 1;
}

.w-nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: #2f8f82;
  opacity: 0;
  transform: scaleY(0.55);
  transition: opacity 180ms ease, transform 220ms ease;
}

.w-nav-item:hover {
  background: #f5f6f7;
  border-color: #eceff2;
  color: #111827 !important;
  transform: none;
  text-decoration: none;
  box-shadow: none;
}

.w-nav-item.active {
  background: #eceff3;
  color: #111827 !important;
  border-color: #e2e7ec;
  box-shadow: none;
}

.w-nav-item.active:hover {
  background: #eceff3;
  color: #111827 !important;
}

.w-nav-item.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.w-nav-item i {
  font-size: 18px;
  width: 20px;
  flex-shrink: 0;
  color: currentColor;
  transition: color 180ms ease, transform 180ms ease;
  opacity: 0.9;
}

.w-nav-item span {
  color: currentColor;
  transition: transform 180ms ease;
}

.w-nav-item:hover i,
.w-nav-item:hover span,
.w-nav-item:focus-visible i,
.w-nav-item:focus-visible span {
  transform: none;
}

.w-sidebar.collapsed .w-nav-item {
  justify-content: center;
  font-size: 0;
  padding: 9px 8px;
}

.w-sidebar.collapsed .w-nav-item i {
  margin: 0;
  width: auto;
  font-size: 17px;
}

.w-sidebar.collapsed .w-nav-item span,
.w-sidebar.collapsed .w-sidebar-brand-copy,
.w-sidebar.collapsed .w-sidebar-section-head,
.w-sidebar.collapsed .w-sidebar-user-email,
.w-sidebar.collapsed .w-sidebar-signout span {
  display: none;
}

.w-sidebar.collapsed .w-sidebar-brand,
.w-sidebar.collapsed .w-sidebar-footer {
  align-items: center;
}

.w-sidebar.collapsed .w-sidebar-brand-card {
  justify-content: center;
}

/* Logo swap: full logo ↔ icon logo on collapse */
.senera-logo-icon { display: none; }
.w-sidebar.collapsed .senera-logo-full { display: none; }
.w-sidebar.collapsed .senera-logo-icon {
  display: block;
  height: 32px;
  width: 32px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.w-nav-divider {
  border: none;
  border-top: 1px solid var(--w-border);
  margin: 10px 0;
}

.w-sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #e7eaee;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.w-nav-item-logout {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.w-nav-item,
.w-nav-item:visited,
.w-nav-item:hover,
.w-nav-item:focus,
.w-nav-item:active {
  text-decoration: none !important;
  color: #374151 !important;
}

/* ── Shell header bar ────────────────────────────────────────── */
.w-shell-header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 12px;
  border-bottom: 1px solid var(--w-border);
  background: var(--w-bg);
  flex-shrink: 0;
  gap: 20px;
}

.w-shell-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  flex: 0 0 auto;
}

/* Header toggle: hidden by default, shown when sidebar is collapsed */
.w-header-sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--w-border);
  color: var(--w-muted);
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 15px;
  transition: color 0.15s, border-color 0.15s;
}
.w-header-sidebar-toggle:hover {
  color: var(--w-text);
  border-color: var(--w-text);
}
.w-shell-sidebar-collapsed .w-header-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.w-shell-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.w-shell-header-center {
  flex: 1;
  min-width: 240px;
  display: flex;
  justify-content: center;
}

.w-sidebar-toggle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--w-border);
  border-radius: 10px;
  background: #fff;
  color: var(--w-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.w-sidebar-toggle:hover {
  border-color: #c8d3dd;
  color: var(--w-text);
  background: var(--w-bg-subtle);
}

.w-shell-header-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--w-text);
}

.w-shell-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.w-header-credit-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: #f6faf9;
  border: 1px solid var(--w-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--w-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, text-decoration 0.15s;
  text-decoration: none;
}
.w-header-credit-chip:hover {
  border-color: var(--w-brand);
  color: var(--w-brand);
  text-decoration: none;
}
.w-header-credit-suffix { opacity: 0.6; font-size: 11px; }
.w-header-credit-chip.low  { color: #f59e0b; border-color: #fde68a; }
.w-header-credit-chip.exhausted { color: #ef4444; border-color: #fca5a5; }

.w-header-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--w-border);
  border-radius: 12px;
  background: #fff;
  color: var(--w-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.w-header-bell:hover {
  background: var(--w-nav-hover);
  color: var(--w-text);
  border-color: var(--w-brand);
}
.w-header-bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 15px;
  height: 15px;
  background: #dc2626;
  color: #fff;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1.5px solid var(--w-bg);
}

.w-shell-header-divider {
  width: 1px;
  height: 32px;
  background: var(--w-border);
}

.w-header-profile-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.w-header-signout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--w-border);
  border-radius: 8px;
  background: transparent;
  color: var(--w-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.w-header-signout:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.w-header-profile {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--w-text);
}

.w-header-profile,
.w-header-profile:visited,
.w-header-profile:hover,
.w-header-profile:focus,
.w-header-profile:active {
  color: var(--w-text) !important;
  text-decoration: none !important;
}

.w-header-profile-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.w-header-profile-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
}

.w-header-profile-role {
  font-size: 12px;
  color: var(--w-muted);
  line-height: 1.1;
}

.w-header-profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #efe2d1 0%, #d5b89f 100%);
  border: 2px solid #fff;
  box-shadow: 0 8px 18px -16px rgba(17, 24, 39, 0.75);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.w-header-search {
  width: min(600px, 100%);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border: 1px solid var(--w-border);
  border-radius: 12px;
  background: #f2f4f7;
  color: var(--w-muted);
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.w-header-search:hover {
  border-color: #cfd6df;
  background: #eceff4;
  color: var(--w-text);
}

.w-header-search-label {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.w-header-search-kbd {
  border: 1px solid #d7dce4;
  border-bottom-width: 2px;
  border-radius: 8px;
  background: #fff;
  padding: 3px 8px;
  font-size: 11px;
  font-family: var(--font-sans);
  color: #6b7280;
}

.w-main-content {
  flex: 1;
  padding: 16px 22px 22px;
}

/* ── Main content ────────────────────────────────────────────── */
.w-main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background:
    url("data:image/svg+xml,%3Csvg width='600' height='600' viewBox='0 0 600 600' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23c4b89c' stroke-width='0.8' opacity='0.25'%3E%3Cellipse cx='300' cy='300' rx='280' ry='220'/%3E%3Cellipse cx='300' cy='300' rx='240' ry='180'/%3E%3Cellipse cx='300' cy='300' rx='200' ry='145'/%3E%3Cellipse cx='300' cy='300' rx='160' ry='110'/%3E%3Cellipse cx='300' cy='300' rx='120' ry='80'/%3E%3Cellipse cx='300' cy='300' rx='80' ry='50'/%3E%3Cellipse cx='300' cy='300' rx='40' ry='25'/%3E%3Cellipse cx='150' cy='150' rx='130' ry='100' transform='rotate(-15 150 150)'/%3E%3Cellipse cx='150' cy='150' rx='90' ry='65' transform='rotate(-15 150 150)'/%3E%3Cellipse cx='480' cy='420' rx='110' ry='85' transform='rotate(20 480 420)'/%3E%3Cellipse cx='480' cy='420' rx='70' ry='50' transform='rotate(20 480 420)'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 600px 600px,
    url("data:image/svg+xml,%3Csvg width='400' height='400' viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23b8ad96' stroke-width='0.5' opacity='0.15'%3E%3Cellipse cx='200' cy='200' rx='180' ry='140'/%3E%3Cellipse cx='200' cy='200' rx='140' ry='100'/%3E%3Cellipse cx='200' cy='200' rx='100' ry='65'/%3E%3Cellipse cx='200' cy='200' rx='60' ry='35'/%3E%3C/g%3E%3C/svg%3E") 100px 50px / 400px 400px,
    var(--w-bg-subtle) !important;
}

.w-main-content {
  flex: 1;
  padding: 16px 22px;
}

/* ── Page topbar (title + actions) ───────────────────────────── */
.w-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}
.w-topbar-left { flex: 1; min-width: 0; }
.w-topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.w-page-title {
  font-size: 1.35rem;
  font-weight: 600;
  font-family: var(--font-serif);
  color: var(--w-text);
  margin: 0 0 2px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.w-page-subtitle {
  font-size: 13px;
  color: var(--w-muted);
  margin: 0;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.w-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.w-btn:hover { text-decoration: none; }

.w-btn-primary {
  background: var(--w-brand);
  color: #fff !important;
  box-shadow: 0 2px 8px hsla(172,55%,32%,0.25);
}
.w-btn-primary:hover { background: var(--w-brand-dark); color: #fff !important; box-shadow: 0 4px 14px hsla(172,55%,32%,0.3); }
.w-btn-primary:visited,
.w-btn-primary:focus,
.w-btn-primary:active {
  color: #fff !important;
}

.w-btn-ghost {
  background: #fff;
  color: #374151 !important;
  border: 1px solid #d1d5db;
}
.w-btn-ghost:hover {
  background: #f9fafb;
  color: #111827 !important;
  border-color: #9ca3af;
}
.w-btn-ghost:visited,
.w-btn-ghost:focus,
.w-btn-ghost:active {
  color: #374151 !important;
}

.w-btn-sm { padding: 6px 12px; font-size: 13px; }
.w-btn-lg { padding: 11px 22px; font-size: 15px; }

/* ── Credit / info widget ────────────────────────────────────── */
.w-credit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-sm);
  font-size: 13px;
  color: var(--w-muted);
}

/* ── Stat cards ──────────────────────────────────────────────── */
.w-stats {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.w-stats-4 { grid-template-columns: repeat(4, 1fr); }
.w-stats-3 { grid-template-columns: repeat(3, 1fr); }
.w-stats-2 { grid-template-columns: repeat(2, 1fr); }

.w-stat {
  border: 1px solid var(--w-border);
  border-radius: 12px;
  padding: 18px 20px;
  background: hsl(40,20%,99%);
  box-shadow: 0 1px 3px hsla(210,40%,12%,0.03);
}
.w-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.w-stat-label {
  font-size: 12px;
  color: var(--w-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.w-stat-icon { color: var(--w-muted); font-size: 16px; }
.w-stat-icon.brand  { color: var(--w-brand); }
.w-stat-icon.blue   { color: hsl(172,55%,36%); }
.w-stat-icon.orange { color: #f59e0b; }
.w-stat-icon.red    { color: #ef4444; }

.w-stat-value {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--w-text);
  line-height: 1;
  letter-spacing: -0.02em;
}
.w-stat-value.brand  { color: var(--w-brand); }
.w-stat-value.blue   { color: hsl(172,55%,36%); }
.w-stat-value.orange { color: #f59e0b; }

.w-stat-note {
  font-size: 12px;
  color: var(--w-muted);
  margin-top: 4px;
}

/* ── Cards ───────────────────────────────────────────────────── */
.w-card {
  border: 1px solid var(--w-border);
  border-radius: 10px;
  background: hsl(40,20%,99%);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px hsla(210,40%,12%,0.04), 0 4px 12px hsla(210,40%,12%,0.03);
}
.w-card-subtle {
  background: var(--w-brand-light);
  border-color: hsl(172,55%,85%);
}
.w-card-warn {
  border-left: 3px solid #f59e0b;
}
.w-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--w-text);
  margin: 0 0 5px;
}
.w-card-desc {
  font-size: 13px;
  color: var(--w-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

/* ── Breadcrumb ──────────────────────────────────────────────── */
.w-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--w-muted);
  margin-bottom: 12px;
}
.w-breadcrumb a {
  color: var(--w-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.w-breadcrumb a:hover { color: var(--w-text); }
.w-breadcrumb-sep { opacity: 0.4; }
.w-breadcrumb-current { color: var(--w-text); font-weight: 500; }

/* ── Form label ──────────────────────────────────────────────── */
.w-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--w-brand);
  margin-bottom: 6px;
}

/* ── Form elements ───────────────────────────────────────────── */
.w-textarea {
  width: 100%;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-sm);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--w-text);
  resize: vertical;
  outline: none;
  min-height: 72px;
  font-family: inherit;
  box-sizing: border-box;
  background: var(--w-bg);
}
.w-textarea:focus { border-color: var(--w-brand); }
.w-textarea::placeholder { color: var(--w-muted); }

.w-select-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
}
.w-select {
  padding: 7px 12px;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-sm);
  font-size: 13px;
  color: var(--w-muted);
  background: var(--w-bg);
  cursor: pointer;
  outline: none;
  font-family: inherit;
}
.w-select:focus { border-color: var(--w-brand); }

/* ── List ────────────────────────────────────────────────────── */
.w-list { display: flex; flex-direction: column; }

.w-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--w-border);
  gap: 16px;
  text-decoration: none;
  color: inherit;
}
.w-list-item:last-child { border-bottom: none; }
.w-list-item:hover { background: transparent; }

.w-list-body { flex: 1; min-width: 0; }
.w-list-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--w-text);
  margin: 0 0 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.w-list-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--w-muted);
}
.w-list-arrow { color: var(--w-muted); font-size: 14px; flex-shrink: 0; }

/* ── Confidence widget ───────────────────────────────────────── */
.w-confidence { text-align: right; flex-shrink: 0; }
.w-confidence-label { font-size: 11px; color: var(--w-muted); margin-bottom: 2px; }
.w-confidence-value { font-size: 18px; font-weight: 700; color: var(--w-brand); }

/* ── Badges / chips ──────────────────────────────────────────── */
.w-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  background: var(--w-bg-subtle);
  color: var(--w-muted);
  border: 1px solid var(--w-border);
}

.w-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.w-badge-green  { background: #dcfce7; color: #166534; }
.w-badge-yellow { background: #fef9c3; color: #854d0e; }
.w-badge-blue   { background: hsl(172,55%,92%); color: hsl(172,55%,24%); }
.w-badge-gray   { background: #f3f4f6; color: #4b5563; }
.w-badge-red    { background: #fee2e2; color: #991b1b; }

/* ── Alert banners ───────────────────────────────────────────── */
.w-alert {
  padding: 14px 18px;
  border-radius: var(--w-radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.w-alert-warn    { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-left: 3px solid #f59e0b; }
.w-alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; border-left: 3px solid #22c55e; }

/* ── Legacy trainer pages mapped to Wanda tokens ────────────── */
.trainer-ui {
  max-width: none;
  margin: 0;
  color: var(--w-text);
}

.trainer-topbar {
  border-bottom: 1px solid var(--w-border);
}

.trainer-title {
  color: var(--w-text);
}

.trainer-credit,
.trainer-subtitle,
.trainer-card-caption,
.trainer-stat-label,
.trainer-stat-note {
  color: var(--w-muted);
}

.trainer-btn {
  border: 1px solid var(--w-border);
  background: #fff;
  color: #374151 !important;
  border-radius: var(--w-radius-sm);
  font-weight: 600;
}

.trainer-btn:hover {
  border-color: #9ca3af;
  background: #f8fafc;
  color: #111827 !important;
}

.trainer-btn-dark,
.trainer-btn-primary {
  background: #111827;
  color: #ffffff !important;
  border-color: #111827;
}

.trainer-btn-dark:hover,
.trainer-btn-primary:hover {
  background: #030712;
  border-color: #030712;
  color: #ffffff !important;
}

.trainer-btn-ghost {
  background: #fff;
  color: #374151 !important;
  border-color: #d1d5db;
}

.trainer-btn:visited,
.trainer-btn:focus,
.trainer-btn:active,
.trainer-btn-ghost:visited,
.trainer-btn-ghost:focus,
.trainer-btn-ghost:active {
  color: var(--w-action) !important;
}

.trainer-card,
.trainer-stat,
.trainer-list-item {
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius);
  background: var(--w-bg);
}

.trainer-table th { color: #4b5563; }
.trainer-table td { color: var(--w-text); }

/* ── Section title ───────────────────────────────────────────── */
.w-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--w-text);
  margin: 24px 0 14px;
}

/* ── Table ───────────────────────────────────────────────────── */
.w-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.w-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--w-muted);
  border-bottom: 1px solid var(--w-border);
}
.w-table td {
  padding: 14px 14px;
  border-bottom: 1px solid var(--w-border);
  color: var(--w-text);
  vertical-align: middle;
}
.w-table tr:last-child td { border-bottom: none; }
.w-table tr:hover td { background: var(--w-bg-subtle); }

/* ── Toolbar (search + filter row) ──────────────────────────── */
.w-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.w-input {
  padding: 8px 12px;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-sm);
  font-size: 14px;
  color: var(--w-text);
  outline: none;
  font-family: inherit;
  background: var(--w-bg);
}
.w-input:focus { border-color: var(--w-brand); }
.w-input::placeholder { color: var(--w-muted); }

/* ── AI Module Input Bar ─────────────────────────────────────── */
.w-ai-bar {
  background: var(--w-bg);
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px 0 hsl(220 20% 10% / 0.03);
}
.w-ai-bar-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--w-brand);
  margin-bottom: 8px;
}
.w-ai-bar-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.w-ai-bar-input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-sm);
  font-size: 14px;
  color: var(--w-text);
  outline: none;
  font-family: inherit;
  background: var(--w-bg-subtle);
  transition: border-color 0.15s;
}
.w-ai-bar-input:focus {
  border-color: var(--w-brand);
  background: var(--w-bg);
}
.w-ai-bar-input::placeholder { color: var(--w-muted); }
.w-ai-bar-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.w-ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--w-border);
  background: var(--w-bg-subtle);
  font-size: 12px;
  color: var(--w-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.w-ai-chip:hover,
.w-ai-chip.selected {
  border-color: var(--w-brand);
  color: var(--w-brand);
  background: var(--w-brand-light);
}

/* ── Empty state ─────────────────────────────────────────────── */
.w-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--w-muted);
}
.w-empty-title { font-size: 15px; font-weight: 600; color: var(--w-text); margin-bottom: 4px; }

/* ── Stat card accent borders ────────────────────────────────── */
.w-stat-accent-teal   { border-top: 3px solid hsl(172 55% 32%); }
.w-stat-accent-green  { border-top: 3px solid #10b981; }
.w-stat-accent-orange { border-top: 3px solid #f59e0b; }
.w-stat-accent-blue   { border-top: 3px solid hsl(172,55%,36%); }
.w-stat-accent-gray   { border-top: 3px solid #9ca3af; }

/* ── Stat icon circle backgrounds ───────────────────────────── */
.w-stat-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  flex-shrink: 0;
}
.w-stat-icon-wrap.brand  { background: hsl(172 55% 32% / 0.1); color: hsl(172 55% 32%); }
.w-stat-icon-wrap.orange { background: #fef3c7; color: #d97706; }
.w-stat-icon-wrap.blue   { background: hsl(172,55%,92%); color: hsl(172,55%,32%); }
.w-stat-icon-wrap.gray   { background: #f3f4f6; color: #6b7280; }
.w-stat-icon-wrap i { font-size: 12px; }

/* ── Progress bar ────────────────────────────────────────────── */
.w-progress {
  height: 5px;
  background: hsl(38,14%,90%);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.w-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: hsl(172 55% 32%);
  transition: width 0.8s cubic-bezier(.22,.68,0,1.2);
}
.w-progress-fill.warning { background: #f59e0b; }
.w-progress-fill.danger  { background: #ef4444; }

/* ── AI Prompt card (module builder) ─────────────────────────── */
.w-ai-card {
  border: 1.5px solid hsl(172 55% 32% / 0.18);
  border-radius: 12px;
  background: linear-gradient(160deg, hsl(172 55% 32% / 0.025) 0%, #fff 50%);
  padding: 24px;
  margin-bottom: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.w-ai-card:focus-within {
  border-color: hsl(172 55% 32% / 0.45);
  box-shadow: 0 0 0 4px hsl(172 55% 32% / 0.07);
}
.w-ai-card .w-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.w-ai-card .w-card-title::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: hsl(172 55% 32%);
  box-shadow: 0 0 0 3px hsl(172 55% 32% / 0.15);
}
.w-ai-card .w-textarea {
  border-color: transparent;
  background: #f9fafb;
  border-radius: 8px;
  min-height: 80px;
  font-size: 14px;
  transition: background 0.15s, border-color 0.15s;
}
.w-ai-card .w-textarea:focus {
  background: #fff;
  border-color: hsl(172 55% 32% / 0.3);
  box-shadow: none;
}

/* ── Module list hover ───────────────────────────────────────── */
.w-list-item {
  cursor: pointer;
  border-radius: 6px;
  padding: 14px 8px;
  margin: 0 -8px;
  transition: background 0.12s;
}
.w-list-item:hover { background: var(--w-bg-subtle); }
.w-list-item:last-child { border-bottom: none; }

/* ── Page subtitle ───────────────────────────────────────────── */
.w-page-subtitle {
  font-size: 13px;
  color: var(--w-muted);
  margin: 2px 0 0;
  font-weight: 400;
}

/* ── Desktop-first (no mobile collapse) ─────────────────────── */

/* ── Module Performance Review ───────────────────────────────── */
.w-mpr-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--w-radius);
  padding: 12px 16px;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 20px;
}
.w-mpr-notice i { margin-top: 2px; flex-shrink: 0; }

.w-mpr-scene-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.w-mpr-scene {
  background: var(--w-bg);
  border: 1.5px solid var(--w-border);
  border-radius: var(--w-radius);
  padding: 20px 24px;
  transition: border-color 0.15s;
}
.w-mpr-scene.at-risk  { border-color: #fbbf24; background: #fffdf5; }
.w-mpr-scene.healthy  { border-color: #6ee7b7; }
.w-mpr-scene.no-data  { border-color: var(--w-border); }

.w-mpr-scene-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.w-mpr-scene-meta {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.w-mpr-scene-index {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--w-bg-subtle);
  border: 1.5px solid var(--w-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--w-muted);
  flex-shrink: 0;
}
.w-mpr-scene.at-risk .w-mpr-scene-index {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #92400e;
}
.w-mpr-scene.healthy .w-mpr-scene-index {
  background: hsl(172 55% 32% / 0.08);
  border-color: hsl(172 55% 32% / 0.3);
  color: hsl(172 55% 26%);
}
.w-mpr-scene-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--w-text);
}
.w-mpr-scene-objective {
  font-size: 12px;
  color: var(--w-muted);
  margin-top: 3px;
  max-width: 480px;
}

.w-mpr-metrics {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--w-border);
  border-bottom: 1px solid var(--w-border);
}
.w-mpr-metric { display: flex; flex-direction: column; gap: 4px; }
.w-mpr-metric-label { font-size: 11px; color: var(--w-muted); text-transform: uppercase; letter-spacing: .05em; }
.w-mpr-metric-value { font-size: 18px; font-weight: 700; color: var(--w-text); }
.w-mpr-metric-value.orange { color: #d97706; }

.w-mpr-no-telemetry {
  font-size: 12px;
  color: var(--w-muted);
  padding: 8px 0 12px;
  border-top: 1px solid var(--w-border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.w-mpr-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.w-mpr-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--w-border);
  border-radius: var(--w-radius-sm);
  background: var(--w-bg);
  color: var(--w-text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.w-mpr-action-btn:hover {
  border-color: hsl(172 55% 32% / 0.5);
  background: hsl(172 55% 32% / 0.05);
  color: hsl(172 55% 26%);
}
.w-mpr-action-btn-danger { border-color: #fca5a5; color: #991b1b; }
.w-mpr-action-btn-danger:hover {
  border-color: #ef4444;
  background: #fef2f2;
  color: #b91c1c;
}

/* w-badge variants */.w-badge-gray { background:#f3f4f6;color:#6b7280;border:1px solid #e5e7eb; }
.w-form-label { font-size:13px;font-weight:500;color:var(--w-text); }
.w-select {
  padding: 7px 12px;
  font-size: 13px;
  border: 1.5px solid var(--w-border);
  border-radius: var(--w-radius-sm);
  background: var(--w-bg);
  color: var(--w-text);
  cursor: pointer;
}
.w-select:focus {
  outline: none;
  border-color: hsl(172 55% 32% / 0.6);
  box-shadow: 0 0 0 3px hsl(172 55% 32% / 0.08);
}

/* ── Dashboard Hero ──────────────────────────────────────────── */
.w-dash-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.w-dash-hero-left { flex: 1; min-width: 0; }
.w-dash-hero-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.w-dash-welcome {
  font-size: 26px;
  font-weight: 700;
  color: var(--w-text);
  margin: 0 0 6px;
  line-height: 1.2;
}
.w-dash-subtitle { font-size: 15px; color: var(--w-muted); margin: 0; }
.w-dash-highlight { color: hsl(172 55% 32%); font-weight: 600; }

/* ── Dashboard Stat Cards ────────────────────────────────────── */
.w-dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.w-dash-stat {
  background: var(--w-bg);
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius);
  padding: 20px 20px 16px;
}
.w-dash-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.w-dash-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.w-dash-stat-delta {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}
.w-dash-stat-delta.pos { background: #dcfce7; color: #166534; }
.w-dash-stat-delta.neg { background: #fee2e2; color: #991b1b; }
.w-dash-stat-label { font-size: 13px; color: var(--w-muted); font-weight: 500; margin-bottom: 4px; }
.w-dash-stat-value { font-size: 30px; font-weight: 700; color: var(--w-text); line-height: 1; }
.w-dash-stat-value.orange { color: #d97706; }

/* ── Dashboard Section Header ────────────────────────────────── */
.w-dash-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.w-dash-view-all {
  font-size: 13px;
  font-weight: 500;
  color: hsl(172 55% 32%);
  text-decoration: none;
}
.w-dash-view-all:hover { text-decoration: underline; }

/* ── Module Card Grid ────────────────────────────────────────── */
.w-module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.w-module-card {
  border: 1px solid var(--w-border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--w-bg);
  transition: transform 0.18s, box-shadow 0.18s;
  cursor: pointer;
  display: block;
}
.w-module-card:hover {
  /* transform removed — no jiggle */
  box-shadow: 0 12px 28px -8px rgba(0,0,0,0.15);
  text-decoration: none;
  color: inherit;
}
.w-module-card-thumb {
  position: relative;
  height: 140px;
  overflow: hidden;
}
.w-module-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 60%);
}
.w-module-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
}
.w-module-card-bottom {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
}
.w-module-card-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 2px;
}
.w-module-card-edited { font-size: 11px; color: rgba(255,255,255,0.7); }
.w-module-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
}
.w-module-card-meta { display: flex; align-items: center; gap: 6px; }
.w-module-card-rate { text-align: right; flex-shrink: 0; }
.w-module-card-rate-label { font-size: 10px; color: var(--w-muted); text-transform: uppercase; letter-spacing: 0.05em; display: block; }
.w-module-card-rate-value { font-size: 16px; font-weight: 700; color: var(--w-text); }
.w-module-card-rate-value.orange { color: #d97706; }

/* ── Create Module Card ──────────────────────────────────────── */
.w-module-card-create {
  border: 1.5px dashed var(--w-border);
  background: var(--w-bg-subtle);
}
.w-module-card-create:hover {
  border-color: hsl(172 55% 32% / 0.5);
  background: hsl(172 55% 32% / 0.04);
  box-shadow: none;
  transform: none;
}
.w-module-card-create-inner {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
}
.w-module-card-create-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: hsl(172 55% 32% / 0.1);
  color: hsl(172 55% 32%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.w-module-card-create-label { font-size: 14px; font-weight: 600; color: var(--w-text); }
.w-module-card-create-hint { font-size: 12px; color: var(--w-muted); }

/* ── Tab Pills (filter) ──────────────────────────────────────── */
.w-tab-pills {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--w-bg-subtle);
  border: 1px solid var(--w-border);
  border-radius: 8px;
  padding: 4px;
}
.w-tab-pill {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  color: var(--w-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  font-family: inherit;
}
.w-tab-pill:hover { background: #fff; color: var(--w-text); }
.w-tab-pill.active { background: #fff; color: hsl(172 55% 32%); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.w-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  background: var(--w-border);
  color: var(--w-muted);
  margin-left: 4px;
}
.w-tab-pill.active .w-tab-count { background: hsl(172 55% 32% / 0.12); color: hsl(172 55% 26%); }

/* ── Module List Avatar ──────────────────────────────────────── */
.w-module-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* ── Deployment Hub Layout ───────────────────────────────────── */
.w-deploy-hub {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}
.w-deploy-panel {
  background: var(--w-bg);
  border: 1.5px solid hsl(172 55% 32% / 0.2);
  border-radius: 12px;
  overflow: hidden;
  position: sticky;
  top: 20px;
}
.w-deploy-panel-head {
  padding: 14px 16px;
  background: hsl(172 55% 32% / 0.06);
  border-bottom: 1px solid hsl(172 55% 32% / 0.12);
}
.w-deploy-panel-head h3 {
  font-size: 11px;
  font-weight: 700;
  color: hsl(172 55% 26%);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.w-deploy-panel-body { padding: 16px; }
.w-deploy-panel-thumb {
  height: 80px;
  border-radius: 8px;
  background: linear-gradient(135deg,#1e3a5f 0%,#0a1628 100%);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.35);
  font-size: 28px;
}
.w-deploy-panel-name { font-size: 14px; font-weight: 600; color: var(--w-text); margin-bottom: 4px; }
.w-deploy-panel-meta { font-size: 12px; color: var(--w-muted); margin-bottom: 14px; }
.w-deploy-panel-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.w-deploy-panel-stat-label { font-size: 10px; color: var(--w-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.w-deploy-panel-stat-value { font-size: 18px; font-weight: 700; color: var(--w-text); }

/* ── Status Pills ────────────────────────────────────────────── */
.w-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.w-status-pill-active    { background: #dcfce7; color: #166534; }
.w-status-pill-completed { background: hsl(172,55%,92%); color: hsl(172,55%,24%); }
.w-status-pill-revoked   { background: #f3f4f6; color: #6b7280; }
.w-status-pill-warning   { background: #fef9c3; color: #854d0e; }

.w-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.w-status-dot-active    { background: #16a34a; animation: w-pulse 2s infinite; }
.w-status-dot-completed { background: hsl(172,55%,36%); }
.w-status-dot-revoked   { background: #9ca3af; }
.w-status-dot-warning   { background: #d97706; }

@keyframes w-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Deployment Fleet Table ──────────────────────────────────── */
.w-fleet-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--w-border);
}
.w-fleet-row:last-child { border-bottom: none; }

/* ── Shared Underline Tab Navigation ────────────────────────── */
/* Used by: w-settings-tab (OrgAdmin settings), w-analytics-tab (Analytics), w-my-tab (My Learning) */
.w-settings-tab,
.w-analytics-tab,
.w-my-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--w-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.w-settings-tab:hover,
.w-analytics-tab:hover,
.w-my-tab:hover { color: var(--w-text); text-decoration: none; }
.w-settings-tab-active,
.w-analytics-tab-active,
.w-my-tab-active { color: var(--w-brand); border-bottom-color: var(--w-brand); font-weight: 600; }
.w-fleet-row:hover { background: var(--w-bg-subtle); /* margin/padding jiggle removed */ border-radius: 6px; }

/* ── P1: Cursor + Interaction Utilities ──────────────────────── */
/* All interactive rows/cards should show pointer cursor */
.w-list-item[onclick],
.w-list-item a,
[onmouseenter] { cursor: pointer; }
.w-btn, .w-tab-pill, .w-settings-tab, .w-analytics-tab, .w-my-tab { cursor: pointer; }

/* P2: Reduced motion — disable pulse animation */
@media (prefers-reduced-motion: reduce) {
  @keyframes w-pulse { 0%, 100% { opacity: 1; } }
  .w-status-dot-active { animation: none; }
  .w-tab-pill, .w-btn, .w-stat, .w-card { transition: none !important; }
}

/* ── L7: Wanda Feature Card (gradient accent top-border) ─────── */
/* Use for high-emphasis cards: feature highlights, AI actions, onboarding steps */
.wanda-card {
  background: #fff;
  border: 1px solid var(--w-border);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.18s, transform 0.18s;
}
.wanda-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--w-brand) 0%, hsl(172 55% 55%) 100%);
}
.wanda-card:hover {
  box-shadow: 0 6px 24px rgba(14, 134, 117, 0.12);
  /* transform removed — no jiggle */
}
.wanda-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--w-text);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wanda-card-desc {
  font-size: 13px;
  color: var(--w-muted);
  line-height: 1.55;
  margin: 0;
}
.wanda-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--w-brand-light);
  color: var(--w-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  margin-bottom: 12px;
}

/* ── Readiness Gauge (SVG ring component) ────────────────────── */
.w-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.w-gauge-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--w-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  text-align: center;
}
.w-gauge-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--w-text);
}
.w-gauge-sublabel {
  font-size: 11px;
  color: var(--w-muted);
  text-align: center;
}

/* ── Credit Balance Chip ─────────────────────────────────────── */
.w-credit-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--w-brand-light);
  color: var(--w-brand);
  border: 1px solid hsl(172 55% 80%);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.w-credit-chip.low {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}
.w-credit-chip.exhausted {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* ── Paywall / Blocked State ─────────────────────────────────── */
.w-paywall {
  text-align: center;
  padding: 40px 24px;
  border: 2px dashed var(--w-border);
  border-radius: 12px;
  background: var(--w-bg-subtle);
}
.w-paywall-icon {
  font-size: 32px;
  color: var(--w-muted);
  margin-bottom: 12px;
}
.w-paywall-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--w-text);
  margin: 0 0 6px;
}
.w-paywall-desc {
  font-size: 13px;
  color: var(--w-muted);
  max-width: 40ch;
  margin: 0 auto 16px;
  line-height: 1.55;
}

/* ── Status Lifecycle Badges (module publishing) ─────────────── */
.w-badge-draft     { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.w-badge-published { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.w-badge-completed { background: hsl(172,55%,95%); color: hsl(172,55%,24%); border: 1px solid hsl(172,55%,80%); }
.w-badge-archived  { background: #f8fafc; color: #94a3b8; border: 1px solid #e2e8f0; }

/* ── P3: Button size normalisation ───────────────────────────── */
/* Ensure icon-only buttons have a square min-size for touch targets */
.w-btn-icon {
  min-width: 36px;
  min-height: 36px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.w-btn-icon.w-btn-sm {
  min-width: 30px;
  min-height: 30px;
  padding: 4px;
}

/* ── P5: Accessibility — focus ring on all interactive elements ── */
.w-btn:focus-visible,
.w-tab-pill:focus-visible,
.w-nav-item:focus-visible,
.w-input:focus-visible,
.w-select:focus-visible {
  outline: 2px solid var(--w-brand);
  outline-offset: 2px;
}

/* ── P6: Keyboard nav for tab pills — role="tablist" pattern ──── */
/* Tab pills receive role="tab" + tabindex in JS; style focused pill */
.w-tab-pill[tabindex="0"]:focus-visible,
.w-tab-pill:focus-visible {
  background: #fff;
  color: var(--w-brand);
  outline: 2px solid var(--w-brand);
  outline-offset: 1px;
}

/* ── P7: Skeleton screen loader ──────────────────────────────── */
.w-skeleton {
  border-radius: var(--w-radius-sm);
  background: linear-gradient(90deg, var(--w-border) 25%, var(--w-bg-subtle) 50%, var(--w-border) 75%);
  background-size: 200% 100%;
  animation: w-skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes w-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.w-skeleton-text  { height: 14px; margin-bottom: 8px; }
.w-skeleton-title { height: 20px; margin-bottom: 12px; width: 60%; }
.w-skeleton-card  { height: 80px; border-radius: var(--w-radius); }
@media (prefers-reduced-motion: reduce) {
  .w-skeleton { animation: none; background: var(--w-border); }
}

/* ── P8: Toast notification ──────────────────────────────────── */
.w-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: var(--w-brand);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: w-toast-in 0.2s ease-out;
}
@keyframes w-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.w-toast-error   { background: #dc2626; }
.w-toast-warning { background: #d97706; }

/* ── Stat icon wrap (right-aligned icon in stat card header) ─── */
.w-stat-icon-wrap {
  font-size: 15px;
  color: var(--w-muted);
  opacity: 0.7;
  flex-shrink: 0;
}
.w-stat-icon-wrap.brand  { color: var(--w-brand); opacity: 1; }
.w-stat-icon-wrap.blue   { color: hsl(172,55%,36%); opacity: 1; }
.w-stat-icon-wrap.orange { color: #d97706; opacity: 1; }
.w-stat-icon-wrap.red    { color: #dc2626; opacity: 1; }
.w-stat-icon-wrap.gray   { color: #9ca3af; opacity: 1; }

/* ═══════════════════════════════════════════════════════════════
   PERSONALITY & INTUITIVENESS LAYER
   Applies globally to every authenticated page — no individual
   page changes needed. These are purposeful, not decorative.
   ═══════════════════════════════════════════════════════════════ */

/* ── Page entrance: subtle fade+rise so content doesn't pop ── */
.w-main-content {
  animation: wanda-page-in 0.16s ease-out both;
}
@keyframes wanda-page-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .w-main-content { animation: none; }
}

/* ── Sidebar nav icon: 1px nudge on hover (tactile, not gimmicky) ── */
.w-nav-item i,
.w-nav-item svg {
  transition: transform 0.15s ease, color 0.15s;
  will-change: transform;
}
.w-nav-item:hover i,
.w-nav-item:hover svg {
  /* transform removed — no jiggle */
}

/* ── Sidebar group accordion: smooth height transition ── */
.w-sidebar-group-items {
  animation: wanda-group-open 0.18s ease-out both;
}
@keyframes wanda-group-open {
  from { opacity: 0; /* transform removed — no jiggle */ }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .w-sidebar-group-items { animation: none; }
}

/* ── Standardised status dot (use anywhere with w-status-dot + modifier) ── */
.w-status-dot {
  display: inline-flex;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  vertical-align: middle;
}
.w-status-dot.active {
  background: hsl(152 60% 40%);
  box-shadow: 0 0 0 2px hsl(152 60% 40% / 0.2);
}
.w-status-dot.warn {
  background: hsl(38 92% 50%);
  box-shadow: 0 0 0 2px hsl(38 92% 50% / 0.15);
}
.w-status-dot.danger {
  background: hsl(0 72% 51%);
  box-shadow: 0 0 0 2px hsl(0 72% 51% / 0.15);
}
.w-status-dot.idle    { background: hsl(220 13% 78%); }
.w-status-dot.pulse {
  animation: wanda-dot-pulse 2s ease infinite;
}
@keyframes wanda-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 2px hsl(152 60% 40% / 0.2); }
  50%       { box-shadow: 0 0 0 5px hsl(152 60% 40% / 0.04); }
}
@media (prefers-reduced-motion: reduce) {
  .w-status-dot.pulse { animation: none; }
}

/* ── Skeleton shimmer (for loading states on any element) ── */
.w-skeleton {
  background: linear-gradient(
    90deg,
    hsl(220 16% 93%) 25%,
    hsl(220 16% 97%) 50%,
    hsl(220 16% 93%) 75%
  );
  background-size: 200% 100%;
  border-radius: 4px;
  animation: wanda-shimmer 1.5s ease-in-out infinite;
}
@keyframes wanda-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .w-skeleton { animation: none; background: hsl(220 16% 93%); }
}

/* ── Header search button (⌘K shortcut surface) ── */
.w-header-search {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--w-border);
  border-radius: 6px;
  background: var(--w-bg-subtle);
  color: var(--w-muted);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
  min-width: 160px;
  text-align: left;
}
.w-header-search:hover {
  border-color: var(--w-brand);
  color: var(--w-text);
  background: var(--w-bg);
}
.w-header-search:focus-visible {
  outline: 2px solid var(--w-brand);
  outline-offset: 2px;
}
.w-header-search-icon { font-size: 12px; opacity: 0.6; }
.w-header-search-label { flex: 1; }
.w-header-search-kbd {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  padding: 1px 5px;
  border: 1px solid var(--w-border);
  border-radius: 4px;
  background: var(--w-bg);
  color: var(--w-muted);
  font-family: var(--font-mono);
  opacity: 0.8;
}

/* ── User card in sidebar footer ── */

/* ── Sidebar: hide user-card text when collapsed ── */
.w-sidebar.collapsed .w-sidebar-user-info { display: none; }
.w-sidebar.collapsed .w-header-search-label,
.w-sidebar.collapsed .w-header-search-kbd  { display: none; }

/* ════════════════════════════════════════════════════════════════════
   SENERA PHASE A + B — Prototype Design Parity
   Dark navy sidebar · Warm parchment shell · Card hierarchy · Utilities
   ════════════════════════════════════════════════════════════════════ */

/* ── 1. Warm Parchment Shell with thin grid lines ────────────────── */
.w-body,
.w-shell {
  background-color: hsl(38, 18%, 95%);
}

/* Background pattern is now topographic lines on .w-body */

/* ── 2. Dark Navy Sidebar ────────────────────────────────────────── */
.w-sidebar {
  background: hsl(210, 35%, 10%);
  border-right: 1px solid hsl(210, 25%, 14%);
  position: relative;
}

/* Teal accent strip — 3px left edge (matches reference) */
.w-sidebar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: hsl(172, 55%, 32%);
  opacity: 0.6;
  z-index: 2;
}

/* Paper noise texture overlay */
.w-sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  z-index: 0;
}

.w-sidebar > * { position: relative; z-index: 1; }

.w-sidebar-brand-title { color: hsl(38, 20%, 88%); }

.w-sidebar-brand-card,
.w-sidebar-brand-card:visited,
.w-sidebar-brand-card:hover,
.w-sidebar-brand-card:focus,
.w-sidebar-brand-card:active {
  color: hsl(38, 20%, 88%) !important;
  text-decoration: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  background: none !important;
}

/* Section labels (ORGANISATION) */
.w-sidebar .w-sidebar-section-label,
.w-sidebar .w-sidebar-section-chevron {
  color: hsla(38, 14%, 85%, 0.4);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.w-sidebar-footer { border-top-color: hsl(210, 25%, 18%); }
.w-sidebar .w-nav-divider { border-top-color: hsl(210, 25%, 18%); }

/* Nav items — default */
.w-sidebar .w-nav-item,
.w-sidebar .w-nav-item:visited { color: hsl(38, 14%, 85%) !important; }

/* Nav items — hover */
.w-sidebar .w-nav-item:hover {
  background: hsl(210, 30%, 16%);
  border-color: transparent;
  color: hsl(38, 14%, 92%) !important;
}

/* Nav items — active */
.w-sidebar .w-nav-item.active {
  background: hsl(210, 30%, 16%);
  color: hsl(38, 14%, 92%) !important;
  border-color: transparent;
  font-weight: 500;
}

.w-sidebar .w-nav-item.active:hover {
  background: hsl(210, 30%, 19%);
  color: hsl(38, 14%, 95%) !important;
}

/* Active indicator — teal left bar */
.w-sidebar .w-nav-item.active::before {
  background: hsl(172, 55%, 50%);
  width: 2px;
  top: 6px;
  bottom: 6px;
  border-radius: 0 2px 2px 0;
}

/* Sidebar toggle button */
.w-sidebar-toggle {
  background: hsl(210, 30%, 14%);
  border-color: hsl(210, 25%, 22%);
  color: hsl(38, 14%, 58%);
}

.w-sidebar-toggle:hover {
  background: hsl(210, 30%, 18%);
  border-color: hsl(210, 25%, 28%);
  color: hsl(38, 14%, 88%);
}

/* Sidebar user area */
.w-sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
}
.w-sidebar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: hsl(210, 30%, 18%);
  color: hsl(38, 14%, 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.w-sidebar-user-email {
  font-size: 11px;
  color: hsla(38, 14%, 85%, 0.4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.w-sidebar-signout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: hsla(38, 14%, 85%, 0.5);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: color 150ms ease;
}
.w-sidebar-signout:hover {
  color: hsl(0, 65%, 60%);
}

/* ── 3. Header — Sticky Glass ────────────────────────────────────── */
.w-shell-header {
  background: hsla(38, 18%, 96%, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

/* ── 4. Senera Card Hierarchy ────────────────────────────────────── */
.senera-elevated {
  background: hsl(40, 20%, 99%);
  border: 1px solid hsl(38, 15%, 88%);
  border-radius: var(--w-radius, 8px);
  box-shadow:
    0 1px 2px   hsla(210, 40%, 12%, 0.04),
    0 4px 12px  hsla(210, 40%, 12%, 0.03),
    0 8px 24px  hsla(210, 40%, 12%, 0.02);
}

.senera-inset {
  background: hsla(38, 14%, 92%, 0.55);
  border: 1px solid hsl(38, 15%, 86%);
  border-radius: var(--w-radius, 8px);
  box-shadow: inset 0 1px 3px hsla(210, 40%, 12%, 0.04);
}

.senera-panel {
  background: hsl(40, 20%, 99%);
  border: 1px solid hsl(38, 15%, 88%);
  border-radius: var(--w-radius, 8px);
  box-shadow: 0 1px 3px hsla(210, 40%, 12%, 0.06);
}

.senera-flush { background: transparent; border: none; border-radius: 0; box-shadow: none; }

.senera-tile {
  background: hsl(40, 20%, 99%);
  border: 1px solid hsl(38, 15%, 88%);
  border-radius: var(--w-radius, 8px);
  box-shadow: 0 1px 3px hsla(210, 40%, 12%, 0.06);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  cursor: pointer;
}

.senera-tile:hover {
  border-color: hsl(172, 40%, 70%);
  box-shadow:
    0 0 0 1px hsla(172, 55%, 32%, 0.08),
    0 4px 16px hsla(172, 55%, 32%, 0.08);
  /* transform removed — no jiggle */
  text-decoration: none;
}

/* ── 5. Metric Stripes ───────────────────────────────────────────── */
.metric-stripe { border-left: 3px solid transparent; padding-left: 14px; }
.metric-stripe-teal   { border-left-color: hsl(172, 55%, 40%); }
.metric-stripe-copper { border-left-color: hsl(18,  70%, 55%); }
.metric-stripe-sage   { border-left-color: hsl(152, 35%, 50%); }
.metric-stripe-navy   { border-left-color: hsl(210, 40%, 30%); }
.metric-stripe-amber  { border-left-color: hsl(38,  90%, 55%); }
.metric-stripe-red    { border-left-color: hsl(0,   72%, 55%); }

/* ── 6. Metric Glows ─────────────────────────────────────────────── */
.metric-glow { position: relative; overflow: hidden; }
.metric-glow::before {
  content: "";
  position: absolute; top: -40%; right: -20%;
  width: 60%; height: 120%;
  border-radius: 50%; pointer-events: none; opacity: 0.09;
}
.metric-glow-teal::before   { background: radial-gradient(circle, hsl(172, 55%, 50%), transparent 70%); }
.metric-glow-amber::before  { background: radial-gradient(circle, hsl(38,  90%, 55%), transparent 70%); }
.metric-glow-red::before    { background: radial-gradient(circle, hsl(0,   72%, 55%), transparent 70%); }
.metric-glow-green::before  { background: radial-gradient(circle, hsl(152, 35%, 50%), transparent 70%); }
.metric-glow-copper::before { background: radial-gradient(circle, hsl(18,  70%, 55%), transparent 70%); }

/* ── 7. Status Dots ──────────────────────────────────────────────── */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot-green { background: hsl(152, 45%, 48%); }
.status-dot-amber { background: hsl(38,  90%, 55%); }
.status-dot-red   { background: hsl(0,   72%, 55%); }
.status-dot-teal  { background: hsl(172, 55%, 40%); }
.status-dot-muted { background: hsl(210, 10%, 65%); }
.status-dot-pulse { animation: senera-pulse 2.2s ease-in-out infinite; }
@keyframes senera-pulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; }
  50%       { box-shadow: 0 0 0 5px transparent; }
}

/* ── 8. Typography Utilities ─────────────────────────────────────── */
.metric-serif    { font-family: var(--font-serif); font-size: 2.5rem; font-weight: 400; letter-spacing: -0.03em; line-height: 1; color: hsl(210, 40%, 12%); }
.metric-serif-lg { font-size: 3.25rem; }
.metric-serif-sm { font-size: 1.75rem; }

.text-gradient-primary {
  background: linear-gradient(135deg, hsl(172, 55%, 30%), hsl(172, 55%, 48%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── 9. Surface Levels ───────────────────────────────────────────── */
.surface-0 { background: hsl(38, 18%, 95%); }
.surface-1 { background: hsl(40, 20%, 99%); }
.surface-2 { background: hsl(38, 14%, 97%); }

/* ── 10. Ink Divider ─────────────────────────────────────────────── */
.ink-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, hsl(38, 15%, 82%), transparent);
  border: none; margin: 0;
}

/* ── 11. Analytics page card override ───────────────────────────── */
.metric-card, .feature-card {
  background: hsl(40, 20%, 99%);
  border: 1px solid hsl(38, 15%, 88%);
  box-shadow:
    0 1px 2px   hsla(210, 40%, 12%, 0.04),
    0 4px 12px  hsla(210, 40%, 12%, 0.03);
}

.metric-card strong {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.03em;
}

/* ══════════════════════════════════════════════════════════════════
   12. Standardised Design Tokens — Dashboard Reference
   ══════════════════════════════════════════════════════════════════ */

/* ── Semantic status colours ── */
:root {
  --w-success:      hsl(152,35%,50%);
  --w-warning:      hsl(18,70%,55%);
  --w-danger:       hsl(0,72%,55%);
  --w-danger-text:  hsl(0,72%,45%);
}

/* ── Elevated surface (dashboard-style card) ── */
.w-elevated {
  background: hsl(40,20%,99%);
  border: 1px solid var(--w-border);
  border-radius: 10px;
  box-shadow: 0 1px 2px hsla(210,40%,12%,0.04),
              0 4px 12px hsla(210,40%,12%,0.03);
}

/* ── Inset surface ── */
.w-inset {
  background: hsla(38,14%,92%,0.5);
  border: 1px solid hsla(38,15%,87%,0.6);
  border-radius: 10px;
  box-shadow: inset 0 1px 3px hsla(210,40%,12%,0.04);
}

/* ── List card wrapper ── */
.w-list-card {
  padding: 22px 24px 20px;
}

/* ── List card header row ── */
.w-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

/* ── Section title (list card headings) ── */
.w-list-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--w-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Data row ── */
.w-data-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 6px;
  border-radius: 8px;
  transition: background 150ms;
}
.w-data-row + .w-data-row {
  border-top: 1px solid hsl(38,14%,93%);
}
.w-data-row:hover {
  background: hsla(38,14%,92%,0.5);
}

/* ── Count badge (pill) ── */
.w-count-badge {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: hsl(38,14%,92%);
  color: var(--w-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

/* ── Empty state (standardised) ── */
.w-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 48px 16px;
  text-align: center;
}
.w-empty-state-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: hsl(38,14%,92%);
  color: hsla(210,10%,46%,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
}
.w-empty-state strong {
  font-size: 16px;
  font-weight: 600;
  color: var(--w-text);
}
.w-empty-state span {
  font-size: 13px;
  color: var(--w-muted);
}

/* ── Underline tabs (standard) ── */
.w-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--w-border);
  margin-bottom: 20px;
}
.w-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--w-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .15s, border-color .15s;
}
.w-tab:hover { color: var(--w-text); }
.w-tab.active {
  color: var(--w-brand);
  border-bottom-color: var(--w-brand);
  font-weight: 600;
}

/* ── Mobile responsive sidebar (≤768px) ──────────────────────────
 * On mobile the sidebar uses position:fixed so it overlays content
 * rather than squeezing the main column to ~130px.
 * A backdrop div with class .w-sidebar-backdrop is shown behind the
 * open sidebar so tapping outside closes it.
 * ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .w-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    z-index: 400;
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    /* Keep desktop widths — used when drawer slides in */
    width: var(--w-sidebar-w) !important;
    min-width: var(--w-sidebar-w) !important;
    box-shadow: 4px 0 24px rgba(14, 26, 38, 0.18);
  }

  /* Sidebar open on mobile = slide in from left */
  .w-sidebar.open,
  .w-sidebar:not(.collapsed) {
    transform: translateX(0);
  }

  /* Collapsed class on mobile = stay hidden (don't show icon rail) */
  .w-sidebar.collapsed {
    transform: translateX(-100%);
    width: var(--w-sidebar-w) !important;
    min-width: var(--w-sidebar-w) !important;
  }

  /* Main content takes full width */
  .w-main {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Header: hide center search + right credits on small screens */
  .w-shell-header-center {
    display: none !important;
  }
  .w-shell-header-right {
    display: none !important;
  }

  /* Show hamburger toggle in header on mobile */
  .w-header-sidebar-toggle {
    display: flex !important;
  }

  /* Backdrop overlay — visible when sidebar is open on mobile */
  .w-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(14, 26, 38, 0.45);
    z-index: 399;
    animation: w-backdrop-in 0.2s ease;
  }

  /* Compact header padding */
  .w-shell-header {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* Stack KPI cards vertically on narrow screens */
  .w-kpi-grid,
  .w-stats-row {
    flex-direction: column !important;
    gap: 10px !important;
  }

  /* Main content padding */
  .w-main-content {
    padding: 14px 16px 20px !important;
  }
}

@keyframes w-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Backdrop hidden by default (desktop) */
.w-sidebar-backdrop { display: none; }
