/* Orchester-Anfragen – schlicht, ruhig, gut lesbar */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --ink: #1e2633;
  --muted: #5e6878;
  --faint: #8a93a1;
  --line: #e2e5ea;
  --line-strong: #c9ced6;
  --accent: #2a4a8c;
  --accent-hover: #213c74;
  --accent-soft: #e8edf7;
  --yes: #2f7d5b;
  --yes-soft: #e4f1ea;
  --no: #b5473a;
  --no-soft: #f8e6e3;
  --wait: #b7832a;
  --wait-soft: #faf0dc;
  --radius: 8px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }

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

.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* ---------- Admin-Gerüst ---------- */

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { padding: 0 10px; font-weight: 650; font-size: 16px; color: var(--ink); line-height: 1.3; }
.brand small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 500;
}
.nav a:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

.sidebar-foot { margin-top: auto; padding: 0 10px; font-size: 13px; color: var(--muted); }
.sidebar-foot form { margin-top: 6px; }

.main { padding: 32px 40px 64px; max-width: 1180px; width: 100%; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head p { margin: 6px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.crumb { font-size: 13px; margin-bottom: 6px; display: inline-block; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; order: 3; }
  .nav a { white-space: nowrap; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; display: flex; gap: 10px; align-items: center; }
  .sidebar-foot form { margin: 0; }
  .sidebar-foot .who { display: none; }
  .main { padding: 22px 16px 48px; }
  h1 { font-size: 22px; }
}

/* ---------- Flächen ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.panel-body { padding: 18px; }
.panel-body > :last-child { margin-bottom: 0; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 550;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-yes { background: var(--yes); border-color: var(--yes); color: #fff; }
.btn-yes:hover { background: #276a4d; }
.btn-danger { color: var(--no); }
.btn-danger:hover { background: var(--no-soft); }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-link { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--no); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.inline { display: inline; }

/* ---------- Formulare ---------- */

.form { max-width: 640px; }
.field { margin-bottom: 18px; }
.field label, .label { display: block; font-weight: 550; margin-bottom: 6px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 5px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .row { grid-template-columns: 1fr; } }

input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date],
input[type=datetime-local], input[type=number], input[type=search], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }

.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 6px; }

/* ---------- Meldungen ---------- */

