/* NABH Compliance Copilot — professional design system */

:root {
  --bg: #eef2f7;
  --bg-subtle: #e4eaf2;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --border: #d8e0eb;
  --border-light: #e8edf4;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: rgba(29, 78, 216, 0.1);
  --accent: #0e7490;
  --accent-soft: rgba(14, 116, 144, 0.12);
  --gold: #b45309;
  --gold-soft: rgba(180, 83, 9, 0.1);
  --sidebar-bg: #0c1526;
  --sidebar-bg-end: #152238;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #f8fafc;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --error: #dc2626;
  --success: #059669;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --sidebar-width: 272px;
  --header-height: 64px;
  --font: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

button, .btn, .subnav-item, .suggestion-chip, .nav-item, .module-tile {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── Auth pages ─── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(29, 78, 216, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(14, 116, 144, 0.1), transparent 50%),
    var(--bg);
}

.shell {
  width: 100%;
  max-width: 440px;
}

.auth-split {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 960px;
  min-height: min(640px, 90vh);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.auth-split-panel {
  display: none;
  padding: 48px 40px;
  background: linear-gradient(145deg, var(--sidebar-bg) 0%, var(--sidebar-bg-end) 100%);
  color: #e2e8f0;
  flex-direction: column;
  justify-content: center;
}

.auth-split-panel h2 {
  margin: 0 0 12px;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.auth-split-panel p {
  margin: 0;
  color: var(--sidebar-text);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 320px;
}

.auth-split-features {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.auth-split-features li {
  padding: 10px 0 10px 28px;
  position: relative;
  font-size: 0.92rem;
  color: #cbd5e1;
}

.auth-split-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.auth-split-form {
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand {
  text-align: center;
  margin-bottom: 28px;
}

.brand-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: var(--radius-md);
  object-fit: contain;
  display: block;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.brand h1 { margin: 0 0 6px; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.brand p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ─── Cards & forms ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  transition: all 0.2s;
}

.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

input, select, textarea {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font: inherit;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--surface);
}

.btn {
  width: 100%;
  padding: 13px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.25);
}

.btn:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(29, 78, 216, 0.3);
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: none;
  margin-top: 0;
}

.btn-ghost:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
  transform: none;
  box-shadow: var(--shadow-sm);
}

.btn-sm {
  width: auto;
  padding: 8px 14px;
  font-size: 0.85rem;
  box-shadow: none;
}

.link {
  display: block;
  text-align: center;
  margin-top: 14px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
}

.error { color: var(--error); font-size: 0.875rem; margin: 0 0 12px; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0 0 14px; }
.hidden { display: none !important; }

/* ─── App layout (dashboard) ─── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-end) 100%);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-sidebar.open { transform: translateX(0); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 150;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.visible { display: block; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  padding: 2px;
}

.sidebar-brand-text strong {
  display: block;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sidebar-brand-text span {
  display: block;
  color: var(--sidebar-text);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.nav-section { margin-bottom: 20px; }

.nav-section-label {
  display: block;
  padding: 0 12px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 2px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sidebar-text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text-active);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.18);
  color: #fff;
  font-weight: 600;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item.active .nav-icon { opacity: 1; }

.sidebar-user { display: none; }

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-height);
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  color: var(--text);
  font-size: 1.2rem;
}

.app-header h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
  max-width: min(560px, 72vw);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border-light);
}

.header-avatar {
  width: 34px;
  height: 34px;
  font-size: 0.75rem;
  border-radius: 999px;
}

.header-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
  padding-right: 4px;
}

.header-user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.header-user-role {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.header-logout-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all 0.15s;
  white-space: nowrap;
}

.header-logout-btn:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: #fef2f2;
}

.header-pill {
  display: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-content {
  flex: 1;
  padding: 24px 20px 40px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* ─── Dashboard home ─── */
.welcome-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--surface) 0%, #f8fafc 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.home-context-bar {
  padding: 12px 16px;
  margin-top: 0;
  margin-bottom: 20px;
}

.welcome-banner h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.welcome-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 0;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(29, 78, 216, 0.15);
}

.welcome-badge.accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(14, 116, 144, 0.2);
}

