﻿/* ============================================================================
   ABIA MoBSE  &middot;  admin.css
   Bronzebit Consult Ltd
   ----------------------------------------------------------------------------
   Same Abia tokens as the public site so the two never look like different
   systems, but a denser, calmer surface. An administrator is here for an hour
   at a time; the public visitor is here for ninety seconds.

   The one deliberate divergence: red is used far more sparingly here. On the
   public site it is the identity. In a console a saturated red reads as an
   error, so it marks exactly two things - the primary action, and the item
   that needs attention. Everything else is ink and line.

   HOUSE RULES ENFORCED: radius never above 8px, badges square, no pill
   shapes, no left-edge colour bars on rows, everything prefixed adm-.
   ========================================================================== */

:root{
  /* Same Abia tokens as the public sheet - see ppssc.css for why the legacy
     --sun names are aliased rather than renamed. */
  --red:#AA1F2E;
  --red-2:#C42B3A;
  --red-3:#FAEFEC;
  --red-dk:#7E121E;
  --on-red:#FFFFFF;
  --gold:#FDBD3D;
  --gold-dk:#8A5A00;
  --red-lite:var(--gold);

  --sun:var(--red);
  --sun-2:var(--red-2);
  --sun-3:var(--red-3);
  --amber:var(--red-dk);
  --on-sun:var(--on-red);
  --sun-lite:var(--gold);

  --ink:#0F1921;
  --slate:#1B2730;
  --paper:#FFFFFF;
  --shell:#F5F1EA;
  --wash:#FBF8F2;
  --line:#E5DDCF;
  --line-2:#F0EBE0;
  --muted:#6B6355;
  --dim:#98908A;
  --ok:#1F7A45;
  --ok-bg:#EAF6EF;
  --bad:#A11B1B;
  --bad-bg:#FDF2F2;
  --work:#8A5A00;
  --fd:'Plus Jakarta Sans','Segoe UI',system-ui,sans-serif;
  --fb:'Inter',system-ui,sans-serif;
  --fm:ui-monospace,'SFMono-Regular',Consolas,monospace;
  --r:8px;
  --side:250px;
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body.adm{
  margin:0;background:var(--shell);color:var(--ink);
  font-family:var(--fb);font-size:15px;line-height:1.55;
}
h1,h2,h3{font-family:var(--fd);margin:0;letter-spacing:-.015em;line-height:1.25}
p{margin:0}
a{color:inherit}
:focus-visible{outline:3px solid var(--sun);outline-offset:2px}
code{font-family:var(--fm);font-size:.86em;background:var(--line-2);padding:1px 5px;border-radius:4px}
.adm-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.adm-hidden-btn{position:absolute;left:-9999px;width:1px;height:1px}
.adm-dim{color:var(--dim)}

.adm-skip{
  position:absolute;left:-9999px;top:0;z-index:400;background:var(--ink);color:var(--sun-lite);
  padding:12px 18px;font-family:var(--fd);font-weight:700;text-decoration:none;
}
.adm-skip:focus{left:8px;top:8px}

/* ============================== SHELL ============================== */
.adm-side{
  position:fixed;top:0;left:0;bottom:0;width:var(--side);background:var(--ink);
  display:flex;flex-direction:column;z-index:120;transition:transform .25s;
}
.adm-side__h{display:flex;align-items:center;gap:11px;padding:20px 18px;border-bottom:1px solid rgba(255,255,255,.09)}
.adm-seal{
  width:38px;height:38px;flex:0 0 38px;border-radius:50%;background:var(--sun);
  display:grid;place-items:center;
}
.adm-seal svg{width:21px;height:21px}
.adm-seal--lg{width:56px;height:56px;flex-basis:56px;margin:0 auto 18px}
.adm-seal--lg svg{width:30px;height:30px}
.adm-side__t b{display:block;font-family:var(--fd);font-size:.98rem;font-weight:800;color:var(--sun-lite);letter-spacing:.04em}
.adm-side__t i{display:block;font-style:normal;font-size:.74rem;color:rgba(255,255,255,.55)}

.adm-nav{flex:1;overflow-y:auto;padding:14px 10px}
.adm-nav__g{margin-bottom:16px}
.adm-nav__gh{
  display:block;font-family:var(--fd);font-size:.63rem;font-weight:700;letter-spacing:.16em;
  text-transform:uppercase;color:rgba(255,255,255,.35);padding:6px 10px 8px;
}
.adm-nav__i{
  display:flex;align-items:center;gap:11px;padding:9px 11px;border-radius:var(--r);
  text-decoration:none;color:rgba(255,255,255,.78);font-size:.89rem;font-weight:500;
  transition:background .15s,color .15s;
}
.adm-nav__i svg{width:17px;height:17px;flex:0 0 17px;opacity:.7}
.adm-nav__i:hover{background:rgba(255,255,255,.07);color:#fff}
.adm-nav__i.is-on{background:var(--sun);color:var(--on-sun);font-weight:700}
.adm-nav__i.is-on svg{opacity:1}
.adm-nav__i em{
  margin-left:auto;font-style:normal;background:var(--sun);color:var(--on-sun);
  font-family:var(--fd);font-size:.68rem;font-weight:700;padding:1px 7px;border-radius:0;
}
.adm-nav__i.is-on em{background:var(--ink);color:var(--sun-lite)}

.adm-side__f{padding:14px 18px;border-top:1px solid rgba(255,255,255,.09)}
.adm-side__site{
  display:block;font-size:.82rem;color:rgba(255,255,255,.6);text-decoration:none;
}
.adm-side__site:hover{color:var(--sun-lite)}

.adm-main{margin-left:var(--side);min-height:100vh;display:flex;flex-direction:column}

.adm-top{
  background:var(--paper);border-bottom:1px solid var(--line);
  display:flex;align-items:center;gap:18px;padding:16px 28px;position:sticky;top:0;z-index:80;
}
.adm-top__t{flex:1;min-width:0}
.adm-top__t h1{font-size:1.25rem;font-weight:700}
.adm-top__t p{font-size:.85rem;color:var(--muted);margin-top:3px}
.adm-burger{
  display:none;width:40px;height:40px;border:1px solid var(--line);background:var(--paper);
  border-radius:var(--r);cursor:pointer;place-items:center;color:var(--ink);
}
.adm-burger svg{width:20px;height:20px}

.adm-who{display:flex;align-items:center;gap:11px;flex:0 0 auto}
.adm-who__av{
  width:38px;height:38px;flex:0 0 38px;border-radius:var(--r);background:var(--ink);
  color:var(--sun-lite);display:grid;place-items:center;font-family:var(--fd);
  font-weight:800;font-size:.82rem;
}
.adm-who__t b{display:block;font-family:var(--fd);font-size:.86rem;font-weight:700;line-height:1.25}
.adm-who__t small{display:block;font-size:.75rem;color:var(--muted)}
.adm-out{
  font-size:.82rem;color:var(--muted);text-decoration:none;padding:8px 12px;
  border:1px solid var(--line);border-radius:var(--r);font-weight:600;
}
.adm-out:hover{border-color:var(--ink);color:var(--ink)}

.adm-body{flex:1;padding:26px 28px 40px;max-width:1500px;width:100%}
.adm-foot{
  padding:18px 28px;border-top:1px solid var(--line);display:flex;justify-content:space-between;
  gap:14px;flex-wrap:wrap;font-size:.79rem;color:var(--dim);
}
.adm-scrim{position:fixed;inset:0;background:rgba(20,18,10,.5);opacity:0;visibility:hidden;transition:.2s;z-index:110}
.adm-scrim.is-open{opacity:1;visibility:visible}

/* ============================== CARDS ============================== */
.adm-card{
  background:var(--paper);border:1px solid var(--line);border-radius:var(--r);
  padding:22px 24px;margin-bottom:16px;
}
.adm-card__h{
  display:flex;align-items:baseline;justify-content:space-between;gap:16px;
  margin:-4px 0 18px;flex-wrap:wrap;
}
.adm-card__h h2{font-size:1.02rem;font-weight:700}
.adm-card__n{font-size:.8rem;color:var(--muted)}
.adm-h3{font-family:var(--fd);font-size:.92rem;font-weight:700;margin-bottom:12px}

.adm-split{display:grid;grid-template-columns:1fr 400px;gap:16px;align-items:start}
.adm-split--edit{grid-template-columns:1fr 340px}
.adm-cols{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}

/* ============================== BARS =============================== */
.adm-bar{
  display:flex;gap:14px;align-items:flex-end;flex-wrap:wrap;
  background:var(--paper);border:1px solid var(--line);border-radius:var(--r);
  padding:16px 20px;margin-bottom:16px;
}
.adm-bar__f{min-width:170px}
.adm-bar__f--grow{flex:1;min-width:200px}
.adm-bar__f label{
  display:block;font-family:var(--fd);font-size:.75rem;font-weight:600;
  color:var(--muted);margin-bottom:6px;
}
.adm-bar__a{margin-left:auto;display:flex;gap:9px;align-items:flex-end;flex-wrap:wrap}

/* ============================= BUTTONS ============================= */
.adm-btn{
  display:inline-flex;align-items:center;gap:8px;border:0;cursor:pointer;
  font-family:var(--fd);font-weight:700;font-size:.85rem;padding:11px 18px;
  border-radius:var(--r);text-decoration:none;transition:background .15s,transform .12s;
}
.adm-btn:hover{transform:translateY(-1px)}
.adm-btn--sun{background:var(--sun);color:var(--on-sun)}
.adm-btn--sun:hover{background:var(--sun-2)}
.adm-btn--ink{background:var(--ink);color:var(--sun-lite)}
.adm-btn--ink:hover{background:var(--slate)}
.adm-btn--quiet{background:var(--paper);color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--line)}
.adm-btn--quiet:hover{box-shadow:inset 0 0 0 1.5px var(--ink)}
.adm-btn--danger{background:var(--bad);color:#fff}
.adm-btn--danger:hover{background:#8A1717}
.adm-btn--wide{width:100%;justify-content:center;margin-top:6px}

.adm-link{font-size:.85rem;font-weight:600;color:var(--amber);text-decoration:none}
.adm-link:hover{text-decoration:underline;text-underline-offset:3px}
.adm-link--back::before{content:"\2190";margin-right:6px}

/* ============================== FORMS ============================== */
.adm-field{margin-bottom:18px}
.adm-field label{
  display:block;font-family:var(--fd);font-weight:600;font-size:.85rem;margin-bottom:6px;
}
.adm-hint{display:block;font-size:.79rem;color:var(--muted);margin-bottom:7px;line-height:1.5;font-weight:400}
.adm-req{
  display:inline-block;background:var(--sun);color:var(--on-sun);border-radius:0;
  font-family:var(--fd);font-size:.58rem;font-weight:700;letter-spacing:.1em;
  text-transform:uppercase;padding:2px 6px;margin-left:5px;vertical-align:middle;
}
.adm-input,.adm-select,.adm-textarea,.adm-file{
  width:100%;border:1px solid var(--line);border-radius:var(--r);background:var(--paper);
  padding:10px 13px;font-family:var(--fb);font-size:.92rem;color:var(--ink);
}
.adm-input:focus,.adm-select:focus,.adm-textarea:focus{border-color:var(--ink)}
.adm-input--mono{font-family:var(--fm);font-size:.86rem}
.adm-textarea{min-height:110px;resize:vertical;line-height:1.6}
.adm-textarea--sm{min-height:64px}
.adm-textarea--code{font-family:var(--fm);font-size:.84rem;line-height:1.65}
.adm-file{padding:9px 12px;background:var(--wash)}
.adm-frow{display:grid;grid-template-columns:1fr 1fr;gap:14px}

.adm-check{display:flex;gap:12px;align-items:flex-start;margin-bottom:16px}
.adm-check input[type="checkbox"]{width:20px;height:20px;flex:0 0 20px;margin-top:2px;accent-color:var(--ink);cursor:pointer}
.adm-check label{cursor:pointer;min-width:0;margin:0}
.adm-check label b{display:block;font-family:var(--fd);font-size:.88rem;font-weight:700}
.adm-check label span{display:block;font-size:.8rem;color:var(--muted);line-height:1.5;margin-top:3px;font-weight:400}

.adm-acts{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.adm-acts--form{margin-top:20px;padding-top:18px;border-top:1px solid var(--line-2)}
.adm-acts--sticky{
  position:sticky;bottom:0;background:var(--paper);border:1px solid var(--line);
  border-radius:var(--r);padding:14px 20px;margin-top:0;
  box-shadow:0 -8px 24px -20px rgba(20,18,10,.5);
}
.adm-sidebreak{border-top:1px solid var(--line-2);margin:22px 0 18px}

.adm-thumb{margin-top:10px;display:flex;gap:12px;align-items:center}
.adm-thumb img{width:130px;height:74px;object-fit:cover;border-radius:var(--r);border:1px solid var(--line)}
.adm-thumb span{font-size:.79rem;color:var(--muted)}

/* editor */
.adm-editor{border:1px solid var(--line);border-radius:var(--r);overflow:hidden;margin-bottom:10px;display:none}
.adm-editor.is-on{display:block}
.adm-editor__t{display:flex;gap:2px;flex-wrap:wrap;background:var(--wash);border-bottom:1px solid var(--line);padding:6px}
.adm-editor__t button{
  border:0;background:none;cursor:pointer;padding:6px 10px;border-radius:6px;
  font-family:var(--fd);font-size:.8rem;font-weight:600;color:var(--ink);
}
.adm-editor__t button:hover{background:var(--sun)}
.adm-editor__sep{width:1px;background:var(--line);margin:4px 5px}
.adm-editor__s{
  min-height:280px;padding:16px 18px;background:var(--paper);font-size:.94rem;line-height:1.7;
  overflow-y:auto;max-height:520px;
}
.adm-editor__s:focus{outline:none;box-shadow:inset 0 0 0 2px var(--sun-3)}
.adm-editor__s h3{font-size:1.05rem;margin:1.2em 0 .4em}
.adm-editor__s ul,.adm-editor__s ol{padding-left:1.4em}
.adm-editor__s p{margin:0 0 .8em}
.adm-editor.is-on + .adm-textarea{display:none}

/* ============================= MESSAGES ============================ */
.adm-flash{
  border:1px solid var(--line);border-radius:var(--r);background:var(--ok-bg);
  border-color:#BFE0CC;padding:14px 18px;margin-bottom:18px;font-size:.88rem;
}
.adm-flash b{display:block;font-family:var(--fd);font-size:.92rem;margin-bottom:3px;color:var(--ok)}
.adm-flash--bad{background:var(--bad-bg);border-color:#E4BEBE}
.adm-flash--bad b{color:var(--bad)}
.adm-flash--info{background:var(--wash);border-color:var(--line)}
.adm-flash--info b{color:var(--ink)}
.adm-errlist{margin:8px 0 0;padding-left:1.2em;line-height:1.6}
.adm-errlist li+li{margin-top:4px}

.adm-note{
  border:1px solid var(--line);border-radius:var(--r);background:var(--wash);
  padding:16px 20px;font-size:.85rem;color:var(--muted);line-height:1.6;margin-top:16px;
}
.adm-note b{display:block;font-family:var(--fd);color:var(--ink);font-size:.88rem;margin-bottom:4px}
.adm-note a{color:var(--amber);font-weight:600}
.adm-note--tight{margin-top:14px;padding:13px 16px}

.adm-empty{
  border:1px dashed var(--line);border-radius:var(--r);background:var(--wash);
  padding:26px;text-align:left;
}
.adm-empty b{display:block;font-family:var(--fd);font-size:.95rem;margin-bottom:4px}
.adm-empty span{display:block;font-size:.85rem;color:var(--muted);line-height:1.55;margin-bottom:14px}
.adm-empty .adm-btn{margin-top:2px}

/* ============================== BADGES ============================= */
/* square, always */
.adm-badge{
  display:inline-block;border-radius:0;padding:2px 8px;margin-right:5px;
  font-family:var(--fd);font-size:.64rem;font-weight:700;letter-spacing:.08em;
  text-transform:uppercase;line-height:1.6;white-space:nowrap;
}
.adm-badge--on{background:var(--ok-bg);color:var(--ok);box-shadow:inset 0 0 0 1px #BFE0CC}
.adm-badge--off{background:var(--line-2);color:var(--muted)}
.adm-badge--draft{background:var(--line-2);color:var(--muted);box-shadow:inset 0 0 0 1px var(--line)}
.adm-badge--new{background:var(--sun);color:var(--on-sun)}
.adm-badge--work{background:var(--sun-3);color:var(--work);box-shadow:inset 0 0 0 1px var(--red-dk)}
.adm-badge--line{background:var(--paper);color:var(--muted);box-shadow:inset 0 0 0 1px var(--line)}

/* ============================== TABLES ============================= */
.adm-tablewrap{border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.adm-table{width:100%;border-collapse:collapse;font-size:.88rem}
.adm-table thead th{
  background:var(--ink);color:var(--sun-lite);text-align:left;padding:11px 14px;
  font-family:var(--fd);font-weight:700;font-size:.7rem;letter-spacing:.1em;
  text-transform:uppercase;white-space:nowrap;
}
.adm-table tbody td{padding:12px 14px;border-top:1px solid var(--line-2);vertical-align:top}
.adm-table tbody tr:hover{background:var(--wash)}
.adm-td--act{white-space:nowrap;text-align:right}
.adm-name{
  display:block;font-family:var(--fd);font-weight:700;color:var(--ink);
  text-decoration:none;line-height:1.35;
}
.adm-name:hover{text-decoration:underline;text-decoration-color:var(--sun-lite);text-decoration-thickness:2px;text-underline-offset:3px}
.adm-name--mono{font-family:var(--fm);font-size:.85rem;letter-spacing:.02em}
.adm-sub{display:block;font-size:.78rem;color:var(--muted);margin-top:2px}
.adm-stale{display:block;font-size:.72rem;color:var(--bad);font-weight:700;margin-top:3px}

/* ============================== ROWS =============================== */
.adm-rows{display:flex;flex-direction:column}
.adm-row{
  display:flex;gap:14px;align-items:flex-start;padding:12px 2px;
  border-bottom:1px solid var(--line-2);text-decoration:none;
}
.adm-row:last-child{border-bottom:0}
.adm-row:hover{background:var(--wash)}
.adm-row--flat:hover{background:none}
.adm-row__m{flex:0 0 auto;padding-top:1px}
.adm-row__t{min-width:0;flex:1}
.adm-row__t b{display:block;font-size:.88rem;font-weight:600;line-height:1.4}
.adm-row__t small{display:block;font-size:.76rem;color:var(--muted);margin-top:2px}

/* tree / ordered list */
.adm-tree{display:flex;flex-direction:column}
.adm-tree__i{
  display:flex;gap:12px;align-items:center;padding:11px 4px;
  border-bottom:1px solid var(--line-2);
}
.adm-tree__i:last-child{border-bottom:0}
.adm-tree__i.is-child{padding-left:32px;background:var(--wash)}
.adm-tree__i.is-off{opacity:.55}
.adm-tree__t{flex:1;min-width:0}
.adm-tree__t b{display:block;font-family:var(--fd);font-size:.88rem;font-weight:700;line-height:1.35}
.adm-tree__t small{display:block;font-size:.76rem;color:var(--muted);font-family:var(--fm);margin-top:2px;word-break:break-all}
.adm-tree__s{flex:0 0 auto}
.adm-mini{
  width:64px;height:38px;flex:0 0 64px;border-radius:6px;border:1px solid var(--line);
  background:var(--line-2) center/cover no-repeat;
}

/* row actions */
.adm-acts{display:flex;gap:5px}
.adm-act{
  width:32px;height:32px;display:inline-grid;place-items:center;border-radius:6px;
  border:1px solid var(--line);background:var(--paper);cursor:pointer;color:var(--ink);
  text-decoration:none;transition:.15s;
}
.adm-act:hover{border-color:var(--ink);background:var(--wash)}
.adm-act svg{width:16px;height:16px}
.adm-act--del:hover{border-color:var(--bad);color:var(--bad);background:var(--bad-bg)}

.adm-sort{display:flex;flex-direction:column;gap:2px;flex:0 0 auto}
.adm-sortb{
  width:26px;height:19px;display:grid;place-items:center;border:1px solid var(--line);
  background:var(--paper);cursor:pointer;border-radius:4px;color:var(--muted);padding:0;
}
.adm-sortb:hover{border-color:var(--ink);color:var(--ink)}
.adm-sortb.is-off{opacity:.25;cursor:default}
.adm-sortb svg{width:13px;height:13px}

/* ============================ DASHBOARD ============================ */
.adm-attn{
  background:var(--sun);border-radius:var(--r);padding:18px 22px;margin-bottom:18px;
}
.adm-attn__i{display:flex;gap:16px;align-items:center;flex-wrap:wrap}
.adm-attn__ic{
  width:42px;height:42px;flex:0 0 42px;border-radius:var(--r);background:var(--ink);
  color:var(--sun-lite);display:grid;place-items:center;
}
.adm-attn__ic svg{width:21px;height:21px}
.adm-attn__t{flex:1;min-width:220px}
.adm-attn__t b{display:block;font-family:var(--fd);font-size:1rem;font-weight:700}
.adm-attn__t span{display:block;font-size:.85rem;color:rgba(255,255,255,.82);margin-top:2px}

.adm-stats{display:grid;grid-template-columns:repeat(6,1fr);gap:12px;margin-bottom:18px}
.adm-stat{
  background:var(--paper);border:1px solid var(--line);border-radius:var(--r);
  padding:16px 18px;text-decoration:none;display:block;transition:border-color .15s,transform .15s;
}
.adm-stat:hover{border-color:var(--ink);transform:translateY(-2px)}
.adm-stat b{
  display:block;font-family:var(--fd);font-size:1.6rem;font-weight:800;
  font-variant-numeric:tabular-nums;line-height:1.1;
}
.adm-stat span{display:block;font-size:.75rem;color:var(--muted);margin-top:4px;line-height:1.35}

.adm-card--wide{grid-column:1 / -1}
.adm-checks{display:flex;flex-direction:column;gap:10px}
.adm-check{margin-bottom:0}
.adm-checks .adm-check{display:flex}
.adm-checks>.adm-check{align-items:flex-start}
.adm-check__i{
  width:24px;height:24px;flex:0 0 24px;border-radius:6px;display:grid;place-items:center;
  font-family:var(--fd);font-weight:800;font-size:.82rem;
}
.is-ok .adm-check__i{background:var(--ok-bg);color:var(--ok)}
.is-bad .adm-check__i{background:var(--bad-bg);color:var(--bad)}
.adm-check__t{min-width:0}
.adm-check__t b{display:block;font-family:var(--fd);font-size:.86rem;font-weight:700}
.adm-check__t span{display:block;font-size:.8rem;color:var(--muted);line-height:1.5;margin-top:2px}

/* ============================ DEFINITIONS ========================== */
.adm-dl dl{margin:0;border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.adm-dl__r{display:grid;grid-template-columns:190px 1fr;border-bottom:1px solid var(--line-2)}
.adm-dl__r:last-child{border-bottom:0}
.adm-dl dt{padding:10px 14px;background:var(--wash);font-family:var(--fd);font-weight:600;font-size:.79rem;color:var(--muted)}
.adm-dl dd{margin:0;padding:10px 14px;font-size:.88rem}

.adm-report{
  background:var(--wash);border:1px solid var(--line);border-radius:var(--r);
  padding:20px 22px;font-size:.94rem;line-height:1.7;
}
.adm-meta{font-size:.8rem;color:var(--muted);line-height:1.7;padding-top:14px;border-top:1px solid var(--line-2)}
.adm-meta b{color:var(--ink);font-family:var(--fd)}

/* ============================== MODAL ============================== */
.adm-modal{
  position:fixed;inset:0;z-index:300;background:rgba(20,18,10,.6);
  display:flex;align-items:center;justify-content:center;padding:24px;
}
.adm-modal[hidden]{display:none}
.adm-modal__c{
  background:var(--paper);border-radius:var(--r);padding:28px 30px;max-width:460px;width:100%;
  box-shadow:0 40px 80px -40px rgba(20,18,10,.8);
}
.adm-modal__c h2{font-size:1.1rem;font-weight:700;margin-bottom:10px}
.adm-modal__c p{font-size:.9rem;color:var(--muted);line-height:1.6;margin-bottom:22px}
.adm-modal__c p b{color:var(--ink)}
.adm-modal__a{display:flex;gap:9px;justify-content:flex-end;flex-wrap:wrap}

/* ============================== SIGN IN ============================ */
.adm-signin{background:var(--ink);display:flex;min-height:100vh}
.adm-gate{flex:1;display:flex;align-items:center;justify-content:center;padding:32px 20px}
.adm-gate__c{
  background:var(--paper);border-radius:var(--r);padding:38px 36px;width:100%;max-width:410px;
  box-shadow:0 40px 90px -50px rgba(0,0,0,.9);text-align:left;
}
.adm-gate__c--wide{max-width:480px}
.adm-gate__k{
  display:block;font-family:var(--fd);font-size:.68rem;font-weight:700;letter-spacing:.18em;
  text-transform:uppercase;color:var(--amber);text-align:center;margin-bottom:8px;
}
.adm-gate h1{font-size:1.22rem;font-weight:700;text-align:center;line-height:1.35}
.adm-gate__s{font-size:.85rem;color:var(--muted);text-align:center;margin:8px 0 24px;line-height:1.55}
.adm-gate__f{font-size:.78rem;color:var(--muted);line-height:1.5;margin-top:18px;text-align:center}
.adm-gate__b{
  display:block;text-align:center;margin-top:18px;font-size:.8rem;color:var(--muted);
  text-decoration:none;
}
.adm-gate__b:hover{color:var(--ink)}

/* ============================ RESPONSIVE =========================== */
@media (max-width:1280px){
  .adm-stats{grid-template-columns:repeat(3,1fr)}
  .adm-split,.adm-split--edit{grid-template-columns:1fr}
  .adm-cols{grid-template-columns:1fr}
}
@media (max-width:900px){
  .adm-side{transform:translateX(-100%)}
  .adm-side.is-open{transform:none}
  .adm-main{margin-left:0}
  .adm-burger{display:grid}
  .adm-body{padding:20px 18px 32px}
  .adm-top{padding:14px 18px}
  .adm-who__t{display:none}
  .adm-frow{grid-template-columns:1fr;gap:0}
  .adm-dl__r{grid-template-columns:1fr}
  .adm-dl dt{padding-bottom:2px}
  .adm-dl dd{padding-top:2px}

  /* tables become stacked cards, same markup, data-label supplies headings */
  .adm-tablewrap{border:0}
  .adm-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .adm-table,.adm-table tbody,.adm-table tr,.adm-table td{display:block;width:100%}
  .adm-table tr{
    background:var(--paper);border:1px solid var(--line);border-radius:var(--r);
    margin-bottom:10px;padding:6px 0;
  }
  .adm-table tbody td{border-top:0;padding:7px 16px;display:flex;gap:12px;align-items:baseline}
  .adm-table tbody td::before{
    content:attr(data-label);flex:0 0 38%;font-family:var(--fd);font-weight:600;
    font-size:.7rem;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);
  }
  .adm-table tbody td:first-child{display:block;padding-top:14px;padding-bottom:10px;
    border-bottom:1px solid var(--line-2);margin-bottom:6px}
  .adm-table tbody td:first-child::before{display:none}
  .adm-td--act{text-align:left}
}
@media (max-width:560px){
  .adm-stats{grid-template-columns:1fr 1fr}
  .adm-gate__c{padding:28px 22px}
}
@media (prefers-reduced-motion:reduce){
  *{animation-duration:.001ms!important;transition-duration:.001ms!important}
}

/* ============================================================================
   PHASE 4B  &middot;  ADDITIONS
   LGA mapping grid, zone tally, temporary passwords, message list.
   ========================================================================== */

/* square avatar variant, used where the thing is a person not a photograph */
.adm-mini--sq{
  border-radius:6px;background:var(--ink);color:var(--sun-lite);
  display:grid;place-items:center;font-family:var(--fd);font-weight:800;font-size:.78rem;
}

/* ------------------------------------------------------ LGA mapping grid */
.adm-lgagrid{display:grid;grid-template-columns:1fr 1fr;gap:8px 18px}
.adm-lgarow{
  display:flex;align-items:center;gap:12px;padding:7px 0;
  border-bottom:1px solid var(--line-2);
}
.adm-lgarow__n{
  flex:1;min-width:0;font-family:var(--fd);font-weight:600;font-size:.86rem;
}
.adm-select--sm{width:auto;min-width:150px;padding:7px 10px;font-size:.84rem}

.adm-tally{display:flex;flex-direction:column;gap:6px}
.adm-tally__r{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:9px 13px;background:var(--wash);border:1px solid var(--line);border-radius:var(--r);
  font-size:.86rem;
}
.adm-tally__r b{
  font-family:var(--fd);font-size:1rem;font-variant-numeric:tabular-nums;
}
/* an empty zone is almost certainly a mistake, so it is called out */
.adm-tally__r.is-bad{background:var(--bad-bg);border-color:#E4BEBE}
.adm-tally__r.is-bad b{color:var(--bad)}

/* --------------------------------------------------- temporary password */
.adm-temp{
  margin-top:12px;background:var(--ink);color:var(--sun-lite);border-radius:var(--r);
  padding:16px 20px;font-family:var(--fm);font-size:1.08rem;font-weight:700;
  letter-spacing:.06em;word-break:break-all;
}

/* ------------------------------------------------------------- messages */
.adm-msgs{display:flex;flex-direction:column;gap:12px}
.adm-msg{border:1px solid var(--line);border-radius:var(--r);padding:18px 20px;background:var(--paper)}
.adm-msg__h{display:flex;gap:13px;align-items:flex-start;margin-bottom:12px}
.adm-msg__av{
  width:38px;height:38px;flex:0 0 38px;border-radius:var(--r);background:var(--ink);
  color:var(--sun-lite);display:grid;place-items:center;font-family:var(--fd);
  font-weight:800;font-size:.8rem;
}
.adm-msg__t{flex:1;min-width:0}
.adm-msg__t b{display:block;font-family:var(--fd);font-size:.95rem;font-weight:700;line-height:1.35}
.adm-msg__t small{display:block;font-size:.78rem;color:var(--muted);margin-top:3px;line-height:1.5}
.adm-msg__s{flex:0 0 auto}
.adm-msg__b{
  background:var(--wash);border:1px solid var(--line-2);border-radius:var(--r);
  padding:14px 16px;font-size:.9rem;line-height:1.65;
}
.adm-msg__a{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}

@media (max-width:1180px){
  .adm-lgagrid{grid-template-columns:1fr}
}
@media (max-width:560px){
  .adm-lgarow{flex-direction:column;align-items:stretch;gap:6px}
  .adm-select--sm{width:100%}
}

/* ============================================================================
   PHASE 4C  &middot;  ADDITIONS
   Photo grid inside the gallery editor.
   ========================================================================== */

.adm-photos{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.adm-photo{position:relative;border:1px solid var(--line);border-radius:var(--r);padding:8px;background:var(--wash)}
.adm-photo__i{
  display:block;aspect-ratio:4/3;border-radius:6px;background:var(--line-2) center/cover no-repeat;
  margin-bottom:7px;
}
.adm-input--tiny{padding:6px 9px;font-size:.79rem}
.adm-photo .adm-act--del{
  position:absolute;top:2px;right:2px;width:26px;height:26px;
  font-family:var(--fd);font-size:1rem;font-weight:700;line-height:1;
  background:var(--paper);text-decoration:none;
}
@media (max-width:1180px){ .adm-photos{grid-template-columns:repeat(4,1fr)} }
@media (max-width:680px){ .adm-photos{grid-template-columns:repeat(2,1fr)} }

/* ============================================================================
   FIELD ORDER  &middot;  label, then control, then the note
   Same reasoning as the public stylesheet: a hint between the label and the
   input pushes that input below its neighbour and the row reads as a
   staircase. Reordering in CSS covers every screen at once, including the
   settings and LGA forms whose controls are built at runtime.
   ========================================================================== */

.adm-field{display:flex;flex-direction:column;align-items:stretch}

.adm-field > label            { order:1 }
.adm-field > .adm-input,
.adm-field > .adm-select,
.adm-field > .adm-textarea,
.adm-field > .adm-file,
.adm-field > .adm-editor,
.adm-field > input,
.adm-field > select,
.adm-field > textarea         { order:2 }
.adm-field > .adm-hint        { order:3; margin:7px 0 0 }
.adm-field > .adm-thumb,
.adm-field > datalist         { order:4 }

.adm-frow{align-items:start}
.adm-check{display:flex;flex-direction:row}

/* The rich editor and its fallback textarea are one control in two parts, so
   they must stay adjacent and share the same order slot. */
.adm-field > .adm-editor + textarea{order:2}

/* Cover thumbnail in the downloads editor */
.adm-cover{
  width:150px;aspect-ratio:16/10;border-radius:var(--r);border:1px solid var(--line);
  background:var(--line-2) center/cover no-repeat;
}

/* ============================================================================
   SHOW / HIDE PASSWORD
   The wrapper is created by admin.js, so it must carry the same flex order slot
   as the input it replaced - otherwise the label/control/hint ordering breaks
   on any field that has a hint.
   ========================================================================== */

.adm-field > .adm-pw{order:2}

.adm-pw{position:relative;display:block;width:100%}
.adm-pw .adm-input{width:100%;padding-right:46px}

.adm-pw__eye{
  position:absolute;top:50%;right:5px;transform:translateY(-50%);
  width:34px;height:34px;display:grid;place-items:center;
  border:0;background:none;cursor:pointer;color:var(--muted);border-radius:6px;padding:0;
}
.adm-pw__eye svg{width:19px;height:19px}
.adm-pw__eye:hover{color:var(--ink);background:var(--line-2)}
.adm-pw__eye.is-on{color:var(--ink)}
.adm-pw__eye:focus-visible{outline:3px solid var(--sun);outline-offset:1px}

/* ============================================================================
   ADMIN LAYOUT CORRECTIONS
   ----------------------------------------------------------------------------
   ROW ACTIONS WERE STACKING VERTICALLY.

   .adm-acts is display:flex, which makes it a BLOCK-level box. In a table cell
   that already held a standalone view link, the link took one line and the
   button group dropped to the next. It also carried flex-wrap:wrap, so once
   the actions column was squeezed by the five columns to its left, each 32px
   button wrapped onto a line of its own - which is the three-button vertical
   ladder in the screenshot, and why the rows were three times taller than
   their content.

   Three fixes, all needed:
     inline-flex so the group sits on the same line as anything before it;
     nowrap so the buttons never ladder;
     a fixed basis on each button so they are never squashed instead.
   ========================================================================== */

.adm-td--act{white-space:nowrap;text-align:right;vertical-align:middle;min-width:118px}
.adm-td--act > .adm-act{vertical-align:middle}

.adm-acts{
  display:inline-flex;flex-wrap:nowrap;align-items:center;gap:5px;vertical-align:middle;
}
.adm-act{flex:0 0 32px}

/* The tree rows use the same group; keep it on one line there too. */
.adm-tree__i .adm-acts{flex-wrap:nowrap}

/* Toolbars and form action rows: even spacing, aligned baselines, and buttons
   that never end up half a row apart from each other. */
.adm-bar{align-items:end;row-gap:12px}
.adm-bar__a{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.adm-acts--form{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.adm-acts--form .adm-btn{margin:0}

/* Equal heights across every control in a filter bar, whatever it is. */
.adm-bar .adm-input,
.adm-bar .adm-select,
.adm-bar .adm-btn{height:42px;line-height:1.2}
.adm-bar .adm-btn{padding-top:0;padding-bottom:0}

@media (max-width:900px){
  /* In the stacked-card table the action cell is full width, so the group
     aligns left with the rest of the card rather than floating right. */
  .adm-td--act{text-align:left;min-width:0}
}

/* ============================================================================
   ROW ACTIONS  ·  one line, always
   ----------------------------------------------------------------------------
   The buttons were stacking vertically in the downloads list. The cause was
   structural rather than stylistic: the "download" button was emitted as a bare
   anchor BEFORE the .adm-acts container, so the cell held two sibling boxes
   rather than one flex row, and the second dropped below the first as soon as
   the column narrowed.

   That is now fixed in AdminUi.RowActions, which takes the extra button and
   renders it inside the same row. These rules make the outcome robust: the row
   never wraps, and the column is wide enough for three buttons plus gaps
   (3 x 32 + 2 x 5 = 106) plus the cell padding.
   ========================================================================== */

.adm-acts--row{
  display:inline-flex;flex-wrap:nowrap;align-items:center;gap:5px;
  vertical-align:middle;justify-content:flex-end;
}
.adm-td--act{white-space:nowrap;text-align:right;vertical-align:middle;min-width:150px}
.adm-td--act .adm-act{flex:0 0 32px}

/* Stacked-card view on small screens: the row moves under the label and is
   left-aligned like every other value, rather than hugging the right edge. */
@media (max-width:900px){
  .adm-td--act{min-width:0;text-align:left}
  .adm-acts--row{justify-content:flex-start}
}

/* ---- form action bars ----
   Save and Cancel were sitting at different heights wherever one was a Button
   and the other a LinkButton, because the two render different elements. This
   makes every control in an action bar share one baseline and one height. */
.adm-acts--form{align-items:center}
.adm-acts--form .adm-btn{min-height:42px}

/* ============================================================================
   ADMIN GRID, PAGER AND SIGN-IN  ·  corrections
   ========================================================================== */

/* ---- the logo in the console ----
   The sidebar seal was a fixed 38px yellow disc drawn around the star. An
   uploaded logo drops the disc for the same reason it does on the public site:
   the client's mark is portrait and a circle letterboxes it. */
.adm-seal--img{
  background:transparent;border-radius:0;width:auto;flex:0 0 auto;
  height:38px;max-width:64px;display:flex;align-items:center;justify-content:center;
}
.adm-seal--img img{width:auto;height:100%;max-width:64px;object-fit:contain;display:block}
.adm-seal--lg.adm-seal--img{height:64px;max-width:110px;margin:0 auto 18px}
.adm-seal--lg.adm-seal--img img{max-width:110px}

/* ---- table rows ----
   Rows were far taller than their content because the action cell held three
   stacked buttons. With the actions on one line the cell no longer sets the
   height, so the row can sit at its natural size. vertical-align:middle keeps
   short cells centred against a two-line title rather than floating at the top. */
.adm-table tbody td{vertical-align:middle;padding:11px 14px}
.adm-table tbody tr{height:auto}
.adm-table tbody td:first-child{vertical-align:middle}
.adm-name{line-height:1.3}
.adm-sub{line-height:1.3;margin-top:1px}

/* ---- pagination ----
   Pager.Render emits aps- prefixed markup because it was written for the public
   site, and admin.css defined none of it - so in the console the pager rendered
   as raw underlined text runs jammed together: "<12>Showing 1-25 of 26 schools".
   These rules give it the console's own treatment.

   Renaming the classes would have been tidier and would also have broken every
   public page that already styles them, for no gain. */
.aps-pager{
  display:flex;align-items:center;gap:6px;flex-wrap:wrap;
  margin-top:16px;padding-top:16px;border-top:1px solid var(--line-2);
}
.aps-pager a,
.aps-pager span.is-on{
  min-width:36px;height:36px;padding:0 11px;
  display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--line);border-radius:6px;background:var(--paper);
  font-family:var(--fd);font-weight:600;font-size:.85rem;color:var(--ink);
  text-decoration:none;transition:border-color .15s,background .15s;
}
.aps-pager a:hover{border-color:var(--ink);background:var(--wash)}
.aps-pager span.is-on{background:var(--ink);border-color:var(--ink);color:var(--sun-lite)}
.aps-pager span.is-off{
  min-width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--line-2);border-radius:6px;color:var(--dim);opacity:.5;
}
/* the count is pushed to the far end, where it reads as a caption rather than
   as another button */
.aps-pager__c{
  margin-left:auto;font-size:.82rem;color:var(--muted);white-space:nowrap;
  border:0;background:none;padding:0;height:auto;
}

@media (max-width:560px){
  .aps-pager{gap:5px}
  .aps-pager__c{margin-left:0;width:100%;order:99;padding-top:6px}
}

/* ---- sign-in: split screen ----
   The card sat alone on a wide cream field. These rules put it in the left
   column and fill the right with a photograph and one line of the Commission's
   own words.

   The backdrop is generated artwork, not a photograph: there is no licensed
   image in this project, and a stock classroom photo the Commission has no
   rights to would be worse than none on a government sign-in page. It is the
   Igwebuike stroke motif over a dark ground, in the state palette.

   If the file is ever missing the panel falls back to flat --ink and the type
   stays legible, because the url() is layered over a colour rather than used
   alone. A sign-in page that breaks when an image 404s is worse than one with
   no image. */

/*  THE FLEX CONTAINER IS THE FORM, NOT THE BODY.

    This is the WebForms trap. Everything on the page sits inside
    <form runat="server">, so a display:flex on <body> has exactly one flex
    item - the form - and the card and the panel inside it are ordinary blocks
    that stack. Which is what happened: the panel appeared underneath the
    sign-in card instead of beside it.

    Putting the flex on the form itself is the fix, and it is worth remembering
    for any full-height layout added to this solution later. */
.adm-signin{display:block;min-height:100vh;background:var(--shell)}
.adm-signin > form{display:flex;min-height:100vh;width:100%;align-items:stretch}
.adm-gate{flex:0 0 46%;max-width:560px;display:flex;align-items:center;justify-content:center;padding:32px 28px}

.adm-gate__aside{
  flex:1;position:relative;overflow:hidden;background:var(--ink);
  display:flex;align-items:flex-end;
}
.adm-gate__aside::before{
  content:"";position:absolute;inset:0;
  background:url("../img/signin-panel.jpg") center/cover no-repeat, var(--ink);
  opacity:.5;
}
/* A wash from the black corner up through the image, so the type at the bottom
   always has something dark behind it whatever the photograph is doing. */
.adm-gate__aside::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(15deg,rgba(20,18,10,.94) 8%,rgba(20,18,10,.45) 58%,rgba(20,18,10,.2) 100%);
}
.adm-gate__aside-in{position:relative;z-index:2;padding:46px 52px 52px;max-width:560px}
.adm-gate__kicker{
  display:block;font-family:var(--fd);font-size:.7rem;font-weight:700;
  letter-spacing:.2em;text-transform:uppercase;color:var(--sun-lite);margin-bottom:14px;
}
.adm-gate__quote{
  font-family:var(--fd);font-size:1.7rem;font-weight:700;line-height:1.25;
  color:#fff;letter-spacing:-.02em;margin:0 0 16px;
}
.adm-gate__foot{display:block;font-size:.82rem;color:rgba(255,255,255,.6)}

@media (max-width:1100px){
  .adm-gate{flex-basis:52%}
  .adm-gate__quote{font-size:1.4rem}
  .adm-gate__aside-in{padding:36px 38px 42px}
}
@media (max-width:900px){
  /* Below this the card already fills the screen; the panel would only push it
     off the fold. */
  .adm-gate__aside{display:none}
  .adm-gate{flex:1;max-width:none}
}

/* ---- editor: upload progress and inserted images ---- */
.adm-editor__note{
  padding:8px 14px;font-size:.8rem;color:var(--muted);
  background:var(--wash);border-top:1px solid var(--line);
}
.adm-editor__note.is-bad{background:var(--bad-bg);color:var(--bad);font-weight:600}

/* An inserted image must not blow the editing surface out to its natural size,
   or a 1400px photo makes the whole console scroll sideways. */
.adm-editor__s img{max-width:100%;height:auto;display:block;margin:12px 0;border-radius:6px}


/* ---- ported from the Delta build: helpers the new admin pages use ------- */
.adm-thumb--wide .adm-cover{width:190px;height:64px;flex:0 0 190px;background-size:cover;background-position:center}
.adm-cover--tall{width:84px;height:104px;flex:0 0 84px;aspect-ratio:auto;background-size:cover;background-position:center top}
.adm-filewarn{
  display:block;order:5;margin-top:8px;padding:10px 13px;
  background:#FBEBEC;border:1px solid #E7B7BC;border-radius:6px;
  color:#8C2B33;font-size:.8rem;line-height:1.55;
}
.adm-card__a{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-left:auto}
.adm-card__a .adm-btn{min-height:38px;padding-top:0;padding-bottom:0;font-size:.82rem}
.adm-btn--sm{padding:7px 12px;font-size:.78rem;min-height:34px}
/* key / value strip used on the website screens */
.adm-kv{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin-bottom:16px}
.adm-kv__i{border:1px solid var(--line);border-radius:var(--r);padding:12px 14px;background:var(--paper);min-width:0}
.adm-kv__i small{display:block;font-family:var(--fd);font-size:.66rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin-bottom:4px}
.adm-kv__i b{display:block;font-family:var(--fd);font-size:.92rem;font-weight:700;overflow-wrap:anywhere}
.adm-kv__i a{color:var(--amber);text-decoration:none}
.adm-kv__i a:hover{text-decoration:underline}
/* inline code-ish value (a subdomain, a URL) */
.adm-mono{font-family:var(--fm);font-size:.84rem;background:var(--line-2);padding:2px 7px;border-radius:4px;overflow-wrap:anywhere}
.adm-kv{grid-template-columns:1fr 1fr}
.adm-card__a{margin-left:0;width:100%}
.adm-input--sm{padding:7px 10px;font-size:.84rem;min-height:0}
/* ---- request review aside ---- */
.adm-input--static{display:flex;align-items:center;min-height:40px;background:var(--wash);color:var(--ink);font-weight:600}
.adm-gap-12{height:12px}
.adm-prose{font-size:.9rem;line-height:1.65;color:var(--ink)}
.adm-prose p{margin:0 0 10px}
.adm-prose--boxed{border:1px solid var(--line);border-radius:6px;padding:12px 14px;background:#fff;max-height:320px;overflow:auto}
.adm-prose--boxed img{max-width:100%;height:auto}
.adm-swatch .adm-mono{white-space:nowrap}
.adm-photo__b{padding:10px 12px;display:flex;flex-direction:column;gap:8px}
.adm-photo__b .adm-input{font-size:.84rem;padding:7px 10px}
.adm-photo__a{display:flex;justify-content:space-between;align-items:center;gap:8px}
.adm-btn--sm{padding:7px 12px;font-size:.78rem}
.adm-tree__i .adm-btn--sm{flex:0 0 auto}
