:root {
  --canvas: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: #edf2f8;
  --surface-subtle: #f8fafd;
  --ink: #0f172a;
  --ink-soft: #475569;
  --line: #dbe3ef;
  --line-strong: #bac7da;
  --brand: #003d8f;
  --brand-hover: #002c69;
  --brand-soft: color-mix(in srgb, var(--brand) 9%, transparent);
  --accent: #e20031;
  --positive: #087443;
  --warning: #a45b05;
  --negative: #b4233a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -12px rgba(15, 23, 42, 0.08);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0b111a;
    --surface: #121b28;
    --surface-muted: #1b2739;
    --surface-subtle: #162131;
    --ink: #f1f5f9;
    --ink-soft: #9fb0c7;
    --line: #263449;
    --line-strong: #3b4e6b;
    --brand: #6ca8ff;
    --brand-hover: #96c1ff;
    --brand-soft: color-mix(in srgb, var(--brand) 14%, transparent);
    --accent: #ff5c7c;
    --positive: #5fd39a;
    --warning: #f0b95e;
    --negative: #ff8599;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 14px 36px -12px rgba(0, 0, 0, 0.45);
  }
}

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

html {
  background: var(--canvas);
  color-scheme: light dark;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    radial-gradient(900px 480px at 95% -120px, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%),
    var(--canvas);
  font: 16px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--brand-hover);
}

.skip-link {
  position: absolute;
  inset-block-start: -100px;
  inset-inline-start: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  inset-block-start: 12px;
}

.sim-banner {
  padding: 8px 16px;
  background: var(--accent);
  color: #ffffff;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 700;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px);
}

.header-bar,
main,
.site-footer {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.header-bar {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--ink);
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--surface-muted);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-list a:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.nav-list a[aria-current="page"] {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 750;
}

.nav-logout {
  margin-inline-start: 6px;
  padding-inline-start: 10px;
  border-inline-start: 1px solid var(--line);
}

/* Main & Footer */
main {
  flex: 1 0 auto;
  padding-block: clamp(28px, 4.5vw, 52px) 64px;
}

