/* =========================================================================
   OCS End of Year Report — SY 25-26
   Design system. Enterprise / professional refresh of the legacy form.
   ========================================================================= */

:root {
  /* Brand palette — built around the NYC Community Schools cyan (#1abdef) */
  --brand-cyan: #1abdef;          /* bright brand cyan — accents, progress, focus */
  --brand-cyan-soft: #e7f7fd;     /* tinted background for active/checked states */
  --brand-primary: #0a6e94;       /* deep cyan — buttons & primary actions (AA on white) */
  --brand-primary-700: #075873;   /* hover */
  --brand-primary-300: #1abdef;   /* bright accent for hover borders */
  --brand-ink: #123442;           /* dark teal — headings & strong text */
  --brand-accent: #5aa832;        /* logo green — success / submit */
  --brand-accent-600: #4a8f29;

  --bg: #eef3f8;                  /* app background */
  --surface: #ffffff;             /* cards */
  --surface-alt: #f7fafc;
  --border: #d7e0ea;
  --border-strong: #b7c5d6;

  --text: #1a2733;
  --text-muted: #5b6b7b;
  --text-faint: #8794a3;

  --danger: #c0392b;
  --danger-bg: #fdecea;
  --focus-ring: #1bbdef;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(11, 61, 107, .06), 0 1px 3px rgba(11, 61, 107, .08);
  --shadow-md: 0 4px 14px rgba(11, 61, 107, .10);
  --shadow-lg: 0 12px 40px rgba(11, 61, 107, .16);

  --maxw: 880px;
  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.25; color: var(--brand-ink); }
p { margin: 0 0 1em; }
a { color: var(--brand-primary-300); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }

/* =========================================================================
   Header
   ========================================================================= */
.app-header {
  background: var(--surface);
  color: var(--text);
  padding: 0;
  position: relative;
  border-top: 4px solid var(--brand-cyan);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.app-header__bar {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 14px 24px;
}
.app-header__brand { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1 1 auto; }
.app-header__logo { height: 46px; width: auto; display: block; flex-shrink: 0; }
.app-header__titles {
  min-width: 0; padding-left: 16px; border-left: 1px solid var(--border);
}
.app-header__title { color: var(--brand-ink); font-size: 1.1rem; font-weight: 700; }
.app-header__subtitle { color: var(--text-muted); font-size: .82rem; font-weight: 500; letter-spacing: .3px; }
.app-header__actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* Secondary action — outlined so it doesn't compete with the page content. */
.btn-tech {
  background: transparent; color: var(--brand-primary); text-decoration: none;
  padding: 8px 15px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  border: 1px solid var(--border); transition: background .2s, color .2s, border-color .2s;
  white-space: nowrap;
}
.btn-tech:hover { background: var(--brand-tint, #eef7fb); border-color: var(--brand-primary); }

/* Google Translate widget — tame its default styling, hide "Powered by" */
#google_translate_element { font-size: 0; line-height: 0; }
#google_translate_element .goog-te-gadget { font-size: 0 !important; line-height: 0 !important; }
#google_translate_element .goog-te-gadget > span { display: none !important; }
#google_translate_element .goog-te-gadget-simple { border: 0; }
#google_translate_element select.goog-te-combo {
  margin: 0; padding: 7px 28px 7px 10px; max-width: 170px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  font-family: var(--font); font-size: .82rem; line-height: 1.2; background: #fff; color: var(--text); cursor: pointer;
}
body { top: 0 !important; }            /* neutralize Google banner shift */
.goog-te-banner-frame { display: none !important; }

/* =========================================================================
   Progress bar
   ========================================================================= */
.progress {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}
.progress__inner { max-width: var(--maxw); margin: 0 auto; }
.progress__meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.progress__label { font-size: .8rem; font-weight: 600; color: var(--text-muted); letter-spacing: .3px; }
.progress__pct { font-size: .9rem; font-weight: 700; color: var(--brand-primary); }
.progress__track { height: 10px; background: #e3eaf2; border-radius: 999px; overflow: hidden; }
.progress__fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-cyan));
  border-radius: 999px; transition: width .45s cubic-bezier(.4,0,.2,1);
}

/* =========================================================================
   Layout: sidebar + main
   ========================================================================= */
.layout { max-width: 1200px; margin: 0 auto; display: flex; gap: 28px; padding: 28px 24px 80px; align-items: flex-start; }

