/* ==========================================================================
   RQAM — Reverse Quality Assurance Management
   Master Design System & Stylesheet (CSS Tokens & Components)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Brand Core */
  --color-brand-sidebar:       var(--color-night); /* Midnight Navy */
  --color-brand-sidebar-hover: var(--color-night-2);
  --color-brand-sidebar-text:  var(--color-muted);
  --color-brand-sidebar-active:var(--color-night-3);

  /* Primary & Accents */
  --color-primary-blue:        var(--color-blue); /* Royal Blue */
  --color-primary-blue-hover:  var(--color-blue-strong);
  --color-primary-blue-light:  var(--color-blue-soft);

  /* Status & Scoring */
  --color-score-strong:        var(--color-success); /* Emerald Green */
  --color-score-strong-bg:     var(--color-success-soft);
  --color-score-developing:    var(--color-blue); /* Blue */
  --color-score-developing-bg: var(--color-blue-soft);
  --color-score-moderate:      var(--color-warn); /* Amber/Orange */
  --color-score-moderate-bg:   var(--color-warn-soft);
  --color-score-critical:      var(--color-error); /* Crimson Red */
  --color-score-critical-bg:   var(--color-error-soft);

  /* AI Special Accents */
  --color-ai-violet:           var(--color-ai-violet); /* Purple/Violet */
  --color-ai-violet-light:     var(--color-ai-violet-light);
  --color-ai-border:           var(--color-ai-border);

  /* Surfaces & Text */
  --color-bg-app:              var(--color-paper); /* Slate 50 */
  --color-surface-card:        var(--color-paper-3);
  --color-border-subtle:       var(--color-rule);
  --color-text-title:          var(--color-ink); /* Slate 900 */
  --color-text-body:           var(--color-ink-2); /* Slate 700 */
  --color-text-muted:          var(--color-muted); /* Slate 500 */

  /* Shadows & Radius */
  --shadow-sm: 0 1px 2px 0 color-mix(in oklab, var(--color-ink) 5%, transparent);
  --shadow-md: 0 4px 6px -1px color-mix(in oklab, var(--color-ink) 7%, transparent), 0 2px 4px -2px color-mix(in oklab, var(--color-ink) 5%, transparent);
  --shadow-lg: 0 10px 15px -3px color-mix(in oklab, var(--color-ink) 8%, transparent), 0 4px 6px -4px color-mix(in oklab, var(--color-ink) 4%, transparent);
  --shadow-xl: 0 20px 25px -5px color-mix(in oklab, var(--color-ink) 10%, transparent), 0 8px 10px -6px color-mix(in oklab, var(--color-ink) 5%, transparent);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 9999px;
  --sidebar-width: 260px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg-app);
  color: var(--color-text-body);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   App Shell Layout (Sidebar + Main Area)
   ========================================================================== */

.app-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--color-brand-sidebar);
  color: var(--color-brand-sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  border-right: 1px solid color-mix(in oklab, var(--color-night-ink) 6%, transparent);
  z-index: 100;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.sidebar-header {
  padding: var(--space-lg) 20px 20px 20px;
  border-bottom: 1px solid color-mix(in oklab, var(--color-night-ink) 8%, transparent);
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.brand-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--color-paper-3);
}

.brand-title span {
  color: var(--color-accent); /* Emerald arc accent */
}

.brand-tagline {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-night-muted);
  line-height: 1.35;
  letter-spacing: 0;
}

.sidebar-nav {
  padding: 20px var(--space-sm);
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.nav-section-title {
  font-size: 10.5px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-ink-2);
  font-weight: 700;
  padding: var(--space-sm) var(--space-sm) var(--space-xs) var(--space-sm);
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--color-brand-sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
}

.nav-link-content {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-link svg {
  width: 18px;
  height: 18px;
  stroke-width: 2px;
  stroke: currentColor;
  fill: none;
  transition: stroke 0.18s ease;
}

.nav-link:hover {
  background-color: var(--color-brand-sidebar-hover);
  color: var(--color-paper);
}

.nav-link.active {
  background-color: var(--color-primary-blue);
  color: var(--color-paper-3);
  font-weight: 600;
  box-shadow: 0 4px 12px color-mix(in oklab, var(--color-blue) 35%, transparent);
}

.nav-link.active svg {
  stroke: var(--color-paper-3);
}

.nav-badge {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-size: 10px;
  font-weight: 700;
  padding: var(--space-3xs) var(--space-xs);
  border-radius: var(--radius-pill);
}

.nav-badge.beta {
  background: var(--color-ai-violet);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--space-md) var(--space-md);
  border-top: 1px solid color-mix(in oklab, var(--color-night-ink) 8%, transparent);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  background: color-mix(in oklab, var(--color-ink) 15%, transparent);
}

