/* Admin area. Builds on site.css tokens. */

:root { --danger: #A8432C; --ok: #2F7A4F; --ok-soft: #DCEEDF; }
@media (prefers-color-scheme: dark) {
  :root { --danger: #E68A72; --ok: #6CC08C; --ok-soft: #1C3325; }
}

.booting { text-align: center; margin: 90px 0; color: var(--muted); }

.sign-in { max-width: 440px; margin: 64px auto; padding: 0 18px; }
#g-button { min-height: 44px; }
#g-button:empty { min-height: 0; }

.admin-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 22px 20px 72px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
.admin-top h1 {
  font-family: Archivo, system-ui, sans-serif;
  font-stretch: 112%;
  font-weight: 800;
  font-size: 24px;
  line-height: 1.1;
  margin: 2px 0 0;
}
.who-am-i { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }

.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); }
.tab {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.stack { display: flex; flex-direction: column; gap: 14px; }
.section-title {
  font-family: Archivo, system-ui, sans-serif;
  font-stretch: 112%;
  font-weight: 700;
  font-size: 20px;
  margin: 0;
}
.muted { color: var(--muted); }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; }
.toolbar .group { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.toolbar label, .panel-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.toolbar select, .toolbar input { width: auto; min-width: 180px; }

.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 4px;
  padding: 9px 13px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.small { font-size: 13px; padding: 6px 10px; }
.btn:disabled { opacity: .55; cursor: progress; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 5px; background: var(--card); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 10px 12px; border-top: 1px solid var(--line-2); vertical-align: top; }
table.data tbody tr:first-child td { border-top: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data a { color: var(--accent); text-underline-offset: 3px; }
table.data .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 9px 5px 8px;
  border-radius: 999px;
  white-space: nowrap;
  margin: 0 4px 4px 0;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.warn { color: var(--brass); background: var(--brass-soft); }
.pill.off { color: var(--muted); background: var(--line-2); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  text-decoration: none;
}
.stat:hover { border-color: var(--accent); }
.stat .n {
  font-family: Archivo, system-ui, sans-serif;
  font-stretch: 112%;
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat .label { font-weight: 600; }
.stat .sub { font-size: 13px; color: var(--muted); }

.detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: start; }
.detail-head h2 {
  font-family: Archivo, system-ui, sans-serif;
  font-stretch: 112%;
  font-weight: 700;
  font-size: 22px;
  margin: 4px 0;
}
.meta-lines { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--muted); }
.linkline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; }
.linkline a { color: var(--accent); overflow-wrap: anywhere; }
.back { font-size: 14px; color: var(--accent); text-underline-offset: 3px; }

.panel-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 18px;
}
.panel-form .wide { grid-column: 1 / -1; }
.panel-form .hint { text-transform: none; letter-spacing: 0; font-weight: 400; margin: 0; }
.panel-form .actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
@media (max-width: 680px) { .panel-form { grid-template-columns: 1fr; } }

