:root {
  --navy: #3c467b;
  --navy-light: #5a6ba8;
  --navy-tint: #eef0f8;
  --charcoal: #363435;
  --text: #2d2d2d;
  --muted: #6c757d;
  --line: #dee2e6;
  --bg: #f8f9fa;
  --card: #ffffff;
  --red: #c8102e;
  --red-tint: #fef2f2;
  --green: #1f7a4d;
  --green-tint: #edf7f1;
  --amber: #8a5a00;
  --amber-tint: #fff7e0;
  --radius: 12px;
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--navy); }
h1, h2, h3 { color: var(--charcoal); line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; }
code, .mono { font-family: "Geist Mono", ui-monospace, Menlo, monospace; font-size: .92em; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.site-header .inner { max-width: 1100px; margin: 0 auto; padding: .6rem 16px; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--charcoal); }
.brand img { height: 44px; width: auto; }
.brand .title { font-weight: 600; font-size: 1.05rem; line-height: 1.1; }
.brand .title small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.header-contact { margin-left: auto; font-size: .9rem; text-align: right; }
.header-contact a { text-decoration: none; font-weight: 600; }
nav.staff-nav { background: var(--navy); }
nav.staff-nav .inner { max-width: 1100px; margin: 0 auto; padding: 0 8px; display: flex; flex-wrap: wrap; align-items: center; }
nav.staff-nav a, nav.staff-nav button { color: #fff; text-decoration: none; padding: .7rem .75rem; font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; }
nav.staff-nav a:hover, nav.staff-nav a.active, nav.staff-nav button:hover { background: rgba(255,255,255,.12); }
nav.staff-nav form { margin-left: auto; }
nav.staff-nav .who { color: #dfe3f3; font-size: .85rem; padding: 0 .5rem; }

main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.5rem 16px 3rem; }
main.narrow { max-width: 520px; }

/* Footer */
.site-footer { background: var(--charcoal); color: #e8e8e8; font-size: .88rem; }
.site-footer .inner { max-width: 1100px; margin: 0 auto; padding: 1.5rem 16px; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer a { color: #fff; }
.site-footer strong { color: #fff; }

/* Cards, forms, buttons */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.card h2:first-child { margin-top: 0; }
label { display: block; font-weight: 600; margin: .9rem 0 .3rem; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input:not([type]), select, textarea {
  width: 100%; padding: .7rem .8rem; border: 1px solid #c4c9d0; border-radius: 8px; font: inherit; font-size: 16px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy-light); outline-offset: 1px; border-color: var(--navy-light); }
.radio-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.radio-row label, ul.radio li label { font-weight: 400; display: flex; gap: .4rem; align-items: center; margin: 0; }
ul.radio { list-style: none; padding: 0; margin: 0; display: flex; gap: 1.25rem; }
.errorlist { color: var(--red); list-style: none; padding: 0; margin: .3rem 0 0; font-size: .9rem; }
.help { color: var(--muted); font-size: .88rem; margin: .3rem 0 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.1rem; border-radius: 8px; border: 1px solid var(--navy); background: var(--navy); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; min-height: 44px; }
.btn:hover { background: #323b69; }
.btn.secondary { background: #fff; color: var(--navy); }
.btn.secondary:hover { background: var(--navy-tint); }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red-tint); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
form.inline { display: inline; }

/* Messages */
.msg { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.msg.success { background: var(--green-tint); border-color: #b9dfc8; color: var(--green); }
.msg.error { background: var(--red-tint); border-color: #f3c1c1; color: var(--red); }
.msg.warning { background: var(--amber-tint); border-color: #f0dca0; color: var(--amber); }
.msg.info { background: var(--navy-tint); border-color: #cfd5ec; color: var(--navy); }

/* Tables -> stacked cards on phones */
table.list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { background: var(--navy-tint); color: var(--charcoal); font-size: .85rem; }
table.list tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list tr { border-bottom: 1px solid var(--line); padding: .4rem 0; }
  table.list td { border: 0; padding: .25rem .8rem; }
  table.list td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--muted); }
  .header-contact { margin-left: 0; text-align: left; width: 100%; }
}

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.badge.ok { background: var(--green-tint); color: var(--green); }
.badge.off { background: #eceef1; color: var(--muted); }
.badge.warn { background: var(--amber-tint); color: var(--amber); }
.badge.bad { background: var(--red-tint); color: var(--red); }
.badge.admin { background: var(--navy-tint); color: var(--navy); }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { dl.facts { grid-template-columns: 1fr; } dl.facts dd { margin-bottom: .5rem; } }

.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; font-family: "Geist Mono", ui-monospace, monospace; font-size: 1.1rem; background: var(--bg); padding: 1rem; border-radius: 8px; }
.copybox { display: flex; gap: .5rem; }
.copybox input { font-family: "Geist Mono", ui-monospace, monospace; font-size: 14px; }
.steps { padding-left: 1.2rem; } .steps li { margin-bottom: .5rem; }
.faceid { text-align: center; padding: 1rem 0 .5rem; }
.faceid svg { width: 56px; height: 56px; color: var(--navy); }
.muted { color: var(--muted); }

/* Settings tabs */
nav.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
nav.tabs a { padding: .6rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 600; }
nav.tabs a.active { color: var(--navy); border-bottom-color: var(--navy); }

nav.staff-nav .count { display: inline-block; min-width: 1.4em; padding: 0 .4em; margin-left: .2rem; border-radius: 999px; background: #fff; color: var(--navy); font-size: .8rem; font-weight: 700; text-align: center; }
.hero { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 2rem 1.5rem; margin-bottom: 1.25rem; }
.hero h1 { color: #fff; font-size: 1.8rem; margin-bottom: .5rem; }
.hero p { margin: 0 0 1.25rem; color: #dfe3f3; max-width: 40rem; }
.hero .btn.secondary { border-color: #fff; }
.grid2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.check-row { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin-top: 1.2rem; }
.check-row input { width: 22px; height: 22px; margin-top: .1rem; flex: none; }
input.code { font-size: 1.8rem; letter-spacing: .4em; text-align: center; font-family: "Geist Mono", ui-monospace, monospace; }
.legal h2 { margin-top: 1.75rem; }
.legal { max-width: 760px; }
.req { color: var(--red); }