.ai-assistant-mini {
  background: color-mix(in oklab, var(--color-ai-violet) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--color-ai-violet) 25%, transparent);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
}

.ai-assistant-mini h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ai-border);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-2xs);
}

.ai-assistant-mini p {
  font-size: 11px;
  color: var(--color-muted);
  line-height: 1.35;
  margin-bottom: var(--space-xs);
}

.btn-ai-mini {
  background: var(--color-ai-violet);
  color: var(--color-paper-3);
  border: none;
  font-size: 11px;
  font-weight: 600;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
}

.btn-ai-mini:hover {
  background: var(--color-ai-violet);
}

.tenant-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xs) var(--space-sm);
  background: color-mix(in oklab, var(--color-night-ink) 4%, transparent);
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in oklab, var(--color-night-ink) 8%, transparent);
  cursor: pointer;
}

.tenant-info {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.tenant-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--color-night-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-sky);
  font-size: 12px;
  font-weight: 700;
}

.tenant-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-paper);
}

.tenant-sub {
  font-size: 10px;
  color: var(--color-muted);
}

/* ==========================================================================
   Main Canvas & Topbar
   ========================================================================== */

.main-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
  height: 100vh;
}

/* TOPBAR */
.topbar {
  background: var(--color-paper-3);
  border-bottom: 1px solid var(--color-border-subtle);
  padding: var(--space-md) 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: static;
  z-index: auto;
  box-shadow: none;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.portal-tabs {
  display: flex;
  background: var(--color-paper-2);
  padding: var(--space-2xs);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
}

.portal-tab-btn {
  border: none;
  background: transparent;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.portal-tab-btn.active {
  background: var(--color-paper-3);
  color: var(--color-text-title);
  box-shadow: var(--shadow-sm);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.period-badge {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-paper);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-body);
  cursor: pointer;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--color-border-subtle);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-body);
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}

.icon-btn:hover {
  background: var(--color-paper-2);
}

.badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--color-error);
  border: 2px solid var(--color-paper-3);
  border-radius: 50%;
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-left: var(--space-sm);
  border-left: 1px solid var(--color-border-subtle);
  cursor: pointer;
}

.avatar-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-rule);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-title);
}

