/* ===================================================================== */
/* KEYSTONE · inside pages                                                */
/*                                                                       */
/* The companion to keystone-signin.css. That one gets people through the */
/* door; this one is what they find on the other side.                    */
/*                                                                       */
/* GENERATED — never edit this file inside an app. Edit                   */
/* _brand/app/keystone-app.css and run _brand/signin/distribute.mjs.      */
/*                                                                       */
/* Extracted from App-22 Parent Access Card, which had already solved     */
/* this on the current brand, and generalised. The tokens are identical   */
/* to the sign-in page's, so a person signing in and then landing inside  */
/* sees one continuous product rather than two.                           */
/* ===================================================================== */

@font-face { font-family: Lato; font-weight: 300; font-style: normal; font-display: swap; src: url("/brand/fonts/Lato-Light.ttf") format("truetype"); }
@font-face { font-family: Lato; font-weight: 400; font-style: normal; font-display: swap; src: url("/brand/fonts/Lato-Regular.ttf") format("truetype"); }
@font-face { font-family: Lato; font-weight: 400; font-style: italic; font-display: swap; src: url("/brand/fonts/Lato-Italic.ttf") format("truetype"); }
@font-face { font-family: Lato; font-weight: 700; font-style: normal; font-display: swap; src: url("/brand/fonts/Lato-Bold.ttf") format("truetype"); }
@font-face { font-family: Lato; font-weight: 900; font-style: normal; font-display: swap; src: url("/brand/fonts/Lato-Black.ttf") format("truetype"); }

:root {
  /* Brand */
  --navy: #1B2034;
  --grey: #E6DDCB;
  --gold: #DEAC35;
  --paper: #FAF7F1;
  --white: #FFFFFF;

  /* Tonal extensions — same values as the sign-in page */
  --navy-90: #2A2F44;
  --navy-70: #434860;   /* secondary text; darkened when body went to Regular */
  --navy-50: #7C8093;
  --navy-20: #C8CAD2;
  --navy-10: #E5E6EB;
  --grey-warm: #D8CFBC;
  --grey-soft: #F1ECE0;
  --gold-deep: #B7892A;
  --gold-soft: #FDF3D9;

  /* State. Scarlett is the brand's own alarm colour (5.63:1 on white);
     the other two are picked to match it for weight, not for cheer. */
  --ok: #2D7B00;
  --warn: #B4553E;
  --critical: #CC1A18;

  --radius: 8px;
  --radius-card: 10px;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --fast: 140ms;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--paper); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  /* Regular for anything read at text size. Lato Light is the brand's
     workhorse for DISPLAY — at 16px on paper it reads as grey mist, which is
     what happened here: Regular was never shipped, so every weight-400 rule in
     the estate silently fell back to Light. */
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  color: var(--navy);
  background: var(--paper);
}

/* Light only where the type is big enough to carry it. */
h1, h2, h3, h4 { letter-spacing: 0.01em; margin: 0; text-wrap: balance; }
h1 { font-weight: 300; }
h2, h3, h4 { font-weight: 400; }
h1 { font-size: 1.9rem; line-height: 1.2; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 12px; }
a { color: var(--navy); }
a:hover { color: var(--gold-deep); }
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
[hidden], .hidden { display: none !important; }

