/* ITRoomCAD Server — schlichtes, dunkles CI wie die iPad-App. */
/* Farben nach GEMESSENEM Kontrast, nicht nach Augenmaß. Maßstab ist WCAG AA:
 * 4,5:1 für Text, 3:1 für Flächen und Rahmen. Auf dunklem Grund kippt das schnell —
 * ein sattes Blau sieht kräftig aus, trägt aber weißen Text nur mit 3,7:1.
 *
 * Deshalb hat der Akzent DREI Werte, je nach Aufgabe:
 *   --acc        Flächen und Rahmen (kein Text darauf)
 *   --acc-knopf  Grund für weiße Knopfschrift  → Weiß darauf 5,2:1
 *   --acc-text   blauer TEXT auf dunklem Grund → 6,1:1
 * Ein einziger Wert kann beides nicht: Was hell genug für Text auf dunkel ist,
 * trägt keinen weißen Text mehr, und umgekehrt.
 */
:root {
  --bg: #14161a; --card: #1c2027; --line: #2b313b;
  --fg: #e9edf3; --dim: #98a2b3;
  --acc: #3b82f6; --acc-knopf: #2563eb; --acc-text: #7aa7ff;
  --ok: #22c55e; --warn: #f59e0b; --bad: #f87171;
  --gefahr-knopf: #dc2626; --gefahr-text: #ff8b82;
}
* { box-sizing: border-box; }
/* hidden-Attribut gewinnt IMMER — sonst übersteuern display-Regeln (.row etc.) das Verstecken */
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg);
       font: 15px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif; }
