/* Oberflaeche der Objektuebernahme in der Farbwelt der Hausverwaltung Mueller GmbH (Skill hvm-ci):
   Orange #E6A83C nur als Akzent, Anthrazit #87888A, Mittelgrau #9C9D9F, Hellgrau #D7D8DA, Umrissgrau #ECECEC,
   Textschwarz #1A1A1A. Schrift system-ui, Helvetica Neue, Arial. Kein Framework, keine externen Quellen. */
:root {
  --orange: #E6A83C; --orange-dunkel: #c98f27; --orange-hell: #fff4e0;
  --anthrazit: #87888A; --mittelgrau: #9C9D9F; --hellgrau: #D7D8DA; --umriss: #ECECEC;
  --text: #1A1A1A; --text-2: #4b4c4f; --text-3: #5f6063; --flaeche: #f4f5f7; --weiss: #ffffff;
  --gruen: #1f6b39; --gruen-hell: #e6f4ea; --rot: #9b2f24; --rot-hell: #fbe9e7; --gelb: #8a6508; --gelb-hell: #fff7e0;
  --radius: 10px; --radius-klein: 6px; --schatten: 0 1px 2px rgba(26, 26, 26, .06), 0 4px 14px rgba(26, 26, 26, .05);
  --fokus: 0 0 0 3px rgba(230, 168, 60, .35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--text); background: var(--flaeche);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--hellgrau); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--orange); }
:focus-visible { outline: none; box-shadow: var(--fokus); border-radius: var(--radius-klein); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--umriss); padding: 1px 5px; border-radius: 4px; }
img { max-width: 100%; }

/* Kennlinie aus dem Briefbogen: Anthrazit, Mittelgrau, Orange, Hellgrau */
.kennlinie { height: 4px; background: linear-gradient(90deg, var(--anthrazit) 0 40%, var(--mittelgrau) 40% 60%, var(--orange) 60% 67.5%, var(--hellgrau) 67.5% 100%); }

/* Kopf und Navigation */
.kopf {
  position: static; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
  padding: 10px 28px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hellgrau);
}
.marke { display: flex; align-items: baseline; gap: 10px; margin-right: 8px; white-space: nowrap; }
.marke strong { font-size: 17px; letter-spacing: .01em; }
.marke .sub { color: var(--anthrazit); font-size: 13px; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; flex: 1; }
nav a, nav .link {
  display: inline-block; padding: 6px 10px; border-radius: 999px; color: var(--text-2); text-decoration: none;
  font-size: 14px; line-height: 1.2; border: 1px solid transparent;
}
nav a:hover, nav .link:hover { background: var(--flaeche); color: var(--text); }
nav a.aktiv { background: var(--orange-hell); color: var(--text); border-color: #f1d9a6; font-weight: 600; }
nav .nutzer { margin-left: auto; color: var(--anthrazit); font-size: 13px; padding-left: 12px; border-left: 1px solid var(--hellgrau); }
nav form.inline { display: inline; }
nav button.link { text-decoration: none; }

/* Inhalt */
.inhalt { padding: 24px 28px 40px; max-width: 1480px; margin: 0 auto; }
.fuss { padding: 14px 28px; color: var(--anthrazit); font-size: 12px; border-top: 1px solid var(--hellgrau); background: var(--weiss); }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 18px; letter-spacing: -.01em; }
h1 .ampel { vertical-align: middle; margin-left: 6px; }
h2 { font-size: 13px; margin: 0 0 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
h1 .mono.schluessel { font-size: 20px; }
h3 { font-size: 14px; margin: 16px 0 8px; color: var(--text-2); }
p { margin: 0 0 10px; }
.inhalt > p:first-of-type { color: var(--text-2); }

/* Karten und Raster */
.karte { background: var(--weiss); border: 1px solid var(--umriss); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--schatten); }
.karte.schmal { max-width: 560px; }
.karte > :last-child { margin-bottom: 0; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.raster > .karte { margin-bottom: 0; }
.raster + .karte, .raster + .raster { margin-top: 16px; }

/* Tabellen */
table { border-collapse: collapse; width: 100%; font-size: 14px; }
table.voll { background: var(--weiss); }
th { text-align: left; padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; background: var(--flaeche); border-bottom: 2px solid var(--orange); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--umriss); vertical-align: top; }
tbody tr:not(.gelb):not(.rot):not(.grau):hover td { background: #fbfbfc; }
tr:nth-child(even) td { background: transparent; }
tr.gelb td { background: var(--gelb-hell); } tr.rot td { background: var(--rot-hell); } tr.grau td { color: var(--mittelgrau); }
.karte table { margin-bottom: 8px; }
.karte > table:last-child { margin-bottom: 0; }

/* Text-Hilfsklassen */
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-word; }
.klein { font-size: 12.5px; color: var(--text-3); }
.hinweis { color: var(--text-3); font-size: 13px; }
.sichten { margin: 6px 0 0; } .sichten form.inline { display: inline; }
.warnung { border-left: 4px solid var(--orange); background: var(--orange-hell); padding: 10px 14px; border-radius: 0 var(--radius-klein) var(--radius-klein) 0; }
.pfad { font-size: 15px; margin-bottom: 10px; }
.pfad a { text-decoration: none; color: var(--text-2); } .pfad a:hover { color: var(--text); text-decoration: underline; }

