/* [P2:T1] Status, Glocke und Status-Dialog in der Kopfzeile (live.js, Spezifikation 6.1.6).
   Zustände nie nur über Farbe: jede Anzeige hat eigenes Symbol und Text. */
[hidden] { display: none !important; }

:root {
  --live-gruen: #22C55E;
  --live-orange: #F59E0B;
  --live-rot: #F87171;
  --live-grau: #CBD5E1;
  --live-violett: #C4B5FD;
}

.live-kopf { display: flex; align-items: center; gap: 12px; }
.live-feld { position: relative; display: flex; align-items: center; }

/* Status-Knopf (dunkle Kopfzeile) */
.status-knopf { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; max-width: 220px; }
.status-knopf:hover { background: rgba(255,255,255,.16); }
.status-knopf .status-text { overflow: hidden; text-overflow: ellipsis; }
.status-knopf::after { content: "▾"; font-size: 11px; opacity: .75; }
.status-symbol { font-size: 13px; line-height: 1; width: 1em; text-align: center; flex: none; }
.status-symbol[data-anzeige="verfuegbar"], .status-symbol[data-anzeige="untaetig"] { color: var(--live-gruen); }
.status-symbol[data-anzeige="beschaeftigt"] { color: var(--live-orange); }
.status-symbol[data-anzeige="nicht_stoeren"] { color: var(--live-rot); }
.status-symbol[data-anzeige="abwesend"], .status-symbol[data-anzeige="offline"] { color: var(--live-grau); }
.status-symbol[data-anzeige="im_gespraech"] { color: var(--live-violett); }
.status-knopf[data-anzeige="offline"] { border-style: dashed; }