.user-role {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Page Content Views
   ========================================================================== */

.content-container {
  padding: 28px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.view-section {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header greeting */
.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.header-greeting h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-title);
  letter-spacing: -0.4px;
  margin-bottom: var(--space-2xs);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.header-greeting p {
  font-size: 13.5px;
  color: var(--color-text-muted);
}

.header-actions {
  display: flex;
  gap: var(--space-sm);
}

/* Primary Button */
.btn-primary {
  background: var(--color-primary-blue);
  color: var(--color-paper-3);
  border: none;
  padding: var(--space-xs) 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  box-shadow: 0 2px 6px color-mix(in oklab, var(--color-blue) 25%, transparent);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
  background: var(--color-primary-blue-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-paper-3);
  color: var(--color-text-body);
  border: 1px solid var(--color-border-subtle);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn-secondary:hover {
  background: var(--color-paper);
}

/* ==========================================================================
   KPI Cards Grid
   ========================================================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: var(--space-lg);
}

.kpi-card {
  background: var(--color-surface-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.kpi-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.kpi-body {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.kpi-ring-wrapper {
  width: 76px;
  height: 76px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-ring-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.kpi-ring-bg {
  stroke: var(--color-rule);
  stroke-width: 6;
  fill: transparent;
}

.kpi-ring-progress {
  stroke: var(--color-primary-blue);
  stroke-width: 6;
  stroke-linecap: round;
  fill: transparent;
  transition: stroke-dashoffset 1s ease-in-out;
}

.kpi-ring-value {
  position: absolute;
  font-size: 20px;
  font-weight: 800;
  color: var(--color-text-title);
  letter-spacing: -0.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.kpi-ring-value sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: var(--space-2xs);
}

.kpi-details {
  flex: 1;
}

.kpi-pill {
  display: inline-block;
  padding: var(--space-2xs) var(--space-xs);
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.kpi-pill.strong {
  background: var(--color-score-strong-bg);
  color: var(--color-score-strong);
}

.kpi-pill.developing {
  background: var(--color-score-developing-bg);
  color: var(--color-score-developing);
}

.kpi-pill.moderate {
  background: var(--color-score-moderate-bg);
  color: var(--color-warn-ink);
}

.kpi-pill.critical {
  background: var(--color-score-critical-bg);
  color: var(--color-score-critical);
}

.kpi-desc {
  font-size: 11.5px;
  color: var(--color-text-muted);
  line-height: 1.35;
}

.kpi-footer {
  border-top: 1px solid var(--color-paper-2);
  padding-top: var(--space-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary-blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

/* Next Action Banner (Pattern C) */
.action-banner-card {
  background: linear-gradient(135deg, var(--color-accent-soft) 0%, var(--color-accent-soft) 100%);
  border: 1px solid var(--color-accent-rule);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.action-banner-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.action-badge-icon {
  width: 50px;
  height: 50px;
  background: var(--color-paper-3);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-success);
  box-shadow: 0 4px 10px color-mix(in oklab, var(--color-success) 15%, transparent);
}

.action-badge-icon svg {
  width: 26px;
  height: 26px;
}

.action-banner-text h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-success-ink);
  margin-bottom: var(--space-2xs);
}

.action-banner-text p {
  font-size: 13px;
  color: var(--color-success-ink);
}

.btn-start-action {
  background: var(--color-success);
  color: var(--color-paper-3);
  border: none;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 8px color-mix(in oklab, var(--color-success) 30%, transparent);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn-start-action:hover {
  background: var(--color-success-ink);
  transform: translateY(-1px);
}

/* ==========================================================================
   Progress Journey Stepper (Pattern D)
   ========================================================================== */

.card-stepper {
  background: var(--color-paper-3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.stepper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.stepper-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-title);
}

.stepper-header p {
  font-size: 12px;
  color: var(--color-text-muted);
}

.stepper-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 0 20px;
}

.stepper-line {
  position: absolute;
  top: 24px;
  left: 60px;
  right: 60px;
  height: 3px;
  background: var(--color-rule);
  z-index: 1;
}

.stepper-line-fill {
  height: 100%;
  width: 40%;
  background: var(--color-primary-blue);
  border-radius: var(--radius-pill);
}

.step-node {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.step-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-paper-3);
  border: 2px solid var(--color-rule-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.step-node.completed .step-circle {
  background: var(--color-primary-blue);
  border-color: var(--color-primary-blue);
  color: var(--color-paper-3);
  box-shadow: 0 4px 10px color-mix(in oklab, var(--color-blue) 30%, transparent);
}

.step-node.active .step-circle {
  background: var(--color-blue-soft);
  border-color: var(--color-primary-blue);
  color: var(--color-primary-blue);
  border-width: 3px;
}

.step-node.locked .step-circle {
  background: var(--color-paper-2);
  border-color: var(--color-rule);
  color: var(--color-muted);
}

.step-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-title);
  margin-bottom: var(--space-2xs);
}

.step-status {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.step-node.completed .step-status {
  color: var(--color-score-strong);
}

.step-node.active .step-status {
  color: var(--color-primary-blue);
}

/* ==========================================================================
   Two Column Grid (Assessments + AI Coach / Timeline)
   ========================================================================== */

.dashboard-split-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-lg);
}

@media (max-width: 1080px) {
  .dashboard-split-grid {
    grid-template-columns: 1fr;
  }
}

.card-box {
  background: var(--color-paper-3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-lg);
}

.card-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-box-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-title);
}

.card-box-header a, .card-box-header span {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary-blue);
  text-decoration: none;
  cursor: pointer;
}

/* Recent Assessment List */
.assessment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-sm);
  border-radius: var(--radius-md);
  border-bottom: 1px solid var(--color-paper-2);
  transition: background 0.15s ease;
  cursor: pointer;
}

.assessment-item:last-child {
  border-bottom: none;
}

.assessment-item:hover {
  background: var(--color-paper);
}

.assessment-item-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.assessment-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.assessment-item-icon.user-type { background: var(--color-paper-2); color: var(--color-blue); }
.assessment-item-icon.org-type { background: var(--color-success-soft); color: var(--color-success); }
.assessment-item-icon.align-type { background: var(--color-warn-soft); color: var(--color-warn); }
.assessment-item-icon.audit-type { background: var(--color-accent-soft); color: var(--color-success); }

.assessment-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-text-title);
  margin-bottom: var(--space-2xs);
}

.assessment-item-meta {
  font-size: 11.5px;
  color: var(--color-text-muted);
}

