:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --line: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- Kopf ---------- */
.topbar { background: #0f172a; color: #fff; box-shadow: var(--shadow); }
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 24px 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { font-size: 28px; }
.brand h1 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: .2px; }
.brand .sub { font-size: 12.5px; color: #94a3b8; }
.demo-badge {
  background: #f59e0b; color: #1e1b04; font-weight: 700; font-size: 12px;
  padding: 4px 10px; border-radius: 999px; letter-spacing: .5px; cursor: help;
}
.tabs {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; gap: 4px; overflow-x: auto;
}
.tabs a {
  color: #cbd5e1; text-decoration: none; padding: 9px 14px; font-size: 14px;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: #fff; }
.tabs a.aktiv { color: #fff; border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- Inhalt ---------- */
.content { max-width: 1200px; margin: 24px auto 80px; padding: 0 24px; }

.karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.karte {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.karte .wert { font-size: 26px; font-weight: 700; }
.karte .label { color: var(--muted); font-size: 13px; margin-top: 2px; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.panel h2 { margin: 0 0 12px; font-size: 16.5px; }
.panel h3 { margin: 18px 0 8px; font-size: 14.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }

/* ---------- Tabellen ---------- */
.tabelle-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
tr:hover td { background: #f8fafc; }
td.num, th.num { text-align: right; }

.diff-alt { color: var(--red); text-decoration: line-through; text-decoration-thickness: 1px; }
.diff-neu { color: var(--green); font-weight: 600; }
.diff-pfeil { color: var(--muted); padding: 0 4px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge.klasse-A { background: var(--green-bg); color: var(--green); border: 1px solid #bbf7d0; }
.badge.klasse-B { background: var(--amber-bg); color: var(--amber); border: 1px solid #fde68a; }
.badge.klasse-C { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.badge.klasse-TABU { background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; }

.badge.st-offen        { background: #eff6ff; color: var(--accent); border: 1px solid #bfdbfe; }
.badge.st-angewendet   { background: var(--green-bg); color: var(--green); border: 1px solid #bbf7d0; }
.badge.st-verifiziert  { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge.st-zurueckgerollt { background: #f1f5f9; color: var(--muted); border: 1px solid var(--line); }
.badge.st-konflikt, .badge.st-fehler { background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; }
.badge.st-blockiert    { background: #18181b; color: #fafafa; }

.badge.batch-Entwurf { background: #eff6ff; color: var(--accent); border: 1px solid #bfdbfe; }
.badge.batch-Pilot { background: var(--amber-bg); color: var(--amber); border: 1px solid #fde68a; }
.badge.batch-Angewendet { background: var(--green-bg); color: var(--green); border: 1px solid #bbf7d0; }
.badge.batch-Verifiziert { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge.batch-Zurückgerollt, .badge.batch-Teilweise { background: #f1f5f9; color: var(--muted); border: 1px solid var(--line); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { background: #cbd5e1; cursor: not-allowed; }
.btn.sekundaer { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.sekundaer:hover { background: #f8fafc; }
.btn.gefahr { background: var(--red); }
.btn.gefahr:hover { background: #b91c1c; }
.btn.ghost { background: transparent; color: var(--muted); padding: 4px 8px; font-size: 16px; }
.btn.ghost:hover { color: var(--text); background: #f1f5f9; }
.btn.klein { padding: 4px 10px; font-size: 12.5px; }
.aktionen { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }

/* ---------- Upload ---------- */
.dropzone {
  border: 2px dashed #94a3b8; border-radius: var(--radius); background: #f8fafc;
  padding: 46px 20px; text-align: center; cursor: pointer; transition: all .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: #eff6ff; }
.dropzone .gross { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.dropzone .klein-text { color: var(--muted); font-size: 13.5px; }

/* ---------- Workflow-Leiste ---------- */
.workflow { display: flex; flex-wrap: wrap; gap: 0; margin: 6px 0 18px; }
.schritt { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.schritt .punkt {
  width: 26px; height: 26px; border-radius: 50%; background: #e2e8f0; color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.schritt.fertig .punkt { background: var(--green); color: #fff; }
.schritt.aktiv .punkt { background: var(--accent); color: #fff; }
.schritt .name { font-size: 13.5px; color: var(--muted); }
.schritt.fertig .name, .schritt.aktiv .name { color: var(--text); font-weight: 600; }
.schritt-linie { flex: 0 0 34px; height: 2px; background: var(--line); margin: 0 8px; align-self: center; }

/* ---------- Sonstiges ---------- */
.hinweis {
  background: var(--amber-bg); border: 1px solid #fde68a; border-radius: 8px;
  padding: 10px 14px; font-size: 13.5px; margin: 10px 0;
}
.hinweis.blau { background: #eff6ff; border-color: #bfdbfe; }
.hinweis.rot { background: var(--red-bg); border-color: #fecaca; }
.leer { color: var(--muted); font-style: italic; padding: 18px 0; text-align: center; }
.muted { color: var(--muted); }
.mono { font-family: Consolas, monospace; font-size: 13px; }
a.link { color: var(--accent); text-decoration: none; font-weight: 600; }
a.link:hover { text-decoration: underline; }
.hidden { display: none !important; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 11px 22px; border-radius: 999px;
  font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 60;
  max-width: 90vw;
}
.toast.fehler { background: var(--red); }

.modal {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px;
}
.modal-box {
  background: #fff; border-radius: 12px; max-width: 820px; width: 100%;
  max-height: 84vh; overflow-y: auto; padding: 20px 24px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-head h2 { margin: 0; font-size: 17px; }

.lade { text-align: center; color: var(--muted); padding: 40px 0; }

@media (max-width: 700px) {
  .content { padding: 0 12px; }
  .topbar-inner { padding: 12px 12px 4px; }
  .tabs { padding: 0 12px; }
}
