/*
 * ACCG Registration - admin and staff pages.
 * Same palette and typeface as the kiosk; quieter, denser, built for a
 * laptop at the registration desk. Fonts are local: the event network
 * has no internet.
 */

@font-face {
  font-family: 'Atkinson Next';
  src: url('fonts/atkinson-next-latin.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Atkinson Next';
  src: url('fonts/atkinson-next-latin-ext.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face { font-family: 'Badge Sans'; src: url('fonts/freesans.ttf') format('truetype'); font-weight: 400; }
@font-face { font-family: 'Badge Sans'; src: url('fonts/freesans-bold.ttf') format('truetype'); font-weight: 700; }

:root {
  --pine: #173A34;
  --pine-2: #24524A;
  --pine-track: #D3E2DE;
  --granite: #E6ECEA;
  --paper: #FFFFFF;
  --marigold: #F2B632;
  --marigold-2: #D99B12;
  --brick: #A93226;
  --mist: #52665F;
  --rule: #C3CFCB;
  --line: #E1E8E5;
  --ok: #2F6B45;
  --ok-bg: #DDEEE2;
  --warn-bg: #FBEBC4;
  --bad-bg: #F6DDD9;
  --idle-bg: #E2E7E5;
  --font: 'Atkinson Next', 'Atkinson Hyperlegible', system-ui, sans-serif;
}

* { box-sizing: border-box; }
body.admin { margin: 0; background: var(--granite); color: var(--pine); font: 15px/1.5 var(--font); }
a { color: var(--pine-2); text-underline-offset: 2px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }

/* ---- Chrome ------------------------------------------------------- */
.topbar { display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: var(--pine); color: #fff; flex-wrap: wrap; }
.topbar a { color: #fff; }
.brand { font-weight: 800; text-decoration: none; font-size: 1.05rem; }
.event-now { flex: 1; color: #C9DBD6; min-width: 0; }
.event-now-name { color: #fff; font-weight: 700; }
.who { display: flex; gap: 14px; align-items: center; font-size: 0.9rem; }
.mainnav { display: flex; gap: 2px; padding: 0 16px; background: var(--paper); border-bottom: 1px solid var(--rule); overflow-x: auto; }
.mainnav a { padding: 12px 12px 9px; color: var(--mist); font-weight: 700; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.mainnav a:hover { color: var(--pine); }
.mainnav a[aria-current] { color: var(--pine); border-bottom-color: var(--marigold); }
.mainnav .nav-kiosk { margin-left: auto; }
.page { max-width: 1320px; margin: 0 auto; padding: 24px; }

h1 { font-size: 1.75rem; font-weight: 800; line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.01em; }
h2 { font-size: 1.12rem; font-weight: 800; margin: 0 0 12px; }
h3 { font-size: 1rem; font-weight: 800; margin: 18px 0 6px; }
p { margin: 0 0 12px; }

.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.narrow-panel { max-width: 400px; }
.narrow-panel.wide { max-width: 620px; }
.muted { color: var(--mist); }
.hint { color: var(--mist); font-size: 0.88rem; margin: 6px 0 12px; }
.hint-list { color: var(--mist); font-size: 0.9rem; padding-left: 1.2em; }
.hint-list li { margin-bottom: 6px; }
.empty { color: var(--mist); margin: 0; }
code, pre.token { font-family: Consolas, 'Cascadia Mono', 'DejaVu Sans Mono', monospace; font-size: 0.9em; background: var(--granite); border-radius: 4px; }
code { padding: 1px 5px; overflow-wrap: anywhere; }
pre.token { padding: 10px 12px; white-space: pre-wrap; word-break: break-all; margin: 8px 0 0; }

.notice { padding: 10px 14px; border-radius: 8px; margin: 0 0 16px; border-left: 5px solid; }
.notice p:last-child { margin-bottom: 0; }
.notice-ok { background: var(--ok-bg); border-color: var(--ok); }
.notice-bad { background: var(--bad-bg); border-color: var(--brick); }
.notice-info { background: var(--warn-bg); border-color: var(--marigold-2); }

/* ---- Tables ------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 0.8rem; font-weight: 700; color: var(--mist); padding: 6px 10px; border-bottom: 2px solid var(--rule); white-space: nowrap; vertical-align: bottom; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:hover td { background: #F7FAF9; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.actions { white-space: nowrap; text-align: right; }
.table td.actions > * { margin-left: 4px; }

/* ---- Forms -------------------------------------------------------- */
.field { display: block; margin: 0 0 14px; min-width: 0; }
.field > span { display: block; font-weight: 700; margin-bottom: 4px; }
.field small { display: block; color: var(--mist); margin-top: 4px; font-size: 0.85rem; }
input:not([type]), input[type=text], input[type=password], input[type=number], input[type=email],
input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; color: inherit; background: #fff;
  border: 1px solid #A6B8B2; border-radius: 6px; padding: 7px 10px; min-height: 38px;
}
textarea { min-height: 72px; resize: vertical; }
input[type=color] { width: 100%; height: 38px; padding: 2px; border: 1px solid #A6B8B2; border-radius: 6px; background: #fff; }
input[type=file] { font: inherit; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--marigold); outline-offset: 0; border-color: var(--pine); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--pine); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.form-actions { margin: 4px 0 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 16px; align-items: start; }
form.inline { display: inline; }
.inline-edit { display: flex; gap: 6px; }
.inline-edit input { min-width: 10rem; }
.pin-form + .pin-form { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 4px; }
.logo-thumb { max-height: 70px; max-width: 240px; background: var(--granite); padding: 8px; border-radius: 6px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.toolbar .field { margin: 0; }
.toolbar .grow { flex: 1 1 18rem; }
.toolbar .spacer { flex: 1; }

/* ---- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 7px 16px; border-radius: 7px; border: 2px solid var(--pine);
  background: var(--pine); color: #fff; font: inherit; font-weight: 700; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--pine-2); border-color: var(--pine-2); color: #fff; }
.btn-secondary { background: #fff; color: var(--pine); }
.btn-secondary:hover { background: var(--granite); color: var(--pine); border-color: var(--pine); }
.btn-small { min-height: 30px; padding: 3px 10px; font-size: 0.86rem; border-width: 1.5px; }
.btn-danger { background: #fff; color: var(--brick); border-color: var(--brick); }
.btn-danger:hover { background: var(--bad-bg); color: var(--brick); border-color: var(--brick); }
.btn[disabled] { opacity: 0.45; cursor: default; pointer-events: none; }
.btn-link { background: none; border: 0; padding: 0; color: var(--pine-2); text-decoration: underline; font: inherit; cursor: pointer; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: #1D4A2E; }
.pill-warn { background: var(--warn-bg); color: #664600; }
.pill-bad { background: var(--bad-bg); color: #7A2017; }
.pill-idle { background: var(--idle-bg); color: var(--mist); }

.pager { display: flex; gap: 10px; align-items: center; margin-top: 4px; }

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 36px)); }
.toast { background: var(--pine); color: #fff; padding: 10px 14px; border-radius: 8px; border-left: 6px solid #86C99E; box-shadow: 0 10px 26px -10px rgba(0, 0, 0, 0.45); }
.toast-bad { border-left-color: #F08B7D; }
.toast-info { border-left-color: var(--marigold); }

/* ---- Landing ------------------------------------------------------ */
.landing { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.landing-inner { width: min(760px, 100%); }
.landing h1 { font-size: 2.4rem; }
.landing-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.landing-choice { display: block; background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 22px; text-decoration: none; color: var(--pine); }
.landing-choice:hover { border-color: var(--pine); }
.landing-choice b { display: block; font-size: 1.3rem; margin-bottom: 6px; }
.landing-choice span { color: var(--mist); }

/* ---- Dashboard ---------------------------------------------------- */
.dash-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dash-head h1 { margin-bottom: 12px; }
.dash-hero {
  display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr); gap: 18px 40px; align-items: end;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 22px 24px; margin-bottom: 16px;
}
.hero-value { display: block; font-size: 3.6rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero-label { display: block; color: var(--mist); margin-top: 6px; }
.hero-meter { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.hero-meter .meter { flex: 1; height: 14px; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; }
.stat dt { color: var(--mist); font-size: 0.88rem; }
.stat dd { margin: 2px 0 0; font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.meter { height: 10px; border-radius: 6px; background: var(--pine-track); overflow: hidden; }
.meter > span { display: block; height: 100%; width: 0; background: var(--pine); border-radius: 4px; transition: width 0.4s ease; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 16px; align-items: start; }
.dash-grid .panel { margin: 0; }
.dash-wide { grid-column: 1 / -1; }
.type-row td { vertical-align: middle; }
.type-row .meter { min-width: 120px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--mist); font-variant-numeric: tabular-nums; }
.problem { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.problem:last-child { border-bottom: 0; }

/* ---- Attendee ----------------------------------------------------- */
.att-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.badge-preview-wrap { background: var(--granite); border-radius: 8px; padding: 18px; margin-bottom: 14px; }
#badge-preview { max-width: 420px; margin: 0 auto; }
#badge-preview .badge-canvas { margin: 0 auto; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 12px 26px -14px rgba(23, 58, 52, 0.45); }
.att-status select { width: auto; min-width: 12rem; }

/* ---- Badge designer ----------------------------------------------- */
.be { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 16px; align-items: start; }
.be-main { position: sticky; top: 12px; min-width: 0; }
.be-stage {
  display: flex; align-items: center; justify-content: center; min-height: 380px; padding: 24px;
  border: 1px solid var(--rule); border-radius: 10px;
  background: repeating-conic-gradient(#DCE4E1 0% 25%, #E9EEEC 0% 50%) 50% / 22px 22px;
}
#be-canvas .badge-canvas { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15), 0 16px 32px -16px rgba(23, 58, 52, 0.55); touch-action: none; }
#be-canvas .badge-el { cursor: move; }
#be-canvas .badge-el:hover { outline: 1px dashed rgba(23, 58, 52, 0.55); }
#be-canvas .badge-el.is-selected { outline: 2px solid var(--marigold-2); z-index: 5; }
.badge-empty { border: 1px dashed #93A6A0; color: #6F837D; font: 11px/1.2 var(--font); display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.be-handle { position: absolute; right: -6px; bottom: -6px; width: 13px; height: 13px; background: var(--marigold); border: 2px solid var(--pine); border-radius: 2px; cursor: nwse-resize; }
.be-safe { position: absolute; border: 1px dashed rgba(169, 50, 38, 0.55); pointer-events: none; z-index: 6; }
.be-side .panel { margin-bottom: 12px; }
.be-list { list-style: none; margin: 0 0 12px; padding: 0; }
.be-list li { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); padding: 2px 0; }
.be-list li.is-selected { background: var(--warn-bg); }
.be-pick { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 7px 6px; font: inherit; color: inherit; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.be-props-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 8px; }
.be-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.be-props-grid .field { margin-bottom: 10px; }
.be-props-grid .field > span { font-size: 0.85rem; }
.be-map-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px auto; gap: 6px; margin-bottom: 6px; align-items: center; }
.be-test { margin-top: 14px; }

@media (max-width: 1000px) {
  .be, .att-layout, .dash-hero { grid-template-columns: 1fr; }
  .be-main { position: static; }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .page { padding: 16px; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .hero-value { font-size: 2.8rem; }
  .who span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .meter > span { transition: none; }
}
