@import url('/static/fonts/Figtree/figtree.css');

/* Global variables */
:root {
  --sans-font: "Figtree", -apple-system, BlinkMacSystemFont, "Avenir Next",
    Avenir, "Segoe UI", Roboto, "Noto Sans", Helvetica, Arial, sans-serif;

  --primary: #003BED;
  --primary-hover: #0333c2;
  --secondary: #b5eaea;
  --white: #ffffff;
  --bg: #FDFCFA;
  --bg-accent: #DDDFFF;
  --bg-accent-hover: #c1c4f6;
  --grey-xlight: #EBEDF8;
  --grey-light: #b4b3b3;
  --grey-med: #9F9F9F;
  --grey-deep: #313541;
  --text-xlight: #9ba3af;
  --border: var(--grey-xlight);
  --alert: #CC0101;
  --alert-hover: #a20808;
  --disabled: #9ba3af;

  --standard-border-radius: 8px;
  --container-max: 1200px;
  --border-width: 1px;
  --form-padding: 0.5rem 1rem;
  --form-border: 1px solid var(--border);
  --form-radius: var(--standard-border-radius);
  --form-spacing: 0.5rem;
  --row-height: 2.5rem;
}

@supports (color: oklch(1 0 0)) {
  :root {
    --primary: oklch(47.44% 0.26 263.83);
    --primary-hover: oklch(41.539% 0.22336 263.877);
    --secondary: oklch(0.90 0.09 180);
    --white: oklch(1 0 0);
    --bg: oklch(0.99 0.003 84.5);
    --bg-accent: oklch(0.912 0.0436 282.66);
    --bg-accent-hover: oklch(0.8348 0.0699 282.08);
    --grey-xlight: oklch(94.777% 0.01502 277.807);
    --grey-light: oklch(76.757% 0.00111 12.861);
    --grey-med: oklch(70.251% 0.00008 271.152);
    --grey-deep: oklch(33.01% 0.02199 270.68);
    --border: var(--grey-xlight);
    --alert: oklch(53.102% 0.21752 29.182);
    --alert-hover: oklch(0.45 0.18 28);
    --disabled: oklch(0.63 0.01 260);
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--sans-font);
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
  html { overflow-y: scroll; }
}

body {
  color: var(--grey-deep);
  background-color: var(--bg);
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}


/* Headers and Text */
h1 {
  color: var(--grey-deep);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 200;
  font-size: 1rem;
  margin-bottom: 2rem;
}

h2 {
  font-size: 1.8rem;
  margin-top: 3rem;
  color: var(--primary);
}

.h2 {
  margin-top: 1.5rem;
}

h3 {
  font-size: 1.4rem;
  margin-top: 3rem;
}

h4 {
  font-size: 1.1rem;
}

h5 {
  font-size: 1rem;
}

h6 {
  font-size: 0.96rem;
}

p {
  margin: 1rem 0;
}

form p {
  margin: 0 0 1rem 0;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  line-height: 1.2;
  font-weight: 600;
}

h1, h2, h3 a {
  font-weight: 600;
}

a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
a:hover {
  color: var(--primary-hover)
}

.text-center {
  text-align: center;
}

.para-small {
  font-size: 14px;
}


/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--standard-border-radius);
  border-width: var(--border-width);
  border-color: var(--primary);
  background-color: var(--primary);
  color: var(--white);
  padding: 0.4rem 1rem;
  font-size: 0.95rem;
  font-weight: 400;
  font-family: inherit;
  line-height: normal;
  text-decoration: none;
  min-height: var(--row-height);
}
.button:disabled,
.button[aria-disabled="true"] {
  background-color: var(--disabled);
  border-color: var(--disabled);
  color: var(--grey-med);
  cursor: not-allowed;
}
.button:hover:not(:disabled),
.button:focus:not(:disabled) {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--white);
}

.button--primary {
  border-color: var(--primary);
  border-radius: var(--standard-border-radius);
  background-color: var(--primary);
  color: var(--white);
  text-decoration: none;
  padding: 1em 2rem;
  font-size: 18px;
  font-weight: 400;
}
.button--primary:hover,
.button--primary:focus {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--white);
}

.button--secondary { 
  border-color: var(--primary);
  background-color: var(--bg-accent);
  color: var(--primary);
  font-weight: 400;
  padding: 0.6em 1rem;
}
.button--secondary:hover,
.button--secondary:focus {
  border-color: var(--primary-hover);
  background-color: var(--primary-hover);
  color: var(--white);
}

.button--danger {
  border-color: var(--alert);
  background-color: var(--alert);
  font-weight: 400;
  color: var(--white);
}
.button.button--danger:hover,
.button.button--danger:focus {
  background-color: var(--alert-hover);
  border-color: var(--alert-hover);
  color: var(--white);
}

/* === Status Badges === */
.badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 0.3rem 0.5rem 0.2rem;
  margin-left: 0.2rem;
  vertical-align: middle;
}

.badge--launched {
  background: var(--primary);
  color: var(--white);
}

.badge--closed {
  background: var(--disabled);
  color: var(--white);
}

/* Flex container */
.page-wrapper {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}
@supports (min-height: 100dvh) {
  .page-wrapper { min-height: 100dvh; } 
}


.public-page .page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
@supports (min-height: 100dvh) {
  .public-page .page-wrapper { min-height: 100dvh; }
}

/* App shell (no sidebar) */
.app-page .page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}
@supports (min-height: 100dvh) {
  .app-page .page-wrapper { min-height: 100dvh; }
}

/* Shared centered content width */
.app-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Main area should just provide background; the container controls width */
.app-page .main-content {
  flex: 1 1 auto;
  padding: 0;
  background: transparent;
  border: 0;
}

