/* =========================================================
   OnlyHIPAA – Design System
   Modern healthcare SaaS aesthetic
   ========================================================= */

/* ---- CSS Custom Properties -------------------------------- */
:root {
  /* Brand */
  --primary:        #2563eb;
  --primary-hover:  #1d4ed8;
  --primary-light:  #eff6ff;
  --primary-text:   #2563eb;
  --primary-dark:   #1e40af;
  --accent:         #0891b2;
  --accent-light:   #ecfeff;

  /* Legacy aliases (keep for existing code) */
  --success:  #059669;
  --warning:  #d97706;
  --danger:   #dc2626;
  --info:     #0891b2;

  /* Semantic shorthand aliases (used by utility CSS) */
  --bg:      #f8fafc;
  --bg-card: #ffffff;
  --border:  #e5e7eb;

  /* Surfaces */
  --bg-body:           #f8fafc;
  --bg-surface:        #ffffff;
  --bg-surface-raised: #ffffff;
  --bg-alt:            #f1f5f9;
  --bg-hover:          #f8fafc;

  /* Text */
  --text-primary:   #111827;
  --text-secondary: #374151;
  --text-muted:     #6b7280;
  --text-subtle:    #9ca3af;
  --text-disabled:  #9ca3af;
  --text-inverse:   #ffffff;

  /* Borders */
  --border-color:  #e5e7eb;
  --border-strong: #d1d5db;
  --border-focus:  #2563eb;

  /* Semantic colors — light variants */
  --success-light:  #ecfdf5;
  --warning-light:  #fffbeb;
  --danger-light:   #fef2f2;
  --info-light:     #ecfeff;

  /* Semantic colors */
  --color-success:        #059669;
  --color-success-bg:     #ecfdf5;
  --color-success-border: #a7f3d0;
  --color-warning:        #d97706;
  --color-warning-bg:     #fffbeb;
  --color-warning-border: #fcd34d;
  --color-warning-text:   #92400e;
  --color-danger:         #dc2626;
  --color-danger-bg:      #fef2f2;
  --color-danger-border:  #fca5a5;
  --color-danger-text:    #991b1b;
  --color-info:           #0891b2;
  --color-info-bg:        #ecfeff;
  --color-info-border:    #a5f3fc;
  --color-purple:         #7c3aed;
  --color-purple-bg:      #f5f3ff;
  --color-white:          #ffffff;

  /* Legacy gray scale (keep for existing code) */
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.05);
  --shadow:    0 1px 3px rgb(0 0 0 / 0.1), 0 1px 2px rgb(0 0 0 / 0.06);
  --shadow-md: 0 4px 6px rgb(0 0 0 / 0.07), 0 2px 4px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px rgb(0 0 0 / 0.07), 0 4px 6px rgb(0 0 0 / 0.05);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Radius */
  --radius-sm: 6px;
  --radius:    8px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition:      150ms ease;
  --transition-fast: 120ms ease;
  --transition-base: 150ms ease;
  --transition-slow: 300ms ease;
  --transition-md:   250ms ease;

  /* Sidebar */
  --sidebar-width:            240px;
  --sidebar-bg:               #ffffff;
  --sidebar-border:           #e5e7eb;
  --sidebar-link-color:       #374151;
  --sidebar-link-hover-bg:    #f3f4f6;
  --sidebar-link-active-bg:   #eff6ff;
  --sidebar-link-active-color:#2563eb;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;
}

/* ---- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-sans); color: var(--text-primary); background: var(--bg-body); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }

/* ---- Typography -------------------------------------------- */
h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p  { color: var(--gray-600); line-height: 1.75; }

/* ---- Layout ------------------------------------------------ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Buttons ----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  font-weight: 500;
  font-size: .875rem;
  border-radius: var(--radius-md);
  padding: .5rem 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.25;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-sm  { padding: .3125rem .75rem; font-size: .8125rem; }
.btn-lg  { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-full { width: 100%; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 0 0 3px rgb(59 130 246 / 0.2); }

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-300); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-alt); color: var(--text-primary); }

.btn-danger {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
}
.btn-danger:hover { background: #b91c1c; box-shadow: 0 0 0 3px rgb(220 38 38 / 0.2); }

.btn-white {
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.btn-white:hover { background: var(--gray-50); color: var(--primary-dark); box-shadow: 0 4px 12px rgba(0,0,0,.15); }

.btn-ghost-white {
  background: transparent;
  color: rgba(255,255,255,.9);
  border: 1.5px solid rgba(255,255,255,.4);
}
.btn-ghost-white:hover { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.7); }

.btn-passkey {
  background: var(--gray-50);
  color: var(--gray-800);
  border: 1.5px solid var(--gray-200);
  font-size: .9375rem;
  font-weight: 500;
  justify-content: center;
  padding: .75rem 1.25rem;
}
.btn-passkey:hover { background: var(--gray-100); border-color: var(--gray-300); }

/* ---- Badges ------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-new      { background: var(--primary-light); color: var(--primary); border: 1px solid #bfdbfe; }
.badge-trust    { background: var(--gray-100); color: var(--gray-600); font-size: .75rem; font-weight: 500; }
.badge-success  { background: var(--success-light); color: #065f46; }
.badge-warning  { background: var(--warning-light); color: #92400e; }
.badge-danger   { background: var(--danger-light);  color: #991b1b; }
.badge-info     { background: var(--info-light);    color: #164e63; }
.badge-gray     { background: var(--gray-100);      color: var(--gray-600); }
[data-theme="dark"] .badge-success { background: rgba(52,211,153,.15); color: #34d399; }
[data-theme="dark"] .badge-warning { background: rgba(251,191,36,.12); color: #fbbf24; }
[data-theme="dark"] .badge-danger  { background: rgba(248,113,113,.15); color: #f87171; }
[data-theme="dark"] .badge-info    { background: rgba(56,189,248,.12); color: #38bdf8; }
[data-theme="dark"] .badge-gray    { background: rgba(255,255,255,.07); color: #94a3b8; }

/* ---- Navigation -------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  transition: box-shadow var(--transition-md);
}
.site-header.scrolled { box-shadow: var(--shadow-md); }

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: .625rem;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo-text {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--gray-800);
  letter-spacing: -0.03em;
}
.nav-logo-text strong { font-weight: 800; color: var(--primary); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex: 1;
}
.nav-link {
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--gray-900); background: var(--gray-100); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: .5rem;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: transform var(--transition-md), opacity var(--transition-md);
}

/* ---- Hero -------------------------------------------------- */
.hero {
  position: relative;
  padding: 5rem 0 4rem;
  overflow: hidden;
  background: linear-gradient(135deg, #f8faff 0%, #eff6ff 50%, #f0fdfe 100%);
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(30,64,175,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,64,175,.04) 1px, transparent 1px);
  background-size: 48px 48px;
}
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
}
.hero-glow-1 { width: 500px; height: 500px; background: #bfdbfe; top: -100px; left: -100px; }
.hero-glow-2 { width: 400px; height: 400px; background: #a5f3fc; bottom: -100px; right: 0; }

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  padding: .375rem .875rem .375rem .5rem;
  background: rgba(255,255,255,.8);
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  font-size: .875rem;
  color: var(--gray-600);
  margin-bottom: 1.75rem;
  backdrop-filter: blur(8px);
}
.badge-arrow { color: var(--primary); margin-left: auto; }

.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}
.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 1.1875rem;
  color: var(--gray-600);
  line-height: 1.75;
  margin-bottom: 2rem;
  max-width: 580px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .875rem;
  margin-bottom: 1rem;
}
.hero-note { font-size: .875rem; color: var(--gray-400); }

/* App screenshot mockup */
.hero-screenshot {
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 480px;
  pointer-events: none;
}
.screenshot-frame {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,.06);
  overflow: hidden;
}
.screenshot-header {
  display: flex;
  gap: .375rem;
  padding: .75rem 1rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}
.screenshot-header span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gray-300);
}
.screenshot-header span:first-child { background: #fc6058; }
.screenshot-header span:nth-child(2) { background: #fec02f; }
.screenshot-header span:nth-child(3) { background: #2aca3e; }

.screenshot-body { display: flex; height: 260px; }
.mock-sidebar { width: 80px; background: var(--gray-900); padding: 1rem .5rem; }
.mock-logo-block { width: 36px; height: 36px; background: var(--primary); border-radius: 8px; margin-bottom: 1rem; }
.mock-nav-item { height: 8px; background: rgba(255,255,255,.15); border-radius: 4px; margin-bottom: .625rem; }
.mock-nav-item.active { background: rgba(255,255,255,.35); }

.mock-content { flex: 1; padding: 1rem; background: var(--gray-50); }
.mock-header-bar { height: 24px; background: var(--gray-200); border-radius: 6px; margin-bottom: 1rem; width: 60%; }
.mock-cards { display: flex; gap: .5rem; margin-bottom: 1rem; }
.mock-card { flex: 1; height: 56px; border-radius: 8px; }
.mock-card-blue   { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.mock-card-green  { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
.mock-card-amber  { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.mock-progress-section { display: flex; flex-direction: column; gap: .5rem; }
.mock-progress-bar { height: 8px; background: linear-gradient(90deg, var(--primary) 65%, var(--gray-200) 65%); border-radius: 4px; }
.mock-progress-bar.short  { background: linear-gradient(90deg, var(--success) 40%, var(--gray-200) 40%); }
.mock-progress-bar.medium { background: linear-gradient(90deg, var(--accent) 78%, var(--gray-200) 78%); }

/* ---- Social Proof ------------------------------------------ */
.social-proof {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--gray-100);
}
.social-proof-label {
  text-align: center;
  font-size: .8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gray-400);
  margin-bottom: 1.25rem;
}
.logo-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
}
.logo-pill {
  padding: .5rem 1.25rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-500);
}

/* ---- Section Header ---------------------------------------- */
.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3.5rem;
}
.section-label {
  display: inline-block;
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--primary);
  margin-bottom: .75rem;
}
.section-header h2 { color: var(--gray-900); margin-bottom: .875rem; }
.section-header p  { font-size: 1.0625rem; }