.flash {
  padding: 11px 14px;
  border-radius: 6px;
  margin-bottom: 18px;
  border: 1px solid;
}
.flash-ok { background: var(--yes-soft); border-color: #c4dfd1; color: #1f5a40; }
.flash-error { background: var(--no-soft); border-color: #ecc6c0; color: #8a2f25; }
.flash ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- Tabellen ---------- */

.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left;
  font-size: 13px;
  font-weight: 550;
  color: var(--muted);
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.list td { padding: 11px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.group td {
  background: var(--bg);
  font-weight: 600;
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 14px;
}
table.list tr.inactive td { color: var(--faint); }

.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.empty p { margin-bottom: 14px; }

/* ---------- Status ---------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 550;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-accepted { background: var(--yes-soft); color: var(--yes); }
.status-declined { background: var(--no-soft); color: var(--no); }
.status-pending { background: var(--wait-soft); color: #94681b; }
.status-failed { background: var(--no-soft); color: var(--no); }
.status-archived { background: var(--bg); color: var(--muted); }

/* ---------- Kennzahlen ---------- */

.tally { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--line); }
.tally > div { flex: 1 1 120px; padding: 14px 18px; border-right: 1px solid var(--line); }
.tally > div:last-child { border-right: 0; }
.tally .n { font-size: 26px; font-weight: 650; line-height: 1.1; display: block; }
.tally .l { font-size: 13px; color: var(--muted); }
.tally .yes .n { color: var(--yes); }
.tally .no .n { color: var(--no); }
.tally .wait .n { color: #94681b; }

/* Fortschrittsband: Zusagen | Absagen | Ausstehend */
.band { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); }
.band span { display: block; height: 100%; }
.band .b-yes { background: var(--yes); }
.band .b-no { background: var(--no); opacity: .75; }
.band .b-wait { background: var(--wait); opacity: .55; }

/* ---------- Pulte: die Besetzung auf einen Blick ---------- */

.seating { display: grid; gap: 2px; }
.seat-row {
  display: grid;
  grid-template-columns: minmax(110px, 170px) 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 7px 0;
}
.seat-row + .seat-row { border-top: 1px dashed var(--line); }
.seat-name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seats { display: flex; flex-wrap: wrap; gap: 4px; }
.seat {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px dashed var(--line-strong);
  background: transparent;
}
.seat.yes { background: var(--yes); border: 1.5px solid var(--yes); }
.seat.wait { background: var(--wait-soft); border: 1.5px solid var(--wait); }
.seat.extra { background: transparent; border: 1.5px solid var(--yes); }
.seat-count { font-size: 13px; color: var(--muted); white-space: nowrap; text-align: right; }
.seat-count strong { color: var(--ink); font-weight: 600; }
.seat-count .ok { color: var(--yes); font-weight: 600; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .seat { width: 12px; height: 12px; border-radius: 3px; }

@media (max-width: 600px) {
  .seat-row { grid-template-columns: 1fr auto; }
  .seats { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Projektkarten (Übersicht) ---------- */

.project-list { display: grid; gap: 16px; }
.project-card { padding: 18px 20px; }
.project-list > .panel { margin-bottom: 0; }
.project-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.project-card h2 a { color: var(--ink); }
.project-card .when { color: var(--muted); margin-top: 3px; }
.project-card .band { margin: 16px 0 8px; }
.project-card .counts { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.project-card .counts b { color: var(--ink); font-weight: 600; }
.project-card .seating { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------- Auswahl der Musiker ---------- */

.pick-group { border-top: 1px solid var(--line); }
.pick-group:first-child { border-top: 0; }
.pick-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg);
  flex-wrap: wrap;
}
.pick-head h3 { font-size: 15px; }
.pick-head .meta { font-size: 13px; color: var(--muted); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pick-head .meta .sel { font-weight: 600; color: var(--ink); }
.pick-head .meta .sel.full { color: var(--yes); }
.pick-head .meta .sel.over { color: #94681b; }

.pick {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 18px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.pick:hover { background: #fafbfc; }
.pick input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.pick .who { min-width: 0; }
.pick .who span { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick .hist { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.pick .hist b { color: var(--ink); font-weight: 600; }
.pick.suggested .who strong::after {
  content: "Vorschlag";
  margin-left: 8px;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 7px;
  border-radius: 999px;
  vertical-align: 1px;
}

.sendbar {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: 0 -6px 18px rgba(30, 38, 51, .06);
}
.sendbar .total { font-weight: 600; }

/* ---------- Detailliste ---------- */

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}
.timeline time { display: block; font-size: 12.5px; color: var(--muted); }

.copy-field { display: flex; gap: 8px; }
.copy-field input { font-size: 13px; color: var(--muted); }

details.more summary { cursor: pointer; color: var(--accent); font-weight: 550; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary { margin-bottom: 12px; }

.danger-zone { border-color: #ecc6c0; }
.danger-zone .panel-head { border-color: #ecc6c0; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.toolbar input[type=search] { max-width: 280px; }
.toolbar select { max-width: 220px; }

.order-handle { width: 64px !important; }

.needs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 16px; }
.needs-grid .field { margin-bottom: 14px; }
.needs-grid label { font-weight: 500; font-size: 14px; }
.needs-grid input { max-width: 110px; }

/* ---------- Öffentliche Seiten (Musiker) ---------- */

.public { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 40px 16px 56px; }
.public-wrap { width: 100%; max-width: 560px; }
.public-wrap.wide { max-width: 720px; }
.public-brand { color: var(--muted); font-size: 14px; margin-bottom: 18px; font-weight: 550; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
@media (max-width: 520px) { .card { padding: 22px 18px; } .public { padding-top: 24px; } }

.project-title { font-size: 24px; margin-bottom: 8px; }
.project-when { font-size: 16px; }
.project-where { color: var(--muted); }
.project-desc { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); white-space: pre-line; }

.answer-state {
  margin-top: 24px;
  padding: 16px 18px;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.answer-state.accepted { background: var(--yes-soft); color: #1f5a40; }
.answer-state.declined { background: var(--no-soft); color: #8a2f25; }
.answer-state.pending { background: var(--bg); color: var(--muted); }
.answer-state .mark {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
}
.answer-state.accepted .mark { background: var(--yes); }
.answer-state.declined .mark { background: var(--no); }
.answer-state strong { display: block; color: var(--ink); }

.answer-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.answer-buttons .btn { padding: 13px 14px; font-size: 16px; }
.answer-buttons .btn.chosen-yes { box-shadow: 0 0 0 3px var(--yes-soft); }
.answer-buttons .btn.chosen-no { border-color: var(--no); color: var(--no); box-shadow: 0 0 0 3px var(--no-soft); }

.confirm-box { margin-top: 24px; padding: 18px; border: 1.5px solid var(--accent); border-radius: 8px; }
.confirm-box p { margin-bottom: 14px; font-size: 16px; }
.confirm-box .btn { width: 100%; padding: 13px; font-size: 16px; }
.confirm-box .alt { text-align: center; margin-top: 12px; font-size: 14px; }

.deadline-note { margin-top: 16px; font-size: 14px; color: var(--muted); }

.public-foot { margin-top: 18px; font-size: 14px; text-align: center; }

.my-section { margin-top: 28px; }
.my-section h2 { font-size: 15px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.my-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
}
a.my-item { color: var(--ink); }
a.my-item:hover { text-decoration: none; border-color: var(--line-strong); }
.my-item .t { font-weight: 600; }
.my-item .d { font-size: 14px; color: var(--muted); }
.my-item.past { opacity: .7; }

.login-card { max-width: 400px; margin: 0 auto; }
.login-card h1 { margin-bottom: 20px; font-size: 22px; }
.login-card .btn { width: 100%; padding: 11px; }

@media (prefers-reduced-motion: no-preference) {
  .flash { animation: flash-in .25s ease-out; }
  @keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}
