/*
 * THE ADMINISTRATOR PORTAL.
 *
 * A full-page workspace, not a dialog. The console it replaces was a tall
 * modal with a second scrolling list inside it, which is why a mission
 * list, an attempt table and a competition builder all had to fight for
 * the same 40vh.
 *
 * Values come from the design pack's design-tokens.json. They are written
 * as tokens here rather than inlined so that the pack and this file can be
 * diffed when either moves.
 */

.adp {
  --adp-orange:   #F15F25;
  --adp-deep:     #B83B12;
  --adp-ink:      #171614;
  --adp-text:     #34312E;
  --adp-muted:    #746E68;
  --adp-border:   #E7E2DD;
  --adp-bg:       #F7F5F2;
  --adp-white:    #FFFFFF;
  --adp-tint:     #FFF0E7;
  --adp-green:    #226548;
  --adp-green-bg: #EAF4EE;
  --adp-amber:    #805718;
  --adp-amber-bg: #FFF3D9;
  --adp-red:      #AD3535;
  --adp-red-bg:   #FCECEC;

  --adp-header:   84px;
  --adp-sidebar:  242px;
  --adp-gutter:   24px;
  --adp-radius:   15px;
  --adp-radius-s: 9px;
  --adp-input:    8px;

  position: fixed;
  inset: 0;
  /*
   * Above the app's own topbar, which is 1000 and sticky. At 900 the IDE
   * header sat on top of the portal's header and the two brands stacked.
   * A native <dialog> still opens above this, in the top layer, which is
   * right: a confirmation must not be hidden by the page asking for it.
   */
  z-index: 1200;
  display: grid;
  grid-template-columns: var(--adp-sidebar) 1fr;
  grid-template-rows: var(--adp-header) 1fr;
  background: var(--adp-bg);
  color: var(--adp-text);
  font-size: 15px;
  line-height: 1.5;
}

.adp[hidden] { display: none; }

/*
 * The portal keeps its own light surfaces in either app theme. It is a
 * settings surface an adult reads in a staffroom, and the pack specifies
 * warm neutrals; inheriting the IDE's dark theme would produce a screen
 * neither design accounts for.
 */
.adp, .adp * { box-sizing: border-box; }

/* ------------------------------------------------------------ the header */

.adp-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--adp-gutter);
  padding: 0 40px 0 24px;
  background: var(--adp-white);
  border-bottom: 1px solid var(--adp-border);
}

.adp-brand { display: flex; align-items: center; gap: 14px; width: calc(var(--adp-sidebar) - 24px); }
.adp-brand img { height: 34px; width: auto; }

.adp-head-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--adp-ink);
  letter-spacing: -.01em;
}

.adp-head-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }

.adp-scope {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--adp-border);
  border-radius: var(--adp-radius-s);
  background: var(--adp-white);
  font-size: 14px;
  font-weight: 600;
  color: var(--adp-ink);
}
.adp-scope .adp-lock { margin-left: 6px; opacity: .45; }

.adp-net { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--adp-muted); }
.adp-net::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--adp-muted);
}
.adp-net[data-state="online"]::before { background: var(--adp-green); }
.adp-net[data-state="offline"]::before { background: var(--adp-amber); }
.adp-net[data-state="offline"] { color: var(--adp-amber); }

.adp-who { display: flex; align-items: center; gap: 12px; }
.adp-avatar {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--adp-tint);
  color: var(--adp-deep);
  font-size: 13px; font-weight: 700;
}
.adp-who-name { font-size: 14px; font-weight: 700; color: var(--adp-ink); }
.adp-who-scope { font-size: 12.5px; color: var(--adp-muted); }

/* ----------------------------------------------------------- the sidebar */

.adp-side {
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  background: var(--adp-white);
  border-right: 1px solid var(--adp-border);
  overflow-y: auto;
}

.adp-side-label {
  margin: 0 0 12px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--adp-muted);
}

.adp-nav { display: flex; flex-direction: column; gap: 2px; }