.container--narrow {
  max-width: 700px;
}


/* Nav links */
.nav-section {
  font-size: 0.75rem;
  color: var(--grey-med);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.sidebar-nav ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.sidebar-nav .nav-link svg[data-lucide] {
  width: 1rem; 
  height: 1rem;
  stroke: var(--grey-light); 
  margin-right: 0.2rem;
  transition: stroke 0.2s ease;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--grey-light); 
  font-size: 1rem;
  font-weight: 400;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background-color: var(--bg-accent-hover);
  color: var(--primary);
}

.nav-link:hover svg[data-lucide],
.nav-link.active svg[data-lucide] {
  stroke: var(--primary); /* blue icons on hover or active */
}


/* Scrollable main content area */
.main {
  grid-area: main;
  padding: 2rem;
  max-width: 100%;
  background-color: var(--bg);
}

.main-area {
  flex-direction: column;
  display: flex;
  background-color: var(--bg);
  min-height: 0;             /* prevents overflow in flex children */
  flex: 1 1 auto;  
}

.main-content {
  padding: 1rem 1.5rem 1rem 2rem;
  border-color: var(--bg);
  border-radius: var(--standard-border-radius);
  border-width: var(--border-width);
  flex: 1 1 auto; 
}

.main-heading {
  margin-bottom: 1rem;
}
#new-assessment {
  margin-bottom: 3rem;
}

.section {
  margin-bottom: 4rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-header h2 {
  margin: 0;
}

.section-header a:not(.button) {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary);
}

.section-header a:not(.button):hover {
  color: var(--primary-hover);
}


/* Header Bar (App) */

.app-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.app-header .header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--primary);
  white-space: nowrap;
}

.brand-mark {
  width: 32px;
  height: auto;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.primary-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 1.5rem;
}

.nav-item {
  color: var(--grey-med);
  font-weight: 500;
  text-decoration: none;
  padding: 0.35rem 1rem;
  border-radius: 6px;
}

.nav-item:hover,
.nav-item:focus-visible {
  color: var(--primary-hover);
  background: var(--bg-accent);
  outline: none;
}

.nav-item--icon {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.5rem;
}

.nav-item--icon i {
  width: 20px;
  height: 20px;
}

.nav-username {
  font-size: 0.9rem;
  color: var(--grey-med);
  font-weight: 500;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.logout-link {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0.25rem;
  border-radius: 6px;
}

.logout-link:hover,
.logout-link:focus-visible {
  color: var(--primary-hover);
  background: none;
  border: none;
  outline: none;
}

@media (max-width: 900px) {
  .app-header .header-inner {
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
  }

  .primary-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 1rem;
  }

  .header-actions {
    gap: 0.75rem;
  }
}

@media (max-width: 520px) {
  .brand-name {
    display: none;
  }

  .header-actions .button {
    display: none;
  }
}

/* Site footer */
.site-footer {
  background-color: var(--bg);
  border-top: 1px solid var(--border);
  color: var(--grey-light);
  padding: 1rem 0;
  margin-top: auto;          /* stick to bottom when space remains */
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.footer-logo {
  --logo-url: url('../images/orghealth-logo.svg');
  width: 110px;
  height: 22px;
  margin-bottom: 6px;
  background-color: currentColor;
  -webkit-mask: var(--logo-url) no-repeat center / contain;
          mask: var(--logo-url) no-repeat center / contain;
}

.site-footer .copyright {
  margin-left: .25rem;
  font-size: .8rem;
  font-weight: 400;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto; 
  font-size: .8rem;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
  font-weight: 400;
}
.footer-links a:hover { text-decoration: underline; }


/* Footer responsiveness */
@media (max-width: 900px) {
  .footer-inner {
    flex-direction: column;      /* stack items */
    align-items: center;         /* center horizontally */
    justify-content: center;     /* center vertically in the row */
    text-align: center;          /* center the copyright text */
    gap: .25rem;                 /* compact vertical spacing */
  }
  .footer-links {
    margin-left: 0;              /* remove push-to-right */
    flex-wrap: wrap;             /* allow multiple lines */
    gap: .5rem 1rem;
  }
  .footer-logo {
    width: 96px;                 /* scale logo down a touch */
    height: 20px;
    margin-bottom: 0;            /* no extra offset when stacked */
  }
  .site-footer {
    padding: .75rem 1rem;        /* slightly tighter padding on phones */
  }
}


/* Dashboard layout */
.grid {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.dashboard-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.dashboard-section {
  background-color: white;
}

/* Dashboard - Assessments widget */
.assessment-cards {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  gap: 1rem;
  justify-content: flex-start;
  align-items: stretch;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--standard-border-radius);
  padding: 2rem;
}

.assessment-cards .card {
  /* Target three columns: 3 cards per row when space allows.
     Never narrower than 320px, never wider than 520px. */
  width: clamp(320px, calc((100% - 2rem) / 3), 520px);
  flex: 0 1 auto; 
}

@media (max-width: 1100px) {
  .assessment-cards .card {
    width: clamp(320px, calc((100% - 1rem) / 2), 520px);
  }
}

@media (max-width: 720px) {
  .assessment-cards .card {
    width: 100%; 
  }
}

.card-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.card-header p {
  margin: 0.25rem 0 0.75rem;
  color: var(--grey-med);
}

.participant-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.participant-list li {
  padding: 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.participant-list li.incomplete {
  font-weight: bold;
  color: var(--alert);
}

/* Tables */

.table-wrapper {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--standard-border-radius);
  overflow-x: auto;
  padding: 1rem 2rem;
  margin-top: 2rem;
}

/* table with headers i.e. Assessment management, teams */
.table { 
  width: 100%;
  margin: 0rem;
  border-color: var(--white);
  background: var(--white);
  table-layout: fixed; 
}

.table thead th {
  font-weight: 600;
  color: var(--grey-deep);
  padding: 0.75rem 1rem;
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 2px solid var(--border);
  text-align: left;
  background: var(--white);
}
.table thead th.rightmost-column {
  text-align: right;
}


.table tbody tr {
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
}

.table tbody td {
  padding: 0.6rem 1rem;         /* tighten vertical spacing */
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;       /* center icons and text */
}

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

.table td { word-break: break-word; }

.email-cell,
.email-cell a {
  word-break: normal;
  overflow-wrap: anywhere; 
}

.table td.status-cell { text-align: left; }

.status-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

.table td.actions-cell {
  text-align: right;
  white-space: normal;
}

.table td input[type="text"],
.table td input[type="email"] {
  width: 100%;
  max-width: none;
  margin-bottom: 0; 
}

/* Lay out the resend button + transient message neatly */
.resend-form {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  max-width: 100%;
}

/* The message shouldn't push the column wider */
.message-slot {
  position: relative;
  display: inline-block;
  min-width: 0;     /* don't reserve space */
  width: auto;
}

.sent-message {
  position: static; 
  font-size: 0.875rem;
  font-weight: 500;
  padding-right: 10px;
  opacity: 0;
}

.sent-message[data-autofade] {
  opacity: 1;
  animation: msgFade var(--dur, 5s) forwards;
}

@keyframes msgFade {
  0%   { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

.status-icon.submitted {
  color: var(--check);
}

.status-icon.incomplete {
  color: var(--alert);
}

/* table list with no headers, i.e dashboard widgets */
.table-list { 
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Limit dashboard participant preview to ~6 rows and add a soft fade */
.table-list-wrap {
  position: relative;
  /* about 6 rows tall; adjust if your row height changes */
  max-height: calc(6 * 2.5rem + 5 * 1px); /* 6 rows * row-height + 5 borders */
  overflow: hidden;
}

.list-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5rem;                 /* thickness of the fade */
  pointer-events: none;
  /* fade from transparent to card background */
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--white));
  border-bottom-left-radius: var(--standard-border-radius);
  border-bottom-right-radius: var(--standard-border-radius);
}

.assessment-cards .card .table-list { margin-bottom: 0; }

.table-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--grey-med);
}

