/* The admin pages: a title block, then the form or the parts list, centred on
   the sheet like the account pages but wider. */
@layer components {
  .admin {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--block-space) * 1.5);
    padding: calc(var(--block-space) * 2) calc(var(--inline-space) * 2);

    > * {
      inline-size: min(100%, 48rem);
    }

  }

  /* A list that outgrows a phone scrolls inside itself, never the page. */
  .admin__list {
    overflow-x: auto;
  }

  /* The review queue: each run's row, then its proof and the void form
     (a disclosure, so the list stays short) under it, as one record. */
  .admin__runs {
    font-variant-numeric: tabular-nums;

    .board__time {
      text-align: end;
    }

    tr:has(+ .admin__run-actions) td {
      border-block-end: 0;
    }
  }

  /* The wrong answers: the numbers right-aligned, a date never split. */
  .admin__guesses {
    font-variant-numeric: tabular-nums;

    time {
      white-space: nowrap;
    }
  }

  .admin__mass {
    text-align: end;
  }

  .admin__run-actions td {
    padding-block-start: 0;
  }

  .admin__proof {
    overflow-wrap: anywhere;
  }

  .admin__void {
    margin-block-start: calc(var(--block-space) * 0.375);

    summary {
      cursor: pointer;
    }
  }

  .admin__void-form {
    display: grid;
    gap: calc(var(--block-space) * 0.375);
    margin-block-start: calc(var(--block-space) * 0.5);
  }

  .admin__void-row {
    display: flex;
    gap: var(--inline-space);

    .input {
      flex: 1 1 12ch;
      min-inline-size: 0;
    }
  }

  .admin__file {
    padding-block: calc(var(--block-space) * 0.5);
  }

  .admin__empty,
  .admin__back {
    color: var(--color-ink-dim);
    font-size: var(--text-sm);
  }

  /* An SVG in an <img> draws in black whatever the theme, so the preview
     sits on white paper, like a print. */
  .admin__preview {
    display: flex;
    flex-direction: column;
    gap: calc(var(--block-space) * 0.5);
  }

  .admin__drawing {
    display: block;
    inline-size: 100%;
    block-size: auto;
    border: var(--rule-width) solid var(--color-rule);
    background-color: var(--color-on-accent);
  }

  /* The render's two versions side by side, on the sheet's own colour. */
  .admin__renders {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: var(--inline-space);
    align-items: center;
  }

  .admin__renders figcaption {
    grid-column: 1 / -1;
  }

  .admin__render {
    inline-size: 100%;
  }
}