.adp-nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--adp-text);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.adp-nav button:hover { background: var(--adp-bg); }
.adp-nav button[aria-current="page"] { background: var(--adp-tint); color: var(--adp-deep); }
.adp-nav svg { width: 20px; height: 20px; flex: 0 0 20px; }

.adp-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }

.adp-machine {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--adp-border);
  border-radius: 12px;
  background: var(--adp-bg);
}
.adp-machine h3 {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 8px;
  font-size: 14px; font-weight: 700; color: var(--adp-ink);
}
.adp-machine p { margin: 0; font-size: 12.5px; color: var(--adp-muted); }

.adp-side-foot > button {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 0 12px;
  border: 0; border-radius: 10px; background: none;
  color: var(--adp-text); font: inherit; font-size: 14.5px; font-weight: 600;
  text-align: left; cursor: pointer;
}
.adp-side-foot > button:hover { background: var(--adp-bg); }
.adp-side-foot > button svg { width: 20px; height: 20px; flex: 0 0 20px; }

/* -------------------------------------------------------------- the page */

.adp-main { overflow-y: auto; }
.adp-page { padding: 30px 40px 40px; }

.adp-crumb {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--adp-muted);
}

.adp-title-row {
  display: flex;
  align-items: flex-start;
  gap: var(--adp-gutter);
  margin-bottom: 26px;
}
.adp-title-row > div { flex: 1 1 auto; min-width: 0; }

.adp-h1 {
  margin: 0;
  font-size: 31px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--adp-ink);
  text-wrap: balance;
}
.adp-sub { margin: 6px 0 0; font-size: 15px; color: var(--adp-muted); }

/* ------------------------------------------------------------- controls */

.adp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--adp-border);
  border-radius: var(--adp-radius-s);
  background: var(--adp-white);
  color: var(--adp-ink);
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.adp-btn:hover { border-color: var(--adp-muted); }

/* Filled orange takes dark text, per the pack. */
.adp-btn-primary {
  border-color: var(--adp-orange);
  background: var(--adp-orange);
  color: var(--adp-ink);
}
.adp-btn-primary:hover { filter: brightness(1.06); border-color: var(--adp-orange); }

.adp-btn:disabled { opacity: .5; cursor: not-allowed; }
.adp-btn svg { width: 18px; height: 18px; }

.adp :focus-visible { outline: 3px solid var(--adp-deep); outline-offset: 2px; }

.adp-link {
  border: 0; background: none; padding: 0;
  color: var(--adp-deep); font: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer;
}
.adp-link:hover { text-decoration: underline; }

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

.adp-card {
  border: 1px solid var(--adp-border);
  border-radius: var(--adp-radius);
  background: var(--adp-white);
  padding: 22px;
}

.adp-card h2, .adp-card h3 { margin: 0 0 4px; color: var(--adp-ink); letter-spacing: -.015em; }
.adp-card h2 { font-size: 21px; font-weight: 700; }
.adp-card h3 { font-size: 16px; font-weight: 700; }

.adp-grid { display: grid; gap: var(--adp-gutter); }
.adp-grid-2 { grid-template-columns: 1fr 1fr; }
/* Cards of very different lengths keep their own height rather than being
   stretched to match the tallest: a two-line paragraph centred in an empty
   box reads as something that failed to load. */
.adp-grid-top { align-items: start; }
.adp-grid-3 { grid-template-columns: repeat(3, 1fr); }
.adp-split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); gap: var(--adp-gutter); }

/* ------------------------------------------------------------- the hero */

.adp-hero {
  display: flex;
  align-items: center;
  gap: var(--adp-gutter);
  padding: 26px;
  border-radius: var(--adp-radius);
  background: var(--adp-ink);
  color: var(--adp-white);
}
.adp-hero-tag {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 12px;
  border-radius: 7px;
  background: var(--adp-orange);
  color: var(--adp-ink);
  font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.adp-hero h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--adp-white); }