.table-row .row-left {
  font-weight: 500;
  color: var(--grey-deep);
}

.row-right {
  display: flex;
  align-items: center;
}

.row-right i[data-lucide] {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 2px;
  vertical-align: middle; /* optional, fallback */
}

.table-row .status-icon {
  width: 20px;
  height: 20px;
  stroke: var(--grey-med); /* default = gray */
}

.table-row.incomplete .status-icon {
  stroke: var(--alert); /* red if incomplete */
}

.row-button {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--grey-med);
  text-decoration: none;
  transition: color 0.2s ease;
  margin-left: 0.5rem;
}

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

/* Dashboard - Teams & Reports widgets */
.team-list,
.report-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.team-list li,
.report-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.report-list a {
  font-size: 0.875rem;
  color: var(--primary);
  margin-left: 0.5rem;
}

.report-list a:hover {
  color: var(--primary-hover);
}

@media (max-width: 768px) {
  .dashboard-bottom {
    grid-template-columns: 1fr;
  }
}

/* Dashboard - Welcome heading */

.welcome-subtitle {
  font-size: 1.05rem;
  color: var(--grey-deep);
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Dashboard - Assessment cards */
.assessment-card {
  border: 1px solid var(--border);
  border-radius: var(--standard-border-radius);
  padding: 1.5rem 2rem;
  margin-bottom: 1rem;
  background: var(--white);
}

.assessment-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.assessment-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--grey-deep);
}

.assessment-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.assessment-card-details {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.assessment-card-meta {
  flex: 0 0 auto;
  min-width: 160px;
}

.meta-line {
  color: var(--grey-med);
  font-size: 0.95rem;
  padding: 0.25rem 0;
}

.meta-label {
  font-weight: 500;
  color: var(--grey-med);
}

.assessment-card-participants {
  flex: 1;
  border-left: 1px solid var(--border);
  padding-left: 2rem;
}

.participant-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--grey-deep);
}

.participant-row:last-child {
  border-bottom: none;
}

.participant-row .status-icon {
  width: 20px;
  height: 20px;
}

.participant-row .status-icon.submitted {
  stroke: var(--grey-med);
}

.participant-row .status-icon.incomplete {
  stroke: var(--alert);
}

@media (max-width: 720px) {
  .assessment-card {
    padding: 1rem;
  }

  .assessment-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .assessment-card-details {
    flex-direction: column;
    gap: 1rem;
  }

  .assessment-card-participants {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
  }
}

/* Dashboard - Status badges */
.badge--draft {
  background: var(--grey-xlight);
  color: var(--grey-deep);
}

.badge--current {
  background: var(--secondary);
  color: var(--grey-deep);
}

/* Dashboard - Onboarding card (new user) */
.onboarding-card {
  border: 1px solid var(--border);
  border-radius: var(--standard-border-radius);
  background: var(--white);
  overflow: hidden;
}

.onboarding-steps {
  display: flex;
  gap: 1rem;
  padding: 2rem;
}

.onboarding-step {
  flex: 1;
  text-align: center;
}

.onboarding-step-number {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--grey-deep);
  margin-bottom: 0.25rem;
}