/* Statusmarken */
.ampel { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: baseline; }
.ampel.gruen { background: var(--gruen-hell); color: var(--gruen); }
.ampel.rot { background: var(--rot-hell); color: var(--rot); }
.ampel.gelb { background: var(--gelb-hell); color: var(--gelb); }
.ampel.grau { background: var(--umriss); color: var(--text-2); }

/* Meldungen */
.meldungen { list-style: none; padding: 0; margin: 0 0 18px; }
.meldungen li { padding: 10px 14px; border-left: 4px solid var(--orange); background: var(--weiss); margin-bottom: 8px; border-radius: 0 var(--radius-klein) var(--radius-klein) 0; box-shadow: var(--schatten); }
.meldungen li.success { border-left-color: var(--gruen); }
.meldungen li.warning { border-left-color: var(--orange); background: var(--orange-hell); }
.meldungen li.error { border-left-color: var(--rot); background: var(--rot-hell); }
.meldungen li.info { border-left-color: var(--anthrazit); }

/* Schaltflaechen */
button, .knopf {
  background: var(--orange); border: 1px solid var(--orange); padding: 8px 14px; border-radius: var(--radius-klein);
  cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none;
  display: inline-block; line-height: 1.3; transition: background .12s, border-color .12s;
}
button:hover, .knopf:hover { background: var(--orange-dunkel); border-color: var(--orange-dunkel); color: var(--weiss); }
/* Filter- und Suchknoepfe sind Nebenaktionen: sekundaer; Anlegen, Speichern, Verbinden bleiben primaer (orange) */
.filter button, form.filter button { background: var(--weiss); border-color: var(--mittelgrau); color: var(--text); font-weight: 500; }
.filter button:hover, form.filter button:hover { background: var(--flaeche); border-color: var(--anthrazit); color: var(--text); }
button.link { background: none; border: none; color: var(--text); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; text-decoration-color: var(--hellgrau); text-underline-offset: 3px; font-weight: 400; }
button.link:hover { background: none; color: var(--text); text-decoration-color: var(--orange); }
nav button.link { padding: 6px 10px; border-radius: 999px; text-decoration: none; font-size: 14px; color: var(--text-2); }
nav button.link:hover { background: var(--flaeche); color: var(--text); }
form.inline { display: inline; }
p > form.inline + form.inline { margin-left: 6px; }
.aktionen button, .aktionen .knopf { margin: 0 8px 8px 0; }
.aktionen.weitere form { display: block; margin: 8px 0; }
.aktionen.weitere form button { margin: 0; }

