/* css/statusleiste.css - rechte Statusleiste ein-/ausklappbar + Hell/Dunkel-
   Schalter (06.10.2026, framework/Statusleiste/Default.php). Global ueber
   framework/js/head.php eingebunden; Grundgestaltung der Leiste weiterhin in
   css/styles.css (.tc-statusleiste*).
   Ab 1280px: ausgeklappt wie bisher (--sidebar-right-width 260px) oder
   eingeklappt als 64px-Schiene - der rechts reservierte Streifen der
   Seitentabelle folgt automatisch derselben Variable. Unter 1280px
   Overlay ueber den Avatar-Knopf im Header. */

/* ---- Hell/Dunkel-Schalter (Symbol wechselt mit der Darstellung) ------ */
.tc-theme-knopf svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.tc-theme-knopf .tc-theme-mond { fill: currentColor; stroke: none; }
.tc-theme-knopf .tc-theme-sonne { display: none; }
:root[data-theme="dunkel"] .tc-theme-knopf .tc-theme-mond { display: none; }
:root[data-theme="dunkel"] .tc-theme-knopf .tc-theme-sonne { display: inline; }
.tc-theme-text-hell { display: none; }
:root[data-theme="dunkel"] .tc-theme-text-dunkel { display: none; }
:root[data-theme="dunkel"] .tc-theme-text-hell { display: inline; }

/* ausgeklappt: wie die uebrigen Benutzer-Links (Mein Profil, Logout ...) */
button.tc-statusleiste-theme {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 0; margin: 0; padding: 6px 8px; border: 0; border-radius: var(--radius-small);
	background-color: transparent; color: var(--color-text-muted);
	font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
}
button.tc-statusleiste-theme svg { width: 15px; height: 15px; }
button.tc-statusleiste-theme:hover,
button.tc-statusleiste-theme:focus-visible { background-color: var(--color-background); color: var(--color-primary); }

/* ---- Ein-/Ausklappen ----------------------------------------------- */
.tc-statusleiste-einklappen,
.tc-statusleiste-schiene { display: none; }

