/* Admin — internal, dense, plain. Borrows the form's palette and nothing else. */

.admin {
  display: block;
}

.admin__head {
  border-bottom: 1px solid var(--line);
  padding: 1.25rem;
}

.admin__head-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin__eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin__title {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
}

.admin__account {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* An author `display` beats the [hidden] attribute, so without this the
   account block — Sign out included — stays on screen while signed out. */
.admin__account[hidden] {
  display: none;
}

.admin__who {
  font-size: 0.85rem;
  color: var(--muted);
}

/* The header buttons sit beside text, not in a form footer. */
.admin__btn {
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

.admin__shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.admin__loading {
  color: var(--muted);
}

/* ---------- sign in ---------- */

.signin {
  max-width: 360px;
  margin: 3rem auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.signin__title {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.signin__blurb {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.signin__error {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
  border-left: 3px solid var(--danger);
  padding-left: 0.75rem;
}

.signin__go {
  margin-top: 1rem;
}

/* The eye sits inside the field's right edge, so the input keeps its full
   width and the control does not become a second column to line up. */
.signin__pw {
  position: relative;
}

.signin__peek {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
}

.signin__peek:hover {
  color: var(--white);
}

.signin__peek:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: -2px;
}

.signin__peek[aria-pressed='true'] {
  color: var(--lime);
}

/* The client form has no password field, so the shared stylesheet never
   styled one and it renders as a white browser default on a black page. */
.signin input[type='password'],
.signin input[type='text']#password {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 1rem;
  /* Room on the right so text never runs under the eye. */
  padding: 0.95rem 3rem 0.95rem 1rem;
  min-height: 52px;
}

.signin input[type='password']:focus,
.signin input[type='text']#password:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(180, 224, 31, 0.18);
}

/* ---------- two-step sign in ---------- */

/* The rules above are scoped to #password, so the code box would otherwise
   render as a white browser default on a black page. */
.signin input[type='text']#code {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font-body);
  /* Six digits read one at a time, not as a word. */
  font-size: 1.5rem;
  letter-spacing: 0.4em;
  text-align: center;
  padding: 0.95rem 1rem;
  min-height: 52px;
}

.signin input[type='text']#code:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(180, 224, 31, 0.18);
}

.signin--enrol {
  max-width: 420px;
}

/* Supabase draws the QR with black bars on a transparent ground, which is
   invisible on this page. The white plate is what makes it scannable. */
.enrol__qr {
  display: block;
  margin: 0 auto 1rem;
  width: 200px;
  height: 200px;
  background: #fff;
  padding: 0.6rem;
  border-radius: var(--radius);
}

.enrol__secret {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  margin: 0 0 1.25rem;
}

.enrol__secret code {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.4rem 0.6rem;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--white);
  font-size: 0.95rem;
  /* A shared secret typed by hand — it must be selectable and must wrap. */
  user-select: all;
  word-break: break-all;
}

.signin__out {
  margin-top: 0.85rem;
  align-self: center;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- tabs ---------- */

.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.7rem 1rem;
  cursor: pointer;
}

.tab:hover {
  color: var(--white);
}

.tab--on {
  color: var(--black);
  background: var(--lime);
  border-bottom-color: var(--lime);
}

.tab__count {
  font-weight: 400;
  opacity: 0.75;
}

.tab:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: -2px;
}

/* ---------- table ---------- */

/* Six columns will not fit a phone; let the table scroll rather than
   squeeze an email address into nothing. */
.tablewrap {
  overflow-x: auto;
}

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

.table th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table tr:hover td {
  background: var(--surface);
}

.cell--when {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.85rem;
}

.cell--name {
  font-weight: 600;
}

.cell--num {
  text-align: right;
  white-space: nowrap;
}

.cell--empty {
  color: var(--muted);
  padding: 2rem 0.75rem;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

/* A button that reads as a link — the row opens in place, it does not
   navigate, so an anchor would be a lie. */
.linky {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--lime);
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}

.linky:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

/* ---------- detail ---------- */

.detail {
  margin-top: 1.25rem;
}

.detail__title {
  font-size: clamp(1.4rem, 4vw, 1.9rem);
}

.detail__meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.35rem 0 1.5rem;
}

.detail__group {
  margin-bottom: 1.75rem;
}

.detail__step {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lime);
  border-left: 3px solid var(--lime);
  padding-left: 0.6rem;
  margin-bottom: 0.75rem;
}

.answers {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 800px) {
  .answers {
    grid-template-columns: 1fr 1fr;
    column-gap: 2rem;
  }
}

.answer {
  display: grid;
  grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.answer dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.answer dd {
  margin: 0;
  font-size: 0.9rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.answer--blank {
  color: var(--muted);
  font-style: italic;
}

.filelist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
