/* Inter – lokal eingebunden, damit die Schrift in jedem Browser und auf
   jedem Betriebssystem identisch aussieht (kein Google-Fonts-CDN). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/InterVariable.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/InterVariable-Italic.woff2") format("woff2");
}

:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --border: #dde3ea;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2b3a55;
  --primary-light: #3d5279;
  --accent: #1c7c54;
  --accent-bg: #e7f5ee;
  --warn-bg: #fff4e5;
  --warn: #9a5b00;
  --radius: 8px;

  /* Rückmeldungen: Erfolg / Fehler / Warnung */
  --ok-bg: #e8f5ee;
  --ok-border: #b6ddc7;
  --ok-text: #1f5c41;
  --fehler-bg: #fdecec;
  --fehler-border: #e6b3b3;
  --fehler-text: #8f2a2a;
  --hinweis-bg: #fff6e5;
  --hinweis-border: #e8cf9a;
  --hinweis-text: #7a5a1e;

  /* Statuslampen */
  --lampe-an: #2e9e63;
  --lampe-an-hof: rgba(46, 158, 99, 0.18);
  --lampe-aus: #c9973f;
  --lampe-aus-hof: rgba(201, 151, 63, 0.18);
  --lampe-inaktiv: #b9b9b9;
  --lampe-inaktiv-hof: rgba(0, 0, 0, 0.06);

  /* Kopfzeile (dunkler Grund) */
  --kopf-text: #ffffff;
  --kopf-text-leise: #e0e0e0;
  --kopf-text-hover: #b3b3b3;

  /* neutrale Fläche für Badges und Statuszeilen */
  --flaeche: #eef1f6;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.app-header {
  background: var(--primary);
  color: white;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.brand { font-weight: 600; font-size: 1.1rem; }
.projekt-kontext { font-size: 0.85rem; opacity: 0.85; }
.layout { display: flex; min-height: calc(100vh - 56px); flex-wrap: wrap; }
.steps {
  width: 220px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
}
.step-btn {
  border: none; background: none; text-align: left; padding: 12px 20px;
  font-size: 0.9rem; cursor: pointer; color: var(--text); border-left: 3px solid transparent;
}
.step-btn:hover { background: var(--bg); }
.step-btn.active { border-left-color: var(--accent); background: var(--accent-bg); font-weight: 600; }
.content { flex: 1; padding: 24px 32px; max-width: 980px; min-width: 280px; }
h1 { font-size: 1.4rem; margin-top: 0; }
h2 { font-size: 1.1rem; color: var(--primary); }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 4px; margin-top: 10px; }
input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.9rem; font-family: inherit;
}
textarea { min-height: 60px; resize: vertical; }
button.btn, a.btn {
  background: var(--primary); color: white; border: none; padding: 8px 16px; border-radius: 6px;
  cursor: pointer; font-size: 0.85rem; margin-top: 10px; margin-right: 6px;
  display: inline-block; text-decoration: none; box-sizing: border-box;
}
button.btn:hover, a.btn:hover { background: var(--primary-light); }
button.btn.secondary, a.btn.secondary { background: white; color: var(--primary); border: 1px solid var(--border); }
button.btn.accept, a.btn.accept { background: var(--accent); }
button.btn.danger, a.btn.danger { background: #b23a3a; }
button.btn:disabled, a.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; background: white; }
.card.bestaetigt { border-left: 4px solid var(--accent); }
.card .meta { font-size: 0.75rem; color: var(--muted); margin-top: 6px; }
.badge { display: inline-block; font-size: 0.7rem; padding: 2px 8px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); margin-left: 6px; }
.badge.confirmed { background: var(--accent-bg); color: var(--accent); }
.badge.danger { background: var(--fehler-bg); color: var(--fehler-text); }
.vorschlag { background: var(--warn-bg); border: 1px dashed #e0b976; border-radius: 6px; padding: 8px 10px; margin-top: 6px; font-size: 0.85rem; }
.vorschlag .begruendung { color: var(--muted); font-size: 0.75rem; display: block; margin-top: 4px; }
.hint { font-size: 0.8rem; color: var(--muted); background: #eef1f6; border-radius: 6px; padding: 10px 12px; margin-bottom: 14px; }
.two-col { display: flex; gap: 20px; flex-wrap: wrap; }
.two-col > * { flex: 1; min-width: 180px; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.checkbox-row { display: flex; align-items: center; gap: 6px; margin: 4px 0; font-size: 0.85rem; }
.checkbox-row input { width: auto; }
.empty-state { color: var(--muted); font-style: italic; padding: 20px 0; }
.breadcrumb-trail { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.row-buttons { margin-top: 6px; }
.app-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
@media print {
  .app-header, .steps, .row-buttons, .hint, input, select, .two-col button { display: none !important; }
  .content { max-width: 100%; padding: 0; }
  .panel { border: none; box-shadow: none; }
}

/* --- Ergänzungen v2 --- */
.banner { border-radius: 6px; padding: 10px 12px; margin-bottom: 14px; font-size: 0.82rem; border: 1px solid transparent; }
.banner.ki { background: var(--accent-bg); color: var(--accent); border-color: #bfe3d2; }
.banner.regel { background: var(--warn-bg); color: var(--warn); border-color: #e0b976; }
.banner.fehler { background: #fdecec; color: #b23a3a; border-color: #f0c2c2; }
.vorschlag textarea { min-height: 46px; margin-top: 4px; background: white; font-size: 0.85rem; }
.vorschlag .herkunft { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.pill { display: inline-block; font-size: 0.68rem; padding: 1px 7px; border-radius: 10px; background: #eef1f6; color: var(--muted); margin-left: 6px; }
.pill.ki { background: #e8eefc; color: #2f4b8f; }
.pill.regel { background: var(--warn-bg); color: var(--warn); }
.pill.manuell { background: #eef1f6; color: var(--muted); }
.pill.bibliothek { background: #f0e9fb; color: #5b3fa0; }
.aehnlich { background: #f6f2ff; border: 1px dashed #c3b0e8; border-radius: 6px; padding: 8px 10px; margin-top: 6px; font-size: 0.82rem; }
.fortschritt { font-size: 0.8rem; color: var(--muted); margin-top: 8px; }
.edit-form { background: #f8fafc; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-top: 8px; }
.protokoll-tabelle td { vertical-align: top; font-size: 0.78rem; }
.zaehler { display: inline-block; background: var(--primary); color: white; border-radius: 10px; font-size: 0.7rem; padding: 1px 8px; margin-left: 6px; }
.merge-box { border: 1px dashed var(--primary); border-radius: 6px; padding: 10px 12px; margin-top: 10px; font-size: 0.85rem; }

.balken { position: relative; height: 6px; border-radius: 4px; background: var(--flaeche); overflow: hidden; margin-top: 8px; display: none; }
.balken.aktiv { display: block; }
.balken .balken-fuellung {
  position: absolute; top: 0; height: 100%; width: 40%; border-radius: 4px;
  background: var(--primary); animation: balken-lauf 1.1s ease-in-out infinite;
}
@keyframes balken-lauf {
  0%   { left: -40%; }
  50%  { left: 30%; }
  100% { left: 100%; }
}
