/* Team Nouri Fighting – Mitgliederverwaltung
   Schwarz für Kopf und Navigation (Logo sitzt auf Schwarz), Rot als Aktionsfarbe, Gelb als Akzent. Systemschriften, keine externen Fonts. */
:root {
  --black: #0b0b0b; --ink: #17181b; --muted: #61646c; --line: #e2e2df; --bg: #f3f3f0; --surface: #fff; --surface-2: #f8f8f6;
  --red: #d4200f; --red-dark: #a91808; --yellow: #ffc61a; --yellow-soft: #fff4cc;
  --ok: #157a42; --ok-soft: #e2f3e8; --warn: #8f5a00; --warn-soft: #fcefd6; --bad: #c0182b; --bad-soft: #fbe2e4; --neutral-soft: #ececea; --accent-soft: #fde4e0;
  --r: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Arial Black", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--red); }
h1, h2, h3 { line-height: 1.15; margin: 0; }
h1 { font-family: var(--display); font-size: clamp(24px, 4vw, 32px); letter-spacing: -.01em; }
h2 { font-size: 18px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 0 10px; }
code { font-family: var(--mono); font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; overflow-wrap: anywhere; }
code.block { display: block; margin: 6px 0 12px; padding: 8px 10px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Buttons & Pills */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #cfcfca; background: var(--surface); color: var(--ink); border-radius: 8px; padding: 10px 16px; font: 600 15px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 44px; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.danger { color: var(--bad); border-color: #e8b4b9; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.sm { padding: 6px 12px; font-size: 14px; min-height: 36px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 2px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.neutral { background: var(--neutral-soft); color: var(--muted); }
.pill.accent { background: var(--accent-soft); color: var(--red-dark); }
.flash { border-radius: var(--r); padding: 12px 16px; margin: 0 0 16px; font-size: 15px; background: var(--ok-soft); color: var(--ok); }
.flash.bad { background: var(--bad-soft); color: var(--bad); } .flash.warn { background: var(--warn-soft); color: var(--warn); }
.flash form.inline { display: inline; margin-left: 8px; }

/* Karten & Formulare */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card.flush { padding: 0; }
.card.flush > .card-h { padding: 16px 20px; margin: 0; border-bottom: 1px solid var(--line); }
.card.highlight { border-color: var(--red); box-shadow: inset 4px 0 0 var(--red); margin-bottom: 16px; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form.one { grid-template-columns: minmax(0, 1fr); }
.form > label, .form .full { min-width: 0; }
.form label:not(.check) { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; }
.full { grid-column: 1 / -1; }
input, select, textarea { font: 16px var(--font); color: var(--ink); background: var(--surface); border: 1px solid #cfcfca; border-radius: 8px; padding: 10px 12px; width: 100%; min-height: 44px; }
textarea { min-height: 0; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--red); }
input[aria-invalid=true] { border-color: var(--bad); background: #fffafa; }
input[readonly] { background: var(--surface-2); color: var(--muted); }
small, .hint { color: var(--muted); font-size: 13px; font-weight: 400; display: block; }
p.hint { margin: 10px 0 0; }
.err { color: var(--bad); font-size: 13px; font-weight: 600; display: block; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { margin-top: 2px; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.w100 { width: 100%; }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.grow-label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; flex: 1 1 180px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack.tight { gap: 10px; }
.dl { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 15px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; overflow-wrap: anywhere; }
.mono { font-family: var(--mono); font-size: 14px; } .small { font-size: 13px; }
.muted { color: var(--muted); } .bad-text { color: var(--bad); }

/* Öffentlicher Bereich */
.pub-top { background: var(--black); color: #fff; display: flex; align-items: center; gap: 16px; padding: 14px max(16px, env(safe-area-inset-left)); padding-top: calc(14px + env(safe-area-inset-top)); }
.pub-logo { height: 54px; width: auto; }
.pub-top b { display: block; font-size: 17px; } .pub-top span { color: #bdbdbd; font-size: 14px; }
.pub-main { max-width: 720px; margin: 0 auto; padding: 20px 16px 40px; }
.pub-main.narrow { max-width: 440px; }
.pub-main > .card + .card { margin-top: 16px; }
.pub-main .card h1 { margin: 10px 0 12px; }
.intro { margin: 0 0 16px; color: var(--muted); }
.pub-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 16px 40px; }
.checks { list-style: none; padding: 0; margin: 0 0 16px; } .checks .ok { color: var(--ok); } .checks .bad { color: var(--bad); font-weight: 700; }
.public .card h2 { margin: 18px 0 12px; } .public .card h2:first-child { margin-top: 0; }

/* Anmeldestrecke */
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 6px; counter-reset: s; }
.steps li { flex: 1; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.steps li::before { content: ""; height: 5px; border-radius: 9px; background: #d9d9d4; }
.steps li.done::before, .steps li.cur::before { background: var(--red); }
.steps li.cur { color: var(--ink); font-weight: 700; }
.step-now { font-weight: 700; font-size: 14px; margin: 4px 0 12px; display: none; }
.signup .card h2 { margin-bottom: 14px; }
.tariffs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.tcard { position: relative; border: 2px solid var(--line); border-radius: var(--r); padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; background: var(--surface); }
.tcard input { position: absolute; opacity: 0; }
.tcard:has(input:checked) { border-color: var(--red); background: #fff7f5; box-shadow: 0 0 0 1px var(--red); }
.tcard:has(input:focus-visible) { outline: 3px solid var(--yellow); outline-offset: 2px; }
.tcard .price { font-family: var(--display); font-size: 26px; line-height: 1.2; }
.tcard .step-note { color: var(--warn); }
.plan { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-top: 16px; }
.plan:empty { display: none; }
.plan-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 15px; }
.plan-row:first-child { border-top: 0; }
.plan-row.first { background: var(--yellow-soft); }
.plan-row b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mandate { font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 12px; }
details.mandate summary { cursor: pointer; }
.checks-list { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.sig-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0 6px; font-size: 14px; }
.sig-wrap { position: relative; border: 2px dashed #9a9a94; border-radius: var(--r); background: #fff; touch-action: none; }
.sig-wrap.invalid { border-color: var(--bad); }
.sig-wrap canvas { display: block; width: 100%; height: 190px; cursor: crosshair; }
.sig-line { position: absolute; left: 24px; right: 24px; bottom: 42px; border-bottom: 1px solid #b5b5b0; pointer-events: none; }
.sig-x { position: absolute; left: 24px; bottom: 46px; color: #b5b5b0; pointer-events: none; }
.sig-preview { max-width: 320px; width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: block; }
.signup .actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 16px 0 calc(8px + env(safe-area-inset-bottom)); margin-top: 8px; }
.signup .actions #back { margin-right: auto; }

/* Interner Bereich */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--black); color: #c9c9c4; padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.menu-btn, .side-title { display: none; }
.side-menu { display: contents; }
.side-brand { display: flex; flex-direction: column; gap: 4px; color: #9a9a95; text-decoration: none; font-size: 12px; padding: 0 6px; }
.side-brand img { width: 150px; height: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #77776f; padding: 12px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 8px; color: #d6d6d0; text-decoration: none; padding: 9px 10px; border-radius: 8px; font-size: 15px; }
.nav a:hover { background: #1d1d1d; color: #fff; }
.nav a[aria-current=page] { background: #1f1f1f; color: #fff; box-shadow: inset 3px 0 0 var(--red); }
.count { margin-left: auto; font-size: 12px; font-weight: 700; border-radius: 99px; padding: 0 8px; line-height: 20px; color: #fff; background: var(--red); }
.count.new { background: var(--yellow); color: #000; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; font-size: 14px; padding: 0 6px; }
.side-foot b { color: #fff; } .side-foot span { font-size: 12px; color: #8a8a84; margin-bottom: 6px; }
.side-foot .btn { color: #c9c9c4; border-color: #333; }
.main { padding: 24px clamp(16px, 3vw, 36px) 80px; min-width: 0; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.sub { color: var(--muted); margin: 6px 0 0; max-width: 75ch; }
.back { font-size: 14px; text-decoration: none; display: inline-block; margin-bottom: 6px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; }
.kpi .l { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.kpi .v { font-family: var(--display); font-size: 26px; font-variant-numeric: tabular-nums; }
.kpi .n { font-size: 13px; color: var(--muted); }
.kpi.alert .v { color: var(--bad); }
.two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.main > .card, .main > .stack, .main > form > .card { margin-bottom: 16px; }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 15px; }
.card:not(.flush) .li { padding-left: 0; padding-right: 0; }
.list .li:first-child { border-top: 0; }
a.li:hover b { color: var(--red); }
.grow { flex: 1; min-width: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; }
tr.click { cursor: pointer; } tr.click:hover td { background: #fbfbf9; }
td a { color: inherit; text-decoration: none; }
table.edit input:not([type=checkbox]), table.edit select { min-height: 38px; padding: 6px 8px; }
table.edit input.n { width: 92px; text-align: right; } table.edit input.s, input.n.s { width: 70px; }
input.n { width: 110px; text-align: right; }
.new-row td { background: var(--surface-2); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search { flex: 1 1 240px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 14px; color: var(--ink); text-decoration: none; background: var(--surface); }
.chip[aria-current=true] { background: var(--black); color: #fff; border-color: var(--black); }
.month-nav { margin-bottom: 14px; font-size: 18px; }
.linkbox { margin-top: 16px; background: var(--yellow-soft); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.linktext { font-family: var(--mono); font-size: 14px; }
.signup-wrap { max-width: 760px; }
.fab { display: none; }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 40; height: auto; padding: 0; gap: 0; overflow: visible; }
  .side-top { display: flex; align-items: center; gap: 12px; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; min-height: 60px; }
  .side-brand img { width: 84px; } .side-brand span { display: none; }
  .side-title { display: block; flex: 1; min-width: 0; color: #fff; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .menu-btn { display: inline-flex; align-items: center; gap: 8px; position: relative; background: #1f1f1f; color: #fff; border: 1px solid #333; border-radius: 10px; padding: 9px 12px; font: 600 15px var(--font); cursor: pointer; min-height: 44px; }
  .menu-icon { display: inline-flex; flex-direction: column; gap: 4px; width: 18px; }
  .menu-icon i { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
  .side.open .menu-icon i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .side.open .menu-icon i:nth-child(2) { opacity: 0; }
  .side.open .menu-icon i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .menu-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); }
  .side.open .menu-dot { display: none; }
  .side-menu { display: none; }
  .side.open .side-menu { display: flex; flex-direction: column; gap: 14px; position: fixed; left: 0; right: 0; top: calc(60px + env(safe-area-inset-top)); bottom: 0; background: var(--black); padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid #222; }
  .side.open .nav a { font-size: 17px; padding: 13px 12px; }
  .side-foot { margin-top: 8px; padding: 16px 12px 0; border-top: 1px solid #222; }
  body.menu-open { overflow: hidden; }
  body.menu-open .fab { display: none; }
  .fab { display: inline-flex; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30; background: var(--red); color: #fff; text-decoration: none; font-weight: 700; padding: 14px 20px; border-radius: 99px; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
}
@media (max-width: 600px) {
  .form { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .dl dd { margin-bottom: 8px; }
  .steps li { font-size: 0; } .step-now { display: block; }
  .pub-logo { height: 42px; }
  .card { padding: 16px; }
  .kpi .v { font-size: 21px; }
  .signup .actions .btn { flex: 1; }
}
.danger-zone { border-color: #efc1c6; }
.danger-zone details[open] > summary { margin-bottom: 4px; }
.flash.warn a, .flash.bad a { color: inherit; }
.stack > .grow-label, form.stack .grow-label { flex: none; }
@media (max-width: 600px) {
  .members-table th:nth-child(2), .members-table td:nth-child(2), .members-table th:nth-child(3), .members-table td:nth-child(3) { display: none; }
  .members-table td, .members-table th { padding-left: 12px; padding-right: 12px; }
}