.assessment-item-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.assessment-score-badge {
  display: flex;
  align-items: baseline;
  gap: var(--space-2xs);
  background: var(--color-paper);
  border: 1px solid var(--color-border-subtle);
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
}

.assessment-score-badge small {
  font-size: 10px;
  color: var(--color-text-muted);
}

/* AI Coach Card (Pattern E) */
.ai-coach-card {
  background: var(--color-ai-violet-light);
  border: 1px solid var(--color-ai-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-lg);
}

.ai-coach-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.ai-coach-avatar {
  width: 44px;
  height: 44px;
  background: var(--color-ai-violet);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-paper-3);
}

.ai-coach-title h4 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--color-text-title);
}

.ai-coach-title p {
  font-size: 12px;
  color: var(--color-text-muted);
}

.ai-coach-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: 20px;
}

.ai-coach-check-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 12.5px;
  color: var(--color-text-body);
}

.ai-coach-check-item svg {
  width: 16px;
  height: 16px;
  color: var(--color-ai-violet);
  flex-shrink: 0;
  margin-top: var(--space-3xs);
}

.btn-ai-coach-action {
  background: var(--color-paper-3);
  color: var(--color-ai-violet);
  border: 1px solid var(--color-ai-border);
  padding: var(--space-xs) 20px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn-ai-coach-action:hover {
  background: var(--color-ai-violet);
  color: var(--color-paper-3);
}

/* Timeline Widget */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  position: relative;
  padding-left: 20px;
}

.timeline-list::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: 2px;
  background: var(--color-rule);
}

.timeline-node {
  position: relative;
  font-size: 12.5px;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--color-paper-3);
  background: var(--color-primary-blue);
  box-shadow: 0 0 0 2px var(--color-rule);
}

.timeline-dot.green { background: var(--color-success); }
.timeline-dot.orange { background: var(--color-warn); }

.timeline-time {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3xs);
}

.timeline-content {
  font-weight: 600;
  color: var(--color-text-title);
  line-height: 1.35;
}

.timeline-sub {
  font-size: 11.5px;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* ==========================================================================
   Organization Hub Specific Styles (Heatmap, Drivers, Evolution)
   ========================================================================== */

.drivers-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.driver-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.driver-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 220px;
}

.driver-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.driver-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-title);
}

.driver-desc {
  font-size: 11px;
  color: var(--color-text-muted);
}

.driver-bar-wrapper {
  flex: 1;
  height: 8px;
  background: var(--color-rule);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.driver-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: opacity 0.3s ease;
}

.driver-score-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-title);
  width: 35px;
  text-align: right;
}

/* Heatmap Table */
.heatmap-table-wrap {
  overflow-x: auto;
}

.heatmap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.heatmap-table th {
  text-align: left;
  padding: var(--space-sm);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border-subtle);
  text-transform: none;
  letter-spacing: 0;
}

.heatmap-table td {
  padding: var(--space-sm);
  border-bottom: 1px solid var(--color-paper-2);
  font-weight: 600;
}

.heatmap-cell {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  border-radius: 6px;
  font-weight: 700;
  text-align: center;
  min-width: 54px;
}

.heatmap-cell.high { background: var(--color-accent-soft); color: var(--color-success-ink); }
.heatmap-cell.medium { background: var(--color-warn-soft); color: var(--color-warn-ink); }
.heatmap-cell.critical { background: var(--color-error-soft); color: var(--color-error-ink); }

/* ==========================================================================
   Consultant Portal (Benchmark Bars, Clients Table)
   ========================================================================== */

.benchmark-bars-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 190px;
  padding-top: 20px;
  border-bottom: 2px solid var(--color-rule);
}

.benchmark-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  width: 60px;
}

.benchmark-bar {
  width: 36px;
  border-radius: 6px 6px 0 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: var(--space-xs);
  color: var(--color-paper-3);
  font-size: 11px;
  font-weight: 700;
}

.benchmark-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
}

/* ==========================================================================
   Interactive Assessment Stepper Engine (RILA Modal / View)
   ========================================================================== */

.assessment-engine-card {
  background: var(--color-paper-3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  max-width: 880px;
  margin: 0 auto;
}

.assessment-progress-bar {
  height: 6px;
  background: var(--color-rule);
  border-radius: var(--radius-pill);
  margin: 20px 0 var(--space-lg) 0;
  overflow: hidden;
}

.assessment-progress-fill {
  height: 100%;
  background: var(--color-blue);
  width: 0%;
  transition: opacity 0.3s ease;
}

.assessment-domain-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-pill);
  background: var(--color-paper-2);
  color: var(--color-blue-strong);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: var(--space-sm);
}

