/* file: monitore/wachraum/monitor.css */
/* --------------------------------------
   Monitor-Layout Wache 7 – kompakte Version
   Basis: 1920x1080 | Fokus: gute Lesbarkeit, wenig Höhe pro Zeile
----------------------------------------- */

/* =========================================================
   1. Root-Variablen (Farben, Typografie, Abstände)
   ========================================================= */
:root {
    /* Grundfarben */
    --color-bg: #05060a;
    --color-bg-soft: #10131b;
    --color-panel: rgba(16, 19, 27, 0.92);
    --color-panel-soft: rgba(23, 27, 39, 0.9);
    --color-border: rgba(255, 255, 255, 0.06);

    --color-text: #f5f5f5;
    --color-text-muted: #a0a4b0;

    /* Akzentfarben */
    --color-accent: #df2334;   /* Rot, Corporate-Akzent */
    --color-ok: #00c853;
    --color-warn: #ffab00;
    --color-err: #ff5252;

    /* Typografie – Basis wie alter Monitor: 14px */
    --font-family-base: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-size-base: 14px;

    /* Abstände / Radius */
    --gap-layout: 8px;         /* Kompaktes Grid */
    --radius-panel: 8px;
}

/* =========================================================
   2. Reset / Base
   ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden; /* Kein globaler Scrollbalken */
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: 1.4;
    color: var(--color-text);
    background-color: var(--color-bg);
}

/* =========================================================
   3. Root-Layout & Hintergrund
   ========================================================= */
#monitor-root {
   position: relative;
   z-index: 0;

   display: grid;
   /* ALT:
   grid-template-rows: 64px 1fr;
   */
   grid-template-rows: 64px 1fr 32px; /* Header, Main, schmale Fußleiste */

   grid-template-columns: 1fr;

   height: 100vh;
   padding: 2px;                 /* schmaler Rand */
   background-color: var(--color-bg);
}

/* Abdunkelung über dem Hintergrundbild */
#monitor-root::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(
        circle at 0 0,
        rgba(0, 0, 0, 0.35) 0,
        rgba(0, 0, 0, 0.75) 55%
    );
    pointer-events: none;
}

/* Inhaltsebene über Overlay */
#monitor-root > * {
    position: relative;
    z-index: 1;
}

/* =========================================================
   4. Header
   ========================================================= */
.monitor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 4px 10px;
    background: linear-gradient(
        90deg,
        rgba(5, 6, 12, 0.98) 0%,
        rgba(15, 17, 25, 0.96) 55%,
        rgba(223, 35, 52, 0.35) 100%
    );
    border-bottom: 2px solid rgba(255, 255, 255, 0.25);

    font-size: 0.9rem;
}

/* Linker Bereich (Logo + Wachentext, wird im HTML befüllt) */
.header-left {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-start;
}

/* Mittlerer Bereich mit den Info-Blöcken */
.header-middle {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

/* Container für dynamische Blöcke */
.header-dynamic {
    display: flex;
    align-items: center;
}

/* Flex-Container für einzelne Header-Blöcke */
.monitor-header-blocks {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.6rem;      /* etwas enger */
    margin-top: 3px;
    max-width: 100%;
    align-items: flex-start;
}

/* Generischer Header-Block */
.header-block {
    flex: 0 1 auto;
    min-width: 0;

    padding: 3px 0.75rem 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.16);

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

/* Labelzeile (Überschrift) im Block */
.header-block .hb-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 0.05rem;
    letter-spacing: 0.03em;
}

/* „Leeres“ Label: reserviert Höhe, zeigt aber keinen Text */
.header-block .hb-label-empty {
    visibility: hidden;  /* Block bleibt, Inhalt unsichtbar */
}

