/* B8 dashboard design system. Builds on the existing functional form styles. */
:root {
  --qa-ink: #171b26;
  --qa-muted: #687181;
  --qa-border: #e5e7eb;
  --qa-surface: #ffffff;
  --qa-subtle: #f8f9fb;
  --qa-accent: #2563eb;
  --qa-focus: #93b4ff;
  font-variant-numeric: tabular-nums;
}
body.qa-signed-in {
  background: var(--qa-subtle);
  color: var(--qa-ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
body.qa-signed-in .nav.wrap {
  max-width: none;
  margin: 0;
  height: 68px;
  padding: 0 clamp(16px, 3vw, 40px);
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 90;
  background: #fff;
  border-bottom: 1px solid var(--qa-border);
}
.qa-signed-in .nav .logo { color: #111827; font-size: 18px; letter-spacing: -.6px; font-weight: 780; }
.qa-signed-in .nav .logo-mark { width: 30px; height: 30px; background: #111827; border-radius: 8px; font-size: 21px; }
.qa-signed-in .nav-hint { display: none; }
.qa-signed-in .nav .beta { border-color: #e5e7eb; background: #f8fafc; color: #717989; font-size: 9px; letter-spacing: .5px; }
.qa-signed-in .nav .locale-picker { margin-left: auto; font-size: 12px; color: #717989; }
.qa-signed-in .nav .locale-picker select { background: #fff; color: #374151; border-color: #e1e5eb; border-radius: 8px; }
.qa-signed-in .nav button#logout { border: 1px solid #e5e7eb; border-radius: 8px; color: #374151; padding: 8px 12px; font-weight: 570; font-size: 12px; }
.qa-signed-in #root.wrap { max-width: none; width: 100%; margin: 0; padding: 0; }
.qa-signed-in .footer { display: none; }

.qa-shell { display: grid; grid-template-columns: 242px minmax(0,1fr); min-height: calc(100vh - 68px); max-width: 1900px; margin: auto; }
.qa-sidebar {
  position: sticky; top: 68px; height: calc(100vh - 68px);
  border-right: 1px solid var(--qa-border); background: #fff;
  padding: 22px 13px 18px; display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin;
}
.qa-sidebar-heading { display: flex; align-items: center; gap: 9px; margin: 0 11px 26px; font-size: 11px; font-weight: 800; color: #111827; letter-spacing: 1.2px; }
.qa-sidebar-heading .qa-icon { width: 16px; height: 16px; }
.qa-sidebar-heading span { margin-left: auto; font-size: 9px; letter-spacing: .3px; color: #9da4b1; border: 1px solid #e5e7eb; border-radius: 4px; padding: 2px 5px; }
.qa-sidebar-nav { flex: 1; }
.qa-menu-group { margin-bottom: 22px; }
.qa-menu-label { margin: 0 12px 9px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #9ba3b1; font-weight: 760; }
.qa-menu-link { min-height: 38px; display: flex; gap: 11px; align-items: center; padding: 9px 12px; color: #566071; font-size: 12px; font-weight: 540; border-radius: 8px; transition: background .15s,color .15s; }
.qa-menu-link:hover { background: #f4f6f9; color: #252b35; text-decoration: none; }
.qa-menu-link.is-active { background: #eff3fb; color: #1d4ed8; font-weight: 670; }
.qa-icon { display: block; flex-shrink: 0; }
.qa-sidebar-foot { padding: 14px 12px; border-top: 1px solid #eff0f3; color: #8c95a4; font-size: 11px; }
.qa-sidebar-foot span,.qa-sidebar-foot a { display: block; margin: 3px 0; }
.qa-sidebar-foot a { font-weight: 600; color: #4e6178; font-size: 12px; }
.qa-main { min-width: 0; background: #fafbfc; }
.qa-content-header { max-width: 1280px; padding: 34px clamp(24px,4vw,62px) 24px; margin: 0 auto; }
.qa-header-top { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: space-between; min-height: 25px; margin-bottom: 25px; }
.qa-breadcrumb { color: #8791a0; font-weight: 530; font-size: 12px; }
.qa-breadcrumb-sep { padding: 0 8px; color: #c0c5cf; }
.qa-network-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #e4e8ee; background: #fff; border-radius: 999px; padding: 5px 10px; font-size: 10px; font-weight: 650; color: #657083; white-space: nowrap; }
.qa-network-dot { width: 7px; height: 7px; border-radius: 50%; background: #e0a431; box-shadow: 0 0 0 3px #fff3d9; }
.qa-title-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.qa-title-row h1 { margin: 0; font-size: clamp(27px,2.8vw,34px); color: #171b26; font-weight: 740; letter-spacing: -1.25px; line-height: 1.18; }
.qa-title-row p { margin: 9px 0 0; font-size: 13px; color: #7c8491; line-height: 1.6; }
.qa-back { display: inline-block; color: #576a83; margin-bottom: 18px; font-size: 12px; }
.qa-content-body { max-width: 1280px; padding: 0 clamp(24px,4vw,62px) 70px; margin: 0 auto; min-width: 0; }
.qa-menu-toggle { display: none; }
.qa-mobile-shade { display: none; }
.qa-shell a:focus-visible,.qa-shell button:focus-visible,.qa-shell summary:focus-visible,
.qa-signed-in .nav a:focus-visible,.qa-signed-in .nav select:focus-visible {
  outline: 3px solid var(--qa-focus); outline-offset: 2px;
}
.qa-shell .card {
  margin: 0 0 18px; background: #fff; border: 1px solid var(--qa-border);
  border-radius: 12px; padding: 24px; box-shadow: 0 1px 2px rgba(12,20,35,.025);
}
.qa-shell .card h2 { color: #202633; font-weight: 690; font-size: 17px; margin: 0 0 17px; letter-spacing: -.3px; }
.qa-shell .card h3 { color: #283143; }
.qa-shell .card p,.qa-shell .muted,.qa-shell .hint { color: #747d8c; }
.qa-shell .card p { line-height: 1.65; }
.qa-shell .notice { border-radius: 9px; background: #f2f6fd; color: #345277; border-color: #dee8f8; }
.qa-shell .notice.warning { background: #fffaeb; color: #805d23; border-color: #f5e4bb; }
.qa-shell .card input,.qa-shell .card select,.qa-shell .card textarea {
  background: #fff; border-color: #dce2eb; color: #222a38; border-radius: 8px;
  padding: 10px 12px; font-size: 13px;
}
.qa-shell .card input:focus,.qa-shell .card select:focus,.qa-shell .card textarea:focus {
  box-shadow: 0 0 0 3px #e8efff; border-color: #6e9bf5;
}
.qa-shell .card label { color: #414c5d; font-size: 12px; font-weight: 600; margin: 13px 0 6px; }
.qa-shell button.primary,.qa-shell .qa-action {
  display: inline-flex; justify-content: center; align-items: center; border: 1px solid #1d4ed8;
  border-radius: 8px; background: #2563eb; color: #fff; font-size: 12px; font-weight: 650;
  padding: 10px 14px; box-shadow: 0 1px 2px #1a4eab18;
}
.qa-shell button.primary:hover,.qa-shell .qa-action:hover { background: #1d4ed8; text-decoration: none; }
.qa-shell button.secondary { border-radius: 8px; background: #f5f7fa; border-color: #e3e7ed; color: #36465a; font-size: 12px; }
.qa-shell button.secondary:hover { background: #edf1f6; }
.qa-shell button.ghost { border-radius: 8px; border-color: #e0e6ed; color: #586476; font-size: 12px; }
.qa-shell button:disabled { opacity: .5; }
.qa-shell pre,.qa-shell .sdk-code { background: #172235; border-radius: 10px; color: #e3ebf8; font-size: 12px; line-height: 1.6; }
.qa-shell code { font-size: 11px; color: #334155; background: #f2f5f9; }
.qa-shell .item { padding: 15px 0; border-color: #edf0f3; overflow-wrap: anywhere; }
.qa-shell .grid { gap: 16px; align-items: start; }
.qa-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 22px; }
.qa-metrics.qa-metrics-three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.qa-metric { background: #fff; border: 1px solid var(--qa-border); border-radius: 11px; padding: 18px 18px 16px; min-width: 0; box-shadow: 0 1px 2px #17243b08; }
.qa-metric > span { display: block; font-size: 11px; font-weight: 610; color: #667080; margin-bottom: 14px; }
.qa-metric strong { display: block; font-size: clamp(20px,2.1vw,26px); color: #212938; letter-spacing: -1px; font-weight: 730; word-break: break-word; }
.qa-metric small { display: block; color: #8d97a6; font-size: 10px; margin-top: 8px; }
.qa-dashboard-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; align-items: start; }
.qa-quick-link { color: #354052; display: flex; align-items: center; gap: 13px; padding: 17px 2px; border-top: 1px solid #edf0f4; }
.qa-quick-link:hover { text-decoration: none; color: #174bbd; }
.qa-quick-icon { display: flex; flex: 0 0 40px; align-items: center; justify-content: center; height: 40px; color: #356bd1; background: #f0f4fc; border-radius: 10px; }
.qa-quick-link strong,.qa-quick-link small { display: block; }
.qa-quick-link strong { font-size: 13px; font-weight: 650; }
.qa-quick-link small { margin-top: 4px; color: #88919f; font-size: 11px; line-height: 1.5; }
.qa-link-arrow { margin-left: auto; color: #9da7b6; }
.qa-activity { display: flex; align-items: center; gap: 20px; justify-content: space-between; padding: 16px 0; border-top: 1px solid #edf0f4; }
.qa-activity strong,.qa-activity small { display: block; }
.qa-activity strong { font-size: 12px; color: #334155; font-weight: 630; text-transform: capitalize; }
.qa-activity small { max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; color: #9aa3b2; margin-top: 4px; }
.qa-amount { color: #3c495b; font-weight: 620; font-size: 12px; white-space: nowrap; }
.qa-inline-note { background: #f2f5fa; color: #778292; border: 1px solid #e8edf3; border-radius: 10px; font-size: 11px; line-height: 1.7; padding: 12px 15px; margin: 17px 0; }
.qa-empty { color: #9199a6; text-align: center; padding: 32px 20px; line-height: 1.7; font-size: 13px; }
.qa-counter { font-size: 12px; color: #8a93a1; margin: 0 0 15px; }
.qa-table-shell { padding: 0 !important; overflow: hidden; }
.qa-table-scroll { overflow-x: auto; max-width: 100%; }
.qa-data-table { width: 100%; border-collapse: collapse; background: #fff; text-align: left; font-size: 12px; }
.qa-data-table th { padding: 14px 17px; border-bottom: 1px solid #e8ebef; background: #fbfcfd; color: #7c8593; font-size: 10px; font-weight: 650; letter-spacing: .01em; }
.qa-data-table td { padding: 18px 17px; border-bottom: 1px solid #f0f2f5; color: #4d5868; white-space: nowrap; }
.qa-data-table tr:last-child td { border-bottom: 0; }
.qa-data-table td:first-child { min-width: 185px; white-space: normal; }
.qa-data-table td small { display: block; font-size: 10px; margin-top: 5px; color: #abb2bc; word-break: break-all; }
.qa-title-link { color: #253246; font-weight: 660; }
.qa-title-link:hover { color: #1d4ed8; }
.qa-status { display: inline-flex; border-radius: 6px; color: #697385; border: 1px solid #e4e8ed; background: #f5f7fa; padding: 4px 8px; font-size: 10px; font-weight: 670; text-transform: capitalize; }
.qa-status-active,.qa-status-paid,.qa-status-credited,.qa-status-published { color: #18734c; background: #eff9f3; border-color: #d4f0df; }
.qa-status-paused,.qa-status-requested,.qa-status-pending { color: #926615; background: #fffaed; border-color: #f8e9c3; }
.qa-status-rejected,.qa-status-failed { color: #b04340; background: #fff3f2; border-color: #f7dfdb; }
.qa-steps { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.qa-steps span { font-size: 11px; color: #647086; background: #fff; border: 1px solid #e5e9f0; padding: 9px 12px; border-radius: 8px; }
.qa-site-row { display: flex; align-items: center; gap: 16px; border-top: 1px solid #edf0f4; padding: 16px 0; color: #2f3b4e; }
.qa-site-row:hover { text-decoration: none; }
.qa-site-row:hover .qa-site-text strong { color: #2563eb; }
.qa-site-avatar { display: grid; place-items: center; width: 44px; height: 44px; background: #f0f3f9; color: #5d7cb6; border-radius: 11px; flex-shrink: 0; }
.qa-site-text { display: block; flex: 1; min-width: 0; }
.qa-site-text strong,.qa-site-text small { display: block; }
.qa-site-text strong { font-size: 13px; font-weight: 690; }
.qa-site-text small { color: #9ba4b0; font-size: 11px; margin-top: 5px; word-break: break-all; }
.qa-site-row > span:last-child { color: #afb5c0; }
.qa-analytics-item { padding: 14px 0; border-top: 1px solid #edf0f4; }
.qa-analytics-item > a { font-size: 13px; color: #283b57; font-weight: 690; }
.qa-analytics-item .campaign-budget { margin: 10px 0 2px; }
.qa-form-page { max-width: 990px; }
.qa-form-page .campaign-section { border-color: #eaedf1; border-radius: 9px; }
.qa-form-page .campaign-section legend { color: #263549; }
.qa-form-page button.primary { margin-top: 8px; }
.qa-shell .board-admin-section { margin: 0; }
.qa-shell .board-banner { border-radius: 16px; box-shadow: none; }
.qa-shell .program-card { border-radius: 13px; box-shadow: 0 2px 5px #334b6b06; }
.qa-shell .board-applications { margin-top: 24px; }
.qa-shell .board-admin-card { margin-bottom: 0; }
.qa-shell .program-card h3 { color: #1b2841; }
.qa-shell .campaign-budget-bar { border-radius: 999px; overflow: hidden; background: #edf1f6; }
.qa-shell .qa-panel .item:first-child { border-top: 1px solid #edf0f4; }
.qa-shell .qa-panel h2 + .item { border-top: 1px solid #edf0f4; }
.qa-shell .qa-panel .managed-head { align-items: center; }
.qa-shell .qa-panel .managed-head strong { font-size: 14px; }
@media (max-width: 1200px) {
  .qa-shell { grid-template-columns: 220px minmax(0,1fr); }
  .qa-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 960px) {
  .qa-shell { display: block; }
  .qa-sidebar { position: fixed; z-index: 110; inset: 68px auto 0 0; height: calc(100vh - 68px); width: min(280px,calc(100vw - 46px)); box-shadow: 12px 0 34px #1c2e491b; transform: translateX(-105%); transition: transform .18s ease-out; }
  .qa-shell.nav-open .qa-sidebar { transform: translateX(0); }
  .qa-shell.nav-open .qa-mobile-shade { display: block; position: fixed; z-index: 100; inset: 68px 0 0; width: 100%; border: 0; background: #16253b5e; }
  .qa-menu-toggle { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #e2e7ef; border-radius: 8px; background: #fff; color: #536173; font-size: 11px; padding: 7px 11px; }
  .qa-header-top { gap: 10px; }
  .qa-breadcrumb { flex: 1; }
}
@media (max-width: 690px) {
  .qa-signed-in .nav.wrap { flex-wrap: nowrap; min-height: 62px; height: 62px; padding: 0 13px; gap: 9px; }
  .qa-signed-in .nav .logo { font-size: 15px; gap: 6px; }
  .qa-signed-in .nav .logo-mark { width: 27px; height: 27px; font-size: 19px; }
  .qa-signed-in .nav .beta { display: none; }
  .qa-signed-in .nav .locale-picker select { min-width: 98px; max-width: 103px; padding: 8px 5px; }
  .qa-signed-in .nav button#logout { font-size: 11px; padding: 8px 9px; }
  .qa-sidebar { top: 62px; height: calc(100vh - 62px); }
  .qa-shell.nav-open .qa-mobile-shade { top: 62px; }
  .qa-content-header { padding: 22px 17px 22px; }
  .qa-content-body { padding: 0 17px 40px; }
  .qa-header-top { margin-bottom: 16px; }
  .qa-breadcrumb { display: none; }
  .qa-title-row { flex-direction: column; align-items: flex-start; gap: 13px; }
  .qa-title-row h1 { font-size: 27px; letter-spacing: -.8px; }
  .qa-title-row .qa-action { width: 100%; }
  .qa-metrics,.qa-metrics.qa-metrics-three { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .qa-metric { padding: 15px 12px; }
  .qa-metric strong { font-size: 19px; }
  .qa-metric > span { font-size: 10px; min-height: 30px; margin-bottom: 8px; }
  .qa-dashboard-grid { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .qa-shell .card { padding: 17px; }
  .qa-shell .qa-table-shell { padding: 0; }
  .qa-shell .grid,.qa-shell .board-numbers { grid-template-columns: minmax(0,1fr); }
  .qa-steps { gap: 5px; }
  .qa-steps span { font-size: 10px; }
  .qa-site-row { gap: 9px; }
  .qa-site-row .qa-status { font-size: 9px; }
  .qa-shell .board-banner .board-copy { padding: 27px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .qa-sidebar,.qa-menu-link { transition: none; }
}


/* Public first-use flow: authentication remains visible before the programs board. */
body:not(.qa-signed-in) { background: #fcfcfd; color: #1f2937; -webkit-font-smoothing: antialiased; }
body:not(.qa-signed-in) .nav { border-color: #e7eaf0; }
body:not(.qa-signed-in) .logo-mark { background: #111827; border-radius: 9px; }
body:not(.qa-signed-in) .hero { padding: 62px 0 26px; }
body:not(.qa-signed-in) .hero .eyebrow { color: #4773bf; letter-spacing: 1.6px; font-size: 11px; }
body:not(.qa-signed-in) .hero h1 { color: #161d29; letter-spacing: -2.2px; font-weight: 760; }
body:not(.qa-signed-in) .hero p:not(.eyebrow) { color: #7b8795; font-size: 16px; }
body:not(.qa-signed-in) #root > .grid { gap: 18px; align-items: start; }
body:not(.qa-signed-in) #register,
body:not(.qa-signed-in) #login,
body:not(.qa-signed-in) #forgotPassword {
  background: #fff; border: 1px solid #e5e9ef; box-shadow: 0 3px 14px #21304608;
  border-radius: 13px; padding: 28px;
}
body:not(.qa-signed-in) #register h2,
body:not(.qa-signed-in) #login h2 { color: #172031; font-size: 21px; }
body:not(.qa-signed-in) #register button,
body:not(.qa-signed-in) #login button { width: 100%; border-radius: 8px; margin-top: 16px; }
body:not(.qa-signed-in) #register button.primary { background: #2563eb; border-color: #2563eb; }
body:not(.qa-signed-in) #login button.secondary { color: #24344b; background: #f4f6fa; border-color: #e2e7ed; }
body:not(.qa-signed-in) #resendVerification { padding: 22px 26px; border-radius: 12px; border: 1px dashed #e0e5ed; background: #f8f9fc; }
body:not(.qa-signed-in) #resendVerification h3 { font-size: 15px; color: #344054; margin: 0 0 16px; }
body:not(.qa-signed-in) .qa-public-programs { margin-top: 60px; padding-top: 27px; border-top: 1px solid #e8ebf0; }
body:not(.qa-signed-in) .qa-public-programs .board-main { margin-top: 0; }
@media (max-width: 690px) {
  body:not(.qa-signed-in) .hero { padding-top: 34px; }
  body:not(.qa-signed-in) .hero h1 { letter-spacing: -1.2px; }
  body:not(.qa-signed-in) #register,
  body:not(.qa-signed-in) #login { padding: 22px; }
  body:not(.qa-signed-in) .qa-public-programs { margin-top: 35px; }
}
