/*
 * AI-Act-Kompass — Anti-AI-Design.
 * Gestaltungsprinzip: technisches Druckwerk statt SaaS-Dashboard.
 * Papierton, Serifenschrift, Hairlines, rechteckige "Stempel" —
 * keine Verläufe, keine Schatten, keine Rundungen, keine Emojis.
 */
:root {
  --paper: #f4f1ea;
  --panel: #fdfcf8;
  --ink: #14120e;
  --muted: #6b675e;
  --line: #14120e;
  --hairline: #c9c4b8;
  --accent: #a3271e;
  --ok: #2d5d3a;
  --warn: #8a6d1a;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Courier New', monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
}

.layout { display: flex; min-height: 100vh; }

/* ── Seitenleiste: Kolumnentitel eines Fachblatts ─────────────────── */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--paper);
  border-right: 2px solid var(--ink);
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-bottom: 3px double var(--ink);
  padding-bottom: 12px;
}
.sidebar .brand small {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 8px;
}
.sidebar nav { display: flex; flex-direction: column; margin-top: 22px; }
.sidebar button {
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  padding: 12px 4px;
  font-family: var(--serif);
  font-size: 15px;
  cursor: pointer;
}
.sidebar button:hover { color: var(--accent); }
.sidebar button.active {
  font-weight: 700;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}
.sidebar .foot {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  line-height: 1.8;
  border-top: 1px solid var(--ink);
  padding-top: 12px;
}

.main { flex: 1; padding: 32px 40px; max-width: 1060px; }

h1 { font-size: 26px; margin: 0 0 6px; font-weight: 700; }
h2 { font-size: 16px; margin: 22px 0 10px; }
.sub { color: var(--muted); font-size: 15px; margin: 0 0 22px; font-style: italic; }

.panel {
  background: var(--panel);
  border: 1px solid var(--ink);
  padding: 20px 22px;
  margin-bottom: 18px;
}

/* ── Kennzahlen ───────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; }
.grid .stat { padding: 0 18px; border-left: 1px solid var(--hairline); }
.grid .stat:first-child { border-left: none; padding-left: 0; }
.stat .num { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .lbl {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Tabellen ─────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-family: var(--mono);
  color: var(--ink);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 2px solid var(--ink);
}
th, td { padding: 10px; }
td { border-bottom: 1px solid var(--hairline); vertical-align: top; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #efe9dc; }

/* ── Risiko-Stempel ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border: 1.5px solid currentColor;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
  background: transparent;
}
.badge.high { color: var(--accent); }
.badge.prohibited { color: var(--panel); background: var(--accent); border-color: var(--accent); }
.badge.limited { color: var(--warn); }
.badge.minimal { color: var(--ok); }
.badge.out-of-scope { color: var(--muted); }

/* ── Buttons: Stempelkissen-Optik ─────────────────────────────────── */
button.primary, button.ghost, button.danger {
  padding: 9px 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: 1.5px solid var(--ink);
  background: var(--panel);
  color: var(--ink);
}
button.primary { background: var(--ink); color: var(--paper); }
button.primary:hover { background: var(--accent); border-color: var(--accent); }
button.primary:disabled { opacity: 0.4; cursor: not-allowed; }
button.ghost:hover { border-color: var(--accent); color: var(--accent); }
button.danger { border-color: var(--accent); color: var(--accent); }
button.danger:hover { background: var(--accent); color: var(--paper); }

/* ── Formulare ────────────────────────────────────────────────────── */
label.field { display: block; margin-bottom: 14px; font-size: 14px; }
label.field span {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
input[type='text'], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--ink);
  font-size: 14px;
  font-family: var(--serif);
  background: #fff;
  color: var(--ink);
  border-radius: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 22px; }
