/* SimpleBanking — "Passbook" design system
   Outside (sign-in, sign-up, payment approval): the cloth cover of a savings
   passbook — deep green, gold-foil lettering, a paper name plate.
   Inside (dashboard, admin): the ruled paper pages — a ledger.
   Fonts: Besley (a Clarendon, the face of bank forms and certificates) for
   headings and money; Libre Franklin for everything you read or press. */

@import url("https://fonts.googleapis.com/css2?family=Besley:ital,wght@0,400..900;1,400..900&family=Libre+Franklin:wght@400..700&display=swap");

:root {
  /* colour */
  --cover: #123b2e;        /* passbook cloth */
  --cover-deep: #0c2a21;
  --paper: #f1f4ec;        /* safety paper */
  --paper-raised: #f8faf4; /* slips and plates sit a shade lighter */
  --ink: #18231e;
  --ink-soft: #55635b;
  --rule: #c7d3c6;         /* ledger rules */
  --green: #1b6b4f;        /* credits, primary actions on paper */
  --foil: #c8a24a;         /* gold foil: cover lettering, focus */
  --stamp: #b83a2b;        /* errors and warnings only */
  --marker: #f4e7a1;       /* highlighter: focused field */

  /* type */
  --display: "Besley", "Clarendon", "Rockwell", Georgia, serif;
  --text: "Libre Franklin", "Franklin Gothic Medium", "Helvetica Neue", Arial, sans-serif;
  --step--1: 0.8125rem;  /* 13 */
  --step-0: 1rem;        /* 16 */
  --step-1: 1.3125rem;   /* 21 */
  --step-2: 1.75rem;     /* 28 */
  --step-3: 2.5rem;      /* 40 */

  --radius: 3px;           /* paper has barely any corner */
  --measure: 56rem;        /* page column */
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font: 400 var(--step-0)/1.55 var(--text);
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
h4 { font-size: var(--step-0); font-family: var(--text); font-weight: 600; letter-spacing: 0; }

p { margin: 0 0 1em; max-width: 65ch; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--foil); outline-offset: 2px; }

.num, .money { font-variant-numeric: lining-nums tabular-nums; }
.soft { color: var(--ink-soft); }
.small { font-size: var(--step--1); }

/* ── Wordmark ─────────────────────────────────────────────────────────── */
.wordmark {
  font: 700 1.25rem/1 var(--display);
  letter-spacing: -0.015em;
  color: var(--green);
  text-decoration: none;
}

/* ── Fields: ruled lines on a form, not boxes ─────────────────────────── */
.form-group, .field { display: block; margin: 0 0 1.25rem; }

