/* Admin console (internal support) */

.admin-body {
  margin: 0;
  min-height: 100vh;
  background: #f8fafc;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0f172a;
}

.admin-header {
  background: #0f172a;
  color: #f8fafc;
  border-bottom: 1px solid #1e293b;
}

.admin-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.admin-header__title {
  color: #f8fafc;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.admin-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.admin-header__logout-form {
  margin: 0;
  display: inline;
}

.admin-header__logout {
  margin: 0;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  background: #e2e8f0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.admin-header__logout:hover {
  background: #cbd5e1;
}

.admin-link {
  color: #93c5fd;
  text-decoration: none;
}

.admin-link:hover {
  text-decoration: underline;
}

.admin-link-strong {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: none;
}

.admin-link-strong:hover {
  text-decoration: underline;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.admin-nav__link {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.95rem;
}

.admin-nav__link:hover {
  color: #fff;
}

.admin-nav__link--active {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.admin-page__title {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
}

.admin-page__lead {
  margin: 0 0 1.25rem;
  color: #475569;
}

.admin-stat-highlight {
  font-weight: 800;
  font-size: 1.35rem;
  color: #0f172a;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-metric-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.admin-metric-card--alert {
  border-color: #fecaca;
  background: #fff1f2;
}

.admin-metric-card__label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.admin-metric-card__value {
  font-size: 1.45rem;
  font-weight: 700;
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.admin-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.admin-panel__title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.admin-panel__subtitle {
  margin: 1.25rem 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.admin-db-health-dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) 1fr;
  gap: 0.65rem 1.25rem;
  font-size: 0.92rem;
  align-items: start;
}

.admin-db-health-dl dt {
  margin: 0;
  color: #64748b;
  font-weight: 600;
}

.admin-db-health-dl dd {
  margin: 0;
}

.admin-db-health__primary {
  font-weight: 700;
  margin-right: 0.35rem;
}

.admin-chart-wrap {
  position: relative;
  height: 240px;
}

.admin-disk-summary {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.admin-disk-bar {
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.admin-disk-bar__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.admin-disk-bar__fill--green {
  background: #22c55e;
}

.admin-disk-bar__fill--amber {
  background: #f59e0b;
}

.admin-disk-bar__fill--red {
  background: #ef4444;
}

.admin-table-scroll {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

.admin-table__num {
  text-align: right;
  white-space: nowrap;
}

.admin-table__mono {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
}

.admin-th-link {
  color: #0f172a;
  text-decoration: none;
  font-weight: 600;
}

.admin-th-link:hover {
  text-decoration: underline;
}

.admin-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.admin-pill--ok {
  background: #dcfce7;
  color: #166534;
}

.admin-pill--bad {
  background: #fee2e2;
  color: #991b1b;
}

.admin-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.admin-tag--success {
  background: #dcfce7;
  color: #166534;
}

.admin-tag--amber {
  background: #fef3c7;
  color: #92400e;
}

.admin-tag--muted {
  background: #f1f5f9;
  color: #475569;
}

.admin-muted {
  color: #64748b;
  margin: 0;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

.admin-input {
  padding: 0.45rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  min-width: 220px;
  font: inherit;
}

.admin-input--grow {
  flex: 1 1 220px;
  min-width: 200px;
}

.admin-grant-credits {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-grant-credits__fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  flex: 1 1 280px;
}

.admin-grant-credits__label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.admin-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-button {
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: none;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.admin-button:hover {
  background: #1d4ed8;
}

.admin-pagination {
  margin-top: 1rem;
}

.admin-pagination__info {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: #64748b;
}

.admin-breadcrumb {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.admin-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.5rem 1rem;
  font-size: 0.92rem;
}

.admin-dl dt {
  margin: 0;
  color: #64748b;
  font-weight: 600;
}

.admin-dl dd {
  margin: 0;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
/* =========================
   AUTH PAGES (LOGIN / SIGNUP)
   ========================= */

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
}

.auth-body {
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.auth-container {
  width: 100%;
  max-width: 520px;
  padding: 2rem;
  margin: 6rem auto 3rem auto;
  padding-top: 4rem;
  padding-bottom: 2rem;
}

.auth-card {
  background: white;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  padding: 2rem 2.25rem 2.25rem;
}

.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-card h2 {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
}

/* Assessment → group allocation (drag & drop) */
.assessment-assign-groups__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 768px) {
  .assessment-assign-groups__grid {
    grid-template-columns: 1fr;
  }
}

/* Assessment form: second checkbox only when “Automatically generate reports” is checked */
.auto-reports-block .auto-reports-email {
  display: none;
}

.auto-reports-block:has(#assessment_auto_generate_reports:checked) .auto-reports-email {
  display: block;
}

.assessment-assign-groups__panel {
  min-height: 12rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.assessment-assign-groups__panel.dropzone-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  background: #eff6ff;
}

.assessment-assign-groups__panel--assigned {
  background: #fff;
}

.assessment-assign-groups__panel-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.assessment-assign-groups__hint {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  color: #64748b;
}

.assessment-assign-groups__empty {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: #64748b;
  border: 2px dashed #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.assessment-assign-groups__empty--drop {
  color: #94a3b8;
}

.assessment-assign-groups__chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: grab;
  font-size: 0.9rem;
}

.assessment-assign-groups__chip.is-dragging {
  opacity: 0.55;
}

.assessment-assign-groups__chip--assigned {
  cursor: grab;
  flex-direction: column;
  align-items: stretch;
}

.assessment-assign-groups__chip-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
}

.assessment-assign-groups__chip-label {
  font-weight: 600;
  color: #0f172a;
}

a.assessment-assign-groups__chip-label {
  text-decoration: none;
}

a.assessment-assign-groups__chip-label:hover {
  text-decoration: underline;
}

.assessment-assign-groups__chip-meta {
  font-size: 0.75rem;
  color: #64748b;
}

.assessment-assign-groups__chip-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 0.25rem;
}

.assessment-assign-groups__remove {
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  font-weight: 600;
}

.assessment-assign-groups__remove:hover {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
}

/* Organisation settings (edit): two cards side by side */
.org-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

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

/* Form fields */
.auth-card .field {
  margin-bottom: 1rem;
}

.auth-card label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.auth-card .field--checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.auth-card .field--checkbox label {
  display: inline;
  margin-bottom: 0;
}

.field--password-toggle .field__password-wrap {
  position: relative;
  display: block;
}

.field--password-toggle .field__password-wrap input[type="password"],
.field--password-toggle .field__password-wrap input[type="text"] {
  width: 100%;
  padding-right: 2.85rem;
  box-sizing: border-box;
}

/* Sign-in: same outer box and padding as password + toggle row (eye sits in the extra right padding). */
.auth-card .field--login-email input[type="email"] {
  padding-right: 2.85rem;
  box-sizing: border-box;
}

.field--password-toggle .field__password-toggle {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  line-height: 0;
}

.field--password-toggle .field__password-toggle:hover {
  background: rgba(100, 116, 139, 0.1);
  color: #334155;
}

.field--password-toggle .field__password-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
  border-radius: 8px;
}

.field--password-toggle .field__password-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.field--password-toggle .field__password-toggle-icon--hidden {
  display: none;
}

.field--password-toggle .field__password-toggle-svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"],
.auth-card input[type="tel"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  line-height: 1.4;
}

.auth-card select {
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 2.25rem 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  line-height: 1.4;
  background-color: #fff;
  color: #111827;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  box-sizing: border-box;
}

.auth-card input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.auth-card select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* SMTP: Port + Authentication (compact row) */
.auth-card .field--smtp-port-auth {
  display: grid;
  grid-template-columns: minmax(4.75rem, 6.5rem) minmax(0, 10.75rem);
  gap: 0.75rem 1.25rem;
  align-items: end;
}

@media (max-width: 420px) {
  .auth-card .field--smtp-port-auth {
    grid-template-columns: 1fr;
  }
}

.auth-card .field--smtp-port-auth .field--smtp-port label,
.auth-card .field--smtp-port-auth .field--smtp-auth label {
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}

.auth-card .field--smtp-port-auth .field--smtp-port,
.auth-card .field--smtp-port-auth .field--smtp-auth {
  margin-bottom: 0;
}

.auth-card .field--smtp-port-auth input.smtp-port-input[type="number"] {
  width: 100%;
  max-width: 6.5rem;
  box-sizing: border-box;
  padding: 0.5rem 0.45rem;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  background: #f8fafc;
}

.auth-card .field--smtp-port-auth input.smtp-port-input[type="number"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  background: #fff;
}

.auth-card .field--smtp-port-auth select.smtp-auth-select {
  width: 100%;
  max-width: 10.75rem;
  padding: 0.42rem 1.75rem 0.42rem 0.65rem;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 0.8125rem;
  line-height: 1.35;
  background-color: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  box-sizing: border-box;
}

.auth-card .field--smtp-port-auth select.smtp-auth-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Buttons */
.auth-card .actions input[type="submit"] {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.65rem;
  border-radius: 999px;
  border: none;
  background: #2563eb;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.auth-card .actions input[type="submit"]:hover {
  background: #1d4ed8;
}

/* SMTP form: compact Save + Verify side by side */
.auth-card .actions.actions--inline {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
  justify-content: flex-start;
}

.auth-card .actions.actions--inline input[type="submit"] {
  width: auto;
  margin-top: 0;
  padding: 0.45rem 0.9rem;
  font-size: 0.8125rem;
}

.auth-card .actions.actions--inline input[type="submit"].actions__submit--verify {
  background: #ea580c;
}

.auth-card .actions.actions--inline input[type="submit"].actions__submit--verify:hover {
  background: #c2410c;
}

/* Links */
.auth-links {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
}

.auth-links a {
  color: #2563eb;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.75rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

/* =========================
   intl-tel-input overrides
   ========================= */

.iti {
  width: 100%;
}

.iti input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 3.2rem; /* space for flag */
  border-radius: 12px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  height: auto;
  box-sizing: border-box;
}

.iti input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.iti__flag-container {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.iti--allow-dropdown input {
  padding-left: 3.2rem;
}
/* =========================
   Flash messages (global)
   ========================= */

.flash-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  /* Below .topbar so the main nav stays clickable; top offset when topbar is present */
  z-index: 9998;
  width: 100%;
  max-width: 720px;
  padding: 0 1rem;
  pointer-events: none;
}

body.app-has-topbar .flash-container {
  top: 5rem;
}

.flash {
  pointer-events: auto;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  text-align: center;
  animation: flashFadeOut 6s forwards;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Success / notice */
.flash-notice {
  background: #ecfeff;
  border: 1px solid #67e8f9;
  color: #155e75;
}

/* Errors / alerts */
.flash-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

@keyframes flashFadeOut {
  0% { opacity: 0; transform: translateY(-10px); }
  10% { opacity: 1; transform: translateY(0); }
  70% { opacity: 1; transform: translateY(0); }
  /* Invisible elements still intercept clicks unless we disable hit-testing */
  100% {
    opacity: 0;
    transform: translateY(0);
    pointer-events: none;
    visibility: hidden;
  }
}

/* =========================
   Dashboard
   ========================= */

.dashboard {
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
}

.dashboard-header .subtitle {
  color: #64748b;
  font-size: 0.95rem;
}

.pagination-footer {
  margin-top: 1.5rem;
}

/* Table/list footers: keep “per page” on the same line as the select; fixed width for 10 / 25 / 50 */
.pagination-per-page-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.pagination-per-page-form {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
}

/* Narrow native select (10 / 25 / 50): tight box, matches list table scale (0.95rem) */
.pagination-per-page-select {
  padding: 0.22rem 0.06rem 0.22rem 0.18rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  width: 2.7rem;
  min-width: 2.7rem;
  max-width: 2.7rem;
  flex-shrink: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  line-height: 1.25;
  text-align: center;
  background-color: #fff;
  color: #0f172a;
}

/* “per page” — serif caption like dashboard reference; stays on one line via .pagination-per-page-form */
.pagination-per-page-label {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 0.95rem;
  line-height: 1.25;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Figures index allows 100 items per page — slightly wider select */
.pagination-per-page-select--wide {
  width: 3.5rem;
  min-width: 3.5rem;
  max-width: 3.5rem;
}

/*
 * List index pagination lives inside `.auth-card` on some pages (assessments, reports, questions).
 * `.auth-card select` uses width:100% and full-width padding — higher specificity than `.pagination-per-page-select` alone.
 */
.auth-card select.pagination-per-page-select {
  width: 2.7rem;
  min-width: 2.7rem;
  max-width: 2.7rem;
  padding: 0.22rem 0.06rem 0.22rem 0.18rem;
  border-radius: 6px;
  appearance: auto;
  -webkit-appearance: menulist;
  background-image: none;
  background-repeat: no-repeat;
  background-position: initial;
  line-height: 1.25;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  text-align: center;
  color: #0f172a;
  flex-shrink: 0;
  box-sizing: border-box;
}

.auth-card select.pagination-per-page-select--wide {
  width: 3.5rem;
  min-width: 3.5rem;
  max-width: 3.5rem;
}

/* Dashboard onboarding checklist */
.onboarding-checklist {
  margin-bottom: 1.75rem;
  padding: 1.25rem 1.35rem;
}

.onboarding-checklist__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.onboarding-checklist__title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.onboarding-checklist__progress-label {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
}

.onboarding-checklist__toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.45rem 0.95rem 0.45rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.onboarding-checklist__toggle:hover {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.onboarding-checklist__toggle:focus {
  outline: none;
}

.onboarding-checklist__toggle:focus-visible {
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px rgba(37, 99, 235, 0.45);
}

.onboarding-checklist__toggle:active {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.onboarding-checklist__toggle-icon {
  display: flex;
  flex-shrink: 0;
  color: #64748b;
  transition: transform 0.22s ease, color 0.15s ease;
}

.onboarding-checklist__toggle:hover .onboarding-checklist__toggle-icon {
  color: #2563eb;
}

/* Expanded = panel open → chevron points up (collapse) */
.onboarding-checklist__toggle[aria-expanded="true"] .onboarding-checklist__toggle-icon {
  transform: rotate(180deg);
}

.onboarding-checklist__toggle-label {
  line-height: 1.2;
}

.onboarding-checklist__progress-track {
  height: 0.45rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 1rem;
}

.onboarding-checklist__progress-bar {
  height: 100%;
  border-radius: 999px;
  background: #2563eb;
  transition: width 0.25s ease;
}

.onboarding-checklist__next-hint {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: #475569;
}

.onboarding-checklist__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.onboarding-checklist__step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.onboarding-checklist__step--next .onboarding-checklist__step-link {
  font-weight: 600;
  color: #1d4ed8;
}

.onboarding-checklist__step--done .onboarding-checklist__step-link {
  color: #64748b;
  text-decoration: line-through;
}

.onboarding-checklist__step-status {
  width: 1.25rem;
  text-align: center;
  color: #94a3b8;
  flex-shrink: 0;
}

.onboarding-checklist__step--done .onboarding-checklist__step-status {
  color: #16a34a;
}

/* Data tables: topbar .nav-link uses large padding — inside cells it skews columns vs headers */
table.data-table {
  table-layout: fixed;
}

table.data-table th,
table.data-table td {
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

table.data-table .nav-link {
  display: inline;
  padding: 0.15rem 0.3rem;
  margin: 0 -0.05rem;
  font-size: inherit;
  line-height: 1.45;
  vertical-align: baseline;
}

table.data-table .nav-link:hover {
  border-radius: 4px;
}

/* Assessments / contacts / students / groups / questions: icon-only row actions (Heroicons-style SVG) */
table.data-table .assessment-icon-link,
table.data-table .contact-icon-link,
table.data-table .student-icon-link,
table.data-table .group-icon-link,
table.data-table .question-icon-link,
.contact-card-actions .contact-icon-link,
.student-card-actions .student-icon-link,
.group-card-actions .group-icon-link,
.group-assignment-card-actions .assessment-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border-radius: 8px;
  color: #2563eb;
  line-height: 0;
  text-decoration: none;
}

table.data-table .assessment-icon-link:hover,
table.data-table .contact-icon-link:hover,
table.data-table .student-icon-link:hover,
table.data-table .group-icon-link:hover,
table.data-table .question-icon-link:hover,
.contact-card-actions .contact-icon-link:hover,
.student-card-actions .student-icon-link:hover,
.group-card-actions .group-icon-link:hover,
.group-assignment-card-actions .assessment-icon-link:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

table.data-table .assessment-icon-link svg,
table.data-table .contact-icon-link svg,
table.data-table .student-icon-link svg,
table.data-table .group-icon-link svg,
table.data-table .question-icon-link svg,
.contact-card-actions .contact-icon-link svg,
.student-card-actions .student-icon-link svg,
.group-card-actions .group-icon-link svg,
.group-assignment-card-actions .assessment-icon-link svg {
  flex-shrink: 0;
}

/* School years: current calendar year (index) or current period (show) */
.school-years-highlight-row {
  background: #eff6ff;
  box-shadow: inset 4px 0 0 #2563eb;
}

.school-years-highlight-row > td {
  background: transparent;
}

/* Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.metric-card h3 {
  font-size: 2rem;
  margin: 0;
  color: #2563eb;
}

.metric-card p.metric-card__people-context {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.metric-card__people-lines {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.metric-card__people-lines .metric-people-line {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.35;
  color: #64748b;
  font-weight: 500;
  font-size: 0.8rem;
  font-weight: 600;
}

.metric-card__people-lines .metric-people-line strong {
  color: #2563eb;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-right: 0.35rem;
  font-size: 2rem;
}

.metric-card p {
  margin-top: 0.25rem;
  color: #475569;
  font-size: 0.9rem;
}

.metric-card--calendar .metric-card__calendar-label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.metric-card--calendar .metric-card__calendar-date {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  line-height: 1.2;
  color: #2563eb;
}

.metric-card--calendar .metric-card__calendar-full-date {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
}

.metric-card--calendar .metric-card__calendar-dl {
  margin: 0;
  font-size: 0.88rem;
  color: #475569;
}

.metric-card--calendar .metric-card__calendar-dl dt {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.metric-card--calendar .metric-card__calendar-dl dt:first-of-type {
  margin-top: 0;
}

.metric-card--calendar .metric-card__calendar-dl dd {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.5rem;
}

.chart-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.chart-card h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.chart-card__hint {
  margin: -0.35rem 0 0.75rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #64748b;
}

.dashboard-status-chart-wrap {
  min-height: 14rem;
}

.dashboard-status-chart-wrap--empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-empty-message {
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
}

/* =========================
   Top navigation
   ========================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid #e5e7eb;
  background: white;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: #2563eb;
}

.main-nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav-item {
  position: relative;
}

.nav-item:hover .nav-dropdown {
  display: block;
}

.nav-link {
  text-decoration: none;
  font-size: 1.05rem;
  color: #334155;
  padding: 0.75rem 1rem;    /* increases clickable area */
  line-height: 1.2;
  font-weight: 600;
}

.nav-link:hover {
  color: #2563eb;
}

.nav-link.active {
  font-weight: 600;
  color: #2563eb;
}

/* Top bar only: avoid default :visited colour and “stuck” blue after mouse click (:focus without :focus-visible) */
.topbar .main-nav .nav-link:visited {
  color: #334155;
}

.topbar .main-nav .nav-link:visited:hover {
  color: #2563eb;
}

.topbar .main-nav .nav-link.active:visited {
  color: #2563eb;
}

.topbar .main-nav .nav-link:focus {
  outline: none;
  color: #334155;
}

.topbar .main-nav .nav-link.active:focus {
  color: #2563eb;
}

.topbar .main-nav .nav-link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
  border-radius: 6px;
}

.nav-dropdown-link {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: #334155;
}

.nav-dropdown-link:hover {
  background: #f8fafc;
}

.nav-dropdown-link.active {
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
}

.topbar .nav-dropdown-link:visited {
  color: #334155;
}

.topbar .nav-dropdown-link.active:visited {
  color: #2563eb;
}

.topbar .nav-dropdown-link:focus {
  outline: none;
}

.topbar .nav-dropdown-link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  border-radius: 4px;
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  min-width: 180px;
  padding: 0.5rem 0;
  z-index: 50;
}

/* User dropdown */
.user-menu {
  position: relative;
  cursor: pointer;
  font-size: 0.9rem;
  color: #334155;
}

.user-menu .chevron {
  margin-left: 0.25rem;
  font-size: 0.7rem;
}

.dropdown {
  position: absolute;
  right: 0;
  top: 120%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  min-width: 160px;
  padding: 0.5rem 0;
  display: none;
}

.dropdown a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: #334155;
  text-decoration: none;
}

.dropdown a:hover {
  background: #f1f5f9;
}

.dropdown hr {
  margin: 0.5rem 0;
  border: none;
  border-top: 1px solid #e5e7eb;
}

.user-menu.open .dropdown {
  display: block;
}

/* Main content spacing */
.main-content {
  padding: 2rem;
  background: #f8fafc;
}

/* =========================
   User dropdown (CSS-only)
   ========================= */

.user-nav {
  position: relative;
}

.user-trigger {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  padding: 0.6rem;
}

.user-trigger:focus {
  outline: none;
}

.user-trigger .chevron {
  font-size: 0.8rem;
  margin-left: 0.35rem;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: 120%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  min-width: 160px;
  padding: 0.5rem 0;
  list-style: none;
  display: none;
  z-index: 1000;
}

.user-dropdown li a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: #334155;
  text-decoration: none;
}

.user-dropdown li a:hover {
  background: #f1f5f9;
}

.user-dropdown .divider {
  height: 1px;
  background: #e5e7eb;
  margin: 0.5rem 0;
}

/* 🔑 SHOW DROPDOWN */
.user-nav:hover .user-dropdown,
.user-nav:focus-within .user-dropdown {
  display: block;
}

/* Logout button styled like a link */
.logout-form {
  margin: 0;
}

.logout-button {
  background: none;
  border: none;
  padding: 0.6rem 1rem;
  width: 100%;
  text-align: left;
  font-size: 0.95rem;
  color: #334155;
  cursor: pointer;
}

.logout-button:hover {
  background: #f1f5f9;
}

.chart-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 1.5rem 0;
}

.btn-danger {
  background: #fff;
  color: #dc2626; /* red-600 */
  border: 1px solid #d1d5db;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-danger:hover {
  background: #fef2f2; /* red-50 */
  border-color: #dc2626;
}

.dropzone-active {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  transition: all 0.15s ease;
}

.app-footer {
  padding: 1rem 2rem;
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
  font-size: 0.85rem;
  color: #64748b;
}

.footer-inner {
  max-width: 1200px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.footer-right a {
  text-decoration: none;
  color: #64748b;
}

.footer-right a:hover {
  color: #2563eb;
}



.page-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}

.filters-bar {
  margin-bottom: 1.5rem;
}

.filters-form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-input,
.filter-select {
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  min-width: 200px;
}

.assessments-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.assessment-card {
  background: white;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

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

.assessment-meta {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #64748b;
}

.assessment-tags {
  margin-top: 0.75rem;
}

.tag-badge {
  background: #eef2ff;
  color: #4338ca;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  margin-right: 0.5rem;
}

.status-badge {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-draft {
  background: #f1f5f9;
  color: #475569;
}

.status-ready {
  background: #e0f2fe;
  color: #0369a1;
}

.status-active {
  background: #dcfce7;
  color: #166534;
}

.status-closed {
  background: #fee2e2;
  color: #991b1b;
}

.assessment-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

.pagination-wrapper {
  margin-top: 2rem;
  text-align: center;
}

.settings-link {
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  display: block;
  margin-top: 0.75rem;
}

.settings-link:hover {
  text-decoration: underline;
}

.settings-desc {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 1.1rem;
}

/* Settings index: two columns — row 1: Organisation & content | People & customisation; row 2: Data & account | (empty) */
.settings-index .settings-section-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.settings-index__sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  width: 100%;
  align-items: start;
}

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

/* Settings → Portal: stacked cards (full width within .dashboard) */
.portal-settings__form {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.portal-settings__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.portal-settings__header .subtitle {
  max-width: 42rem;
  margin-top: 0.35rem;
}

.portal-settings__errors {
  margin-bottom: 1rem;
}

.portal-settings__stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* One future-friendly row = one white card on the grey main background */
.portal-setting-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8ecf0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.045);
  padding: 1.15rem 1.35rem;
}

.portal-setting-card__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.portal-setting-card__toggle {
  flex-shrink: 0;
}

/* List | switch | Grid */
.portal-setting-card__mode-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.65rem;
  flex-wrap: wrap;
}