.adp-hero p { margin: 8px 0 0; font-size: 14.5px; color: #cfc8c1; }
.adp-hero-mark {
  margin-left: auto;
  width: 62px; height: 62px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: #2a2724;
  color: var(--adp-orange);
  flex: 0 0 auto;
}
.adp-hero-mark svg { width: 30px; height: 30px; }

/* ------------------------------------------------------------ stat tile */

.adp-stat { display: flex; flex-direction: column; gap: 12px; }
.adp-stat-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--adp-tint);
  color: var(--adp-deep);
}
.adp-stat-icon svg { width: 20px; height: 20px; }
.adp-stat-n {
  font-size: 33px; font-weight: 700; line-height: 1;
  color: var(--adp-ink);
  font-variant-numeric: tabular-nums;
}
.adp-stat-what { font-size: 15px; font-weight: 700; color: var(--adp-ink); }
.adp-stat-note { font-size: 13px; color: var(--adp-muted); }

/* --------------------------------------------------------------- pills */

.adp-pill {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.adp-pill-green { background: var(--adp-green-bg); color: var(--adp-green); }
.adp-pill-amber { background: var(--adp-amber-bg); color: var(--adp-amber); }
.adp-pill-red   { background: var(--adp-red-bg);   color: var(--adp-red); }
.adp-pill-grey  { background: var(--adp-bg);       color: var(--adp-muted); }
.adp-pill-tint  { background: var(--adp-tint);     color: var(--adp-deep); }

/* --------------------------------------------------------------- notes */

.adp-note {
  display: flex;
  gap: 12px;
  padding: 15px 18px;
  border-radius: 11px;
  background: var(--adp-tint);
  color: var(--adp-text);
  font-size: 14px;
}
.adp-note svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--adp-deep); margin-top: 1px; }
.adp-note b { display: block; color: var(--adp-ink); }
.adp-note-amber { background: var(--adp-amber-bg); }
.adp-note-amber svg { color: var(--adp-amber); }
.adp-note-grey { background: var(--adp-bg); }
.adp-note-grey svg { color: var(--adp-muted); }
.adp-note p { margin: 0; }

/* -------------------------------------------------------------- tables */

.adp-scroll { overflow-x: auto; }

.adp-table { width: 100%; border-collapse: collapse; }
.adp-table th {
  padding: 11px 14px;
  background: var(--adp-bg);
  border-bottom: 1px solid var(--adp-border);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--adp-muted);
  text-align: left;
  white-space: nowrap;
}
.adp-table td {
  padding: 14px;
  border-bottom: 1px solid var(--adp-border);
  font-size: 14.5px;
  vertical-align: middle;
}
.adp-table tr[data-pick] { cursor: pointer; }
.adp-table tr[data-pick]:hover td { background: var(--adp-bg); }
.adp-table tr[aria-selected="true"] td { background: var(--adp-tint); }
.adp-table .adp-cell-name { font-weight: 700; color: var(--adp-ink); }
.adp-table .adp-cell-note { font-size: 12.5px; color: var(--adp-muted); }
.adp-num { font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- fields */

.adp-field { display: block; margin-bottom: 16px; }
.adp-field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--adp-ink);
}
.adp-field input, .adp-field select, .adp-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--adp-border);
  border-radius: var(--adp-input);
  background: var(--adp-white);
  color: var(--adp-text);
  font: inherit;
  font-size: 14.5px;
}
.adp-field input:focus, .adp-field select:focus { border-color: var(--adp-orange); }
.adp-hint { margin: 6px 0 0; font-size: 13px; color: var(--adp-muted); }
.adp-bad { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--adp-red); }
.adp-good { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--adp-green); }

.adp-search { position: relative; }
.adp-search input { padding-left: 40px; }
.adp-search svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--adp-muted);
}

.adp-row { display: flex; gap: 12px; align-items: flex-end; }
.adp-row > * { flex: 1 1 0; min-width: 0; }
.adp-row > .adp-field { margin-bottom: 0; }

/* ------------------------------------------------------------- stepper */