label {
  display: block;
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 0.15rem;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="tel"], select, textarea {
  width: 100%;
  font: 500 1.0625rem/1.4 var(--text);
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  border-radius: 0;
  padding: 0.5rem 0.125rem;
  appearance: none;
}
input::placeholder, textarea::placeholder { color: #8b978f; font-weight: 400; }
input:focus, select:focus, textarea:focus {
  outline: none;
  background: var(--marker);
  border-bottom-color: var(--green);
  box-shadow: 0 1.5px 0 var(--green);
}
select {
  padding-right: 1.5rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: right 0.55rem center, right 0.25rem center;
  background-size: 0.3rem 0.3rem;
  background-repeat: no-repeat;
}

/* one-time codes */
.code-input {
  font: 600 1.75rem/1.2 var(--display) !important;
  letter-spacing: 0.35em !important;
  text-align: center;
  font-variant-numeric: lining-nums !important;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: 600 0.9375rem/1 var(--text);
  color: var(--paper-raised);
  background: var(--green);
  border: 1.5px solid var(--green);
  border-radius: var(--radius);
  padding: 0.8rem 1.25rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.12s, color 0.12s, border-color 0.12s;
}
button:hover, .btn:hover { background: var(--cover); border-color: var(--cover); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

.btn-quiet, .btn-cancel {
  color: var(--ink);
  background: transparent;
  border-color: var(--ink);
}
.btn-quiet:hover, .btn-cancel:hover { color: var(--paper-raised); background: var(--ink); border-color: var(--ink); }

.btn-danger, .btn-deny {
  color: var(--stamp);
  background: transparent;
  border-color: var(--stamp);
}
.btn-danger:hover, .btn-deny:hover { color: var(--paper-raised); background: var(--stamp); border-color: var(--stamp); }

.btn-link {
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.btn-link:hover { background: none; text-decoration-thickness: 2px; }

.btn-block { width: 100%; }

/* ── Messages ─────────────────────────────────────────────────────────── */
.message { font-size: 0.9375rem; font-weight: 500; margin: 0 0 1rem; }
.message:empty { display: none; }
.message.error, .message.failure { color: var(--stamp); border-left: 3px solid var(--stamp); padding-left: 0.75rem; }
.message.success { color: var(--green); border-left: 3px solid var(--green); padding-left: 0.75rem; }

.toast-message {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 1100;
  max-width: calc(100vw - 2rem);
  padding: 0.8rem 1.1rem;
  font: 500 0.9375rem/1.4 var(--text);
  color: var(--paper-raised);
  background: var(--ink);
  border-radius: var(--radius);
}
.toast-message.error { background: var(--stamp); }

/* Rubber stamp — statuses only (Verified, 2FA on, Locked) */
.stamp {
  display: inline-block;
  font: 700 0.6875rem/1 var(--text);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  border: 1.5px solid currentColor;
  border-radius: 2px;
  padding: 0.3rem 0.45rem;
  transform: rotate(-2deg);
}
.stamp.off, .stamp.warn { color: var(--stamp); }
.stamp.idle { color: var(--ink-soft); }

/* ══ OUTSIDE: the cover ═════════════════════════════════════════════════ */
body.cover {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  color: var(--paper);
  background-color: var(--cover);
  background-image: url("guilloche-foil.svg");
  background-repeat: no-repeat;
  background-position: right -14rem bottom -16rem;
  background-size: 46rem;
}
.cover-head { width: 100%; padding: 1.75rem 2rem 0; }
.cover .wordmark { color: var(--foil); font-size: 1.375rem; }
.cover-foot { padding: 1.5rem 2rem 1.75rem; font-size: var(--step--1); color: #a9bdb2; text-align: center; }
.cover-foot a { color: inherit; }

/* The name plate: a paper label let into the cover */
.plate {
  position: relative;
  align-self: center;
  width: min(27rem, calc(100vw - 2rem));
  margin: 2rem 0;
  padding: 2.75rem 2.5rem 2.25rem;
  color: var(--ink);
  background: var(--paper-raised);
  border-radius: var(--radius);
}
.plate::before {            /* the double rule printed round a label */
  content: "";
  position: absolute;
  inset: 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 1px;
  pointer-events: none;
}
.plate > * { position: relative; }
.plate h1, .plate h2 { font-size: var(--step-2); margin-bottom: 0.35em; }
.plate .lede { color: var(--ink-soft); margin-bottom: 1.75rem; }
.plate-foot { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); font-size: 0.9375rem; color: var(--ink-soft); }
.plate-foot p { margin: 0 0 0.35rem; }

/* Cheque — payment approval */
.cheque {
  position: relative;
  margin: 0 0 1.5rem;
  padding: 1.1rem 1.1rem 1rem;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: var(--paper) url("guilloche.svg") no-repeat right -4.5rem bottom -6.5rem / 14rem;
}
.cheque .wordmark { color: var(--green); font-size: 0.9375rem; }
.cheque-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1.1rem; font-size: var(--step--1); color: var(--ink-soft); }
.cheque-pay { display: flex; align-items: baseline; gap: 0.6rem; border-bottom: 1px solid var(--ink); padding-bottom: 0.3rem; }
.cheque-pay .payee { font: italic 500 1.375rem/1.2 var(--display); }
.cheque-amount {
  display: inline-block;
  margin-top: 0.9rem;
  padding: 0.35rem 0.7rem;
  border: 1.5px solid var(--ink);
  background: var(--paper-raised);
  font: 600 1.75rem/1.2 var(--display);
  font-variant-numeric: lining-nums; /* Besley's tabular zero is drawn at the wrong weight: never tabular-nums on Besley */
}
.cheque-memo { margin: 0.9rem 0 0; font-size: var(--step--1); color: var(--ink-soft); }

.grants { list-style: none; margin: 0 0 1.5rem; padding: 0; font-size: 0.9375rem; }
.grants li { display: flex; gap: 0.6rem; padding: 0.4rem 0; border-bottom: 1px solid var(--rule); }
.grants li::before { content: "Can"; flex: none; width: 3.4rem; font-weight: 600; color: var(--green); }
.grants li.no::before { content: "Cannot"; color: var(--stamp); }

.btn-row { display: flex; gap: 0.75rem; }
.btn-row > * { flex: 1; }

/* ══ INSIDE: the pages ══════════════════════════════════════════════════ */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem max(1.25rem, calc((100vw - var(--measure)) / 2));
  color: var(--paper);
  background: var(--cover);
}
.masthead .wordmark { color: var(--foil); }
.masthead nav { display: flex; gap: 1.25rem; font-size: 0.9375rem; }
.masthead nav a, .masthead nav button { color: var(--paper); }

.sheet {
  width: min(var(--measure), calc(100vw - 2.5rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

/* Balance: the one loud thing on the page */
.balance {
  position: relative;
  padding: 0.5rem 0 2rem;
  margin-bottom: 2rem;
  border-bottom: 3px double var(--ink);
}
.balance::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 11.5rem;
  height: 11.5rem;
  transform: translateY(-56%);
  background: url("guilloche.svg") center / contain no-repeat;
  opacity: 0.6;
  pointer-events: none;
}
.balance > * { position: relative; z-index: 1; }
.balance-label { font-size: 0.9375rem; color: var(--ink-soft); }
.balance-amount {
  font: 600 clamp(3rem, 10vw, 5.5rem)/1.05 var(--display);
  letter-spacing: -0.03em;
  font-variant-numeric: lining-nums; /* Besley's tabular zero is drawn at the wrong weight: never tabular-nums on Besley */
  margin: 0.1rem 0 0.4rem;
}
.balance-meta { font-size: 0.9375rem; color: var(--ink-soft); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 3rem; }

/* Ledger */
.ledger { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.ledger caption { text-align: left; font: 600 var(--step-1)/1.2 var(--display); padding-bottom: 0.75rem; }
.ledger th {
  text-align: left;
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-soft);
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1.5px solid var(--ink);
}
.ledger td { padding: 0.8rem 0.75rem 0.8rem 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.ledger .r, .ledger th.r { text-align: right; padding-right: 0; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.ledger .date { white-space: nowrap; color: var(--ink-soft); font-variant-numeric: lining-nums tabular-nums; }
.ledger .in, .amount-positive { color: var(--green); font-weight: 600; }
.ledger .out, .amount-negative { color: var(--ink); font-weight: 600; }

/* Rows the history code already generates */
.transaction-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--rule); }
.transaction-type { font-weight: 600; }
.transaction-desc, .transaction-date { font-size: var(--step--1); color: var(--ink-soft); }
.transaction-amount { font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.no-transactions, .loading-history { padding: 2rem 0; color: var(--ink-soft); }

.page-btn { padding: 0.4rem 0.7rem; color: var(--ink); background: transparent; border-color: var(--rule); }
.page-btn.active, .page-btn:hover { color: var(--paper-raised); background: var(--ink); border-color: var(--ink); }

/* ── Slips: every modal is a counter slip ─────────────────────────────── */
.modal {
  display: none;               /* scripts switch this to flex */
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(12, 42, 33, 0.62);
  overflow-y: auto;
}
.modal-content {
  position: relative;
  width: min(27rem, 100%);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: 2.25rem 2rem 1.75rem;
  color: var(--ink);
  background: var(--paper-raised);
  border-radius: 0 0 var(--radius) var(--radius);
}
.modal-content::before {       /* torn-off perforation along the top edge */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 7px;
  background: radial-gradient(circle at 7px 0, rgba(12, 42, 33, 0.62) 4px, transparent 4.5px) 0 0 / 14px 7px repeat-x;
}
.modal-content h2, .modal-content h3 { font-size: var(--step-1); margin-bottom: 1.25rem; }
.modal-content.wide, .history-content { width: min(46rem, 100%); }
.modal-buttons { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; }
.modal-buttons button:first-child:not(:only-child) { color: var(--ink); background: transparent; border-color: var(--ink); }
.modal-buttons button:first-child:not(:only-child):hover { color: var(--paper-raised); background: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .modal-content { animation: slip-in 0.18s ease-out; }
  @keyframes slip-in { from { transform: translateY(14px); opacity: 0; } }
}

/* ── Small screens ────────────────────────────────────────────────────── */
@media (max-width: 40rem) {
  :root { --step-3: 2rem; --step-2: 1.5rem; }
  .plate { padding: 2.25rem 1.5rem 1.75rem; }
  .cover-head { padding: 1.25rem 1.25rem 0; }
  body.cover { background-size: 30rem; background-position: right -11rem bottom -11rem; }
  .balance::after { width: 8.5rem; height: 8.5rem; right: -2.5rem; opacity: 0.4; }
  .actions { gap: 0.5rem; }
  .actions > * { flex: 1 1 0; padding-left: 0.5rem; padding-right: 0.5rem; white-space: nowrap; }
  .ledger .hide-sm { display: none; }
  .masthead { flex-wrap: wrap; row-gap: 0.5rem; }
  .masthead nav { gap: 1rem; font-size: var(--step--1); }
  .masthead nav a { white-space: nowrap; }
}

/* ── Shared states the page scripts toggle ────────────────────────────── */
button.loading { opacity: 0.6; cursor: wait; pointer-events: none; }
.message.info { color: var(--ink-soft); border-left: 3px solid var(--rule); padding-left: 0.75rem; }
.message.warning { color: var(--ink); border-left: 3px solid var(--foil); padding-left: 0.75rem; }

/* ── Sign-up and reset: live password checklist and field states ──────── */
.req { display: block; font-size: var(--step--1); color: var(--ink-soft); }
.req::before { content: "\2013\00a0\00a0"; }
.req.met { color: var(--green); font-weight: 600; }
.req.met::before { content: "\2713\00a0\00a0"; }
input.invalid { border-bottom-color: var(--stamp); }
input.valid { border-bottom-color: var(--green); }
.hint { font-size: var(--step--1); color: var(--ink-soft); margin: 0.35rem 0 0; }
.password-strength { margin: 0.6rem 0 0.5rem; }
.strength-bar { height: 4px; background: var(--rule); }
.strength-fill { height: 100%; width: 0; background: var(--stamp); transition: width 0.2s; }
.strength-fill.weak { width: 30%; background: var(--stamp); }
.strength-fill.fair { width: 55%; background: var(--foil); }
.strength-fill.good { width: 80%; background: var(--green); }
.strength-fill.strong { width: 100%; background: var(--green); }

/* ── Email confirmation pages ─────────────────────────────────────────── */
.loader-container { margin: 0.5rem 0 1rem; }
.loader { height: 3px; background: linear-gradient(90deg, var(--green) 0 30%, var(--rule) 30% 100%); }
@media (prefers-reduced-motion: no-preference) {
  .loader { background-size: 200% 100%; animation: loader-run 1.1s linear infinite; }
  @keyframes loader-run { to { background-position: -200% 0; } }
}

/* ── Payment approval (authorize.html) ────────────────────────────────── */
.authorize .step { display: none; }
.authorize .step.active { display: block; }
.authorize .plate h1 { font-size: var(--step-2); }
.method-selector { display: grid; gap: 0.6rem; margin-bottom: 1.25rem; }
.method-option {
  display: flex; align-items: center; gap: 0.75rem; cursor: pointer;
  padding: 0.85rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-raised);
}
.method-option:hover { border-color: var(--ink); }
.method-option.selected { border: 1.5px solid var(--ink); background: var(--marker); }
.method-option:focus-visible { outline: 2px solid var(--foil); outline-offset: 2px; }
.method-name { font-weight: 600; }
.method-desc { font-size: var(--step--1); color: var(--ink-soft); }
#confirmMethodBtn:not(.enabled) { opacity: 0.45; pointer-events: none; }
.resend-btn { margin: 0 0 0.75rem; }
.countdown { font-size: var(--step--1); color: var(--ink-soft); margin: 0 0 1rem; }
.cheque-amount:empty { display: none; }
/* Full-page states the script writes into the body */
.page-state { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--cover); }
#expiryOverlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(12, 42, 33, 0.62); }
.expiry-box { width: min(27rem, 100%); padding: 2rem; background: var(--paper-raised); border-radius: var(--radius); }

/* ── Dashboard (index.html) ───────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tone-ok { color: var(--green) !important; }
.tone-bad { color: var(--stamp) !important; }
.tone-warn { color: var(--ink-soft) !important; }

.masthead .btn-link { color: var(--paper); font-weight: 500; }
.masthead .btn-link:hover { color: var(--foil); }
.balance .btn-link { font-size: 0.9375rem; color: var(--ink-soft); }

/* Settings rows */
.settings-option { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--rule); cursor: pointer; }
.settings-option:first-of-type { border-top: 1px solid var(--rule); }
.settings-option:hover h4 { text-decoration: underline; text-underline-offset: 3px; }
.settings-option h4 { margin: 0 0 0.15rem; }
.settings-option p { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }
.option-arrow { font-size: var(--step--1); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
/* A small ink switch */
.toggle-container { flex: none; position: relative; width: 2.5rem; height: 1.4rem; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper-raised); }
.toggle-slider { position: absolute; top: 2px; left: 2px; width: calc(1.4rem - 7px); height: calc(1.4rem - 7px); border-radius: 50%; background: var(--ink); transition: transform 0.15s; }
.toggle-container.active { background: var(--green); border-color: var(--green); }
.toggle-container.active .toggle-slider { transform: translateX(1.1rem); background: var(--paper-raised); }
.password-form { margin-top: 1.25rem; padding-top: 1rem; border-top: 3px double var(--ink); }
.form-header { display: flex; justify-content: space-between; align-items: baseline; }
#passwordMsg { font-size: 0.9375rem; margin: 0.75rem 0 0; }

/* Activity */
.modal-header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.history-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.filter-controls, .search-controls { display: flex; gap: 0.75rem; align-items: end; }
.filter-controls select, .search-controls input { flex: 1; }
.btn-export { flex: none; padding: 0.55rem 0.9rem; }
.history-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 1rem; border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule); }
.stat-card { padding: 0.65rem 0.75rem 0.7rem 0; }
.stat-card + .stat-card { padding-left: 0.75rem; border-left: 1px solid var(--rule); }
.stat-label { font-size: var(--step--1); color: var(--ink-soft); }
.stat-value { margin: 0.15rem 0 0; font: 600 1.25rem/1.2 var(--display); font-variant-numeric: lining-nums; }
.transactions-container { max-height: 50vh; overflow-y: auto; }
.history-pagination { display: flex; justify-content: center; gap: 0.35rem; margin-top: 1rem; flex-wrap: wrap; }
.page-dots { padding: 0.4rem 0.2rem; color: var(--ink-soft); }