@media (min-width: 1280px) {
	html:has(#tc-statusleiste[data-zustand="zu"]) { --sidebar-right-width: 64px; }

	button.tc-statusleiste-einklappen {
		display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; flex: 0 0 auto;
		width: 38px; height: 38px; min-height: 0; padding: 0; margin: 0 0 -4px;
		border: 2px solid var(--color-border-strong); border-radius: 8px;
		background-color: var(--color-surface); color: var(--color-text); cursor: pointer;
	}
	button.tc-statusleiste-einklappen .tc-icon { width: 20px; height: 20px; }
	button.tc-statusleiste-einklappen:hover,
	button.tc-statusleiste-einklappen:focus-visible { background-color: var(--color-primary-flaeche, var(--color-primary)); border-color: var(--color-primary); color: var(--color-text-on-dark); }

	.tc-statusleiste[data-zustand="zu"] { padding: 12px 8px; align-items: center; }
	.tc-statusleiste[data-zustand="zu"] > :not(.tc-statusleiste-schiene) { display: none !important; }
	.tc-statusleiste[data-zustand="zu"] > .tc-statusleiste-schiene { display: flex; }
}

.tc-statusleiste-schiene { flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.tc-statusleiste-schiene .tc-statusleiste-schiene-avatar { margin: 4px 0 6px; }
/* Profilbild in der Schiene klappt die Leiste aus (Knopf statt Link) */
button.tc-statusleiste-schiene-avatar { display: inline-flex; padding: 2px; border: 0; border-radius: 50%; background: none; cursor: pointer; min-height: 0; }
.tc-statusleiste-schiene .tc-statusleiste-schiene-avatar .tc-avatar { margin: 0; }
.tc-statusleiste-schiene-knopf {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; min-height: 0; padding: 0; margin: 0; box-sizing: border-box;
	border: 1px solid var(--color-border); border-radius: 10px;
	background-color: var(--color-surface); color: var(--color-text); text-decoration: none; cursor: pointer;
}
.tc-statusleiste-schiene-knopf .tc-icon,
.tc-statusleiste-schiene-knopf svg { width: 20px; height: 20px; }
.tc-statusleiste-schiene-knopf:hover,
.tc-statusleiste-schiene-knopf:focus-visible { background-color: var(--color-primary-flaeche, var(--color-primary)); border-color: var(--color-primary); color: var(--color-text-on-dark); }

/* ---- 1280-1599px (auch bei Browser-Zoom auf groesseren Bildschirmen) ----
   06.10.2026, Nutzermeldungen "rechte Seitenleiste verschwunden" und "soll sich
   wie der linke Seitenstreifen verhalten": hier gilt jetzt dasselbe wie ab
   1600px - ausgeklappt 260px bzw. eingeklappt 64px-Schiene, Platz rechts
   reserviert (kein Overlay), Zustand je Benutzer gespeichert. Der Avatar-Knopf
   im Header entfaellt. Unter 1280px bleibt das Overlay ueber den Avatar-Knopf. */
@media (min-width: 1280px) and (max-width: 1599px) {
	body > table > tbody > tr > td:not([width]):not([class]) + td[bgcolor="#666666" i] {
		width: var(--sidebar-right-width) !important; background-color: var(--color-background) !important;
		border-left: 1px solid var(--color-border) !important; vertical-align: top;
	}
	.tc-statusleiste, .tc-statusleiste.tc-statusleiste--offen {
		display: flex; top: var(--tc-kopf-hoehe, 0px); height: calc(100vh - var(--tc-kopf-hoehe, 0px));
		width: var(--sidebar-right-width); box-shadow: none; z-index: 40;
	}
	.tc-statusleiste .tc-statusleiste-schliessen { display: none !important; }
	.app-statusleiste-umschalter { display: none !important; }
}

@media print {
	.tc-statusleiste { display: none !important; }
}

/* 07.10.2026: schwebender Modus (data-tc-schwebend, z. B. Ticketdetails, js/tc-leisten-schwebend.js):
   rechts bleibt nur die Schienenbreite reserviert - aufgeklappt liegt die Leiste UEBER dem Inhalt. */
@media (min-width: 1280px) {
	html:has(#tc-statusleiste[data-tc-schwebend]) { --sidebar-right-width: 64px; }
	#tc-statusleiste[data-tc-schwebend][data-zustand="offen"] { width: 260px; z-index: 65; box-shadow: -8px 0 28px rgba(0, 0, 0, .22); }
}

/* 07.10.2026: Pin zum Anheften (links und rechts identisch, Nutzerwunsch "gleiche Groesse";
   Symbol je Zustand verschieden, neutrale Farben statt Blau). Nur ab 1280px - darunter
   gelten die Overlays. Geloest: helle Flaeche, schraege Nadel; angeheftet: dunkle
   Flaeche, senkrechte gefuellte Nadel. */
button.tc-leiste-pin { display: none; }
button.tc-leiste-pin .tc-pin-fest,
button.tc-leiste-pin[aria-pressed="true"] .tc-pin-lose { display: none; }
button.tc-leiste-pin[aria-pressed="true"] .tc-pin-fest { display: inline-flex; }
@media (min-width: 1280px) {
	button.tc-leiste-pin {
		display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
		box-sizing: border-box; width: 26px; height: 26px; min-height: 0; margin: 0; padding: 0;
		/* 06.11.2026 (Roman): kleiner und dezenter (vorher 38px, 2px-Rahmen) */
		border: 1px solid var(--color-border); border-radius: 6px;
		background-color: var(--color-surface); color: var(--color-text-muted); cursor: pointer;
	}
	button.tc-leiste-pin .tc-pin-lose, button.tc-leiste-pin .tc-pin-fest { align-items: center; justify-content: center; }
	button.tc-leiste-pin .tc-pin-lose { display: inline-flex; }
	button.tc-leiste-pin[aria-pressed="true"] .tc-pin-lose { display: none; }
	button.tc-leiste-pin .tc-icon { width: 14px; height: 14px; }
	/* angeheftet: Hintergrund bleibt hell (Nutzerwunsch 07.10.2026), Unterschied ueber gefuellte Nadel + dunklen Rahmen */
	button.tc-leiste-pin[aria-pressed="true"] { background-color: var(--color-surface); border-color: var(--color-text); color: var(--color-text); }
	button.tc-leiste-pin:hover,
	button.tc-leiste-pin:focus-visible { background-color: var(--color-background); border-color: var(--color-text); color: var(--color-text); }
	.tc-statusleiste > button.tc-statusleiste-pin { align-self: flex-start; margin: 0 0 -4px; }
}

/* 08.10.2026: Menue der ausgeklappten Leiste nur als Symbole, nebeneinander in einer Zeile,
   gleiches Design wie die Knoepfe der schmalen Leiste (passt sich der Breite an). */
.tc-statusleiste-benutzer-aktionen { display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: center; gap: 6px; }
.tc-statusleiste-benutzer-aktionen > .tc-statusleiste-schiene-knopf {
	flex: 1 1 0; max-width: 44px; min-width: 0; height: 44px; padding: 0; gap: 0; font-size: inherit;
	border: 1px solid var(--color-border); border-radius: 10px;
	background-color: var(--color-surface); color: var(--color-text);
}
.tc-statusleiste-benutzer-aktionen > .tc-statusleiste-schiene-knopf .tc-icon,
.tc-statusleiste-benutzer-aktionen > .tc-statusleiste-schiene-knopf svg { width: 20px; height: 20px; }
.tc-statusleiste-benutzer-aktionen > .tc-statusleiste-schiene-knopf:hover,
.tc-statusleiste-benutzer-aktionen > .tc-statusleiste-schiene-knopf:focus-visible { background-color: var(--color-primary-flaeche, var(--color-primary)); border-color: var(--color-primary); color: var(--color-text-on-dark); }
/* 08.10.2026: Ueberschriften der Kennzahlen-Bereiche ("Meine Tickets", "Sitzung", Konto) zentriert, einheitliche Groesse */
.tc-statusleiste .tc-statusleiste-section-titel { text-align: center; font-size: .7rem; }

/* ---- 09.11.2026 (OTS-0870): Aktive Benutzer - Knopf in der Leiste + Modal (js/tc-aktive-benutzer.js) ---- */
.tc-statusleiste-schiene-knopf.tc-ab-knopf { position: relative; }
.tc-ab-knopf-zahl {
	min-width: 18px; padding: 0 5px; border-radius: 9px; box-sizing: border-box;
	background-color: var(--color-success-dark, var(--color-success)); color: #FFFFFF; font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center;
}
.tc-ab-knopf .tc-ab-knopf-zahl { position: absolute; top: -6px; right: -6px; }
.tc-ab-knopf-zahl[hidden] { display: none; }
button.tc-ab-knopf-breit {
	display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 40px; margin: 10px 0 0; padding: 6px 10px; box-sizing: border-box;
	border: 1px solid var(--color-border); border-radius: 10px; background-color: var(--color-surface); color: var(--color-text);
	font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer;
}
button.tc-ab-knopf-breit .tc-icon, button.tc-ab-knopf-breit svg { width: 20px; height: 20px; }
button.tc-ab-knopf-breit:hover, button.tc-ab-knopf-breit:focus-visible { background-color: var(--color-primary-flaeche, var(--color-primary)); border-color: var(--color-primary); color: var(--color-text-on-dark); }
button.tc-ab-knopf-breit:hover .tc-ab-knopf-zahl, button.tc-ab-knopf-breit:focus-visible .tc-ab-knopf-zahl { background-color: var(--color-surface); color: var(--color-text); }

dialog.tc-modal.tc-ab-dialog { width: min(760px, 96vw); max-width: 96vw; }
dialog.tc-modal.tc-ab-dialog[open] { height: min(720px, 90vh); max-height: 90vh; }
.tc-ab-header { background-color: var(--color-primary-flaeche, var(--color-primary)); }
.tc-ab-header .tc-modal-titel { display: inline-flex; align-items: center; gap: 8px; }
.tc-ab-header .tc-modal-titel .tc-icon { width: 20px; height: 20px; }
.tc-ab-inhalt { padding: 0; gap: 0; }
.tc-ab-kopf { position: sticky; top: 0; z-index: 1; padding: 12px 16px 8px; background-color: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.tc-ab-reiter { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-ab-reiter .tc-admin-tab { border: 1px solid var(--color-border); background-color: var(--color-surface); color: var(--color-text); font-size: .95rem; cursor: pointer; font-family: inherit; }
.tc-ab-reiter .tc-admin-tab:hover, .tc-ab-reiter .tc-admin-tab:focus-visible { background-color: var(--color-background); color: var(--color-text); }
.tc-ab-reiter .tc-admin-tab.tc-admin-tab--aktiv, .tc-ab-reiter .tc-admin-tab.tc-admin-tab--aktiv:hover { background-color: var(--color-primary-flaeche, var(--color-primary)); border-color: var(--color-primary); color: var(--color-text-on-dark); }
.tc-ab-zahl { font-weight: 700; opacity: .85; }
.tc-ab-legende { margin: 8px 0 0; font-size: .82rem; color: var(--color-text-muted); display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tc-ab-panel { padding: 8px 16px 16px; }
.tc-ab-leer { margin: 16px; color: var(--color-text-muted); }
.tc-ab-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tc-ab-eintrag { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--color-border); }
.tc-ab-eintrag:last-child { border-bottom: 0; }
.tc-ab-eintrag--inaktiv .tc-ab-bild { opacity: .65; }
.tc-ab-bild { position: relative; width: 40px; height: 40px; }
.tc-ab-punkt { display: inline-block; width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box; flex: 0 0 auto; }
.tc-ab-bild .tc-ab-punkt { position: absolute; right: -2px; bottom: -2px; border: 2px solid var(--color-surface); width: 14px; height: 14px; }
.tc-ab-punkt--aktiv { background-color: var(--color-success); }
.tc-ab-punkt--inaktiv { background-color: var(--color-border-strong); }
.tc-ab-text { display: flex; flex-direction: column; min-width: 0; }
.tc-ab-name { font-weight: 700; color: var(--color-text); overflow-wrap: anywhere; }
.tc-ab-unter { font-size: .85rem; color: var(--color-text-muted); overflow-wrap: anywhere; }
.tc-ab-zeit { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-size: .85rem; color: var(--color-text); white-space: nowrap; }
.tc-ab-eintrag--inaktiv .tc-ab-zeit { color: var(--color-text-muted); }
.tc-ab-sitzungen { font-size: .75rem; color: var(--color-text-muted); }
@media (max-width: 600px) {
	dialog.tc-modal.tc-ab-dialog { width: 100vw; max-width: 100vw; }
	dialog.tc-modal.tc-ab-dialog[open] { height: 100vh; max-height: 100vh; border-radius: 0; }
	.tc-ab-eintrag { grid-template-columns: 44px minmax(0, 1fr); }
	.tc-ab-zeit { grid-column: 2; align-items: flex-start; text-align: left; }
}
