/* StarADFS - Sylvania Schools look (same palette as StarPass / StarCompass) */
:root {
  --bg: #eef2f4; --panel: #ffffff; --panel-2: #f6f9fa; --ink: #263030; --ink-2: #3b4a57; --muted: #6f7d7d; --line: #dfe5e5;
  --brand: #0079ab; --brand-hover: #00658f; --brand-ink: #ffffff; --brand-soft: #e3f5fc;
  --ok: #1d8a4e; --ok-soft: #e3f4ea; --warn: #a35f00; --warn-soft: #fdf1dc; --bad: #c0362c; --bad-soft: #fbe6e4;
  --yellow: #FFCB05; --blue: #00A3DE; --orange: #F28E2C; --slate: #22313A;
  --s1: #0079ab; --s2: #F28E2C; --s3: #1d8a4e; --s4: #c0362c;
  --side-bg: #1a2129; --side-ink: #dbe3ea; --side-muted: #8e9aa6; --side-hover: #232c36; --side-active: #2b3644; --side-line: #29323d;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 26px rgba(16,24,40,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1216; --panel: #161b21; --panel-2: #1f2730; --ink: #e6ebf0; --ink-2: #c3ccd5; --muted: #9aa7b5; --line: #27303a;
    --brand: #00a0dd; --brand-hover: #20b2ea; --brand-soft: #0d2836; --ok: #4cc985; --ok-soft: #14301f; --warn: #f0a63a;
    --warn-soft: #33270f; --bad: #ff6b5e; --bad-soft: #3a1a17; --s1: #2fb3e6; --s3: #4cc985; --s4: #ff6b5e; --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1216; --panel: #161b21; --panel-2: #1f2730; --ink: #e6ebf0; --ink-2: #c3ccd5; --muted: #9aa7b5; --line: #27303a;
  --brand: #00a0dd; --brand-hover: #20b2ea; --brand-soft: #0d2836; --ok: #4cc985; --ok-soft: #14301f; --warn: #f0a63a;
  --warn-soft: #33270f; --bad: #ff6b5e; --bad-soft: #3a1a17; --s1: #2fb3e6; --s3: #4cc985; --s4: #ff6b5e; --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--brand); }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 10px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .nowrap { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand .mark { width: 44px; height: 44px; }
.brand-name { display: block; font-size: 24px; font-weight: 300; letter-spacing: -.01em; line-height: 1.05; }
.brand-name b { font-weight: 800; }
.brand-org { display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tri { display: grid; grid-template-columns: repeat(3, 1fr); height: 5px; border-radius: 3px; overflow: hidden; margin: 14px 0 18px; }
.tri i:nth-child(1) { background: var(--yellow); } .tri i:nth-child(2) { background: var(--blue); } .tri i:nth-child(3) { background: var(--orange); }

/* ---------- public pages ---------- */
body.public { min-height: 100vh;
  background: radial-gradient(90% 60% at 100% 0%, rgba(0,174,239,.13), transparent 60%),
              radial-gradient(70% 50% at 0% 100%, rgba(242,142,44,.08), transparent 60%), var(--bg); }
.pub-wrap { max-width: 480px; margin: 0 auto; padding: 40px 16px 32px; }
.pub-wrap.wide { max-width: 720px; }
.pub-head { display: flex; justify-content: center; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.pub-card { padding: 28px; }
.pub-foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 22px; }
.pub-foot a { color: var(--muted); }
.lead { color: var(--ink-2); margin: 0 0 18px; }
.hint { color: var(--muted); font-size: 13.5px; margin: 18px 0 0; }
.back { display: inline-block; font-size: 14px; text-decoration: none; margin-bottom: 10px; }
.demo-bar { background: var(--warn-soft); color: var(--warn); text-align: center; font-size: 13px; padding: 8px 12px; font-weight: 600; }

.tiles { display: grid; gap: 12px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel-2); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s; }
.tile:hover { border-color: var(--brand); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,121,171,.12); }
.tile b { display: block; font-size: 16px; margin-bottom: 4px; }
.tile small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.tile-ic { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
@media (max-width: 639px) { .tile { flex-direction: row; align-items: center; } }

.field { display: block; margin: 0 0 14px; }
.field > span:first-child { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=email], input[type=date], input:not([type]), select {
  width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 11px 12px; font-size: 16px; }
input:focus, select:focus, .btn:focus-visible, .tile:focus-visible { outline: 3px solid rgba(0,163,222,.35); outline-offset: 1px; border-color: var(--brand); }
.pw { position: relative; display: block; }
.pw input { padding-right: 46px; }
.peek { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted);
  width: 38px; height: 38px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.peek:hover, .peek.on { color: var(--brand); background: var(--brand-soft); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--brand); background: var(--brand);
  color: var(--brand-ink); font-weight: 700; padding: 11px 20px; border-radius: 9px; cursor: pointer; text-decoration: none; font-size: 15px; }
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.sm { padding: 7px 12px; font-size: 13.5px; }
form .btn[type=submit] { width: 100%; margin-top: 6px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.alert { border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; font-size: 14.5px; }
.alert.ok { background: var(--ok-soft); color: var(--ok); } .alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.small { font-size: 13px; padding: 8px 10px; margin: 8px 0 0; }
.rules { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 4px 0 14px; font-size: 13.5px; }
.rules-h { font-weight: 700; margin-bottom: 4px; } .rules ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.live { min-height: 0; font-size: 13.5px; margin: -6px 0 10px; }
.live .ok { color: var(--ok); } .live .bad { color: var(--bad); }
.who-box { display: flex; flex-direction: column; background: var(--brand-soft); border-radius: 10px; padding: 10px 14px; margin: 4px 0 16px; }
.who-box span { color: var(--muted); font-size: 13.5px; }
.unlock-form p { margin: 0 0 10px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 22px 0 16px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.mail { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 8px; background: var(--panel-2); }
.mail summary { padding: 10px 12px; cursor: pointer; } .mail summary small { color: var(--muted); margin-left: 6px; }
.mail pre { white-space: pre-wrap; word-break: break-word; margin: 0; padding: 0 14px 14px; font: 13.5px/1.5 ui-monospace, Consolas, monospace; }
.empty { color: var(--muted); margin: 0; }

/* ---------- admin ---------- */
.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side-bg); color: var(--side-ink);
  display: flex; flex-direction: column; padding: 18px 12px 14px; border-right: 1px solid var(--side-line);
  background-image: radial-gradient(140% 45% at 100% 0%, rgba(0,174,239,.18), transparent 60%); }
