:root {
  --bg: #f3f5f9; --surface: #ffffff; --surface-2: #f7f8fb; --text: #14181f; --muted: #5b6472;
  --line: #dfe3ea; --accent: #1f5fd6; --accent-text: #ffffff; --accent-soft: #e8f0fe;
  --ok: #167a45; --ok-soft: #e3f5ea; --warn: #9a5b00; --warn-soft: #fff2d9; --bad: #b3261e; --bad-soft: #fde8e6;
  --shadow: 0 1px 2px rgba(20, 24, 31, .06), 0 8px 28px rgba(20, 24, 31, .07);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f131a; --surface: #171c25; --surface-2: #1d2430; --text: #e8ecf3; --muted: #9aa4b5;
    --line: #2a3342; --accent: #6aa0ff; --accent-text: #0b1220; --accent-soft: #1b2a47;
    --ok: #5fd08e; --ok-soft: #13301f; --warn: #f0b95a; --warn-soft: #33270f; --bad: #ff8f87; --bad-soft: #3a1815;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 28px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #0f131a; --surface: #171c25; --surface-2: #1d2430; --text: #e8ecf3; --muted: #9aa4b5;
  --line: #2a3342; --accent: #6aa0ff; --accent-text: #0b1220; --accent-soft: #1b2a47;
  --ok: #5fd08e; --ok-soft: #13301f; --warn: #f0b95a; --warn-soft: #33270f; --bad: #ff8f87; --bad-soft: #3a1815;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 28px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
h2 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.topbar { border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: var(--accent-text); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }

label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.field { margin-bottom: 16px; }
input[type="text"], input[type="email"], input[type="number"], textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 12px 14px; min-height: 48px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
.hint { color: var(--muted); font-size: .85rem; margin-top: 5px; }
.error-text { color: var(--bad); font-size: .875rem; margin-top: 5px; }
.error-text:empty { display: none; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--accent); }

.btn {
  font: inherit; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 10px; border: 1.5px solid transparent; cursor: pointer;
  background: var(--accent); color: var(--accent-text); text-decoration: none; transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; filter: none; transform: none; }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface-2); filter: none; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn.block { width: 100%; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } .btn { transition: none; } }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 650; }
.badge.offen { background: var(--warn-soft); color: var(--warn); }
.badge.bestaetigt { background: var(--ok-soft); color: var(--ok); }
.badge.abgelaufen, .badge.zurueckgezogen { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge.angesehen { background: var(--accent-soft); color: var(--accent); }

.notice { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; background: var(--accent-soft); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); z-index: 50; max-width: calc(100vw - 32px);
}
.hidden { display: none !important; }
.center { text-align: center; }
.stack > * + * { margin-top: 16px; }