.sidebar {
  position: sticky; top: 86px; flex: 0 0 248px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 18px 14px; align-self: flex-start;
}
.sidebar__title { font-size: .72rem; text-transform: uppercase; letter-spacing: .9px; color: var(--text-faint); padding: 0 8px 12px; }
.sidebar__list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.sidebar__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: .86rem; color: var(--text-muted); font-weight: 500;
  transition: background .15s, color .15s; margin-bottom: 2px;
}
.sidebar__item:hover { background: var(--surface-alt); color: var(--text); }
.sidebar__item .step-num {
  flex: 0 0 22px; height: 22px; border-radius: 50%;
  background: #e3eaf2; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700;
}
.sidebar__item.is-active { background: var(--brand-cyan-soft); color: var(--brand-primary); font-weight: 700; }
.sidebar__item.is-active .step-num { background: var(--brand-primary); color: #fff; }
.sidebar__item.is-done .step-num { background: var(--brand-accent); color: #fff; }
.sidebar__item.is-done .step-num::after { content: "✓"; }
.sidebar__item.is-done .step-num span { display: none; }

/* =========================================================================
   Main / pages
   ========================================================================= */
.main { flex: 1 1 auto; min-width: 0; max-width: var(--maxw); margin: 0 auto; width: 100%; }

.page-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  overflow: hidden;
}
.page-card__header {
  padding: 28px 34px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fbfdff, var(--surface));
}
.page-card__eyebrow { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--brand-primary); margin-bottom: 6px; }
.page-card__title { font-size: 1.55rem; }
.page-card__intro { color: var(--text-muted); margin-top: 10px; font-size: .95rem; }
.page-card__body { padding: 26px 34px 30px; }

/* Group intro — a question title + scale legend above a block of fields */
.group-intro { margin: 32px 0 10px; padding-bottom: 14px; border-bottom: 2px solid var(--border); }
.group-intro__title { font-size: 1.08rem; color: var(--brand-ink); font-weight: 700; line-height: 1.35; }
.group-intro__help { margin: 10px 0 0; font-size: .9rem; color: var(--text-muted); line-height: 1.55; }

/* Section header inside a page */
.section-header {
  font-size: 1.05rem; color: var(--brand-primary); font-weight: 700;
  margin: 30px 0 4px; padding-bottom: 8px; border-bottom: 2px solid var(--border);
}
.section-header:first-child { margin-top: 0; }

/* =========================================================================
   Fields
   ========================================================================= */
.field { margin: 18px 0; }

/* Compact 2-column grid for count-list groups (e.g. "Insert # …") */
.field-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 26px; margin: 14px 0 18px;
}
.field-grid .field { margin: 8px 0; }
.field-grid .field__label { margin-bottom: 6px; }
.field-grid .input--narrow { max-width: 100%; }
.field__label { display: block; font-weight: 600; color: var(--text); margin-bottom: 9px; font-size: .96rem; }
.field__label .req { color: var(--danger); margin-left: 3px; font-weight: 700; }
.field__help { font-size: .82rem; color: var(--text-faint); margin: -4px 0 9px; }

