/* Radar – Seitenelemente. Farben, Schrift, Kopf- und Fußzeile: basis.css */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--grund); color: var(--tinte);
  font: 400 15px/1.55 "Lexend", system-ui, sans-serif;
  font-feature-settings: "tnum" 1;
}
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--fokus); outline-offset: 2px; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: 1.6rem; margin: 0 0 12px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 20px 0 8px; }
code { font-size: .9em; background: var(--blau-hell); padding: 1px 5px; border-radius: 3px; }

main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 16px 48px; }

/* Formulare */
input, select, textarea {
  font: inherit; color: var(--tinte); background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: 4px; padding: 7px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--blau); outline: none; box-shadow: 0 0 0 3px var(--blau-hell); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blau); }
input[type=file] { padding: 5px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--gedaempft); }
label.haken { flex-direction: row; align-items: center; gap: 8px; color: var(--tinte); }
.helptext, .hinweis { color: var(--gedaempft); font-size: .85rem; }
button, .knopf {
  font: 500 .95rem/1 "Lexend", system-ui, sans-serif; cursor: pointer;
  padding: 10px 18px; border-radius: 4px; border: 1px solid var(--blau);
  background: var(--blau); color: #fff; text-decoration: none; display: inline-block;
}
button:hover { background: var(--blau-tief); border-color: var(--blau-tief); }
button.zweitrangig { background: transparent; color: var(--link); border-color: var(--linie); }
button.zweitrangig:hover { border-color: var(--link); }
button.gefahr { background: transparent; color: var(--rot); border-color: var(--rot); }
button.gefahr:hover { background: var(--rot); color: #fff; }
button.link { background: none; border: 0; padding: 0; color: var(--link); font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }

/* Filterleiste */
.filter {
  display: grid; grid-template-columns: 2fr repeat(8, minmax(96px, 1fr)); gap: 12px; align-items: end;
  padding: 0 0 20px; border-bottom: 1px solid var(--linie);
}
.filter .haken { grid-column: 1 / -1; }
@media (max-width: 1100px) { .filter { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }

.kopfzeile { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 20px 0 10px; }
.kopfzeile h1 { margin: 0; }
.anzahl { color: var(--gedaempft); margin: 0; }

/* Tabellen */
.tabellenrahmen { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 6px; }
table.liste { width: 100%; border-collapse: collapse; }
.liste th, .liste td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--linie); }
.liste th { font-size: .8rem; font-weight: 500; color: var(--gedaempft); background: var(--blau-hell); white-space: nowrap; }
.liste tbody tr:last-child td { border-bottom: 0; }
.liste tbody tr:hover { background: color-mix(in srgb, var(--blau-hell) 45%, transparent); }
.liste td.titel a { font-weight: 500; text-decoration: none; }
.liste td.titel a:hover { text-decoration: underline; }
.liste .nebeninfo { display: block; color: var(--gedaempft); font-size: .85rem; margin-top: 2px; }
.leer { color: var(--gedaempft); }

/* Score als Radarring – angelehnt an die Ringe im Logo */
.ring {
  --wert: 0; --farbe: var(--blau);
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--farbe) calc(var(--wert) * 1%), var(--ring-leer) 0);
  font-weight: 600; font-size: .9rem; color: var(--tinte);
}
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--flaeche); }
.ring span { position: relative; }
.ring.schwach { --farbe: var(--ring-schwach); }
.ring.gross { width: 72px; height: 72px; font-size: 1.35rem; }
.ring.gross::before { inset: 7px; }

.etiketten { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.etikett { font-size: .75rem; padding: 1px 8px; border-radius: 3px; background: var(--blau-hell); color: var(--tinte); }
.status { font-size: .85rem; white-space: nowrap; padding-left: 14px; position: relative; }
.status::before { content: ""; position: absolute; left: 0; top: .45em; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--gedaempft); }
.status-interessant::before { background: var(--blau); border-color: var(--blau); }
.status-in_pruefung::before { border-color: var(--blau); background: linear-gradient(90deg, var(--blau) 50%, transparent 50%); }
.status-angeboten::before { background: var(--blau); border-color: var(--blau); box-shadow: 0 0 0 2px var(--flaeche), 0 0 0 3.5px var(--blau); }
.status-abgelehnt { color: var(--gedaempft); text-decoration: line-through; }
.dringend { color: var(--rot); font-weight: 500; }
.abgelaufen { color: var(--gedaempft); text-decoration: line-through; }