/* Digits that sit in columns must line up, always. */
table, .tabular, .stat-card strong { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- app bar */
/* Navy band, gold rule under it. The rule is the one piece of brand
   furniture every inside page shares, so it is never decorative here. */

.appbar { background: var(--navy); border-bottom: 3px solid var(--gold); }

.appbar__inner {
  max-width: 1180px; margin: 0 auto; padding: 13px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}

.appbar__crest { width: 150px; height: auto; flex: 0 0 auto; }
.appbar__titles { flex: 1 1 260px; min-width: 0; }

.appbar__kicker {
  margin: 0; color: var(--gold);
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.appbar__name { margin: 2px 0 0; color: var(--white); font-size: 1.2rem; font-weight: 400; }
.appbar__name b { font-weight: 700; }

.appbar__side { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; margin-left: auto; }
/* WA Grey on navy is 11.95:1. Pure white is kept for the app name. */
.appbar__who { color: var(--grey); font-size: 0.875rem; }

.appbar__side button, .appbar__side a {
  border: 1px solid var(--grey); background: transparent; color: var(--white);
  font: inherit; font-size: 0.875rem; padding: 6px 14px;
  border-radius: var(--radius); cursor: pointer; text-decoration: none;
  transition: background var(--fast) var(--ease);
}
.appbar__side button:hover, .appbar__side a:hover { background: var(--navy-90); color: var(--white); }

/* Tabs sit in a darker strip below the bar; the active one lifts onto paper. */
.tabs { display: flex; gap: 2px; padding: 0 14px; background: rgba(0,0,0,0.16); overflow-x: auto; }
.tabs a {
  display: inline-block; padding: 11px 16px; white-space: nowrap;
  font-size: 0.875rem; font-weight: 700; text-decoration: none;
  color: var(--grey); border-radius: var(--radius) var(--radius) 0 0;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.tabs a:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.tabs a[aria-current], .tabs a.active { background: var(--paper); color: var(--navy); }

/* ------------------------------------------------------------- layout */

.page-shell { max-width: 1180px; margin: 0 auto; padding: 26px 20px 64px; }
.page-shell--narrow { max-width: 760px; }

.page-head { margin: 0 0 22px; }
.page-head h1 { margin: 6px 0 4px; }
.page-head p { color: var(--navy-70); margin: 0; max-width: 68ch; }

.eyebrow {
  margin: 0; font-size: 0.6875rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-deep);
}

.rule { width: 56px; height: 1px; background: var(--gold); border: 0; margin: 14px 0 20px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.section + .section { margin-top: 30px; }

/* ------------------------------------------------------------- surfaces */
/* Border, fill and radius each say "separate object". Spend them by role:
   a card is a thing you act on, not a box round every paragraph. */

.card {
  background: var(--white);
  border: 1px solid var(--navy-10);
  border-radius: var(--radius-card);
  padding: 22px;
}
.card + .card { margin-top: 16px; }
.card__title { font-size: 1.15rem; margin: 0 0 6px; }
.card__meta { color: var(--navy-70); font-size: 0.875rem; margin: 0; }

/* A card you click. The gold edge is the affordance, so it appears on
   hover and focus and nowhere else. */
.action-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--white); border: 1px solid var(--navy-10);
  border-left: 3px solid var(--navy-20);
  border-radius: var(--radius-card); padding: 20px;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.action-card:hover, .action-card:focus-visible { border-left-color: var(--gold); background: var(--grey-soft); }
.action-card .title { font-size: 1.05rem; font-weight: 700; display: block; margin-bottom: 4px; }
.action-card .desc { color: var(--navy-70); font-size: 0.9rem; margin: 0; }

.stat-card { background: var(--white); border: 1px solid var(--navy-10); border-radius: var(--radius-card); padding: 18px 20px; }
.stat-card .label { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-70); }
.stat-card strong { display: block; font-size: 2rem; font-weight: 300; line-height: 1.15; margin-top: 4px; }

/* A quiet aside. Not a card — no border, no radius, just a gold margin. */
.note, .hint {
  border-left: 2px solid var(--gold); background: var(--grey-soft);
  padding: 12px 16px; margin: 0 0 14px; color: var(--navy-70); font-size: 0.9rem;
}
.note--warn { border-left-color: var(--warn); background: #FBF0EC; }
.note--critical { border-left-color: var(--critical); background: #FBEDED; color: var(--navy); }

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 0.95rem; font-weight: 700;
  padding: 11px 20px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.btn-primary { background: var(--navy); border-color: var(--navy); color: var(--grey); }
.btn-primary:hover { background: var(--navy-90); border-color: var(--navy-90); color: var(--grey); }

.btn-secondary { background: var(--white); border-color: var(--navy-20); color: var(--navy); }
.btn-secondary:hover { background: var(--grey-soft); border-color: var(--navy-50); color: var(--navy); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--navy-70); }
.btn-ghost:hover { background: var(--grey-soft); color: var(--navy); }

/* Destructive. Never the default, never the only styling that says so —
   the words on it have to say "delete" too. */
.btn-danger { background: var(--critical); border-color: var(--critical); color: var(--white); }
.btn-danger:hover { background: #A81514; border-color: #A81514; color: var(--white); }

.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn + .btn { margin-left: 8px; }

/* ------------------------------------------------------------- forms */

.field { margin: 0 0 16px; }
.field > label, label.field-label {
  display: block; font-size: 0.6875rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-70); margin: 0 0 5px;
}
.field small, .field .help { display: block; color: var(--navy-70); font-size: 0.85rem; margin-top: 5px; }

input[type="text"], input[type="email"], input[type="search"], input[type="password"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%; font: inherit; font-size: 16px;   /* 16px stops iOS zooming on focus */
  padding: 10px 13px; color: var(--navy); background: var(--white);
  border: 1px solid var(--navy-20); border-radius: var(--radius);
  transition: border-color var(--fast) var(--ease);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-deep); }
textarea { min-height: 120px; resize: vertical; }

.field-grid { display: grid; gap: 0 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ------------------------------------------------------------- status */

.pill, .status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 3px 10px; border-radius: 999px;
  background: var(--grey-soft); color: var(--navy-70); border: 1px solid var(--grey-warm);
}
/* State reads as shape and word, not colour alone — colour is the third cue. */
.pill--ok, .status-live, .status-done { background: #EAF3E4; color: #1F5600; border-color: #C3DDB4; }
.pill--warn { background: #FBF0EC; color: #8C3F2C; border-color: #E7C6BB; }
.pill--critical { background: #FBEDED; color: #96110F; border-color: #E9BFBE; }
.pill--off, .status-off { background: var(--grey-soft); color: var(--navy-50); border-color: var(--navy-10); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 0.8rem; padding: 3px 10px; border-radius: 999px;
  background: var(--gold-soft); border: 1px solid var(--grey-warm); color: var(--navy);
}

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

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead th {
  text-align: left; font-size: 0.6875rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-70);
  padding: 10px 12px; border-bottom: 1px solid var(--navy-20); white-space: nowrap;
}
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--navy-10); vertical-align: top; }
tbody tr:hover { background: var(--grey-soft); }

/* A wide table scrolls inside its own box; the page never scrolls sideways. */
.table-wrap { overflow-x: auto; border: 1px solid var(--navy-10); border-radius: var(--radius-card); background: var(--white); }
.table-wrap table { font-size: 0.875rem; }
.table-wrap thead th { background: var(--grey-soft); }

/* ------------------------------------------------------------- code */

.code-box, .script-box {
  background: var(--navy); color: var(--grey);
  padding: 16px; border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem; line-height: 1.55;
  white-space: pre-wrap; overflow-x: auto;
}
.copy-wrap { position: relative; }
.copy-wrap > .script-box, .copy-wrap > .code-box { padding-right: 76px; }
.copy-wrap .copy-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  background: rgba(255,255,255,0.12); color: var(--grey);
  border: 1px solid rgba(255,255,255,0.22); border-radius: 6px;
  padding: 4px 10px; font: inherit; font-size: 0.75rem; cursor: pointer;
}
.copy-wrap .copy-btn:hover { background: rgba(255,255,255,0.22); }
.copy-wrap .copy-btn.copied { background: var(--gold); color: var(--navy); border-color: var(--gold); }
@media print { .copy-wrap .copy-btn { display: none; } }

/* ------------------------------------------------------------- misc */

.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.wordmark { font-weight: 300; color: var(--navy); }

.pagination { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 20px; flex-wrap: wrap; }
.pagination .pager-current { font-weight: 700; }
.pagination .pager-disabled { opacity: 0.4; pointer-events: none; }

.error-message, .form-error-panel {
  border-left: 2px solid var(--critical); background: #FBEDED;
  padding: 12px 16px; margin: 0 0 16px; color: var(--navy); font-size: 0.9rem;
}

@media (max-width: 720px) {
  .page-shell { padding: 20px 16px 48px; }
  .appbar__inner { padding: 12px 16px; }
  .appbar__crest { width: 120px; }
  .btn { width: 100%; }
  .btn + .btn { margin-left: 0; margin-top: 8px; }
  .row .btn { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
