:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --text: #1d1d1b;
  --muted: #6b6b66;
  --line: #e2e1dc;
  --accent: #b4391f; /* Bern red, toned down */
  --ok: #2f7d46;
  --hint: #3b6aa0;
  --warn: #a86a00;
  --bad: #b4231f;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); }
h1 { font-size: 1.6rem; margin: 0 0 0.25rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
h3 { font-size: 1rem; margin: 0; }
a { color: var(--accent); }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85em; }
.addr { word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.warn { color: var(--warn); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* — layout — */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1.25rem; background: var(--surface); border-bottom: 3px solid var(--accent);
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.topbar nav { display: flex; gap: 1rem; align-items: baseline; }
.topbar nav a { color: var(--text); text-decoration: none; }

.layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 52px); }
.sidebar { padding: 1.25rem; border-right: 1px solid var(--line); background: var(--surface); }
.main { padding: 1.5rem 2rem; max-width: 1000px; }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .main { padding: 1rem; }
}

.company-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.company-list a { display: block; padding: 0.35rem 0.5rem; border-radius: 4px; color: var(--text); text-decoration: none; }
.company-list a:hover { background: var(--bg); }
.company-list a.active { background: var(--accent); color: #fff; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1.25rem; margin: 1.25rem 0; }

.steps li { margin-bottom: 0.5rem; }

/* — forms — */

.stack { display: grid; gap: 0.6rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem 1rem; margin-top: 1rem; }
.grid.compact { padding-top: 1rem; border-top: 1px solid var(--line); }
.inline { display: flex; align-items: end; gap: 0.75rem; margin-top: 1rem; }
label { display: grid; gap: 0.2rem; font-size: 0.85rem; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 0.4rem; align-self: end; }
input, select {
  font: inherit; color: var(--text); padding: 0.4rem 0.55rem;
  border: 1px solid var(--line); border-radius: 4px; background: #fff; min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
button {
  font: inherit; padding: 0.45rem 0.9rem; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button:disabled { opacity: 0.6; cursor: progress; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); }
button.link.danger { color: var(--bad); }
.form-error { color: var(--bad); font-size: 0.8rem; margin: 0; }
.form-error:empty { display: none; }

details { border-top: 1px solid var(--line); padding: 0.6rem 0; }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: baseline; }

/* — tables — */

table { width: 100%; border-collapse: collapse; margin: 0.5rem 0 1rem; }
th, td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; }
thead th { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
tfoot th, tfoot td { border-bottom: 0; }
tr.bad td { color: var(--bad); font-weight: 600; }

.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 99px; font-size: 0.8rem; color: #fff; }
.badge.ok, .verdict.ok { background: var(--ok); }
.badge.hinweis, .verdict.hinweis { background: var(--hint); }
.badge.warnung, .verdict.warnung { background: var(--warn); }
.badge.fehler, .verdict.fehler { background: var(--bad); }

/* — login — */

.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-box { width: 100%; max-width: 360px; border-top: 3px solid var(--accent); }
.login-box h1 { margin-bottom: 1rem; }

/* — report — */

.report { background: #e9e8e4; }
.toolbar { display: flex; justify-content: space-between; align-items: center; max-width: 820px; margin: 1rem auto; padding: 0 1rem; }
.report-page { background: #fff; max-width: 820px; margin: 0 auto 2rem; padding: 2.5rem 3rem; box-shadow: 0 1px 4px rgb(0 0 0 / 0.08); }
.report-page h2 { margin-top: 2rem; padding-bottom: 0.3rem; border-bottom: 2px solid var(--text); }
.report-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem; color: var(--accent); margin: 0 0 0.3rem; font-weight: 600; }
.verdict { color: #fff; padding: 0.5rem 0.9rem; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.facts { display: grid; grid-template-columns: 180px 1fr; gap: 0.35rem 1rem; margin: 1.5rem 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.findings { list-style: none; padding: 0; }
.findings li { padding: 0.5rem 0.75rem; margin-bottom: 0.4rem; border-left: 4px solid; background: var(--bg); }
.findings li strong { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.findings .ok { border-color: var(--ok); }
.findings .hinweis { border-color: var(--hint); }
.findings .warnung { border-color: var(--warn); }
.findings .fehler { border-color: var(--bad); }
.report-foot { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .report-page { padding: 1.25rem; }
  .report-head { flex-direction: column; }
  .facts { grid-template-columns: 1fr; }
}
@media print {
  .no-print { display: none; }
  .report { background: #fff; }
  .report-page { box-shadow: none; padding: 0; max-width: none; }
  .verdict, .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