/* Flächen */
.panel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 6px; padding: 20px 24px; margin-bottom: 20px; }
.panel.schmal { max-width: 420px; margin: 48px auto; }
.panel.schmal-breit { max-width: 680px; }
.panel form { display: grid; gap: 12px; }
.panel form + form { margin-top: 12px; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; }
.raster .panel { margin-bottom: 0; }
.zurueck { display: inline-block; margin-bottom: 16px; }

.titelblock { display: flex; gap: 20px; align-items: flex-start; }
.titelblock h1 { margin-bottom: 6px; }
.angaben { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 20px 0 0; }
.angaben dt { color: var(--gedaempft); }
.angaben dd { margin: 0; overflow-wrap: anywhere; }
.links-liste { margin: 0; padding-left: 18px; }
.historie { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--linie); }
.historie li { padding: 0 0 14px 16px; position: relative; }
.historie li::before { content: ""; position: absolute; left: -6px; top: .4em; width: 10px; height: 10px; border-radius: 50%; background: var(--flaeche); border: 2px solid var(--blau); }
.historie li.leer::before { border-color: var(--linie); }
.historie .wann { color: var(--gedaempft); font-size: .85rem; }
.historie p { margin: 4px 0 0; }
.zert-liste { list-style: none; padding: 0; margin: 0; }
.zert-liste li { padding: 10px 0; border-bottom: 1px solid var(--linie); }
.zert-zeile { display: flex; justify-content: space-between; gap: 12px; }
.zert-liste details summary { margin: 6px 0 0; }
.zert-liste li:last-child { border-bottom: 0; }
.zert-liste form { margin: 0; }
.aktionen { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0 4px; }
pre.profiltext { white-space: pre-wrap; font: inherit; margin: 0; max-width: 80ch; }
address { font-style: normal; margin: 16px 0; }
details summary { cursor: pointer; color: var(--link); margin: 4px 0 12px; }

/* Meldungen */
.meldung { padding: 10px 14px; border-radius: 4px; border-left: 4px solid var(--blau); background: var(--flaeche); margin: 0 0 16px; }
.meldung-error { border-left-color: var(--rot); }
.fehler { color: var(--rot); }