.scenario-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-title);
  margin-bottom: var(--space-xs);
}

.scenario-box {
  background: var(--color-paper);
  border-left: 4px solid var(--color-primary-blue);
  padding: var(--space-md) 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: var(--space-lg);
  font-size: 15px;
  color: var(--color-text-body);
  line-height: 1.5;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: 28px;
}

.option-item {
  border: 2px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-md) 20px;
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  background: var(--color-paper-3);
}

.option-item:hover {
  border-color: var(--color-blue-rule);
  background: var(--color-paper);
}

.option-item.selected {
  border-color: var(--color-primary-blue);
  background: var(--color-primary-blue-light);
  box-shadow: 0 4px 12px color-mix(in oklab, var(--color-blue) 15%, transparent);
}

.option-letter-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--color-text-title);
  flex-shrink: 0;
}

.option-item.selected .option-letter-badge {
  background: var(--color-primary-blue);
  color: var(--color-paper-3);
}

.option-text {
  font-size: 14px;
  color: var(--color-text-body);
  line-height: 1.45;
  font-weight: 500;
}

.stepper-nav-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--color-border-subtle);
  padding-top: 20px;
}

/* ==========================================================================
   Product Vision & Manifesto (Mockup 4 Styles)
   ========================================================================== */

.vision-hero {
  background: var(--color-night);
  color: var(--color-paper-3);
  border-radius: var(--radius-card);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

.vision-hero-title {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: var(--space-sm);
}

.vision-hero-title span {
  color: var(--color-accent);
}

.vision-hero-sub {
  font-size: 16px;
  color: var(--color-night-muted);
  max-width: 650px;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.vision-audiences-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .vision-audiences-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.vision-audience-card {
  background: color-mix(in oklab, var(--color-night-ink) 6%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid color-mix(in oklab, var(--color-night-ink) 12%, transparent);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
}

.vision-audience-number {
  font-size: 36px;
  font-weight: 800;
  color: var(--color-paper-3);
  margin-bottom: var(--space-2xs);
}

.vision-audience-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-sky);
  margin-bottom: var(--space-xs);
}

.vision-audience-desc {
  font-size: var(--text-xs);
  color: var(--color-night-muted);
  line-height: 1.4;
}

/* Modal Window */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: color-mix(in oklab, var(--color-ink) 65%, transparent);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-content {
  background: var(--color-paper-3);
  border-radius: var(--radius-xl);
  max-width: 580px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--color-ink);
}

/* ==========================================================================
   Authentication System (Login, Sign Up & OTP Verification)
   ========================================================================== */

.auth-modal-card {
  background: var(--color-paper-3);
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  padding: 32px;
  box-shadow: var(--shadow-xl);
  position: relative;
  border: 1px solid var(--color-border-subtle);
  animation: authFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-tabs {
  display: flex;
  background: var(--color-paper-2);
  border-radius: var(--radius-md);
  padding: var(--space-2xs);
  margin-bottom: var(--space-lg);
}

.auth-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: var(--space-xs);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.auth-tab-btn.active {
  background: var(--color-paper-3);
  color: var(--color-text-title);
  box-shadow: var(--shadow-sm);
}

.auth-form-group {
  margin-bottom: var(--space-md);
}

.auth-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-title);
  margin-bottom: var(--space-xs);
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--color-text-title);
  background: var(--color-paper-3);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--color-primary-blue);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-blue) 15%, transparent);
}

.auth-toggle-pwd {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
}

/* Password Strength Meter */
.password-meter-wrap {
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  background: var(--color-paper);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}

.password-meter-bar {
  height: 6px;
  background: var(--color-rule);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.password-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  transition: opacity 0.3s ease, background-color 0.3s ease;
}

.password-meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-text-title);
  margin-bottom: var(--space-xs);
}

.password-checklist {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xs);
}

.password-rule-item {
  font-size: 11px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  transition: color 0.2s;
}

.password-rule-item.valid {
  color: var(--color-score-strong);
  font-weight: 600;
}

.password-rule-item .rule-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  background: var(--color-rule);
  color: var(--color-muted);
}

.password-rule-item.valid .rule-icon {
  background: var(--color-success-soft);
  color: var(--color-success);
}

/* OTP 6-Digit Code Group */
.otp-container {
  text-align: center;
  padding: var(--space-xs) 0;
}

.otp-icon-badge {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--color-blue-soft);
  color: var(--color-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: var(--space-sm);
}