main:focus {
  outline: none;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-block: 0 32px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* Typography */
h1, h2, h3 {
  margin-top: 0;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.18;
  text-wrap: balance;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(1.85rem, 4.2vw, 2.75rem);
  font-weight: 800;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.2rem;
  font-weight: 750;
}

h3 {
  margin-bottom: 6px;
  font-size: 1rem;
  font-weight: 700;
}

p {
  margin: 0 0 14px;
  text-wrap: pretty;
}

.prose {
  max-inline-size: 65ch;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-heading {
  max-width: 720px;
  margin-bottom: 26px;
}

.page-heading h1 {
  margin-bottom: 8px;
}

.page-heading .muted {
  margin-bottom: 0;
  font-size: 1rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.back-link:hover {
  color: var(--brand);
}

/* Cards & Layout */
.card {
  margin-bottom: 20px;
  padding: clamp(20px, 3vw, 28px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card > :last-child {
  margin-bottom: 0;
}

.card-subtle {
  background: var(--surface-subtle);
  box-shadow: none;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 16px;
  margin-bottom: 18px;
}

.section-heading p {
  margin-bottom: 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.mt-sm {
  margin-top: 12px;
}

.mt-md {
  margin-top: 18px;
}

/* Hero & Onboarding Steps */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5.5vw, 56px);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-muted) 100%);
}

.hero::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -130px;
  width: 320px;
  height: 320px;
  border: 42px solid color-mix(in srgb, var(--brand) 11%, transparent);
  border-radius: 50%;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  margin-bottom: 12px;
}

.hero p {
  color: var(--ink-soft);
  font-size: 1.06rem;
  margin-bottom: 22px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.step-card {
  margin-bottom: 0;
  padding: 20px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Onboarding Stepper */
.stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.stepper-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.stepper-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stepper-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.stepper-title {
  font-weight: 700;
  color: var(--ink-soft);
}

.stepper-sub {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.stepper-item.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.stepper-item.is-active .stepper-badge {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.stepper-item.is-active .stepper-title {
  color: var(--brand);
}

.stepper-item.is-done {
  border-color: color-mix(in srgb, var(--positive) 35%, var(--line));
}

.stepper-item.is-done .stepper-badge {
  border-color: var(--positive);
  background: color-mix(in srgb, var(--positive) 14%, transparent);
  color: var(--positive);
}

.stepper-item.is-done .stepper-title {
  color: var(--ink);
}

@media (prefers-color-scheme: dark) {
  .stepper-item.is-active .stepper-badge {
    color: #0b111a;
  }
}

.callout-info {
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line));
  background: var(--brand-soft);
  color: var(--ink);
  font-size: 0.9rem;
}

.account-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.account-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

/* Buttons */
.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #ffffff;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.btn:hover {
  color: #ffffff;
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn.secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
}

.btn.secondary:hover {
  color: var(--ink);
  background: var(--surface-muted);
  border-color: var(--line-strong);
}

.btn.danger-ghost {
  color: var(--negative);
  background: transparent;
  border-color: color-mix(in srgb, var(--negative) 32%, var(--line));
}

.btn.danger-ghost:hover {
  color: var(--negative);
  background: color-mix(in srgb, var(--negative) 8%, transparent);
  border-color: var(--negative);
}

.btn.danger {
  color: #ffffff;
  background: var(--negative);
  border-color: var(--negative);
}

.btn.danger:hover {
  color: #ffffff;
  background: color-mix(in srgb, var(--negative) 86%, #000000);
  border-color: color-mix(in srgb, var(--negative) 86%, #000000);
}

.icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.btn.small {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.84rem;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.btn.is-loading::before {
  content: "";
  width: 0.85em;
  height: 0.85em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@media (prefers-color-scheme: dark) {
  .btn:not(.secondary):not(.danger-ghost) {
    color: #0b111a;
  }
  .btn:not(.secondary):not(.danger-ghost):hover {
    color: #0b111a;
  }
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label,
label.field-label {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.field-hint {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-top: 16px;
}

.form-inline .field {
  flex: 1 1 240px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font: inherit;
  font-size: max(1rem, 1em);
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
  color: var(--ink-soft);
  opacity: 0.72;
}

input:user-invalid,
select:user-invalid {
  border-color: var(--negative);
}

input:focus-visible,
select:focus-visible,
a:focus-visible,
button:focus-visible,
summary:focus-visible,
.table-wrap:focus-visible {
  border-color: var(--brand);
  outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent);
  outline-offset: 2px;
}

.errorlist {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--negative);
  font-size: 0.84rem;
  font-weight: 600;
}

/* Badges & Messages */
.messages {
  margin-bottom: 18px;
}

.msg {
  margin-bottom: 10px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.msg.success {
  border-left-color: var(--positive);
}

.msg.warning {
  border-left-color: var(--warning);
}

.msg.error {
  border-left-color: var(--negative);
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 9px;
  color: var(--ink-soft);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.badge.ok {
  color: var(--positive);
  border-color: color-mix(in srgb, var(--positive) 35%, var(--line));
  background: color-mix(in srgb, var(--positive) 10%, transparent);
}

.badge.warn {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 38%, var(--line));
  background: color-mix(in srgb, var(--warning) 10%, transparent);
}

.badge.brand {
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  background: var(--brand-soft);
}

/* Tables */
.table-wrap {
  container-type: inline-size;
  overflow-x: auto;
  max-inline-size: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 10px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.actions-cell {
  text-align: right;
  white-space: nowrap;
}

@container (max-width: 580px) {
  .responsive-table,
  .responsive-table thead,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table th,
  .responsive-table td {
    display: block;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  .responsive-table tr:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .responsive-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 0;
  }

  .responsive-table td::before {
    content: attr(data-label);
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-weight: 700;
    flex: 0 0 auto;
  }

  .responsive-table td.actions-cell {
    justify-content: flex-start;
    padding-top: 8px;
  }

  .responsive-table td.actions-cell::before {
    display: none;
  }
}

/* Drive Link Pills & Code */
.drive-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.drive-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.drive-pill:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}

code {
  padding: 2px 6px;
  color: var(--brand);
  background: var(--surface-muted);
  border-radius: 6px;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

/* Stats & Logs (Verwaltung) */
.connection-state {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat {
  display: flex;
  min-height: 118px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.stat-link:hover {
  color: var(--brand);
  border-color: var(--brand);
  transform: translateY(-2px);
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.stat-value small {
  color: var(--ink-soft);
  font-size: 1rem;
  font-weight: 600;
}

.stat-label {
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 650;
}

.log-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.45fr) auto;
  gap: 10px;
  margin-bottom: 16px;
}

.log-list {
  border-top: 1px solid var(--line);
}

.log-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
}

.log-entry[hidden] {
  display: none;
}

.log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.log-summary {
  display: flex;
  min-width: 112px;
  gap: 8px;
  align-items: flex-end;
  flex-direction: column;
  text-align: right;
  font-size: 0.82rem;
}

.status-ok .status-badge {
  color: var(--positive);
}

.status-failed .status-badge,
.log-error {
  color: var(--negative);
}

.status-running .status-badge {
  color: var(--brand);
}

.status-aborted .status-badge {
  color: var(--warning);
}

.log-error {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.log-entry details {
  margin-top: 8px;
}

.log-entry summary {
  color: var(--brand);
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
}

.change-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.86rem;
}

/* Simulation Personas */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.persona-btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

/* Events & Lager Series Cards */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-pill {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.filter-pill:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.filter-pill[aria-pressed="true"] {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 750;
}

.person-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.person-filter-row input {
  max-width: 320px;
}

.series-section {
  margin-bottom: 28px;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.series-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.series-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.series-header h3 {
  margin-bottom: 6px;
  font-size: 1.15rem;
}

.year-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.year-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.year-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.archived-years {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.archived-years .badge {
  text-decoration: none;
}

.year-create-form {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}

.year-input {
  width: 96px;
  min-height: 36px;
  padding: 5px 10px;
}

.year-create-form .btn {
  flex: 1 1 auto;
}

/* Admin Directory Cards */
.admin-section {
  margin-bottom: 26px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.admin-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.admin-card p {
  margin-bottom: 0;
}

/* Confirm Dialog */
.confirm-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
}

.confirm-dialog-body {
  padding: 24px;
}

.confirm-dialog-body h2 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.confirm-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Accessible Combobox */
.combobox-wrap {
  position: relative;
}

.combobox-list {
  position: absolute;
  inset-block-start: calc(100% + 4px);
  inset-inline: 0;
  z-index: 30;
  max-block-size: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.combobox-list[hidden] {
  display: none;
}

.combobox-option {
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.94rem;
}

.combobox-option:hover,
.combobox-option.is-focused {
  background: var(--brand-soft);
  color: var(--brand);
}

.combobox-option[aria-selected="true"] {
  font-weight: 700;
}

.combobox-empty {
  padding: 9px 12px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

/* Empty & Utility */
.empty-state {
  padding: 12px 0 4px;
}

.empty-state h3 {
  margin-bottom: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-card {
  max-width: 540px;
}

.simple-list {
  margin: 0;
  padding-left: 20px;
}

.simple-list li + li {
  margin-top: 6px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Breakpoints */
@media (max-width: 760px) {
  .stepper,
  .steps-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat {
    min-height: 94px;
  }

  .log-controls {
    grid-template-columns: 1fr 1fr;
  }

  .log-controls .btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .site-header {
    position: relative;
  }

  .header-bar {
    flex-wrap: wrap;
    padding-block: 10px;
    min-height: 60px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-list {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px solid var(--line);
  }

  .site-nav.is-open .nav-list,
  .nav-list.is-open {
    display: flex;
  }

  .site-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .header-bar:has(.nav-list.is-open) .site-nav {
    flex: 1 0 100%;
    justify-content: space-between;
  }

  .nav-list a {
    width: 100%;
    padding: 10px 12px;
  }

  .nav-logout {
    margin-inline-start: 0;
    padding-inline-start: 0;
    padding-top: 6px;
    margin-top: 4px;
    border-inline-start: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .header-bar,
  main,
  .site-footer {
    width: min(100% - 24px, 1120px);
  }

  .card {
    padding: 18px;
    border-radius: 14px;
  }

  .hero {
    padding: 24px 20px;
  }

  .log-entry {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .log-summary {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    text-align: left;
  }

  .log-controls {
    grid-template-columns: 1fr;
  }

  .log-controls .btn {
    grid-column: auto;
  }
}

@media (max-width: 440px) {
  .btn:not(.small) {
    width: 100%;
  }

  .row .btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Migration: Explorer-Ansicht */
.mig-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.mig-side { display: grid; gap: 20px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.mig-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; margin-bottom: 14px;
  background: var(--surface-muted); border-radius: var(--radius-sm); font-size: 0.92rem; }
.mig-crumbs a { color: var(--brand); text-decoration: none; }
.mig-crumbs a:hover { text-decoration: underline; }
.mig-current { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; padding: 14px;
  margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-subtle); }
.mig-current h3 { margin: 2px 0 4px; }
.small-link { font-size: 0.8rem; font-weight: 400; }
.mig-head, .mig-row { display: grid; grid-template-columns: minmax(0, 1.1fr) 150px minmax(0, 1.4fr); gap: 12px; align-items: start; }
.mig-head { padding: 0 10px 6px; color: var(--ink-soft); font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; border-bottom: 1px solid var(--line); }
.mig-list { list-style: none; margin: 0; padding: 0; }
.mig-row { padding: 10px; border-bottom: 1px solid var(--line); }
.mig-row:hover { background: var(--surface-subtle); }
.mig-name { display: inline-flex; gap: 8px; align-items: center; color: var(--ink); font-weight: 600; text-decoration: none;
  min-width: 0; padding-top: 6px; }
.mig-name span:first-of-type { overflow-wrap: anywhere; }
.mig-name .icon { width: 18px; height: 18px; flex: none; color: var(--brand); }
.mig-name:hover span:first-of-type { text-decoration: underline; }
.mig-meta { font-size: 0.82rem; padding-top: 8px; }
.mig-target { display: grid; gap: 6px; min-width: 0; }
.mig-select { font-size: 0.88rem; }
.mig-select:not(.is-set) { color: var(--ink-soft); }
.mig-select.is-set { border-color: var(--brand); }
.mig-sub { font-size: 0.85rem; }
.mig-files { margin-top: 14px; font-size: 0.9rem; }
.mig-files summary { cursor: pointer; color: var(--ink-soft); }
.mig-files ul { margin: 8px 0 0; padding-left: 20px; max-height: 320px; overflow: auto; }
.mig-save { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 14px;
  padding: 12px 0 4px; background: var(--surface); border-top: 1px solid var(--line); }
.mig-rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; font-size: 0.86rem; }
.mig-rules li { display: grid; gap: 3px; padding-bottom: 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.mig-tag { display: inline-block; width: fit-content; padding: 2px 8px; border-radius: 999px; font-size: 0.8rem;
  border: 1px solid var(--line); background: var(--surface-muted); color: var(--ink-soft); overflow-wrap: anywhere; }
.mig-drive-01_vorstand { color: #7a1fa2; background: color-mix(in srgb, #7a1fa2 10%, transparent); border-color: color-mix(in srgb, #7a1fa2 35%, var(--line)); }
.mig-drive-02_illnau { color: #0b6bcb; background: color-mix(in srgb, #0b6bcb 10%, transparent); border-color: color-mix(in srgb, #0b6bcb 35%, var(--line)); }
.mig-drive-03_effi { color: #b45309; background: color-mix(in srgb, #b45309 10%, transparent); border-color: color-mix(in srgb, #b45309 35%, var(--line)); }
.mig-drive-04_gemeinsam { color: var(--positive); background: color-mix(in srgb, var(--positive) 10%, transparent); border-color: color-mix(in srgb, var(--positive) 35%, var(--line)); }
.mig-drive-05_dachverein, .mig-drive-06_fotos { color: var(--brand); background: var(--brand-soft); }
.mig-drive-skip { text-decoration: line-through; }
@media (prefers-color-scheme: dark) {
  .mig-drive-01_vorstand { color: #d79bf0; }
  .mig-drive-02_illnau { color: #7cb8ff; }
  .mig-drive-03_effi { color: #f3b26b; }
}
@media (max-width: 1000px) {
  .mig-layout { grid-template-columns: 1fr; }
  .mig-side { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .mig-head { display: none; }
  .mig-row, .mig-current { grid-template-columns: 1fr; gap: 6px; }
  .mig-meta { padding-top: 0; }
}
