:root {
  --farbe-haupt: #e8590c;
  --farbe-text: #222;
  --farbe-hintergrund: #faf8f5;
  --ok: #2b8a3e;
  --warn: #e67700;
  --err: #c92a2a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--farbe-text);
  background: var(--farbe-hintergrund);
}

.topbar {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.8rem 1.5rem;
  background: var(--farbe-haupt);
  color: #fff;
}
.logo { font-weight: 700; font-size: 1.3rem; }
.subtitle { opacity: 0.9; }

.container { max-width: 60rem; margin: 0 auto; padding: 1.5rem; }

.card {
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status { list-style: none; padding: 0; }
.status li { padding: 0.3rem 0; }
.status li::before { display: inline-block; width: 1.5rem; font-weight: 700; }
.status .ok::before { content: "✓"; color: var(--ok); }
.status .warn::before { content: "!"; color: var(--warn); }
.status .err::before { content: "✗"; color: var(--err); }

/* Kopfzeile */
.topbar { flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; }
.mainnav { display: flex; gap: 1rem; margin-left: 1rem; }
.mainnav a:hover, .usermenu a:hover { text-decoration: underline; }
.usermenu { display: flex; align-items: baseline; gap: 1rem; margin-left: auto; }
.usermenu form { margin: 0; }
.link-button {
  background: none; border: none; color: #fff; font: inherit;
  cursor: pointer; padding: 0; text-decoration: underline;
}

/* Meldungen */
.flash { padding: 0.6rem 1rem; border-radius: 6px; margin: 0 0 1rem; }
.flash-ok { background: #ebfbee; border-left: 4px solid var(--ok); }
.flash-warn { background: #fff4e6; border-left: 4px solid var(--warn); }
.flash-err { background: #fff5f5; border-left: 4px solid var(--err); }

/* Formulare */
.card { margin-bottom: 1.5rem; }
.narrow { max-width: 28rem; }
.form { display: flex; flex-direction: column; gap: 1rem; }
.form label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; }
.form input, .form select {
  font: inherit; font-weight: normal; padding: 0.5rem 0.6rem;
  border: 1px solid #bbb; border-radius: 6px;
}
.form input:focus, .form select:focus { outline: 2px solid var(--farbe-haupt); border-color: transparent; }
.hint { font-weight: normal; color: #666; font-size: 0.9rem; }

.button {
  display: inline-block; background: var(--farbe-haupt); color: #fff; border: none;
  border-radius: 6px; padding: 0.6rem 1.2rem; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.button:hover { filter: brightness(0.92); }
.button.small { padding: 0.3rem 0.7rem; font-size: 0.85rem; font-weight: 500; background: #555; }
.button.small.danger { background: var(--err); }

/* Tabelle */
.table-wrap { overflow-x: auto; margin-bottom: 1.5rem; }
.table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.table th, .table td { text-align: left; padding: 0.5rem 0.7rem; border-bottom: 1px solid #eee; vertical-align: middle; }
.table th { background: #f1ede8; font-size: 0.9rem; }
.table tr.inactive td { color: #999; }
.actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.actions form { margin: 0; }

.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.8rem; white-space: nowrap; }
.badge-ok { background: #ebfbee; color: var(--ok); }
.badge-warn { background: #fff4e6; color: var(--warn); }
.badge-err { background: #fff5f5; color: var(--err); }
.badge-off { background: #eee; color: #666; }

.credentials { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; }
.credentials dt { font-weight: 600; }
.credentials dd { margin: 0; }
.password { font-size: 1.3rem; background: #f1ede8; padding: 0.2rem 0.5rem; border-radius: 4px; }

/* Archiv */
a { color: #b8440a; }
.breadcrumb { font-size: 0.9rem; color: #666; margin: 0 0 0.5rem; }
.archive-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; }
.archive-card { color: inherit; text-decoration: none; display: block; }
.archive-card:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); }
.archive-card h2 { margin-top: 0.3rem; color: var(--farbe-haupt); }

.searchbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 1rem 0; }
.searchbar input[type=search] {
  flex: 1 1 18rem; font: inherit; padding: 0.55rem 0.7rem; border: 1px solid #bbb; border-radius: 6px;
}
.searchbar select { font: inherit; padding: 0.5rem; border: 1px solid #bbb; border-radius: 6px; }
.searchbar .reset { font-size: 0.9rem; }

.item-list { list-style: none; padding: 0; margin: 0; }
.item-row { background: #fff; border-radius: 8px; padding: 0.8rem 1.1rem; margin-bottom: 0.6rem;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.item-title { font-weight: 600; font-size: 1.05rem; text-decoration: none; color: var(--farbe-text); }
.item-title:hover { color: var(--farbe-haupt); text-decoration: underline; }
.item-meta { font-size: 0.85rem; color: #666; margin-top: 0.2rem; }
.snippet { margin: 0.4rem 0 0; color: #333; font-size: 0.95rem; }
mark { background: #ffe8a3; padding: 0 0.1em; border-radius: 2px; }

.pagination { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1.5rem 0; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(14rem, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 50rem) { .detail-grid { grid-template-columns: 1fr; } }
.item-text p { white-space: pre-line; margin: 0 0 0.8rem; }
.item-text p.lead { font-weight: 600; }
.facts h2 { margin-top: 0.3rem; }
.facts dl { margin: 0; }
.facts dt { font-weight: 600; font-size: 0.85rem; color: #666; margin-top: 0.8rem; }
.facts dd { margin: 0.1rem 0 0; }
.references { margin: 0; padding-left: 1.1rem; }
.references li { word-break: break-word; }
.filename { font-family: ui-monospace, monospace; font-size: 0.8rem; word-break: break-all; }
.sibling-list { margin: 0; padding-left: 1.1rem; }

.issue-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.issue-nav { display: flex; gap: 0.5rem; }
.issue-item details { margin-top: 0.3rem; font-size: 0.9rem; }
.issue-item summary { cursor: pointer; color: #666; }
