:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9dee8;
  --primary: #172f55;
  --primary-2: #244a82;
  --success: #166534;
  --success-bg: #dcfce7;
  --warning: #92400e;
  --warning-bg: #fef3c7;
  --danger: #991b1b;
  --danger-bg: #fee2e2;
  --shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--primary-2);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 30px clamp(20px, 5vw, 70px);
  color: white;
  background: linear-gradient(135deg, #112340, #274f87);
}

.topbar h1 {
  margin: 2px 0 6px;
  font-size: clamp(28px, 4vw, 44px);
}

.topbar p {
  margin: 0;
  opacity: 0.88;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  opacity: 0.72;
  font-size: 12px;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.content {
  width: min(1500px, calc(100% - 32px));
  margin: 28px auto 60px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.compact {
  gap: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card h2 {
  margin: 0 0 8px;
}

.muted {
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.metric strong {
  display: block;
  font-size: 30px;
}

.metric span {
  color: var(--muted);
}

.form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

label span {
  display: block;
  margin-bottom: 6px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c8d0dc;
  border-radius: 10px;
  padding: 11px 12px;
  background: white;
  color: var(--text);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(36, 74, 130, 0.15);
  border-color: var(--primary-2);
}

.button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.button:hover {
  background: var(--primary-2);
}

.button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.button.secondary {
  background: #e8edf5;
  color: var(--primary);
}

.button.danger {
  background: #b42318;
}

.button.small {
  padding: 7px 10px;
  font-size: 13px;
}

.message,
.result {
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  background: var(--success-bg);
  color: var(--success);
  overflow-wrap: anywhere;
}

.result {
  margin-top: 14px;
  margin-bottom: 0;
}

.message.error,
.result.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

small {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e8edf5;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.badge.bereit,
.badge.plausibel,
.badge.aktiv,
.badge.gesendet,
.badge.vollstaendig,
.badge.erledigt {
  background: var(--success-bg);
  color: var(--success);
}

.badge.pruefung_noetig,
.badge.warnungen,
.badge.teilweise_eingegangen,
.badge.offen,
.badge.bereit:not(.plausibel) {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge.fehler,
.badge.blockiert,
.badge.gesperrt,
.badge.verworfen {
  background: var(--danger-bg);
  color: var(--danger);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.locked {
  width: min(680px, calc(100% - 32px));
  margin: 50px auto;
}

.locked-card {
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (max-width: 1000px) {
  .grid.two,
  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .topbar {
    flex-direction: column;
  }
}

@media (max-width: 680px) {
  .grid.two,
  .metrics {
    grid-template-columns: 1fr;
  }

  .content {
    width: min(100% - 20px, 1500px);
  }

  .card {
    padding: 16px;
  }
}


.button.green {
  background: #166534;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.66);
}

.modal-card {
  width: min(900px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-radius: 18px;
  padding: 22px;
  background: white;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
}

.modal-card.wide {
  width: min(1500px, 100%);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.preview-meta {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.preview-meta div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.preview-meta strong,
.preview-meta span {
  display: block;
}

.preview-meta span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.validation-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.validation-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
}

.validation-item.passed {
  background: var(--success-bg);
  color: var(--success);
}

.validation-item.failed {
  background: var(--danger-bg);
  color: var(--danger);
}

.validation-item span {
  color: inherit;
}

.preview-table {
  min-width: 1300px;
}

@media (max-width: 1000px) {
  .preview-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
