:root {
	--trb-m-bg: #e8eaed;
	--trb-m-text: #1e1e1e;
	--trb-m-muted: #62676d;
	--trb-m-primary: #2271b1;
	--trb-m-primary-hover: #135e96;
	--trb-m-primary-bg: rgba( 255, 255, 255, 0.16 );
	--trb-m-primary-hover-bg: rgba( 255, 255, 255, 0.24 );
	--trb-m-danger: #c13b3b;
	--trb-m-radius-lg: 16px;
	--trb-m-radius-md: 10px;
	--trb-m-radius-sm: 7px;
	--trb-m-panel-bg: #f8f8f9;
	--trb-m-panel-border: #cfd3d8;
	--trb-m-card-bg: #f1f2f4;
	--trb-m-card-hover: #ffffff;
	--trb-m-page-text: #1e1e1e;
	--trb-m-page-muted: #62676d;
	--trb-m-button-bg: rgba( 255, 255, 255, 0.78 );
	--trb-m-button-hover: #ffffff;
}

.trb-mgmt-body,
.trb-mgmt-body * {
	box-sizing: border-box;
}

body.trb-mgmt-body {
	margin: 0;
	min-height: 100vh;
	background: #000;
	color: var( --trb-m-page-text );
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.55;
	font-weight: 500;
	-webkit-font-smoothing: antialiased;
}

/* Dasselbe vollflächige Hintergrund-/Overlay-Prinzip wie auf der Startseite. */
.trb-mgmt-background,
.trb-mgmt-background-overlay {
	position: fixed;
	inset: 0;
	pointer-events: none;
}

.trb-mgmt-background {
	z-index: 0;
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	opacity: 0;
	transition: opacity 0.38s ease;
}

.trb-mgmt-background-overlay {
	z-index: 1;
	opacity: 0;
	transition: opacity 0.38s ease;
}

.trb-mgmt-body.trb-bg-ready .trb-mgmt-background {
	opacity: 1;
}

.trb-mgmt-body.trb-bg-ready .trb-mgmt-background-overlay {
	opacity: var( --trb-m-overlay-opacity, 0.6 );
}

.trb-mgmt-overlay-dark .trb-mgmt-background-overlay {
	background: #000;
}

.trb-mgmt-overlay-light .trb-mgmt-background-overlay {
	background: #fff;
}

.trb-mgmt-app,
.trb-login-shell {
	position: relative;
	z-index: 2;
}

.trb-mgmt-app {
	max-width: 1240px;
	margin: 0 auto;
	padding: 54px 32px 90px;
}

.trb-mgmt-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 30px;
	margin-bottom: 30px;
}

.trb-mgmt-header h1 {
	margin: 3px 0 5px;
	font-size: clamp( 34px, 5vw, 58px );
	line-height: 1.06;
	font-weight: 800;
	letter-spacing: -0.025em;
	color: inherit;
}

.trb-mgmt-header p {
	margin: 0;
	color: var( --trb-m-page-muted );
	font-weight: 500;
}

.trb-mgmt-eyebrow {
	color: inherit;
	opacity: 0.82;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	font-size: 11px;
	font-weight: 800;
}

.trb-mgmt-header-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

/* Hauptbereiche entsprechen optisch den Kategorieboxen der Startseite. */
.trb-mgmt-section,
.trb-login-card {
	background: var( --trb-m-panel-bg );
	border: 1px solid var( --trb-m-panel-border );
	backdrop-filter: blur( 12px );
	-webkit-backdrop-filter: blur( 12px );
}

.trb-mgmt-no-background .trb-mgmt-section,
.trb-mgmt-no-background .trb-login-card {
	background: #f8f8f9;
	border-color: #cfd3d8;
}

.trb-mgmt-section {
	border-radius: var( --trb-m-radius-lg );
	padding: 26px;
	margin-bottom: 24px;
}

.trb-mgmt-section-head {
	display: flex;
	justify-content: space-between;
	gap: 24px;
	align-items: center;
	margin-bottom: 20px;
}

.trb-mgmt-section-head h2 {
	margin: 0 0 4px;
	font-size: 24px;
	line-height: 1.2;
	font-weight: 700;
	color: inherit;
}

.trb-mgmt-section-head p {
	margin: 0;
	color: var( --trb-m-page-muted );
	font-weight: 500;
}

.trb-mgmt-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 7px 12px;
	border: 1px solid var( --trb-m-panel-border );
	border-radius: var( --trb-m-radius-sm );
	background: var( --trb-m-button-bg );
	color: inherit;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.3;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
	backdrop-filter: blur( 8px );
	-webkit-backdrop-filter: blur( 8px );
}