.otp-inputs-grid {
  display: flex;
  justify-content: center;
  gap: var(--space-xs);
  margin: 20px 0;
}

.otp-digit-box {
  width: 46px;
  height: 54px;
  border: 2px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  color: var(--color-text-title);
  background: var(--color-paper-3);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.otp-digit-box:focus {
  outline: none;
  border-color: var(--color-primary-blue);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-blue) 15%, transparent);
  background: var(--color-blue-soft);
}

.otp-resend-wrap {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: var(--space-md);
}

.otp-resend-btn {
  background: none;
  border: none;
  color: var(--color-primary-blue);
  font-weight: 700;
  cursor: pointer;
  padding: 0 var(--space-2xs);
}

.otp-resend-btn:disabled {
  color: var(--color-muted);
  cursor: not-allowed;
}

/* Notification Alert Banner */
.auth-alert {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  margin-bottom: var(--space-md);
  display: none;
  align-items: center;
  gap: var(--space-xs);
}

.auth-alert.show {
  display: flex;
}

.auth-alert.error {
  background: var(--color-error-soft);
  border: 1px solid var(--color-error-rule);
  color: var(--color-error-ink);
}

.auth-alert.success {
  background: var(--color-success-soft);
  border: 1px solid var(--color-accent-rule);
  color: var(--color-success-ink);
}

/* User Profile Dropdown in Topbar */
.user-dropdown-menu {
  position: absolute;
  top: 54px;
  right: 28px;
  background: var(--color-paper-3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 280px;
  padding: var(--space-xs);
  z-index: 200;
  display: none;
  animation: authFadeIn 0.15s ease-out;
}

.user-dropdown-menu.open {
  display: block;
}

.dropdown-user-header {
  padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-sm);
  border-bottom: 1px solid var(--color-paper-2);
  margin-bottom: var(--space-xs);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-body);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  border: none;
  width: 100%;
  text-align: left;
  background: transparent;
}

.dropdown-item:hover {
  background: var(--color-paper);
  color: var(--color-primary-blue);
}

.dropdown-item.logout {
  color: var(--color-error);
}

.dropdown-item.logout:hover {
  background: var(--color-error-soft);
}

/* Quick Language Switcher Bar in Dropdown */
.dropdown-lang-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-paper);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2xs);
}

.dropdown-lang-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: none;
  letter-spacing: 0;
}

.quick-lang-group {
  display: flex;
  gap: var(--space-2xs);
}

.quick-lang-btn {
  padding: var(--space-2xs) var(--space-xs);
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid var(--color-rule);
  background: var(--color-paper-3);
  color: var(--color-ink-2);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.quick-lang-btn:hover {
  border-color: var(--color-rule-strong);
  background: var(--color-paper-2);
}

.quick-lang-btn.active {
  background: var(--color-ink);
  color: var(--color-paper-3);
  border-color: var(--color-ink);
}

/* User Profile & Language Modal Styles */
.profile-modal-content {
  max-width: 640px !important;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px !important;
}

.profile-modal-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-paper-2);
  margin-bottom: 20px;
}

.profile-header-avatar-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.profile-modal-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-rule);
}

.avatar-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--color-accent);
  border: 2px solid var(--color-paper-3);
}

.profile-header-meta {
  flex: 1;
  min-width: 0;
}

.profile-header-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xs);
  flex-wrap: wrap;
}

.profile-header-title-row h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-ink);
  margin: 0;
}

.profile-header-email {
  font-size: 13px;
  color: var(--color-muted);
}

.profile-sec-block {
  margin-bottom: var(--space-lg);
}

.profile-sec-title {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 14px;
  font-weight: 800;
  color: var(--color-ink);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.2px;
}

.profile-sec-title svg {
  color: var(--color-blue);
}

.profile-sec-desc {
  font-size: 12.5px;
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
  line-height: 1.45;
}

/* Grid of profile fields */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.profile-field-box {
  background: var(--color-paper);
  border: 1px solid var(--color-paper-2);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.profile-field-box.full-width {
  grid-column: span 2;
}

.profile-field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: none;
  letter-spacing: 0;
}

.profile-field-value {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-night-3);
  word-break: break-all;
}

.uuid-copy-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-3xs);
}

.profile-uuid-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  color: var(--color-ink-2);
  background: var(--color-paper-2);
  padding: var(--space-2xs) var(--space-xs);
  border-radius: 4px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-copy-uuid {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  background: var(--color-paper-3);
  border: 1px solid var(--color-rule-strong);
  border-radius: 4px;
  padding: var(--space-2xs) var(--space-sm);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-ink-2);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn-copy-uuid:hover {
  background: var(--color-paper-2);
  border-color: var(--color-muted);
}