header { display: flex; align-items: center; justify-content: space-between;
         padding: 14px 20px; border-bottom: 1px solid var(--line); background: #10131a; }
h1 { font-size: 18px; margin: 0; }
h1 .sub { color: var(--dim); font-weight: 400; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 16px 0 8px; color: var(--dim); }
main { padding: 18px; margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
        padding: 16px; margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* Aufeinanderfolgende Zeilen brauchen Luft — ohne das beginnt die nächste Zeile
   exakt an der Unterkante der vorigen und die Felder wirken übereinander. */
/* Jede Zeile, die nicht als erstes in ihrem Block steht, bekommt Luft nach oben.
   Als Nachbarschafts-Regel (.row + .row) greift das nicht, sobald ein Container
   dazwischen liegt — deshalb über den Elternteil. */
.card > * + .row, .card > * + table, .formspalten > div > * + .row,
.formspalten > div > * + table { margin-top: 12px; }
.card > .row + .row { margin-top: 12px; }
/* Kein Feld darf aus seiner Zeile herauslaufen (lange Auswahltexte!). */
.row > *, .formspalten > * { min-width: 0; }
.row select, .row input { max-width: 100%; }
.row h2 { flex: 1; }
label { display: block; margin-bottom: 10px; color: var(--dim); font-size: 13px; }
input, select { width: 100%; padding: 9px 10px; margin-top: 4px; background: #0f1216;
                border: 1px solid var(--line); border-radius: 7px; color: var(--fg); font-size: 14px; }
.row input, .row select { width: auto; min-width: 150px; margin-top: 0; }
button { padding: 9px 14px; border: 1px solid var(--line); border-radius: 7px;
         background: #232a33; color: var(--fg); cursor: pointer; font-size: 14px; }
button:hover { border-color: var(--acc); }
button.primary { background: var(--acc-knopf); border-color: var(--acc-knopf); color: #fff; }
/* Gesperrte Knöpfe: Der Browser färbt sie von sich aus so blass, dass die Schrift
 * praktisch verschwindet (bis herunter auf 1,9:1). Der Zustand muss am RAHMEN und
 * am Zeiger erkennbar sein, nicht daran, dass man die Aufschrift nicht mehr liest —
 * sonst weiß niemand, was der Knopf täte, wenn er dürfte. */
button:disabled, button:disabled:hover {
  background: #1b2027; border-color: var(--line); color: var(--dim);
  cursor: not-allowed; opacity: 1;
}
button.primary:disabled { background: #1b2027; border-color: var(--line); color: var(--dim); }
button.small { padding: 5px 9px; font-size: 13px; }
table { width: 100%; border-collapse: collapse; margin-top: 6px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--dim); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.kpi .v { font-size: 22px; font-weight: 700; }
.kpi .t { color: var(--dim); font-size: 12px; }
.msg { color: var(--dim); font-size: 13px; min-height: 18px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.pill.free { background: rgba(34,197,94,.15); color: var(--ok); }
.pill.lock { background: rgba(245,158,11,.18); color: var(--warn); }
.bad { color: var(--bad); } .ok { color: var(--ok); } .warn { color: var(--warn); }
pre { background: #0f1216; border: 1px solid var(--line); border-radius: 7px;
      padding: 10px; overflow: auto; font-size: 12px; }


/* Organisation — Baum mit Verbindungslinien (└→) und klappbaren Knoten */
.org-zeile { display: flex; align-items: center; gap: 8px; padding: 5px 0; flex-wrap: wrap;
             position: relative;
             border-bottom: 1px solid rgba(139, 148, 158, .13); }
.org-ebene { font-size: 11px; color: #8b949e; border: 1px solid #30363d;
             border-radius: 10px; padding: 1px 8px; }
.org-pfeil { width: 16px; text-align: center; color: #8b949e; user-select: none;
             flex: 0 0 16px; }
/* Aktions-Knöpfe tabellarisch: feste Spalten, rechts verankert, linksbündig gefüllt */
.org-aktionen { display: grid; margin-left: auto; align-items: center; gap: 4px 8px;
                grid-template-columns: 78px 128px 100px 138px 116px 78px;
                justify-items: start; }
.org-sp { display: flex; gap: 4px; }
.org-zeile .msg { flex: 1; min-width: 40px; }

/* Anpinn-Kästchen: groß + inline, NICHT von der globalen input-Breite erfasst */
.org-pin { width: 18px; height: 18px; margin: 0; flex: 0 0 18px; accent-color: var(--acc);
           cursor: pointer; }
.org-pfeil.klappbar { cursor: pointer; }
.org-pfeil.klappbar:hover { color: #e6edf3; }
.org-kinder { margin-left: 7px; padding-left: 20px; border-left: 1px solid #30363d; }
/* Quer-Ast vom senkrechten Strich zur Kindzeile */
.org-kinder > div > .org-zeile::before {
  content: ''; position: absolute; left: -20px; top: 50%;
  width: 16px; height: 1px; background: #30363d;
}
/* Der senkrechte Strich soll am letzten Kind enden, nicht ins Leere laufen */
.org-kinder > div:last-child { position: relative; }
.org-kinder > div:last-child::before {
  content: ''; position: absolute; left: -21px; top: 14px; bottom: 0;
  width: 2px; background: var(--card);
}

/* Bearbeiten-Fenster: Formular links am Rand, rechts die Vorschau der Verlinkungen */
#org-form { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start;
            margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px;
            position: relative; }
/* Koordinaten als Info oben rechts im Fenster */
/* Oben rechts im Fenster: zus.-Info-Knopf + Koordinaten-Anzeige */
#org-oben-rechts { position: absolute; top: 10px; right: 4px;
                   display: flex; gap: 12px; align-items: center; }
#org-koord { font-size: 13px; cursor: pointer; }
#org-koord:hover { color: var(--fg); }
.org-form-links { flex: 1 1 380px; max-width: 440px; }
.org-vorschau { flex: 1 1 320px; }
.org-form-links .row input { min-width: 0; }
.org-vorschau { flex: 1; min-width: 0; }
.org-vorschau h3 { margin-top: 0; }
.linkknopf { display: inline-block; padding: 7px 12px; border: 1px solid var(--line);
             border-radius: 7px; background: #232a33; color: var(--fg);
             text-decoration: none; font-size: 14px; }
.linkknopf:hover { border-color: var(--acc); }
.linkknopf[hidden] { display: none; }
/* Feldbreiten HIER, nicht als style=-Attribut: die CSP (style-src 'self') blockt Inline-Styles */
#org-form-titel { flex: 1; margin: 0; }
#org-plz { flex: 0 0 60px; width: 60px; }
#org-name { flex: 1; }
#org-lat, #org-lon { flex: 1; }
#org-groesse { flex: 0 0 110px; width: 110px; }
#org-projekt { flex: 1; }
#org-notiz { flex: 1; }
#org-mehr-bereich label { margin: 0; }
/* Generell: Zeilen im Bearbeiten-Fenster überlappen nicht — fester Abstand,
   und der globale input-margin-top wird hier neutralisiert. */
#org-form .row { margin-bottom: 12px; }
#org-form input, #org-form select { margin-top: 0; }
#org-form .row:last-child { margin-bottom: 0; }

/* Plan-Auswahlfenster (Overlay) */
#gf-wahl { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .55);
           display: flex; align-items: center; justify-content: center; }
.gf-wahl-box { width: 620px; max-width: 94vw; max-height: 75vh; overflow: auto; }
.gf-wahl-eintrag { display: block; width: 100%; text-align: left; margin-bottom: 8px;
                   padding: 10px 14px; }
.gf-wahl-eintrag .msg { display: block; margin-top: 2px; }

/* GIS-Vollbild-Fenster */
#gis-fenster { position: fixed; inset: 0; z-index: 65; background: var(--bg);
               padding: 14px 22px; overflow: auto; }
#gis-fenster h2 { flex: 1; }
#gis-fenster #gis-canvas { height: calc(100vh - 330px); min-height: 420px; }

/* 3D-Vollbild-Fenster */
/* Grafische Set-Zusammenstellung im Gerätekatalog (wie der Rack-Konfigurator) */
.set-teil-grafik { background: #14171c; border: 1px solid var(--line); border-radius: 10px;
                   padding: 10px 12px; margin-bottom: 10px; }
.set-fest { margin: 6px 0 4px; }
.set-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.set-slot { border: 1px dashed #3b4450; border-radius: 8px; min-height: 40px;
            display: flex; align-items: center; justify-content: center; gap: 8px;
            font-size: 12px; color: var(--dim); padding: 4px 8px; text-align: center; }
.set-slot.belegt { border-style: solid; border-color: #3fb950;
                   background: rgba(63,185,80,.12); color: var(--fg); }
.set-slot.ziel { border-color: #58a6ff; background: rgba(88,166,255,.12); }
#set-palette { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.set-chip { border: 1px solid #58a6ff; border-radius: 14px; padding: 4px 12px;
            font-size: 12px; cursor: grab; background: rgba(88,166,255,.10); }
#set-palette-wrap h4 { margin: 8px 0 2px; color: var(--dim); }
.set-svg { width: 100%; height: auto; display: block; margin: 2px 0 10px; }
.set-bays { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin: 4px 0 8px; }
.set-bay { border: 1px dashed #3b4450; border-radius: 5px; min-height: 34px;
           display: flex; align-items: center; justify-content: center;
           font-size: 10px; color: var(--dim); cursor: default; overflow: hidden; }
.set-bay.belegt { border-style: solid; border-color: #e3b341;
                  background: rgba(227,179,65,.14); color: var(--fg); cursor: pointer; }
.set-bay.ziel { border-color: #58a6ff; background: rgba(88,166,255,.12); }
.set-chip.laufwerk { border-color: #e3b341; background: rgba(227,179,65,.10); }
.set-chip.sfp { border-color: #ffd60a; background: rgba(255,214,10,.12); }
#set-stueckliste table { margin-top: 4px; }
.set-grund { margin-top: 6px; gap: 8px; align-items: center; }
/* Schemavorschau im Katalog-Baum: nur Ansicht, kompakt unter dem Eintrag */
.kat-vorschau { margin: 4px 8px 12px 44px; max-width: 760px; background: #14171c;
                border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; }
.kat-vorschau svg { pointer-events: none; }
.set-seiten { display: flex; gap: 6px; margin: 6px 0 2px; }
.set-seiten button.aktiv { background: #2f81f7; color: #fff; border-color: #2f81f7; }
.set-grund select { max-width: 320px; }
#set-stueckliste h4 { margin: 10px 0 2px; color: var(--dim); }
.set-palette-titel { width: 100%; margin: 4px 0 0; }

/* LWL-Verbindungsdialog: liegt über dem CAD-Vollbild */
#lwl-fenster { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.55);
               display: flex; align-items: center; justify-content: center; }
#lwl-fenster[hidden] { display: none; }
.lwl-dialog { background: #14171c; border: 1px solid var(--line); border-radius: 12px;
              padding: 18px 22px; width: min(640px, 92vw); }
.lwl-felder { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
              margin: 10px 0; }
.lwl-felder label { display: flex; flex-direction: column; gap: 3px; font-size: 12px;
                    color: var(--dim); }
/* 3D liegt ÜBER dem CAD-Vollbild (z 60) — es wird von dort aus geöffnet */
#cad3d-fenster { position: fixed; inset: 0; z-index: 70; background: var(--bg);
                 padding: 14px 22px; display: flex; flex-direction: column; gap: 10px; }
#cad3d-fenster h2 { flex: 0 1 auto; }
#cad3d-canvas { flex: 1; width: 100%; min-height: 0; border: 1px solid var(--line);
                border-radius: 8px; background: #0b0e13; cursor: grab; }
#cad3d-canvas:active { cursor: grabbing; }

/* Audit-Rundgang und Katalogpflege — Vollbild ÜBER dem CAD-Fenster.
   Ohne eigene z-Ebene liegt die Zeichenfläche darüber und schluckt jeden Klick
   auf „Ja"/„Nein" (im Prüflauf mit Playwright genau so aufgefallen). */
#audit-fenster, #katalog-fenster {
  position: fixed; inset: 0; z-index: 80; background: var(--bg);
  padding: 14px 22px; display: flex; flex-direction: column; gap: 10px;
  overflow: auto;
}
#audit-inhalt { max-width: 760px; margin: 8vh auto 0; }
#audit-frage { font-size: 1.35rem; font-weight: 600; line-height: 1.35; margin: 10px 0; }
#audit-antworten { gap: 12px; margin-top: 28px; }
#audit-antworten button { flex: 1; padding: 14px 10px; font-size: 1.05rem; }
#audit-antworten #audit-zurueck { flex: 0 0 auto; padding: 14px 16px; }
#audit-ende { max-width: 620px; margin: 12vh auto 0; text-align: center; }
#katalog-liste { max-width: 1100px; margin: 0 auto; width: 100%; }
.katalog-frage { gap: 8px; align-items: center; }
.katalog-frage .f-de, .katalog-frage .f-en { flex: 1 1 240px; min-width: 0; }

/* GIS (Glasfaser) */
.scrollrahmen { overflow: auto; max-height: 70vh; border: 1px solid #30363d; border-radius: 8px; }
.fett { font-weight: 600; }
#gis-canvas { width: 100%; height: 480px; display: block; border: 1px solid var(--line);
              border-radius: 8px; background: #0f1216; cursor: grab; touch-action: none; }
#gis-detail { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
#gis-detail .row { margin-bottom: 10px; }
#gis-detail input, #gis-detail select { margin-top: 0; min-width: 0; flex: 1; }
#gis-fasern, #gis-belegt { flex: 0 0 90px; }
.gis-pruefung { display: flex; gap: 10px; align-items: center; padding: 4px 0;
                border-bottom: 1px solid var(--line); font-size: 14px; }
.gis-pruefung .msg { flex: 1; }

/* CAD-Ansicht */
/* CAD-Vollbild-Fenster — Aufbau wie die iPad-App (Palette links, Fußzeile unten) */
#cad-card { position: fixed; inset: 0; z-index: 60; background: #0b0e13;
            padding: 12px 16px; display: flex; flex-direction: column;
            overflow: auto; }
#cad-card[hidden] { display: none; }
#cad-flaeche { position: relative; display: flex; gap: 10px; flex: 1; min-height: 420px; }
#cad-palette { flex: 0 0 86px; background: #14171c; border: 1px solid var(--line);
               border-radius: 10px; padding: 6px; overflow-y: auto; align-self: stretch; }
#cad-palette .wz-gruppe { font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
                          color: var(--dim); margin: 10px 4px 4px; }
#cad-palette .wz { display: flex; flex-direction: column; align-items: center; gap: 2px;
                   width: 100%; background: none; border: none; border-radius: 8px;
                   color: var(--fg); padding: 7px 2px; font-size: 11px; cursor: pointer; }
#cad-palette .wz:hover { background: rgba(88,166,255,.08); }
#cad-palette .wz.aktiv { background: rgba(47,129,247,.22); color: #58a6ff; }
#cad-palette .wz-ico { font-size: 19px; line-height: 1; }
#cad-mitte { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#cad-canvas { flex: 1; width: 100%; min-height: 380px; display: block;
              border: 1px solid var(--line); border-radius: 8px 8px 0 0;
              background: #121212; cursor: crosshair; }
#cad-kpi { position: absolute; top: 8px; left: 106px; font-size: 12px; color: #c9d1d9;
           background: rgba(18,18,18,.72); padding: 3px 10px; border-radius: 7px;
           pointer-events: none; }
#cad-fusszeile { display: flex; align-items: center; gap: 16px; background: #14171c;
                 border: 1px solid var(--line); border-top: none;
                 border-radius: 0 0 8px 8px; padding: 6px 12px; font-size: 12px;
                 color: var(--dim); flex-wrap: wrap; }