/* ---- Features ---------------------------------------------- */
.features { padding: 6rem 0; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  padding: 1.75rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-md), transform var(--transition-md);
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.feature-icon-blue   { background: #eff6ff; color: var(--primary); }
.feature-icon-teal   { background: #ecfeff; color: var(--accent); }
.feature-icon-purple { background: #f5f3ff; color: #7c3aed; }
.feature-icon-green  { background: #ecfdf5; color: var(--success); }
.feature-icon-orange { background: #fff7ed; color: #c2410c; }
.feature-icon-red    { background: #fef2f2; color: var(--danger); }
.feature-card h3 { margin-bottom: .5rem; color: var(--gray-900); }

/* ---- How It Works ------------------------------------------ */
.how-it-works { padding: 6rem 0; background: var(--gray-50); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; }
.step { display: flex; gap: 1.25rem; }
.step-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-200);
  line-height: 1;
  flex-shrink: 0;
  min-width: 2.5rem;
}
.step-content h3 { color: var(--gray-900); margin-bottom: .5rem; }

/* ---- Testimonials ------------------------------------------ */
.testimonials { padding: 6rem 0; }
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.testimonial-card {
  padding: 1.75rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.testimonial-card p { font-size: 1rem; color: var(--gray-700); font-style: italic; margin-bottom: 1.25rem; line-height: 1.7; }
.testimonial-card footer { display: flex; align-items: center; gap: .875rem; }
.testimonial-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8125rem;
  font-weight: 700;
  flex-shrink: 0;
}
.testimonial-card footer strong { display: block; font-size: .9375rem; color: var(--gray-900); }
.testimonial-card footer span   { font-size: .8125rem; color: var(--gray-400); }

/* ---- Pricing ----------------------------------------------- */
.pricing-preview { padding: 6rem 0; background: var(--gray-50); }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}
.pricing-card {
  position: relative;
  padding: 2rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.pricing-card-featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,64,175,.1), var(--shadow-md);
}
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .25rem .875rem;
  border-radius: 100px;
}
.pricing-header { margin-bottom: 1.5rem; }
.pricing-header h3 { font-size: 1.25rem; color: var(--gray-900); margin-bottom: .5rem; }
.pricing-price { margin-bottom: .5rem; }
.pricing-price span { font-size: 2.25rem; font-weight: 800; color: var(--gray-900); }
.pricing-price { font-size: .9375rem; color: var(--gray-400); }
.pricing-features { flex: 1; margin-bottom: 1.5rem; }
.pricing-features li { padding: .4375rem 0; border-bottom: 1px solid var(--gray-100); font-size: .9375rem; color: var(--gray-600); }
.pricing-features li:last-child { border: none; }
.pricing-note { text-align: center; font-size: .875rem; color: var(--gray-400); margin-top: 1.5rem; }

/* ---- CTA Banner -------------------------------------------- */
.cta-banner {
  padding: 5rem 0;
  background: linear-gradient(135deg, var(--primary) 0%, #0c4a9e 50%, var(--accent) 100%);
}
.cta-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.cta-banner h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: .375rem; }
.cta-banner p  { color: rgba(255,255,255,.75); font-size: 1.0625rem; }
.cta-banner-actions { display: flex; gap: .875rem; flex-wrap: wrap; }

/* ---- Footer ------------------------------------------------ */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 4rem 0 0;
}
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 3rem;
}
.footer-brand .nav-logo-text { color: #fff; }
.footer-tagline { font-size: .9rem; margin: 1rem 0; line-height: 1.6; }
.footer-badges { display: flex; flex-wrap: wrap; gap: .5rem; }
.footer-badges span {
  padding: .25rem .625rem;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 100px;
  font-size: .75rem;
  color: var(--gray-400);
}
.footer-links { display: contents; }
.footer-col h4 { color: #fff; font-size: .875rem; font-weight: 600; margin-bottom: 1rem; }
.footer-col li + li { margin-top: .5rem; }
.footer-col a { color: var(--gray-400); font-size: .9rem; transition: color var(--transition); }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 1.5rem;
  text-align: center;
  font-size: .8125rem;
}
.footer-disclaimer { margin-top: .5rem; color: var(--gray-600); font-size: .775rem; max-width: 600px; margin-inline: auto; }

/* ---- Alerts ------------------------------------------------ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  border-radius: var(--radius-md);
  padding: .875rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid transparent;
  animation: slideDown 200ms ease both;
  margin-bottom: 1.25rem;
}
.alert p { margin: 0; }
.alert-error   { background: var(--color-danger-bg);  border-color: var(--color-danger-border);  color: var(--color-danger-text, var(--color-danger)); }
.alert-success { background: var(--color-success-bg); border-color: var(--color-success-border); color: var(--color-success); }
.alert-warning { background: var(--color-warning-bg); border-color: var(--color-warning-border); color: var(--color-warning-text, var(--color-warning)); }
.alert-info    { background: var(--color-info-bg);    border-color: var(--color-info-border);    color: var(--color-info); }
.alert-list { list-style: disc; padding-left: 1rem; }

/* ---- Forms ------------------------------------------------- */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .875rem; font-weight: 500; color: var(--text-secondary); margin-bottom: .375rem; }
.form-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.form-label-link { font-size: .8125rem; color: var(--primary); }
.form-input {
  display: block;
  width: 100%;
  padding: .5625rem .75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: .9375rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-surface);
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  box-sizing: border-box;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-input::placeholder { color: var(--text-subtle, var(--text-disabled)); }
.form-input-code {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: .25em;
  font-weight: 600;
}
.form-hint { font-size: .8125rem; color: var(--text-muted); margin-top: .375rem; display: block; }

.input-wrap { position: relative; }
.input-wrap .form-input { padding-right: 2.75rem; }
.input-toggle-vis {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  padding: .25rem;
  border-radius: 4px;
}
.input-toggle-vis:hover { color: var(--gray-600); }