.input, .textarea, .select {
  width: 100%; padding: 11px 13px; font-family: var(--font); font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input:hover, .textarea:hover, .select:hover { border-color: var(--brand-primary-300); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(27,189,239,.18);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235b6b7b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.input--narrow { max-width: 260px; }

/* Custom searchable dropdown (combobox) */
.combobox { position: relative; }
.combobox__input {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235b6b7b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.combobox__panel {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 290px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  padding: 5px;
}
.combobox__option {
  padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: .92rem; color: var(--text); line-height: 1.35;
}
.combobox__option:hover, .combobox__option.is-active { background: var(--brand-cyan-soft); }
.combobox__option.is-selected { font-weight: 600; color: var(--brand-primary); }
.combobox__empty { padding: 14px 12px; color: var(--text-faint); font-size: .88rem; text-align: center; }
.combobox__more {
  padding: 9px 12px; margin-top: 4px; color: var(--text-faint); font-size: .8rem;
  border-top: 1px solid var(--border); position: sticky; bottom: -5px; background: var(--surface);
}
/* Subtle scrollbar for the panel */
.combobox__panel::-webkit-scrollbar { width: 10px; }
.combobox__panel::-webkit-scrollbar-thumb { background: #c9d6e3; border-radius: 999px; border: 2px solid var(--surface); }

/* Choice groups (radio / checkbox) */
.choice-group { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.choice-group--horizontal { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.choice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 13px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color .15s, background .15s; background: var(--surface);
}
.choice:hover { border-color: var(--brand-primary-300); background: var(--surface-alt); }
.choice input { margin: 2px 0 0; width: 18px; height: 18px; accent-color: var(--brand-primary); flex-shrink: 0; cursor: pointer; }
.choice__text { font-size: .93rem; color: var(--text); }
.choice.is-checked { border-color: var(--brand-primary); background: var(--brand-cyan-soft); }
.choice-group--horizontal .choice { flex: 1 1 auto; min-width: 90px; justify-content: center; text-align: center; }
.choice-group--horizontal .choice__text { font-weight: 600; }

/* Likert / rating matrix rows reuse horizontal choice group */
.likert { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.likert__row { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.likert__row:last-child { border-bottom: 0; }
.likert__row:nth-child(odd) { background: var(--surface-alt); }
.likert__statement { font-size: .92rem; margin-bottom: 10px; color: var(--text); }

/* File upload */
.file-drop {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: 24px; text-align: center; background: var(--surface-alt);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop.is-drag { border-color: var(--brand-primary); background: rgba(27,189,239,.06); }
.file-drop__icon { font-size: 1.8rem; }
.file-drop__hint { font-size: .82rem; color: var(--text-faint); margin-top: 4px; }
.file-list { list-style: none; margin: 10px 0 0; padding: 0; }
.file-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 6px; font-size: .88rem; }
.file-list button { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: .85rem; font-weight: 600; }

/* Validation */
.field.has-error .input, .field.has-error .textarea, .field.has-error .select,
.field.has-error .choice-group, .field.has-error .file-drop { border-color: var(--danger); }
.field.has-error .choice { border-color: var(--danger); }
.field__error { display: none; color: var(--danger); font-size: .82rem; margin-top: 7px; font-weight: 600; }
.field.has-error .field__error { display: block; }

/* =========================================================================
   Footer nav (Back / Save / Next / Submit)
   ========================================================================= */
.form-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 22px; padding: 18px 0;
}
.form-nav__left, .form-nav__right { display: flex; gap: 10px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm); font-size: .95rem; font-weight: 600;
  border: 1.5px solid transparent; cursor: pointer; font-family: var(--font);
  transition: background .18s, color .18s, border-color .18s, transform .08s, box-shadow .18s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand-primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--brand-primary-700); box-shadow: var(--shadow-md); }
.btn--success { background: var(--brand-accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn--success:hover { background: var(--brand-accent-600); }
.btn--ghost { background: transparent; color: var(--brand-primary); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--brand-primary); background: var(--surface-alt); }
.btn--text { background: transparent; color: var(--text-muted); }
.btn--text:hover { color: var(--brand-primary); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.save-status { font-size: .8rem; color: var(--text-faint); }
.save-status.is-saved { color: var(--brand-accent-600); }

/* =========================================================================
   Thank-you / success page
   ========================================================================= */
.thankyou { text-align: center; padding: 30px 20px 10px; }
.thankyou__check {
  width: 84px; height: 84px; margin: 0 auto 22px; border-radius: 50%;
  background: var(--brand-accent); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem; box-shadow: 0 8px 24px rgba(90,168,50,.4);
}
.thankyou__title { font-size: 1.8rem; margin-bottom: 12px; }
.thankyou__text { color: var(--text-muted); max-width: 520px; margin: 0 auto 8px; }

/* =========================================================================
   Toast / banners
   ========================================================================= */
.banner {
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px;
  font-size: .9rem; display: flex; gap: 10px; align-items: flex-start;
}
.banner--error { background: var(--danger-bg); color: #842c22; border: 1px solid #f0b7af; }
.banner--info { background: #eaf3fb; color: #1d4e74; border: 1px solid #bcdcf3; }

/* Overlay loader */
.overlay { position: fixed; inset: 0; background: rgba(18,52,66,.45); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; z-index: 100; }
.overlay.is-open { display: flex; }
.overlay__box { background: #fff; border-radius: var(--radius); padding: 28px 36px; box-shadow: var(--shadow-lg); text-align: center; }
.spinner { width: 40px; height: 40px; border: 4px solid #e3eaf2; border-top-color: var(--brand-primary); border-radius: 50%; margin: 0 auto 14px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================================
   Sign-in gate
   ========================================================================= */
.auth-gate {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: linear-gradient(135deg, #0a6e94 0%, #123442 100%);
}
.auth-gate[hidden] { display: none; }
.auth-gate__card {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 40px 36px; max-width: 460px; width: 100%; text-align: center;
  border-top: 4px solid var(--brand-cyan);
}
.auth-gate__logo { height: 54px; width: auto; margin-bottom: 20px; }
.auth-gate__title { font-size: 1.5rem; margin-bottom: 12px; }
.auth-gate__text { color: var(--text-muted); font-size: .94rem; margin-bottom: 26px; }
.auth-gate__btn { display: flex; justify-content: center; min-height: 44px; }
.auth-gate__dev { margin-top: 16px; }
.auth-gate__help { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--border, #e2e8f0); font-size: .86rem; color: var(--text-muted); }
.auth-gate__help a { color: var(--brand-primary, #0a6e94); font-weight: 600; text-decoration: none; white-space: nowrap; }
.auth-gate__help a:hover { text-decoration: underline; }
.auth-gate__dev button {
  background: none; border: 0; color: var(--text-faint); font-size: .82rem;
  text-decoration: underline; cursor: pointer; font-family: var(--font);
}
.auth-gate__dev button:hover { color: var(--brand-primary); }
.auth-gate .banner { margin-top: 18px; margin-bottom: 0; text-align: left; }

.auth-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--brand-cyan-soft); color: var(--brand-primary);
  border: 1px solid #bfe9f8; border-radius: 999px; padding: 6px 12px;
  font-size: .8rem; font-weight: 600; max-width: 240px;
}
.auth-chip[hidden] { display: none; }
.auth-chip__email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A locked (auto-filled) input */
.input[readonly] { background: var(--surface-alt); cursor: not-allowed; color: var(--text-muted); }

/* =========================================================================
   Sidebar toggle (mobile)
   ========================================================================= */
.sidebar-toggle { display: none; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 940px) {
  .layout { flex-direction: column; gap: 16px; padding: 16px 14px 70px; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; width: 270px; flex-basis: auto;
    border-radius: 0; transform: translateX(-100%); transition: transform .3s ease; overflow-y: auto;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; }
  .sidebar-backdrop.is-open { display: block; }
  .sidebar-toggle {
    display: inline-flex; align-items: center; gap: 7px;
    background: #fff; color: var(--brand-primary); border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); padding: 9px 14px; font-weight: 600; cursor: pointer; font-size: .85rem;
  }
  .page-card__header { padding: 22px 20px 18px; }
  .page-card__body { padding: 20px 18px 24px; }
  .page-card__title { font-size: 1.3rem; }
  .app-header__subtitle { display: none; }
}
@media (max-width: 560px) {
  .app-header__bar { padding: 14px 16px; flex-wrap: wrap; }
  .btn { padding: 11px 16px; font-size: .9rem; }
  .form-nav { flex-wrap: wrap; }
  .choice-group--horizontal { flex-direction: column; }
}

/* =========================================================================
   Admin Dashboard
   ========================================================================= */
.dash-body { background: var(--bg); }
.dash-tabs-wrap {
  position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border);
}
/* Right-edge fade hints that more sections are scrollable into view. */
.dash-tabs-wrap::after {
  content: ""; position: absolute; top: 0; right: 0; height: 100%; width: 40px;
  pointer-events: none; background: linear-gradient(to right, rgba(255,255,255,0), var(--surface));
}
.dash-tabs {
  display: flex; gap: 4px; overflow-x: auto; background: var(--surface);
  padding: 0 16px; scrollbar-width: thin;
}
.dash-tabs::-webkit-scrollbar { height: 6px; }
.dash-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.dash-tab {
  flex: 0 0 auto; background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 14px 16px; font-family: var(--font); font-size: .9rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer; white-space: nowrap;
}
.dash-tab:hover { color: var(--brand-primary); }
.dash-tab.is-active { color: var(--brand-primary); border-bottom-color: var(--brand-cyan); }

.dash-main { max-width: 1280px; margin: 0 auto; padding: 24px 20px 80px; }
.dash-loading { text-align: center; color: var(--text-muted); padding: 80px 0; }

/* A quiet toolbar so the controls read as a group and don't compete with KPIs. */
.dash-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px;
  background: var(--bg-subtle, #f5f8fb); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; }
.dash-filters__title { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase; color: var(--text-muted); padding-right: 4px; }
.dash-filters__title svg { color: var(--brand-primary); }
.dash-filters__search { max-width: 320px; }
.dash-filters__sel { max-width: 240px; }
.dash-filters__count { font-size: .82rem; color: var(--text-muted); margin-left: auto; font-weight: 600; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 18px 20px; }
.kpi__value { font-size: 1.9rem; font-weight: 700; color: var(--brand-primary); line-height: 1.1; }
.kpi__label { font-size: .92rem; font-weight: 600; color: var(--text); margin-top: 4px; }
.kpi__sub { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.kpi-caption { font-size: .8rem; color: var(--text-muted); margin: -10px 0 22px; line-height: 1.5; }
.kpi-group-label { font-size: .72rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-faint); margin: 0 0 8px; }

.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 26px; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 16px 18px; display: flex; flex-direction: column; }
.chart-card__title { font-size: .9rem; font-weight: 600; color: var(--text); margin-bottom: 12px; line-height: 1.3; }
.chart-box { position: relative; width: 100%; height: 240px; }
.chart-card--wide { grid-column: 1 / -1; }
.chart-card--likert .chart-box { height: var(--likert-h, 320px); }
.chart-card__empty { color: var(--text-faint); font-size: .85rem; text-align: center; padding: 30px 0; }
.dash-filters__date { max-width: 150px; }
.dash-daterange { display: inline-flex; align-items: center; gap: 6px; }
.dash-daterange__lbl { font-size: .82rem; font-weight: 600; color: var(--text-muted); }
.dash-daterange__sep { color: var(--text-faint); }
.auth-gate__loading { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; color: var(--text-muted); font-size: .9rem; }
.auth-gate__loading .spinner { width: 24px; height: 24px; margin: 0; border-width: 3px; }

.dash-h2 { font-size: 1.15rem; color: var(--brand-ink); margin: 8px 0 14px; }
.dash-h3 { font-size: .98rem; font-weight: 700; color: var(--brand-ink); margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--brand-primary, #0a6e94); }
.dash-h3:first-of-type { margin-top: 10px; }

.dash-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 26px; }
.dash-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.dash-table th { text-align: left; background: var(--brand-primary); color: #fff; font-weight: 600; padding: 11px 13px; white-space: nowrap; position: sticky; top: 0; }
.dash-table td { padding: 9px 13px; border-bottom: 1px solid var(--border); color: var(--text); max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.dash-table tbody tr:nth-child(even) { background: var(--surface-alt); }
.dash-table tbody tr:hover { background: var(--brand-cyan-soft); }
.dash-table a { color: var(--brand-primary-300); font-weight: 600; }
.dash-table .muted { color: var(--text-faint); }
.dash-table__empty { text-align: center; color: var(--text-faint); padding: 26px; }

@media (max-width: 560px) {
  .chart-grid { grid-template-columns: 1fr; }
  .dash-filters__count { margin-left: 0; width: 100%; }
}

/* =========================================================================
   Portal landing
   ========================================================================= */
.portal { max-width: 920px; margin: 0 auto; padding: 40px 20px 80px; }
.portal-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.portal-card {
  display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--border);
  border-top: 4px solid var(--accent, var(--brand-cyan)); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 24px 22px; transition: box-shadow .15s, transform .08s;
}
.portal-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.portal-card__title { font-size: 1.2rem; font-weight: 700; color: var(--brand-ink); }
.portal-card__desc { color: var(--text-muted); font-size: .9rem; margin: 8px 0 16px; line-height: 1.5; }
.portal-card__go { color: var(--accent, var(--brand-primary)); font-weight: 700; font-size: .9rem; }

/* =========================================================================
   Self-service report view (/view)
   ========================================================================= */
.report { max-width: 880px; margin: 0 auto; padding: 28px 20px 80px; }
.report-card, .report-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 24px 28px; margin-bottom: 18px;
}
.report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.report-head__eyebrow { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--brand-primary); }
.report-head__title { font-size: 1.4rem; margin: 6px 0 4px; }
.report-head__meta { color: var(--text-muted); font-size: .9rem; }
.report-head__badge { background: var(--brand-accent); color: #fff; border-radius: 999px; padding: 6px 14px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.report-head__pdf { display: block; text-align: right; margin-top: 8px; font-size: .82rem; font-weight: 600; color: var(--brand-primary-300); }
.report-section__title { font-size: 1.1rem; color: var(--brand-ink); margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--border); }
.report-dl { display: grid; grid-template-columns: minmax(220px, 38%) 1fr; gap: 0; margin: 0; }
.report-dl dt { font-weight: 600; color: var(--text); padding: 11px 16px 11px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.report-dl dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: .92rem; }
.report-dl dd a { color: var(--brand-primary-300); font-weight: 600; }
.report-empty { text-align: center; padding: 24px 10px; }
.report-empty h2 { margin-bottom: 10px; }
.report-empty p { color: var(--text-muted); }
@media (max-width: 560px) {
  .report-dl { grid-template-columns: 1fr; }
  .report-dl dt { padding-bottom: 2px; border-bottom: 0; }
  .report-dl dd { padding-top: 2px; }
}

/* Print */
@media print {
  .sidebar, .progress, .form-nav, .app-header__actions, .sidebar-toggle { display: none !important; }
  .page-card { box-shadow: none; border: 0; }
  body { background: #fff; }
}