.trb-mgmt-button:hover,
.trb-mgmt-button:focus-visible {
	background: var( --trb-m-button-hover );
}

.trb-mgmt-button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.trb-mgmt-button.is-primary {
	background: var( --trb-m-primary-bg, var( --trb-m-button-bg ) );
	border-color: var( --trb-m-panel-border );
	color: inherit;
}

.trb-mgmt-button.is-primary:hover,
.trb-mgmt-button.is-primary:focus-visible {
	background: var( --trb-m-primary-hover, var( --trb-m-button-hover ) );
	border-color: var( --trb-m-panel-border );
}

.trb-mgmt-button.is-danger-ghost {
	color: var( --trb-m-danger );
}

.trb-mgmt-overlay-dark .trb-mgmt-button.is-danger-ghost {
	color: #ffb7b7;
}

.trb-mgmt-button.is-danger-ghost:hover {
	background: rgba( 190, 45, 45, 0.12 );
}

.trb-mgmt-button.is-small {
	min-height: 31px;
	padding: 5px 9px;
	font-size: 13px;
}

.trb-mgmt-button.is-wide {
	width: 100%;
}

.trb-mgmt-notice {
	position: relative;
	z-index: 2;
	padding: 12px 15px;
	border-radius: 9px;
	margin: 0 0 20px;
	border: 1px solid;
	font-weight: 700;
}

.trb-mgmt-notice.is-success {
	background: rgba( 226, 250, 231, 0.94 );
	border-color: #a9ddb0;
	color: #185b22;
}

.trb-mgmt-notice.is-error {
	background: rgba( 255, 240, 240, 0.96 );
	border-color: #e3aaaa;
	color: #842525;
}

.trb-mgmt-course-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 320px, 1fr ) );
	gap: 12px;
}

.trb-mgmt-course-card,
.trb-mgmt-category-row,
.trb-mgmt-recovery-row {
	border: 1px solid var( --trb-m-panel-border );
	background: var( --trb-m-card-bg );
	backdrop-filter: blur( 8px );
	-webkit-backdrop-filter: blur( 8px );
}

.trb-mgmt-course-card {
	border-radius: var( --trb-m-radius-md );
	padding: 18px 20px;
}

.trb-mgmt-course-card h3 {
	margin: 10px 0 18px;
	font-size: 18px;
	line-height: 1.3;
	font-weight: 700;
	color: inherit;
}

.trb-mgmt-course-meta {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: space-between;
	color: var( --trb-m-page-muted );
	font-size: 12px;
	font-weight: 650;
}

.trb-mgmt-status {
	display: inline-flex;
	border-radius: 999px;
	padding: 3px 7px;
	background: rgba( 127, 127, 127, 0.16 );
	color: inherit;
	font-weight: 700;
}

.trb-mgmt-status.is-publish {
	background: #e5f5e8;
	color: #176326;
}

.trb-mgmt-status.is-draft {
	background: #fff3d6;
	color: #755100;
}

.trb-mgmt-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.trb-mgmt-recovery {
	margin-top: 18px;
	border-top: 1px solid var( --trb-m-panel-border );
	padding-top: 14px;
}

.trb-mgmt-recovery summary {
	cursor: pointer;
	font-weight: 700;
	color: var( --trb-m-page-muted );
}

.trb-mgmt-recovery summary span {
	display: inline-flex;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 11px;
	align-items: center;
	justify-content: center;
	background: rgba( 127, 127, 127, 0.18 );
	color: inherit;
	font-size: 12px;
}

.trb-mgmt-recovery-list {
	margin-top: 10px;
	display: grid;
	gap: 7px;
}

.trb-mgmt-recovery-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	padding: 10px 12px;
	border-radius: 7px;
}

.trb-mgmt-inline-form {
	display: flex;
	gap: 8px;
	margin-bottom: 18px;
}

.trb-mgmt-inline-form input[type="text"],
.trb-login-form input[type="text"],
.trb-login-form input[type="password"] {
	border: 1px solid var( --trb-m-panel-border );
	border-radius: 7px;
	padding: 7px 11px;
	font: inherit;
	font-weight: 500;
	background: rgba( 255, 255, 255, 0.94 );
	color: #1e1e1e;
}

.trb-mgmt-inline-form input[type="text"] {
	flex: 1 1 auto;
	min-width: 180px;
	height: 38px;
}

.trb-mgmt-inline-form input[type="text"]:focus,
.trb-login-form input:focus {
	outline: 2px solid rgba( 127, 127, 127, 0.26 );
	border-color: currentColor;
}