.home-grid {
  display: grid;
  gap: 24px;
  margin-bottom: 20px;
}

.home-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0c4a6e 100%);
  border: none;
  color: #e2e8f0;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 60%;
  height: 120%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.home-hero > * { position: relative; z-index: 1; }

.home-hero-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(147, 197, 253, 0.3);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 14px;
}

.home-hero-title {
  margin: 0 0 10px;
  font-size: 1.75rem;
  line-height: 1.25;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.home-hero-lead {
  margin: 0 0 18px;
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 560px;
}

.home-hero-features {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.home-hero-features li {
  position: relative;
  padding-left: 22px;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.home-hero-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #38bdf8;
  font-weight: 700;
}

.home-copilot-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.home-copilot-form input {
  width: 100%;
  padding: 15px 18px;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: var(--radius-sm);
}

.home-copilot-form input::placeholder { color: #64748b; }

.home-copilot-form input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.home-copilot-submit {
  font-size: 1rem;
  font-weight: 700;
  padding: 15px 20px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.home-suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.home-suggestions .hint { color: #64748b; margin: 0; }

.suggestion-chip {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  color: #e2e8f0;
  transition: all 0.15s;
}

.suggestion-chip:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #fff;
}

.home-promo-slider {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.promo-slider-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  background: #0f172a;
}

.promo-slider-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.promo-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.55s ease;
  pointer-events: none;
  overflow: hidden;
}

.promo-slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.promo-slide-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.promo-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.promo-slide-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 28px 14px 12px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.72) 55%, transparent 100%);
  color: #fff;
}

.promo-slide-caption h3 {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
}

.promo-slide-caption p {
  margin: 0 0 8px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #cbd5e1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.promo-cta {
  width: auto;
  margin: 0;
  padding: 6px 12px;
  font-size: 0.75rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.promo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s;
}

.promo-nav:hover {
  background: rgba(37, 99, 235, 0.85);
}

.promo-prev { left: 10px; }
.promo-next { right: 10px; }

.promo-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.promo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #cbd5e1;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.promo-dot.active {
  background: var(--primary);
  transform: scale(1.2);
}

.home-quick-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.module-section-title {
  margin: 0 0 16px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.module-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.module-tile:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.module-tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  background: var(--primary-soft);
}

.module-tile:nth-child(even) .module-tile-icon { background: var(--accent-soft); }

.module-tile strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.module-tile span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.hub-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.15s;
}

.hub-link:hover { color: var(--primary); }

/* ─── Legacy topbar / subnav (other pages) ─── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  border-radius: 8px;
  object-fit: contain;
}

.topbar h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.topbar button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.subnav {
  display: flex;
  gap: 8px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.subnav-item {
  flex: 0 0 auto;
  padding: 10px 18px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  color: var(--muted);
  white-space: nowrap;
  transition: all 0.15s;
}

.subnav-item:hover {
  color: var(--text);
  background: var(--surface);
}

.subnav-item.active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.dashboard {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.dashboard .card { margin-bottom: 20px; }

.home-page { max-width: none; padding: 0; }
.home-welcome { display: none; }
.home-tools { display: none; }
.home-tools-title { margin: 0 0 10px; font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

/* ─── Lists & chips ─── */
.user-list { list-style: none; padding: 0; margin: 0; }
.user-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.user-list-cards { display: flex; flex-direction: column; gap: 12px; }

.hospital-user-group {
  margin-top: 20px;
  padding-top: 4px;
  border-top: 1px solid var(--border-light);
}

.hospital-user-group:first-child {
  margin-top: 12px;
  border-top: none;
  padding-top: 0;
}

.hospital-user-group-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.user-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.user-row-main { flex: 1; min-width: 200px; }
.user-row-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.user-edit-form { margin-top: 4px; }

.chip {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-weight: 600;
}

