/* AUFTRAG-RAUMPLAN-EDITOR-CC.md (Doc 25): Stile des Raumplan-Moduls.
   BEWUSST global statt scoped (wie css/reservations.css): der Plan zeichnet in
   SVG und reicht Teile davon an Unterkomponenten weiter (SvgText, das
   Element-Template) - Blazors CSS-Isolation endet an jeder Komponentengrenze
   und haette hier eine ::deep-Kette durch jede Regel erzwungen.
   Token-Kit wie in der Bonier-UI (Doc 12 Kap. 10): --pos-* aus pos-theme.css. */

/* ==========  Seitengeruest  ========== */

.plan-seite {
    display: grid;
    grid-template-columns: 1fr 320px;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
    height: calc(100vh - 90px);
    min-height: 480px;
    padding: 10px;
    box-sizing: border-box;
}

.plan-kopf {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--pos-panel);
    border: 1px solid var(--pos-hairline);
    border-radius: var(--pos-radius-sheet, 10px);
}

.plan-kopf h3 { margin: 0; font-size: 1.05rem; }

/* Auftrag Plan-Umbenennen: Namensfeld im Editor-Kopf - sieht wie der
   ehemalige <h3> aus, bis man hineinklickt. */
.plan-kopf-name {
    font-size: 1.05rem;
    font-weight: 600;
    min-width: 160px;
    padding: 2px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font-family: inherit;
}
.plan-kopf-name:hover { border-color: var(--pos-hairline); }
.plan-kopf-name:focus { border-color: var(--pos-accent); background: var(--pos-bg, #fff); outline: none; }

.plan-kopf-zahlen {
    display: flex;
    gap: 14px;
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.plan-kopf-zahl { display: flex; flex-direction: column; line-height: 1.15; }
.plan-kopf-zahl b { font-size: 1.05rem; }
.plan-kopf-zahl span { font-size: .72rem; color: var(--pos-text-dim, #888); }

.plan-mitte {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    min-height: 0;
}

.plan-buehne { flex: 1; min-height: 0; }

.plan-seitenleiste {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
}

.plan-fuss {
    grid-column: 1 / -1;
    grid-row: 3;
}

@media (max-width: 900px) {
    .plan-seite { grid-template-columns: 1fr; }
    .plan-seitenleiste { grid-column: 1; grid-row: 4; max-height: 40vh; }
}

/* ==========  Werkzeugleiste  ========== */

.plan-werkzeuge {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: var(--pos-panel);
    border: 1px solid var(--pos-hairline);
    border-radius: var(--pos-radius-sheet, 10px);
}

.plan-werkzeug-gruppe {
    display: flex;
    gap: 4px;
    padding-right: 8px;
    margin-right: 4px;
    border-right: 1px solid var(--pos-hairline);
}

.plan-werkzeug-gruppe:last-child { border-right: none; }

.plan-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    font-size: .82rem;
    line-height: 1.2;
    color: var(--pos-text, #333);
    background: var(--pos-surface, #f4f4f2);
    border: 1px solid var(--pos-hairline);
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
}

.plan-btn:hover { background: var(--pos-surface-hover, #ececea); }
.plan-btn:disabled { opacity: .45; cursor: default; }

.plan-btn-aktiv {
    background: var(--pos-accent);
    border-color: var(--pos-accent);
    color: #fff;
}

.plan-btn-gefahr { color: #b3261e; border-color: #e6b4b0; }

/* AUFTRAG-EVENT-EDITOR-GESTALTUNG-CC.md Paket D: die Fehlerzeile von
   EventBestuhlungForm trug ihren Rotton als rohen Hex-Wert im style-Attribut -
   jetzt CI-Token (ci.css). Das Bauteil selbst bleibt unangetastet (E.3). */
.event-bestuhlung .eb-fehler { color: var(--tim-fehler); }

.plan-werkzeuge select,
.plan-werkzeuge input[type="number"],
.plan-panel select,
.plan-panel input {
    font-size: .82rem;
    padding: 4px 6px;
    border: 1px solid var(--pos-hairline);
    border-radius: 6px;
    background: var(--pos-surface, #fff);
    color: var(--pos-text, #333);
}

.plan-werkzeuge label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .8rem;
    margin: 0;
}

/* ==========  Editor-Kern  ========== */

.plan-editor {
    position: relative;
    display: grid;
    grid-template-columns: 20px 1fr;
    grid-template-rows: 20px 1fr;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: var(--pos-surface);
    border: 1px solid var(--pos-hairline);
    border-radius: var(--pos-radius-sheet, 10px);
    overflow: hidden;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}

.plan-lineal-ecke {
    grid-column: 1; grid-row: 1;
    display: flex; align-items: center; justify-content: center;
    font-size: 8px;
    color: var(--pos-text-dim, #888);
    background: var(--pos-panel);
    border-right: 1px solid var(--pos-hairline);
    border-bottom: 1px solid var(--pos-hairline);
}

.plan-lineal { background: var(--pos-panel); overflow: hidden; }
.plan-lineal-oben { grid-column: 2; grid-row: 1; border-bottom: 1px solid var(--pos-hairline); }
.plan-lineal-links { grid-column: 1; grid-row: 2; border-right: 1px solid var(--pos-hairline); }

.plan-lineal line { stroke: #9aa0a6; stroke-width: 1; vector-effect: non-scaling-stroke; }
.plan-lineal text { fill: #7b8188; font-size: 9px; dominant-baseline: middle; }

.plan-flaeche {
    position: relative;
    grid-column: 2; grid-row: 2;
    min-width: 0; min-height: 0;
    overflow: hidden;
    /* Ohne das nimmt der Browser Touch-Gesten fuer sich und Pinch/Pan
       erreichen den Editor nie. */
    touch-action: none;
    cursor: default;
}

.plan-flaeche-schiebt { cursor: grabbing; }
.plan-editor-zeichnet .plan-flaeche { cursor: crosshair; }

.plan-svg { display: block; width: 100%; height: 100%; background: #eceae5; }

.plan-blatt { fill: #ffffff; stroke: #c9c6bf; stroke-width: 1; vector-effect: non-scaling-stroke; }
.plan-raster line { stroke: #d9d6cf; }

.plan-element { cursor: move; }

.plan-auswahl rect {
    fill: none;
    stroke: var(--pos-accent, #2d6cdf);
    stroke-dasharray: 4 3;
    vector-effect: non-scaling-stroke;
}

.plan-griff {
    fill: #ffffff;
    stroke: var(--pos-accent, #2d6cdf);
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
    cursor: pointer;
}

.plan-griff-drehen { fill: var(--pos-accent, #2d6cdf); cursor: grab; }
.plan-drehstiel { stroke: var(--pos-accent, #2d6cdf); vector-effect: non-scaling-stroke; }

/* Stuetzpunkt-Griffe (Auftrag Paket A): KREISE in einem anderen Ton als die
   acht quadratischen Rahmengriffe - beides liegt gleichzeitig auf dem Bild,
   und wer den falschen greift, verzieht statt zu verschieben. */
.plan-punktgriff {
    fill: #ffffff;
    stroke: #c2410c;
    stroke-width: 1.8;
    vector-effect: non-scaling-stroke;
    cursor: crosshair;
}

.plan-punktgriff:hover,
.plan-punktgriff-aktiv { fill: #fdba74; }

/* Einfuege-Griff auf der Segmentmitte: bewusst blass, damit er die Punkte
   selbst nicht ueberschreit. */
.plan-punktgriff-neu {
    fill: rgba(194, 65, 12, .35);
    stroke: #c2410c;
    stroke-width: 1;
    stroke-dasharray: 2 2;
    vector-effect: non-scaling-stroke;
    cursor: copy;
}

.plan-punktgriff-neu:hover { fill: #c2410c; stroke-dasharray: none; }

.plan-marquee {
    fill: rgba(45, 108, 223, .15);
    stroke: var(--pos-accent, #2d6cdf);
    stroke-dasharray: 4 3;
    vector-effect: non-scaling-stroke;
}

/* Massstabsleiste: der Ersatz fuer den Massstab am Bildschirm (Doc 25 Kap. 4). */
.plan-massstab {
    position: absolute; left: 12px; bottom: 12px;
    display: flex; align-items: center; gap: 8px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, .88);
    border: 1px solid var(--pos-hairline);
    border-radius: 6px;
    font-size: 11px;
    pointer-events: none;
}

.plan-massstab-balken {
    height: 7px;
    border: 1px solid #3d4551;
    border-top: none;
    background: repeating-linear-gradient(to right, #3d4551 0 8px, transparent 8px 16px);
}

.plan-status {
    position: absolute; right: 12px; bottom: 12px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--pos-hairline);
    border-radius: 6px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

/* Verweigerter Handgriff mit Begruendung (Auftrag Paket A.5) - eine Aktion,
   die wortlos nichts tut, ist schlimmer als eine, die es nicht gibt. */
.plan-hinweis {
    position: absolute; left: 50%; top: 12px;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 7px;
    color: #9a3412;
    font-size: 12.5px;
    pointer-events: none;
}

/* ==========  Zeichen-Hinweiszeile (Auftrag Paket C)  ========== */

.plan-zeichenhilfe {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    padding: 6px 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: .82rem;
    color: #1e3a5f;
}

.plan-zeichenhilfe-text { flex: 1 1 auto; min-width: 200px; }
.plan-zeichenhilfe kbd {
    padding: 1px 5px;
    background: #fff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    font-size: .78rem;
    font-family: inherit;
}

/* ==========  Elemente  ========== */

.pe-raumumriss path, .pe-raumumriss rect, .pe-raumumriss circle {
    fill: none; stroke: #3d4551; stroke-width: 2.5;
    vector-effect: non-scaling-stroke; stroke-linejoin: round;
}

.pe-wand path { stroke: #6b7280; stroke-linecap: butt; stroke-linejoin: miter; fill: none; }
.pe-wand rect, .pe-wand circle { fill: #6b7280; stroke: none; }

.pe-tueroeffnung rect, .pe-tueroeffnung path, .pe-tueroeffnung circle {
    fill: #ffffff; stroke: #6b7280; stroke-width: 1.5; vector-effect: non-scaling-stroke;
}

.pe-rettungsweg-band {
    stroke: #16a34a; stroke-opacity: .22;
    stroke-linecap: butt; stroke-linejoin: round; fill: none;
}

.pe-rettungsweg-mitte { stroke: #16a34a; stroke-dasharray: 400 300; fill: none; }

.pe-fluchttuer-zone {
    fill: #16a34a; fill-opacity: .12; stroke: #16a34a;
    stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke;
}

.pe-fluchttuer-blatt { fill: #16a34a; }
.pe-notausgang rect { fill: #16a34a; stroke: none; }
.pe-notausgang-pfeil { stroke: #ffffff; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.pe-moebel rect, .pe-moebel circle, .pe-moebel path {
    fill: #d9d2c5; stroke: #8a7f6d; stroke-width: 1.2; vector-effect: non-scaling-stroke;
}

.pe-moebel-saeule rect, .pe-moebel-saeule circle { fill: #9ca3af; stroke: #6b7280; }
.pe-moebel-buehne rect, .pe-moebel-buehne circle, .pe-moebel-buehne path { fill: #c7b9e0; stroke: #7c6aa3; }
.pe-moebel-tresen rect, .pe-moebel-tresen path { fill: #b8cfe0; stroke: #5c7f99; }

.pe-tischplatte rect, .pe-tischplatte circle, .pe-tischplatte path {
    fill: #f2ede3; stroke: #8a7f6d; stroke-width: 1.5; vector-effect: non-scaling-stroke;
}

.pe-stuehle rect { fill: #e6e0d4; stroke: #a99c86; stroke-width: 1; vector-effect: non-scaling-stroke; }

.pe-freiform rect, .pe-freiform circle, .pe-freiform path {
    fill: rgba(120, 130, 150, .18); stroke: #7b8798;
    stroke-width: 1.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke;
}

.pe-name, .pe-platzzahl, .pe-beschriftung {
    fill: #3d4551; font-family: inherit; dominant-baseline: middle; pointer-events: none;
}

.pe-platzzahl { fill: #7b8798; }
.pe-beschriftung { font-weight: 600; }

/* AUFTRAG-EVENTSTRUKTUR-NACHSCHAERFUNG-CC.md Paket A.3/B.2 (E-93): Ziffern am
   Stuhlring. pointer-events:none auf der Ziffer selbst, damit der Klick
   immer auf der Stuhlgruppe landet (rect UND Text treffbar). Im Anker-Modus
   zeigt der Cursor an, dass der Stuhl klickbar ist - im Editor "Platz 1
   beginnt hier" (Paket B.2), in der Kasse Platz-Naht/F-50 (AUFTRAG-
   STATUSPLAN-UND-PLATZNAHT-CC.md Paket D): Tap waehlt den Platz fuers
   Bonieren vor statt neu zu nummerieren - derselbe Mechanismus (Stuhl meldet
   seinen GeometrieIndex), zwei Bedeutungen je nach Aufrufer. */
.pe-stuhl-ziffer { fill: #3d4551; font-weight: 600; pointer-events: none; }
.pe-stuhl-anker-modus { cursor: pointer; }
.pe-stuhl-anker-modus rect { stroke: #2c6bd6; stroke-width: 1.5; vector-effect: non-scaling-stroke; }

/* Paket D (F-50) Rueckweg: "wo schon gebucht wurde" - dezent gefuellter Platz
   statt der neutralen Stuhlfarbe, kein zusaetzliches Symbol noetig. */
.pe-stuhl-belegt rect { fill: #b7a888; }

/* Paket G.21: dezenter Hintergrund, sobald die Beschriftung auf einem
   schmalen Objekt verkleinert werden musste - haelt sie lesbar statt sie
   zu beschneiden. */
.pe-name-hintergrund {
    fill: #ffffff; opacity: 0.72; pointer-events: none;
}

/* Befund-Zustaende am Element (Doc 25 Kap. 5) */
.plan-element-hinweis .pe-tischplatte rect,
.plan-element-hinweis .pe-tischplatte circle,
.plan-element-hinweis .pe-tischplatte path,
.plan-element-hinweis .pe-moebel rect,
.plan-element-hinweis .pe-moebel circle,
.plan-element-hinweis .pe-moebel path { stroke: #d68910; stroke-width: 2.5; }

.plan-element-warnung .pe-tischplatte rect,
.plan-element-warnung .pe-tischplatte circle,
.plan-element-warnung .pe-tischplatte path,
.plan-element-warnung .pe-moebel rect,
.plan-element-warnung .pe-moebel circle,
.plan-element-warnung .pe-moebel path { stroke: #c0392b; stroke-width: 3; }

.plan-element-gesperrt { cursor: not-allowed; opacity: .85; }

/* A8.7b (Kasse-Plan-Tischwahl): Status auf einen Blick - frei/offen/
   eskaliert. Muss HIER stehen (global, ungescopt) statt in
   PosTischplanAnsicht.razor.css: .pe-tischplatte wird von der
   Kind-Komponente PlanElementDarstellung gerendert, Blazor-CSS-Isolation
   haengt den Scope-Bezeichner deshalb NIE an dieses Element aus einer
   fremden .razor.css - und selbst ungescopt braucht es die Kind-Shapes
   (rect/circle/path), weil dort (nicht am umschliessenden <g>) der
   sichtbare fill sitzt (Befund waehrend Browser-Verifikation, vorher nie
   im Browser geprueft). */
.pos-tischplan-frei .pe-tischplatte rect,
.pos-tischplan-frei .pe-tischplatte circle,
.pos-tischplan-frei .pe-tischplatte path { fill: #e8ede9; }

.pos-tischplan-offen .pe-tischplatte rect,
.pos-tischplan-offen .pe-tischplatte circle,
.pos-tischplan-offen .pe-tischplatte path { fill: #cfe3f5; stroke: #4f8fc4; stroke-width: 3; }

.pos-tischplan-eskaliert .pe-tischplatte rect,
.pos-tischplan-eskaliert .pe-tischplatte circle,
.pos-tischplan-eskaliert .pe-tischplatte path { fill: #f6d8ca; stroke: #c0392b; stroke-width: 4; }

/* AUFTRAG-STATUSPLAN-UND-PLATZNAHT-CC.md Paket C: der Monitor ersetzt die
   feste Eskaliert-Farbe durch die tatsaechliche Ampelstufen-Farbe (--pos-
   ampel-color kommt inline aus PosTischStatusDienst, dieselbe Sprache wie der
   Randakzent in der Kellner-Spalte, PosOpenTables.razor.css) und pulsiert
   dezent statt hart zu blinken (Gruender-Wunsch "blinken", aber Doc 20 Kap.
   4: sparsame Farben/kein Stroboskop im Arbeits-UI). */
.pos-tischplan-ansicht-monitor .pos-tischplan-eskaliert .pe-tischplatte rect,
.pos-tischplan-ansicht-monitor .pos-tischplan-eskaliert .pe-tischplatte circle,
.pos-tischplan-ansicht-monitor .pos-tischplan-eskaliert .pe-tischplatte path {
    fill: #f6d8ca;
    stroke: var(--pos-ampel-color, #c0392b);
    stroke-width: 5;
    vector-effect: non-scaling-stroke;
}

@keyframes pos-tischplan-monitor-glow {
    0%, 100% { filter: drop-shadow(0 0 0 var(--pos-ampel-color, transparent)); }
    50% { filter: drop-shadow(0 0 30px var(--pos-ampel-color, transparent)); }
}

.pos-tischplan-monitor-eskaliert-pulse {
    animation: pos-tischplan-monitor-glow var(--pos-ampel-pulse-duration, 2.4s) ease-in-out infinite;
}

/* Zahlbereit: dezenter gestrichelter Randakzent zusaetzlich zur "€"-Marke
   ueber dem Tisch (MonitorLabel) - eigener Kanal, damit er nicht mit der
   Ampelfarbe der Eskalation kollidiert. */
.pos-tischplan-monitor-zahlbereit .pe-tischplatte rect,
.pos-tischplan-monitor-zahlbereit .pe-tischplatte circle,
.pos-tischplan-monitor-zahlbereit .pe-tischplatte path {
    stroke-dasharray: 14 8;
}

.pos-tischplan-monitor-wartezeit {
    fill: #2c333d;
    font-weight: 700;
    paint-order: stroke;
    stroke: #ffffff;
    stroke-width: 60;
    stroke-linejoin: round;
}

/* AUFTRAG-EVENT-EDITOR-UND-BELEGUNGSKONFLIKT-CC.md Paket F.4: jeder Tisch mit
   offenem Vorgang zeigt seine Zeit - OHNE Ampelstufe aber LEISE, damit der
   Seitenblick nicht mit dem Alarm verwechselt wird. Der weisse Konturrand
   bleibt (Lesbarkeit ueber der Tischflaeche), nur Farbe und Gewicht gehen
   zurueck. */
.pos-tischplan-monitor-wartezeit-leise {
    fill: #6b7480;
    font-weight: 500;
    opacity: .75;
}

@media (prefers-reduced-motion: reduce) {
    .pos-tischplan-monitor-eskaliert-pulse { animation: none; }
}

/* ==========  Overlays  ========== */

.plan-overlay-freihaltung path {
    fill: rgba(22, 163, 74, .16);
    stroke: #16a34a;
    stroke-width: 1;
    stroke-dasharray: 5 4;
    vector-effect: non-scaling-stroke;
}

.plan-overlay-ruhezone circle {
    fill: none; stroke: #d68910; stroke-width: 1;
    stroke-dasharray: 4 4; vector-effect: non-scaling-stroke;
}

.plan-overlay-vorschau path,
.plan-overlay-vorschau rect,
.plan-overlay-vorschau circle {
    fill: rgba(45, 108, 223, .12);
    stroke: var(--pos-accent, #2d6cdf);
    stroke-width: 1.5;
    stroke-dasharray: 6 4;
    vector-effect: non-scaling-stroke;
}

.plan-overlay-mass { fill: var(--pos-accent, #2d6cdf); font-weight: 600; dominant-baseline: middle; }

.plan-marker-hinweis { fill: #d68910; }
.plan-marker-warnung { fill: #c0392b; }
.plan-marker-text { fill: #ffffff; font-weight: 700; dominant-baseline: middle; }

/* ==========  Seitenleiste  ========== */

.plan-panel {
    background: var(--pos-panel);
    border: 1px solid var(--pos-hairline);
    border-radius: var(--pos-radius-sheet, 10px);
    padding: 8px 10px;
}

.plan-panel h4 {
    margin: 0 0 6px;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--pos-text-dim, #888);
}

.plan-feld { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: .82rem; }
.plan-feld > span:first-child { flex: 0 0 96px; color: var(--pos-text-dim, #888); }
.plan-feld input, .plan-feld select { flex: 1; min-width: 0; }

.plan-palette-suche { width: 100%; margin-bottom: 6px; }

.plan-palette-liste { display: flex; flex-direction: column; gap: 3px; max-height: 260px; overflow-y: auto; }

.plan-palette-eintrag {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 7px;
    border: 1px solid var(--pos-hairline);
    border-radius: 7px;
    background: var(--pos-surface, #f7f7f5);
    cursor: pointer;
    font-size: .82rem;
    text-align: left;
}

.plan-palette-eintrag:hover { background: var(--pos-surface-hover, #ececea); }
.plan-palette-eintrag-platziert { opacity: .45; }
.plan-palette-mass { margin-left: auto; color: var(--pos-text-dim, #888); font-size: .74rem; }

.plan-palette-punkt { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); flex: 0 0 auto; }

.plan-legende { display: flex; flex-wrap: wrap; gap: 8px; font-size: .76rem; }
.plan-legende-eintrag { display: inline-flex; align-items: center; gap: 5px; }

/* ==========  Befundlisten (Doc 25 Kap. 5/5b)  ========== */

.plan-befunde { display: flex; flex-direction: column; gap: 3px; max-height: 200px; overflow-y: auto; }

.plan-befund {
    display: flex; gap: 7px; align-items: flex-start;
    padding: 5px 7px;
    border-radius: 6px;
    border-left: 3px solid transparent;
    background: var(--pos-surface, #f7f7f5);
    font-size: .78rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
    border-top: none; border-right: none; border-bottom: none;
}

.plan-befund-hinweis { border-left-color: #d68910; }
.plan-befund-warnung { border-left-color: #c0392b; }
.plan-befund:hover { background: var(--pos-surface-hover, #ececea); }
.plan-befund-zeichen { font-weight: 700; }
.plan-befund-hinweis .plan-befund-zeichen { color: #d68910; }
.plan-befund-warnung .plan-befund-zeichen { color: #c0392b; }

.plan-befunde-leer { font-size: .78rem; color: var(--pos-text-dim, #888); }

.plan-sicherheit-kopf { color: #c0392b !important; }

/* ==========  Blatt-Tabs  ========== */

.plan-tabs {
    display: flex; align-items: center; gap: 4px;
    padding: 6px 8px;
    background: var(--pos-panel);
    border: 1px solid var(--pos-hairline);
    border-radius: var(--pos-radius-sheet, 10px);
    overflow-x: auto;
}

.plan-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--pos-hairline);
    border-radius: 7px 7px 0 0;
    background: var(--pos-surface, #f4f4f2);
    font-size: .82rem;
    cursor: pointer;
    white-space: nowrap;
}

.plan-tab-aktiv { background: var(--pos-accent); border-color: var(--pos-accent); color: #fff; }

/* ==========  Plan-Uebersicht  ========== */

.plan-uebersicht { padding: 14px; }
.plan-uebersicht-liste { display: flex; flex-direction: column; gap: 8px; max-width: 900px; }

.plan-uebersicht-karte {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    background: var(--pos-panel);
    border: 1px solid var(--pos-hairline);
    border-radius: var(--pos-radius-sheet, 10px);
}

.plan-uebersicht-karte b { font-size: .95rem; }
.plan-uebersicht-meta { font-size: .76rem; color: var(--pos-text-dim, #888); }
.plan-uebersicht-aktionen { margin-left: auto; display: flex; gap: 6px; }

/* Auftrag Plan-Umbenennen: Namensfeld in der Kartenliste - sieht wie das
   ehemalige <b> aus, bis man hineinklickt. */
.plan-uebersicht-name-eingabe {
    font-size: .95rem;
    font-weight: 600;
    min-width: 140px;
    padding: 2px 4px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font-family: inherit;
    display: block;
}
.plan-uebersicht-name-eingabe:hover { border-color: var(--pos-hairline); }
.plan-uebersicht-name-eingabe:focus { border-color: var(--pos-accent); background: var(--pos-bg, #fff); outline: none; }

/* Paket B: Bestuhlung an der Veranstaltung (EventPlanForm/PublicEventEditor). */
.event-bestuhlung-zeile {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 10px; margin-bottom: 6px;
    background: var(--pos-panel);
    border: 1px solid var(--pos-hairline);
    border-radius: var(--pos-radius-sheet, 8px);
}
/* AUFTRAG-EVENT-EDITOR-UND-BELEGUNGSKONFLIKT-CC.md Paket E.1/E.2: der
   Konfliktvermerk an der Etappe - deutlich, aber nicht schreiend; er steht
   direkt unter der Bestuhlungs-Auswahl, auf die er sich bezieht. */
.event-bestuhlung-konflikt {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 10px; margin-bottom: 6px;
    border: 1px solid var(--pos-accent);
    border-radius: var(--pos-radius-sheet, 8px);
}
.event-bestuhlung-neu {
    margin-top: 10px; padding-top: 10px;
    border-top: 1px dashed var(--pos-hairline);
}

/* Rueckfrage vor dem Loeschen (Auftrag Paket D.10) - sie ersetzt die
   Aktionsreihe IN der Karte, statt die ganze Seite mit einem Dialog zu
   blockieren. */
.plan-uebersicht-loeschfrage {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 62%;
    padding: 6px 10px;
    background: #fef2f2;
    border: 1px solid #e6b4b0;
    border-radius: 8px;
    font-size: .8rem;
    color: #7f1d1d;
}

.plan-marke {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: .7rem;
    background: var(--pos-surface, #eee);
    border: 1px solid var(--pos-hairline);
}

.plan-marke-freigegeben { background: #e6f4ea; border-color: #a8d5b5; color: #1e6b34; }
.plan-marke-archiviert { background: #f0f0f0; color: #777; }
.plan-marke-standard { background: #e7effb; border-color: #b3cbef; color: #26518f; }

/* ==========  Druck / PDF (Doc 25 Kap. 5b, Auftrag F.24)  ========== */

.plan-druck { display: none; }

.plan-druck-kopf { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 6mm; }
.plan-druck-kopf h2 { margin: 0; font-size: 14pt; }
.plan-druck-meta { font-size: 9pt; color: #444; }
.plan-druck-blatt { border: .3mm solid #333; }
.plan-druck-legende { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4mm; font-size: 8.5pt; }
.plan-druck-hinweis { margin-top: 3mm; font-size: 8pt; font-style: italic; color: #333; }

@media print {
    body * { visibility: hidden !important; }
    .plan-druck, .plan-druck * { visibility: visible !important; }
    .plan-druck {
        display: block !important;
        position: absolute;
        inset: 0;
        margin: 0;
        padding: 0;
        background: #fff;
    }
    @page { margin: 10mm; }
}

/* ==========  Moebelkatalog, Tischliste, Tafel (E-79/E-80/E-81)  ========== */

/* Herkunft der Werte sichtbar machen (Paket H.27): ohne diese Marke sieht
   ein uebersteuerter Tisch aus wie ein geerbter, und niemand weiss, warum
   die Katalogaenderung nicht durchschlaegt. */
.plan-marke-geerbt { background: #eef4ff; border-color: #c3d6f5; color: #2c4c86; }
.plan-marke-gesetzt { background: #fff4e5; border-color: #f0cfa0; color: #8a5300; }

.plan-panel-meldung {
    display: flex; align-items: flex-start; gap: 10px;
    background: #fef2f2;
    border-color: #e6b4b0;
    color: #7f1d1d;
    font-size: .82rem;
}

/* Paket B.3 (E-93): "nie stilles Verschieben einer Zusage" - Klartext-Warnung
   vor dem Verkleinern einer Sitzverteilung mit belegten Plaetzen. */
.plan-warnung {
    display: block;
    background: #fef2f2;
    border: 1px solid #e6b4b0;
    border-radius: 6px;
    color: #7f1d1d;
    font-size: .82rem;
    padding: 8px 10px;
    margin-bottom: 8px;
}
.plan-warnung ul { margin: 4px 0 0; padding-left: 18px; }

.plan-feld-knapp { color: #8a5300; }
.plan-feld-knapp .plan-marke { background: #fff4e5; border-color: #f0cfa0; }

.plan-palette-art { width: 16px; text-align: center; color: var(--pos-text-dim, #888); }

/* ---- Listenplan: die Oberflaeche fuer den Betrieb, der nie zeichnet ---- */

.plan-liste {
    overflow: auto;
    background: var(--pos-panel);
    border: 1px solid var(--pos-hairline);
    border-radius: var(--pos-radius-sheet, 10px);
    padding: 10px 12px;
}

.plan-tischliste table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.plan-tischliste th {
    text-align: left;
    padding: 4px 8px 8px;
    font-size: .74rem;
    font-weight: 600;
    color: var(--pos-text-dim, #888);
    border-bottom: 1px solid var(--pos-hairline);
    white-space: nowrap;
}
.plan-tischliste td { padding: 5px 8px; border-bottom: 1px solid var(--pos-hairline); vertical-align: middle; }
.plan-tischliste input, .plan-tischliste select {
    font-size: .82rem; padding: 3px 6px;
    border: 1px solid var(--pos-hairline); border-radius: 6px;
    background: var(--pos-surface, #fff); color: var(--pos-text, #333);
}
.plan-tischzeile-inaktiv { opacity: .55; }
.plan-tischliste-aktionen { display: flex; gap: 5px; justify-content: flex-end; }

/* Paket G.24: die Begruendung samt Ausweg steht IN der Zeile - nicht als
   Dialog, der wegklickt, bevor man ihn gelesen hat. */
.plan-tischliste-sperre {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 5px 9px;
    background: #fef2f2;
    border: 1px solid #e6b4b0;
    border-radius: 7px;
    color: #7f1d1d;
    font-size: .78rem;
}

.plan-tischliste-neu {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    margin-top: 12px; padding: 8px 10px;
    background: var(--pos-surface, #f4f4f2);
    border: 1px solid var(--pos-hairline);
    border-radius: 8px;
}

/* ---- Nummern-Dialog beim Platzieren (Paket F.19) ---- */

.plan-dialog-hinterlegung {
    position: fixed; inset: 0; z-index: 40;
    display: flex; align-items: center; justify-content: center;
    background: rgba(30, 30, 30, .35);
}

.plan-dialog {
    min-width: 320px;
    padding: 16px 18px;
    background: var(--pos-panel, #fff);
    border: 1px solid var(--pos-hairline);
    border-radius: var(--pos-radius-sheet, 10px);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
}

.plan-dialog h4 { margin: 0 0 10px; font-size: .95rem; }
.plan-dialog input, .plan-dialog select {
    font-size: .86rem; padding: 5px 8px;
    border: 1px solid var(--pos-hairline); border-radius: 6px;
    background: var(--pos-surface, #fff); color: var(--pos-text, #333);
}
.plan-dialog-knoepfe { display: flex; gap: 8px; margin-top: 12px; }
.plan-dialog-fehler { margin: 8px 0 0; color: #b3261e; font-size: .8rem; }

/* ---- Moebelkatalog ---- */

.plan-katalog { display: flex; flex-direction: column; gap: 8px; max-width: 900px; }

.plan-katalog-karte {
    display: flex; align-items: center; gap: 14px;
    padding: 8px 12px;
    background: var(--pos-panel);
    border: 1px solid var(--pos-hairline);
    border-radius: var(--pos-radius-sheet, 10px);
}

.plan-katalog-karte-offen { border-color: var(--pos-accent, #2d6cdf); }

/* Die Vorschau nutzt DIESELBE Darstellung wie der Editor - im Katalog soll
   nichts anders aussehen als im Plan. */
.plan-katalog-skizze { flex: 0 0 88px; height: 66px; background: #fff; border-radius: 6px; }
.plan-katalog-skizze svg { width: 100%; height: 100%; display: block; }
.plan-katalog-text { flex: 1; min-width: 0; }

.plan-katalog-form { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; max-width: 900px; }
.plan-katalog-form .plan-feld { display: flex; align-items: center; gap: 8px; }
.plan-katalog-form .plan-feld > span:first-child { flex: 0 0 190px; font-size: .82rem; color: var(--pos-text-dim, #777); }
