/* ============================================================
   VBC Ebikon · Beleg-Tool
   Schwarz wie das Vereinslogo, Papier als Fläche, Farbe nur
   dort, wo sie einen Status bedeutet. Das Netzraster aus dem
   Logo trägt den Kopfbereich, der Beleg auf der Schlussseite
   ist das Stück, das man weiterschickt.
   ============================================================ */

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/fonts/plex-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/fonts/plex-mono-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fafaf8;
  --card: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #4a4a46;
  --ink-3: #86867f;
  --rule: #e3e3dd;
  --rule-strong: #c7c7bf;
  --net: #e8e8e1;

  --open: #9a5209;
  --open-soft: #fbf2e6;
  --paid: #14663a;
  --paid-soft: #eaf2ec;
  --alert: #a3211c;
  --alert-soft: #fbeceb;

  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --shell: 40rem;
  --shell-wide: 74rem;
  --radius: 12px;
  --radius-sm: 8px;

  --shadow: 0 1px 2px rgb(11 11 11 / 0.04), 0 8px 24px -12px rgb(11 11 11 / 0.12);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ------------------------------------------------------------ Grundlagen */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }

a { color: inherit; }

button, input, textarea, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
}
.skip:focus { left: 0; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 5vw, 2rem);
}
.shell--narrow { max-width: 34rem; }
.shell--wide { max-width: var(--shell-wide); }

main { flex: 1 0 auto; padding-bottom: 4rem; }

/* ------------------------------------------------------------ Typografie */