.onboarding-step-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--grey-deep);
  margin-bottom: 0.5rem;
}

.onboarding-step-desc {
  font-size: 0.9rem;
  color: var(--grey-med);
  margin: 0;
  line-height: 1.4;
}

.onboarding-bottom {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
}

.onboarding-text {
  flex: 1;
  margin: 0;
  color: var(--grey-deep);
  font-size: 0.95rem;
  line-height: 1.5;
}

.onboarding-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}

.onboarding-actions .button {
  white-space: nowrap;
  text-align: center;
}

@media (max-width: 900px) {
  .onboarding-steps {
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  .onboarding-step {
    flex: 1 1 calc(50% - 1rem);
    min-width: 140px;
  }
}

@media (max-width: 720px) {
  .onboarding-steps {
    flex-direction: column;
    gap: 1.5rem;
  }

  .onboarding-step {
    text-align: left;
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
  }

  .onboarding-step-number {
    flex-shrink: 0;
  }

  .onboarding-bottom {
    flex-direction: column;
    gap: 1rem;
  }

  .onboarding-actions {
    width: 100%;
  }

  .onboarding-actions .button {
    width: 100%;
  }
}


/* Public page */
.public-header {
  text-align: center;
  background-color: var(--bg-accent);
}

.public-header-logo {
  max-height: 80px;
  height: auto;
  width: auto;
  margin-top: 1.5rem;
}

.public-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background-color: var(--bg-accent);
  flex: 1 0 auto;
  padding: 1rem;
}