/* Menü und Tafel: helle Fläche unter der Kopfzeile */
.status-menue, .glocke-tafel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 120; background: var(--surface, #fff);
  color: var(--text, #0F172A); border: 1px solid var(--border, #E2E8F0); border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.18); }
.status-menue { width: 280px; padding: 6px; }
.status-menue ul { list-style: none; margin: 0; padding: 0; }
.status-menue [role="separator"] { height: 1px; margin: 6px 4px; background: var(--border, #E2E8F0); }
.status-menue button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 10px; border: 0;
  border-radius: 8px; background: none; color: inherit; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.status-menue button:hover, .status-menue button:focus-visible { background: var(--nav-hover, #F1F5F9); }
.status-menue button:focus-visible { outline: 2px solid var(--accent, #2563EB); outline-offset: -2px; }
.status-menue button[data-aktion] { padding-left: calc(20px + 1em); }   /* bündig mit den Einträgen mit Symbol */
.status-menue button[aria-checked="true"] { font-weight: 700; }
.status-menue button[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: var(--accent, #2563EB); }
/* Symbole im hellen Menü kräftiger (Kontrast auf Weiß) */
.status-menue .status-symbol[data-anzeige="verfuegbar"] { color: #15803D; }
.status-menue .status-symbol[data-anzeige="beschaeftigt"] { color: #B45309; }
.status-menue .status-symbol[data-anzeige="nicht_stoeren"] { color: #B91C1C; }
.status-menue .status-symbol[data-anzeige="abwesend"] { color: #475569; }
.status-menue-hinweis { margin: 6px 10px 4px; font-size: 12px; line-height: 1.45; color: var(--text-muted, #64748B); }

/* Glocke */
.glocke { position: relative; }
.glocke-zahl { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger, #EF4444); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  border: 2px solid var(--navy, #0A1628); box-sizing: content-box; }
.glocke.glocke-offline { outline: 1px dashed rgba(255,255,255,.5); outline-offset: 2px; }
.glocke-tafel { width: 380px; max-height: min(70vh, 560px); display: flex; flex-direction: column; overflow: hidden; }
.glocke-tafel:focus { outline: none; }
.glocke-tafel:focus-visible { outline: 2px solid var(--accent, #2563EB); outline-offset: 2px; }
.glocke-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 8px; border-bottom: 1px solid var(--border, #E2E8F0); }
.glocke-kopf h2 { font-size: 15px; margin: 0; }
.glocke-leer { margin: 12px 14px 4px; font-size: 13px; color: var(--text-muted, #64748B); }
.glocke-liste { list-style: none; margin: 0; padding: 4px 6px; overflow-y: auto; flex: 1 1 auto; }
.glocke-eintrag { display: grid; grid-template-columns: 22px 1fr auto; align-items: start; gap: 8px; width: 100%; padding: 8px; border: 0;
  border-radius: 8px; background: none; color: inherit; font: inherit; font-size: 13px; line-height: 1.4; text-align: left; cursor: pointer; }
.glocke-eintrag:hover, .glocke-eintrag:focus-visible { background: var(--nav-hover, #F1F5F9); }
.glocke-eintrag:focus-visible { outline: 2px solid var(--accent, #2563EB); outline-offset: -2px; }
.glocke-eintrag.ungelesen { font-weight: 700; }
.glocke-eintrag.ungelesen .glocke-symbol { background: var(--nav-aktiv-flaeche, #E8F0FE); color: var(--nav-aktiv, #1D4ED8); }
.glocke-symbol { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--nav-hover, #F1F5F9); color: var(--text-muted, #64748B); font-size: 12px; font-weight: 700; }
.glocke-eintrag time { font-size: 12px; font-weight: 400; color: var(--text-muted, #64748B); white-space: nowrap; }
.glocke-fuss { border-top: 1px solid var(--border, #E2E8F0); padding: 10px 14px 12px; display: grid; gap: 6px; font-size: 13px; }
.glocke-desktop { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; }
.glocke-haken { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.glocke-haken input { width: 16px; height: 16px; }
.live-klein { margin: 0; font-size: 12px; line-height: 1.45; color: var(--text-muted, #64748B); }

/* Dialog „Abwesend …“ / „Status-Text …“: über Dialogen (.modal-bg 500) und der Sitzungsleiste (600),
   unter dem Step-up (700) */
.live-dialog-bg { position: fixed; inset: 0; z-index: 650; background: rgba(15,23,42,.45); display: flex; align-items: center;
  justify-content: center; padding: 16px; }
.live-dialog { width: min(440px, 100%); background: var(--surface, #fff); color: var(--text, #0F172A); border-radius: 14px;
  box-shadow: 0 20px 48px rgba(15,23,42,.28); padding: 20px 22px; display: grid; gap: 8px; }
.live-dialog h2 { font-size: 17px; margin: 0 0 4px; }
.live-dialog label { font-size: 13px; font-weight: 600; }
.live-dialog input[type="text"], .live-dialog input[type="datetime-local"] { width: 100%; padding: 8px 10px; border: 1.5px solid var(--border, #E2E8F0);
  border-radius: 8px; font: inherit; font-size: 14px; }
.live-dialog input:focus-visible { outline: 2px solid var(--accent, #2563EB); outline-offset: 1px; }
.live-dialog fieldset { border: 0; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; }
.live-dialog legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.status-dialog-wahl { display: flex; flex-wrap: wrap; gap: 6px; }
.status-dialog-option { position: relative; }
.status-dialog-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.status-dialog-option label { display: inline-block; padding: 6px 12px; border: 1.5px solid var(--border, #E2E8F0); border-radius: 999px;
  font-weight: 500; cursor: pointer; }
.status-dialog-option input:checked + label { border-color: var(--accent, #2563EB); background: var(--nav-aktiv-flaeche, #E8F0FE);
  color: var(--nav-aktiv, #1D4ED8); font-weight: 700; }
.status-dialog-option input:checked + label::before { content: "✓ "; }
.status-dialog-option input:focus-visible + label { outline: 2px solid var(--accent, #2563EB); outline-offset: 2px; }
.live-fehler { margin: 0; min-height: 1em; font-size: 13px; color: #B91C1C; }
.live-knoepfe { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* [P2:T3] Klingel-Fenster unten rechts (über dem Wartezimmer-Hinweis #video-wartend, z-index 900),
   unter Dialogen der Sitzung (Sitzungsleiste 600 liegt oben, nicht im Weg) */
.anruf-klingelt { position: fixed; right: 18px; bottom: 18px; z-index: 910; width: min(380px, calc(100vw - 32px));
  background: var(--navy, #0A1628); color: #fff; border: 1px solid #E0A458; border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.32); padding: 14px 16px 16px; display: grid; gap: 6px; }
.anruf-klingelt:focus { outline: none; }
.anruf-klingelt:focus-visible { outline: 3px solid #E0A458; outline-offset: 3px; }
.anruf-klingelt h2 { margin: 0; font-size: 16px; line-height: 1.35; color: #fff; }
.anruf-klingelt h2::before { content: "☎ "; color: #E0A458; }
.anruf-klingelt p { margin: 0; font-size: 13px; line-height: 1.45; color: rgba(255,255,255,.85); }
.anruf-klingelt .anruf-blockiert { color: #FDE68A; font-weight: 600; }
.anruf-klingelt .knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.anruf-klingelt .btn { min-height: 36px; }
.anruf-klingelt .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.anruf-klingelt .btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.anruf-antwort-menue { list-style: none; margin: 4px 0 0; padding: 4px; background: var(--surface, #fff); color: var(--text, #0F172A);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(15,23,42,.25); }
.anruf-antwort-menue button { display: block; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 8px; background: none;
  color: inherit; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.anruf-antwort-menue button:hover, .anruf-antwort-menue button:focus-visible { background: var(--nav-hover, #F1F5F9); }
.anruf-antwort-menue button:focus-visible { outline: 2px solid var(--accent, #2563EB); outline-offset: -2px; }

@media (max-width: 900px) {
  .status-knopf { padding: 0 10px; }
}
@media (max-width: 560px) {
  .live-kopf { gap: 8px; }
  .status-knopf .status-text { display: none; }   /* Symbol bleibt, der Name steht im aria-label */
  .status-knopf { padding: 0; width: 36px; justify-content: center; }
  .status-knopf::after { content: none; }
  .status-knopf .status-symbol { font-size: 17px; }
  .status-menue, .glocke-tafel { position: fixed; top: calc(var(--topbar-h, 60px) + 6px); left: 8px; right: 8px; width: auto; }
  .anruf-klingelt { left: 8px; right: 8px; bottom: 8px; width: auto; }   /* [P2:T3] */
}
@media (forced-colors: active) {
  .glocke-zahl { border: 1px solid CanvasText; }
  .status-menue button[aria-checked="true"] { outline: 1px solid CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
  .status-knopf, .glocke-eintrag, .status-menue button { transition: none !important; }
}
