/* ==========================================================================
   Startup & Innovation Cell portal — one visual system, plain CSS.
   Mobile-first: every screen is checked at 360px before anything wider.
   No Node, no CDNs, no external fonts — system font stack only.
   ========================================================================== */

:root {
  /* Ink & surfaces */
  --ink: #191c24;
  --ink-soft: #5a6072;
  --ink-faint: #6d7488; /* 4.9:1 on white — keep small text readable */
  --bg: #f5f6f9;
  --card: #ffffff;
  --line: #e3e6ec;
  --line-soft: #edeff4;
  /* Brand */
  --accent: #2b4ecf;
  --accent-dark: #1e3aa8;
  --accent-soft: #eceffc;
  --accent-softer: #f5f7fe;
  /* Header (dark ink, slightly blue) */
  --header-bg: #171a23;
  --header-ink: #f5f6fa;
  --header-soft: #a8adbd;
  /* Semantic */
  --danger: #b4232c;
  --danger-bg: #fdecec;
  --success: #1d7a3d;
  --success-bg: #e8f7ee;
  --warn: #8a6100;
  --warn-bg: #fdf3d7;
  /* Shape & depth */
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(25, 28, 36, 0.06);
  --shadow-md: 0 6px 24px -8px rgba(25, 28, 36, 0.18);
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--accent-soft); }

/* Accessible, always-visible focus ring. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- layout */

.container {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem;
  flex: 1;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-bg);
}

.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--header-ink);
  font-size: 1rem;
  letter-spacing: 0.01em;
}
.brand:hover { color: #fff; }

.site-nav { display: flex; align-items: center; gap: 0.9rem; }

.site-nav a {
  color: var(--header-soft);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 120ms ease;
}
.site-nav a:hover { color: var(--header-ink); }
.site-header :focus-visible { outline-color: var(--header-ink); }

/* "Sign in" pill in the dark header */
.site-nav .btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.site-nav .btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.site-nav .btn-link { color: var(--header-soft); }
.site-nav .btn-link:hover { color: var(--header-ink); }

.site-footer {
  margin-top: 2rem;
  padding: 1.5rem 1rem 2rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  background: var(--card);
  border-top: 1px solid var(--line);
}
.site-footer p { margin: 0.15rem 0; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--ink); }
.site-footer .footer-brand {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.92rem;
}

h1 { font-size: 1.5rem; margin: 0.75rem 0; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; margin: 0 0 0.75rem; letter-spacing: -0.01em; }
h3 { font-size: 1rem; margin: 0; }

/* ----------------------------------------------------------------- cards */

.card, .step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.auth-card { max-width: 26rem; margin: 1.5rem auto; }

.empty-state, .closed-state, .confirmation { text-align: center; }
.empty-state { padding: 2rem 1rem; }
.empty-state h2 { color: var(--ink); }
.empty-state .btn { margin-top: 0.5rem; }

/* ------------------------------------------------------- landing / hero */

.hero {
  text-align: center;
  padding: 2rem 0 1.25rem;
  background: radial-gradient(38rem 15rem at 50% -3rem, var(--accent-soft), transparent 72%);
}
.hero h1 {
  font-size: 1.9rem;
  margin: 0.5rem 0 0.35rem;
  letter-spacing: -0.02em;
}
.hero .btn-primary { margin-top: 0.75rem; }

.hero-kicker {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  margin: 0;
}

.lede {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 34rem;
  margin: 0.5rem auto 1rem;
}