.public-box {
  background: white;
  padding: 2rem;
  border-radius: var(--standard-border-radius);
  max-width: 700px;
  width: 100%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.public-footer {
  text-align: center;
  background-color: var(--bg-accent);
  font-size: 0.8rem;
  padding: 1rem;
  color: var(--grey-med);
}

/* Utility */
.unstyled-link {
  text-decoration: none;
  color: inherit;
}

input[type="range"] {
  padding: 0;
}


/* Message boxes */

.box--msg {
  margin-bottom: 2rem;
  display: block;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  border: var(--border-width) solid var(--primary);
  border-left-width: 4px; 
  border-radius: var(--standard-border-radius);
  background: var(--bg-accent);
  color: var(--grey-deep);
  margin-bottom: 0.75rem;
}
.box--msg a {
  color: var(--primary);
  text-decoration: underline;
}
.box--msg a:hover {
  color: var(--primary-hover);
}

.box--msg-danger {
  border: var(--border-width) solid var(--alert);
  background: var(--white);
}





/* Set the cursor to '?' on an abbreviation and style the 
abbreviation to show that there is more information underneath */
abbr[title] {
  cursor: help;
  text-decoration-line: underline;
  text-decoration-style: dotted;
}

fieldset, dialog {
  border: var(--border-width) solid var(--border);
  padding: 1rem;
  border-radius: var(--standard-border-radius);
  margin-bottom: 1rem;
}


/* Format tables */
table {
  border-collapse: collapse;
  margin: 1.5rem 0;
}

td,
th {
  border: var(--border-width) solid var(--border);
  text-align: start;
  padding: 0.5rem;
}

th {
  background-color: var(--bg-accent);
  font-weight: bold;
}

tr:nth-child(even) {
  background-color: var(--bg-accent);
}

table caption {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

/* Format forms */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
  clip-path: inset(50%);
}

input:not([type="button"]):not([type="reset"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
textarea {
  font: inherit;
  color: var(--grey-deep);
  padding: var(--form-padding);
  margin-bottom: var(--form-spacing);
  border: var(--form-border);
  border-radius: var(--form-radius);
  background: var(--white);
  box-shadow: none;
  display: inline-block;
  width: 300px;
  max-width: 100%;
  height: var(--row-height);
}

/* Compact inputs only inside the editable table rows, not the add-member form */
#member-table .table td input[type="text"],
#member-table .table td input[type="email"] {
  margin-bottom: 0;
  height: var(--row-height);
}

/* Restore normal spacing for inputs in the Add New Member form under the table */
#member-table .form--extend-table input[type="text"],
#member-table .form--extend-table input[type="email"] {
  margin-bottom: var(--form-spacing);
}

select,
  .button:not(.button--primary) {
  height: var(--row-height);
  line-height: var(--row-height);
  padding-top: 0;
  padding-bottom: 0;
}

select {
  font: inherit;
  font-size: 16px;
  color: var(--grey-med);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg fill='none' stroke='%239ba3af' stroke-width='2' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E<path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.2rem;
  padding-left: 1rem;
  padding-right: 2rem;
  border: var(--form-border);
  border-radius: var(--form-radius);
  margin-bottom: var(--form-spacing);
  display: inline-block;
  width: 300px;
  max-width: 100%;
  height: var(--row-height);
}

button,
input[type="submit"],
input[type="reset"] {
  font: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  border-style: solid;
  border-width: var(--border-width);
  border-radius: var(--form-radius);
  border-color: var(--primary);
  background: var(--primary);
  color: var(--white);
  padding: var(--form-padding);
  line-height: normal;
  text-decoration: none;
  display: inline-block;
}
button:disabled,
input:disabled {
  background: var(--disabled);
  border-color: var(--disabled);
  color: var(--grey-med);
  cursor: not-allowed;
}
button:not(:disabled):not(.logout-link):hover,
input:not(:disabled):hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Ensure button elements styled as text-buttons never pick up filled-hover styles */
button.text-button,
button.text-button:hover,
input.text-button,
input.text-button:hover {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  text-decoration: none;
}


label {
  display: block;
  font-weight: 400;
  font-size: 14px;
  margin-bottom: 0.3rem;
  font-style: italic;
}

.form-group input,
.form-group textarea,
.form-group select {
  display: block;
  width: 100%;
}

.full-width {
  display: block !important;
  width: 100%  !important;
}

.notice {
  color: var(--alert);
  font-size: 1rem;
}

.form--extend-table {
  display: block;
  margin-top: 20px;
}

.element--actions-row {
  display: flex;
  gap: .5rem;
  align-items: stretch; 
}
.element--actions-row .button {
  display: inline-flex; 
  align-items: center;
  justify-content: center;
}


/* Hide native controls but keep them accessible to a11y tree and labels */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;              /* standard */
  -webkit-appearance: none;      /* Safari */
  -moz-appearance: none;         /* older Firefox */
  position: absolute !important; /* removes from layout but keeps in doc */
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;

  /* extra belt & suspenders so nothing paints */
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

label.custom-control {
  position: relative;
  padding-left: 2em;
  cursor: pointer;
}

/* shared box/circle */
label.custom-control::before {
  content: "";
  position: absolute;
  left: 0; 
  top: 0.2em;
  width: 1.2em; 
  height: 1.2em;
  border: var(--form-border);
  background: #fff;
  border-radius: var(--form-radius);
}

input[type="checkbox"]:focus-visible + label.custom-control::before,
input[type="radio"]:focus-visible + label.custom-control::before {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

input[type="checkbox"]:checked + label.custom-control::after {
  content: "\2713";
  position: absolute;
  left: 0.2em; 
  top: 0.1em;
  font-size: 1em;
  color: var(--primary);
}

label.custom-control.radio::before {
  border-radius: 50%;
}

input[type="radio"]:checked + label.custom-control.radio::after {
  content: "";
  position: absolute;
  left: 0.4em; 
  top: 0.4em;
  width: 0.4em; 
  height: 0.4em;
  border-radius: 50%;
  background: var(--primary);
}

@media (max-width:720px) {
  input:not([type="button"]):not([type="reset"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
  textarea,
  select {
    width: 100%;
  }

  .main-content {
    padding: 1rem;
  }

  .table-wrapper {
    padding: 0.75rem 1rem;
  }

  .add-form-card {
    padding: 1rem;
  }
}

/* Simplified containers for views with no sidebar */
.auth-container {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  padding: 4rem 1rem;
  background-color: var(--bg-accent);
}

.auth-box {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.auth-box form {
  display: block;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.auth-box input,
.auth-box button {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
}

.auth-box input,
.auth-box button,
.auth-box select,
.auth-box textarea {
  display: block !important;
  width: 100% !important;
}

.auth-box label {
  display: block;
}

.auth-box .helptext,
.auth-box ul {
  font-size: 0.875rem;
  color: var(--grey-med);
  line-height: 1.5rem;
}

.auth-box ul {
  list-style-type: disc;
  margin: 0.25rem 0 1rem;
  padding-left: 1.2rem;
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.auth-logo img {
  max-width: 240px;
  height: auto;
}


/* All forms */

.helptext {
  font-size: 0.875rem;
  color: var(--grey-med);
  line-height: 1.5rem;
}


/* Support form two-up row (Name + Email) */
.form-row { display: inline-flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
.form-row .form-group--button { flex: 0 0 auto; }
@media (max-width: 720px) { .form-row { display: block; } }

/* Terminology grid: 3 rows × 2 columns */
.terminology-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1rem;
}

.terminology-section .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 600px) {
  .terminology-section .form-row {
    grid-template-columns: 1fr;
  }
}

/* Support page form specifics */
.support-form .form-row--two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 720px) {
  .support-form .form-row--two { grid-template-columns: 1fr; }
}

/* Fields and labels in the support form */
.support-form .form-field label {
  display: block;
  margin-bottom: 0.375rem;
}
.support-form .form-field input,
.support-form .form-field select,
.support-form .form-field textarea {
  width: 100%;
  max-width: 100%;
}

/* Inline validation message under a field */
.support-form .field-error {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--alert);
}

/* Actions row and inline status message */
.form-actions { margin-top: 1rem; }
/* Reuse global .form-status colors; classes already exist */

/* Make support textarea taller by default */
textarea { 
  min-height: 6rem; 
}

/* Inline status message under the submit button */
.form-status { margin-top: .75rem; font-size: .95rem; }
.form-status--ok { color: var(--primary); }
.form-status--error { color: var(--alert); }


/* Misc body elements */

.text-button {
  background: transparent;
  border: none;
  color: var(--primary);
  padding: 0;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
a.text-button:hover,
button.text-button:hover,
input.text-button:hover {
  color: var(--primary-hover);
  text-decoration: underline;
  background: transparent;
}

.text-button--danger {
  color: var(--alert);
}
a.text-button--danger:hover,
button.text-button--danger:hover {
  color: var(--alert-hover);
}

/* Add-member form inside the narrow wizard container: fill available width */
.container--narrow .add-member-form .form-row {
  display: flex;
  width: 100%;
}

/* Don’t style non-clickable confirm copy like a link */
.actions-stack span.text-button {
  cursor: default;
}
.actions-stack span.text-button:hover {
  color: var(--alert);
  text-decoration: none;
  background: transparent;
}

hr {
  border: none;
  height: var(--border-width);
  background: var(--border);
  margin: 1rem auto;
}

img,
video {
  max-width: 100%;
  height: auto;
}

blockquote {
  margin-inline-start: 2rem;
  margin-inline-end: 0;
  margin-block: 2rem;
  padding: 0.4rem 0.8rem;
  border-inline-start: 0.35rem solid var(--primary);
  color: var(--grey-med);
  font-style: italic;
}

cite {
  font-size: 0.9rem;
  color: var(--grey-med);
  font-style: normal;
}

dt {
    color: var(--grey-med);
}

/* Superscript & Subscript */
/* Prevent scripts from affecting line-height. */
sup, sub {
  vertical-align: baseline;
  position: relative;
}

sup {
  top: -0.4em;
}

sub { 
  top: 0.3em; 
}

.notice {
  background: var(--bg-accent);
  border: var(--border-width) solid var(--border);
  border-radius: var(--standard-border-radius);
  padding: 1.5rem;
  margin: 2rem 0;
}

/* --- Respondent Assessment pager --- */

.assessment-form { 
  max-width: 720px; 
}

.assessment-form fieldset.question-card {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
  background: transparent; 
}
.assessment-form fieldset.question-card legend {
  margin: 0 0 1rem;
  font-weight: 600;
}

.progress-wrap { 
  margin: 0 0 3rem; 
}

.progress-bar { 
  height: 6px; 
  background: var(--bg-accent); 
  border-radius: 999px; 
  overflow: hidden; 
}
.progress-fill { 
  display: block; 
  height: 100%; 
  width: 0%; 
  background: var(--primary); 
  transition: width .25s ease; 
}
.progress-meta { 
  margin-top: .5rem; 
  color: var(--grey-med); 
  font-size: .9rem; 
}

.step { 
  display: none; 
}
.step.is-active { 
  display: block; 
}

.question-card { 
  background-color: white;
}
.question-card legend { 
  margin: 0 0 1rem;
  font-weight: 400;
  font-size: clamp(1.05rem, 1.1rem + 0.6vw, 1.35rem);
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  hyphenate-limit-chars: 11 5 5;
  -webkit-hyphenate-limit-before: 5;
  -webkit-hyphenate-limit-after: 5;
}
@media (max-width: 420px) {
  .question-card legend { margin: 1.5rem 0 .75rem; }
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}
@media (min-width: 720px) { .choices { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 360px) { .choices { grid-template-columns: 1fr; } }

.choice {
  display: flex; align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--standard-border-radius);
  padding: .6rem .75rem; background: #fff;
}
.choice:hover { 
  border-color: var(--primary); 
}
.choice:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-color: var(--primary);
}

.choice.is-selected {
  border-color: var(--primary);
  background: #f5fbff; 
}

.choice-label { 
  display: flex; 
  align-items: baseline; 
  gap: .5rem; 
  min-height: 3rem;
}
.choice-text { 
  color: var(--grey-med); 
  font-size: 1rem; 
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.choice input[type="radio"]:checked ~ .choice-label,
.choice input[type="radio"]:checked + .choice-label {
  color: var(--grey-deep); 
}
.choice input[type="radio"]:checked ~ .choice-label .choice-text,
.choice input[type="radio"]:checked + .choice-label .choice-text {
  color: var(--grey-deep);
}

.form-error {
  margin-top: .5rem;
  color: var(--alert);
  font-size: .95rem;
}

[hidden] {
  display: none !important;
}

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.form-error.is-visible { animation: nudge .25s; }

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}
.pager-actions { display: flex; gap: .5rem; align-items: center; }
@media (max-width: 420px) {
  .pager { flex-wrap: wrap; }
  .pager-actions { flex-wrap: wrap; width: 100%; justify-content: flex-end; }
}

/* Snapshot questions: 3-option grid */
.choices--three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .choices--three { grid-template-columns: 1fr; } }



/* --- Stripe and Checkout Page Payment --- */


.payment-summary { 
  margin-top: 1rem; 
  padding: 2rem 2rem 1rem 2rem;
}
.payment-summary .summary-line { 
  margin-bottom: .25rem; 
}
.payment-summary .summary-line .amount {
  font-weight: 700;
  letter-spacing: 0.2px;
}
.payment-summary .helptext { 
  margin-bottom: none;
}

.go-to-checkout { 
  display: block;
  margin-top: 2rem; 
}

.go-to-checkout form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.secure-note { 
  display: inline-flex; 
  align-items: center; 
  gap: .4rem; 
  margin-top: 0.1rem;
}
.secure-note svg[data-lucide] { 
  width: 1rem; 
  height: 1rem; 
  display: block; 
}
.secure-note span { 
  line-height: 1; 
  font-size: .8rem;
}

.card h2 {
  margin-top: 0;       /* override global h2 margin-top: 3rem */
  margin-bottom: 1rem;
}

@media (max-width: 720px) {
  .payment-summary .summary-line {
    flex-direction: column;
    align-items: flex-start;
    gap: .25rem;
  }
  .payment-summary .summary-line .amount {
    font-size: 1.1rem;
  }
}


/* --- Support FAQ --- */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--standard-border-radius);
  background: #fff;
  padding: 1rem 1rem 0rem 1rem;
  margin: .5rem 0;
}
.faq-item[open] { background: var(--white); }
.faq-q {
  cursor: pointer;
  font-size: large;
  font-weight: 400;
  list-style: none;
  margin-bottom: 1rem;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: "▾";
  float: right;
  color: var(--grey-med);
  transition: transform .2s ease;
}
.faq-item[open] .faq-q::after { transform: rotate(180deg); }
.faq-a { margin-top: .5rem; color: var(--grey-deep); }



/* --- Responsive interactive tables (stack rows on small screens) --- */
@media (max-width: 1100px) {
  .table { table-layout: auto; }
}

@media (max-width: 900px) {
  /* Hide header on small screens; data labels will be shown by cells */
  .table-wrapper {
    padding: 0;
    border-width: 0;
  }

  /* Chrome fix: colgroup keeps constraining width on stacked layout */
  .table colgroup { display: none; }

  .table thead { display: none; }

  .table { 
    width: 100% !important; 
    border-collapse: separate; 
    border-spacing: 0;
  }

  .table tbody { display: block; width: 100%; }

  .table tbody tr {
    display: block;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--standard-border-radius);
    padding: .25rem 0; 
    margin: 0 0 .75rem;
    background: #fff;
  }

  .table tbody tr:last-child {
    margin-bottom: 0;
  }

  .table tbody tr:last-child td {
    border-bottom: 1px solid var(--border);
    margin: 0rem;
  }

  .table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
    border-bottom: 1px solid var(--border);
    padding: .6rem 1rem;
  }

  /* Prepend the header label using the attribute set in the template */
  .table tbody td::before {
    content: attr(data-label);
    flex: 0 0 7.5rem;
    min-width: 7.5rem;
    color: var(--grey-med);
    font-weight: 600;
  }

  .table td[data-label="Last Invited"] { white-space: nowrap; }

  /* Make inputs fill the remaining width neatly */
  .table td input[type="text"],
  .table td input[type="email"] {
    width: 100%;
    max-width: 100%;
    margin-left: auto; 
  }

  /* Inputs inside the editable member table only */
