/* Werty Clippers — crew accreditation world: maroon shell, orange crew band, royal blue for links/focus.
   Flat colour only; no gradients, no decorative shadows. */

@font-face {
  font-family: "Archivo";
  src: url("/static/fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 400 800; font-stretch: 62% 125%; 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  src: url("/static/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 400 800; font-stretch: 62% 125%; 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;
}

:root {
  --maroon: #5b0e14;
  --maroon-ink: #f7e9e4;
  --orange: #f26b1d;          /* band fills, with dark ink on top */
  --orange-deep: #b8410c;     /* buttons with white text (5.3:1) */
  --orange-deeper: #973509;
  --blue: #1e3a8a;
  --paper: #f6f3ee;
  --card: #fffdfa;
  --ink: #1c1917;
  --muted: #625750;
  --line: #e2d9cd;
  --line-strong: #cbbfb0;
  --ok: #15803d;
  --ok-bg: #e7f4ea;
  --off: #6f6863;
  --off-bg: #eeeae5;
  --err: #a61b1b;
  --err-bg: #fbe9e7;
  --warn-bg: #fdf0dc;
  --radius: 10px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.5 var(--font); font-stretch: 100%;
}
::selection { background: var(--orange); color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
a { color: var(--blue); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5rem; text-wrap: balance; }
h1 { font-size: 1.75rem; font-weight: 800; font-stretch: 85%; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; font-weight: 700; margin-top: 2rem; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1rem; max-width: 68ch; }
.num, td.num, .amount, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.skip { position: absolute; left: -999px; top: 0; background: var(--card); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* Shell */
.shell { background: var(--maroon); color: var(--maroon-ink); }
.shell-in { max-width: 1120px; margin: 0 auto; padding: .625rem 1rem; display: flex; align-items: center; gap: 1rem; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: .5rem; color: inherit; text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--orange); }
.wordmark { font-weight: 800; font-stretch: 70%; font-size: 1.375rem; letter-spacing: .02em; }
.brand-sub { font-size: .875rem; opacity: .85; padding-left: .5rem; border-left: 1px solid rgb(247 233 228 / .35); }
.shell nav { display: flex; align-items: center; gap: .25rem; }
.shell nav a, .shell .linklike { color: var(--maroon-ink); text-decoration: none; padding: .5rem .625rem; border-radius: 6px; font: 600 .9375rem var(--font); }
.shell nav a:hover, .shell .linklike:hover { background: rgb(255 255 255 / .1); }
.shell nav form { margin: 0; }
.shell .linklike { background: none; border: 0; cursor: pointer; }
@media (max-width: 480px) {
  .brand-sub { display: none; }
  .shell-in { gap: .5rem; padding-inline: .75rem; }
  .shell nav a, .shell .linklike { padding: .5rem .4rem; }
}
.shell :focus-visible { outline-color: var(--orange); }

.wrap { max-width: 720px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.wrap.wide { max-width: 1120px; }

/* Flash */
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin: 0 0 1.25rem; max-width: none; font-weight: 500; }
.flash-ok { background: var(--ok-bg); color: #0f5a2b; }
.flash-error { background: var(--err-bg); color: var(--err); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .625rem 1.125rem; border-radius: 8px; border: 1px solid transparent;
  font: 700 1rem var(--font); text-decoration: none; cursor: pointer;
  background: var(--orange-deep); color: #fff; transition: background-color .15s ease-out;
}
.btn:hover { background: var(--orange-deeper); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: var(--card); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: #f1ebe3; }
.btn-danger { background: var(--card); color: var(--err); border-color: #e5b4ae; }
.btn-danger:hover { background: var(--err-bg); }
.btn-discord { background: #5865f2; }
.btn-discord:hover { background: #4752c4; }
.btn-sm { min-height: 34px; padding: .3rem .75rem; font-size: .875rem; }
.btn svg { width: 20px; height: 20px; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Forms */
form.stack { display: grid; gap: 1.25rem; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 1rem; }
legend { font-weight: 700; font-size: 1.125rem; margin-bottom: .75rem; padding: 0; }
.field { display: grid; gap: .375rem; }
.field label, .label { font-weight: 600; font-size: .9375rem; }
.hint { font-size: .8125rem; color: var(--muted); margin: 0; }
input[type="text"], input[type="url"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; min-height: 44px; padding: .625rem .75rem; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--card); color: var(--ink); font: 400 1rem var(--font);
}
textarea { min-height: 7rem; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: #857a72; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
input[aria-invalid="true"] { border-color: var(--err); }
.check { display: flex; gap: .625rem; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin-top: .125rem; accent-color: var(--orange-deep); flex: none; }

/* Choice tiles (creator, payout method) */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; }
.choice { position: relative; display: flex; gap: .625rem; align-items: center; padding: .75rem .875rem; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); cursor: pointer; font-weight: 600; }
.choice input { accent-color: var(--orange-deep); width: 18px; height: 18px; margin: 0; }
.choice:has(input:checked) { border-color: var(--orange-deep); box-shadow: inset 0 0 0 1px var(--orange-deep); background: #fff6ef; }
.choice:has(input:disabled) { cursor: not-allowed; color: var(--muted); background: transparent; border-style: dashed; }
.choice .soon { white-space: nowrap; font-weight: 500; font-size: .8125rem; margin-left: auto; }
.choice:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }

/* Payout groups switch with the radio (works without JS: both shown) */
.payout-group { display: grid; gap: 1rem; padding: 1rem; border-radius: var(--radius); background: #fbf8f4; border: 1px solid var(--line); }
.js .payout-group[hidden] { display: none; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.panel + .panel { margin-top: 1rem; }

/* Signature: the crew pass */
.pass {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; align-items: center;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden;
  padding: 1.75rem 1.25rem 0; margin-bottom: 1.5rem;
  box-shadow: 0 6px 18px -10px rgb(60 20 10 / .35);
}
.pass::before { /* lanyard slot */
  content: ""; position: absolute; top: .625rem; left: 50%; width: 56px; height: 8px; transform: translateX(-50%);
  border-radius: 4px; background: var(--paper); box-shadow: inset 0 1px 2px rgb(0 0 0 / .18);
}
.pass-photo { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--off-bg); grid-row: span 2; }
.pass-org { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--maroon); }
.pass-name { font-size: 1.25rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.pass-number {
  grid-column: 1 / -1; font-weight: 800; font-stretch: 62%; line-height: .9; letter-spacing: -0.02em;
  font-size: clamp(4.5rem, 22vw, 7rem); font-variant-numeric: tabular-nums; color: var(--ink); margin: .75rem 0 .25rem;
}
.pass-number small { font-size: .32em; font-stretch: 85%; font-weight: 700; color: var(--muted); letter-spacing: 0; margin-left: .25rem; vertical-align: .9em; }
.pass-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: .875rem; color: var(--muted); padding-bottom: 1rem; }
.pass-band {
  grid-column: 1 / -1; margin: 0 -1.25rem; padding: .625rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  font-weight: 800; font-stretch: 75%; font-size: 1.125rem; letter-spacing: .08em; text-transform: uppercase;
}
.pass-band.active { background: var(--orange); color: var(--ink); }
.pass-band.removed { background: var(--off-bg); color: var(--off); }
.pass-band .btn { letter-spacing: 0; text-transform: none; font-stretch: 100%; }
.pass-band.active .btn { background: var(--ink); color: #fff; }
.pass-band.active .btn:hover { background: #000; }
.passes { display: grid; gap: 1rem; }
@media (min-width: 640px) { .passes.two { grid-template-columns: 1fr 1fr; } }

/* Definition lists */
dl.facts { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .5rem 1.25rem; margin: 0; }
dl.facts dt { color: var(--muted); font-size: .9375rem; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { dl.facts { grid-template-columns: 1fr; gap: .125rem; } dl.facts dd { margin-bottom: .5rem; } }
.prewrap { white-space: pre-wrap; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8125rem; font-weight: 700; color: var(--muted); background: #f8f4ee; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
tbody tr:hover { background: #fcf7f1; }
tfoot td { font-weight: 800; border-top: 1px solid var(--line-strong); border-bottom: 0; }
.table-empty { padding: 1.5rem; color: var(--muted); }

/* Badges */
.tab-no { display: inline-block; min-width: 2.5rem; padding: .125rem .375rem; border-radius: 4px; background: var(--orange); color: var(--ink); font-weight: 800; font-stretch: 70%; text-align: center; font-variant-numeric: tabular-nums; }
.status { display: inline-flex; align-items: center; gap: .375rem; font-weight: 600; font-size: .875rem; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.active { color: var(--ok); }
.status.removed { color: var(--off); }
.tag { white-space: nowrap; display: inline-block; padding: .125rem .5rem; border-radius: 999px; background: var(--warn-bg); color: #7a4a06; font-size: .8125rem; font-weight: 600; }

/* Admin */
.admin-nav { display: flex; gap: .25rem; border-bottom: 1px solid var(--line-strong); margin: 0 0 1.5rem; overflow-x: auto; }
.admin-nav a { padding: .625rem .875rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.admin-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--orange-deep); }
.admin-nav a:hover { color: var(--ink); }
.count { display: inline-block; margin-left: .25rem; padding: 0 .375rem; border-radius: 999px; background: var(--maroon); color: #fff; font-size: .75rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: 1rem; }
.filters .field { flex: 1 1 12rem; }
.filters select { width: auto; }
.inline-form { display: inline; margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: .375rem; justify-content: flex-end; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; align-items: end; }
details.edit summary { cursor: pointer; color: var(--blue); font-size: .875rem; }
details.edit[open] { padding: .5rem 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1rem; }

.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.login-card { max-width: 420px; margin: 2rem auto; }
.login-card h1 { font-size: 2rem; }

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