.trb-mgmt-category-list {
	display: grid;
	gap: 8px;
}

.trb-mgmt-category-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	border-radius: 9px;
	padding: 11px 13px;
}

.trb-mgmt-category-name {
	display: flex;
	align-items: center;
	gap: 11px;
	min-width: 0;
	font-weight: 700;
}

.trb-mgmt-category-name div {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.trb-mgmt-category-name span:not(.trb-mgmt-color-dot) {
	color: var( --trb-m-page-muted );
	font-size: 12px;
	font-weight: 500;
}

.trb-mgmt-color-dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	flex: 0 0 14px;
	box-shadow: 0 0 0 1px rgba( 0, 0, 0, 0.12 );
}

.trb-mgmt-empty {
	padding: 22px;
	border: 1px dashed var( --trb-m-panel-border );
	border-radius: 9px;
	text-align: center;
	color: var( --trb-m-page-muted );
	font-weight: 500;
}

/* Login: dieselbe Glasfläche wie eine Kategoriebox auf der Startseite. */
body.trb-login-body {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.trb-login-shell {
	width: 100%;
	max-width: 430px;
}

.trb-login-card {
	border-radius: var( --trb-m-radius-lg );
	padding: 34px;
}

.trb-login-mark {
	display: none !important;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 11px;
	background: var( --trb-m-primary );
	color: #fff;
	font-weight: 850;
	margin-bottom: 20px;
}

.trb-login-card h1 {
	margin: 0;
	font-size: 30px;
	line-height: 1.1;
	font-weight: 800;
	letter-spacing: -0.015em;
	color: inherit;
}

.trb-login-lead {
	margin: 4px 0 24px;
	color: var( --trb-m-page-muted );
	font-weight: 500;
}

.trb-login-form {
	display: grid;
	gap: 15px;
}

.trb-login-form label > span {
	display: block;
	margin-bottom: 5px;
	font-weight: 700;
}

.trb-login-form input[type="text"],
.trb-login-form input[type="password"] {
	width: 100%;
	height: 42px;
}

.trb-login-remember {
	display: flex !important;
	align-items: center;
	gap: 8px;
	font-weight: 500 !important;
}

.trb-login-remember span {
	margin: 0 !important;
	font-weight: 500 !important;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect( 0, 0, 0, 0 ) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

@media ( max-width: 760px ) {
	.trb-mgmt-app {
		padding: 36px 18px 56px;
	}

	.trb-mgmt-header,
	.trb-mgmt-section-head {
		flex-direction: column;
		align-items: stretch;
	}

	.trb-mgmt-header-actions {
		justify-content: flex-start;
	}

	.trb-mgmt-section {
		padding: 18px;
	}

	.trb-mgmt-course-grid {
		grid-template-columns: 1fr;
	}

	.trb-mgmt-category-row {
		align-items: flex-start;
		flex-direction: column;
	}

	.trb-mgmt-inline-form {
		flex-direction: column;
	}
}

/* Ohne Hintergrundbild bleibt die Verwaltung bewusst im hellen Grunddesign,
   unabhängig davon, welches Overlay für eine spätere Startseite gewählt ist. */
body.trb-mgmt-no-background {
	background: var( --trb-m-bg );
	--trb-m-page-text: #1e1e1e !important;
	--trb-m-page-muted: #62676d !important;
	--trb-m-panel-border: #cfd3d8 !important;
	--trb-m-card-bg: #f1f2f4 !important;
	--trb-m-card-hover: #ffffff !important;
	--trb-m-button-bg: rgba( 255, 255, 255, 0.78 ) !important;
	--trb-m-button-hover: #ffffff !important;
	--trb-m-primary-bg: rgba( 30, 30, 30, 0.08 ) !important;
	--trb-m-primary-hover: rgba( 30, 30, 30, 0.14 ) !important;
	color: #1e1e1e;
}

/* Bei Seiten mit Hintergrund erscheint auch der Inhalt erst zusammen mit dem
   geladenen Hintergrund. So gibt es weder Bildflackern noch kurz falsche
   Kontraste bei hellem Overlay. */
.trb-mgmt-has-background .trb-mgmt-app,
.trb-mgmt-has-background .trb-login-shell {
	opacity: 0;
	transition: opacity 0.24s ease;
}

.trb-mgmt-has-background.trb-bg-ready .trb-mgmt-app,
.trb-mgmt-has-background.trb-bg-ready .trb-login-shell {
	opacity: 1;
}

.trb-login-mark {
	display: none !important;
}