.logo-row { display: flex; align-items: center; gap: 16px; margin-top: 6px; flex-wrap: wrap; }
.logo-preview {
  max-height: 56px;
  max-width: 180px;
  object-fit: contain;
  border: 1px solid var(--hairline);
  padding: 6px;
  background: #fff;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 13px;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--ink);
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 14.5px;
  background: var(--panel);
}
.check:hover { border-left-color: var(--accent); }
.check input { margin-top: 4px; accent-color: var(--accent); }
.check .ref {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

/* ── Wizard ───────────────────────────────────────────────────────── */
.wizard-steps { display: flex; gap: 0; margin-bottom: 20px; flex-wrap: wrap; border: 1px solid var(--ink); }
.wizard-steps .step {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 7px 12px;
  border-right: 1px solid var(--hairline);
  color: var(--muted);
  background: var(--panel);
}
.wizard-steps .step:last-child { border-right: none; }
.wizard-steps .step.current { background: var(--ink); color: var(--paper); }
.wizard-steps .step.done { color: var(--ink); font-weight: 700; }

.wizard-nav { display: flex; justify-content: space-between; margin-top: 20px; }

.reasons li { margin-bottom: 7px; font-size: 14.5px; }
.hint { font-size: 13px; color: var(--muted); }
.disclaimer {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  padding: 9px 13px;
  background: var(--panel);
  margin-top: 22px;
}

/* ── Fristen ──────────────────────────────────────────────────────── */
.deadline-list { list-style: none; padding: 0; margin: 0; }
.deadline-list li {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 14.5px;
  align-items: baseline;
}
.deadline-list li:last-child { border-bottom: none; }
.deadline-list .date {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  min-width: 96px;
}
.deadline-list .past { color: var(--muted); text-decoration: line-through; }

/* ── Dokumentvorschau ─────────────────────────────────────────────── */
.doc-preview {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 18px;
  font-family: var(--mono);
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  max-height: 420px;
  overflow-y: auto;
}

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 16px; }
.empty { text-align: center; color: var(--muted); padding: 44px 0; font-size: 14.5px; font-style: italic; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.table-scroll { overflow-x: auto; }

/* ── Sprachumschalter ─────────────────────────────────────────────── */
.lang-switch { display: flex; gap: 0; margin-top: 18px; border: 1px solid var(--ink); align-self: flex-start; }
.lang-switch button {
  border: none; border-right: 1px solid var(--ink); border-radius: 0;
  padding: 6px 12px; background: var(--panel); color: var(--ink);
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; cursor: pointer;
}
.lang-switch button:last-child { border-right: none; }
.lang-switch button.active { background: var(--ink); color: var(--paper); }

/* ── Aufgabenliste (abhakbar) ─────────────────────────────────────── */
.task-list { list-style: none; padding: 0; margin: 0; }
.task {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 4px; border-bottom: 1px solid var(--hairline);
}
.task:last-child { border-bottom: none; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-check input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--accent); cursor: pointer; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14.5px; font-weight: 600; }
.task-meta {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 3px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.task-system {
  border: none; background: none; padding: 0; cursor: pointer;
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  text-decoration: underline; text-underline-offset: 2px;
}

.progress-label { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.progress-track { height: 12px; border: 1px solid var(--ink); background: var(--panel); }
.progress-fill { height: 100%; background: var(--ink); transition: width 0.3s ease; }

/* ── Rechtlicher Hinweis (Erststart) ──────────────────────────────── */
.gate-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 18, 14, 0.6);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.gate {
  background: var(--paper); border: 2px solid var(--ink);
  max-width: 620px; max-height: 90vh; overflow-y: auto; padding: 26px 28px;
}
.gate h1 { border-bottom: 3px double var(--ink); padding-bottom: 10px; }
.gate p { font-size: 14.5px; line-height: 1.6; }
.gate button { margin-top: 10px; }

/* ── Responsiv: Tablet & Handy ────────────────────────────────────── */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; border-right: none; border-bottom: 2px solid var(--ink);
    padding: 14px 16px; flex-direction: column;
  }
  .sidebar .brand { font-size: 17px; padding-bottom: 8px; }
  .sidebar nav {
    flex-direction: row; overflow-x: auto; margin-top: 10px; gap: 0;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar nav button {
    white-space: nowrap; border-bottom: none; border-right: 1px solid var(--hairline);
    padding: 9px 12px; font-size: 13.5px;
  }
  .sidebar button.active { border-left: none; padding-left: 12px; background: var(--ink); color: var(--paper); }
  .sidebar .foot { display: none; }
  .lang-switch { position: absolute; top: 14px; right: 16px; margin-top: 0; }
  .sidebar { position: relative; }
  .main { padding: 18px 14px; }
  h1 { font-size: 21px; }
  .panel { padding: 14px 14px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px 0; }
  .grid .stat:nth-child(odd) { border-left: none; padding-left: 0; }
  .grid .stat:nth-child(even) { padding-left: 14px; }
  .stat .num { font-size: 26px; }
  .wizard-steps { border: none; gap: 4px; }
  .wizard-steps .step { border: 1px solid var(--hairline); }
  .deadline-list li { flex-direction: column; gap: 2px; }
  button.primary, button.ghost, button.danger { padding: 10px 14px; }
  .task { padding: 12px 2px; }
  .task-check input { width: 22px; height: 22px; }
}