.adp-steps { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.adp-step {
  flex: 1 1 0;
  min-width: 150px;
  padding: 13px 16px;
  border: 1px solid var(--adp-border);
  border-radius: 10px;
  background: var(--adp-white);
  font-size: 14px; font-weight: 700; color: var(--adp-muted);
  text-align: left; font-family: inherit; cursor: pointer;
}
.adp-step[aria-current="step"] { background: var(--adp-tint); color: var(--adp-deep); border-color: var(--adp-tint); }
.adp-step .adp-step-n { opacity: .7; margin-right: 7px; }

/* ---------------------------------------------------------- pick a mission */

.adp-picks { display: flex; flex-direction: column; gap: 10px; }
.adp-pick {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border: 1px solid var(--adp-border);
  border-radius: 11px;
  background: var(--adp-white);
}
.adp-pick[data-on="true"] { background: var(--adp-tint); border-color: #f6d6c4; }
.adp-pick input { width: 20px; height: 20px; accent-color: var(--adp-orange); flex: 0 0 auto; }
.adp-pick-words { flex: 1 1 auto; min-width: 0; }
.adp-pick-words b { display: block; font-size: 15px; color: var(--adp-ink); }
.adp-pick-words span { font-size: 13px; color: var(--adp-muted); }

/* ------------------------------------------------------------ summaries */

.adp-rows { margin: 0; }
.adp-rows div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--adp-border);
  font-size: 14.5px;
}
.adp-rows dt { color: var(--adp-muted); }
.adp-rows dd { margin: 0; font-weight: 700; color: var(--adp-ink); text-align: right; }

.adp-attention { display: flex; flex-direction: column; gap: 18px; }
.adp-attention article { padding-bottom: 16px; border-bottom: 1px solid var(--adp-border); }
.adp-attention article:last-child { border-bottom: 0; padding-bottom: 0; }
.adp-attention h4 {
  display: flex; align-items: baseline; gap: 9px;
  margin: 0 0 3px; font-size: 15px; font-weight: 700; color: var(--adp-ink);
}
.adp-attention h4::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--adp-orange); flex: 0 0 8px;
}
.adp-attention p { margin: 0 0 7px; font-size: 13.5px; color: var(--adp-muted); }

.adp-actions { display: flex; flex-direction: column; gap: 10px; }
.adp-action {
  display: flex; align-items: center; gap: 15px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--adp-border);
  border-radius: 12px;
  background: var(--adp-white);
  font: inherit; text-align: left; cursor: pointer;
}
.adp-action:hover { background: var(--adp-bg); }
.adp-action .adp-stat-icon { flex: 0 0 40px; }
.adp-action-words { flex: 1 1 auto; }
.adp-action-words b { display: block; font-size: 15px; color: var(--adp-ink); }
.adp-action-words span { font-size: 13.5px; color: var(--adp-muted); }
.adp-action .adp-arrow { color: var(--adp-muted); }

.adp-empty {
  padding: 34px 26px;
  text-align: center;
  color: var(--adp-muted);
  font-size: 14.5px;
}
.adp-empty b { display: block; margin-bottom: 6px; font-size: 16px; color: var(--adp-ink); }

.adp-foot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 22px 40px 30px;
  font-size: 12.5px; color: var(--adp-muted);
}

.adp-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--adp-border); margin-bottom: 22px; }
.adp-tab {
  padding: 12px 16px;
  border: 0; border-bottom: 2px solid transparent;
  background: none; font: inherit; font-size: 14.5px; font-weight: 700;
  color: var(--adp-muted); cursor: pointer;
}
.adp-tab[aria-selected="true"] { color: var(--adp-deep); border-bottom-color: var(--adp-orange); }

/* --------------------------------------------------------- tablet sizes */

@media (max-width: 1279px) {
  .adp { --adp-sidebar: 192px; --adp-gutter: 16px; }
  .adp-page { padding: 24px 24px 32px; }
  .adp-head { padding: 0 24px 0 18px; }
  .adp-grid-3 { grid-template-columns: 1fr 1fr; }
}