.chip-warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.chip-ok { background: #ecfdf5; border-color: #6ee7b7; color: #065f46; }
.chip-bad { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }

.standards-page,
.copilot-page,
.audits-page,
.evidence-page,
.workflow-page { max-width: 1280px; }

.list-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.list-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.list-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.list-card-code {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.85rem;
}

.list-card-title {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
}

.chapter-card .chapter-number {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-light, #eff6ff);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.chapter-header-card .chapter-kicker,
.standard-header-card .chapter-kicker {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.chapter-header-card h3,
.standard-header-card h3 {
  margin: 0 0 8px;
}

.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.standard-title-text {
  margin: 0 0 12px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.standards-breadcrumb {
  margin-bottom: 12px;
}

.oe-list { list-style: none; padding: 0; margin: 0; }
.oe-item { padding: 16px 0; border-bottom: 1px solid var(--border-light); }
.oe-item p { margin: 6px 0 0; line-height: 1.55; color: var(--text-secondary); }

.oe-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.oe-item-doc-required {
  background: rgba(245, 158, 11, 0.06);
  margin: 0 -8px;
  padding: 16px 8px;
  border-radius: var(--radius-sm);
}

.oe-doc-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.oe-upload-btn {
  width: auto;
  margin: 0;
  white-space: nowrap;
}

.oe-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.oe-level-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.oe-level-commitment {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.oe-level-core {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.oe-level-excellence {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

.oe-level-achievement {
  background: #f3e8ff;
  color: #7e22ce;
  border-color: #d8b4fe;
}

.oe-item-clickable {
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: var(--radius-sm);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
}

.oe-item-clickable:hover,
.oe-item-clickable:focus-visible {
  background: rgba(37, 99, 235, 0.05);
  outline: none;
}

.oe-content-hint {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #6ee7b7;
}

.oe-workbook {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  align-items: start;
}

.oe-workbook-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.oe-workbook-header h3 {
  margin: 4px 0 0;
  line-height: 1.35;
}

.oe-workbook-logo {
  flex-shrink: 0;
  border-radius: 8px;
}

.oe-workbook-oe {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.oe-workbook-oe-text {
  margin: 0;
  line-height: 1.55;
  color: var(--text);
}

.oe-interpretation h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.oe-interpretation p {
  margin: 0;
  line-height: 1.65;
  color: var(--text-secondary);
}

.oe-summary {
  margin-top: 16px;
}

.oe-summary h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.oe-summary-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.oe-summary-list li {
  padding: 10px 12px;
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  line-height: 1.45;
}

.oe-workbook-images {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.oe-workbook-figure {
  margin: 0;
}

.oe-workbook-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.oe-workbook-figure figcaption {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.oe-workbook-footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.oe-evidence-examples {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.oe-evidence-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.oe-evidence-head h4 {
  margin: 0;
  font-size: 0.95rem;
}

.oe-evidence-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.oe-evidence-card {
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.oe-evidence-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.oe-evidence-meta {
  margin: 6px 0 0;
}

.oe-evidence-bullets {
  margin: 8px 0 0;
  padding-left: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.45;
  font-size: 0.88rem;
}

.oe-evidence-card .oe-evidence-open {
  margin-top: 8px;
}

.oe-ownership-panel {
  margin: 16px 0 18px;
  padding: 14px;
  border: 1px solid #99f6e4;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 70%);
}

.oe-ownership-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.oe-ownership-kicker {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f766e;
}

.oe-ownership-banner h4 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  color: #0f2a44;
}

.oe-ownership-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.oe-ownership-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 12px;
  min-height: 160px;
}

.oe-ownership-pict {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 64px;
  margin-bottom: 10px;
  border-radius: 10px;
  font-weight: 700;
}

.oe-ownership-icon {
  font-size: 1.45rem;
  line-height: 1;
}

.oe-ownership-pict-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.oe-ownership-owner .oe-ownership-pict {
  background: #ecfeff;
  color: #0e7490;
  border: 1px solid #a5f3fc;
}

.oe-ownership-action .oe-ownership-pict {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.oe-ownership-timeline .oe-ownership-pict {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.oe-ownership-label {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #0f2a44;
}

.oe-ownership-value {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
}

.oe-ownership-inline {
  display: grid;
  gap: 6px;
  margin: 10px 0 4px;
}

.oe-own-pill {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #0f172a;
}

.oe-own-pill strong {
  display: inline-block;
  min-width: 72px;
  margin-right: 6px;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.oe-own-owner {
  background: #ecfeff;
  border: 1px solid #a5f3fc;
}

.oe-own-action {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.oe-own-time {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.oe-ev-triad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.oe-ev-triad > div {
  padding: 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border-light);
}

.oe-ev-triad-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f766e;
}

.oe-ev-triad p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text);
}

@media (max-width: 900px) {
  .oe-ownership-grid,
  .oe-ev-triad {
    grid-template-columns: 1fr;
  }
}

.oe-workbook-notes h4 {
  margin: 0 0 10px;
}

.oe-notes-area {
  width: 100%;
  min-height: 320px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  line-height: 1.85;
  resize: vertical;
  background-color: #fffef8;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 27px,
    #d4d4d8 27px,
    #d4d4d8 28px
  );
  background-attachment: local;
}

.oe-notes-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .oe-workbook {
    grid-template-columns: 1fr;
  }
}

.search-form { display: grid; gap: 12px; margin-bottom: 16px; }
.search-form input[type="search"] {
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--bg);
}

.filter-label { display: block; margin-top: 12px; font-size: 0.875rem; font-weight: 600; }
.filter-label select { margin-top: 6px; width: 100%; }

.dashboard .btn + .btn { margin-top: 10px; }

.filter-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  align-items: end;
}

.filter-row label { margin-bottom: 0; }
.list-stack { display: grid; gap: 12px; margin-top: 12px; }

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
}

.action-row .btn { width: auto; margin-top: 0 !important; }

/* ─── Copilot ─── */
.copilot-intro { margin-bottom: 16px; }

.copilot-chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
  margin-bottom: 16px;
  padding: 4px;
}

.copilot-msg { display: flex; flex-direction: column; gap: 6px; }
.copilot-msg.user { align-items: flex-end; }
.copilot-msg.assistant { align-items: flex-start; }

.copilot-bubble {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 16px;
  line-height: 1.55;
  font-size: 0.95rem;
}

.copilot-msg.user .copilot-bubble {
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.copilot-msg.assistant .copilot-bubble {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-bottom-left-radius: 4px;
  max-width: min(920px, 100%);
  width: 100%;
}

.copilot-bubble .copilot-p {
  margin: 0 0 10px;
}
.copilot-bubble .copilot-p:last-child { margin-bottom: 0; }

.copilot-h {
  margin: 14px 0 8px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.3;
}
.copilot-bubble > .copilot-h:first-child { margin-top: 0; }
h3.copilot-h { font-size: 1.05rem; }
h4.copilot-h { font-size: 0.95rem; }
h5.copilot-h { font-size: 0.9rem; }

.copilot-list {
  margin: 8px 0 12px;
  padding-left: 1.2rem;
  color: var(--text-secondary);
}
.copilot-list li { margin-bottom: 4px; }

.copilot-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

.copilot-table-wrap {
  overflow-x: auto;
  margin: 12px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.copilot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 520px;
}

.copilot-table th,
.copilot-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
}

.copilot-table th {
  background: #f1f5f9;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.copilot-table tbody tr:nth-child(even) td {
  background: #fafbfc;
}

.copilot-table tbody tr:hover td {
  background: #f0f7ff;
}

.copilot-table tbody tr:last-child td {
  border-bottom: none;
}

.copilot-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
}

.copilot-status-critical {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.copilot-status-warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.copilot-status-ok {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.copilot-answer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  max-width: min(920px, 100%);
}

.copilot-hospital-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  max-width: min(920px, 100%);
}

.copilot-scope-line {
  margin-top: 8px !important;
}

.copilot-print-btn {
  margin: 0 !important;
  padding: 6px 12px !important;
  font-size: 0.78rem !important;
  width: auto !important;
}

.copilot-input { display: flex; gap: 10px; align-items: center; }
.copilot-input input {
  flex: 1;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
}

.copilot-input .btn { width: auto; margin: 0; }
.copilot-sources { font-size: 0.85rem; max-width: 95%; }
.copilot-sources ul { margin: 6px 0 0; padding-left: 0; list-style: none; }
.copilot-sources li { margin-bottom: 8px; }

.copilot-source-link,
.copilot-source-static {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--surface);
  font: inherit;
  color: inherit;
}

.copilot-source-link {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.copilot-source-link:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.copilot-source-link .copilot-source-cta {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}

.copilot-source-static {
  cursor: default;
}

.list-card.static { cursor: default; }
.list-card.static:hover { transform: none; }

button.list-card {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}

.step-list {
  margin: 8px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workflow-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  resize: vertical;
}

/* ─── Audits & metrics ─── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
}

.metric-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
}

.metric-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.metric-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.dept-compliance { margin: 8px 0 0; padding-left: 18px; }
.timeline-list { margin: 8px 0 0; padding-left: 18px; }
.timeline-list li { margin-bottom: 10px; }
.checklist-item label { margin-top: 8px; }

/* ─── Evidence ─── */
.evidence-filters { display: grid; gap: 12px; margin-top: 12px; }
.evidence-filters input,
.evidence-filters select { width: 100%; }

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.inline-form input,
.inline-form select { flex: 1; min-width: 120px; }
.inline-form .btn { width: auto; margin: 0; }

.checkbox-row {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}

.checkbox-row input { width: auto; }
.history-list { margin: 8px 0 0; padding-left: 18px; }
.history-list li { margin-bottom: 8px; }
.notif-unread { border-color: rgba(29, 78, 216, 0.3); background: var(--primary-soft); }
.approval-comment { width: 100%; margin: 8px 0; }

/* ─── Desktop layout ─── */
@media (min-width: 1024px) {
  .auth-split {
    grid-template-columns: 1fr 1fr;
  }

  .auth-split-panel {
    display: flex;
  }

  .auth-split-form {
    padding: 48px 44px;
  }

  .app-sidebar {
    transform: translateX(0);
  }

  .menu-toggle { display: none; }

  .app-main {
    margin-left: var(--sidebar-width);
  }

  .app-header {
    padding: 0 32px;
  }

  .header-pill { display: inline-flex; }

  .header-user-name,
  .header-user-role {
    max-width: 200px;
  }

  .page-content {
    padding: 32px 32px 48px;
  }

  .home-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .home-copilot-form {
    flex-direction: row;
    align-items: stretch;
  }

  .home-copilot-form input { flex: 1; }

  .home-copilot-submit {
    width: auto;
    white-space: nowrap;
    min-width: 200px;
  }

  .module-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .home-promo-slider {
    align-self: stretch;
  }

  .welcome-banner h2 { font-size: 1.5rem; }
  .home-hero-title { font-size: 2rem; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .module-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .home-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1023px) {
  .sidebar-overlay.visible { display: block; }
}

@media (max-width: 480px) {
  .header-user-meta {
    display: none;
  }

  .header-user {
    padding: 2px;
    border-radius: 999px;
  }

  .module-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .module-tile {
    padding: 14px 12px;
    min-height: 100%;
  }

  .module-tile-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .module-tile strong {
    font-size: 0.85rem;
    line-height: 1.25;
  }

  .module-tile span {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .promo-slide-caption h3 {
    font-size: 0.85rem;
  }

  .promo-slide-caption {
    padding: 22px 10px 10px;
  }

  .welcome-banner {
    padding: 16px 18px;
  }

  .home-hero-title {
    font-size: 1.4rem;
  }

  .exec-hero {
    flex-direction: column;
  }

  .exec-hero-top {
    flex-direction: column;
  }

  .exec-overall {
    width: 100%;
  }

  .exec-copilot-form {
    flex-direction: column;
  }

  .exec-copilot-submit {
    width: 100%;
  }

  .exec-charts {
    grid-template-columns: 1fr;
  }

  .exec-module-grid {
    grid-template-columns: 1fr;
  }

  .exec-vbars {
    gap: 8px;
  }
}

/* ─── Executive readiness dashboard ─── */
.exec-dashboard-root {
  margin-bottom: 24px;
}

.exec-loading {
  padding: 24px;
}

.home-page-exec .home-grid {
  margin-top: 8px;
}

.exec-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.exec-hero {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px 28px 24px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, #0c1526 0%, #152a45 55%, #0e3a4a 100%);
  color: #e2e8f0;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.exec-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
}

.exec-eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
}

.exec-hero h2 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f8fafc;
}

.exec-lead {
  margin: 0 0 16px;
  max-width: 42rem;
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.55;
}

.exec-rag-key {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.exec-rag-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rag-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.rag-dot.green { background: #10b981; }
.rag-dot.yellow { background: #f59e0b; }
.rag-dot.red { background: #ef4444; }

.exec-overall {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  min-width: 260px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.exec-overall-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 5px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  flex-shrink: 0;
}

.exec-overall-score {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.exec-overall-unit {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.exec-overall-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exec-overall-meta strong {
  font-size: 1.1rem;
  font-weight: 800;
}

.exec-overall-meta span {
  font-size: 0.8rem;
  color: #64748b;
}

.exec-copilot {
  padding: 18px 18px 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(125, 211, 252, 0.22);
  backdrop-filter: blur(6px);
}

.exec-copilot-head {
  margin-bottom: 14px;
}

.exec-copilot-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0c1526;
  background: linear-gradient(90deg, #7dd3fc, #a5f3fc);
  margin-bottom: 8px;
}

.exec-copilot-head h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.exec-copilot-head p {
  margin: 0;
  font-size: 0.88rem;
  color: #94a3b8;
  max-width: 48rem;
  line-height: 1.5;
}

.exec-copilot-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.exec-copilot-form input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
}

.exec-copilot-form input:focus {
  outline: 2px solid rgba(125, 211, 252, 0.55);
  outline-offset: 1px;
  border-color: #38bdf8;
}

.exec-copilot-submit {
  flex: 0 0 auto;
  white-space: nowrap;
  background: #38bdf8;
  color: #0c1526;
  border: none;
  font-weight: 700;
}

.exec-copilot-submit:hover {
  background: #7dd3fc;
}

.exec-copilot-suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.exec-suggest-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  margin-right: 2px;
}

.exec-suggestion-chip {
  appearance: none;
  border: 1px solid rgba(125, 211, 252, 0.35);
  background: rgba(14, 116, 144, 0.25);
  color: #e0f2fe;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.exec-suggestion-chip:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: #7dd3fc;
}

.home-page-exec .home-grid .home-hero {
  display: none;
}

.home-page-exec .home-grid {
  grid-template-columns: 1fr;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.exec-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.exec-kpi {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--border);
}

.exec-kpi.rag-green { border-top-color: #059669; }
.exec-kpi.rag-yellow { border-top-color: #d97706; }
.exec-kpi.rag-red { border-top-color: #dc2626; }

.exec-kpi-value {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.exec-kpi-label {
  display: block;
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.exec-section-title {
  margin: 4px 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.exec-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.exec-module {
  display: flex;
  gap: 0;
  padding: 0;
  text-align: left;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  font: inherit;
  color: inherit;
}

.exec-module:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.exec-module-rag {
  width: 6px;
  flex-shrink: 0;
}

.exec-module-body {
  flex: 1;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exec-module-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.exec-module-top strong {
  font-size: 0.95rem;
}

.exec-module-score {
  font-size: 1.15rem;
  font-weight: 800;
}

.exec-module-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.exec-pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

.exec-module-meter {
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.exec-module-meter > div {
  height: 100%;
  border-radius: 999px;
}

.exec-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.exec-chart-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
}

.exec-chart-card h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 700;
}

.exec-chart-card > .hint {
  margin: 0 0 14px;
}

.exec-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exec-bar-row {
  display: grid;
  grid-template-columns: minmax(72px, 110px) 1fr 48px;
  align-items: center;
  gap: 10px;
}

.exec-bar-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exec-bar-track {
  height: 10px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.exec-bar-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
  transition: width 0.4s ease;
}

.exec-bar-val {
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
  color: var(--text);
}

.exec-vbars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 12px;
  min-height: 160px;
  padding-top: 8px;
}

.exec-vbar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 72px;
}

.exec-vbar-col {
  width: 100%;
  height: 120px;
  background: var(--bg);
  border-radius: 8px 8px 4px 4px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.exec-vbar-fill {
  width: 100%;
  border-radius: 8px 8px 0 0;
  min-height: 4px;
  transition: height 0.4s ease;
}

.exec-vbar-val {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text);
}

.exec-vbar-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

.exec-pie-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.exec-pie-center {
  font-size: 1.1rem;
  font-weight: 800;
  fill: var(--text);
  font-family: var(--font);
}

.exec-pie-sub {
  font-size: 0.65rem;
  font-weight: 600;
  fill: var(--muted);
  font-family: var(--font);
  text-transform: uppercase;
}

.exec-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.exec-legend strong {
  color: var(--text);
  margin-left: 4px;
}

.exec-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 8px;
  vertical-align: middle;
}

@media (min-width: 960px) {
  .home-page-exec .home-grid:has(.home-hero:not([style*="display: none"])) {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

/* ─── AI Gap Analysis ─── */
.gap-report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.gap-report-toolbar .btn {
  width: auto;
  margin: 0;
}
.gap-intro h3 { margin: 0 0 8px; }
.gap-filters { margin-top: 16px; }
.gap-chapter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.gap-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.gap-chip.active {
  background: var(--primary-soft);
  border-color: rgba(29, 78, 216, 0.35);
  color: var(--primary);
}
.gap-summary-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--surface);
  margin-bottom: 14px;
  border-top: 4px solid #d97706;
}
.gap-summary-hero.rag-green { border-top-color: #059669; }
.gap-summary-hero.rag-red { border-top-color: #dc2626; }
.gap-eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.gap-summary-hero h3 { margin: 0 0 8px; }
.gap-exec { margin: 0 0 8px; color: var(--text-secondary); line-height: 1.55; }
.gap-score-ring {
  min-width: 120px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg);
  text-align: center;
  border: 1px solid var(--border-light);
}
.gap-score-val {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
}
.gap-score-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}
.gap-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.gap-kpi {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
}
.gap-kpi strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
}
.gap-kpi.warn strong { color: #d97706; }
.gap-kpi.bad strong { color: #dc2626; }
.gap-kpi span {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gap-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.gap-bullets {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-secondary);
}
.gap-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.gap-card-head h4 { margin: 0; }
.gap-actions { display: flex; flex-direction: column; gap: 12px; }
.gap-action {
  padding: 14px 14px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.gap-action-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.gap-action p {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}
.gap-action-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.gap-prio {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gap-prio.critical { background: #fef2f2; color: #b91c1c; }
.gap-prio.high { background: #fff7ed; color: #c2410c; }
.gap-prio.medium { background: #fffbeb; color: #b45309; }
.gap-prio.low { background: #ecfdf5; color: #047857; }
.gap-chapter-bars { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.gap-chapter-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr minmax(90px, 120px);
  gap: 10px;
  align-items: center;
}
.gap-chapter-label strong { display: block; font-size: 0.85rem; }
.gap-bar-track {
  height: 10px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.gap-bar-fill { height: 100%; border-radius: 999px; min-width: 2px; }
.gap-chapter-stats {
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
}
.gap-std-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  margin-top: 10px;
}
.gap-std-list-full {
  max-height: none;
}
.gap-chapter-group {
  margin-top: 12px;
}
.gap-chapter-group h5 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
}
.gap-matrix-wrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
.gap-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.gap-matrix th,
.gap-matrix td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: top;
}
.gap-matrix th {
  position: sticky;
  top: 0;
  background: var(--bg);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  z-index: 1;
}
.gap-row-gap td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
.gap-row-partial td:first-child,
.gap-row-weak td:first-child { box-shadow: inset 3px 0 0 #d97706; }
.gap-row-covered td:first-child { box-shadow: inset 3px 0 0 #059669; }
.linkish {
  appearance: none;
  border: none;
  background: none;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.linkish:hover { text-decoration: underline; }
.gap-std-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.gap-std-item.static { cursor: default; }
.gap-std-item strong { font-size: 0.85rem; color: var(--primary); }
.gap-std-item span { font-size: 0.8rem; color: var(--text-secondary); }
.exec-gap-link {
  background: rgba(56, 189, 248, 0.35) !important;
  border-color: #7dd3fc !important;
  color: #f0f9ff !important;
}
@media (max-width: 720px) {
  .gap-chapter-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .gap-chapter-stats { text-align: left; }
}