.portal-setting-card__mode-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  min-width: 2.15rem;
  text-align: center;
  transition: color 0.15s ease;
}

.portal-setting-card__mode-toggle:has(.portal-switch__input:checked) .portal-setting-card__mode-label--grid {
  color: #2563eb;
}

.portal-setting-card__mode-toggle:not(:has(.portal-switch__input:checked)) .portal-setting-card__mode-label--list {
  color: #2563eb;
}

.portal-setting-card__mode-toggle--boolean:has(.portal-switch__input:checked) .portal-setting-card__mode-label--on {
  color: #2563eb;
}

.portal-setting-card__mode-toggle--boolean:not(:has(.portal-switch__input:checked)) .portal-setting-card__mode-label--off {
  color: #2563eb;
}

.portal-setting-card__body {
  flex: 1;
  min-width: 0;
}

.portal-setting-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.35;
}

.portal-setting-card__hint {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
}

.portal-settings__actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.portal-switch {
  position: relative;
  display: inline-block;
  width: 3.1rem;
  height: 1.7rem;
  flex-shrink: 0;
}

.portal-switch__input {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.portal-switch__visual {
  pointer-events: none;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s ease;
  position: relative;
}

.portal-switch__visual::after {
  content: "";
  position: absolute;
  top: 0.22rem;
  left: 0.22rem;
  width: 1.26rem;
  height: 1.26rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  transition: transform 0.2s ease;
}

.portal-switch__input:checked + .portal-switch__visual {
  background: #2563eb;
}

.portal-switch__input:checked + .portal-switch__visual::after {
  transform: translateX(1.36rem);
}

.portal-switch__input:focus-visible + .portal-switch__visual {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.badge {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-green { background:#dcfce7; }
.badge-yellow { background:#fef9c3; }
.badge-gray { background:#f1f5f9; }

.btn-small {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background:#f8fafc;
}

.btn-primary-small {
  background:#2563eb;
  color:white;
  border:none;
  padding:0.25rem 0.6rem;
  border-radius:6px;
}

.btn-danger-small {
  background:#fee2e2;
  color:#991b1b;
  border:1px solid #fecaca;
  padding:0.25rem 0.6rem;
  border-radius:6px;
}

/* Primary button: matches dashboard forms (figures, class levels, questions, etc.) */
.btn-primary,
input[type="submit"].btn-primary,
button.btn-primary {
  display: inline-block;
  box-sizing: border-box;
  background: #2563eb;
  color: #fff;
  padding: 0.55rem 1.35rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary:hover,
input[type="submit"].btn-primary:hover,
button.btn-primary:hover {
  background: #1d4ed8;
}

input[type="submit"].btn-primary:disabled,
button.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Support → Support access (token page): secondary / revoke action (pairs with .btn-primary) */
.support-access-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* button_to wraps each control in a form — keep them in the row */
.support-access-actions > form {
  display: inline-flex;
  margin: 0;
}

.btn-support-revoke,
input[type="submit"].btn-support-revoke,
button.btn-support-revoke {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-sizing: border-box;
  margin: 0;
  background: #fff;
  color: #b91c1c;
  border: 1.5px solid #fecdd3;
  padding: 0.52rem 1.2rem 0.52rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(185, 28, 28, 0.06);
}

.btn-support-revoke:hover,
input[type="submit"].btn-support-revoke:hover,
button.btn-support-revoke:hover {
  background: #fff1f2;
  border-color: #fb7185;
  color: #991b1b;
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.1);
}

.btn-support-revoke:focus-visible,
input[type="submit"].btn-support-revoke:focus-visible,
button.btn-support-revoke:focus-visible {
  outline: 2px solid #f43f5e;
  outline-offset: 2px;
}

.btn-support-revoke:active,
input[type="submit"].btn-support-revoke:active,
button.btn-support-revoke:active {
  background: #ffe4e6;
}

.pagination {
  display:flex;
  gap:0.4rem;
}

.pagination a, .pagination span {
  padding:0.3rem 0.6rem;
  border-radius:6px;
  border:1px solid #e2e8f0;
  font-size:0.8rem;
}

.pagination .current {
  background:#2563eb;
  color:white;
}

.settings-link.disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-group-students__img {
  display: block;
}

/* Support impersonation (support staff viewing a school) */
.support-impersonation-banner {
  background: #1e3a5f;
  color: #f1f5f9;
  font-size: 0.9rem;
  border-bottom: 1px solid #0f172a;
}

.support-impersonation-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.support-impersonation-banner__exit {
  flex-shrink: 0;
  background: transparent;
  color: #f1f5f9;
  border: 1px solid rgba(241, 245, 249, 0.45);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.support-impersonation-banner__exit:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Support requests — new request */
.support-request-new {
  max-width: min(60rem, 100%);
}

.support-request-new__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.support-request-new__error-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.support-request-form__stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.support-request-form__columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.support-request-form__columns > .support-request-form__card {
  min-height: 100%;
}

.support-request-form__card--description textarea {
  min-height: 10rem;
}

.support-request-form__summary-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 20rem);
  gap: 1.25rem 1.75rem;
  align-items: start;
}

.support-request-form__summary-fields > .field {
  min-width: 0;
}

.support-request-form__field-title .support-request-form__title-input {
  width: 100%;
  max-width: 26rem;
  box-sizing: border-box;
}

.support-request-form__summary-fields select {
  max-width: 100%;
}

@media (max-width: 768px) {
  .support-request-form__summary-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .support-request-form__columns {
    grid-template-columns: 1fr;
  }
}

.support-request-form__card.auth-card {
  padding: 1.5rem 1.75rem 1.65rem;
  margin: 0;
}

.support-request-form__card-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.support-request-form__card-lead {
  margin: 0 0 1.1rem;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.45;
}

.support-request-form .field {
  margin-bottom: 1.25rem;
}

.support-request-form .field--flush-bottom {
  margin-bottom: 0;
}

.support-request-form__card select,
.support-request-form__card textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}

.support-request-form__card select {
  cursor: pointer;
  appearance: none;
  line-height: 1.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.support-request-form__card textarea {
  resize: vertical;
  min-height: 11rem;
  line-height: 1.5;
}

.support-request-form__card select:focus,
.support-request-form__card textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.support-request-form__hint {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.45;
}

.support-request-form__dropzone {
  border: 2px dashed #e5e7eb;
  border-radius: 12px;
  padding: 1.35rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: #fafafa;
}

.support-request-form__dropzone:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.support-request-form__dropzone:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.support-request-form__dropzone-title {
  display: block;
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 500;
}

.support-request-form__file-input {
  display: none;
}

.support-request-form__preview {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: #334155;
}

.support-request-form__actions {
  margin-top: 5rem;
  padding-top: 0;
  border-top: none;
  gap: 0.75rem;
}

.support-request-form__cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.35rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.support-request-form__cancel:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* Figures (portal uses application.css — no Tailwind) */
.figures-index__file-input {
  display: none;
}

.figures-index__dropzone {
  border: 2px dashed #d1d5db;
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  background: #fff;
  transition: border-color 0.15s ease;
}

.figures-index__dropzone:hover {
  border-color: #60a5fa;
}

.figures-index__dropzone.dropzone-active {
  border-color: #2563eb;
  background: #eff6ff;
}

.figures-index__dropzone-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
}

.figures-index__dropzone-hint {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0.5rem 0 0 0;
}

.figures-index__dropzone .btn-primary {
  margin-top: 1rem;
}

.figures-index__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.figures-index__tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  text-decoration: none;
}

.figures-index__tag--active {
  background: #2563eb;
  color: #fff;
}

.figures-index__tag--inactive {
  background: #e5e7eb;
  color: #374151;
}

.figures-index__tag--inactive:hover {
  background: #d1d5db;
}

.figures-index__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.figures-index__card {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.15s ease;
}

.figures-index__card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.figures-index__card img {
  width: 100%;
  height: 10rem;
  object-fit: cover;
  display: block;
}

.figures-index__card-placeholder {
  width: 100%;
  height: 10rem;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 0.9rem;
}

.figures-index__card-body {
  padding: 0.75rem;
}

.figures-index__card-body p {
  margin: 0;
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.45;
}

.figures-index__link {
  color: #2563eb;
  text-decoration: none;
}

.figures-index__link:hover {
  text-decoration: underline;
}

.figures-index__tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.figures-index__tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: #f3f4f6;
  color: #1f2937;
}

.figures-index__footer {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .figures-index__footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.figures-index__footer-info {
  font-size: 0.875rem;
  color: #4b5563;
  min-width: 0;
}

.figures-index__footer-pagination {
  display: flex;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.figures-index__footer-per {
  flex-shrink: 0;
}

.figures-edit {
  max-width: 56rem;
  margin: 0 auto;
}

.figures-edit__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.figures-edit__back {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.figures-edit__back:hover {
  text-decoration: underline;
}

.figures-edit__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .figures-edit__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.figures-edit__preview {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.figures-edit__preview img {
  width: 100%;
  object-fit: contain;
  max-height: 480px;
  background: #f9fafb;
  display: block;
}

.figures-edit__placeholder {
  width: 100%;
  height: 16rem;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
}

.figures-edit__meta p {
  font-size: 0.875rem;
  color: #4b5563;
  margin: 0 0 0.35rem 0;
}

.figures-edit__meta a {
  color: #2563eb;
  text-decoration: none;
}

.figures-edit__meta a:hover {
  text-decoration: underline;
}

.figures-edit__form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.figures-edit__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}

.figures-edit__input,
.figures-edit__textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  font-size: 0.95rem;
  font-family: inherit;
}

.figures-edit__textarea {
  min-height: 6rem;
  resize: vertical;
}

.figures-edit__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.figures-edit__btn-secondary {
  display: inline-block;
  padding: 0.55rem 1rem;
  background: #e5e7eb;
  color: #1f2937;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
}

.figures-edit__btn-secondary:hover {
  background: #d1d5db;
}

.figures-edit__section {
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.figures-edit__section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.5rem 0;
}

.figures-edit__code {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: #f3f4f6;
  border-radius: 4px;
  font-size: 0.875rem;
  word-break: break-all;
}

.figures-edit__copy-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.figures-edit__btn-copy {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  background: #e5e7eb;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.figures-edit__btn-copy:hover {
  background: #d1d5db;
}

.figures-edit__btn-danger {
  padding: 0.55rem 1rem;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
}

.figures-edit__btn-danger:hover {
  background: #b91c1c;
}