/* Hauptwert im Block (z.B. Name, Temperatur) */
.header-block .hb-value {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Unterzeile im Block */
.header-block .hb-sub {
    font-size: 0.7rem;
    opacity: 0.85;
}

/* Blöcke mit fester Breite (Plan, EvD, Funk) */
.header-block-plan,
.header-block-evd,
.header-block-funk,
.header-block-weather-extra {
    flex: 0 0 auto;
}

/* Wetterblock darf wachsen und Restbreite nutzen */
.header-block-weather {
    flex: 1 1 460px;
    min-width: 380px;
    max-width: 720px;
}

/* =========================================================
   4.1 Wetterblock (Temperatur + Kurzinfos)
   ========================================================= */

/* Zeile 1: Icon + Temperatur + Trend */
.hb-weather-main {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    white-space: nowrap;  /* alles in EINER Zeile */
}

/* Wettericon (FontAwesome) */
.header-block-weather .hb-weather-icon i {
    font-size: 1.1rem;
}

/* Temperatur groß und fett */
.header-block-weather .hb-weather-temp {
    font-weight: 700;
    font-size: 0.95rem;
}

/* Trend-Pill rechts von der Temperatur */
.hb-weather-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.06);
    margin-left: 0.1rem;
}

.hb-weather-trend i {
    font-size: 0.75rem;
}

/* Farbcode für Trend */
.hb-weather-trend--up {
    color: var(--color-ok);      /* grün */
}

.hb-weather-trend--down {
    color: var(--color-accent);  /* rot */
}

.hb-weather-trend--flat {
    color: var(--color-text-muted);
}

/* Zeile 2: Kurzbeschreibung (gefühlt, Regen, Wind)
   → immer EINZEILIG mit Ellipsis */
.header-block-weather .hb-weather-meta {
    margin-top: 1px;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* DWD-Warnindikator im Wetter-Label */
.hb-weather-alert {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.3rem;
    font-size: 0.75rem;
    color: var(--color-warn);  /* Standard: gelb */
}

.hb-weather-alert i {
    margin-top: -1px;
}

/* Farbvarianten je Warnstufe */
.hb-weather-alert--lvl1 {
    color: var(--color-ok);    /* grün / Hinweis */
}

.hb-weather-alert--lvl2 {
    color: var(--color-warn);  /* gelb / markant */
}

.hb-weather-alert--lvl3,
.hb-weather-alert--lvl4 {
    color: var(--color-err);   /* rot / Unwetter */
}

.header-block-weather .hb-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.header-block-weather .hb-label i {
    font-size: 0.7rem;
}

/* =========================================================
   4.2 Neuer Block: Wetter-Stand + Sonnenauf/-untergang
   ========================================================= */

/* gesamter Block rechts neben dem Wetter */
.header-block-weather-extra {
    min-width: 190px;
    margin-left: -0.3rem;  /* rückt dichter an den Wetterblock heran */
}

/* Zeile „Wetter-Stand: 13:00 Uhr“ – kleine, nicht fette Schrift */
.hb-weather-extra-main {
   display: flex;
   align-items: center;
   gap: 0.3rem;
   font-size: 0.7rem;     /* kleine Schrift */
   font-weight: 400;      /* nicht fett */
   white-space: nowrap;
}

/* Label in der Zeile („Wetter-Stand:“) ebenfalls normal */
.hb-weather-extra-main-label {
   font-weight: 400;
}

/* Zeilen für Sonnenaufgang / -untergang */
.hb-weather-extra-row {
   display: flex;
   align-items: center;
   gap: 0.25rem;
   margin-top: 1px;
   font-size: 0.7rem;
   white-space: nowrap;
}

/* Icons in den Zusatzzeilen */
.hb-weather-extra-row i {
   font-size: 0.75rem;
}

/* =========================================================
   4.3 Logo / Uhr im Header
   ========================================================= */

/* Rechte Seite mit Uhr */
.header-right {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Logo + Text links im Header */
.header-logo-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.5rem;
}

.header-logo {
    height: 52px;
    width: auto;
    display: block;
}

/* Text neben dem Logo */
.header-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.header-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #ffffff;
    line-height: 1.1;
}

.header-subtitle {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-accent);
    margin-top: 2px;
    line-height: 1.1;
}

/* Uhr/Datum rechtsbündig */
.header-clock-wrap {
    text-align: right;
}