.eyebrow {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.eyebrow--ok { color: var(--paid); }
.eyebrow--alert { color: var(--alert); }
.eyebrow__tick { width: 0.85em; height: 0.85em; }

.intro { padding-block: clamp(2rem, 7vw, 3rem) 1.75rem; }
.intro--centered { text-align: center; }
.intro--centered .eyebrow { justify-content: center; }

.intro__title {
  font-size: clamp(2rem, 7.5vw, 2.85rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.03;
  margin-block: 0.55rem 0.75rem;
  text-wrap: balance;
}

.intro__lede {
  color: var(--ink-2);
  font-size: 1.0625rem;
  max-width: 34rem;
  text-wrap: pretty;
}
.intro--centered .intro__lede { margin-inline: auto; }

.link {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.link:hover { text-decoration-thickness: 2px; }
.link--quiet {
  color: var(--ink-2);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: 0.9375rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link--quiet:hover { color: var(--ink); }

/* ------------------------------------------------------------ Kopfbereich */

.masthead {
  position: relative;
  border-bottom: 1px solid var(--rule);
  background: var(--card);
  overflow: hidden;
}

/* Das Netz aus dem Logo, nach unten ausgeblendet. */
.masthead__net {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(to right, var(--net) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(to bottom, var(--net) 0 1px, transparent 1px 36px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 96%);
}

.masthead .shell { position: relative; }

.masthead__logo {
  width: min(190px, 46vw);
  padding-block: 1.4rem;
}

.siteFooter {
  flex: 0 0 auto;
  border-top: 1px solid var(--rule);
  padding-block: 1.5rem 2.25rem;
  color: var(--ink-3);
  font-size: 0.8125rem;
}
.siteFooter__line { margin: 0; }
.siteFooter__contact { margin-top: 0.2rem; }
.siteFooter a { color: var(--ink-2); }

/* ------------------------------------------------------------ Hinweise */

.notice {
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
  border: 1px solid;
}
.notice--alert { background: var(--alert-soft); border-color: #efd0ce; color: var(--alert); }
.notice--ok { background: var(--paid-soft); border-color: #cfe2d5; color: var(--paid); }

/* ------------------------------------------------------------ Formular */

.form { display: flex; flex-direction: column; gap: 0.9rem; }

.block {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 4vw, 1.5rem);
}

.block__title {
  font-size: 1.1875rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-block: 0.45rem 1.1rem;
}

.field { margin-bottom: 1rem; }
.field:last-child { margin-bottom: 0; }

.field__label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin-bottom: 0.4rem;
}

.field__input {
  width: 100%;
  /* 17px verhindert, dass iOS beim Antippen hineinzoomt. */
  font-size: 1.0625rem;
  padding: 0.72rem 0.85rem;
  background: var(--paper);
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.field__input::placeholder { color: #a9a9a1; }
.field__input:hover { border-color: #b0b0a7; }
.field__input:focus {
  background: var(--card);
  border-color: var(--ink);
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.field__input--mono {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.field__input--area { resize: vertical; line-height: 1.5; }

.field__hint {
  font-size: 0.8125rem;
  color: var(--ink-3);
  margin-top: 0.35rem;
}

.fieldError {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--alert);
  margin-top: 0.35rem;
}
.fieldError:empty { display: none; }

.field.is-invalid .field__input,
.field__input[aria-invalid='true'] {
  border-color: var(--alert);
  background: var(--alert-soft);
}

.row { display: grid; gap: 0 0.75rem; }
/* Ab iPhone-SE-Breite stehen Vor- und Nachname nebeneinander – das kürzt das Formular spürbar. */
@media (min-width: 23rem) {
  .row { grid-template-columns: 1fr 1fr; }
}

.amount { position: relative; display: flex; align-items: stretch; }
.amount__currency {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-3);
  pointer-events: none;
}
.amount__input {
  padding-left: 3.4rem;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.125rem;
}

/* ------------------------------------------------------------ Auswahlkarten */

.choices { display: grid; gap: 0.6rem; }
.choices > .field__label { margin-bottom: 0.15rem; }

.choice {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.9rem 1rem;
  background: var(--paper);
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.choice:hover { border-color: #b0b0a7; }

.choice__radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.choice__box {
  width: 20px;
  height: 20px;
  margin-top: 0.15rem;
  border: 1.5px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--card);
  display: grid;
  place-items: center;
  transition: border-color 0.15s var(--ease);
}
.choice__box::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
  transform: scale(0);
  transition: transform 0.16s var(--ease);
}

.choice__title { display: block; font-weight: 600; letter-spacing: -0.01em; }
.choice__desc {
  display: block;
  font-size: 0.875rem;
  color: var(--ink-2);
  margin-top: 0.15rem;
}

.choice:has(.choice__radio:checked) {
  border-color: var(--ink);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.choice:has(.choice__radio:checked) .choice__box { border-color: var(--ink); }
.choice:has(.choice__radio:checked) .choice__box::after { transform: scale(1); }
.choice:has(.choice__radio:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.choices.is-invalid .choice { border-color: var(--alert); }

/* ------------------------------------------------------------ Upload */

.drop {
  position: relative;
  border: 1.5px dashed var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.drop:hover, .drop.is-over { border-color: var(--ink); background: var(--card); }
.drop.is-invalid { border-color: var(--alert); background: var(--alert-soft); }

.drop__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.drop__input:focus-visible + .drop__label {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: var(--radius);
}

.drop__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: clamp(1.6rem, 6vw, 2.25rem) 1rem;
  cursor: pointer;
  pointer-events: none;
}
.drop__icon { width: 32px; height: 32px; color: var(--ink); margin-bottom: 0.3rem; }
.drop__title { font-weight: 600; letter-spacing: -0.01em; }
.drop__hint { font-size: 0.8125rem; color: var(--ink-3); }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 0.55rem; }
.thumbs:not(:empty) { margin-top: 0.75rem; }

.thumb {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card);
  animation: thumbIn 0.22s var(--ease);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.thumb__doc {
  display: grid;
  place-content: center;
  gap: 0.25rem;
  height: 100%;
  padding: 0.5rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.thumb__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgb(11 11 11 / 0.78);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  font-size: 0.9rem;
  backdrop-filter: blur(2px);
}
.thumb__remove:hover { background: var(--ink); }

@keyframes thumbIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ Knöpfe */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.35rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.button:active { transform: translateY(1px); }
.button[disabled] { opacity: 0.55; cursor: progress; }

.button--primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.button--primary:hover { background: #262622; border-color: #262622; }

.button--outline { border-color: var(--ink); color: var(--ink); }
.button--outline:hover { background: var(--ink); color: var(--paper); }

.button--quiet { border-color: var(--rule-strong); color: var(--ink-2); }
.button--quiet:hover { border-color: var(--ink); color: var(--ink); }

.button--danger { background: var(--alert); border-color: var(--alert); color: #fff; }
.button--danger:hover { background: #8d1c17; border-color: #8d1c17; }

.button--small { padding: 0.42rem 0.8rem; font-size: 0.875rem; border-color: var(--rule-strong); color: var(--ink); }
.button--small:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }

.submit { padding-block: 0.5rem 0; }
.submit .button--primary { width: 100%; padding-block: 0.95rem; font-size: 1.0625rem; }

.trust {
  display: flex;
  gap: 0.55rem;
  align-items: start;
  margin-top: 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-3);
}
.trust__icon { width: 16px; height: 16px; flex: none; margin-top: 0.12rem; }

/* ------------------------------------------------------------ Fortschritt */

.progress { margin-top: 0.9rem; }
.progress__bar {
  height: 5px;
  border-radius: 999px;
  background: var(--rule);
  overflow: hidden;
}
.progress__fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  border-radius: 999px;
  transition: width 0.2s var(--ease);
}
.progress__label {
  margin-top: 0.45rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  text-align: center;
}

/* ------------------------------------------------------------ Der Beleg */

.receiptWrap {
  /* Der enge Schatten zeichnet die Zacken nach – ohne ihn verschwindet die
     Abrisskante im fast gleichfarbigen Papier. */
  filter:
    drop-shadow(0 1px 0.5px rgb(11 11 11 / 0.16))
    drop-shadow(0 14px 30px rgb(11 11 11 / 0.10));
  margin-block: 0.5rem 1.4rem;
  animation: receiptIn 0.45s var(--ease) both;
}

.receipt {
  /* Für saubere Zacken muss die Kachel doppelt so breit wie hoch sein –
     die 45-Grad-Schenkel treffen dann genau die Kachelecken. */
  --teeth-height: 9px;
  --tooth: 18px;
  background: var(--card);
  padding-bottom: var(--teeth-height);
  /* Untere Kante als Abrisskante wie bei einem Kassenbon: oben eine volle
     Fläche, unten eine Reihe Dreiecke mit der Spitze nach unten. */
  -webkit-mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--teeth-height)) no-repeat,
    conic-gradient(from -45deg at 50% 100%, #000 0 90deg, #0000 0) bottom / var(--tooth) var(--teeth-height) repeat-x;
  mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--teeth-height)) no-repeat,
    conic-gradient(from -45deg at 50% 100%, #000 0 90deg, #0000 0) bottom / var(--tooth) var(--teeth-height) repeat-x;
}

.receipt__net {
  height: 26px;
  background-image:
    repeating-linear-gradient(to right, var(--net) 0 1px, transparent 1px 13px),
    repeating-linear-gradient(to bottom, var(--net) 0 1px, transparent 1px 13px);
  border-bottom: 1px solid var(--rule);
}

.receipt__body { padding: 1.6rem 1.25rem 1.4rem; text-align: center; }

.receipt__label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.receipt__number {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(1.55rem, 8vw, 2.15rem);
  letter-spacing: 0.01em;
  margin-top: 0.5rem;
  word-break: break-all;
  animation: numberIn 0.5s var(--ease) 0.2s both;
}

/* Perforation: gestrichelte Linie mit ausgestanzten Ecken. */
.receipt__perf {
  position: relative;
  height: 0;
  border-top: 2px dashed var(--rule-strong);
  margin-inline: 1.1rem;
}
.receipt__perf::before,
.receipt__perf::after {
  content: '';
  position: absolute;
  top: -12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper);
}
.receipt__perf::before { left: -1.1rem; transform: translateX(-50%); }
.receipt__perf::after { right: -1.1rem; transform: translateX(50%); }

.receipt__foot {
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 1.25rem 0.6rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.receiptActions { display: grid; }
.receiptActions .button { width: 100%; }

@keyframes receiptIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes numberIn {
  from { opacity: 0; letter-spacing: 0.28em; }
  to { opacity: 1; letter-spacing: 0.01em; }
}

.next { margin-top: 2.5rem; }
.next__list { display: grid; gap: 0.7rem; margin-top: 0.9rem; }
.next__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.next__marker {
  width: 7px;
  height: 7px;
  margin-top: 0.55rem;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}

.againLine { margin-top: 2rem; text-align: center; font-size: 0.9375rem; }

/* ============================================================
   Verwaltung
   ============================================================ */

.is-admin { background: #f6f6f3; }

.adminbar {
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 10;
}
.adminbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-block: 0.85rem;
}
.adminbar__brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.adminbar__brand img { width: 104px; }
.adminbar__label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-left: 0.7rem;
  border-left: 1px solid var(--rule);
}
.adminbar__nav { display: flex; align-items: center; gap: 1rem; }

@media (max-width: 34rem) {
  /* Auf dem Handy reicht der Platz nicht für Logo, Bereichsname und Navigation. */
  .adminbar__label { display: none; }
  .adminbar__brand img { width: 88px; }
  .adminbar__nav { gap: 0.85rem; }
  .adminbar__nav .link--quiet { font-size: 0.875rem; }
}

.adminMain { padding-top: 1.75rem; }

.listHead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
}
.listHead__title {
  font-size: clamp(1.7rem, 4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 0.35rem;
}
.listHead__stat {
  display: grid;
  justify-items: end;
  text-align: right;
  padding: 0.6rem 0.95rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}
.listHead__statLabel {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.listHead__statValue {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.listHead__statMeta { font-size: 0.75rem; color: var(--ink-3); }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink-2);
}
.tab:hover { background: var(--card); border-color: var(--rule); color: var(--ink); }
.tab.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tab__count {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: rgb(11 11 11 / 0.07);
}
.tab.is-active .tab__count { background: rgb(255 255 255 / 0.18); }

.searchBar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-block: 1rem;
}
.searchBar__input {
  flex: 1 1 15rem;
  font-size: 0.9375rem;
  padding: 0.55rem 0.8rem;
  background: var(--card);
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  -webkit-appearance: none;
  appearance: none;
}
.searchBar__input:focus { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 1px; }
.searchBar .button { padding: 0.55rem 1rem; font-size: 0.9375rem; }

.rows { display: grid; gap: 0.5rem; }

.rowCard {
  display: grid;
  gap: 0.5rem 1rem;
  grid-template-areas:
    'ref    amount'
    'who    who'
    'tags   tags'
    'meta   actions';
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0.9rem 1rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s var(--ease);
}
.rowCard:hover { border-color: var(--rule-strong); }
.rowCard.is-muted { opacity: 0.6; }

.rowCard__ref {
  grid-area: ref;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-3);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.rowCard__ref:hover { color: var(--ink); }

.rowCard__who { grid-area: who; min-width: 0; }
.rowCard__name {
  font-weight: 650;
  letter-spacing: -0.015em;
  text-decoration: none;
}
.rowCard__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.rowCard__purpose {
  font-size: 0.875rem;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rowCard__amount {
  grid-area: amount;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1rem;
  text-align: right;
  white-space: nowrap;
}
.rowCard__chf { font-size: 0.6875rem; color: var(--ink-3); }

.rowCard__tags { grid-area: tags; display: flex; flex-wrap: wrap; gap: 0.35rem; }

.rowCard__meta {
  grid-area: meta;
  display: flex;
  gap: 0.7rem;
  font-size: 0.75rem;
  color: var(--ink-3);
}

.rowCard__actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}
.rowCard__open {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--ink-3);
}
.rowCard__open svg { width: 16px; height: 16px; }
.rowCard__open:hover { background: var(--paper); color: var(--ink); }

@media (min-width: 62rem) {
  .rowCard {
    grid-template-areas: 'ref who amount tags meta actions';
    /* Feste Spuren, damit Beträge und Status über alle Zeilen hinweg fluchten –
       jede Zeile ist ein eigenes Grid, ohne feste Spuren wandern sie. */
    grid-template-columns: 8.5rem minmax(0, 1fr) 9.5rem 14rem 6.5rem 7.5rem;
    gap: 0.5rem 1rem;
  }
  /* Ohne min-width:0 sprengt langer Inhalt die Spur und verschiebt die Zeile. */
  .rowCard > * { min-width: 0; }
  .rowCard__meta { flex-direction: column; gap: 0.1rem; text-align: right; align-items: flex-end; }
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.17rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  white-space: nowrap;
}
.tag--refund { background: var(--paper); }
.tag--invoice { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.tag__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* Offen → bezahlt → verbucht: gleicher Grünton, mit jeder Stufe fester umrandet. */
.tag--open { background: var(--open-soft); border-color: #ecdcc4; color: var(--open); }
.tag--paid { background: var(--paid-soft); border-color: #cfe2d5; color: var(--paid); }
.tag--booked { background: var(--paid-soft); border-color: var(--paid); color: var(--paid); }
.tag--rejected { background: var(--paper); color: var(--ink-3); }

.listFoot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1.1rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--ink-2);
}
.listFoot__exports { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.listFoot__hint {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--ink-3);
  max-width: 46rem;
}
.listFoot__hint code {
  font-family: var(--mono);
  font-size: 0.95em;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  background: var(--card);
  border: 1px solid var(--rule);
}

.empty {
  padding: 3.5rem 1.5rem;
  text-align: center;
  background: var(--card);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
}
.empty__title { font-weight: 650; font-size: 1.0625rem; letter-spacing: -0.02em; }
.empty__text { color: var(--ink-2); font-size: 0.9375rem; margin-top: 0.3rem; }

/* ------------------------------------------------------------ Detailseite */

.backLink {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.875rem;
  color: var(--ink-2);
  text-decoration: none;
  margin-bottom: 1rem;
}
.backLink:hover { color: var(--ink); }
.backLink svg { width: 14px; height: 14px; }

.detailHead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}
.detailHead__ref {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  letter-spacing: -0.01em;
  margin-block: 0.3rem 0.6rem;
}
.detailHead__amount {
  display: grid;
  justify-items: end;
  gap: 0.15rem;
  text-align: right;
}
.detailHead__amountLabel {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.detailHead__amountValue {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  letter-spacing: -0.02em;
}

.detailPurpose {
  font-size: 1.0625rem;
  color: var(--ink-2);
  padding-block: 0.75rem 1.5rem;
  max-width: 46rem;
}

.detailGrid { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 62rem) {
  .detailGrid { grid-template-columns: minmax(0, 1.15fr) minmax(21rem, 0.85fr); }
}

.detailSide { display: grid; gap: 1rem; }

.panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.15rem;
}
.panel__empty { color: var(--ink-3); font-size: 0.9375rem; margin-top: 0.75rem; }
.panel__foot { margin-top: 0.85rem; font-size: 0.8125rem; color: var(--ink-3); }

.scans { display: grid; gap: 0.75rem; margin-top: 0.85rem; }

.scan {
  position: relative;
  display: block;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--paper);
}
.scan img { width: 100%; }
.scan__zoom {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: rgb(11 11 11 / 0.82);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}
.scan:hover .scan__zoom, .scan:focus-visible .scan__zoom { opacity: 1; }

.pdf {
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--paper);
}
.pdf__frame {
  display: block;
  width: 100%;
  height: min(78vh, 720px);
  border: 0;
  background: var(--paper);
}
.pdf__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border-top: 1px solid var(--rule);
  background: var(--card);
  font-size: 0.8125rem;
}
.pdf__name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fileCard {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.fileCard__icon { width: 26px; height: 26px; flex: none; color: var(--ink-2); }
.fileCard__body { flex: 1; min-width: 0; }
.fileCard__name {
  font-weight: 600;
  font-size: 0.9375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fileCard__meta { font-size: 0.75rem; color: var(--ink-3); }

.dataList { margin-top: 0.85rem; }
.dataList__row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.5rem 1rem;
  padding-block: 0.6rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.dataList__row:first-child { border-top: 0; padding-top: 0; }
.dataList dt { color: var(--ink-3); font-size: 0.8125rem; padding-top: 0.1rem; }
.dataList dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dataList__mono {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.copyChip {
  font-family: var(--font);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.copyChip:hover { border-color: var(--ink); color: var(--ink); }
.copyChip.is-done { border-color: var(--paid); color: var(--paid); }

.actions { display: grid; gap: 0.5rem; margin-top: 0.85rem; }
.actions .button { width: 100%; }

.notesForm { margin-top: 0.85rem; }
.notesForm .button { width: 100%; }

.danger {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  padding: 0.9rem 1.15rem;
}
.danger__summary {
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-3);
  list-style: none;
}
.danger__summary::-webkit-details-marker { display: none; }
.danger__summary::before { content: '▸ '; }
.danger[open] .danger__summary::before { content: '▾ '; }
.danger__summary:hover { color: var(--alert); }
.danger__text { font-size: 0.875rem; color: var(--ink-2); margin-block: 0.75rem; }

/* ------------------------------------------------------------ Anmeldung */

.loginPage {
  display: grid;
  place-items: center;
  padding: 2rem 1.15rem 4rem;
}
.loginCard {
  width: 100%;
  max-width: 23rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.loginCard__logo { width: 132px; margin-bottom: 1.5rem; }
.loginCard__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-block: 0.3rem 1.25rem;
}
.loginForm .button { width: 100%; margin-top: 0.25rem; }

/* ------------------------------------------------------------ Bewegung aus */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
