:root {
  --red: #d64c40;
  --red-dark: #a8261b;
  --blue: #0b8fd6;
  --ink: #2b2b2b;
  --muted: #8a8a8a;
  --line: #e6e6e6;
  --bg: #f4f4f5;
  --card: #ffffff;
  --radius: 14px;
  font-family: "DIN Next", "DIN Pro", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
h1 { font-size: 1.75rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 2rem 0 .75rem; }
a { color: inherit; }
.muted { color: var(--muted); }

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--card); border-right: 1px solid var(--line); padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100vh; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a { text-decoration: none; padding: .6rem .8rem; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; font-weight: 500; }
.sidebar nav a:hover { background: var(--bg); }
.sidebar nav a.active { background: var(--red); color: #fff; }
.nav-group { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 1rem .8rem .3rem; }
.badge { background: var(--red); color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 .5rem; line-height: 1.4rem; }
.active .badge { background: #fff; color: var(--red); }
.sidebar-foot { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; color: var(--muted); }

.brand { display: flex; flex-direction: column; gap: .35rem; padding: 0 .4rem; }
.brand .logo { width: 140px; height: auto; }
.brand small { color: var(--muted); font-size: .8rem; letter-spacing: .04em; }
.login-logo { width: 190px; margin: 0 auto .25rem; display: block; }
.center { text-align: center; margin: 0 0 1rem; }

.content { padding: 2rem 2.5rem; max-width: 1200px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }

.btn { text-decoration: none; display: inline-block; border: 0; border-radius: 999px; padding: .65rem 1.4rem; font: inherit; font-weight: 600; cursor: pointer; background: var(--line); color: var(--ink); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
button.link { background: none; border: 0; color: var(--red); font: inherit; cursor: pointer; padding: 0; }

input, select, textarea { font: inherit; width: 100%; padding: .8rem 1.1rem; border: 1px solid transparent; border-radius: 999px; background: #f1f1f2; }
textarea { border-radius: var(--radius); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); background: #fff; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.stat { background: var(--card); border-radius: var(--radius); padding: 1.25rem 1.5rem; text-decoration: none; display: flex; flex-direction: column; gap: .25rem; }
.stat-value { font-size: 2.2rem; font-weight: 700; color: var(--red); }
.stat-label { color: var(--muted); }

.cards { display: grid; gap: .75rem; }
.card { background: var(--card); border-radius: var(--radius); padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.card-actions { display: flex; gap: .5rem; }
.card-done { color: var(--muted); }

.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }

.pill { font-size: .8rem; padding: .15rem .6rem; border-radius: 999px; background: var(--line); }
.pill-active { background: #e3f4ea; color: #1f7a45; }
.pill-pending { background: #fdecea; color: var(--red-dark); }

.btn-danger { background: transparent; color: var(--red-dark); margin-left: auto; }
.btn-danger:hover { background: #fdecea; }
.back { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: .75rem; font-size: .95rem; }
.back:hover { color: var(--red); }
.content > h1 { margin-bottom: 1.5rem; }

/* Formulare */
.form { display: flex; flex-direction: column; gap: 1rem; max-width: 820px; }
.field { display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.field > span { font-size: .85rem; font-weight: 600; color: #555; padding-left: .3rem; }
.hint { color: var(--muted); font-size: .8rem; padding-left: .3rem; }
.field-hint { margin-top: -.6rem; }
.check { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--red); }
.row { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.row > .check { align-self: center; padding-top: 1.4rem; }
.stack { display: flex; flex-direction: column; gap: .6rem; padding-bottom: .5rem; }
.form-actions { display: flex; gap: .5rem; padding-top: .5rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .8rem; }
legend { font-weight: 600; padding: 0 .4rem; }
select[multiple] { border-radius: var(--radius); padding: .5rem; }
.current-file { display: flex; gap: 1rem; align-items: center; padding: .2rem .3rem .4rem; }
.current-file a { color: var(--red); }
input[type=file] { border-radius: var(--radius); background: transparent; border: 1px dashed #ccc; }
.extracted { background: #fafafa; border-radius: var(--radius); padding: .75rem 1rem; }
.extracted summary { cursor: pointer; color: var(--muted); }
.extracted pre { white-space: pre-wrap; font: inherit; font-size: .85rem; max-height: 320px; overflow: auto; }

/* Panels für Unterbereiche */
.panel { background: var(--card); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-top: 2rem; max-width: 820px; }
.panel h2 { margin-top: 0; }
.option-group { border-top: 1px solid var(--line); padding: 1rem 0; }
.option-group-head { display: flex; gap: .75rem; align-items: baseline; }
.option-group-head .link { margin-left: auto; }
.option-list { list-style: none; padding: 0; margin: .5rem 0; }
.option-list li { display: flex; gap: 1rem; align-items: center; padding: .4rem 0; border-bottom: 1px dashed var(--line); }
.option-list li span:first-child { flex: 1; }
.inline-form { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; }
.inline-form input[type=text] { flex: 1; }
.narrow { max-width: 180px; }

/* Listen & Karten */
.empty { color: var(--muted); background: var(--card); border-radius: var(--radius); padding: 2rem; text-align: center; }
.nowrap { white-space: nowrap; }
.table a { text-decoration: none; font-weight: 600; }
.table a:hover { color: var(--red); }
.pill-featured { background: #fdecea; color: var(--red-dark); margin-left: .4rem; }
.pill-reg-registered { background: #e3f4ea; color: #1f7a45; }
.pill-reg-invited { background: #e8f3fb; color: #0b6aa0; }
.pill-reg-declined, .pill-reg-cancelled { background: #f1f1f2; color: var(--muted); }
.warn { color: #b26a00; }
.accent { color: var(--red); }
.card-link { text-decoration: none; }
.card-link:hover { box-shadow: 0 0 0 2px var(--red); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: .25rem; }
.card.quick { background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; text-transform: uppercase; letter-spacing: .08em; }
.card.quick .muted { color: rgba(255,255,255,.75); text-transform: none; letter-spacing: 0; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.contact-card { background: var(--card); border-radius: var(--radius); padding: 1rem; display: flex; gap: 1rem; align-items: center; text-decoration: none; }
.contact-card:hover { box-shadow: 0 0 0 2px var(--red); }
.contact-card img, .avatar { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.avatar { display: grid; place-items: center; background: #f1f1f2; color: var(--muted); font-weight: 700; font-size: 1.3rem; }

.alert { background: #fdecea; color: var(--red-dark); padding: .75rem 1rem; border-radius: 10px; margin: 0; }

.login-page { display: grid; place-items: center; min-height: 100vh; }
.login-card { background: var(--card); padding: 2.5rem; border-radius: 20px; width: min(380px, 92vw); display: flex; flex-direction: column; gap: .8rem; }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .content { padding: 1.25rem 1rem; }
}

/* Nutzer, Gremien */
.committee-picker { display: flex; flex-direction: column; gap: .4rem; }
.committee-row { display: grid; grid-template-columns: minmax(220px, 1fr) 1.4fr; gap: 1rem; align-items: center; }
.committee-row input[type=text] { padding: .55rem 1rem; }
.committee-checks { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding-left: 1.7rem; }
.table-filter { margin-bottom: .75rem; }
.small { font-size: .85rem; }
.pill { white-space: nowrap; }
.pill-admin { background: #fdecea; color: var(--red-dark); }
.pill-staff { background: #e8f3fb; color: #0b6aa0; }
.readonly { padding: .8rem 1.1rem; background: #f7f7f8; border-radius: 999px; display: flex; justify-content: space-between; }
.notice { background: #e3f4ea; color: #1f7a45; padding: .75rem 1rem; border-radius: 10px; }
.notice-inline { color: #1f7a45; font-weight: 600; }
@media (max-width: 800px) { .committee-row { grid-template-columns: 1fr; } }