.header-clock {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.header-date {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* =========================================================
   4.4 Funkwetter-Ampel im Header
   ========================================================= */

.header-block-funk {
    min-width: 260px;              /* genug Platz für 4 Bänder */
}

/* Funkwetter-Block insgesamt etwas kleiner */
.header-block-funk .hb-value {
    font-size: 0.7rem;
}

/* Wrapper um die Tabelle, damit sie kompakt bleibt */
.funkwetter-wrapper {
    margin-top: 2px;
}

/* Grundlayout der Tabelle */
.funkwetter-table {
    border-collapse: collapse;
    font-size: 0.65rem;
}

.funkwetter-table th,
.funkwetter-table td {
    padding: 1px 4px;
    white-space: nowrap;
}

/* Kopfzeile: Titel + Meta */
.fw-row-head th {
    font-weight: 600;
    text-align: center;
    opacity: 0.9;
}

/* Titel „Funkwetter“ im Kopf */
.fw-head-title {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Meta-Zeile: SFI, K-Index, X-Ray, Stand … */
.fw-head-meta {
    display: inline-block;
    margin-top: 1px;
    font-size: 0.6rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Label-Spalte links */
.fw-col-label {
    text-align: left;
}

/* „Tag“ / „Nacht“-Spalte links fett */
.fw-col-label--row {
    font-weight: 500;
}

/* Spalten für die Bänder */
.fw-col-band {
    text-align: center;
}

/* Zellen mit Ampelwerten */
.fw-col-state {
    text-align: center;
}

/* Icon + Text „Tag“ / „Nacht“ */
.fw-row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
}

.fw-row-icon i {
    font-size: 0.65rem;
}

.fw-row-text {
    font-size: 0.65rem;
    vertical-align: middle;
}

/* Ampel-Pill: runder Indikator, leicht verkleinert */
.fw-pill {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8);
    background: rgba(255, 255, 255, 0.12);
}

/* Zustände: Farben über bestehende Variablen */
.fw-pill--good {
    background-color: var(--color-ok);      /* grün */
}

.fw-pill--fair {
    background-color: var(--color-warn);    /* gelb */
}

.fw-pill--poor {
    background-color: var(--color-accent);  /* rot */
}

/* Unbekannt: transparenter Kreis */
.fw-pill--unknown {
    background: transparent;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

/* leichte Zeilenabstände / optische Trennung */
.fw-row-day td,
.fw-row-night td {
    padding-top: 2px;
    padding-bottom: 2px;
}

/* =========================================================
   5. Hauptbereich (linke/rechte Spalte)
   ========================================================= */
.monitor-main {
    display: grid;
    grid-template-columns: 2.1fr 1.1fr;
    gap: var(--gap-layout);
    padding: 2px 6px 2px;
    min-height: 0;  /* wichtig: Kind-Overflow begrenzen */
    overflow: hidden; /* Inhalt darf nicht das Grid nach unten ausdehnen */
}

/* Linke Spalte: Dienstplan */
.monitor-main-left {
    display: flex;
    flex-direction: column;
    gap: var(--gap-layout);
}

/* Rechte Spalte: Foto, darunter Wachenfunk + News */
.monitor-main-right {
    display: flex;
    flex-direction: column;
    gap: var(--gap-layout);
    height: 100%;   /* füllt den verfügbaren Track */
    min-height: 0;  /* darf auch kleiner werden als Inhalte */
}

.monitor-main-left,
.monitor-main-right {
    min-height: 0; /* beide Spalten dürfen schrumpfen */
}

/* =========================================================
   6. Panels / Karten – generisch
   ========================================================= */
.panel {
    background: var(--color-panel);
    border-radius: var(--radius-panel);
    border: 1px solid var(--color-border);

    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(
        90deg,
        rgba(223, 35, 52, 0.18),
        rgba(15, 17, 25, 0.9)
    );
}

.panel-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.panel-body {
    padding: 8px 10px 9px;
    font-size: 0.95rem;
}

/* Scroll erst bei Hover sichtbar (für Mausbedienung) */
.panel-scroll {
    overflow: hidden;
}

.panel-scroll:hover {
    overflow: auto;
}

/* Plan- und Heute-Panels etwas kompakter */
.panel-plan .panel-body,
.panel-heute .panel-body {
    font-size: 0.9rem;
    padding: 4px 8px 6px;
}

/* =========================================================
   7. Linke Seite „Heute im Dienst“
   ========================================================= */
.plan-day {
    margin-bottom: 8px;
}

.plan-day-header {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 3px;
    color: #ffffff;
}

.plan-day-date {
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
}

.plan-day-empty {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    padding: 3px 2px 2px;
}

.plan-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.plan-row:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.plan-row:nth-child(even) {
    background: transparent;
}

.plan-col-time {
    white-space: nowrap;
    padding: 2px 4px 2px 0;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.plan-col-slot {
    padding: 2px 4px;
    font-weight: 500;
}

.plan-col-crew {
    padding: 2px 0 2px 4px;
    color: var(--color-text-muted);
}

.heute-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.heute-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 3px;
    padding: 3px 2px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
}

.heute-slot {
    font-weight: 600;
    font-size: 0.95rem;
}

.heute-crew {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* =========================================================
   8. Dienstplan-Gesamttabelle (Monitor)
   ========================================================= */

/* Wrapper um die große Tabelle */
.monitor-plan {
    font-size: 0.8rem;
    line-height: 1.2;
}

.plan-all-table-wrapper--monitor {
    width: 100%;
    overflow: hidden;
}

/* Tabelle mit allen Positionen x Tagen */
.plan-all-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 0.9rem;
}

/* Allgemeine Zellen */
.plan-all-grid th,
.plan-all-grid td {
    border: none;
    padding: 0px 2px;
    text-align: left;
    vertical-align: top;
}

/* Standard-Trennlinie pro Position */
.plan-all-grid tbody .pos-row {
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

/* Stärkere Linie bei Gruppenwechsel */
.plan-all-grid tbody .pos-row.pos-row-group-sep {
    border-top: 2px solid rgba(255, 255, 255, 0.25);
}

/* Kopfzeile (Tage) */
.plan-all-grid thead th {
    background: linear-gradient(
        180deg,
        #5f636e 0%,
        #51555f 50%,
        #484c55 100%
    );
    font-weight: 600;
    padding: 4px 4px 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
    color: #f5f5f5;
}

/* linke Ecke mit „wache7.de“ */
.plan-all-grid th.corner {
    width: 14%;
    min-width: 140px;
    text-align: left;
}

/* Zebra-Streifen im Body – deutlich dunkler */
.plan-all-grid tbody tr:nth-child(odd) {
    /* dunkler Streifen – fast schwarz */
    background: rgba(0, 0, 0, 0.65);
}

.plan-all-grid tbody tr:nth-child(even) {
    /* heller Streifen – ungefähr wie bisheriger „dunkler“ Wert */
    background: rgba(255, 255, 255, 0.02);
}

/* Tageskopf innerhalb der th-Zelle */
.day-header {
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.25;
    white-space: nowrap;
    letter-spacing: 0.02em;
    background: transparent;
    color: #f5f5f5;
}

.day-header .day-label {
    font-weight: 600;
}

/* Wochenende (nicht heute) */
.day-header.is-weekend:not(.is-today) {
    background: rgba(40, 30, 0, 0.85);
    color: var(--color-warn);
}

/* Heute */
.day-header.is-today {
    background: rgba(255, 171, 0, 0.5);
    color: #000000;
}

/* Heute + Wochenende */
.day-header.is-today.is-weekend {
    background: rgba(255, 171, 0, 0.7);
    color: #000000;
}

/* Positionszelle (erste Spalte) */
.pos-cell {
    font-weight: 600;
}

.pos-title {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-time {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

/* Mitarbeiter-Felder */
.dp-cell {
    font-size: 0.9rem;
}

.dp-cell--weekend {
    background-color: rgba(255, 255, 255, 0.01);
}

.dp-cell--today {
    background-color: rgba(223, 35, 52, 0.16);
}

/* Mitarbeiterzeile innerhalb einer Zelle */
.emp-line {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 0;
}

/* Qualifikations-Indikator (Farbstreifen) */
.emp-qual-ind {
    display: inline-block;
    width: 4px;
    height: 1.1em;
    border-radius: 2px;
    margin-top: 1px;
}

/* Qualifikationsfarben + Avatar-Ring */
.emp-qual-ind.qual-none { background-color: #666666; }
.emp-avatar-ring.qual-none { border-color: #666666; }

.emp-qual-ind.qual-rs { background-color: #df2334; }
.emp-avatar-ring.qual-rs { border-color: #df2334; }

.emp-qual-ind.qual-rh { background-color: #2962ff; }
.emp-avatar-ring.qual-rh { border-color: #2962ff; }

.emp-qual-ind.qual-notsan { background-color: #2e7d32; }
.emp-avatar-ring.qual-notsan { border-color: #2e7d32; }

.emp-qual-ind.qual-other { background-color: #999999; }
.emp-avatar-ring.qual-other { border-color: #999999; }

.emp-name-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.emp-name {
    white-space: nowrap;
}

/* Azubi-Badge */
.emp-azubi-badge {
    display: inline-block;
    padding: 0 4px;
    font-size: 0.6rem;
    line-height: 1.1;
    border-radius: 3px;
    background-color: #ffeb3b;
    color: #000;
}

/* =========================================================
   9. Avatar-Leiste im aktuellen Tag
   ========================================================= */
.dp-cell-inner--today {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

/* Namensbereich */
.dp-cell-text {
    flex: 1 1 auto;
    min-width: 0;
}

/* Avatarbereich */
.dp-cell-avatars {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 4px;
}

.emp-avatar {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Avatar-Ring */
.emp-avatar-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.emp-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Name unter Avatar ausgeschaltet */
.emp-avatar-name {
    display: none;
}

/* =========================================================
   10. Foto-Panel
   ========================================================= */
.panel-photos .panel-header {
    padding: 4px 6px;
}

.panel-photos .panel-header h2 {
    margin: 0;
    font-size: 0.95rem;
}

.panel-photos-body {
    padding: 4px 6px;
}

#panel-photos,
#panel-news {
    flex: 0 0 auto;  /* nehmen nur so viel Platz wie nötig */
}

.monitor-photos-empty {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Foto-Container */
.monitor-photo {
    margin: 0;
}

/* Einheitliche Bildhöhe 4:3 */
.monitor-photo-imgwrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Portraitfotos nur anderes Styling */
.monitor-photo-imgwrap--portrait {
    background: #000;
}

/* Verschwommener Hintergrund */
.monitor-photo-img-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(18px);
    transform: scale(1.1);
    opacity: 0.7;
    pointer-events: none;
}

/* Sichtbares Bild */
.monitor-photo-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 1;
}

/* Caption ausgeblendet */
.monitor-photo-caption {
    display: none;
}

/* Badge unten links */
.monitor-photo-badge-meta {
    position: absolute;
    left: 8px;
    bottom: 6px;

    display: inline-block;
    max-width: calc(100% - 16px);

    padding: 2px 8px;
    border-radius: 999px;

    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.75rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    z-index: 2;
}

/* Badge unten rechts (Uploader) */
.monitor-photo-badge-user {
    position: absolute;
    right: 8px;
    bottom: 6px;

    display: inline-block;
    max-width: calc(100% - 16px);

    padding: 2px 8px;
    border-radius: 999px;

    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.75rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    z-index: 2;
    text-align: right;
}

/* NEU-Badge oben links */
.monitor-photo-badge-new {
    position: absolute;
    top: 6px;
    left: 6px;

    padding: 2px 6px;
    border-radius: 999px;

    background: var(--color-accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;

    z-index: 2;
}

/* =========================================================
   11. Chat-Panel
   ========================================================= */
.panel-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chat-line {
    font-size: 0.9rem;
}

.chat-time {
    color: var(--color-text-muted);
    margin-right: 6px;
    font-size: 0.8rem;
}

.chat-name {
    font-weight: 600;
    margin-right: 4px;
}

/* Panel Chat & Wachenfunk: zwei Spalten nebeneinander */
.panel-chat .panel-body {
    padding: 6px 8px 7px;
}

.panel-chat-grid {
    display: flex;
    flex-direction: row;
    gap: 8px;
    height: 100%;
    align-items: stretch; /* beide Spalten gleiche Höhe */
}

.panel-chat-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    padding: 5px 6px;
}

/* Mini-Header innerhalb des Panels */
.panel-chat-col-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.panel-chat-col-header i {
    font-size: 0.85rem;
}

.panel-chat-col-body {
    flex: 1 1 auto;
    min-height: 0;
    font-size: 0.9rem;
}

/* Chat-Messages: schön lesbar */
.panel-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-line {
    font-size: 0.9rem;
    padding: 3px 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
}

.chat-line:nth-child(odd) {
    background: rgba(255, 255, 255, 0.04);
}

.chat-meta {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 1px;
}

.chat-time {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.chat-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.chat-text {
    font-size: 0.9rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.chat-empty {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    padding: 3px 2px;
}

/* =========================================================
   11a. WachenFunk-Panel
   ========================================================= */

.wachenfunk-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Logo + Kurztext nebeneinander */
.wachenfunk-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.wachenfunk-logo-wrap {
    flex: 0 0 auto;
}

/* Logo sinnvoll skaliert für die rechte Spalte */
.wachenfunk-logo {
    display: block;
    max-height: 64px;      /* bei Bedarf auf 72 o.ä. anpassen */
    width: auto;
    /* Hintergrund transparent lassen */
    background: transparent;
    /* Kein zusätzlicher Rand um das Logo */
    padding: 0;
    /* Wenn du keinen abgerundeten „Rahmen“ brauchst, auch das weg: */
    border-radius: 0;
}

/* Text rechts neben dem Logo */
.wachenfunk-text {
    flex: 1 1 auto;
    min-width: 0;
}

.wachenfunk-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.wachenfunk-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Bereich für Meldungen */
.wachenfunk-messages {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
    font-size: 0.9rem;
}

/* Einfache „Meldungszeilen“ (kannst du später ausbauen) */
.funk-line {
    padding: 4px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
}

.funk-line--info {
    background: rgba(255, 255, 255, 0.04);
}

.funk-text {
    display: block;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Funkwetter-Zeile unter dem WachenFunk-Header */
.wachenfunk-funkwetter {
    font-size: 0.8rem;
    margin-top: 2px;
    line-height: 1.3;
}

/* Stand-Zeile oben */
.funkwetter-stand {
    display: block;
    margin-bottom: 2px;
}

.funkwetter-stand-icon {
    margin-right: 4px;
}

.funkwetter-stand-icon i {
    font-size: 0.85rem;
}

.funkwetter-stand-label {
    font-weight: 600;
    margin-right: 2px;
}

.funkwetter-stand-value {
    font-weight: 600;
}

/* Fließtext darunter */
.funkwetter-flow {
    margin-top: 1px;
}

/* Ein einzelner „Chip“: Icon + Label + Wert, ohne Umbruch dazwischen */
.funkwetter-chip {
    display: inline-block;
    margin-right: 0.9rem;
    white-space: nowrap; /* Icon + Text + Wert bleiben zusammen */
}

.funkwetter-chip-icon i {
    font-size: 0.8rem;
    margin-right: 3px;
}

.funkwetter-chip-label {
    color: var(--color-text-muted);
    margin-right: 2px;
}

.funkwetter-chip-value {
    font-weight: 600;
}

/* =========================================================
   12. Geburtstags-Panel
   ========================================================= */
.bday-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bday-item {
    font-size: 0.95rem;
    margin-bottom: 3px;
}

/* =========================================================
   13. Warnungs-Panel
   ========================================================= */
.warn-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.warn-item {
    border-radius: 6px;
    padding: 5px 7px;
    margin-bottom: 3px;
    font-size: 0.9rem;
}

.warn-item-level-1 {
    background: rgba(0, 200, 83, 0.18);
    border: 1px solid rgba(0, 200, 83, 0.6);
}

.warn-item-level-2 {
    background: rgba(255, 171, 0, 0.18);
    border: 1px solid rgba(255, 171, 0, 0.7);
}

.warn-item-level-3 {
    background: rgba(255, 82, 82, 0.18);
    border: 1px solid rgba(255, 82, 82, 0.7);
}

/* =========================================================
   14. Hilfselemente
   ========================================================= */
.loading {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* =========================================================
   15. Footer-Infobar unten
   ========================================================= */

.monitor-footer {
    grid-row: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(
        90deg,
        rgba(5, 6, 12, 0.98) 0%,
        rgba(15, 17, 25, 0.96) 60%,
        rgba(223, 35, 52, 0.25) 100%
    );
    border-top: 1px solid rgba(255, 255, 255, 0.25);

    font-size: 0.8rem;
    line-height: 1.2;
    padding: 2px 10px;
}

.monitor-footer-inner {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Linke Legende */
.footer-legend {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.footer-legend-label {
    font-weight: 600;
    color: var(--color-text-muted);
    margin-right: 4px;
}

.footer-legend-items {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Kleiner Quali-Balken in der Leiste */
.footer-qual-ind {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 3px;
}

/* Farben identisch zu emp-qual-ind */
.footer-qual-notsan { background-color: #2e7d32; } /* NotSan/RA */
.footer-qual-rs     { background-color: #df2334; } /* RS */
.footer-qual-rh     { background-color: #2962ff; } /* RH */
.footer-qual-none   { background-color: #666666; } /* keine/unbekannt */

.footer-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* Azubi-Badge in der Leiste */
.footer-azubi-badge {
    display: inline-block;
    padding: 0 4px;
    font-size: 0.65rem;
    line-height: 1.1;
    border-radius: 3px;
    background-color: #ffeb3b;
    color: #000;
    font-weight: 700;
}

/* Trennstriche */
.footer-separator {
    flex: 0 0 auto;
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.35);
    opacity: 0.8;
}

/* Mittlerer Tickerbereich */
.footer-ticker {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 8px;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.footer-ticker-label {
    font-weight: 600;
    margin-right: 6px;
    color: var(--color-text-muted);
}

#footer-ticker-text {
    font-weight: 500;
}

/* Rechte Meta-Info (wache7.de) */
.footer-meta {
    flex: 0 0 auto;
    white-space: nowrap;
    color: var(--color-text-muted);
    font-weight: 500;
}

#footer-meta-text {
    font-weight: 600;
    color: var(--color-text);
}

/* =========================================================
   XX. Wissensbox / Knowledge-Panel
   ========================================================= */
 #panel-knowledge {
     flex: 1 1 auto;
     min-height: 0;
     display: flex;
     flex-direction: column;
 }

 #panel-knowledge .panel-body {
     flex: 1 1 auto;
     min-height: 0;
     overflow: hidden;  /* unten abschneiden */
     padding: 0;        /* KEIN Innenabstand */
     font-size: 0.9rem;
 }

.panel-knowledge .panel-header {
    padding: 4px 8px;
}

.panel-knowledge .panel-header h2 {
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.panel-knowledge .panel-header i {
    font-size: 0.95rem;
    color: var(--color-accent);
}

.panel-knowledge .panel-body {
    padding: 6px 8px 7px;
    font-size: 0.9rem;
}

/* Grundlayout der Wissenskarte */
.knowledge-card {
    display: flex;
    gap: 8px;
    padding: 6px 7px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Text-Teil links */
.knowledge-card-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Foto-Teil rechts (optional) */
.knowledge-card-media {
    flex: 0 0 32%;
    max-width: 32%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bildrahmen */
.knowledge-card-figure {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    overflow: hidden;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

.knowledge-card-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Kicker-Zeile über dem Titel (z.B. "Pädiatrie") */
.knowledge-card-kicker {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.knowledge-card-kicker i {
    font-size: 0.8rem;
    color: var(--color-accent);
}

/* Titel der Karte */
.knowledge-card-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

/* kurzer Haupttext (prägnante Erklärung) */
.knowledge-card-lead {
    margin: 2px 0 0;
    font-size: 0.9rem;
}

/* zusätzlicher Fließtext, etwas kleiner */
.knowledge-card-extra {
    margin: 3px 0 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Variante: Foto rechts, Text links */
.knowledge-card--photo-right {
    flex-direction: row;
}

/* Variante: nur Foto, volle Breite */
.knowledge-card--photo-only {
    flex-direction: column;
}

.knowledge-card--photo-only .knowledge-card-main {
    display: none; /* nur Bild zeigen */
}

.knowledge-card--photo-only .knowledge-card-media {
    flex: 1 1 auto;
    max-width: 100%;
}

/* Variante: nur Text (groß, mittel, klein) */
.knowledge-card--text-only {
    flex-direction: column;
}

.knowledge-card--text-only .knowledge-card-media {
    display: none;
}

.knowledge-card--text-sm .knowledge-card-title {
    font-size: 0.85rem;
}

.knowledge-card--text-sm .knowledge-card-lead {
    font-size: 0.8rem;
}

.knowledge-card--text-lg .knowledge-card-title {
    font-size: 1.1rem;
}

.knowledge-card--text-lg .knowledge-card-lead {
    font-size: 1.0rem;
}

/* Liste/Platzhalter, falls du später mehrere Einträge rotieren willst */
.knowledge-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Volle Breite/Höhe für Foto-only im Wissenspanel */
#panel-knowledge .knowledge-list {
    height: 100%;
    margin: 0;
}

/* Karte selbst ohne Abstand/Borders, füllt den Body komplett */
#panel-knowledge .knowledge-card--photo-only {
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    height: 100%;
}

/* Textteil wird bei photo-only gar nicht genutzt */
#panel-knowledge .knowledge-card--photo-only .knowledge-card-main {
    display: none;
}

/* Bild-Container soll den gesamten verfügbaren Bereich nutzen */
#panel-knowledge .knowledge-card--photo-only .knowledge-card-media {
    flex: 1 1 auto;
    max-width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;   /* oben ausrichten */
    justify-content: flex-start;
}

/* Figur ohne eigenen Rand/Radius, volle Fläche */
#panel-knowledge .knowledge-card--photo-only .knowledge-card-figure {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;          /* kein Abstand zu Panel-Rand */
    background: #000;          /* wie Panel-Hintergrund, falls Bild nicht voll füllt */
    overflow: hidden;
}

/* Bild füllt den Kasten, wird notfalls beschnitten */
#panel-knowledge .knowledge-card--photo-only .knowledge-card-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;         /* volle Breite/Höhe, unten abgeschnitten */
}

/* =========================================================
   XX. Wissensbox / Knowledge-Panel
   ========================================================= */
#panel-knowledge {
    flex: 1 1 auto;      /* nimmt den restlichen Platz zwischen Fotos und News */
    min-height: 0;       /* darf schrumpfen */
    display: flex;
    flex-direction: column;
}

#panel-knowledge .panel-body {
    flex: 1 1 auto;
    min-height: 0;
    /* Kein Scrollbalken, Inhalt wird unten abgeschnitten */
    overflow: hidden;
    /* Innenabstand maximal reduzieren */
    padding: 2px;
    font-size: 0.9rem;
}

/* Header kann so bleiben, nur der Vollständigkeit halber */
.panel-knowledge .panel-header {
    padding: 4px 8px;
}

.panel-knowledge .panel-header h2 {
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.panel-knowledge .panel-header i {
    font-size: 0.95rem;
    color: var(--color-accent);
}
