/* BikerVote admin - dark surface. Values only from
   .claude/skills/bikervote-design/tokens.md. Operator tool: utilitarian,
   dense, no ornament. Yellow (--scrut) is the only primary/live colour;
   red (--flag) appears on destructive actions only. */

:root{
  --asphalt: #101316;
  --slate:   #1A2026;
  --line:    #262E35;
  --plate:   #EFEDE6;
  --ink:     #0B0E10;
  --scrut:   #F2C230;
  --flag:    #C4341F;
  --steel:   #7A848C;

  --display: 'Archivo', system-ui, sans-serif;
  --body:    'IBM Plex Sans', system-ui, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, monospace;
}

*{ box-sizing: border-box; border-radius: 0 !important; box-shadow: none !important; }

html{ background: var(--asphalt); }

body{
  background: var(--asphalt);
  color: var(--plate);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  padding: 22px;
  max-width: 1100px;
  margin-inline: auto;
}

h1, h2{
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -.02em;
  margin: 0 0 16px;
}

h1{ font-size: 30px; }
h2{ font-size: 22px; margin-top: 34px; }

p{ margin: 0 0 12px; }

a{ color: var(--steel); }
a:hover, a:focus-visible{ color: var(--plate); }

a:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, button:focus-visible{
  outline: 2px solid var(--scrut);
  outline-offset: 2px;
}

small, .meta{
  display: block;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
  color: var(--steel);
}

/* --- Nav --------------------------------------------------------------- */

.nav{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 10px;
  gap: 16px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 22px;
}
.nav a{
  color: var(--steel);
  text-decoration: none;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
}
.nav a:hover, .nav a:focus-visible{ color: var(--plate); }
.nav a.active{ color: var(--scrut); }
.nav form{ margin-left: auto; }

/* --- Tables -------------------------------------------------------------- */

.table{
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}
.table th, .table td{
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table th{
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
  color: var(--steel);
  font-weight: 400;
}
.table td.empty{ color: var(--steel); font-family: var(--mono); }
.table td.num{ text-align: right; }

/* Dense tables get a horizontal scroll wrapper on small screens rather than
   collapsing or wrapping into unreadable columns (mobile.md, "Admin on a
   phone"). The page itself never scrolls sideways - only the wrapper does. */
.table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap .table{ white-space: nowrap; }

/* The action column (Edit/Delete, Print sheet, ...) stays reachable without
   swiping the wrapper - it pins to the right edge of the viewport instead of
   scrolling off with the rest of the row. */
.table-wrap .table th:last-child,
.table-wrap .table td:last-child{
  position: sticky;
  right: 0;
  background: var(--asphalt);
  border-left: 1px solid var(--line);
}

/* --- Forms ---------------------------------------------------------------- */

.form-row{ display: flex; gap: 12px; margin-bottom: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-row.inline{ display: inline-flex; margin-bottom: 0; }

/* A row with one full-width field (e.g. the pasted-CSV textarea) rather than
   several side-by-side inputs - stretches its label to the row's full width
   at every viewport, not only below 600px. */
.form-row.stack{ flex-direction: column; align-items: stretch; }

/* Stacked action forms (e.g. Open voting / Close voting) get breathing room
   so a thumb reaching for one under pressure doesn't clip the other. */
form + form{ margin-top: 8px; }

.form-row label{
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  color: var(--steel);
}

.form-row input, .form-row select, .form-row textarea{
  background: var(--slate);
  color: var(--plate);
  border: 1px solid var(--line);
  padding: 8px 12px;
  font-family: var(--body);
  font-size: 15px;
  min-height: 44px;
  max-width: 100%;
}

.form-row input[type="file"]{ padding: 6px 0; border: none; background: none; min-height: 44px; }

/* Pasted CSV rows - monospace so columns line up, and full width since it
   is the primary import path (mobile.md, "Admin on a phone" - functional,
   not decorative, on a phone at the desk). Resizable vertically only so a
   wide row cannot introduce page-level horizontal scroll. */
.form-row textarea{
  font-family: var(--mono);
  font-size: 13px;
  width: 100%;
  resize: vertical;
}

/* Below 600px, stack form fields one per row instead of letting a wide
   fixed-size field (e.g. the event-title input) push past the viewport. */
@media (max-width: 600px){
  .form-row label{
    flex: 1 1 100%;
    min-width: 0;
  }
  .form-row input, .form-row select{
    width: 100%;
  }
}

/* --- Inline error message (operator-facing, sentence case) --------------- */

.error{
  color: var(--flag);
  border: 1px solid var(--flag);
  padding: 8px 12px;
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .02em;
  text-transform: none;
}

/* --- Buttons --------------------------------------------------------------- */

.btn{
  background: var(--scrut);
  color: var(--ink);
  border: none;
  padding: 10px 16px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  line-height: 1.4;
}
.btn:hover{ background: var(--plate); }

.btn-danger{ background: var(--flag); color: var(--plate); }
.btn-danger:hover{ background: var(--plate); color: var(--flag); }

.btn:disabled{
  background: var(--line);
  color: var(--steel);
  cursor: not-allowed;
}
.btn:disabled:hover{ background: var(--line); }

/* --- Status chips (voting open/closed, published/unpublished) ------------- */

.state{
  display: inline-block;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  color: var(--steel);
}
.state-live{ color: var(--scrut); border-color: var(--scrut); }

/* --- Notice (anomaly panel disclaimer) -------------------------------------- */

/* Steel, not flag - this is a caveat about how to read the page, not a
   destructive action or an alarm. Nothing on the anomaly panel is proof of
   anything, and its framing must not borrow the vocabulary of the one colour
   reserved for "stopped/destructive". */
.notice{
  border: 1px solid var(--steel);
  padding: 16px;
  margin-bottom: 22px;
}
.notice p{ margin: 0; }
.notice p + p{ margin-top: 8px; }

/* --- Stat figure (single-number callouts: median, fast-ballot count) ------- */

.stat{
  display: inline-block;
  font-family: var(--display);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  font-size: 44px;
  color: var(--plate);
  margin-right: 8px;
}

/* --- Danger zone (reset) ---------------------------------------------------- */

.danger-zone{
  border: 1px solid var(--flag);
  padding: 16px;
  margin-top: 12px;
}

/* --- Bike photo thumbnail --------------------------------------------------- */

/* contain, not cover, and 4:3 rather than a square: the operator is checking
   they uploaded the right photo, so it has to show the whole frame. A square
   box with object-fit:cover cropped the sides off every landscape photo. */
.photo{
  width: 280px;
  height: 210px;
  object-fit: contain;
  background: var(--slate);
  border: 1px solid var(--line);
  display: block;
  margin-bottom: 12px;
}

/* --- Login / status page ---------------------------------------------------- */

.status-page{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 44px);
  gap: 16px;
  text-align: center;
}
.status-page .form-row{ flex-direction: column; align-items: stretch; }
.status-page .error{ text-align: left; }

@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}