/*
 * Below this the detail column would be narrower than the 320px the pack
 * sets as its floor, so it becomes a sheet over the table rather than a
 * squeezed column. Same interaction, same markup — the table stays.
 */
@media (max-width: 1023px) {
  .adp { grid-template-columns: 1fr; }
  .adp-side { display: none; }
  .adp-split, .adp-grid-2, .adp-grid-3 { grid-template-columns: 1fr; }
  .adp-brand { width: auto; }
}

/* ------------------------------------------------ a card's own header

   An icon plate, a title and the state of the thing. Written six times
   inline before this existed, every copy asking for an icon that never
   appeared — nothing sized an SVG inside a card title, so six headers were
   drawn with a hole where the icon goes. */

.adp-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.adp-card-head h2 { margin: 0; flex: 1 1 auto; min-width: 0; }
.adp-card-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: var(--adp-tint);
  color: var(--adp-deep);
}
.adp-card-icon svg { width: 19px; height: 19px; }
.adp-card-lede { margin: 10px 0 18px; }
.adp-card-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ------------------------------------ have I got all of it yet? (07)

   Three things an owner has been sent by somebody else, and which of them
   are in. The form used to be three inputs and a Save button, and the only
   way to find out whether what you had pasted was any good was to press
   it. */

.adp-checklist {
  list-style: none;
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--adp-bg);
  border: 1px solid var(--adp-border);
  display: grid;
  gap: 10px;
}
.adp-checklist li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
  color: var(--adp-muted);
}
.adp-checklist b { color: var(--adp-ink); font-weight: 700; }
.adp-checklist em { font-style: normal; font-size: 13px; }
.adp-checklist li[data-done="true"] b { color: var(--adp-green); }

/* The tick, and the ring before it is one. Shape as well as colour: a
   state told only in green is a state a third of the room cannot read. */
.adp-check-tick {
  position: relative;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  align-self: center;
  border-radius: 50%;
  border: 2px solid var(--adp-border);
}
.adp-checklist li[data-done="true"] .adp-check-tick {
  border-color: var(--adp-green);
  background: var(--adp-green);
}
.adp-checklist li[data-done="true"] .adp-check-tick::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

/* What is wrong with what is in the field, said while it is still being
   typed rather than after Save. */
.adp-field-note {
  margin: -6px 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--adp-red);
}
.adp-field-note[data-tone="ok"] { color: var(--adp-green); }

.adp-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.01em;
}

/* ------------------------------------------------- the school portal
 *
 * The same clothes as the administrator's, because they are the same
 * product and a second visual language is a second thing to keep in step.
 * The tokens are this file's own, for the same reason — a school screen
 * that reached for a colour nobody had defined would fall back to a
 * hard-coded one and stay light while the rest of the app went dark.
 *
 * What is added is what a register needs and an installation's settings
 * did not: a sign-in card, a facts list, and rows with buttons.
 */

.adp-signin {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--adp-bg);
}
.adp-signin-card {
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid var(--adp-border);
  border-radius: var(--adp-radius);
  background: var(--adp-white);
  box-shadow: 0 10px 40px rgb(0 0 0 / 8%);
}
.adp-signin-card h1 { margin: 0 0 6px; font-size: 1.25rem; color: var(--adp-ink); }

/* Facts about a school, as a list rather than a table: three of them, and
   a table for three rows is a table you have to read twice. */
.adp-pairs { margin: 14px 0 0; display: grid; gap: 10px; }
.adp-pairs > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--adp-border);
}
.adp-pairs > div:last-child { border-bottom: 0; padding-bottom: 0; }
.adp-pairs dt { color: var(--adp-muted); }
.adp-pairs dd { margin: 0; font-weight: 600; color: var(--adp-ink); }

/* Buttons at the end of a row. Kept together and to the right, so a long
   register reads as names rather than as a wall of controls. */
.adp-row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  white-space: nowrap;
}
