/* Gruppetto – schlichtes, smartphonetaugliches Grundlayout */
:root {
  /* Farben aus dem Logo */
  --text: #16202a;
  --muted: #5f6974;
  --line: #d9dde4;
  --bg: #ffffff;
  --bg-soft: #f4f6f9;
  --accent: #1f3bd1;
  --yellow: #ffd400;
  --accent-text: #ffffff;
  --danger: #b3261e;
  --warn-bg: #fff4d6;
  --error-bg: #fde8e6;
  --success-bg: #e5f4e8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); }

.top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .5rem 1rem;
  background: var(--bg);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 3px 0 var(--yellow);
}
.top .brand { margin-right: auto; display: flex; }
.top .brand img { height: 34px; width: auto; }
.top .who { font-size: .9rem; color: var(--muted); }

.event-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: .5rem 1rem;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

main { max-width: 960px; margin: 0 auto; padding: 1rem; }

h1 { font-size: 1.5rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 .5rem; }

.hint { color: var(--muted); font-size: .9rem; }
.warn { color: var(--danger); }

/* Formulare */
.form { display: grid; gap: .8rem; max-width: 560px; }
.form.narrow { max-width: 320px; }
.form label { display: grid; gap: .2rem; font-weight: 500; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.form label.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
fieldset { border: 1px solid var(--line); border-radius: 6px; padding: .5rem .8rem; display: grid; gap: .3rem; }
legend { font-weight: 500; padding: 0 .3rem; }

input, select, textarea {
  font: inherit;
  padding: .45rem .55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: inherit;
  width: 100%;
}
input[type=checkbox] { width: auto; }

button, .button {
  display: inline-block;
  font: inherit;
  padding: .5rem 1rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  cursor: pointer;
}
button.link {
  background: none;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
}
button.danger { color: var(--danger); }
.actions { display: flex; align-items: center; gap: 1rem; }
form.inline { display: inline; }

/* Hinweise */
.notice { padding: .7rem 1rem; border-radius: 6px; margin: 0 0 1rem; }
.notice p { margin: .3rem 0; }
.notice.error { background: var(--error-bg); }
.notice.conflict { background: var(--warn-bg); }
.notice.success { background: var(--success-bg); }
.code { font: 700 1.6rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .08em; overflow-wrap: anywhere; }
.code.small { font-size: 1.1rem; letter-spacing: 0; }

/* Tabellen */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.row-actions { white-space: nowrap; text-align: right; }
td.row-actions > * + * { margin-left: .8rem; }
tr.revoked td { color: var(--muted); text-decoration: line-through; }
tr.revoked td.row-actions { text-decoration: none; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.announcement { white-space: pre-line; background: var(--bg-soft); padding: .7rem 1rem; border-radius: 6px; }

/* Import */
.form.wide { max-width: 720px; }
.summary { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.old { color: var(--muted); text-decoration: line-through; }
.plain { list-style: none; padding: 0; columns: 2 18rem; font-size: .9rem; }
details > summary { cursor: pointer; }
details > summary h2 { display: inline; }
.actions.sticky { position: sticky; bottom: 0; background: var(--bg); padding: .8rem 0; border-top: 1px solid var(--line); margin-top: 1.5rem; }

/* Startnummern */
input.num-input { width: 5.5rem; }

/* Startnummernausgabe */
.search { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.search input { font-size: 1.15rem; padding: .6rem .7rem; }
.badge { display: inline-block; font-size: .8rem; padding: .05rem .45rem; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); }
.badge.ok { background: var(--success-bg); }
.badge.warn { background: var(--warn-bg); }
.bib { display: inline-block; min-width: 2.5rem; padding: 0 .4rem; border: 2px solid var(--text); border-radius: 6px; text-align: center; }
input.big { font-size: 1.3rem; font-weight: 700; }
input.short { max-width: 9rem; }
.choices { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
button.primary { font-weight: 600; }
.actions.wrap { flex-wrap: wrap; }
.inline-form { margin: .8rem 0; }

/* Ergebnisse */
.badge.status-provisional { background: var(--warn-bg); }
.badge.status-approved { background: var(--success-bg); }
.badge.status-rejected { background: var(--error-bg); }
tr.unknown td { background: var(--warn-bg); }

/* Öffentliche Ansicht */
.cards { list-style: none; padding: 0; display: grid; gap: .7rem; }
.cards li { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: .7rem .9rem; }
.cards li > a { text-decoration: none; color: inherit; display: block; }
.cards .when { font-weight: 600; color: var(--accent); }
.cards .links { margin-top: .3rem; }
table.list td:first-child, table.list th:first-child { width: 3.5rem; }
section + section { margin-top: 2rem; }
.foot { max-width: 960px; margin: 2rem auto 1rem; padding: 0 1rem; color: var(--muted); font-size: .85rem; }
.narrow-only { display: none; }

@media (max-width: 520px) {
  .wide-only { display: none; }
  .narrow-only { display: block; }
  table.list { font-size: .95rem; }
}

@media (max-width: 520px) {
  .form .row { grid-template-columns: 1fr; }
  .top .who { display: none; }
}

/* Nachrichten */
.messages { list-style: none; padding: 0; display: grid; gap: .6rem; margin-top: 1.5rem; }
.messages li { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 6px; padding: .6rem .9rem; }
.messages li.unread { border-left-color: var(--accent); background: var(--bg-soft); }
.messages li.mine { border-left-color: var(--muted); }
.messages .meta { display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; }
.messages .text { white-space: pre-line; margin: .3rem 0; overflow-wrap: anywhere; }