#member-table .table td input[type="text"],
#member-table .table td input[type="email"] {
  margin-bottom: 0;  
  height: var(--row-height);
}

  .table td.email-cell {
    text-align: left; 
    justify-content: flex-start; 
  }

  .cell--align-right {
    display: block;
    margin-left: auto;
    text-align: right;
    max-width: 100%;
  }

  .table td.actions-cell,
  .table td[data-label="Actions"] {
    text-align: left;
    justify-content: space-between;
    border-bottom: none !important;
  }
  /* Hide pipe separators in stacked table cells */
  .table td .separator,
  .table td .actions-sep { display: none; }
  /* For single-action forms (e.g., Resend Invite) */
  .table td.actions-cell .resend-form {
    width: auto;
    justify-content: flex-end;
    margin-left: auto;
  }
  /* For multiple actions grouped together */
  .table td.actions-cell .actions-stack {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    width: auto;
    justify-content: flex-end;
    margin-left: auto;
  }
}

/* Simple key-value tables that should not stack on mobile */
@media (max-width: 900px) {
  .table.table--no-stack thead { display: table-header-group !important; }
  .table.table--no-stack tbody { display: table-row-group !important; }
  .table.table--no-stack tbody tr {
    display: table-row !important;
    width: auto; border: none; border-radius: 0;
    padding: 0; margin: 0; background: transparent;
  }
  .table.table--no-stack tbody td {
    display: table-cell !important;
    border-bottom: 1px solid var(--border);
  }
  .table.table--no-stack tbody td::before { display: none; }
}

