/* ==========================================================================
   SchoolTeam super-admin console — claymorphism
   --------------------------------------------------------------------------
   Every surface is soft moulded clay: a large radius, a gentle drop shadow
   below, and two INSET shadows -- a light one at the top-left and a darker
   one at the bottom-right -- that make a flat box read as puffy. Controls
   that are "pressed" swap to a hollow (inset-only) shadow.

   Readability first: body text is dark ink on light clay (>= 7:1); pastel
   tints are only ever backgrounds; every status carries an icon and a word,
   never colour alone. Focus is always visible. Motion respects
   prefers-reduced-motion.
   ========================================================================== */

:root {
  /* surfaces */
  --bg:        #f4ece4;
  --clay:      #fbf6f1;
  --clay-2:    #f6eee6;         /* inset fields, hollows */
  --ink:       #2c241e;         /* 14.5:1 on --clay */
  --ink-2:     #5c4f45;         /* 7.6:1 on --clay  */
  --line:      #e7dacd;

  /* brand */
  --pri:       #6f4f42;
  --pri-2:     #5a4036;
  --on-pri:    #ffffff;         /* 7.9:1 on --pri */

  /* status tints (backgrounds) + their ink (text on that tint >= 4.5:1) */
  --mint:      #dff2e3;  --mint-ink:  #1f5a2c;
  --peach:     #fde7d2;  --peach-ink: #7a4310;
  --rose:      #fbdcd9;  --rose-ink:  #8a2219;
  --lav:       #e8e3f7;  --lav-ink:   #43357a;

  /* the clay recipe */
  --r-xl: 28px; --r-lg: 22px; --r-md: 16px; --r-sm: 12px; --r-pill: 999px;
  --clay-shadow:
      0 14px 28px -10px rgba(111, 79, 66, .28),
      0 4px 8px -4px rgba(111, 79, 66, .18),
      inset -6px -6px 14px rgba(172, 138, 112, .22),
      inset 6px 6px 14px rgba(255, 255, 255, .85);
  --clay-shadow-sm:
      0 8px 16px -8px rgba(111, 79, 66, .30),
      inset -4px -4px 8px rgba(172, 138, 112, .22),
      inset 4px 4px 8px rgba(255, 255, 255, .85);
  --hollow:
      inset 4px 4px 9px rgba(172, 138, 112, .30),
      inset -4px -4px 9px rgba(255, 255, 255, .90);
  --focus: 0 0 0 3px #fff, 0 0 0 6px #3b6fd8;   /* blue ring: visible on every tint */

  --font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 500 15.5px/1.55 var(--font);
  background-image:
    radial-gradient(900px 500px at 10% -10%, #fff7ef 0, transparent 60%),
    radial-gradient(800px 500px at 110% 10%, #efe4f7 0, transparent 55%);
  background-attachment: fixed;
}
a { color: var(--pri); font-weight: 700; }
a:hover { color: var(--pri-2); }
:focus-visible { outline: none; box-shadow: var(--focus) !important; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 16px;
  background: var(--pri); color: var(--on-pri); border-radius: var(--r-sm); text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 18px 16px 72px; }

/* ------------------------------------------------------------ top bar */
.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--clay); border-radius: var(--r-xl); box-shadow: var(--clay-shadow);
  padding: 12px 14px 12px 16px; margin-bottom: 26px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { width: 40px; height: 40px; object-fit: contain; }
.brand b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; display: block; line-height: 1.1; }
.brand span { font-size: 12.5px; color: var(--ink-2); font-weight: 700; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.tabs a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border-radius: var(--r-pill); text-decoration: none; color: var(--ink-2); font-weight: 800; font-size: 14.5px;
  background: var(--clay); box-shadow: var(--clay-shadow-sm); transition: transform .15s ease, box-shadow .15s ease;
}
.tabs a:hover { transform: translateY(-1px); color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--clay-2); box-shadow: var(--hollow); color: var(--pri); transform: none; }

@media (max-width: 640px) {
  .topbar { border-radius: var(--r-lg); }
  .tabs { width: 100%; }
  .tabs li { flex: 1 1 auto; }
  .tabs a { width: 100%; justify-content: center; padding: 0 10px; font-size: 13.5px; }
}

