/* ── CSS-Variablen & Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --imi-dark:   #05263d;
  --imi-navy:   #0b3c5d;
  --imi-teal:   #00bfae;
  --imi-teal-d: #00897b;
  --imi-bg:     #f8fafc;
  --imi-border: #d1dce6;
  --imi-muted:  #5a7080;
  --imi-light:  #e7f3fd;
}

/* ── Base & Layout ───────────────────────────────────────────────────────── */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--imi-bg);
  color: #333;
  line-height: 1.6;
  font-size: 15px;
}
.container {
  max-width: 1000px;
  margin: 30px auto;
  padding: 0 20px;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
  background: linear-gradient(90deg, var(--imi-dark) 0%, var(--imi-navy) 100%);
  padding: 15px 25px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.sitename {
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.sitename img { height: 32px; width: auto; }

/* ── Navigation / Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb { margin-top: 8px; font-size: 12px; color: #cbd5e1; }
.breadcrumb a { color: #fff; text-decoration: none; }
.breadcrumb a:hover { color: var(--imi-teal); }
.back-link {
  display: inline-block;
  margin-bottom: 15px;
  text-decoration: none;
  color: var(--imi-navy);
  font-size: 14px;
  font-weight: 700;
}
.back-link:hover { color: var(--imi-teal-d); }

/* ── Intro-Box ───────────────────────────────────────────────────────────── */
.imi-intro {
  background: linear-gradient(90deg, var(--imi-light), #f4faff);
  border-left: 5px solid var(--imi-navy);
  padding: 24px 28px;
  border-radius: 4px;
  margin-bottom: 22px;
}
.imi-intro h2 { margin-bottom: 10px; color: var(--imi-navy); font-size: 20px; }
.imi-intro p  { font-size: 15px; color: #444; }

/* ── Content-Box ─────────────────────────────────────────────────────────── */
.content-box {
  background: #fff;
  border: 1px solid var(--imi-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,.05);
  margin-bottom: 22px;
}
.box-header {
  background: var(--imi-navy);
  color: #fff;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.box-body { padding: 24px 28px; }
.box-body ul { padding-left: 18px; font-size: 14px; }
.box-body ul li { margin-bottom: 6px; }
.box-body p { font-size: 14px; margin-bottom: 8px; }
.box-body p:last-child { margin-bottom: 0; }

/* ── Formular-Elemente ───────────────────────────────────────────────────── */
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--imi-muted);
  margin-bottom: 4px;
  margin-top: 14px;
}
label:first-of-type { margin-top: 0; }
input[type=text],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--imi-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #1a2634;
  transition: border .2s;
}
input[type=text]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--imi-navy);
  box-shadow: 0 0 0 3px rgba(11,60,93,.12);
}
textarea { resize: vertical; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all .2s;
  font-family: inherit;
  min-height: 44px;
}
.btn:focus-visible { outline: 3px solid var(--imi-teal); outline-offset: 2px; }
.btn-primary  { background: var(--imi-navy); color: #fff; }
.btn-primary:hover:not(:disabled)  { background: #1565a0; }
.btn-primary:disabled { background: #94a3b8; cursor: not-allowed; }
.btn-outline  { background: #fff; color: var(--imi-navy); border: 2px solid var(--imi-navy); }
.btn-outline:hover  { background: var(--imi-navy); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; min-height: 32px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; margin-bottom: 22px; }

/* ── Grid-Helpers ────────────────────────────────────────────────────────── */
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Accessibility-Utilities ─────────────────────────────────────────────── */
/* GEÄNDERT v2.1: sr-only für visuell versteckte, aber screenreader-sichtbare Elemente
   Quelle: https://www.w3.org/WAI/WCAG21/Techniques/css/C7 */
.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;
}

/* ── Tool-spezifische Styles ─────────────────────────────────────────────── */

/* Info-Band (Skala-Erklärung) */
.info-band {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--imi-light);
  border-radius: 6px;
  font-size: 13px;
  color: var(--imi-navy);
}

/* Risiko-Zeilen */
.risk-header {
  display: grid;
  grid-template-columns: 1fr 90px 90px 90px 180px 40px;
  gap: 8px;
  padding: 0 14px;
  margin-bottom: 4px;
}
.risk-header span {
  font-size: 12px;
  font-weight: 700;
  color: var(--imi-muted);
}
.col-center { text-align: center; }

.risk-row {
  display: grid;
  grid-template-columns: 1fr 90px 90px 90px 180px 40px;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
  padding: 10px 14px;
  border: 1px solid #e8eef4;
  border-radius: 6px;
  background: #fafcff;
}
.risk-row select { text-align: center; }

/* Löschen-Button */
.del-btn {
  background: #fee2e2;
  color: #c53030;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 16px;
  line-height: 1;
  min-height: 36px;
  min-width: 36px;
  transition: background .15s;
}
.del-btn:hover { background: #fca5a5; }

/* Matrix */
.matrix-scroll { overflow-x: auto; }

/* Legende */
.legend {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.legend-item {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}
.legend-low   { background: #dcfce7; color: #166534; }
.legend-med   { background: #fef9c3; color: #854d0e; }
.legend-high  { background: #fed7aa; color: #9a3412; }
.legend-vhigh { background: #fee2e2; color: #9f1239; }

/* Risikobadges in Tabelle */
.risk-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge-low   { background: #dcfce7; color: #166534; }
.badge-med   { background: #fef9c3; color: #854d0e; }
.badge-high  { background: #fed7aa; color: #9a3412; }
.badge-vhigh { background: #fee2e2; color: #9f1239; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  font-size: 13px;
  color: #64748b;
  margin-top: 40px;
  padding-bottom: 30px;
}
footer a { color: var(--imi-navy); text-decoration: none; margin: 0 10px; }
footer a:hover { color: var(--imi-teal-d); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .grid3 { grid-template-columns: 1fr; }
  .box-body { padding: 16px; }
  .risk-header,
  .risk-row {
    grid-template-columns: 1fr 60px 60px 60px 1fr 36px;
    gap: 4px;
  }
  .btn-row { flex-direction: column; }
}