.form-check { display: flex; align-items: flex-start; gap: .625rem; }
.form-checkbox {
  width: 16px; height: 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  appearance: none;
  cursor: pointer;
  position: relative;
  transition: border-color var(--transition), background var(--transition);
}
.form-checkbox:checked { background: var(--primary); border-color: var(--primary); }
.form-checkbox:checked::after {
  content: '';
  position: absolute;
  top: 1px; left: 4px;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.form-check-label { font-size: .875rem; color: var(--gray-600); line-height: 1.5; }
.form-check-label a { color: var(--primary); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: .875rem;
  margin: 1.25rem 0;
  color: var(--gray-400);
  font-size: .8125rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* ---- Auth pages -------------------------------------------- */
.auth-body { background: var(--gray-50); min-height: 100vh; }
.auth-layout {
  display: grid;
  grid-template-columns: 480px 1fr;
  min-height: 100vh;
}
.auth-layout-centered { grid-template-columns: 1fr; align-items: center; }
.auth-brand-panel {
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 50%, var(--accent) 100%);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.auth-brand-logo {
  display: flex;
  align-items: center;
  gap: .625rem;
  text-decoration: none;
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.auth-brand-body { flex: 1; display: flex; align-items: center; }
.auth-brand-body blockquote {
  border-left: 3px solid rgba(255,255,255,.3);
  padding-left: 1.25rem;
}
.auth-brand-body blockquote p {
  color: rgba(255,255,255,.9);
  font-size: 1.0625rem;
  font-style: italic;
  line-height: 1.7;
  margin-bottom: .75rem;
}
.auth-brand-body blockquote footer { color: rgba(255,255,255,.6); font-size: .875rem; }
.auth-brand-body h2 { color: #fff; font-size: 1.375rem; margin-bottom: 1rem; }
.auth-brand-list li { color: rgba(255,255,255,.85); padding: .375rem 0; font-size: .9375rem; }
.auth-brand-badges { display: flex; flex-wrap: wrap; gap: .5rem; }
.auth-brand-badges span {
  padding: .3125rem .75rem;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 100px;
  font-size: .75rem;
  color: rgba(255,255,255,.7);
}
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background: #fff;
  overflow-y: auto;
}
.auth-panel-solo {
  max-width: 480px;
  width: 100%;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  margin: 2rem auto;
}
.auth-form-wrap { width: 100%; max-width: 420px; }
.auth-title { font-size: 1.875rem; color: var(--gray-900); margin-bottom: .375rem; }
.auth-subtitle { color: var(--gray-500); font-size: .9375rem; margin-bottom: 1.75rem; }
.auth-switch { text-align: center; font-size: .9rem; color: var(--gray-500); margin-top: 1.25rem; }
.auth-switch a { color: var(--primary); font-weight: 500; }
.auth-mfa-icon { text-align: center; margin-bottom: 1.25rem; }
.auth-success-state { text-align: center; }
.auth-success-icon { margin: 0 auto 1rem; width: fit-content; }
.auth-brand-logo-inline {
  display: flex; align-items: center; gap: .625rem;
  margin-bottom: 2rem;
  text-decoration: none;
}

/* ---- App Layout (Dashboard) -------------------------------- */
.app-body { background: var(--bg-body); }
.app-layout { display: flex; min-height: 100vh; background: var(--bg-body); }
.app-main { flex: 1; overflow: hidden; background: var(--bg-body); }

.app-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.sidebar-header {
  padding: 1rem 1rem .75rem;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-header .nav-logo-text { color: var(--text-primary); font-size: 1rem; }
.sidebar-nav { padding: .75rem 0; flex: 1; }
.sidebar-nav ul { padding: 0 .5rem; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 500;
  color: var(--sidebar-link-color);
  transition: background-color var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
  margin: 1px 0;
}
.sidebar-link:hover { background: var(--sidebar-link-hover-bg); color: var(--text-primary); }
.sidebar-link.active { background: var(--sidebar-link-active-bg); color: var(--sidebar-link-active-color); font-weight: 600; }
.sidebar-link-logout { color: var(--color-danger); }
.sidebar-link-logout:hover { background: var(--color-danger-bg); color: var(--color-danger); }
.sidebar-divider { height: 1px; background: var(--sidebar-border); margin: .75rem .5rem; }

.app-topbar {
  height: 56px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.sidebar-toggle-btn { color: var(--text-muted); padding: .375rem; border-radius: var(--radius-sm); }
.sidebar-toggle-btn:hover { background: var(--bg-alt); color: var(--text-secondary); }
.topbar-right { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.topbar-alert {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .25rem .75rem;
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-full);
  font-size: .8125rem;
  font-weight: 500;
  color: var(--color-warning-text);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition);
}
.topbar-alert:hover { background: #fef3c7; color: var(--color-warning-text); }
.topbar-user { display: flex; align-items: center; gap: .625rem; }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  transition: transform var(--transition-fast);
  cursor: default;
}
.user-avatar:hover { transform: scale(1.05); }
.user-name { font-size: .875rem; font-weight: 500; color: var(--text-secondary); }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}
.page-header h1 { font-size: 1.375rem; font-weight: 700; color: var(--text-primary); margin: 0; letter-spacing: -.02em; }

/* ---- Stat widgets ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; } }
.stat-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}
.stat-widget:hover { box-shadow: var(--shadow-md); }
.stat-widget-warn  { border-top: 3px solid var(--color-warning); }
.stat-widget-success { border-top: 3px solid var(--color-success); }
.stat-widget-value { font-size: 1.875rem; font-weight: 700; line-height: 1; color: var(--text-primary); }
.stat-widget-label { font-size: .8125rem; font-weight: 500; color: var(--text-muted); margin-top: .375rem; }
.stat-widget-sub   { font-size: .75rem; color: var(--primary); margin-top: .5rem; }
.stat-widget-warn .stat-widget-value    { color: var(--warning); }
.stat-widget-success .stat-widget-value { color: var(--success); }

.welcome-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.welcome-card-icon { flex-shrink: 0; }
.welcome-card h2 { font-size: 1.25rem; color: var(--text-primary); margin-bottom: .5rem; }
.welcome-card p { margin-bottom: 1.5rem; }
.getting-started-steps { display: flex; flex-direction: column; gap: 1rem; }
.gs-step {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-alt);
}
.gs-step.gs-done { opacity: .6; }
.gs-num {
  width: 28px; height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8125rem;
  font-weight: 700;
  flex-shrink: 0;
}
.gs-done .gs-num { background: var(--success); }
.gs-step strong { display: block; font-size: .9375rem; color: var(--gray-900); margin-bottom: .25rem; }
.gs-step p { font-size: .875rem; margin-bottom: 0; }

/* ---- Page Hero (inner pages) ------------------------------- */
.page-hero {
  padding: 4rem 0 3.5rem;
  background: linear-gradient(135deg, #f8faff 0%, #eff6ff 100%);
  border-bottom: 1px solid var(--gray-200);
  text-align: center;
}
.page-hero h1 { max-width: 760px; margin: .75rem auto 1.25rem; color: var(--gray-900); }
.page-hero-sub { font-size: 1.125rem; max-width: 680px; margin: 0 auto; }

/* ---- Product page ------------------------------------------ */
.product-section { padding: 6rem 0; }
.product-section-alt { background: var(--gray-50); }
.product-row { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; }
.product-row-reverse { direction: rtl; }
.product-row-reverse > * { direction: ltr; }
.product-text .section-label { margin-bottom: .75rem; }
.product-text h2 { margin-bottom: 1rem; }
.product-text > p { margin-bottom: 1.5rem; }
.feature-list { display: flex; flex-direction: column; gap: 1rem; }
.feature-list li { display: flex; gap: .875rem; }
.feature-list-icon {
  width: 22px; height: 22px;
  background: #d1fae5;
  color: var(--success);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.feature-list strong { display: block; color: var(--gray-900); margin-bottom: .25rem; }
.feature-list p { font-size: .9rem; margin-bottom: 0; }

.product-card-demo {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}
.demo-progress-header { display: flex; justify-content: space-between; font-size: .875rem; font-weight: 500; color: var(--gray-600); margin-bottom: .375rem; }
.demo-pct { font-weight: 700; color: var(--gray-900); }
.demo-progress-bar-wrap { height: 8px; background: var(--gray-100); border-radius: 4px; margin-bottom: 1rem; overflow: hidden; }
.demo-progress-fill { height: 100%; border-radius: 4px; transition: width .5s ease; }
.demo-finding { display: flex; align-items: center; gap: .625rem; padding: .625rem; background: var(--gray-50); border-radius: var(--radius-sm); margin-bottom: .5rem; font-size: .875rem; color: var(--gray-600); }
.finding-badge { padding: .2rem .5rem; border-radius: 4px; font-size: .75rem; font-weight: 700; }
.finding-high   { background: #fef2f2; color: var(--danger); }
.finding-medium { background: #fef3c7; color: var(--warning); }
.demo-section-label { font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--gray-400); margin-bottom: 1rem; }
.demo-check-item { padding: .625rem .75rem; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: .375rem; display: flex; align-items: center; gap: .625rem; }
.demo-check-done::before { content: '✓'; color: var(--success); font-weight: 700; }
.demo-check-warn::before { content: '⚠'; color: var(--warning); }
.demo-check-fail::before { content: '✕'; color: var(--danger); }
.demo-check-done { background: #ecfdf5; color: #065f46; }
.demo-check-warn { background: #fffbeb; color: #92400e; }
.demo-check-fail { background: #fef2f2; color: #991b1b; }

.risk-matrix { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-md); }
.risk-matrix-label { font-size: .875rem; font-weight: 600; color: var(--gray-500); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: .08em; }
.risk-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .375rem; }
.risk-cell { padding: .75rem .5rem; border-radius: var(--radius-sm); text-align: center; font-size: .75rem; font-weight: 700; }
.risk-critical { background: #fee2e2; color: #991b1b; }
.risk-high     { background: #fef3c7; color: #92400e; }
.risk-medium   { background: #fffbeb; color: #b45309; }
.risk-low      { background: #ecfdf5; color: #065f46; }

.demo-task-item { display: flex; align-items: center; gap: .75rem; padding: .75rem; border-radius: var(--radius-sm); margin-bottom: .5rem; font-size: .9rem; }
.task-status { padding: .2rem .625rem; border-radius: 100px; font-size: .75rem; font-weight: 600; flex-shrink: 0; }
.demo-task-done     { background: #ecfdf5; }
.task-status.done   { background: #d1fae5; color: #065f46; }
.demo-task-progress { background: #eff6ff; }
.task-status.progress { background: #dbeafe; color: #1e40af; }
.demo-task-open     { background: var(--gray-50); }
.task-status.open   { background: var(--gray-200); color: var(--gray-600); }

.report-features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.report-feature {
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  text-align: center;
}
.report-feature-icon { font-size: 2rem; margin-bottom: .875rem; }
.report-feature h3 { margin-bottom: .5rem; }

/* ---- About page -------------------------------------------- */
.mission-section { padding: 6rem 0; }
.mission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.mission-statement h2 { margin-bottom: 1rem; }
.mission-statement p + p { margin-top: 1rem; }
.mission-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.stat-card {
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.stat-number { font-size: 2.25rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: .375rem; }
.stat-label  { font-size: .875rem; color: var(--gray-500); }

.values-section { padding: 6rem 0; background: var(--gray-50); }
.values-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.value-card { padding: 1.75rem; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); }
.value-icon { font-size: 2rem; margin-bottom: 1rem; }

.team-section { padding: 6rem 0; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.team-card { text-align: center; padding: 1.75rem; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); }
.team-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}
.team-title { font-size: .8125rem; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .75rem; }
.team-bio  { font-size: .875rem; color: var(--gray-500); line-height: 1.6; }

.security-section { padding: 6rem 0; background: var(--gray-50); }
.security-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.security-item { padding: 1.5rem; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); }
.security-item h4 { margin-bottom: .5rem; color: var(--gray-900); }

/* ---- Responsive -------------------------------------------- */
@media (max-width: 1100px) {
  .hero-screenshot { display: none; }
  .hero-content { max-width: 100%; }
  .footer-container { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { padding: 2rem 1rem; }

  .product-row { grid-template-columns: 1fr; gap: 2.5rem; }
  .product-row-reverse { direction: ltr; }
  .mission-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-menu, .nav-actions .btn-outline { display: none; }
  .nav-toggle { display: flex; }
  .nav-menu.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--bg-surface);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    z-index: 99;
  }
  .site-header { position: relative; }

  .hero { padding: 3rem 0 2.5rem; }
  .cta-banner-content { flex-direction: column; text-align: center; }
  .features-grid, .testimonials-grid, .pricing-grid { grid-template-columns: 1fr; }

  .app-sidebar { display: none; }
  .app-sidebar.open { display: flex; position: fixed; inset: 0 auto 0 0; z-index: 200; width: 240px; }
  .footer-container { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .steps { grid-template-columns: 1fr; }
}

/* ---- Theme Toggle Button ------------------------------------------- */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--gray-500);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--gray-100); color: var(--gray-700); }
.theme-icon-moon { display: block; }
.theme-icon-sun  { display: none; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun  { display: block; }

/* ---- Sidebar admin label ------------------------------------------- */
.sidebar-section-label {
  padding: 16px 20px 4px;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-top: .25rem;
}

/* ---- Sidebar collapsible groups ------------------------------------ */
.sidebar-group { border: none; }
.sidebar-group summary.sidebar-group-label {
  list-style: none;
  cursor: pointer;
  padding: .3rem .75rem .3rem 1rem;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  margin-top: .375rem;
}
.sidebar-group summary.sidebar-group-label::-webkit-details-marker { display: none; }
.sidebar-group summary.sidebar-group-label::after {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform .2s ease;
  flex-shrink: 0;
}
.sidebar-group[open] summary.sidebar-group-label::after { transform: rotate(90deg); }
.sidebar-group summary.sidebar-group-label:hover { color: var(--text-secondary); }
.sidebar-group > ul { margin: 0; padding: 0; }

/* ---- Admin / Questions table --------------------------------------- */
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.admin-toolbar .form-input { max-width: 260px; }
/* ---- Filter row / select ---- */
.filter-row {
  display: flex; flex-wrap: wrap; gap: .625rem; align-items: center;
  margin-bottom: 1.25rem;
}
.filter-select {
  padding: .5rem .75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .625rem center;
  padding-right: 2rem;
  appearance: none;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: auto; min-width: 140px; max-width: 200px;
}
.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* ---- Tables ---- */
.data-table-wrap {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead th {
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .625rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  text-align: left;
}
/* Legacy selector support */
.data-table th {
  padding: .625rem 1rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border-color);
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.data-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-fast);
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody td { padding: .75rem 1rem; font-size: .875rem; color: var(--text-secondary); vertical-align: middle; }
.data-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: top;
  font-size: .875rem;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }
.data-table .q-code { font-family: var(--font-mono); font-size: .8125rem; color: var(--primary); font-weight: 600; white-space: nowrap; }
.data-table .q-text { max-width: 380px; }
.data-table .q-text p { font-size: .875rem; margin-bottom: 0; color: var(--gray-700); }
.scope-badge {
  display: inline-block;
  padding: .2rem .625rem;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.scope-org            { background: #eff6ff; color: var(--primary); }
.scope-location       { background: #ecfdf5; color: var(--success); }
.scope-ephi           { background: #fdf4ff; color: #7c3aed; }
.scope-location_ephi  { background: #fff7ed; color: #c2410c; }
.status-active   { color: var(--success); font-weight: 600; }
.status-inactive { color: var(--gray-400); }

.import-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  background: var(--gray-50);
  margin-bottom: 1rem;
  transition: border-color var(--transition), background var(--transition);
}
.import-zone:hover, .import-zone.dragover {
  border-color: var(--primary-light);
  background: #eff6ff;
}
.import-zone p { font-size: .9375rem; margin-bottom: .75rem; }
.table-empty {
  text-align: center;
  padding: 3rem;
  color: var(--gray-400);
}

/* ---- Dark Mode ------------------------------------------------------ */
[data-theme="dark"] {
  color-scheme: dark;

  /* Semantic shorthand aliases */
  --bg:      #0f172a;
  --bg-card: #1e293b;
  --border:  #334155;

  --bg-body:           #0f172a;
  --bg-surface:        #1e293b;
  --bg-surface-raised: #253347;
  --bg-alt:            #162032;
  --bg-hover:          #253347;

  --text-primary:   #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted:     #94a3b8;
  --text-subtle:    #64748b;
  --text-disabled:  #475569;

  --border-color:  #334155;
  --border-strong: #475569;
  --border-focus:  #60a5fa;

  /* Semantic light variants — dark equivalents */
  --success-light:  #064e3b;
  --warning-light:  #451a03;
  --danger-light:   #450a0a;
  --info-light:     #0c4a6e;

  --color-success:        #34d399;
  --color-success-bg:     #064e3b;
  --color-success-border: #065f46;
  --color-warning:        #fbbf24;
  --color-warning-bg:     #451a03;
  --color-warning-border: #78350f;
  --color-warning-text:   #fcd34d;
  --color-danger:         #f87171;
  --color-danger-bg:      #450a0a;
  --color-danger-border:  #7f1d1d;
  --color-danger-text:    #fca5a5;
  --color-info:           #38bdf8;
  --color-info-bg:        #0c4a6e;
  --color-info-border:    #0369a1;
  --color-purple:         #a78bfa;
  --color-purple-bg:      #2e1065;

  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6), 0 8px 10px -6px rgb(0 0 0 / 0.4);

  --sidebar-bg:               #1e293b;
  --sidebar-border:           #334155;
  --sidebar-link-color:       #94a3b8;
  --sidebar-link-hover-bg:    #253347;
  --sidebar-link-active-bg:   rgba(37,99,235,.2);
  --sidebar-link-active-color:#60a5fa;
  --primary-light:            rgba(37,99,235,.2);
  --primary-text:             #60a5fa;

  /* Legacy aliases */
  --gray-50:  #162032;
  --gray-100: #1e293b;
  --gray-200: #334155;
  --gray-300: #475569;
  --gray-400: #64748b;
  --gray-500: #94a3b8;
  --gray-600: #cbd5e1;
  --gray-700: #e2e8f0;
  --gray-800: #f1f5f9;
  --gray-900: #f8fafc;
}

/* Base */
[data-theme="dark"] body {
  background: var(--bg-body);
  color: var(--text-primary);
}
[data-theme="dark"] p { color: var(--text-muted); }
[data-theme="dark"] h1,[data-theme="dark"] h2,[data-theme="dark"] h3,
[data-theme="dark"] h4,[data-theme="dark"] h5,[data-theme="dark"] h6 { color: var(--text-primary); }
[data-theme="dark"] a { color: #60a5fa; }
[data-theme="dark"] a:hover { color: #93c5fd; }

/* Navigation */
[data-theme="dark"] .site-header {
  background: rgba(15,23,42,.92);
  border-bottom-color: rgba(255,255,255,.08);
}
[data-theme="dark"] .nav-logo-text { color: #f1f5f9; }
[data-theme="dark"] .nav-link { color: #94a3b8; }
[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active { color: #f1f5f9; background: rgba(255,255,255,.07); }
[data-theme="dark"] .nav-toggle span { background: #94a3b8; }
[data-theme="dark"] .nav-menu.open {
  background: #1e293b;
  border-bottom-color: rgba(255,255,255,.08);
}
[data-theme="dark"] .theme-toggle { color: #94a3b8; }
[data-theme="dark"] .theme-toggle:hover { background: rgba(255,255,255,.07); color: #e2e8f0; }

/* Buttons */
[data-theme="dark"] .btn-outline {
  color: #60a5fa;
  border-color: #60a5fa;
}
[data-theme="dark"] .btn-outline:hover { background: rgba(96,165,250,.1); color: #93c5fd; }
[data-theme="dark"] .btn-ghost {
  background: rgba(255,255,255,.06);
  color: #cbd5e1;
  border-color: rgba(255,255,255,.12);
}
[data-theme="dark"] .btn-ghost:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #f1f5f9; }
[data-theme="dark"] .btn-passkey {
  background: #1e293b;
  color: #e2e8f0;
  border-color: rgba(255,255,255,.12);
}
[data-theme="dark"] .btn-passkey:hover { background: #334155; }

/* Hero */
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0c1a2e 100%);
}
[data-theme="dark"] .hero-title { color: #f1f5f9; }
[data-theme="dark"] .hero-subtitle { color: #94a3b8; }
[data-theme="dark"] .hero-note { color: #475569; }
[data-theme="dark"] .hero-badge {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.1);
  color: #94a3b8;
}
[data-theme="dark"] .hero-glow-1 { background: #1e3a8a; opacity: .2; }
[data-theme="dark"] .hero-glow-2 { background: #164e63; opacity: .2; }
[data-theme="dark"] .hero-grid {
  background-image:
    linear-gradient(rgba(96,165,250,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96,165,250,.04) 1px, transparent 1px);
}

/* Cards and surfaces */
[data-theme="dark"] .feature-card,
[data-theme="dark"] .testimonial-card,
[data-theme="dark"] .pricing-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .value-card,
[data-theme="dark"] .security-item,
[data-theme="dark"] .team-card,
[data-theme="dark"] .report-feature,
[data-theme="dark"] .product-card-demo,
[data-theme="dark"] .risk-matrix {
  background: #1e293b;
  border-color: rgba(255,255,255,.08);
}
[data-theme="dark"] .feature-card h3,
[data-theme="dark"] .testimonial-card footer strong,
[data-theme="dark"] .security-item h4,
[data-theme="dark"] .team-card h3 { color: #f1f5f9; }
[data-theme="dark"] .testimonial-card p { color: #94a3b8; }

/* Section backgrounds */
[data-theme="dark"] .how-it-works,
[data-theme="dark"] .pricing-preview,
[data-theme="dark"] .values-section,
[data-theme="dark"] .security-section,
[data-theme="dark"] .product-section-alt { background: #1e293b; }
[data-theme="dark"] .social-proof { border-bottom-color: rgba(255,255,255,.06); }
[data-theme="dark"] .logo-pill { background: #1e293b; border-color: rgba(255,255,255,.08); color: #64748b; }

/* Section headings */
[data-theme="dark"] .section-header h2,
[data-theme="dark"] .step-content h3,
[data-theme="dark"] .page-hero h1 { color: #f1f5f9; }
[data-theme="dark"] .step-number { color: #334155; }
[data-theme="dark"] .page-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-bottom-color: rgba(255,255,255,.06);
}

/* Forms — base colors handled by variables; keeping specific overrides */
[data-theme="dark"] .form-check-label { color: var(--text-muted); }
[data-theme="dark"] .form-label-link { color: #60a5fa; }
[data-theme="dark"] .input-toggle-vis { color: var(--text-disabled); }
[data-theme="dark"] .input-toggle-vis:hover { color: var(--text-muted); }
[data-theme="dark"] .form-checkbox { border-color: rgba(255,255,255,.2); background: var(--bg-surface); }
[data-theme="dark"] .auth-divider { color: var(--text-disabled); }
[data-theme="dark"] .auth-divider::before,
[data-theme="dark"] .auth-divider::after { background: var(--border-color); }

/* Auth pages */
[data-theme="dark"] .auth-body { background: #0f172a; }
[data-theme="dark"] .auth-form-panel { background: #0f172a; }
[data-theme="dark"] .auth-panel-solo { background: #1e293b; border: 1px solid rgba(255,255,255,.08); }
[data-theme="dark"] .auth-title { color: #f1f5f9; }
[data-theme="dark"] .auth-subtitle { color: #64748b; }
[data-theme="dark"] .auth-switch { color: #64748b; }
[data-theme="dark"] .auth-switch a { color: #60a5fa; }

/* Alerts — handled by CSS variables */

/* App layout — dark mode handled by CSS variables above */
[data-theme="dark"] .gs-step strong { color: var(--text-primary); }

/* Footer */
[data-theme="dark"] .site-footer { background: #020617; }

/* Admin / questions table — dark mode handled by CSS variables */
[data-theme="dark"] .data-table .q-text p { color: var(--text-muted); }
[data-theme="dark"] .import-zone {
  border-color: rgba(255,255,255,.12);
  background: #1e293b;
}
[data-theme="dark"] .import-zone:hover,
[data-theme="dark"] .import-zone.dragover {
  border-color: #60a5fa;
  background: rgba(96,165,250,.07);
}

/* Pricing */
[data-theme="dark"] .pricing-price span,
[data-theme="dark"] .pricing-header h3 { color: #f1f5f9; }
[data-theme="dark"] .pricing-features li {
  border-bottom-color: rgba(255,255,255,.06);
  color: #94a3b8;
}
[data-theme="dark"] .pricing-note { color: #475569; }
[data-theme="dark"] .pricing-card-featured { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }

/* Screenshot mockup */
[data-theme="dark"] .screenshot-frame { background: #1e293b; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.06); }
[data-theme="dark"] .screenshot-header { background: #0f172a; border-bottom-color: rgba(255,255,255,.06); }
[data-theme="dark"] .mock-content { background: #0f172a; }
[data-theme="dark"] .mock-header-bar { background: #1e293b; }

/* ---- Tabs ---------------------------------------------------------- */
.tabs { }
.tab-list {
  display: flex;
  gap: .25rem;
  border-bottom: 2px solid var(--border-color);
  padding: 0 0 0 .25rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-list::-webkit-scrollbar { display: none; }
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .625rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
  margin-bottom: -2px;
  cursor: pointer;
}
.tab-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.tab-btn.active { color: var(--primary-text); border-bottom-color: var(--primary); font-weight: 600; }
.tab-count {
  font-size: .75rem;
  padding: .1rem .4rem;
  border-radius: var(--radius-full);
  background: var(--bg-alt);
  color: var(--text-muted);
  margin-left: .125rem;
}
.tab-btn.active .tab-count { background: var(--primary-light); color: var(--primary-text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 150ms ease; }

/* ---- Settings cards ------------------------------------------------ */
.settings-card,
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}
.settings-card:hover,
.card:hover { box-shadow: var(--shadow); }
@media (max-width: 768px) {
  .settings-card, .card { padding: 1rem; }
}

/* ---- Role checkbox grid -------------------------------------------- */
.role-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .5rem;
}
.role-checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .5rem .625rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  font-size: .875rem;
  color: var(--gray-700);
}
.role-checkbox-item:hover { background: var(--gray-50); border-color: var(--gray-300); }
.role-checkbox-item input[type="checkbox"]:checked ~ span { color: var(--primary); font-weight: 500; }
.role-checkbox-item:has(input:checked) { background: #eff6ff; border-color: #bfdbfe; }

/* ---- Modal --------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
  animation: fadeIn 150ms ease;
}
.modal-box {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: slideUp 200ms ease;
}

/* Dark mode: tabs and settings-card handled by CSS variables */

/* Dark mode: role checkbox grid */
[data-theme="dark"] .role-checkbox-item { border-color: rgba(255,255,255,.08); color: #94a3b8; }
[data-theme="dark"] .role-checkbox-item:hover { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.15); }
[data-theme="dark"] .role-checkbox-item:has(input:checked) { background: rgba(96,165,250,.1); border-color: rgba(96,165,250,.3); }

/* Dark mode: modal */
[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,.65); backdrop-filter: blur(2px); }
[data-theme="dark"] .modal-box { background: var(--bg-surface); border-color: var(--border-color); }

/* ==========================================================================
   Assessment view
   ========================================================================== */

/* Header row */
.assessment-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.assessment-view-meta h1 { font-size: 1.375rem; }
.assessment-view-sub { font-size: .875rem; color: var(--gray-500); margin-top: .25rem; }
.assessment-view-actions { display: flex; gap: .5rem; align-items: center; flex-shrink: 0; }

/* ---- Status badges ---- */
.status-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .6875rem; font-weight: 600;
  padding: .25rem .625rem;
  border-radius: var(--radius-full);
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
  flex-shrink: 0;
}
.status-badge-draft    { background: var(--bg-alt); color: var(--text-muted); border: 1px solid var(--border-color); }
.status-badge-progress { background: var(--color-info-bg); color: var(--color-info); border: 1px solid var(--color-info-border); }
.status-badge-review   { background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid var(--color-warning-border); }
.status-badge-done     { background: var(--color-success-bg); color: var(--color-success); border: 1px solid var(--color-success-border); }
.status-badge-open     { background: var(--color-danger-bg); color: var(--color-danger); border: 1px solid var(--color-danger-border); }
.status-badge-archived { background: var(--bg-alt); color: var(--text-disabled); border: 1px solid var(--border-color); }

/* ---- Progress bar ---- */
.assessment-progress {
  display: flex; align-items: center; gap: 1rem;
  margin: 1rem 0 1.5rem;
}
.assessment-progress-bar {
  flex: 1; height: 6px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.assessment-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: var(--radius-full);
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
.assessment-progress-label { font-size: .8125rem; color: var(--text-muted); white-space: nowrap; }

/* Question subcategory section */
.question-subcategory { margin-bottom: 2rem; }
.question-subcategory-title {
  font-size: .8125rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gray-400);
  padding-bottom: .5rem; border-bottom: 1px solid var(--gray-200);
  margin: 0 0 1rem;
}

/* Question card */
.question-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.125rem 1.25rem;
  margin-bottom: .75rem;
}
.question-header { display: flex; gap: .75rem; align-items: baseline; margin-bottom: .75rem; }
.question-code {
  font-family: var(--font-mono, monospace);
  font-size: .75rem; font-weight: 600;
  color: var(--primary); background: #eff6ff;
  padding: .15rem .45rem; border-radius: 4px;
  white-space: nowrap; flex-shrink: 0;
}
.question-text { margin: 0; font-size: .9375rem; line-height: 1.55; color: var(--text-primary); }

/* Guidance accordion */
.question-guidance {
  font-size: .85rem; color: var(--gray-500);
  margin-bottom: .875rem;
  border: 1px solid var(--border-color); border-radius: var(--radius);
  overflow: hidden;
}
.question-guidance summary {
  cursor: pointer; padding: .4rem .75rem;
  font-size: .8rem; font-weight: 500; color: var(--gray-400);
  list-style: none; user-select: none;
}
.question-guidance summary::-webkit-details-marker { display: none; }
.question-guidance[open] summary { border-bottom: 1px solid var(--border-color); }
.question-guidance p { padding: .625rem .75rem; margin: 0; line-height: 1.6; }

/* Scope group (per-location / per-ePHI) */
.scope-group { margin-bottom: .75rem; }
.scope-group-label {
  display: flex; align-items: center; gap: .375rem;
  font-size: .8rem; font-weight: 600; color: var(--gray-500);
  margin-bottom: .4rem;
}
.scope-setup-notice {
  display: flex; align-items: center; gap: .5rem;
  font-size: .85rem; color: var(--gray-500);
  background: var(--gray-50); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: .6rem .875rem;
}
.scope-setup-notice a { color: var(--primary); font-weight: 500; }

/* Answer widget */
.answer-widget { padding-top: .25rem; }
.answer-widget-locked { opacity: .75; pointer-events: none; }

.answer-btns {
  display: flex; flex-wrap: wrap; gap: .375rem;
  margin-bottom: .625rem;
}
.answer-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .35rem .875rem;
  font-size: .8125rem; font-weight: 500;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-surface); color: var(--gray-500);
  cursor: pointer; transition: all .12s;
}
.answer-btn:hover:not(:disabled) { border-color: var(--gray-400); color: var(--text-primary); }

.answer-btn-yes.active   { background: #dcfce7; border-color: #16a34a; color: #166534; font-weight: 600; }
.answer-btn-no.active    { background: #fee2e2; border-color: #dc2626; color: #991b1b; font-weight: 600; }
.answer-btn-partial.active { background: #fef9c3; border-color: #ca8a04; color: #854d0e; font-weight: 600; }
.answer-btn-na.active    { background: #f1f5f9; border-color: #94a3b8; color: #475569; font-weight: 600; }

.answer-btn-clear {
  padding: .35rem .5rem;
  color: var(--gray-400); border-style: dashed;
}
.answer-btn-clear:hover { color: var(--danger); border-color: var(--danger); }

.answer-meta {
  display: flex; flex-wrap: wrap; gap: .5rem;
  align-items: flex-start;
}
.answer-notes {
  flex: 1; min-width: 200px;
  font-size: .8125rem; min-height: 2.5rem; max-height: 8rem;
  resize: vertical; padding: .4rem .6rem;
}
.answer-assign {
  font-size: .8125rem; padding: .375rem .6rem;
  min-width: 160px; max-width: 220px;
}

.answer-status {
  font-size: .75rem; margin-top: .375rem;
  min-height: 1.2em;
}
.answer-status.saving  { color: var(--gray-400); }
.answer-status.saved   { color: #16a34a; }
.answer-status.error   { color: var(--danger); }

/* Form helper */
.form-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.form-row .form-group { min-width: 120px; }

/* Empty state */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--gray-500); font-size: .9375rem;
}

/* Alert — duplicate removed; canonical definitions are at the top of this file using CSS variables */

/* ==========================================================================
   Dark mode: assessment view
   ========================================================================== */
[data-theme="dark"] .status-badge-draft    { background: rgba(255,255,255,.07); color: #94a3b8; }
[data-theme="dark"] .status-badge-progress { background: rgba(59,130,246,.15); color: #60a5fa; }
[data-theme="dark"] .status-badge-review   { background: rgba(251,191,36,.12); color: #fbbf24; }
[data-theme="dark"] .status-badge-done     { background: rgba(34,197,94,.12); color: #4ade80; }
[data-theme="dark"] .status-badge-archived { background: rgba(255,255,255,.05); color: #64748b; }

/* assessment progress — handled by CSS variables */

[data-theme="dark"] .question-subcategory-title { color: #64748b; border-bottom-color: rgba(255,255,255,.08); }
[data-theme="dark"] .question-card { background: #1e293b; border-color: rgba(255,255,255,.08); }
[data-theme="dark"] .question-code { background: rgba(59,130,246,.15); color: #60a5fa; }
[data-theme="dark"] .question-text { color: #e2e8f0; }

[data-theme="dark"] .question-guidance { border-color: rgba(255,255,255,.08); color: #94a3b8; }
[data-theme="dark"] .question-guidance[open] summary { border-bottom-color: rgba(255,255,255,.08); }

[data-theme="dark"] .scope-group-label { color: #64748b; }
[data-theme="dark"] .scope-setup-notice { background: #0f172a; border-color: rgba(255,255,255,.08); color: #64748b; }

[data-theme="dark"] .answer-btn { background: #1e293b; border-color: rgba(255,255,255,.12); color: #94a3b8; }
[data-theme="dark"] .answer-btn:hover:not(:disabled) { border-color: rgba(255,255,255,.25); color: #e2e8f0; }
[data-theme="dark"] .answer-btn-yes.active    { background: rgba(34,197,94,.15); border-color: #4ade80; color: #4ade80; }
[data-theme="dark"] .answer-btn-no.active     { background: rgba(239,68,68,.15); border-color: #f87171; color: #f87171; }
[data-theme="dark"] .answer-btn-partial.active { background: rgba(234,179,8,.15); border-color: #facc15; color: #facc15; }
[data-theme="dark"] .answer-btn-na.active     { background: rgba(255,255,255,.07); border-color: #94a3b8; color: #94a3b8; }
[data-theme="dark"] .answer-btn-clear         { color: #64748b; }
[data-theme="dark"] .answer-btn-clear:hover   { color: #f87171; border-color: #f87171; }

[data-theme="dark"] .alert-error   { background: rgba(239,68,68,.15); color: #fca5a5; border-color: rgba(239,68,68,.3); }
[data-theme="dark"] .alert-success { background: rgba(34,197,94,.12); color: #4ade80; border-color: rgba(34,197,94,.25); }
[data-theme="dark"] .alert-warning { background: rgba(251,191,36,.1); color: #fbbf24; border-color: rgba(251,191,36,.3); }
[data-theme="dark"] .alert-info    { background: rgba(59,130,246,.12); color: #60a5fa; border-color: rgba(59,130,246,.25); }

/* Sidebar group arrow — dark mode uses a lighter stroke color */
[data-theme="dark"] .sidebar-group summary.sidebar-group-label::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Risk badges & colors
   ========================================================================== */
/* Risk level text colors */
.risk-critical { color: #7c3aed; }
.risk-high     { color: var(--danger); }
.risk-medium   { color: var(--warning); }
.risk-low      { color: var(--success); }

.risk-badge {
  display: inline-flex; align-items: center;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem; font-weight: 600; letter-spacing: .01em;
  white-space: nowrap;
}
.risk-badge-critical     { background: #f5f3ff; color: #6d28d9; }
.risk-badge-high         { background: var(--danger-light); color: #991b1b; }
.risk-badge-medium       { background: var(--warning-light); color: #92400e; }
.risk-badge-low          { background: var(--success-light); color: #065f46; }
.risk-badge-informational{ background: var(--gray-100); color: var(--gray-600); }

[data-theme="dark"] .risk-badge-critical      { background: rgba(239,68,68,.18); color: #fca5a5; }
[data-theme="dark"] .risk-badge-high          { background: rgba(249,115,22,.15); color: #fdba74; }
[data-theme="dark"] .risk-badge-medium        { background: rgba(234,179,8,.13); color: #fde047; }
[data-theme="dark"] .risk-badge-low           { background: rgba(59,130,246,.15); color: #93c5fd; }
[data-theme="dark"] .risk-badge-informational { background: rgba(255,255,255,.07); color: #94a3b8; }

/* ==========================================================================
   Answer badges (inline small)
   ========================================================================== */
.answer-badge {
  display: inline-flex; align-items: center;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .75rem; font-weight: 600;
  white-space: nowrap;
}
.answer-badge-yes     { background: #dcfce7; color: #166534; }
.answer-badge-no      { background: #fee2e2; color: #991b1b; }
.answer-badge-partial { background: #fef9c3; color: #854d0e; }
.answer-badge-na      { background: #f1f5f9; color: #475569; }

[data-theme="dark"] .answer-badge-yes     { background: rgba(34,197,94,.15); color: #4ade80; }
[data-theme="dark"] .answer-badge-no      { background: rgba(239,68,68,.15); color: #f87171; }
[data-theme="dark"] .answer-badge-partial { background: rgba(234,179,8,.13); color: #fde047; }
[data-theme="dark"] .answer-badge-na      { background: rgba(255,255,255,.07); color: #94a3b8; }

/* Answer dot (used in reports) */
.answer-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0;
}
.answer-dot.answer-yes     { background: #16a34a; }
.answer-dot.answer-partial { background: #ca8a04; }
.answer-dot.answer-no      { background: #dc2626; }
.answer-dot.answer-na      { background: #94a3b8; }

/* ==========================================================================
   Status pills (findings + remediation)
   ========================================================================== */
.status-finding-open        { background: #fee2e2; color: #991b1b; }
.status-finding-confirmed   { background: #ffedd5; color: #9a3412; }
.status-finding-mitigated   { background: #fef9c3; color: #854d0e; }
.status-finding-resolved    { background: #dcfce7; color: #166534; }
.status-finding-accepted    { background: #f1f5f9; color: #475569; }
.status-finding-false_positive { background: #f1f5f9; color: #475569; }

.status-rem-open        { background: #fee2e2; color: #991b1b; }
.status-rem-in_progress { background: #dbeafe; color: #1e40af; }
.status-rem-deferred    { background: #f3e8ff; color: #6b21a8; }
.status-rem-completed   { background: #dcfce7; color: #166534; }

[data-theme="dark"] .status-finding-open        { background: rgba(239,68,68,.15); color: #f87171; }
[data-theme="dark"] .status-finding-confirmed   { background: rgba(249,115,22,.13); color: #fdba74; }
[data-theme="dark"] .status-finding-mitigated   { background: rgba(234,179,8,.13); color: #fde047; }
[data-theme="dark"] .status-finding-resolved    { background: rgba(34,197,94,.12); color: #4ade80; }
[data-theme="dark"] .status-finding-accepted    { background: rgba(255,255,255,.07); color: #94a3b8; }
[data-theme="dark"] .status-finding-false_positive { background: rgba(255,255,255,.07); color: #94a3b8; }

[data-theme="dark"] .status-rem-open        { background: rgba(239,68,68,.15); color: #f87171; }
[data-theme="dark"] .status-rem-in_progress { background: rgba(59,130,246,.15); color: #93c5fd; }
[data-theme="dark"] .status-rem-deferred    { background: rgba(139,92,246,.15); color: #c4b5fd; }
[data-theme="dark"] .status-rem-completed   { background: rgba(34,197,94,.12); color: #4ade80; }

/* ==========================================================================
   Stat cards row (findings / remediation dashboards)
   ========================================================================== */
.stats-row {
  display: flex; flex-wrap: wrap; gap: .75rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  flex: 1; min-width: 120px; max-width: 200px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  display: flex; flex-direction: column; gap: .25rem;
}
.stat-card-value {
  font-size: 1.5rem; font-weight: 700; line-height: 1;
  color: var(--text-primary);
}
.stat-card-label {
  font-size: .75rem; color: var(--gray-500); font-weight: 500;
}
.stat-card-danger  .stat-card-value { color: var(--danger); }
.stat-card-warning .stat-card-value { color: var(--warning); }
.stat-card-success .stat-card-value { color: var(--success); }
/* Alias classes used by admin dashboard and physical-safeguards stats */
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); line-height: 1; margin: .125rem 0; }
.stat-sub   { font-size: .75rem; color: var(--gray-400); }

/* ==========================================================================
   Findings list / view
   ========================================================================== */
.finding-detail-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .finding-detail-grid { grid-template-columns: 1fr; }
}

.finding-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}
.finding-panel + .finding-panel { margin-top: 1rem; }
.finding-panel-title {
  font-size: .8125rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--gray-500);
  margin-bottom: 1rem;
}

/* ==========================================================================
   Remediation task cards
   ========================================================================== */
.remediation-task-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  margin-bottom: .625rem;
}
.remediation-task-card:last-child { margin-bottom: 0; }
.remediation-task-card-header {
  display: flex; align-items: flex-start; gap: .625rem;
  margin-bottom: .375rem;
}
.remediation-task-card-title {
  font-size: .875rem; font-weight: 600; flex: 1;
  color: var(--text-primary);
}
.remediation-task-card-meta {
  font-size: .75rem; color: var(--gray-500);
  display: flex; flex-wrap: wrap; gap: .5rem;
}

/* ==========================================================================
   Evidence file rows
   ========================================================================== */
.evidence-file-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .6875rem .875rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: .5rem;
}
.evidence-file-row:last-child { margin-bottom: 0; }
.evidence-file-icon {
  font-size: 1.25rem; flex-shrink: 0;
  color: var(--gray-400);
}
.evidence-file-name {
  flex: 1; font-size: .875rem; font-weight: 500; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.evidence-file-meta { font-size: .75rem; color: var(--gray-500); white-space: nowrap; }

/* Upload drag-and-drop zone */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  color: var(--gray-500);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary-light);
  background: rgba(59,130,246,.04);
}
.upload-zone input[type="file"] { display: none; }
.upload-zone-hint { font-size: .8125rem; margin-top: .375rem; }
.upload-selected-name {
  font-size: .875rem; font-weight: 500; color: var(--text-primary);
  margin-top: .5rem;
}

/* ==========================================================================
   Report styles
   ========================================================================== */
.report-toolbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}

.report-page {
  max-width: 900px; margin: 2rem auto 4rem;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.report-cover {
  background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
  color: #fff;
  padding: 3rem 3.5rem;
}
.report-logo {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 2.5rem;
  color: #fff;
}
.report-title {
  font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700;
  margin-bottom: .5rem; letter-spacing: -0.02em;
  color: #fff;
}
.report-subtitle {
  font-size: 1rem; color: rgba(255,255,255,.75);
  margin-bottom: 2rem;
}
.report-meta-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.report-meta-item { display: flex; flex-direction: column; gap: .25rem; }
.report-meta-key  { font-size: .75rem; color: rgba(255,255,255,.6); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.report-meta-val  { font-size: .9375rem; font-weight: 600; color: #fff; }

.report-section {
  padding: 2rem 3.5rem;
  border-bottom: 1px solid var(--border-color);
}
.report-section:last-child { border-bottom: none; }
.report-section-title {
  font-size: 1.125rem; font-weight: 700; margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.report-page-break { page-break-before: always; }

/* Score circle */
.report-score-grid {
  display: flex; flex-wrap: wrap; gap: 2rem; align-items: center;
}
.report-score-main { flex-shrink: 0; }
.report-score-circle {
  width: 130px; height: 130px;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border: 6px solid currentColor;
}
.score-green  { color: #16a34a; }
.score-yellow { color: #ca8a04; }
.score-red    { color: #dc2626; }
.score-number { font-size: 2rem; font-weight: 800; line-height: 1; }
.score-label  { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-top: .2rem; }

.report-answer-breakdown { flex: 1; min-width: 220px; }
.answer-row {
  display: flex; align-items: center; gap: .625rem;
  padding: .375rem 0;
  font-size: .875rem; color: var(--gray-600);
}
.answer-row strong { margin-left: auto; color: var(--text-primary); }

/* Risk summary bar */
.risk-summary-table { display: flex; flex-direction: column; gap: .5rem; }
.risk-summary-row {
  display: flex; align-items: center; gap: .75rem;
}
.risk-summary-bar-wrap {
  flex: 1; height: 8px; background: var(--gray-200);
  border-radius: 999px; overflow: hidden;
}
.risk-summary-bar {
  height: 100%; background: var(--primary-light);
  border-radius: 999px; transition: width .3s ease;
}

/* Detailed findings */
.report-finding {
  background: var(--gray-50);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
}
.report-finding:last-child { margin-bottom: 0; }
.report-finding-header {
  display: flex; align-items: center; gap: .625rem;
  flex-wrap: wrap;
  margin-bottom: .25rem;
}

/* Q&A table */
.report-qa-table {
  width: 100%; border-collapse: collapse;
  font-size: .875rem; margin-bottom: 1.5rem;
}
.report-qa-table th, .report-qa-table td {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left; vertical-align: top;
}
.report-qa-table th {
  font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--gray-500);
  background: var(--gray-50);
}
.report-footer {
  padding: 1.25rem 3.5rem;
  font-size: .8125rem; color: var(--gray-400);
  text-align: center;
  background: var(--gray-50);
}

/* Report cards (index list) */
.report-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: .75rem;
  display: flex; align-items: center; gap: 1.25rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.report-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}
.report-card-main { flex: 1; min-width: 0; }
.report-card-title {
  font-size: .9375rem; font-weight: 600; color: var(--text-primary);
  margin-bottom: .25rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.report-card-meta { font-size: .8125rem; color: var(--gray-500); display: flex; flex-wrap: wrap; gap: .625rem; }
.report-card-score {
  flex-shrink: 0; width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .9375rem; font-weight: 800;
  border: 3px solid currentColor;
}
.report-card-actions { flex-shrink: 0; }

/* ==========================================================================
   Security settings page
   ========================================================================== */
.security-method-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .875rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: .5rem;
}
.security-method-row:last-child { margin-bottom: 0; }
.security-method-icon {
  font-size: 1.375rem; flex-shrink: 0;
  color: var(--gray-400);
}
.security-method-info { flex: 1; min-width: 0; }
.security-method-name { font-size: .875rem; font-weight: 600; color: var(--text-primary); }
.security-method-detail { font-size: .75rem; color: var(--gray-500); }
.security-method-actions { display: flex; gap: .5rem; align-items: center; flex-shrink: 0; }

/* Session rows */
.session-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: .5rem;
  font-size: .875rem;
}
.session-row.current-session { border-color: var(--primary-light); background: rgba(59,130,246,.04); }
.session-row:last-child { margin-bottom: 0; }
.session-info { flex: 1; min-width: 0; }
.session-device { font-weight: 600; color: var(--text-primary); }
.session-meta { font-size: .75rem; color: var(--gray-500); }

/* Detail list (sidebar metadata) */
.detail-list { display: flex; flex-direction: column; gap: .625rem; }
.detail-list-row { display: flex; flex-direction: column; gap: .1rem; }
.detail-list-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--gray-500); }
.detail-list-value { font-size: .875rem; color: var(--text-primary); }

/* ==========================================================================
   Billing page
   ========================================================================== */
.billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.billing-plan-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: .75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.billing-plan-card.current {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(59,130,246,.08);
}
.billing-plan-name { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.billing-plan-price { font-size: 1.75rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.billing-plan-price span { font-size: .9rem; font-weight: 500; color: var(--gray-500); }
.billing-plan-features { display: flex; flex-direction: column; gap: .375rem; }
.billing-plan-feature { font-size: .875rem; color: var(--gray-600); display: flex; gap: .5rem; }
.billing-plan-feature::before { content: "✓"; color: var(--success); font-weight: 700; flex-shrink: 0; }

/* ==========================================================================
   Dark mode: new components — most handled by CSS variables now
   ========================================================================== */
[data-theme="dark"] .upload-zone:hover,
[data-theme="dark"] .upload-zone.drag-over { border-color: var(--border-focus); background: rgba(59,130,246,.08); }
[data-theme="dark"] .report-card:hover { border-color: var(--border-focus); }
[data-theme="dark"] .session-row.current-session { background: rgba(59,130,246,.08); border-color: #3b82f6; }
[data-theme="dark"] .billing-plan-card.current { border-color: #3b82f6; }
[data-theme="dark"] .risk-summary-bar-wrap { background: var(--border-strong); }
[data-theme="dark"] .answer-row { color: var(--text-muted); }
[data-theme="dark"] .report-answer-breakdown .answer-row strong { color: var(--text-primary); }

/* ==========================================================================
   Settings sub-navigation
   ========================================================================== */
.settings-subnav {
  display: flex; gap: .25rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0;
}
.settings-subnav-link {
  padding: .5rem .875rem;
  font-size: .875rem; font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
  display: inline-flex; align-items: center;
}
.settings-subnav-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.settings-subnav-link.active { color: var(--primary-text); border-bottom-color: var(--primary); font-weight: 600; }
[data-theme="dark"] .settings-subnav-link:hover { background: var(--bg-hover); }

/* ---- Notification Bell ------------------------------------------- */
.notif-bell { position: relative; }
.notif-bell-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: .375rem;
  border-radius: 8px;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  transition: background .15s;
}
.notif-bell-btn:hover { background: var(--gray-100); }
.notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  background: #ef4444;
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 200;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: scaleIn 150ms ease both;
  transform-origin: top right;
}
.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-primary);
}
.notif-mark-all {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .75rem;
  color: var(--primary);
  padding: 0;
}
.notif-list { overflow-y: auto; flex: 1; }
.notif-empty { padding: 1.5rem; text-align: center; color: var(--gray-400); font-size: .875rem; }
.notif-item {
  display: block;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-secondary);
  transition: background var(--transition-fast);
}
.notif-item:hover { background: var(--bg-hover); }
.notif-unread { background: var(--primary-light) !important; border-left: 3px solid var(--primary); }
[data-theme="dark"] .notif-unread { background: var(--sidebar-link-active-bg) !important; }
.notif-item-title { font-size: .875rem; font-weight: 500; margin-bottom: .2rem; color: var(--text-primary); }
.notif-item-body  { font-size: .8125rem; color: var(--text-muted); margin-bottom: .2rem; }
.notif-item-time  { font-size: .75rem; color: var(--text-disabled); }

/* ---- Global Search ------------------------------------------------------ */
.search-trigger {
  background: none; border: none; cursor: pointer;
  padding: .375rem; border-radius: 8px;
  color: var(--gray-600); display: flex; align-items: center;
  transition: background .15s;
}
.search-trigger:hover { background: var(--gray-100); }
.search-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 300; display: flex; align-items: flex-start;
  justify-content: center; padding-top: 10vh;
}
.search-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 540px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: scaleIn 150ms ease both;
}
.search-input {
  width: 100%; padding: 1rem 1.25rem; font-size: 1rem;
  border: none; outline: none;
  background: transparent;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}
.search-results { max-height: 360px; overflow-y: auto; }
.search-result-item {
  display: flex; align-items: center; gap: .625rem;
  padding: .75rem 1.25rem; text-decoration: none;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}
.search-result-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.search-result-type  { font-size: .6875rem; font-weight: 600; text-transform: uppercase; flex-shrink: 0; min-width: 80px; }
.search-result-title { flex: 1; font-size: .875rem; }
.search-result-meta  { font-size: .75rem; color: var(--text-disabled); flex-shrink: 0; }
/* Search result type label colors — use CSS variables for theme consistency */
.srch-type-finding            { color: var(--danger); }
.srch-type-assessment         { color: var(--primary); }
.srch-type-remediation        { color: var(--color-success); }
.srch-type-business_associate { color: #7c3aed; }
[data-theme="dark"] .srch-type-business_associate { color: #a78bfa; }
[data-theme="dark"] .search-overlay { background: rgba(0,0,0,.65); }

/* ==========================================================================
   Animations & Keyframes
   ========================================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.spinner { animation: spin 600ms linear infinite; }

/* Page entrance animations */
.app-content > * {
  animation: fadeInUp 220ms ease both;
}
.app-content > *:nth-child(1) { animation-delay: 0ms; }
.app-content > *:nth-child(2) { animation-delay: 40ms; }
.app-content > *:nth-child(3) { animation-delay: 80ms; }
.app-content > *:nth-child(4) { animation-delay: 120ms; }
.app-content > *:nth-child(5) { animation-delay: 160ms; }
.app-content > *:nth-child(n+6) { animation-delay: 200ms; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .app-content > *, [class*="animate"] {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Mobile Responsiveness
   ========================================================================== */
.app-content {
  padding: 1.5rem 2rem;
  max-width: 100%;
}

@media (max-width: 768px) {
  .app-content { padding: 1rem; }

  .app-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform var(--transition-md), box-shadow var(--transition-md);
    box-shadow: none;
    width: 240px;
  }
  .app-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .app-main { margin-left: 0 !important; }
  .sidebar-toggle-btn { display: flex !important; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .page-header .btn { width: 100%; }
  .filter-row { flex-direction: column; }
  .filter-row .filter-select { width: 100%; max-width: 100%; }
  .data-table-wrap { border-radius: var(--radius-md); font-size: .8125rem; }
  .data-table th, .data-table td { padding: .5rem .625rem; }
}

@media (min-width: 769px) {
  .sidebar-toggle-btn { display: none; }
  .app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
  }
  .app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }
}

/* ==========================================================================
   Sidebar overlay (mobile)
   ========================================================================== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 199;
  animation: fadeIn 200ms ease;
}
.sidebar-overlay.visible { display: block; }

/* Sidebar nav item aliases (alternate class names for flexibility) */
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--sidebar-link-color);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  margin: 1px 0;
}
.sidebar-nav-item:hover { background: var(--sidebar-link-hover-bg); color: var(--text-primary); }
.sidebar-nav-item.active { background: var(--sidebar-link-active-bg); color: var(--sidebar-link-active-color); font-weight: 600; }

/* ==========================================================================
   Empty states
   ========================================================================== */
.empty-state,
.table-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  font-size: .9375rem;
  animation: fadeIn 300ms ease;
}
.empty-state svg { opacity: 0.3; margin-bottom: 1rem; }
.empty-state p { font-size: .9375rem; margin: 0 0 1rem; }
.empty-state-icon { font-size: 2.5rem; margin-bottom: .75rem; opacity: .5; }

/* ==========================================================================
   Trial banner
   ========================================================================== */
.trial-banner {
  margin: .75rem;
  padding: .875rem;
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-md);
  font-size: .8125rem;
  animation: slideDown 300ms ease;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
  display: flex;
  align-items: center;
  gap: .75rem;
  justify-content: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   Loading bar (injected by JS)
   ========================================================================== */
#loading-bar {
  position: fixed; top: 0; left: 0; height: 2px;
  background: var(--primary); z-index: 9999;
  width: 0; pointer-events: none; opacity: 0;
  transition: width 200ms ease, opacity 300ms ease;
}

