:root {
  --green:#16a34a; --green-d:#15803d;
  --red:#dc2626;   --red-d:#b91c1c;
  --orange:#f59e0b;--orange-d:#d97706;
  --primary:#2563eb; --primary-d:#1d4ed8;
  --ink:#1f2937; --muted:#6b7280; --line:#e5e7eb; --bg:#f6f7f9; --card:#ffffff;
}
[data-theme="dark"] {
  --green:#22c55e; --green-d:#16a34a;
  --red:#f87171;   --red-d:#ef4444;
  --orange:#fbbf24;--orange-d:#f59e0b;
  --primary:#3b82f6; --primary-d:#60a5fa;
  --ink:#e5e7eb; --muted:#9ca3af; --line:#2d333b; --bg:#0d1117; --card:#161b22;
}
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body {
  margin:0; background:var(--bg); color:var(--ink);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  line-height:1.5;
  transition:background .15s ease, color .15s ease;
}
a { color:var(--primary); text-decoration:none; }
a:hover { text-decoration:underline; }
h1 { font-size:24px; margin:0 0 16px; }
h2 { font-size:19px; }
h3 { font-size:15px; }
.section { margin-top:30px; }
.muted { color:var(--muted); }
.small { font-size:13px; }
.center { text-align:center; }
.right { text-align:right; }

.container { max-width:760px; margin:0 auto; padding:24px 18px 64px; }
.topbar {
  display:flex; justify-content:space-between; align-items:center;
  padding:13px 18px; background:var(--card); border-bottom:1px solid var(--line);
}
.brand { font-weight:700; color:var(--ink); font-size:18px; }
.topbar nav { display:flex; gap:16px; align-items:center; }
.inline { display:inline; }
.linkbtn { background:none; border:none; color:var(--primary); cursor:pointer; font:inherit; padding:0; }
.linkbtn:hover { text-decoration:underline; }
.theme-toggle {
  border:1px solid var(--line); border-radius:8px; padding:5px 12px !important;
  color:var(--ink) !important; font-size:13px;
}
.theme-toggle:hover { background:var(--line); text-decoration:none; }
.foot { text-align:center; color:var(--muted); font-size:12px; padding:24px; }