/* Language Selection Cards Grid */
.lang-cards-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.lang-select-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border: 1.5px solid var(--color-rule);
  border-radius: var(--radius-lg);
  background: var(--color-paper-3);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.lang-select-card:hover {
  border-color: var(--color-blue-rule);
  background: var(--color-paper);
  transform: translateY(-1px);
}

.lang-select-card.active {
  border-color: var(--color-accent);
  background: color-mix(in oklab, var(--color-accent) 4%, transparent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.lang-card-flag {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
}

.lang-card-info {
  flex: 1;
}

.lang-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: var(--space-2xs);
}

.lang-card-sub {
  font-size: 12px;
  color: var(--color-muted);
}

.profile-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--color-paper-2);
  margin-top: var(--space-xs);
}

.profile-toast {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-success);
  background: var(--color-success-soft);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-accent-rule);
  animation: authFadeIn 0.2s ease;
}

/* Hallmark � shape: kept shell � genre: modern-minimal � theme: brand � redesign: full
 * paper: oklch(98.6% 0.004 250) � accent: oklch(66% 0.145 162) � display: Plus Jakarta Sans � body: Plus Jakarta Sans � hero: kept � nav: sidebar � footer: kept � signature: brand ledger
 * axes: light/grotesk-heavy/cool � posture: kept � contrast: pass � fold: pass � v2.0.0 */

/* Hallmark · shape: kept shell · genre: modern-minimal · theme: brand · redesign: full
 * paper: oklch(98.6% 0.004 250) · accent: oklch(66% 0.145 162) · display: Plus Jakarta Sans · body: Plus Jakarta Sans · hero: kept · nav: sidebar · footer: kept · signature: brand ledger
 * axes: light/grotesk-heavy/cool · posture: kept · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R4 V4 · weakest: S, the shell is generic enterprise; fixed by keeping the navy rail and setting figures and tables as the product's own material */

/* ── Shell · one sticky element, full-height rail ───────────────────── */
.app-shell {
  display: flex;
  width: 100%;
  min-height: 100svh;
  padding-inline-start: var(--sidebar-width);
}

.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  height: auto;
  border-right: var(--rule-hair) solid var(--color-night-rule);
  z-index: var(--z-sticky);
}

.topbar {
  position: static;
  background: var(--color-paper-3);
  border-bottom: var(--rule-hair) solid var(--color-rule);
  box-shadow: none;
  z-index: auto;
}

.main-canvas {
  height: auto;
  min-height: 100svh;
  overflow: visible;
}

/* ── Type · the brand face, one scale ───────────────────────────────── */
.page-title,
.topbar-title,
.section-title,
.card-title {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-display);
  font-weight: 700;
  text-wrap: balance;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-display);
}

.kpi-value,
.metric-number,
.hero-gauge-number,
.vision-audience-number,
.assessment-score-badge {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ── Controls · eight states, 44px hit target ───────────────────────── */
.btn-primary,
.btn-secondary,
.btn-ai-mini,
.quick-lang-btn,
.portal-tab-btn,
.icon-btn {
  min-height: 40px;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out);
}

.btn-primary:active,
.btn-secondary:active,
.btn-ai-mini:active,
.quick-lang-btn:active,
.portal-tab-btn:active,
.icon-btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--color-blue);
  border-radius: var(--radius-pill);
}

.btn-primary:hover { background: var(--color-blue-strong); }

.btn-secondary {
  background: var(--color-paper-3);
  border: var(--rule-hair) solid var(--color-rule-strong);
  color: var(--color-ink);
  border-radius: var(--radius-pill);
}

.btn-secondary:hover { border-color: var(--color-ink-2); }

/* ── Surfaces · one radius per nesting level ────────────────────────── */
.card,
.kpi-card,
.assessment-engine-card,
.modal-content,
.section-card {
  border-radius: var(--radius-card);
  border: var(--rule-hair) solid var(--color-rule);
  box-shadow: var(--shadow-card);
}

.nav-link.active,
.portal-tab-btn.active {
  border-radius: var(--radius-pill);
}