.side .brand { padding: 0 6px 18px; } .side .brand-name { color: #fff; font-size: 21px; } .side .brand-org { color: var(--side-muted); font-size: 10px; }
.side .brand .mark { width: 38px; height: 38px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 7px; color: var(--side-ink); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.nav-item:hover { background: var(--side-hover); }
.nav-item.on { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--blue); }
.nav-item .ic { color: var(--side-muted); } .nav-item.on .ic { color: var(--blue); }
.side-foot { border-top: 1px solid var(--side-line); padding-top: 12px; }
.who { font-size: 13px; color: var(--side-muted); padding: 0 6px 8px; }
.side-pill { width: 100%; display: flex; gap: 8px; justify-content: center; align-items: center; background: #11171d; border: 1px solid var(--side-line);
  color: var(--side-ink); border-radius: 8px; padding: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.side-pill:hover { background: var(--side-hover); }
.content { padding: 26px 28px 40px; min-width: 0; }
.content .card { margin-bottom: 18px; }
.page-h { margin-bottom: 18px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-h h2 { margin: 0; } .card-h a { font-size: 14px; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; }
  .side .brand { padding: 0; flex: 1 0 100%; }
  .side-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .nav-item { padding: 7px 9px; font-size: 13.5px; }
  .side-foot { border: 0; padding: 0; display: flex; align-items: center; gap: 8px; margin-left: auto; }
  .who { padding: 0; }
  .content { padding: 18px 16px 32px; }
}

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpis.compact { margin: 0; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.kpis.compact .kpi { box-shadow: none; background: var(--panel-2); }
.kpi.link:hover { border-color: var(--brand); }
.kpi-h { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-n { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-s { font-size: 12px; color: var(--muted); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid line { stroke: var(--line); } .chart text { fill: var(--muted); font-size: 11px; }
.s1 { fill: var(--s1); background: var(--s1); } .s2 { fill: var(--s2); background: var(--s2); }
.s3 { fill: var(--s3); background: var(--s3); } .s4 { fill: var(--s4); background: var(--s4); }

.table-wrap { overflow-x: auto; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700;
  padding: 8px 8px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:hover td { background: rgba(0,174,239,.05); }
.tbl .acct small { display: block; color: var(--muted); font-size: 12.5px; }
.tbl .det { color: var(--ink-2); font-size: 13px; max-width: 360px; }
.tbl form { margin: 0; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; text-transform: capitalize; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.muted { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }

.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-items: end; margin-bottom: 18px; }
.filters label { font-size: 12.5px; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.filters input, .filters select { padding: 8px 10px; font-size: 14px; }
.filter-btns { display: flex; gap: 6px; flex-wrap: wrap; grid-column: 1 / -1; }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 14px; font-size: 14px; color: var(--muted); }
.chips { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.chip { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 600; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.kv { border-collapse: collapse; width: 100%; font-size: 14px; }
.kv th { text-align: left; width: 180px; color: var(--muted); font-weight: 600; padding: 10px 12px 10px 0; vertical-align: top; }
.kv td { padding: 10px 0; border-bottom: 1px solid var(--line); word-break: break-word; }
.kv tr:last-child td { border: 0; }
@media (max-width: 600px) { .kv th { width: 110px; } }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 220px; }
.steps { padding-left: 20px; margin: 0 0 16px; color: var(--ink-2); }
.steps li { margin-bottom: 8px; }
.setup-key { font: 700 17px/1.4 ui-monospace, Consolas, monospace; letter-spacing: .06em; background: var(--panel-2);
  border: 1px dashed var(--line); border-radius: 9px; padding: 10px 12px; margin: 6px 0; word-break: normal; overflow-wrap: normal; user-select: all; }
.code-input { font: 700 22px/1 ui-monospace, Consolas, monospace !important; letter-spacing: .3em; text-align: center; }
.qr-box { background: #ffffff; border-radius: 12px; padding: 12px; width: 220px; max-width: 100%; margin: 10px 0 8px;
  border: 1px solid var(--line); }
.qr-box .qr { display: block; width: 100%; height: auto; }
.qr-box .qr path { fill: #000000; }
.qr-alt { font-size: 13.5px; margin-top: 4px; }
.qr-alt summary { cursor: pointer; color: var(--brand); }