/* cards */
.cards { display:grid; gap:14px; }
.card {
  display:block; background:var(--card); border:1px solid var(--line);
  border-radius:14px; padding:18px; color:inherit;
  transition:box-shadow .15s ease, transform .15s ease;
}
.card h2 { margin:8px 0 6px; }
.card p { margin:2px 0; }
.card-active:hover { box-shadow:0 8px 22px rgba(0,0,0,.08); transform:translateY(-1px); text-decoration:none; }
.card-planned { opacity:.9; }
.badge {
  display:inline-block; font-size:11px; font-weight:700; text-transform:uppercase;
  letter-spacing:.04em; padding:3px 9px; border-radius:999px;
}
.badge-aktiv   { background:#dcfce7; color:#166534; }
.badge-geplant { background:#fef3c7; color:#92400e; }
.badge-beendet { background:#e5e7eb; color:#374151; }
[data-theme="dark"] .badge-aktiv   { background:#14532d; color:#86efac; }
[data-theme="dark"] .badge-geplant { background:#78350f; color:#fde68a; }
[data-theme="dark"] .badge-beendet { background:#374151; color:#d1d5db; }

/* vote */
.vote-wrap {
  background:var(--card); border:1px solid var(--line); border-radius:16px;
  padding:28px; margin-top:12px;
}
.vote-title { font-size:26px; text-align:center; line-height:1.3; margin-top:0; }
.votebuttons { display:grid; gap:14px; margin:26px 0 12px; }
.btn {
  border:none; border-radius:12px; padding:16px 18px; font-size:18px; font-weight:700;
  color:#fff; cursor:pointer; transition:background .15s ease; text-align:center;
}
.btn:active { transform:translateY(1px); }
.votebuttons .btn { padding:20px; font-size:21px; }
.btn-ja    { background:var(--green);  } .btn-ja:hover    { background:var(--green-d);  }
.btn-nein  { background:var(--red);    } .btn-nein:hover  { background:var(--red-d);    }
.btn-enth  { background:var(--orange); } .btn-enth:hover  { background:var(--orange-d); }
.btn-primary { background:var(--primary); } .btn-primary:hover { background:var(--primary-d); }
.btn-ghost { background:#eef2ff; color:var(--primary); }
.btn-ghost:hover { background:#e0e7ff; text-decoration:none; }
.btn-warn { background:var(--orange); } .btn-warn:hover { background:var(--orange-d); }
.btn-danger { background:var(--red); } .btn-danger:hover { background:var(--red-d); }
a.btn:hover { text-decoration:none; }
[data-theme="dark"] .btn-ghost { background:#1e293b; color:var(--primary); }
[data-theme="dark"] .btn-ghost:hover { background:#273449; }
.notice { background:#eff6ff; border:1px solid #bfdbfe; color:#1e40af; padding:14px; border-radius:10px; text-align:center; margin:18px 0; }
.notice.ok  { background:#dcfce7; border-color:#bbf7d0; color:#166534; }
.notice.err { background:#fee2e2; border-color:#fecaca; color:#991b1b; }
[data-theme="dark"] .notice     { background:#1e3a5f; border-color:#2563eb; color:#bfdbfe; }
[data-theme="dark"] .notice.ok  { background:#14532d; border-color:#16a34a; color:#bbf7d0; }
[data-theme="dark"] .notice.err { background:#5f1e1e; border-color:#dc2626; color:#fecaca; }
.back { font-size:14px; }
.checkmark {
  width:64px; height:64px; border-radius:50%; background:var(--green); color:#fff;
  font-size:34px; line-height:64px; margin:0 auto 12px; text-align:center;
}

/* forms */
.loginbox, .formbox {
  background:var(--card); border:1px solid var(--line); border-radius:16px;
  padding:26px; max-width:560px; margin:12px auto;
}
label { display:block; font-weight:600; font-size:14px; margin-bottom:14px; }
input, textarea {
  width:100%; margin-top:6px; padding:11px 12px; border:1px solid var(--line);
  border-radius:9px; font:inherit; background:#fff; color:var(--ink);
}
input:focus, textarea:focus { outline:2px solid #bfdbfe; border-color:var(--primary); }
[data-theme="dark"] input, [data-theme="dark"] textarea { background:#0d1117; }
[data-theme="dark"] input:focus, [data-theme="dark"] textarea:focus { outline-color:#1d4ed8; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.actions { display:flex; gap:12px; margin-top:8px; }
.danger-zone { margin-top:26px; padding-top:18px; border-top:1px dashed var(--line); display:grid; gap:10px; }
.danger-zone h3 { margin:0 0 4px; }

/* table */
.admin-head { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.tbl {
  width:100%; border-collapse:collapse; margin-top:14px; background:var(--card);
  border:1px solid var(--line); border-radius:12px; overflow:hidden;
}
.tbl th, .tbl td { text-align:left; padding:12px 14px; border-bottom:1px solid var(--line); }
.tbl th { font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); background:#fafafa; }
.tbl tr:last-child td { border-bottom:none; }
[data-theme="dark"] .tbl th { background:#1c2128; }

/* results */
.result-head { display:flex; gap:16px; margin:14px 0 10px; }
.rh-item { flex:1; text-align:center; border-radius:12px; padding:16px; color:#fff; }
.rh-ja { background:var(--green); } .rh-nein { background:var(--red); }
.rh-pct { font-size:34px; font-weight:800; line-height:1; }
.rh-lbl { font-size:14px; opacity:.95; margin-top:4px; }
.bar { display:flex; height:26px; border-radius:8px; overflow:hidden; background:#e5e7eb; margin:8px 0; }
.bar-decisive { height:16px; }
.seg { height:100%; }
.seg-ja { background:var(--green); } .seg-nein { background:var(--red); }
.seg-enth { background:var(--orange); } .seg-none { background:#cbd5e1; }
.legend { display:flex; flex-wrap:wrap; gap:16px; font-size:13px; margin:6px 0 18px; }
.legend .dot { display:inline-block; width:11px; height:11px; border-radius:3px; margin-right:6px; vertical-align:middle; }
.dot-ja { background:var(--green); } .dot-nein { background:var(--red); }
.dot-enth { background:var(--orange); } .dot-none { background:#cbd5e1; }
[data-theme="dark"] .bar { background:#2d333b; }
[data-theme="dark"] .seg-none, [data-theme="dark"] .dot-none { background:#4b5563; }
.stats { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:18px 0; }
.stat { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px; text-align:center; }
.stat-num { font-size:26px; font-weight:800; }
.stat-lbl { font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; }

@media (max-width:520px) {
  .grid2 { grid-template-columns:1fr; }
  .stats { grid-template-columns:repeat(2,1fr); }
}
@media (prefers-reduced-motion:reduce) {
  .card, .btn { transition:none; }
}
