/* Bannkatalog Orange City. Dunkel, Orange als Markenfarbe; Rot nur fuer permanente Sanktionen und Fehler. */
:root {
  --grund: #0b0b0d;
  --flaeche: #121215;
  --flaeche-2: #18181c;
  --rand: #24242a;
  --rand-hell: #33333b;
  --text: #ececef;
  --text-2: #a3a3ad;
  --text-3: #6f6f79;
  --orange: #ff8a1f;
  --orange-text: #ffad5c;
  --orange-flaeche: rgba(255, 138, 31, .1);
  --rot: #f87171;
  --rot-flaeche: rgba(248, 113, 113, .1);
  --gelb: #fbbf24;
  --gelb-flaeche: rgba(251, 191, 36, .1);
  --gruen: #4ade80;
  --radius: 12px;
  --schrift: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--grund); color: var(--text);
  font: 15px/1.55 var(--schrift);
  background-image: radial-gradient(900px 380px at 85% -120px, rgba(255, 138, 31, .07), transparent 70%);
  background-repeat: no-repeat;
}
[hidden] { display: none !important; }
a { color: var(--orange-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Kopf ---------- */
.kopf { position: sticky; top: 0; z-index: 10; background: rgba(11, 11, 13, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rand); }
.kopf-innen { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.marke { display: flex; align-items: center; gap: 10px; color: var(--text); }
.marke:hover { text-decoration: none; }
.marke .logo { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--rand-hell); object-fit: cover; flex: none; }
.anmeldung-logo { display: block; width: 64px; height: 64px; border-radius: 14px; border: 1px solid var(--rand-hell); margin-bottom: 18px; box-shadow: 0 8px 28px rgba(255, 138, 31, .14); }
.marke-text { display: flex; flex-direction: column; line-height: 1.15; }
.marke-text b { font-size: 15px; letter-spacing: -.01em; }
.marke-text small { font-size: 12px; color: var(--text-3); }
.kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.person { display: flex; align-items: center; gap: 8px; padding-right: 6px; color: var(--text-2); font-size: 14px; }
.person img, .person .monogramm { width: 26px; height: 26px; border-radius: 50%; }
.monogramm { display: inline-grid; place-items: center; background: var(--flaeche-2); border: 1px solid var(--rand-hell); font-size: 12px; font-weight: 600; color: var(--orange-text); }

/* ---------- Knoepfe ---------- */
.knopf {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 9px;
  background: var(--flaeche); border: 1px solid var(--rand-hell); color: var(--text); cursor: pointer; font-size: 14px; white-space: nowrap;
}
.knopf:hover { border-color: #4a4a54; background: var(--flaeche-2); text-decoration: none; }
.knopf:focus-visible, .feld:focus-visible, .suche input:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.knopf.haupt { border-color: rgba(255, 138, 31, .55); color: var(--orange-text); }
.knopf.haupt:hover { background: var(--orange-flaeche); }
.knopf.aktiv { background: var(--orange-flaeche); border-color: rgba(255, 138, 31, .55); color: var(--orange-text); }
.knopf.gefahr { color: var(--rot); }
.knopf.gefahr:hover { border-color: rgba(248, 113, 113, .5); background: var(--rot-flaeche); }
.knopf.klein { height: 28px; padding: 0 9px; font-size: 13px; border-radius: 8px; }
.knopf.symbol { width: 30px; padding: 0; justify-content: center; height: 30px; }
.knopf svg { width: 16px; height: 16px; flex: none; }
.knopf[disabled] { opacity: .5; cursor: default; }

/* ---------- Inhalt ---------- */
.inhalt { max-width: 1180px; margin: 0 auto; padding: 28px 20px 120px; }
.seitenkopf { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.seitenkopf h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; line-height: 1.15; }
.seitenkopf p { margin: 6px 0 0; color: var(--text-2); max-width: 620px; }
.kennzeile { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--orange-text); margin-bottom: 8px; }

.werkzeuge { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.suche { position: relative; flex: 1 1 280px; max-width: 460px; }
.suche svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.suche input { width: 100%; height: 38px; padding: 0 12px 0 34px; background: var(--flaeche); border: 1px solid var(--rand-hell); border-radius: 10px; }
.filter { display: flex; gap: 6px; flex-wrap: wrap; }
.filter .knopf { height: 32px; border-radius: 999px; font-size: 13px; }
.zaehler { color: var(--text-3); font-size: 13px; margin-left: auto; }

/* ---------- Abschnitte ---------- */
.abschnitt { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; position: relative; }
.abschnitt::before { content: ""; position: absolute; left: 18px; top: 0; width: 36px; height: 2px; background: var(--orange); border-radius: 0 0 2px 2px; }
.abschnitt-kopf { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; }
.abschnitt-kopf h2 { margin: 0; font-size: 16px; letter-spacing: -.01em; flex: 1; }
.abschnitt-kopf .anzahl { color: var(--text-3); font-size: 13px; }
.abschnitt-kopf input.feld { flex: 1; font-weight: 600; }

table.katalog { width: 100%; border-collapse: collapse; }
.katalog th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; padding: 8px 14px; border-top: 1px solid var(--rand); border-bottom: 1px solid var(--rand); background: rgba(255, 255, 255, .012); }
.katalog td { padding: 13px 14px; vertical-align: top; border-bottom: 1px solid #1c1c21; }
.katalog tr:last-child td { border-bottom: 0; }
.katalog tbody tr:hover td { background: rgba(255, 255, 255, .015); }
.katalog th:first-child, .katalog td:first-child { padding-left: 18px; }
.katalog th:last-child, .katalog td:last-child { padding-right: 18px; }
.sp-nr { width: 64px; }
.sp-verstoss { width: 22%; }
.sp-zust { width: 11%; }
.sp-mass { width: 13%; }
.sp-sank { width: 17%; }
.sp-akt { width: 76px; text-align: right; }
.nr { font: 600 13px var(--mono); color: var(--orange-text); }
.verstoss { font-weight: 600; }
.beschreibung { color: var(--text-2); white-space: pre-line; }
.leer { color: var(--text-3); font-style: italic; }
.marke-wert { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 9px; border-radius: 7px; background: var(--flaeche-2); border: 1px solid var(--rand-hell); color: var(--text); }
.marke-wert::before { content: ""; width: 6px; height: 6px; border-radius: 1.5px; background: var(--text-3); flex: none; }
.marke-wert.perma { background: var(--rot-flaeche); border-color: rgba(248, 113, 113, .3); color: #fca5a5; }
.marke-wert.perma::before { background: var(--rot); }
.marke-wert.zeit { background: var(--gelb-flaeche); border-color: rgba(251, 191, 36, .28); color: #fcd34d; }
.marke-wert.zeit::before { background: var(--gelb); }
.marke-wert.sofort::before { background: var(--orange); }
.aktionen { display: inline-flex; gap: 4px; }
mark { background: rgba(255, 138, 31, .28); color: inherit; border-radius: 3px; padding: 0 1px; }

.abschnitt-fuss { padding: 10px 18px 14px; border-top: 1px solid var(--rand); display: flex; gap: 8px; flex-wrap: wrap; }
.nichts { padding: 26px 18px; color: var(--text-3); text-align: center; }
.stand { color: var(--text-3); font-size: 13px; margin-top: 8px; }

/* ---------- Anmeldung ---------- */
.anmeldung { max-width: 440px; margin: 9vh auto 0; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 16px; padding: 30px 28px; position: relative; }
.anmeldung::before { content: ""; position: absolute; left: 28px; top: 0; width: 44px; height: 2px; background: var(--orange); }
.anmeldung h1 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.02em; }
.anmeldung p { color: var(--text-2); margin: 0 0 22px; }
.anmeldung .knopf { height: 42px; width: 100%; justify-content: center; font-size: 15px; }
.meldung { border-radius: 10px; padding: 12px 14px; margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.meldung.fehler { background: var(--rot-flaeche); border-color: rgba(248, 113, 113, .3); color: #fecaca; }
.meldung.info { background: var(--orange-flaeche); border-color: rgba(255, 138, 31, .3); color: #fed7aa; }
.meldung code { font: 600 14px var(--mono); color: var(--text); background: rgba(0, 0, 0, .3); padding: 2px 6px; border-radius: 5px; }
.meldung .knopf { width: auto; height: 28px; margin-top: 10px; font-size: 13px; }

/* ---------- Fenster ---------- */
dialog { background: var(--flaeche); color: var(--text); border: 1px solid var(--rand-hell); border-radius: 16px; padding: 0; width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(2px); }
.fenster-kopf { display: flex; align-items: center; padding: 18px 20px 6px; gap: 10px; }
.fenster-kopf h2 { margin: 0; font-size: 18px; flex: 1; }
.fenster-inhalt { padding: 10px 20px 4px; }
.fenster-fuss { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px 18px; }
.feldgruppe { display: grid; gap: 6px; margin-bottom: 14px; }
.feldgruppe label { font-size: 13px; color: var(--text-2); }
.feldreihe { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feld { width: 100%; background: var(--grund); border: 1px solid var(--rand-hell); border-radius: 9px; padding: 8px 11px; min-height: 38px; }
textarea.feld { min-height: 96px; resize: vertical; }
select.feld { appearance: auto; }
.feld-meldung { color: var(--rot); font-size: 13px; min-height: 18px; margin: 2px 0 0; }
.vorschlaege { display: flex; flex-wrap: wrap; gap: 6px; }

/* Zugaenge */
.zugang-liste { list-style: none; margin: 0 0 6px; padding: 0; border: 1px solid var(--rand); border-radius: 10px; max-height: 46vh; overflow: auto; }
.zugang-liste li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--rand); }
.zugang-liste li:last-child { border-bottom: 0; }
.zugang-name { font-weight: 600; display: block; }
.zugang-id { font: 12px var(--mono); color: var(--text-3); }
.zugang-liste select.feld { min-height: 30px; padding: 3px 8px; width: auto; }
.zugang-neu { display: grid; grid-template-columns: 1.3fr 1fr auto auto; gap: 8px; align-items: start; }
.etikett { font-size: 12px; color: var(--orange-text); border: 1px solid rgba(255, 138, 31, .35); border-radius: 6px; padding: 1px 7px; }

/* ---------- Leisten ---------- */
.speicherleiste { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 10px; background: #161619; border: 1px solid rgba(255, 138, 31, .4); border-radius: 12px; padding: 9px 10px 9px 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); max-width: calc(100vw - 24px); }
.speicherleiste span { color: var(--text-2); font-size: 14px; margin-right: 6px; }
.hinweis { position: fixed; right: 18px; bottom: 18px; z-index: 30; background: #161619; border: 1px solid var(--rand-hell); border-radius: 10px; padding: 10px 14px; font-size: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); max-width: min(380px, calc(100vw - 36px)); }
.hinweis.fehler { border-color: rgba(248, 113, 113, .45); color: #fecaca; }
.laden { color: var(--text-3); padding: 40px 0; text-align: center; }

/* ---------- Schmal: Tabelle wird zu Karten ---------- */
@media (max-width: 820px) {
  .inhalt { padding: 20px 16px 120px; }
  .kopf-innen { padding: 10px 16px; }
  .seitenkopf h1 { font-size: 24px; }
  .person span, .knopf-text, .marke-text small { display: none; }
  .kopf-rechts { flex-wrap: nowrap; gap: 6px; }
  .kopf-rechts .knopf { padding: 0 10px; }
  .katalog thead { display: none; }
  .katalog, .katalog tbody, .katalog tr, .katalog td { display: block; width: 100%; }
  .katalog tr { padding: 14px 16px; border-bottom: 1px solid #1c1c21; display: grid; grid-template-columns: auto 1fr auto; column-gap: 10px; row-gap: 6px; }
  .katalog tr:last-child { border-bottom: 0; }
  .katalog td { padding: 0 !important; border: 0; }
  .katalog td.sp-nr { grid-column: 1; }
  .katalog td.sp-verstoss { grid-column: 2; }
  .katalog td.sp-akt { grid-column: 3; grid-row: 1; }
  .katalog td.sp-beschr, .katalog td.sp-zust, .katalog td.sp-mass, .katalog td.sp-sank { grid-column: 1 / -1; }
  .katalog td[data-titel]::before { content: attr(data-titel); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 2px; }
  .katalog td.sp-zust, .katalog td.sp-mass, .katalog td.sp-sank { display: inline-block; }
  .feldreihe, .zugang-neu { grid-template-columns: 1fr; }
  .zugang-liste li { grid-template-columns: 1fr auto; }
  .zugang-liste li .knopf { grid-column: 2; }
  .zaehler { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  /* Nur beim ersten Zeichnen; sonst blinkt beim Bearbeiten jede Aenderung. */
  .erst .abschnitt { animation: rein .35s ease both; }
  @keyframes rein { from { opacity: 0; transform: translateY(6px); } }
}
@media print {
  .kopf, .werkzeuge, .speicherleiste, .hinweis, .sp-akt, .abschnitt-fuss { display: none !important; }
  body { background: #fff; color: #000; }
  .abschnitt { border-color: #ccc; break-inside: avoid; }
}