/* Formulare */
input, select, textarea {
  font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--mittelgrau); border-radius: var(--radius-klein);
  width: 100%; max-width: 520px; background: var(--weiss); color: var(--text);
}
input:focus, select:focus, textarea:focus { border-color: var(--orange); box-shadow: var(--fokus); outline: none; }
input[type="checkbox"], input[type="radio"] { width: auto; max-width: none; margin-right: 6px; accent-color: var(--orange-dunkel); vertical-align: middle; }
input[type="file"] { padding: 6px; }
textarea { min-height: 96px; }
form p { margin-bottom: 12px; }
form p label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13.5px; }
form p .helptext { display: block; color: var(--anthrazit); font-size: 12px; margin-top: 3px; }
label.klein input[type="checkbox"] { width: auto; }
.filter, .filter.inline, form.filter.inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.filter input, .filter select { width: auto; max-width: 240px; }
.filter label { font-size: 13px; color: var(--text-2); margin-right: 4px; }
.errorlist { color: var(--rot); list-style: none; padding: 0; margin: 4px 0 8px; font-size: 13px; }
.errorlist.nonfield { padding: 8px 12px; background: var(--rot-hell); border-radius: var(--radius-klein); }

/* Reiter (Filter und Zielwahl) */
.reiter a { display: inline-block; padding: 6px 12px; margin: 0 6px 10px 0; border: 1px solid var(--hellgrau); border-radius: 999px; text-decoration: none; color: var(--text-2); font-size: 13.5px; background: var(--weiss); }
.reiter a:hover { border-color: var(--mittelgrau); color: var(--text); }
.reiter a.aktiv { border-color: var(--orange); background: var(--orange-hell); color: var(--text); font-weight: 600; }

/* Review Center */
.raster.review { align-items: start; }
.seitenleiste { margin-bottom: 8px; }
.seitenleiste button.seite { margin: 0 4px 4px 0; padding: 2px 8px; border: 1px solid var(--hellgrau); border-radius: var(--radius-klein); text-decoration: none; background: var(--weiss); font-size: 13px; }
.seitenleiste button.seite:hover { border-color: var(--mittelgrau); }
.seitenleiste button.im-fall { border-color: var(--orange); background: var(--orange-hell); }
.seite-inhalt img, img.seitenbild { max-width: 100%; height: auto; border: 1px solid var(--hellgrau); border-radius: var(--radius-klein); }
.raster.review { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
@media (min-width: 1200px) { .raster.review { grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.4fr) minmax(320px, 1.2fr); } }
.seitentext { white-space: pre-wrap; background: var(--flaeche); padding: 10px; border-radius: var(--radius-klein); max-height: 480px; overflow: auto; }
.felder[hidden] { display: none; }
.felder { padding: 10px 12px; margin-bottom: 10px; border: 1px dashed var(--hellgrau); border-radius: var(--radius-klein); }
.vorschlaege button { display: block; text-align: left; margin: 2px 0; }
.neue-zuordnung { padding-top: 8px; border-top: 1px solid var(--umriss); }
.markierung { background: var(--orange-hell); }
#owner_results, #tenant_results { margin-top: 4px; }
button.kandidat { font-size: 13px; }

/* Listen, Seitenzahlen, Ausklappbereiche */
.karte ul { padding-left: 18px; margin: 0 0 10px; }
.karte ul.klein li { margin-bottom: 3px; }
.seiten { margin-top: 12px; color: var(--text-2); font-size: 13px; }
details { border: 1px solid var(--umriss); border-radius: var(--radius-klein); padding: 6px 10px; margin-bottom: 8px; background: var(--weiss); }
details summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--text-2); }
details[open] summary { margin-bottom: 8px; }
pre.mono { font-size: 12.5px; line-height: 1.45; }
table td .knopf, table td button { padding: 4px 10px; font-size: 13px; }

/* Kleinere Bildschirme */
@media (min-width: 1500px) { .kopf { position: sticky; top: 0; } }
@media (max-width: 900px) {
  .kopf { padding: 10px 16px; }
  nav .nutzer { margin-left: 0; padding-left: 0; border-left: none; width: 100%; }
  .inhalt { padding: 16px 16px 32px; }
  .raster { grid-template-columns: 1fr; }
  .karte { overflow-x: auto; }
  input, select, textarea { max-width: none; }
}
@media print {
  .kopf, .fuss, .kennlinie, .meldungen, button, .knopf { display: none !important; }
  .karte { box-shadow: none; border-color: #bbb; break-inside: avoid; }
}
