:root {
  --color-primary: #547583;
  --color-primary-dark: #3f5964;
  --color-danger: #a4302f;
  --color-warning: #b8860b;
  --color-border: #d8d8d8;
  --color-bg: #666;
  --color-text: #222;
  --color-menu-bg: #9D3230;
  --color-menu-text: #fff;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

h1, h2, h3 { line-height: 1.25; }

a { color: var(--color-primary-dark); }

.flash { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash-erfolg { background: #e3f3e3; border: 1px solid var(--color-primary); }
.flash-fehler { background: #fbe4e4; border: 1px solid var(--color-danger); }

.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--color-border); }
th { font-size: 0.85rem; text-transform: uppercase; color: #666; }

form.inline { display: inline; }

label { display: block; font-weight: 600; margin: 0.75rem 0 0.25rem; }
input[type=text], input[type=number], input[type=password], input[type=date], select {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 1rem;
}

button, .btn {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.65rem 1.1rem;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  margin-top: 0.75rem;
}
button:hover, .btn:hover { background: var(--color-primary-dark); }
.btn-secondary { background: #666; }
.btn-danger { background: var(--color-danger); }
.btn-small { padding: 0.35rem 0.7rem; font-size: 0.85rem; margin-top: 0; }

.badge { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge-angemeldet, .badge-anwesend { background: #eee; color: #444; }
.badge-unterwegs { background: #dbeafe; color: #1e40af; }
.badge-im_ziel { background: #dcfce7; color: #166534; }
.badge-ausgeschieden_vet, .badge-abgebrochen { background: #fee2e2; color: #991b1b; }
.badge-freiwillig_beendet { background: #fef3c7; color: #92400e; }

.muted { color: #777; font-size: 0.9rem; }

.station-list { display: flex; flex-direction: column; gap: 0.6rem; }
.station-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}
.station-item .wartezeit { font-size: 0.85rem; color: var(--color-warning); }

.token-box {
  background: #fff8e1;
  border: 1px solid #e0c46c;
  padding: 0.85rem 1rem;
  border-radius: 6px;
  word-break: break-all;
  font-family: monospace;
}

.link-details { display: inline-block; }
.link-details summary { cursor: pointer; list-style: none; }
.link-details summary::-webkit-details-marker { display: none; }
.link-details .token-box { margin-top: 0.5rem; font-size: 0.85rem; }

nav.top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  position: relative;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  margin-top: -1rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--color-menu-bg);
  font-size: 0.9rem;
}
nav.top a { color: var(--color-menu-text); }

/*
 * Stationszugänge werden ausschließlich auf Smartphones benutzt (Helfer am Kontrollpunkt).
 * Die Ansicht bleibt deshalb bewusst auf Telefonbreite begrenzt und zentriert, auch wenn sie
 * auf einem Tablet oder Desktop-Rechner geöffnet wird, statt sich responsiv zu verbreitern.
 */
body.station-view {
  display: flex;
  justify-content: center;
}
body.station-view .page {
  max-width: 26rem;
  width: 100%;
  min-height: 100vh;
  background: #fff;
}
body.station-view nav.top {
  position: static;
  left: auto;
  width: auto;
  margin: -1rem -1rem 1rem;
}
@media (min-width: 27rem) {
  body.station-view .page {
    min-height: 0;
    margin: 2rem 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--color-border), 0 16px 40px rgba(0, 0, 0, 0.35);
  }
}

body.station-view label { font-size: 1rem; }
body.station-view input[type=text],
body.station-view input[type=number],
body.station-view input[type=password],
body.station-view select {
  padding: 0.85rem;
  font-size: 1.1rem;
}
body.station-view button,
body.station-view .btn {
  width: 100%;
  padding: 0.9rem 1.1rem;
  font-size: 1.1rem;
}
body.station-view button.btn-small,
body.station-view .btn-small {
  width: auto;
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
}
body.station-view .station-item {
  padding: 1rem 1.1rem;
}

.korrektur-liste { display: flex; flex-direction: column; gap: 0.6rem; }
.korrektur-item {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}
.korrektur-item .korrektur-kopf {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.35rem;
}
.korrektur-item .korrektur-kopf strong { font-size: 1.05rem; }
.korrektur-item form { margin-top: 0.6rem; }