/* Anmeldung */
.anmeldung { max-width: 420px; margin: 56px auto; text-align: left; }
.anmeldung img.schloss { width: 72px; height: 72px; display: block; margin-bottom: 20px; }
.anmeldung button { width: 100%; margin-top: 4px; }
.anmeldung button.microsoft { padding-top: 12px; padding-bottom: 12px; font-size: 1.05rem; }
.anmeldung .notzugang { margin-top: 24px; border-top: 1px solid var(--linie); padding-top: 16px; }
.anmeldung .notzugang summary { cursor: pointer; color: var(--gedaempft); margin-bottom: 12px; }
.anmeldung button.link { width: auto; margin-top: 8px; }
/* Zweiter Faktor (Issue #40): QR-Code immer schwarz auf weiß, auch im dunklen Modus */
.anmeldung .schritte { padding-left: 20px; display: grid; gap: 10px; }
.anmeldung .qr-rahmen { margin: 10px 0; }
.anmeldung svg.qr { display: block; max-width: 100%; height: auto; background: #fff; border-radius: 4px; }
.anmeldung code.geheimnis { display: block; margin-top: 6px; font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
.anmeldung ul.codes { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.anmeldung ul.codes code { font-size: 1rem; letter-spacing: .05em; }

@media (max-width: 640px) {
  .angaben { grid-template-columns: 1fr; gap: 2px; }
  .angaben dt { margin-top: 10px; }
  .marke span { display: none; }
  .titelblock { flex-direction: column; gap: 12px; }
  .fuss .rechts { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Feinschliff: gleiche Höhe für Eingaben und Auswahllisten, leerer Verlauf ohne Linie,
   schmale Bildschirme ohne Nebenspalten */
input:not([type=checkbox]):not([type=file]), select { height: 40px; }
.historie:has(> .leer:only-child) { border-left: 0; }
.historie > .leer { padding-left: 0; }
.historie > .leer::before { display: none; }
@media (max-width: 760px) {
  .liste .breit { display: none; }
  .liste th, .liste td { padding: 10px; }
}

/* Treffertypen: Ausschreibung Tower-Blau, IT-Projekt Petrol, Rahmenvertrag blau umrandet.
   Rot bleibt Dringendem vorbehalten. */
:root { --ausschreibung: var(--blau); --petrol: #00737c; }
@media (prefers-color-scheme: dark) { :root { --ausschreibung: #4d6cff; --petrol: #3fc0c9; } }
.typ {
  display: inline-block; font-size: .78rem; font-weight: 500; white-space: nowrap;
  padding: 2px 9px; border-radius: 3px; border: 1.5px solid transparent;
}
.typ-marke-ausschreibung { background: var(--ausschreibung); color: #fff; }
.typ-marke-freelance { background: var(--petrol); color: #fff; }
.typ-marke-rahmenvertrag { border-color: var(--ausschreibung); color: var(--link); }
@media (prefers-color-scheme: dark) { .typ-marke-freelance { color: #062a2e; } }
.liste tbody tr { box-shadow: inset 4px 0 0 transparent; }
.liste tbody tr.typ-ausschreibung { box-shadow: inset 4px 0 0 var(--ausschreibung); }
.liste tbody tr.typ-freelance { box-shadow: inset 4px 0 0 var(--petrol); }
.liste tbody tr.typ-rahmenvertrag { box-shadow: inset 4px 0 0 var(--ring-schwach); }
.panel.typ-ausschreibung { border-top: 4px solid var(--ausschreibung); }
.panel.typ-freelance { border-top: 4px solid var(--petrol); }
.panel.typ-rahmenvertrag { border-top: 4px solid var(--ring-schwach); }
.liste td:first-child { padding-left: 18px; }

/* Bewertungen auf der Detailseite */
.abstand-oben { margin-top: 24px; }
.bewertungen { list-style: none; padding: 0; margin: 0; }
.bewertungen li { padding: 8px 0; border-bottom: 1px solid var(--linie); }
.bewertungen li:last-child { border-bottom: 0; }

/* Bewerbung: Haken „beworben“ mit Inline-Auswahl (Person, Datum).
   Felder erscheinen per :has() erst, wenn der Haken gesetzt ist – ohne Skript. */
.unsichtbar {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
button.klein { padding: 7px 12px; font-size: .85rem; }
.bewerbung { margin: 0; }
.panel form.bewerbung { gap: 8px; }
.bewerbung .haken { cursor: pointer; }
.bewerbung-felder, .bewerbung-zuruecknehmen, .bewerbung-aendern { display: none; }
.bewerbung-felder { gap: 8px; margin-top: 8px; min-width: 170px; max-width: 260px; }
.bewerbung:not(.ist-beworben):has(.bewerbung-haken:checked) .bewerbung-felder,
.bewerbung-aendern[open] .bewerbung-felder { display: grid; }
.bewerbung.ist-beworben:has(.bewerbung-haken:checked) .bewerbung-aendern { display: block; }
.bewerbung.ist-beworben:not(:has(.bewerbung-haken:checked)) .bewerbung-zuruecknehmen {
  display: grid; gap: 6px; margin-top: 8px; font-size: .85rem; min-width: 150px;
}
.bewerbung-aendern summary { font-size: .85rem; margin: 6px 0 0; }
.bewerbung-fehler { margin: 6px 0 0; padding-left: 18px; font-size: .85rem; max-width: 260px; }
.liste .nur-schmal { display: none; }
.status[title] { cursor: help; }
@media (max-width: 760px) {
  .liste .nur-schmal { display: block; }
  .liste .status { white-space: normal; }
}

/* Go/No-Go-Analyse (S7) */
.analyse h3 { margin-top: 18px; }
.empfehlung { display: inline-block; padding: 4px 12px; border-radius: 4px; border: 2px solid var(--linie); }
.empfehlung-go { border-color: var(--blau); background: var(--blau-hell); }
.empfehlung-no_go { border-color: var(--rot); color: var(--rot); }
.empfehlung-pruefen { border-color: var(--ring-schwach); }
.analyse-liste { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.einschaetzung { font-size: .75rem; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--linie); white-space: nowrap; }
.einschaetzung-schlecht { border-color: var(--rot); color: var(--rot); }
.einschaetzung-gut { border-color: var(--blau); background: var(--blau-hell); }
.beleg { display: block; font-size: .85rem; color: var(--gedaempft); overflow-wrap: anywhere; }
.analyse .hinweis a { overflow-wrap: anywhere; }
.analyse form { margin-top: 16px; }