input[type="datetime-local"], input[type="date"], input[type="search"], input[type="password"], textarea {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 11px;
  width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, textarea:focus-visible, .btn:focus-visible, .tab:focus-visible, .stat:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.chips.small .chip { font-size: 13px; padding: 6px 10px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.chips.small .chip[aria-pressed="true"] { font-weight: 600; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 10;
}

/* ---------- QR code card ---------- */
.qr-card { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card, #fff); }
.qr-image { width: 168px; height: 168px; flex: none; background: #fff; border-radius: 8px; }
.qr-image svg { width: 100%; height: 100%; display: block; }
.qr-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.qr-text .muted { overflow-wrap: anywhere; font-size: 13px; }

@media print {
  body.printing-qr * { visibility: hidden; }
  body.printing-qr .qr-card, body.printing-qr .qr-card * { visibility: visible; }
  body.printing-qr .qr-card { position: absolute; left: 0; top: 0; border: 0; }
  body.printing-qr .no-print { display: none !important; }
}

/* ---------- GSE theme ----------
   The member-site look: near-black page, the seal, Roboto for all text
   (like profile.css), green buttons. site.css still gives the layout.
   These rules only replace its colors and fonts. :root:root wins over
   site.css in both light and dark mode. */

@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300; font-display: swap; src: url(/fonts/roboto-300.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/roboto-400.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/roboto-500.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/roboto-700.woff2) format("woff2"); }

:root:root {
  color-scheme: dark;
  --paper: #0a0a0a;
  --card: #111111;
  --ink: #d9d9d9;
  --muted: #9a9a9a;
  --line: #353534;
  --line-2: #242423;
  --accent: #4bce55;
  --accent-ink: #ffffff;
  --accent-soft: #0f1a11;
  --brass: #e2c46b;
  --brass-soft: #241f10;
  --danger: #ff9a8f;
  --ok: #4bce55;
  --ok-soft: #0f1a11;
  --shadow: 0 12px 28px -14px rgba(0, 0, 0, .8);
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: var(--font);
  --label: var(--font);
  --button: #1b7a37;
  --button-hover: #21903f;
}

html, body { background: var(--paper); }
body { font: 400 15px/1.55 var(--font); color: var(--ink); }
/* site.css names Archivo and JetBrains Mono on many parts. Roboto for all. */
body :not(code):not(pre):not(kbd) { font-family: var(--font) !important; font-stretch: normal !important; }

/* Headings. */
.admin-top h1, .section-title, .detail-head h2, .stat .n, .card-head h2, h1, h2, h3 {
  font-family: var(--serif); font-weight: 400; font-stretch: normal; letter-spacing: .01em; color: #ececec;
}
.admin-top h1 { font-size: 32px; }
.section-title { font-size: 26px; }
.detail-head h2 { font-size: 28px; }
.stat .n { font-size: 40px; color: var(--accent); }

/* Labels, tabs, eyebrows, buttons: Public Sans capitals. */
.eyebrow, .tab, .btn, table.data th, .toolbar label, .panel-form label, .field > label, .stat .label, .pill, .linkline {
  font-family: var(--label);
}
.eyebrow { color: var(--accent); letter-spacing: .14em; font-size: 12px; font-weight: 500; }
.tab { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding: 12px 14px; }
.tab[aria-current="page"] { color: #ececec; border-bottom-color: var(--accent); }
.stat .label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }

.btn {
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase; border-radius: 6px; padding: 10px 14px;
  background: transparent; border-color: var(--line); color: var(--ink);
}
.btn:hover { border-color: var(--muted); color: #fff; }
.btn.primary, button.primary { background: var(--button); border-color: #2a8f49; color: #fff; }
.btn.primary:hover { background: var(--button-hover); }
.btn.danger { border-color: #5a3330; }
.btn.danger:hover { border-color: var(--danger); }
.btn.small { font-size: 11px; padding: 7px 10px; }

/* Cards, tables, forms. */
.card, .stat, .table-wrap, .panel-form, .qr-card { background: var(--card); border-color: var(--line); border-radius: 10px; box-shadow: none; }
.stat:hover { border-color: var(--accent); background: var(--accent-soft); }
table.data td { border-top-color: var(--line-2); }
table.data tbody tr:hover td { background: #151515; }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="search"],
input[type="password"], input[type="date"], input[type="datetime-local"], select, textarea {
  background: #0d0d0d; color: #ececec; border-color: var(--line); border-radius: 6px;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(75, 206, 85, .18); }
.notice { background: #1a1410; border-color: #5a4a1e; color: #e2c46b; }
.toast { background: #ececec; color: #0a0a0a; font-family: var(--label); }
a, table.data a, .back, .linkline a, .top-link { color: var(--accent); }

/* The seal, beside the title and on the sign-in card. */
.seal-mark { width: 44px; height: 44px; display: block; flex: none; }
.admin-brand { display: flex; align-items: center; gap: 14px; }
.sign-in .seal-mark { width: 64px; height: 64px; margin: 0 auto 6px; }
.sign-in .card-head { text-align: center; align-items: center; }
.sign-in .card-head h2 { font-size: 30px; }
.sign-in #pw-submit { width: 100%; justify-content: center; min-height: 48px; }

/* The email a member window. */
.compose {
  width: min(560px, calc(100vw - 32px));
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
}
.compose::backdrop { background: rgb(0 0 0 / .6); }
.compose form { display: flex; flex-direction: column; gap: 14px; }
.compose .group { display: flex; flex-wrap: wrap; gap: 10px; }
.compose input, .compose textarea { width: 100%; font: inherit; }
.dialog-problem { margin: 0; color: var(--danger, #e68a72); }