#cad-fusszeile input[type="number"] { width: 76px !important; }
.cad-schalter { display: flex; align-items: center; gap: 6px; }
#cad-ebenen { position: absolute; top: 10px; left: 106px; background: rgba(20,22,26,.94);
              border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px;
              max-height: 420px; overflow: auto; }
#cad-ebenen h3 { margin: 0 0 6px; }
.cad-ebene { display: block; margin: 3px 0; font-size: 13px; color: var(--fg); cursor: pointer; }
.cad-ebene input { width: auto; margin: 0 6px 0 0; }
#cad-inspector { position: absolute; top: 10px; right: 10px; width: 260px;
                 background: rgba(20,22,26,.94); border: 1px solid var(--line);
                 border-radius: 8px; padding: 10px 14px; max-height: 480px; overflow: auto; }
#cad-inspector h3 { margin: 0 0 8px; }
#cad-insp-felder label { display: block; margin-bottom: 8px; font-size: 12px;
                         color: var(--dim); }
#cad-insp-felder input { width: 100%; margin-top: 2px; }
/* Bemerkung ist Freitext — Feld wie die übrigen, nur mehrzeilig und nicht
   frei ziehbar (sonst schiebt es die Seitenleiste auseinander). */
#cad-insp-felder textarea { width: 100%; margin-top: 2px; resize: vertical;
                            padding: 9px 10px; background: #0f1216; font: inherit;
                            border: 1px solid var(--line); border-radius: 7px;
                            color: var(--fg); font-size: 14px; }