/* =========================
   Responsive Sidebar Drawer
   ========================= */

/* Backdrop that appears behind the drawer on small screens */
.nav-backdrop {
  display: none;
}

/* Hamburger and close controls */
.hamburger,
.sidebar-close {
  margin: 0;  
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}
.hamburger i[data-lucide],
.sidebar-close i[data-lucide] {
  width: 22px;
  height: 22px;
  stroke: var(--grey-deep);
}
.hamburger:hover,
.sidebar-close:hover {
  background: var(--bg-accent);
  border-color: var(--border);
}

/* Layout adjustments under 1024px: convert sidebar to off-canvas */
@media (max-width: 1024px) {
  /* Make main take full width; remove sidebar's reserved space */
  .page-wrapper {
    display: block; /* stack header + main content */
    min-height: 100vh;
  }
  .main-area {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-accent);
    min-height: calc(100vh - 0px);
  }

  /* Sidebar becomes a fixed drawer */
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;              /* left side */
    width: min(86vw, 320px);
    min-width: 260px;
    max-width: 90vw;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 1000;
    box-shadow: 0 0 0 rgba(0,0,0,0);
  }

  /* Show mobile controls */
  .hamburger,
  .sidebar-close {
    display: inline-flex;
  }

  /* Put the close control on the far left of the sidebar header */
  .sidebar-header {
    display: flex;
    align-items: center;
    gap: .5rem;
  }
  .sidebar-header .sidebar-logo {
    margin-left: auto; /* push logo to the right so close is on the left */
  }

  /* Backdrop behind the drawer */
  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    display: block;
  }

  /* When checkbox is checked, reveal the drawer and enable backdrop */
  #nav-toggle:checked ~ .page-wrapper .sidebar {
    transform: translateX(0);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  }
  #nav-toggle:checked ~ .nav-backdrop {
    opacity: 1;
    pointer-events: all;
  }

  /* Tweak header layout on small screens */
  .dashboard-header {
    padding: .75rem 1rem;
  }
  .header-left {
    display: flex;
    align-items: center;
    gap: .5rem;
  }
  .logout-link { padding: .5rem; }

  /* Ensure the main content isn’t obscured behind fixed drawer */
  .main-content {
    background-color: var(--bg);
  }
}

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

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
  .nav-backdrop { transition: none; }
}

/* ==========================================================================
   Wizard
   ========================================================================== */