/* Two-step sign-in QR */
#qrCode2FA { display: block; width: 200px; height: 200px; margin: 1rem auto; border: 1px solid var(--rule); background: var(--paper); }
#qrCode2FA[src=""] { display: none; }
#qrCode2FA.qr-loading { border-style: dashed; }
#qrCode2FA.qr-ready { border-color: var(--ink); }
#qrCode2FA.qr-failed { border: 1.5px solid var(--stamp); }

@media (max-width: 40rem) {
  .history-controls { grid-template-columns: 1fr; }
  .history-stats { grid-template-columns: 1fr 1fr; }
  .stat-card:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat-card:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

/* ── Admin desk (admin-panel.html) ────────────────────────────────────── */
.masthead-sub { margin-left: 0.6rem; padding-left: 0.6rem; border-left: 1px solid rgba(241, 244, 236, 0.35); font-size: 0.9375rem; color: var(--paper); }
.admin-info { display: flex; align-items: center; gap: 1.25rem; font-size: 0.9375rem; color: var(--paper); }
.admin-container { display: grid; grid-template-columns: 13rem 1fr; gap: 2.5rem; width: min(78rem, calc(100vw - 2.5rem)); margin: 0 auto; padding: 2rem 0 4rem; }
.sidebar .nav-items { display: flex; flex-direction: column; border-top: 1.5px solid var(--ink); }
.nav-item { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--rule); border-left: 3px solid transparent; font-weight: 500; text-decoration: none; color: var(--ink); }
.nav-item:hover { background: var(--paper-raised); }
.nav-item.active { border-left-color: var(--green); background: var(--paper-raised); font-weight: 600; }
.main-content { min-width: 0; }
.page-content > h2, .section-header > h2.section-title { font-size: var(--step-2); margin: 0 0 1.25rem; }
.section { margin: 0 0 2.5rem; }
.section > h3 { font-size: var(--step-1); }
.section-header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.section-header > div { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: end; }
.section-title { font-size: var(--step-1); margin: 0; }
.view-all { font-size: 0.9375rem; }
/* Stat figures: one ruled row, no cards */
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin: 0 0 2.5rem; border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule); }
.dashboard-stats .stat-card { padding: 0.75rem 1rem 0.85rem 0; }
.dashboard-stats .stat-card + .stat-card { padding-left: 1rem; border-left: 1px solid var(--rule); }
.dashboard-stats .stat-card h3 { font: 500 var(--step--1)/1.3 var(--text); color: var(--ink-soft); margin: 0; }
.dashboard-stats .stat-value { margin: 0.2rem 0 0; font: 600 2rem/1.1 var(--display); font-variant-numeric: lining-nums; }
.stat-trend { font-size: var(--step--1); color: var(--ink-soft); margin-top: 0.15rem; }
.stat-trend.down { color: var(--stamp); }
/* Tables the script builds */
.table-scroll { overflow-x: auto; }
.main-content table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.main-content th { text-align: left; font-size: var(--step--1); font-weight: 500; color: var(--ink-soft); padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
.main-content td { padding: 0.6rem 0.75rem 0.6rem 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.main-content tr.flagged td { background: var(--marker); }
.main-content code { font-size: 0.8125rem; padding: 0.1rem 0.35rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 2px; }
.truncate { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-buttons { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.empty-state { padding: 2rem 0; color: var(--ink-soft); }
.empty-title { font-weight: 600; color: var(--ink); margin-bottom: 0.25rem; }
/* Status chips are rubber stamps */
.status { display: inline-block; font: 700 0.6875rem/1 var(--text); letter-spacing: 0.1em; text-transform: uppercase; padding: 0.3rem 0.45rem; border: 1.5px solid currentColor; border-radius: 2px; color: var(--green); }
.status.locked { color: var(--stamp); }
.status.warning { color: var(--ink); }
.status.info { color: var(--ink-soft); }
/* Admin buttons */
.btn-sm { padding: 0.4rem 0.65rem; font-size: 0.8125rem; }
.btn-primary { background: var(--green); border-color: var(--green); color: var(--paper-raised); }
.btn-warning { color: var(--ink); background: transparent; border-color: var(--ink); }
.btn-warning:hover { color: var(--paper-raised); background: var(--ink); }
.btn-danger { color: var(--stamp); background: transparent; border-color: var(--stamp); }
.btn-danger:hover { color: var(--paper-raised); background: var(--stamp); }
.alert { font-size: 0.9375rem; padding: 0.15rem 0 0.15rem 0.75rem; border-left: 3px solid var(--ink); margin: 0 0 1rem; }
.alert-success { color: var(--green); border-color: var(--green); }
.alert-danger { color: var(--stamp); border-color: var(--stamp); }
.close-modal { padding: 0.35rem 0.6rem; font-size: 0.8125rem; color: var(--ink); background: transparent; border-color: var(--ink); }
.detail-block { margin-bottom: 1.25rem; }
.page-content small { color: var(--ink-soft); margin-left: 0.5rem; }
.page-content input[type="number"] { width: 6rem; }
.page-content label { color: var(--ink); font-weight: 600; font-size: 0.9375rem; }
@media (max-width: 52rem) {
  .admin-container { grid-template-columns: 1fr; gap: 1.25rem; }
  .sidebar .nav-items { flex-direction: row; overflow-x: auto; border-top: 0; border-bottom: 1.5px solid var(--ink); }
  .nav-item { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
  .nav-item.active { border-bottom-color: var(--green); }
  .admin-info span { display: none; }
}
/* Admin: alignment, settings form spacing, tables that scroll inside the page */
.admin-header.masthead { padding-left: max(1.25rem, calc((100vw - 78rem) / 2)); padding-right: max(1.25rem, calc((100vw - 78rem) / 2)); }
.admin-container { grid-template-columns: 13rem minmax(0, 1fr); }
.main-content .section > div[id$="Table"] { overflow-x: auto; }
#settingsPage .section > h3 { margin-bottom: 1rem; }
#settingsPage .section > div { margin-bottom: 1.25rem; }
#settingsPage .section > div > div,
#settingsPage .section > div > label:last-child { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-top: 0.35rem; font-weight: 400; }
@media (max-width: 52rem) {
  .admin-container { grid-template-columns: minmax(0, 1fr); }
  .dashboard-stats { grid-template-columns: 1fr 1fr; }
  .dashboard-stats .stat-card:nth-child(odd) { border-left: 0; padding-left: 0; }
  .dashboard-stats .stat-card:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

input[type="checkbox"], input[type="radio"] { accent-color: var(--green); width: 1.05rem; height: 1.05rem; }