/* ------------------------------------------------------------ headings */
.page-head { margin: 0 4px 18px; }
.page-head h1 { font-size: 26px; font-weight: 900; letter-spacing: -.02em; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
.section-title { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 0 0 12px; }

/* ------------------------------------------------------------ clay card */
.clay {
  background: var(--clay); border-radius: var(--r-xl); box-shadow: var(--clay-shadow);
  padding: 22px 22px; margin-bottom: 22px;
}
.clay.tight { padding: 16px 18px; }
@media (max-width: 480px) { .clay { padding: 18px 16px; border-radius: var(--r-lg); } }

/* ------------------------------------------------------------ stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; gap: 12px; } }
.stat {
  border-radius: var(--r-lg); padding: 18px 18px 16px; box-shadow: var(--clay-shadow);
  display: flex; align-items: center; gap: 14px;
}
.stat .blob {
  flex: 0 0 52px; height: 52px; border-radius: 18px; display: grid; place-items: center;
  font-size: 24px; background: rgba(255,255,255,.65); box-shadow: var(--clay-shadow-sm);
}
.stat b { font-size: 28px; font-weight: 900; line-height: 1; display: block; }
.stat span { font-size: 13.5px; font-weight: 800; }
.stat.lav   { background: var(--lav);   color: var(--lav-ink); }
.stat.mint  { background: var(--mint);  color: var(--mint-ink); }
.stat.peach { background: var(--peach); color: var(--peach-ink); }

/* ------------------------------------------------------------ school cards */
.schools { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.school {
  background: var(--clay); border-radius: var(--r-lg); box-shadow: var(--clay-shadow);
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
}
.school h3 { margin: 0; font-size: 17px; font-weight: 900; line-height: 1.3; }
.school .row { display: flex; flex-wrap: wrap; gap: 8px; }
.school .actions { margin-top: auto; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font: 800 13px/1 var(--mono);
  padding: 7px 11px; border-radius: var(--r-pill); background: var(--clay-2); box-shadow: var(--hollow); color: var(--ink);
}

/* status pills: icon + word, on a tint */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 800; line-height: 1.2;
  box-shadow: inset 2px 2px 4px rgba(255,255,255,.7), inset -2px -2px 4px rgba(0,0,0,.06);
}
.pill.ok   { background: var(--mint);  color: var(--mint-ink); }
.pill.warn { background: var(--peach); color: var(--peach-ink); }
.pill.bad  { background: var(--rose);  color: var(--rose-ink); }
.pill.info { background: var(--lav);   color: var(--lav-ink); }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: var(--r-md);
  font: 800 15px/1 var(--font); text-decoration: none; cursor: pointer;
  background: var(--pri); color: var(--on-pri);
  box-shadow:
      0 12px 22px -10px rgba(90, 64, 54, .75),
      inset -4px -4px 8px rgba(40, 24, 18, .35),
      inset 4px 4px 8px rgba(255, 255, 255, .28);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.04); color: var(--on-pri); }
.btn:active { transform: translateY(1px); box-shadow: inset 4px 4px 10px rgba(40, 24, 18, .45); }
.btn.big { min-height: 56px; padding: 0 28px; font-size: 16.5px; border-radius: var(--r-lg); }
.btn.ghost { background: var(--clay); color: var(--pri); box-shadow: var(--clay-shadow-sm); }
.btn.ghost:hover { color: var(--pri-2); }
.btn[disabled], .btn[aria-busy="true"] { cursor: progress; filter: saturate(.6); transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ------------------------------------------------------------ forms */
.form-sections { display: grid; gap: 22px; }
.fsec { display: grid; grid-template-columns: 56px 1fr; gap: 16px; }
.fsec .num {
  width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center;
  font-weight: 900; font-size: 20px; color: var(--on-pri); background: var(--pri); box-shadow: var(--clay-shadow-sm);
}
.fsec h2 { font-size: 18px; font-weight: 900; margin: 8px 0 2px; }
.fsec .lead { margin: 0 0 14px; color: var(--ink-2); font-size: 14.5px; }
@media (max-width: 560px) { .fsec { grid-template-columns: 1fr; } .fsec .num { width: 40px; height: 40px; font-size: 17px; } }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field label { display: block; font-size: 14px; font-weight: 800; margin: 0 0 6px 4px; color: var(--ink); }
.field input {
  width: 100%; min-height: 48px; padding: 0 16px; border: 0; border-radius: var(--r-md);
  font: 600 15.5px/1.2 var(--font); color: var(--ink); background: var(--clay-2); box-shadow: var(--hollow);
}
.field input::placeholder { color: #8d7d70; }
.field input:focus-visible { box-shadow: var(--hollow), var(--focus) !important; }
.field .hint { font-size: 13px; color: var(--ink-2); margin: 6px 4px 0; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 84px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 36px; padding: 0 12px;
  border: 0; border-radius: 10px; background: var(--clay); box-shadow: var(--clay-shadow-sm);
  font: 800 13px/1 var(--font); color: var(--pri); cursor: pointer;
}
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--pri); }

