/* THE PANEL LOOK. One stylesheet, linked by every document that draws a panel.
 *
 * John, 18 Aug: "These panels should be made using the same code. So they look
 * the same for tutors as well. All that needs to be configured is which fields
 * to include."
 *
 * This is the first half of that: the LOOK comes from one file, so a change
 * lands everywhere at once and the two documents cannot drift apart again. The
 * second half — one renderer taking a list of field keys — is still to come,
 * and until it does, staff.html and panel.html still write their own markup.
 * That is the P0 fork; this narrows it rather than closing it.
 *
 * WHY THESE VALUES. They are staff.html's, unchanged (John: "I prefer the
 * background colouring of .../student/SP27239 than I do with .../parent/...").
 * So linking this alters nothing on the staff side and brings the parent panel
 * into line — which is the right direction, because the parent panel is the one
 * that drifted.
 *
 * Loaded AFTER each document's own <style>, so these win where they disagree.
 * It holds no name, no child and nothing anybody could not already see — it is
 * a stylesheet, and rule 4 is about data, not presentation.
 */

:root {
  --ink: #1d1d1d;
  --wash: #f5f5f3;
  --paper: #fff;
  --muted: #5a5a5a;
  --green: #087f04;
  --green-bright: #0ea907;
  /* The parent panel had #b6beb8 — a grey-green that reads as dirty against the
     wash, especially now the default avatars are outlines rather than fills. */
  --line: #e5e7eb;
  --sel: #eef2ff;
  --seldk: #1f2740;
  --fold: #e7edf6;
  /* A PANEL IS NOT WHITE (John, 18 Aug: "Let's not have a white panel ... How
     about half way between white and the frame"). Literally half way: #ffffff
     and the wash #f5f5f3 average to #fafaf9. Enough to lift a record off the
     page without the hard white edge a full sheet of paper gives it. */
  --card: #fafaf9;
}

/* A FIELD IS A ROW: its name on the left, its value beside it (John, 18 Aug:
   "I also prefer the field title being to the left of the field rather than on
   its own line above"). A label on its own line doubles the height of every
   record and makes a list of eight fields scroll. */
.field {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}
.field .fl {
  flex: 0 0 10rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.field > span:last-child { flex: 1; min-width: 0; }

/* The parent edit form: label left, field right — but ONLY for the pairs that
   actually are label/field pairs. The first attempt gridded every child, and
   that form also holds a bare <label> carrying the mothball checkbox and a
   paragraph of explanation, plus the Save/Cancel row. Those went into the 10rem
   label column. So each kind is placed explicitly, and anything not named here
   spans the full width rather than being squeezed into whichever column is
   next — an unknown child is full width, never half a row. */
.editform {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 0.45rem 0.9rem;
  align-items: baseline;
}
.editform > * { grid-column: 1 / -1; }          /* the safe default */
.editform > .el { grid-column: 1; margin: 0; color: var(--muted); font-size: 0.9rem; font-weight: 400; }
.editform > .ei,
.editform > .fields,
.editform > select,
.editform > textarea { grid-column: 2; width: 100%; max-width: 32rem; }
.editform > .fields { background: none; border: 0; padding: 0; }
/* Save and Cancel are the last thing, side by side, under both columns. */
.editform > .formactions { margin-top: 0.6rem; }

@media (max-width: 600px) {
  .editform { display: block; }
  /* One column on a phone: 10rem of label leaves nothing for the value. */
  .field { display: block; }
  .field .fl { display: block; }
}

/* A FIELD NAME ENDS IN A COLON (John, 18 Aug). In the markup, not typed into
   every label — the labels are about to be generated from a key list, and a
   colon baked into each string would have to be stripped out again. */
.field .fl::after,
.editform > .el::after { content: ':'; }

/* Lifted off the page, but not white. The parent panel used to draw straight
   onto the wash, so a record sat grey-on-grey; white fixed that and overshot. */
.fields, .journey {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.2rem;
}
.journey { margin: 1.6rem 0; }

/* ADMIN-ONLY BUTTONS ARE PURPLE (John, 21 Oct 2026: "a special colour for
   Admin only buttons like Choose a file, replace and remove"). A button only an
   administrator is shown carries class "admin" beside "btn", so it reads at a
   glance as ours, not something a family can press. */
.btn.admin { background: #6b3fa0; color: #fff; }
.btn.admin:hover { background: #57318a; }