.deadline-banner {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.deadline-banner.closed { color: var(--danger); }

/* Countdown pill under the hero heading */
.countdown-pill {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.4rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  padding: 0.45rem 1.1rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0.25rem 0 0.5rem;
}
.countdown-pill strong { color: var(--ink); }
.countdown-pill .days-left {
  color: var(--accent-dark);
  font-weight: 700;
}
.countdown-pill.closed { color: var(--danger); border-color: var(--danger-bg); }

.how-it-works { margin-top: 2.25rem; }
.how-it-works > h2 { text-align: center; }

.steps-list { padding-left: 1.25rem; }
.steps-list li { margin-bottom: 0.6rem; }

/* 3-step "how it works" cards */
.step-cards {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  counter-reset: howto;
}
.step-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  counter-increment: howto;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.step-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.step-card::before {
  content: counter(howto);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.step-card h3 { margin-bottom: 0.25rem; }
.step-card p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }

.landing-cta {
  text-align: center;
  margin: 2.25rem 0 0.5rem;
}
.landing-cta .hint { margin-top: 0.5rem; }

/* ----------------------------------------------------------------- forms */

.field { margin-bottom: 1rem; }

label, legend { font-weight: 600; font-size: 0.95rem; }

.field label, .field legend { display: block; margin-bottom: 0.35rem; }

input[type="text"], input[type="email"], input[type="tel"],
input[type="number"], input[type="search"], input[type="datetime-local"],
select, textarea {
  width: 100%;
  padding: 0.65rem 0.7rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

textarea { resize: vertical; }

fieldset.field { border: 0; padding: 0; margin: 0 0 1rem; }

.field-hint, .hint { color: var(--ink-soft); font-size: 0.85rem; margin: 0.35rem 0 0; }
.optional { font-weight: 400; color: var(--ink-soft); font-size: 0.85rem; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
/* Grid items must be allowed to shrink, or wide inputs force the page to
   scroll sideways; at 360px the two columns stack instead. */
.field-row > .field { min-width: 0; }
@media (max-width: 479px) {
  .field-row { grid-template-columns: 1fr; }
}

.radio-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0;
  font-weight: 400;
}
.radio-row input { margin-top: 0.25rem; flex-shrink: 0; }

.checkbox-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.checkbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-weight: 400;
  font-size: 0.9rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.checkbox-chip:hover { border-color: var(--accent); }
.checkbox-chip:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice-cards { display: grid; gap: 0.75rem; margin-bottom: 1rem; }

.choice-card {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
  cursor: pointer;
  font-weight: 400;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
.choice-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.choice-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-softer);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.choice-card input { margin-top: 0.3rem; accent-color: var(--accent); }
.choice-card small { color: var(--ink-soft); }

.code-input {
  font-size: 1.5rem;
  letter-spacing: 0.4em;
  text-align: center;
}

.declaration { border-top: 1px solid var(--line); padding-top: 1rem; }

.honeypot {
  position: absolute;
  left: -5000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-block;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  min-height: 44px;
  transition: background 120ms ease, border-color 120ms ease,
              color 120ms ease, box-shadow 120ms ease;
}
.btn:hover { border-color: var(--ink-faint); box-shadow: var(--shadow-sm); }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-block { display: block; width: 100%; }
.btn-big { font-size: 1.05rem; padding: 0.8rem 1.5rem; }
.btn-small { padding: 0.4rem 0.8rem; min-height: 0; }

.btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.btn-link:hover { color: var(--accent-dark); }

.inline-form { display: inline; }

.step-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.step-nav .btn { flex: 1; }

.resend-form { margin-top: 1rem; text-align: center; }

/* ------------------------------------------------------- states & badges */

.step-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 0 0 0.25rem;
}

.flash-stack { margin-bottom: 1rem; }

.flash {
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.92rem;
  margin: 0 0 0.5rem;
}
.flash-error { background: var(--danger-bg); color: var(--danger); }
.flash-success { background: var(--success-bg); color: var(--success); }

.form-errors {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.form-errors p { margin: 0.2rem 0; }

.status-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.status-badge.status-shortlisted { background: var(--success-bg); color: var(--success); }
.status-badge.status-withdrawn { background: var(--danger-bg); color: var(--danger); }

.meta-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  margin: 0.75rem 0;
}
.meta-list dt { font-weight: 600; color: var(--ink-soft); }
.meta-list dd { margin: 0; overflow-wrap: anywhere; }

.review-block { border-top: 1px solid var(--line); padding-top: 0.9rem; margin-top: 0.9rem; }
.review-block:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.review-head { display: flex; align-items: center; justify-content: space-between; }
.review-abstract { white-space: pre-line; }

/* Loading state: htmx adds .htmx-request to the element issuing the request. */
.htmx-request { opacity: 0.6; pointer-events: none; }

/* -------------------------------------------- multi-step form progress */
/* Labelled dots across the top of the submission form. States come from
   the route (progress = list of {label, state}); templates only render. */

.progress-steps {
  display: flex;
  align-items: flex-start;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.progress-steps li {
  flex: 1;
  position: relative;
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-faint);
  padding-top: 1.5rem;
  min-width: 0;
}
.progress-steps li::before {
  /* the dot */
  content: "";
  position: absolute;
  top: 0.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  background: var(--card);
  border: 2px solid var(--line);
  z-index: 1;
  transition: background 150ms ease, border-color 150ms ease;
}
.progress-steps li::after {
  /* the connector */
  content: "";
  position: absolute;
  top: 0.62rem;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--line);
}
.progress-steps li:first-child::after { display: none; }
.progress-steps li.is-done { color: var(--ink-soft); }
.progress-steps li.is-done::before { background: var(--accent); border-color: var(--accent); }
.progress-steps li.is-done::after { background: var(--accent); }
.progress-steps li.is-current { color: var(--accent-dark); font-weight: 700; }
.progress-steps li.is-current::before {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.progress-steps li.is-current::after { background: var(--accent); }
.progress-steps .progress-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 0.15rem;
}
/* 360px: keep the dots, show only the current step's label. */
@media (max-width: 479px) {
  .progress-steps li:not(.is-current) .progress-label { display: none; }
}