/* ------------------------------------------------------------ alerts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); font-weight: 700; margin: 0 0 16px; box-shadow: var(--clay-shadow-sm); }
.alert .ico { font-size: 20px; line-height: 1.2; }
.alert.bad  { background: var(--rose);  color: var(--rose-ink); }
.alert.ok   { background: var(--mint);  color: var(--mint-ink); }
.alert.info { background: var(--lav);   color: var(--lav-ink); }

/* ------------------------------------------------------------ timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 21px; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 46px 1fr; gap: 12px; padding: 8px 0; }
.timeline .dot {
  position: relative; z-index: 1; width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center;
  font-size: 20px; font-weight: 900; box-shadow: var(--clay-shadow-sm);
}
.timeline .ok .dot   { background: var(--mint);  color: var(--mint-ink); }
.timeline .fail .dot { background: var(--rose);  color: var(--rose-ink); }
.timeline .skip .dot { background: var(--lav);   color: var(--lav-ink); }
.timeline b { display: block; font-size: 15.5px; font-weight: 900; margin-top: 3px; }
.timeline .detail { font-size: 14px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline .detail code, .clay code, .guide code { font: 700 13px/1.4 var(--mono); background: var(--clay-2); padding: 2px 6px; border-radius: 6px; }

/* ------------------------------------------------------------ checklist */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; padding: 12px 14px; border-radius: var(--r-md); background: var(--clay-2); box-shadow: var(--hollow); }
.checklist li::before { content: "☐"; font-size: 20px; line-height: 1.2; color: var(--pri); }

/* ------------------------------------------------------------ result rows */
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rows li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--clay-2); box-shadow: var(--hollow); }

/* ------------------------------------------------------------ empty state */
.empty { text-align: center; padding: 34px 18px 28px; }
.empty .art {
  width: 110px; height: 110px; margin: 0 auto 16px; border-radius: 34px; display: grid; place-items: center;
  font-size: 50px; background: var(--peach); box-shadow: var(--clay-shadow);
}
.empty h2 { margin: 0 0 6px; font-size: 21px; font-weight: 900; }
.empty p { margin: 0 auto 18px; max-width: 460px; color: var(--ink-2); }

/* ------------------------------------------------------------ guide accordion */
.guide { padding: 0; overflow: hidden; }
.guide > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 18px 22px; min-height: 64px;
}
.guide > summary::-webkit-details-marker { display: none; }
.guide > summary .ico { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px; display: grid; place-items: center; background: var(--lav); color: var(--lav-ink); font-size: 22px; box-shadow: var(--clay-shadow-sm); }
.guide > summary b { font-size: 17.5px; font-weight: 900; display: block; }
.guide > summary span { font-size: 13.5px; color: var(--ink-2); }
.guide > summary::after { content: "▾"; margin-left: auto; font-size: 20px; color: var(--pri); transition: transform .2s ease; }
.guide:not([open]) > summary::after { transform: rotate(-90deg); }
.gsteps { list-style: none; counter-reset: g; margin: 0; padding: 4px 22px 22px; display: grid; gap: 14px; }
.gsteps > li { counter-increment: g; display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 16px; border-radius: var(--r-lg); background: var(--clay-2); box-shadow: var(--hollow); }
.gsteps > li::before {
  content: counter(g); width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center;
  font-weight: 900; color: var(--on-pri); background: var(--pri); box-shadow: var(--clay-shadow-sm);
}
.gsteps > li > div > b:first-child { font-size: 16px; font-weight: 900; }
.gsteps ol, .gsteps ul { margin: 8px 0 0; padding-left: 20px; }
.gsteps ol li, .gsteps ul li { margin: 4px 0; }
.note { margin-top: 10px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--lav); color: var(--lav-ink); font-size: 14px; font-weight: 700; }
.muted { color: var(--ink-2); font-size: 14px; }
.hint { font-size: 13px; color: var(--ink-2); margin-top: 6px; }

/* ------------------------------------------------------------ sign-in */
.signin { min-height: calc(100vh - 40px); display: grid; place-items: center; padding: 20px 16px; }
.signin .clay { width: 100%; max-width: 420px; text-align: center; padding: 30px 26px 26px; }
.signin .logo { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 26px; display: grid; place-items: center; background: var(--clay); box-shadow: var(--clay-shadow); }
.signin .logo img { width: 58px; height: 58px; object-fit: contain; }
.signin h1 { margin: 0; font-size: 23px; font-weight: 900; }
.signin p.sub { margin: 4px 0 22px; color: var(--ink-2); }
.signin .field { text-align: left; margin-bottom: 18px; }
.signin .btn { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .btn:hover, .tabs a:hover { transform: none; }
}