.wizard-progress {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.wizard-step-label {
  display: block;
  font-size: 0.85rem;
  color: var(--grey-med);
  margin-bottom: 0.5rem;
}

.wizard-progress-bar {
  display: flex;
  gap: 0.25rem;
}

.wizard-progress-segment {
  flex: 1;
  height: 4px;
  background: var(--grey-xlight);
  border-radius: 2px;
}

.wizard-progress-segment--active {
  background: var(--primary);
}

.wizard-option-card {
  border: 1px solid var(--border);
  border-radius: var(--standard-border-radius);
  padding: 1.25rem 1.5rem;
}

.wizard-option-card .helptext {
  margin-bottom: 1rem;
}

.wizard-option-heading {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  margin-top: 0;
}


.wizard-option-card .form-group:last-child {
  margin-bottom: 0;
}

.wizard-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--grey-deep);
  font-size: 0.9rem;
}

.wizard-divider::before,
.wizard-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--grey-xlight);
}

.wizard-summary .table th {
  width: 40%;
  text-align: left;
  font-weight: 600;
}

.wizard-launch-actions {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.email-preview-box {
  border: 1px solid var(--grey-xlight);
  border-radius: var(--standard-border-radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--white);
}

.email-preview-label {
  font-size: 0.8rem;
  color: var(--grey-med);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.email-preview-content {
  font-size: 0.9rem;
  color: var(--grey-deep);
}

.email-preview-content p {
  margin: 0.5rem 0;
}

.email-preview-btn {
  display: inline-block;
  margin: 0.5rem 0;
  padding: 0.5rem 1.25rem;
  background: var(--primary);
  color: var(--white);
  border-radius: 3px;
  text-decoration: none;
  font-size: 0.875rem;
  cursor: default;
  pointer-events: none;
}

/* =============================================================================
   Assessment Monitoring (Feature 06)
   ============================================================================= */

/* Badge: Complete (grey outline, per mockup) */
.badge--complete {
  background: transparent;
  color: var(--grey-deep);
  border: 1px solid var(--grey-light);
}

/* Info card: bordered card for Basic Information / Assessment & Report */
.info-card {
  border: 1px solid var(--border);
  border-radius: var(--standard-border-radius);
  background: var(--white);
  padding: 1.5rem 2rem;
  margin-top: 1rem;
}

.info-card p {
  margin: 0.3rem 0;
  color: var(--grey-deep);
}

.info-card p strong {
  color: var(--grey-deep);
}

.info-card-columns {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.info-card-left {
  flex: 1;
}

.info-card-right {
  text-align: right;
  flex-shrink: 0;
}

.info-card-right p {
  margin: 0.3rem 0;
}

.info-card-participants {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* CTA card (Generate Report) */
.info-card--cta {
  margin-top: 2rem;
}

.info-card--cta h4 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.info-card--cta .info-card-right {
  display: flex;
  align-items: center;
}

/* Promo card */
.info-card--promo {
  background: var(--bg-accent);
  border-color: var(--bg-accent);
  margin-top: 2rem;
}

.info-card--promo p {
  margin: 0;
  line-height: 1.6;
}

/* Expandable email preview in manage page */
.email-preview-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Table checkbox column */
.checkbox-col {
  width: 2.5rem;
  text-align: center;
}

/* Submitted column: just wide enough for header text + icon */
.submitted-col {
  width: 7rem;
  text-align: center;
}
.submitted-col + td,
td.submitted-col {
  text-align: center;
}

/* Email column: prevent wrapping so addresses stay on one line */
.email-col {
  width: 30%;
}

/* Highlight selected rows */
.table tbody tr:has(input[type="checkbox"]:checked) {
  background: var(--grey-xlight);
}

.table .checkbox-col input[type="checkbox"] {
  /* Override the global custom-control hiding (lines ~1447-1465) */
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  position: static !important;
  width: 1rem !important;
  height: 1rem !important;
  opacity: 1 !important;
  clip: auto !important;
  clip-path: none !important;
  overflow: visible !important;
  pointer-events: auto !important;
  cursor: pointer;
  accent-color: var(--accent);
}

/* Table toolbar (below-table actions) */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem 0.25rem;
}

.table-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.table-toolbar-actions .text-button {
  font-size: 0.85rem;
}

.table-toolbar-add .text-button {
  font-size: 0.85rem;
}

/* Add form card (participant / commitment) */
.add-form-card {
  border: 1px solid var(--border);
  border-radius: var(--standard-border-radius);
  background: var(--white);
  padding: 1.25rem 2rem;
  margin-top: 1rem;
}

.add-form-card h4 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.form-row--inline {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-group--grow {
  flex: 1;
  min-width: 200px;
}

.form-group--actions {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  padding-bottom: 0.15rem;
}

/* Action buttons row (Draft view) */
.action-buttons {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Sortable column header */
.sort-header {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.sort-header:hover {
  color: var(--primary);
}

.sort-arrow {
  font-size: 0.65rem;
}

/* Disabled button */
.button--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Responsive: info card stacks on mobile */
@media (max-width: 768px) {
  .info-card-columns {
    flex-direction: column;
    gap: 1rem;
  }

  .info-card-right {
    text-align: left;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .form-row--inline {
    flex-direction: column;
  }

  .action-buttons {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--grey-xlight);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-backdrop {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
}
.modal-content {
  position: relative;
  background: var(--color-bg, #fff);
  padding: 2rem;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.modal-content h3 { margin-top: 0; }
.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}
.terminology-other { margin-top: 0.5rem; }

/* ── Utility classes ─────────────────────────────────────────────────────── */
.d-inline   { display: inline; }
.mt-1       { margin-top: 0.25rem; }
.mt-2       { margin-top: 0.5rem; }
.mt-6       { margin-top: 1.5rem; }
.pager--end { justify-content: flex-end; }
.icon-inline { vertical-align: middle; margin-right: 4px; }

/* ── Anti-bot (honeypot) ────────────────────────────────────────────────── */
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