/* --------------------------------------------------- dashboard timeline */
/* Submitted -> Under review -> Shortlisted / On record. States computed in
   the route; the template renders {label, state, note} rows. */

.status-timeline {
  list-style: none;
  margin: 1rem 0 0.5rem;
  padding: 0;
}
.status-timeline li {
  position: relative;
  padding: 0 0 1.1rem 1.9rem;
  text-align: left;
}
.status-timeline li::before {
  /* node */
  content: "";
  position: absolute;
  left: 0;
  top: 0.28rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  background: var(--card);
  border: 2px solid var(--line);
  z-index: 1;
}
.status-timeline li::after {
  /* stem */
  content: "";
  position: absolute;
  left: 0.46rem;
  top: 1.2rem;
  bottom: -0.1rem;
  width: 2px;
  background: var(--line);
}
.status-timeline li:last-child { padding-bottom: 0; }
.status-timeline li:last-child::after { display: none; }
.status-timeline .timeline-label { font-weight: 600; font-size: 0.95rem; }
.status-timeline .timeline-note {
  display: block;
  color: var(--ink-soft);
  font-size: 0.83rem;
}
.status-timeline li.is-done { color: var(--ink-soft); }
.status-timeline li.is-done::before { background: var(--success); border-color: var(--success); }
.status-timeline li.is-done::after { background: var(--success); }
.status-timeline li.is-current .timeline-label { color: var(--accent-dark); }
.status-timeline li.is-current::before {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.status-timeline li.is-pending { color: var(--ink-faint); }
.status-timeline li.is-pending .timeline-label { font-weight: 500; }

/* ------------------------------------------------- confirmation flourish */

.confirmation .confetti {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin: 0.25rem auto 0.5rem;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 40%, var(--accent-soft), transparent 70%);
  font-size: 2rem;
  animation: pop-in 400ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes pop-in {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .confirmation .confetti { animation: none; }
  .step-card, .step-card:hover { transform: none; }
}

/* -------------------------------------------------------------- desktop */

@media (min-width: 720px) {
  .container { padding: 1.5rem; }
  h1 { font-size: 1.75rem; }
  .card, .step { padding: 1.75rem; }
  .hero { padding-top: 3rem; }
  .hero h1 { font-size: 2.4rem; }
  .step-cards { grid-template-columns: repeat(3, 1fr); }
}

/* ==================================================================== *
 *  ADMIN / FACULTY COMPONENT LIBRARY (integrator-owned — see            *
 *  ARCHITECTURE-P1-P4.md §5). Builders USE these classes.               *
 * ==================================================================== */

:root {
  --heat-1: #dfe6fb;
  --heat-2: #b3c2f4;
  --heat-3: #7e97e9;
  --heat-4: #2b4ecf;
}

/* Wider shell for tables and dashboards; base pages stay at 40rem. */
.container--wide { max-width: 72rem; }

/* ------------------------------------------------- admin tab navigation */
/* Mobile-first: one horizontally scrollable tab row under the header.    */

.admin-tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--line);
  margin: 0.25rem 0 1rem;
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
  flex-shrink: 0;
  padding: 0.55rem 0.85rem;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 120ms ease, border-color 120ms ease;
}
.admin-tab:hover { color: var(--ink); border-bottom-color: var(--line); }
.admin-tab.is-active { color: var(--accent-dark); border-bottom-color: var(--accent); }