#cad-notiz { flex: 1; min-width: 140px; }

/* Geräte-Konfigurator (DnD: Karte auf Slot ziehen) */
#rk-bau { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
#rk-bau-flaeche { display: flex; gap: 24px; align-items: flex-start; }
#rk-bau-geraet { flex: 0 0 520px; border: 2px solid var(--line); border-radius: 8px;
                 background: #10141a; padding: 14px; }
#rk-bau-fest { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.rk-fest { border: 1px solid var(--line); border-radius: 5px; padding: 6px 10px;
           font-size: 12px; color: var(--dim); background: #171b22; }
#rk-bau-slots { display: flex; flex-direction: column; gap: 8px; }
.rk-slot { border: 1.5px dashed #3d4450; border-radius: 6px; min-height: 40px;
           display: flex; align-items: center; gap: 10px; padding: 6px 12px;
           font-size: 13px; color: var(--dim); }
.rk-slot.belegt { border-style: solid; border-color: #3fb950; color: var(--fg);
                  background: rgba(63,185,80,.08); }
.rk-slot.ziel { border-color: var(--acc); background: rgba(59,130,246,.12); }
.rk-slot .msg { flex: 1; }
#rk-bau-karten { flex: 1; }
#rk-bau-karten h4 { margin: 0 0 8px; color: var(--dim); }
.rk-karte { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px;
            margin-bottom: 6px; cursor: grab; background: #1b212b; font-size: 13px; }
.rk-karte:active { cursor: grabbing; }
.rk-karte .msg { display: block; font-size: 11px; }

/* ACI-Placement */
.aci-raum { display: block; margin: 4px 0; font-size: 14px; color: var(--fg); cursor: pointer; }
.aci-raum input { width: 18px; height: 18px; margin: 0 6px 0 0; accent-color: var(--acc);
                  vertical-align: middle; }
.aci-zahl { width: 70px !important; }
#aci-anker h4 { margin: 10px 0 4px; color: var(--dim); }
#aci-vorschau table { margin-top: 10px; }
/* Zeichnungs-Baum: Planungen hängen eingerückt unter ihrer Originalzeichnung */
tr.plan-kind td:first-child { padding-left: 22px; }
tr.plan-kind td { background: rgba(139,148,158,.05); }
.baum-ast { color: var(--dim); }
#aci-kabel table, #aci-material table { margin-top: 6px; }
#aci-kabel h4, #aci-material h4 { margin: 14px 0 2px; color: var(--dim); }
.warn { color: var(--warn); margin: 4px 0; font-size: 13px; }

/* Katalog-Baum */
.kat-kopf { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer;
            user-select: none; }
.kat-kopf:hover b { color: var(--acc-text); }
.kat-zeile { display: flex; align-items: center; gap: 10px; padding: 3px 0 3px 44px;
             flex-wrap: wrap; }
.kat-zeile .msg { flex: 1; min-width: 200px; }

/* Verkabelung */
#kabel-editor { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
#kabel-flaeche { display: flex; gap: 20px; align-items: flex-start; }
#kabel-tabelle { flex: 1; }
#kabel-form { flex: 0 0 300px; }
#kabel-form label { display: block; margin-bottom: 8px; font-size: 12px; color: var(--dim); }
#kabel-form input, #kabel-form select { width: 100%; margin-top: 2px; }
#kabel-tabelle tr.gewaehlt td { background: rgba(227,179,65,.12); }

/* Rack-Bestückung (Elevation) */
#rack-editor { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
#rack-flaeche { display: flex; gap: 20px; align-items: flex-start; }
.rack-seite h4 { margin: 0 0 6px 30px; color: var(--dim); font-size: 13px; }
.rack-he { position: relative; width: 300px; margin-left: 30px; border: 2px solid var(--line);
           border-radius: 6px; background:
             repeating-linear-gradient(to top, #0f1216 0, #0f1216 15px, #1b2027 15px, #1b2027 16px); }
.rk-he-label { position: absolute; left: -30px; width: 26px; text-align: right;
               font-size: 10px; color: var(--dim); }
.rk-item { position: absolute; left: 4px; right: 4px; border: 1px solid;
           border-radius: 3px; font-size: 11px; overflow: hidden; white-space: nowrap;
           padding: 1px 6px; cursor: pointer; color: var(--fg); }
.rk-item.server { background: rgba(47,129,247,.30); border-color: #2f81f7; }
.rk-item.switch, .rk-item.patchpanel { background: rgba(63,185,80,.30); border-color: #3fb950; }
.rk-item.storage { background: rgba(57,197,207,.30); border-color: #39c5cf; }
.rk-item.usv { background: rgba(227,179,65,.30); border-color: #e3b341; }
.rk-item.pdu { background: rgba(240,136,62,.35); border-color: #f0883e; }
.rk-item.sonstig { background: rgba(139,148,158,.30); border-color: #8b949e; }
.rk-item.gewaehlt { outline: 2px solid #e3b341; }
.rk-ports { font-size: 9px; color: var(--dim); overflow: hidden; white-space: nowrap; }
.rk-item.kollision { outline: 2px solid #f85149; }
.rk-drop { position: absolute; left: 4px; right: 4px; pointer-events: none;
           border: 1px dashed #2f81f7; background: rgba(47,129,247,.18); border-radius: 3px; }
#rack-form { flex: 0 0 300px; }
#rack-form label { display: block; margin-bottom: 8px; font-size: 12px; color: var(--dim); }
#rack-form input, #rack-form select { width: 100%; margin-top: 2px; }
#rack-form .row label { flex: 1; }

/* Stockwerksplan */
#sw-canvas { width: 100%; height: 520px; display: block; border: 1px solid var(--line);
             border-radius: 8px; background: #0f1216; }
#sw-canvas.platzieren { cursor: crosshair; }
#sw-raeume div { padding: 4px 0; }
.ohne-abstand { margin: 0; }

/* Campus-Adressblock + Ansprechpartner */
#org-werk, #org-industrie, #org-strasse { flex: 1; }
#org-osm-geb, #org-geb-nr { flex: 1; }
#org-projekt-suche { flex: 1; }
#org-adress-treffer { margin-bottom: 12px; }
#org-adress-treffer button { display: block; width: 100%; text-align: left;
                             margin-bottom: 6px; }
#org-telefon { flex: 0 0 150px; width: 150px; }
#org-adresse h3 { margin: 10px 0 6px; }
.org-kontakt { display: flex; gap: 8px; margin-bottom: 6px; }
.org-kontakt input { min-width: 0; flex: 1; }
.org-kontakt button { flex: 0 0 auto; padding: 5px 9px; }
.wiki-inhalt { display: flex; gap: 12px; align-items: flex-start; }
#org-wiki-bild { max-width: 140px; border-radius: 7px; }
#org-wiki-text { white-space: pre-wrap; }
#org-karte-canvas { width: 100%; height: 320px; display: block; border: 1px solid var(--line);
                    border-radius: 7px; background: #0f1216; cursor: grab; }
#org-karte-canvas.setzmodus { cursor: crosshair; }
#org-osm-vorschau { margin-top: 14px; }
.karte-titel { flex: 1; margin: 0; }
button.danger { color: var(--gefahr-text); }
#gf-canvas { display: block; }
#gf-liste div { padding: 3px 0; }


/* Linker Menübaum */
.layout { display: flex; gap: 16px; align-items: flex-start; }
#menu { width: 230px; flex: none; background: #161b22; border: 1px solid #30363d;
        border-radius: 10px; padding: 8px; position: sticky; top: 12px; }
#inhalt { flex: 1; min-width: 0; }
.menu-kopf { display: block; width: 100%; text-align: left; background: none; border: none;
             color: #8b949e; font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
             padding: 10px 10px 6px; cursor: pointer; }
.menu-sektion.zu .menu-punkte { display: none; }
.menu-punkt { display: block; width: 100%; text-align: left; background: none; border: none;
              color: #c9d1d9; padding: 8px 12px; border-radius: 8px; cursor: pointer;
              font-size: 14px; }
.menu-punkt:hover { background: #21262d; }
.menu-punkt.aktiv { background: #1f6feb33; color: #58a6ff; font-weight: 600; }
#settings-tabs .tab { background: none; border: none; color: #c9d1d9; padding: 8px 14px;
                      border-bottom: 2px solid transparent; cursor: pointer; }
#settings-tabs .tab.aktiv { color: #58a6ff; border-bottom-color: #58a6ff; font-weight: 600; }


/* Benutzerverwaltung: zweispaltiges Formular, Rechteliste als Kästchenraster */
.formspalten { display: flex; gap: 24px; align-items: flex-start; }
.formspalten > div:first-child { flex: 1 1 auto; min-width: 0; }
.formspalten > div:last-child { flex: 0 0 260px; }
.rechteliste { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
               gap: 6px 14px; margin: 10px 0; }
.rechteliste label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rechteliste input[type="checkbox"] { width: 22px; height: 22px; flex: 0 0 auto; }
label.ankreuz { display: flex; align-items: center; gap: 8px; }
label.ankreuz input[type="checkbox"] { width: 22px; height: 22px; }
#users tbody tr { cursor: pointer; }
#users td .zeilenknoepfe { display: flex; gap: 6px; justify-content: flex-end; }
.rechte-kurz { color: var(--dim, #8b949e); font-size: 12px; }


/* Berechtigungstabelle: die Eingabezeile steht IN der Tabelle und fluchtet
   dadurch mit den Spalten „Knoten" und „Rolle". */
#ufRechte { width: 100%; }
#ufRechte tfoot td { padding-top: 10px; vertical-align: middle; }
#ufRechte tfoot select { width: 100%; margin: 0; }
#ufRechte th:last-child, #ufRechte td:last-child { width: 210px; text-align: right; }
#ufRechte th:nth-child(2), #ufRechte td:nth-child(2) { width: 34%; }


/* Miniatur der Gerätezeichnung neben dem Katalogeintrag: feste Breite, damit die
   Zeilen im Baum in einer Flucht bleiben; die Zeichnung selbst ist nicht anklickbar. */
.kat-zeile { display: flex; align-items: center; gap: 10px; }
.kat-mini { flex: 0 0 190px; max-width: 190px; pointer-events: none; opacity: .95; }
.kat-mini svg { width: 100%; height: auto; display: block; }
.kat-text { flex: 1 1 auto; min-width: 0; }

/* ---------------------------------------------------------------------------
   Rackansicht ohne Inline-Styles.

   Die Content-Security-Policy erlaubt nur `style-src 'self'`. Damit blockt der
   Browser JEDES Setzen von `element.style.…` — die Rackansicht hat ihre Höhen
   und Positionen so gesetzt und stand deshalb live falsch da (in der Konsole:
   „Applying inline style violates … style-src 'self'"). Die Werte sind aber
   diskret: alles ist ein Vielfaches der Höheneinheit. Darum hier feste Klassen
   statt Ausnahmen in der Richtlinie.
   Schrittweite = RK_PX in cad.js (16 px je HE) — beide zusammen ändern.
   --------------------------------------------------------------------------- */
.klickbar { cursor: pointer; }
.rk-item.zero-u { left: auto; right: -14px; width: 10px; top: 4px; bottom: 4px; }
.rk-b-0 { bottom: 0px; }
.rk-b-1 { bottom: 16px; }
.rk-b-2 { bottom: 32px; }
.rk-b-3 { bottom: 48px; }
.rk-b-4 { bottom: 64px; }
.rk-b-5 { bottom: 80px; }
.rk-b-6 { bottom: 96px; }
.rk-b-7 { bottom: 112px; }
.rk-b-8 { bottom: 128px; }
.rk-b-9 { bottom: 144px; }
.rk-b-10 { bottom: 160px; }
.rk-b-11 { bottom: 176px; }
.rk-b-12 { bottom: 192px; }
.rk-b-13 { bottom: 208px; }
.rk-b-14 { bottom: 224px; }
.rk-b-15 { bottom: 240px; }
.rk-b-16 { bottom: 256px; }
.rk-b-17 { bottom: 272px; }
.rk-b-18 { bottom: 288px; }
.rk-b-19 { bottom: 304px; }
.rk-b-20 { bottom: 320px; }
.rk-b-21 { bottom: 336px; }
.rk-b-22 { bottom: 352px; }
.rk-b-23 { bottom: 368px; }
.rk-b-24 { bottom: 384px; }
.rk-b-25 { bottom: 400px; }
.rk-b-26 { bottom: 416px; }
.rk-b-27 { bottom: 432px; }
.rk-b-28 { bottom: 448px; }
.rk-b-29 { bottom: 464px; }
.rk-b-30 { bottom: 480px; }
.rk-b-31 { bottom: 496px; }
.rk-b-32 { bottom: 512px; }
.rk-b-33 { bottom: 528px; }
.rk-b-34 { bottom: 544px; }
.rk-b-35 { bottom: 560px; }
.rk-b-36 { bottom: 576px; }
.rk-b-37 { bottom: 592px; }
.rk-b-38 { bottom: 608px; }
.rk-b-39 { bottom: 624px; }
.rk-b-40 { bottom: 640px; }
.rk-b-41 { bottom: 656px; }
.rk-b-42 { bottom: 672px; }
.rk-b-43 { bottom: 688px; }
.rk-b-44 { bottom: 704px; }
.rk-b-45 { bottom: 720px; }
.rk-b-46 { bottom: 736px; }
.rk-b-47 { bottom: 752px; }
.rk-b-48 { bottom: 768px; }
.rk-b-49 { bottom: 784px; }
.rk-b-50 { bottom: 800px; }
.rk-b-51 { bottom: 816px; }
.rk-b-52 { bottom: 832px; }
.rk-b-53 { bottom: 848px; }
.rk-b-54 { bottom: 864px; }
.rk-b-55 { bottom: 880px; }
.rk-b-56 { bottom: 896px; }
.rk-b-57 { bottom: 912px; }
.rk-b-58 { bottom: 928px; }
.rk-b-59 { bottom: 944px; }
.rk-b-60 { bottom: 960px; }
.rk-h-1 { height: 16px; }
.rk-h-2 { height: 32px; }
.rk-h-3 { height: 48px; }
.rk-h-4 { height: 64px; }
.rk-h-5 { height: 80px; }
.rk-h-6 { height: 96px; }
.rk-h-7 { height: 112px; }
.rk-h-8 { height: 128px; }
.rk-h-9 { height: 144px; }
.rk-h-10 { height: 160px; }
.rk-h-11 { height: 176px; }
.rk-h-12 { height: 192px; }
.rk-h-13 { height: 208px; }
.rk-h-14 { height: 224px; }
.rk-h-15 { height: 240px; }
.rk-h-16 { height: 256px; }
.rk-h-17 { height: 272px; }
.rk-h-18 { height: 288px; }
.rk-h-19 { height: 304px; }
.rk-h-20 { height: 320px; }
.rk-h-21 { height: 336px; }
.rk-h-22 { height: 352px; }
.rk-h-23 { height: 368px; }
.rk-h-24 { height: 384px; }
.rk-h-25 { height: 400px; }
.rk-h-26 { height: 416px; }
.rk-h-27 { height: 432px; }
.rk-h-28 { height: 448px; }
.rk-h-29 { height: 464px; }
.rk-h-30 { height: 480px; }
.rk-h-31 { height: 496px; }
.rk-h-32 { height: 512px; }
.rk-h-33 { height: 528px; }
.rk-h-34 { height: 544px; }
.rk-h-35 { height: 560px; }
.rk-h-36 { height: 576px; }
.rk-h-37 { height: 592px; }
.rk-h-38 { height: 608px; }
.rk-h-39 { height: 624px; }
.rk-h-40 { height: 640px; }
.rk-h-41 { height: 656px; }
.rk-h-42 { height: 672px; }
.rk-h-43 { height: 688px; }
.rk-h-44 { height: 704px; }
.rk-h-45 { height: 720px; }
.rk-h-46 { height: 736px; }
.rk-h-47 { height: 752px; }
.rk-h-48 { height: 768px; }
.rk-h-49 { height: 784px; }
.rk-h-50 { height: 800px; }
.rk-h-51 { height: 816px; }
.rk-h-52 { height: 832px; }
.rk-h-53 { height: 848px; }
.rk-h-54 { height: 864px; }
.rk-h-55 { height: 880px; }
.rk-h-56 { height: 896px; }
.rk-h-57 { height: 912px; }
.rk-h-58 { height: 928px; }
.rk-h-59 { height: 944px; }
.rk-h-60 { height: 960px; }
.rk-ih-1 { height: 14px; }
.rk-ih-2 { height: 30px; }
.rk-ih-3 { height: 46px; }
.rk-ih-4 { height: 62px; }
.rk-ih-5 { height: 78px; }
.rk-ih-6 { height: 94px; }
.rk-ih-7 { height: 110px; }
.rk-ih-8 { height: 126px; }
.rk-ih-9 { height: 142px; }
.rk-ih-10 { height: 158px; }
.rk-ih-11 { height: 174px; }
.rk-ih-12 { height: 190px; }
.rk-ih-13 { height: 206px; }
.rk-ih-14 { height: 222px; }
.rk-ih-15 { height: 238px; }
.rk-ih-16 { height: 254px; }
.rk-ih-17 { height: 270px; }
.rk-ih-18 { height: 286px; }
.rk-ih-19 { height: 302px; }
.rk-ih-20 { height: 318px; }
.rk-ih-21 { height: 334px; }
.rk-ih-22 { height: 350px; }
.rk-ih-23 { height: 366px; }
.rk-ih-24 { height: 382px; }
.rk-ih-25 { height: 398px; }
.rk-ih-26 { height: 414px; }
.rk-ih-27 { height: 430px; }
.rk-ih-28 { height: 446px; }
.rk-ih-29 { height: 462px; }
.rk-ih-30 { height: 478px; }
.rk-ih-31 { height: 494px; }
.rk-ih-32 { height: 510px; }
.rk-ih-33 { height: 526px; }
.rk-ih-34 { height: 542px; }
.rk-ih-35 { height: 558px; }
.rk-ih-36 { height: 574px; }
.rk-ih-37 { height: 590px; }
.rk-ih-38 { height: 606px; }
.rk-ih-39 { height: 622px; }
.rk-ih-40 { height: 638px; }
.rk-ih-41 { height: 654px; }
.rk-ih-42 { height: 670px; }
.rk-ih-43 { height: 686px; }
.rk-ih-44 { height: 702px; }
.rk-ih-45 { height: 718px; }
.rk-ih-46 { height: 734px; }
.rk-ih-47 { height: 750px; }
.rk-ih-48 { height: 766px; }
.rk-ih-49 { height: 782px; }
.rk-ih-50 { height: 798px; }
.rk-ih-51 { height: 814px; }
.rk-ih-52 { height: 830px; }
.rk-ih-53 { height: 846px; }
.rk-ih-54 { height: 862px; }
.rk-ih-55 { height: 878px; }
.rk-ih-56 { height: 894px; }
.rk-ih-57 { height: 910px; }
.rk-ih-58 { height: 926px; }
.rk-ih-59 { height: 942px; }
.rk-ih-60 { height: 958px; }
/* Ebenenfarben (ACI) — dieselbe Tabelle wie CAD_ACI in cad.js. */
.aci-1 { color: #ff453a; }
.aci-2 { color: #ffd60a; }
.aci-3 { color: #32d74b; }
.aci-4 { color: #64d2ff; }
.aci-5 { color: #0a84ff; }
.aci-6 { color: #bf5af2; }
.aci-7 { color: #ffffff; }
.aci-8 { color: #808080; }
.aci-9 { color: #c9d1d9; }
.aci-30 { color: #ff9f0a; }
.aci-140 { color: #64d2ff; }
.aci-252 { color: #6e7681; }
.aci-frei { color: #ffffff; }
/* Einrückung im Katalogbaum — Vielfache von 22 px, ebenfalls ohne Inline-Style. */
.kat-tiefe-0 { margin-left: 0px; }
.kat-tiefe-1 { margin-left: 22px; }
.kat-tiefe-2 { margin-left: 44px; }
.kat-tiefe-3 { margin-left: 66px; }
.kat-tiefe-4 { margin-left: 88px; }
.kat-tiefe-5 { margin-left: 110px; }
.kat-tiefe-6 { margin-left: 132px; }
/* Trassenfarben (Glasfaser) — feste Palette, siehe org.js. */
.trasse-farbe-0 { color: #2f81f7; }
.trasse-farbe-1 { color: #3fb950; }
.trasse-farbe-2 { color: #f85149; }
.trasse-farbe-3 { color: #a371f7; }
.trasse-farbe-4 { color: #e3b341; }
.trasse-farbe-frei { color: #c9d1d9; }
/* Ersatz für die letzten style=-Attribute im HTML — die CSP blockt sie. */
.dehnen { flex: 1; }
.ohne-rand { margin: 0; }
.schmal { width: 110px; }

/* Auge für die Audit-Ebene: ausgeblendet = gedämpft, damit der Zustand ohne
   Hineinsehen erkennbar ist. Ein Inline-Style ginge nicht, die CSP blockt ihn. */
#cad-audit-ebene { font-size: 15px; line-height: 1; padding: 4px 8px; }
#cad-audit-ebene.aus { color: var(--dim); border-color: var(--line); }

/* Bestückungs-Import: Einfügefeld volle Breite, unbrauchbare Zeilen gedimmt */
#rk-import-text { width: 100%; font-family: ui-monospace, monospace; margin-top: 8px; }
#rack-import-panel { border: 1px solid var(--rand, #444); border-radius: 8px;
  padding: 10px 12px; margin-top: 10px; }
.rk-import-fehlt td { opacity: 0.45; }

/* Rack-Foto neben der Elevation: erstes Bild gross, weitere als Reihe */
#rack-foto-spalte { max-width: 240px; }
.rack-foto { position: relative; display: inline-block; margin: 0 6px 6px 0; }
.rack-foto img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; }
.rack-foto.gross { display: block; }
.rack-foto.gross img { width: 100%; height: auto; max-height: 300px; object-fit: contain; }
.rack-foto-weg { position: absolute; top: 4px; right: 4px; padding: 0 6px; line-height: 1.4; }

/* Rackgrößen-Wahl in der Palette (gilt für Rack und Reihe) */
#cad-rack-groesse { width: 100%; margin: 2px 0 6px; }

/* Raumcheck: Befundzeilen. Klickbare Zeilen führen zum Objekt im Plan. */
/* Abstand zur Kennzahlenzeile darueber — mit 8px lag die Ueberschrift halb darunter. */
#cad-raumcheck { margin-top: 22px; }
.rc-befund, .rc-rack { padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.rc-klickbar { cursor: pointer; }
.rc-klickbar:hover { background: var(--hover, rgba(127,127,127,.12)); }