/* ── Topbar tabs: one line, scroll inside the bar ────────────────────── */
.topbar { flex-wrap: nowrap; gap: var(--space-md); }
.period-badge { white-space: nowrap; flex: 0 0 auto; }
.topbar-left { min-width: 0; flex: 1 1 auto; }
.topbar-right { display: flex; align-items: center; gap: var(--space-sm); flex: 0 0 auto; }
.portal-tabs { min-width: 0; flex: 1 1 auto; scrollbar-width: none; -ms-overflow-style: none; }
.portal-tabs::-webkit-scrollbar { height: 0; width: 0; }
.portal-tabs {
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}
.portal-tab-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 48rem) {
  .topbar { gap: var(--space-xs); }
  .period-badge { display: none; }
  .user-profile-widget .user-info { display: none; }
}

/* ── Tables in cards: never clip, scroll inside the card ─────────────── */
.card-box { min-width: 0; }
.heatmap-table-wrap { max-width: 100%; overflow-x: auto; }
.heatmap-table { min-width: 520px; }

/* ── Empty decorative tiles left by removed emoji ────────────────────── */
.driver-icon:empty { display: none; }

/* ── Assessment Center: history of diagnostics ──────────────────────── */
#assessment-center {
  background: var(--color-paper-3);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-card);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}

.assessment-center-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.assessment-center-head h2 {
  font-size: var(--text-xl);
  color: var(--color-ink);
  margin-bottom: var(--space-2xs);
}

.assessment-center-head p {
  font-size: var(--text-sm);
  color: var(--color-muted);
  max-width: 56ch;
}

.assessment-history-list {
  border-top: var(--rule-hair) solid var(--color-rule);
}

.assessment-history-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md) 0;
  border-bottom: var(--rule-hair) solid var(--color-rule);
}

.assessment-history-code {
  font-weight: 700;
  color: var(--color-ink);
}

.assessment-history-date {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.assessment-history-score {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.assessment-history-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.assessment-history-value > span,
.assessment-history-value-sm > span {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-muted);
}

.assessment-history-friction {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
}

.assessment-history-label {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.assessment-history-value-sm {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
}

.assessment-history-btn { justify-self: end; }

.assessment-history-empty {
  padding: var(--space-xl);
  text-align: center;
  border: var(--rule-hair) dashed var(--color-rule-strong);
  border-radius: var(--radius-card);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

@media (max-width: 56rem) {
  .assessment-history-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-sm) var(--space-md); }
  .assessment-history-btn { grid-column: 1 / -1; justify-self: start; }
  .assessment-history-friction { align-items: flex-start; }
}

/* ── Avatars: monogram, no external image ───────────────────────────── */
.avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--color-ink);
  color: var(--color-paper-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  user-select: none;
}

.avatar-initials-lg {
  width: 64px;
  height: 64px;
  font-size: 20px;
  background: var(--color-night);
  color: var(--color-night-ink);
  border: var(--rule-hair) solid var(--color-night-rule);
}

#modal-profile-role-badge {
  white-space: normal;
  overflow-wrap: normal;
  word-break: keep-all;
  max-width: 100%;
  line-height: 1.3;
}

/* Profile fields: wrap at spaces, never split a word like "Enterprise" */
.profile-field-value {
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.35;
}

/* ── Sidebar: no visible scrollbar on the dark rail ─────────────────── */
.sidebar-nav {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* ── Sidebar labels: no tracked caps, readable size ─────────────────── */
.nav-section-title,
.nav-link,
.brand-tagline,
.tenant-name,
.tenant-sub,
.kpi-label,
.card-subtitle,
.table th {
  text-transform: none;
  letter-spacing: 0;
}

.nav-link { gap: var(--space-xs); }

.nav-link-content { min-width: 0; }

.nav-link-content > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-badge {
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1.5;
  padding: 0 var(--space-xs);
  font-size: 9.5px;
}

.kpi-pill { white-space: nowrap; }

.nav-badge.beta {
  background: var(--color-night-3);
  color: var(--color-night-muted);
  border: var(--rule-hair) solid var(--color-night-rule);
}

.nav-section-title,
.brand-tagline,
.tenant-sub,
.kpi-label,
.card-subtitle {
  font-size: var(--text-xs);
}

.table th {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-muted);
}

/* ── Focus, visible and instant, on both surfaces ───────────────────── */
.sidebar :focus-visible { outline-color: var(--color-focus-night); }
.topbar :focus-visible { outline-color: var(--color-focus); }

/* ── Numeric tables ────────────────────────────────────────────────── */
.table td.num,
.rca-table td:nth-child(2),
.heatmap-cell {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 56rem) {
  .sidebar { display: none; }
  .app-shell { display: block; padding-inline-start: 0; }
}