/* ------------------------------------------------------------ page head */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}
.page-head h1, .page-head h2 { margin: 0; flex: 1 1 auto; }
.page-head h2 { font-size: 1.2rem; margin-top: 0.75rem; }
.page-head .page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ------------------------------------------------------------- badges */

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.badge-neutral { background: #eceef2; color: var(--ink-soft); }
.badge-submitted { background: var(--accent-soft); color: var(--accent-dark); }
.badge-under_review { background: var(--warn-bg); color: var(--warn); }
.badge-shortlisted { background: var(--success-bg); color: var(--success); }
.badge-on_record { background: #eceef2; color: var(--ink-soft); }
.badge-withdrawn { background: var(--danger-bg); color: var(--danger); }
.badge-warn { background: var(--warn-bg); color: var(--warn); } /* duplicate flag */

/* ---------------------------------------------------------- filter bar */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.filter-field { flex: 1 1 9rem; min-width: 8rem; }
.filter-field label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-bottom: 0.25rem;
}
.filter-field select, .filter-field input { padding: 0.45rem 0.6rem; }
.filter-bar .btn { flex: 0 0 auto; }
/* At 360px the button drops to its own full-width row. */
@media (max-width: 420px) {
  .filter-bar .btn { flex: 1 1 100%; }
}

/* -------------------------------------------------------------- tables */
/* Wide content scrolls inside .table-wrap; the page never scrolls sideways. */

.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th, .data-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.data-table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  background: var(--bg);
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--line);
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 100ms ease; }
.data-table tbody tr:hover { background: var(--accent-softer); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.th-sort { color: inherit; text-decoration: none; }
.th-sort:hover { color: var(--ink); }
.th-sort.sort-asc::after { content: " ↑"; color: var(--accent); }
.th-sort.sort-desc::after { content: " ↓"; color: var(--accent); }

.row-select { width: 1rem; height: 1rem; accent-color: var(--accent); }

/* Sticky bulk-action bar: appears above the fold when rows are selected. */
.bulk-bar {
  position: sticky;
  bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  background: var(--header-bg);
  color: #fff;
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  margin-top: 0.75rem;
  box-shadow: var(--shadow-md);
}
.bulk-bar .bulk-count { font-weight: 700; margin-right: auto; }
.bulk-bar :focus-visible { outline-color: #fff; }

/* ------------------------------------------------------------- scoring */

.score-grid { display: grid; gap: 0.6rem; }
.score-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
}
.score-row label { font-weight: 600; font-size: 0.9rem; margin: 0; }
.score-options { display: flex; gap: 0.25rem; }
.score-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 100ms ease, border-color 100ms ease, color 100ms ease;
}
.score-option:hover { border-color: var(--accent); }
.score-option:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.score-option:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.score-option input { position: absolute; opacity: 0; }

