:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b1425;
  color: #eff3fa;
  --panel: #142138;
  --border: #2b3e5b;
  --muted: #b3c0d2;
  --surface: #0e192c;
  --club-red: #b71336;
  --club-red-hover: #c51c41;
  --club-accent: #f1738d;
  --red: #f3a2ac;
  --green: #8ae2b4;
}

* { box-sizing: border-box; }
body, h1, p, form { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #a9c8ff; outline-offset: 3px; }
h1 { font-size: clamp(1.55rem, 3vw, 2.05rem); letter-spacing: -.035em; line-height: 1.2; }

.topbar {
  min-height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px max(24px, calc((100vw - 1450px) / 2));
  background: linear-gradient(100deg, #15243e, #101b30 65%);
  border-top: 3px solid var(--club-red);
  border-bottom: 1px solid var(--border);
}
.brand, .account { display: flex; align-items: center; gap: 12px; }
.brand { font-size: 1.02rem; font-weight: 720; line-height: 1.28; min-width: 0; }
.brand small { display: block; font-size: .78rem; color: var(--muted); font-weight: 500; }
.club-crest {
  display: block;
  aspect-ratio: 1.10;
  object-fit: cover;
  object-position: center 35%;
}
.brand-crest { width: 55px; flex: 0 0 auto; }
.account { color: var(--muted); font-size: .87rem; }
.account > span { overflow-wrap: anywhere; }

.shell {
  max-width: 1498px;
  margin: 0 auto;
  padding: 28px 24px 44px;
  display: grid;
  grid-template-columns: 201px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.sidebar, .panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.sidebar { padding: 8px; display: grid; gap: 4px; }
.sidebar a { padding: 10px 12px; border-radius: 7px; color: var(--muted); font-size: .92rem; }
.sidebar a:hover { color: #fff; background: #23354e; }
.sidebar a[aria-current] { color: #fff; background: #322039; box-shadow: inset 3px 0 var(--club-accent); font-weight: 650; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid #3b506c;
  border-radius: 7px;
  background: #22344b;
  color: #eef4fc;
  font-size: .88rem;
  font-weight: 620;
  white-space: nowrap;
}
.button:hover { background: #304861; }
.button:disabled { opacity: .5; cursor: default; }
.primary { background: var(--club-red); border-color: #d33857; color: #fff; }
.primary:hover { background: var(--club-red-hover); }
.small { padding: 5px 9px; font-size: .79rem; }

.toolbar, .table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 13px 16px;
}
.filters, .search, .pagination { display: flex; align-items: center; gap: 7px; }
.section-tabs { margin-bottom: 14px; }
.filters a { border: 1px solid transparent; padding: 7px 10px; border-radius: 7px; color: var(--muted); font-size: .87rem; }
.filters a:hover, .filters a[aria-current] { background: #22344b; color: #fff; border-color: #364c68; }
.filters span { margin-left: 3px; color: #bccce0; font-variant-numeric: tabular-nums; font-size: .76rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; text-align: left; }
thead { background: #17273d; color: #bdcbe0; }
th { font-size: .78rem; font-weight: 680; }
td, th { padding: 10px 14px; border-top: 1px solid var(--border); }
th:first-child, td:first-child { padding-left: 17px; }
th:last-child, td:last-child { padding-right: 17px; }
.register > .table-scroll:first-child thead th { border-top: 0; }
.register > .table-scroll:first-child { border-radius: 11px; }
tbody tr:hover { background: #1a2b42; }
.numeric, .email, .muted { color: var(--muted); }
.numeric, .table-footer { font-variant-numeric: tabular-nums; }
.fee { font-variant-numeric: tabular-nums; white-space: nowrap; }
.contribution { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; font-size: .88rem; }
.member-name { font-weight: 650; white-space: nowrap; }
.member-name a:hover, .back:hover { text-decoration: underline; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .77rem; white-space: nowrap; color: var(--muted); }
.status::before { content: ""; background: currentColor; width: 6px; height: 6px; border-radius: 50%; }
.status.active { color: var(--green); }
.row-action { text-align: right; }
.empty { color: var(--muted); text-align: center; padding: 32px; }
.table-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .79rem; min-height: 55px; }

.back { display: inline-block; color: var(--muted); margin-bottom: 10px; font-size: .88rem; }
.form-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-panel { min-inline-size: 0; padding: 12px 16px 16px; margin: 0; }
.form-panel legend { padding: 0 5px; font-size: 1rem; font-weight: 680; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; row-gap: 13px; }
.field-wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 5px; font-size: .83rem; font-weight: 600; }
.checkbox-field { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 6px; }
.checkbox-field label { margin-bottom: 0; }
input:where(:not([type="hidden"], [type="checkbox"])), select, textarea {
  width: 100%;
  min-width: 0;
  background: var(--surface);
  color: #f5f8ff;
  border: 1px solid #3a506b;
  border-radius: 7px;
  min-height: 36px;
  padding: 7px 9px;
  font-size: .9rem;
}
input::placeholder { color: #a2b0c5; }
.search input { width: 248px; }
textarea { resize: vertical; }
.help { margin-top: 6px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.help ul, .errorlist { padding-left: 17px; margin: 5px 0; }
.errorlist { color: var(--red); font-size: .86rem; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.messages { color: var(--green); background: #142c2b; border: 1px solid #28514a; border-radius: 8px; padding: 10px 13px; margin-bottom: 16px; }
.narrow { max-width: 480px; padding: 20px; }
.edit-panel { max-width: 690px; padding: 20px; }
.mail-editor { max-width: 850px; }
.mail-editor textarea { font-family: ui-monospace, monospace; }
.text-link { text-decoration: underline; }
#mail-preview { margin-top: 9px; display: block; width: 100%; height: 290px; border: 1px solid var(--border); border-radius: 7px; background: white; }
.trip-summary { margin-bottom: 18px; padding: 15px 17px; }
.trip-summary dl { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 0; }
.trip-summary dt { color: var(--muted); font-size: .78rem; }
.trip-summary dd { margin: 4px 0 0; font-size: .9rem; }
.trip-notes { margin-top: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.trip-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.fare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fare-group { min-inline-size: 0; margin: 0; padding: 10px 12px 12px; border: 1px solid var(--border); border-radius: 8px; }
.fare-group legend { padding: 0 4px; font-weight: 650; }
.fare-group .field + .field { margin-top: 9px; }
.toolbar h2 { font-size: 1.04rem; margin: 0; }
.danger { color: #ffd3d7; background: #59303e; border-color: #8f5260; }
.danger:hover { background: #723544; }
.sepa-release { margin-top: 16px; }
.sepa-release summary { cursor: pointer; }
.sepa-release form { margin-top: 12px; }
.mfa-qr { display: block; max-width: 100%; height: auto; border-radius: 7px; }
.mfa-key { display: inline-block; margin-top: 8px; overflow-wrap: anywhere; }
.recovery-codes { list-style: none; margin: 0; padding: 12px; background: var(--surface); border-radius: 7px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; }
.form-stack { display: grid; gap: 15px; }
.form-stack h2 { margin: 0; font-size: 1.05rem; }
.form-stack .button { justify-self: start; }
.login-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 30px 18px;
  background: radial-gradient(ellipse at 24% 23%, #18294a 0%, #0b1425 62%);
}
.login-layout {
  width: min(850px, 100%);
  min-height: 425px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 4px solid var(--club-red);
  border-radius: 20px;
  box-shadow: 0 20px 65px #03081180;
}
.login-brand {
  position: relative;
  isolation: isolate;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 26px;
  text-align: center;
  border-right: 1px solid var(--border);
  background: radial-gradient(ellipse at 50% 42%, #243e69, #101e36 73%);
}
.login-brand::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: repeating-linear-gradient(45deg, transparent 0 25px, #7da2d913 25px 27px),
              repeating-linear-gradient(-45deg, transparent 0 25px, #7da2d913 25px 27px);
  mask-image: linear-gradient(135deg, black, transparent 90%);
}
.login-crest { width: clamp(145px, 24vw, 205px); }
.login-brand strong { display: block; font-size: clamp(1.05rem, 2.3vw, 1.48rem); letter-spacing: -.025em; }
.login-brand small { display: block; margin-top: 5px; color: var(--muted); font-size: .87rem; }
.login-panel { align-self: center; min-width: 0; padding: clamp(24px, 5vw, 48px); border: 0; background: transparent; }
.login-panel h1 { margin-bottom: 23px; }
.login-panel .button { justify-self: stretch; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 920px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .sidebar { display: flex; flex-wrap: wrap; }
}
@media (max-width: 620px) {
  .topbar, .shell { padding-left: 12px; padding-right: 12px; }
  .shell { padding-top: 16px; }
  .form-panels { grid-template-columns: minmax(0, 1fr); }
  .fare-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar, .table-footer { padding-left: 11px; padding-right: 11px; }
  .search { width: 100%; }
  .search input { flex: 1 1 auto; width: auto; }
  .account > span { display: none; }
  .brand { gap: 8px; font-size: .88rem; }
  .brand-crest { width: 43px; }
  .login-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; max-width: 420px; }
  .login-brand { padding: 20px 16px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--border); }
  .login-crest { width: 125px; }
  .login-panel h1 { margin-bottom: 18px; }
}