.score-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}
.score-total .value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------- stat cards */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--accent-soft);
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat-label {
  margin: 0.1rem 0 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
/* Small context line under a stat ("awaiting a score", "of 4 sections"…) */
.stat-sub {
  margin: 0.25rem 0 0;
  color: var(--ink-faint);
  font-size: 0.78rem;
}

/* ------------------------------------------------ availability heatmap */

.heat-grid { border-collapse: collapse; font-size: 0.85rem; }
.heat-grid th, .heat-grid td { padding: 0.4rem 0.6rem; border: 1px solid var(--line); }
.heat-grid th { background: var(--bg); }
.heat-cell { text-align: center; font-variant-numeric: tabular-nums; min-width: 3rem; }
.heat-1 { background: var(--heat-1); }
.heat-2 { background: var(--heat-2); }
.heat-3 { background: var(--heat-3); color: #fff; }
.heat-4 { background: var(--heat-4); color: #fff; }

/* Legend under the heatmap: fewer -> more */
.heat-legend {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.heat-legend .swatch {
  width: 1.1rem;
  height: 0.8rem;
  border-radius: 3px;
  border: 1px solid var(--line);
  display: inline-block;
}
.heat-legend .swatch.heat-0 { background: var(--card); }

/* -------------------------------------------- duplicates side-by-side */

.dup-pair { display: grid; gap: 0.75rem; margin-bottom: 1rem; }
.dup-shared { margin: 0.25rem 0 0.75rem; }
.dup-shared .badge { margin-right: 0.25rem; }

/* --------------------------------------------------- settings / roster */

.settings-grid { display: grid; gap: 0.75rem; margin-bottom: 1.5rem; }
@media (min-width: 720px) {
  .settings-grid { grid-template-columns: 1fr 1fr; }
}
.settings-grid .card { margin-bottom: 0; }

.roster-form { margin-top: 1rem; }
.roster-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
}
.roster-fields .filter-field { flex: 1 1 8rem; }
.roster-fields .btn { flex: 0 0 auto; }
@media (max-width: 420px) {
  .roster-fields .btn { flex: 1 1 100%; }
}

/* ---------------------------------------------------- states & loading */

.error-note {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.92rem;
}

/* htmx spinner: <span class="loading-dot htmx-indicator"></span> next to
   the element issuing the request; visible only while in flight. */
.htmx-indicator { opacity: 0; transition: opacity 150ms ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.loading-dot {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------ admin desktop */

@media (min-width: 720px) {
  .dup-pair { grid-template-columns: 1fr 1fr; }
  .score-options { gap: 0.35rem; }
}

/* ------------------------------------------- flexible "Other…" dropdowns */

.flex-choice .other-input { margin-top: 0.4rem; }

/* Browsers with :has() only show the write-in once "Other…" is picked;
   everywhere else it stays visible, so no one gets stuck. */
@supports selector(:has(*)) {
  .flex-choice .other-input { display: none; }
  .flex-choice:has(select option[value="__other__"]:checked) .other-input {
    display: block;
    border-color: var(--accent);
  }
}

/* ------------------------------------------------------ slot change details */

.slot-change { margin-top: 0.9rem; border-top: 1px solid var(--line); padding-top: 0.75rem; }
.slot-change summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.slot-change form { margin-top: 0.75rem; }
.slot-change .btn { margin-top: 0.5rem; }

/* ------------------------------------------- change-notification highlights */

.flash-warning { background: var(--warn-bg); color: var(--warn); }

.slot-changed { border-left: 4px solid var(--warn); font-weight: 600; }

.nav-badge {
  display: inline-block;
  min-width: 1.2rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2rem;
  vertical-align: middle;
}

.recent-moves { background: var(--warn-bg); border-color: var(--warn); }
.move-note { margin: 0.25rem 0; font-size: 0.92rem; }

/* --------------------------------------------------- announcement banner */
/* Admin-set site-wide notice, rendered directly under the header on every
   page. Accent-tinted, full-width, wraps cleanly at 360px. */

.announcement-banner {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 1rem;
  text-align: center;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

/* ----------------------------------------------------- coordinator cards */

.coordinators { margin-top: 2.5rem; text-align: center; }
.coordinators h2 { margin-bottom: 1rem; }

.coordinator-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  max-width: 38rem;
  margin: 0 auto;
}

.coordinator-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.coordinator-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(28, 31, 38, 0.08);
}

.coordinator-avatar {
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 0.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coordinator-title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 0 0 0.25rem;
}

.coordinator-card h3 { font-size: 1.05rem; margin: 0 0 0.35rem; }
.coordinator-line { margin: 0.1rem 0; color: var(--ink-soft); font-size: 0.9rem; }
