/* Bot-Dashboard: gleiche Farben wie die Mail-App (apps/pwa/src/colors.css, DESIGN.md). Nur Variablen, keine Hex-Werte unten. */
@font-face {
	font-family: Inter;
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url(/inter.woff2) format("woff2");
}

:root {
	--background: #ffffff;
	--primary: #07041d;
	--primary-foreground: #f1f0f5;
	--secondary: #f1f0f5;
	--tertiary: #ffffff;
	--sidebar: #eeeff0;
	--border: #eeeff0;
	--muted-foreground: #5e5b72;
	--red: #fc5a5a;
	--blue: #1b67e4;
	--green: #16a34a;
	--orange: #ff9500;
	--fill: rgb(120 120 128 / 0.12);
	--radius: 0.5rem;
	color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
	:root {
		--background: #1c1c24;
		--primary: #efeff0;
		--primary-foreground: #292932;
		--secondary: #292932;
		--tertiary: #17171e;
		--sidebar: #17171e;
		--border: #2c2c34;
		--muted-foreground: #a3a3ad;
		--blue: #5a95ff;
		--orange: #ff9f0a;
		--fill: rgb(120 120 128 / 0.24);
	}
}

* {
	box-sizing: border-box;
}
html,
body {
	margin: 0;
	height: 100%;
}
body {
	font-family: Inter, "Inter Fallback", -apple-system, system-ui, sans-serif;
	background: var(--background);
	color: var(--primary);
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-webkit-text-size-adjust: 100%;
}
a {
	color: var(--blue);
}
button,
input,
textarea,
select {
	font: inherit;
	color: inherit;
}

/* Laden */
.laden {
	min-height: 100dvh;
	display: grid;
	place-items: center;
}
.lade-logo {
	border-radius: 12px;
	animation: puls 1.2s ease-in-out infinite;
}
@keyframes puls {
	50% {
		opacity: 0.5;
		transform: scale(0.94);
	}
}

/* Aufbau: Seitenleiste am PC, Leiste unten am Handy */
.rahmen {
	display: flex;
	min-height: 100dvh;
}
.leiste {
	width: 232px;
	flex-shrink: 0;
	background: var(--sidebar);
	padding: 16px 12px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	position: sticky;
	top: 0;
	height: 100dvh;
}
.marke {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 4px 8px 16px;
	font-weight: 650;
}
.marke img {
	border-radius: 8px;
}
.nav {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: var(--radius);
	color: var(--primary);
	text-decoration: none;
	font-weight: 500;
	transition: background 120ms ease-out;
}
.nav:hover {
	background: var(--fill);
}
.nav[aria-current="page"] {
	background: var(--secondary);
}
.nav svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}
.leiste .unten {
	margin-top: auto;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 8px;
	font-size: 13px;
	color: var(--muted-foreground);
}
.inhalt {
	flex: 1;
	min-width: 0;
	padding: 28px 32px 48px;
	max-width: 1200px;
}
h1 {
	font-size: 24px;
	line-height: 1.25;
	margin: 0 0 4px;
	font-weight: 700;
	letter-spacing: -0.01em;
}
h2 {
	font-size: 16px;
	margin: 0 0 12px;
	font-weight: 650;
}
.unter {
	color: var(--muted-foreground);
	margin: 0 0 24px;
}

@media (max-width: 760px) {
	.rahmen {
		flex-direction: column;
	}
	.leiste {
		order: 2;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		top: auto;
		height: auto;
		width: auto;
		flex-direction: row;
		justify-content: space-around;
		padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
		border-top: 1px solid var(--border);
		z-index: 10;
	}
	.marke,
	.leiste .unten {
		display: none;
	}
	.nav {
		flex-direction: column;
		gap: 2px;
		font-size: 11px;
		padding: 6px 4px;
		min-width: 56px;
		justify-content: center;
	}
	.inhalt {
		padding: calc(16px + env(safe-area-inset-top)) 16px
			calc(96px + env(safe-area-inset-bottom));
	}
	.kopf-handy {
		display: flex !important;
	}
}
.kopf-handy {
	display: none;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 16px;
}
.kopf-handy .marke {
	display: flex;
	padding: 0;
}

/* Karten */
.karten {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
	margin-bottom: 24px;
}
.karte {
	background: var(--secondary);
	border-radius: calc(var(--radius) * 1.5);
	padding: 16px;
	min-width: 0;
}
.karte .wert {
	font-size: 20px;
	font-weight: 650;
	overflow-wrap: anywhere;
}
.karte .name {
	color: var(--muted-foreground);
	font-size: 13px;
}
.block {
	background: var(--secondary);
	border-radius: calc(var(--radius) * 1.5);
	padding: 16px;
	margin-bottom: 16px;
}
.punkt {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	margin-right: 6px;
	background: var(--muted-foreground);
}
.punkt.gut {
	background: var(--green);
}
.punkt.schlecht {
	background: var(--red);
}
.zeilen {
	list-style: none;
	margin: 0;
	padding: 0;
}
.zeilen li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 0;
	border-top: 1px solid var(--border);
	flex-wrap: wrap;
}
.zeilen li:first-child {
	border-top: 0;
}
.zeilen .rechts {
	color: var(--muted-foreground);
	text-align: right;
	overflow-wrap: anywhere;
}
.server {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-bottom: 20px;
}
.server img {
	width: 48px;
	height: 48px;
	border-radius: 14px;
}

/* Knöpfe, Felder */
.knopf {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 36px;
	padding: 0 14px;
	border-radius: var(--radius);
	border: 0;
	cursor: pointer;
	font-weight: 550;
	background: var(--primary);
	color: var(--primary-foreground);
	transition:
		opacity 120ms,
		transform 90ms;
}
.knopf:active {
	transform: scale(0.97);
}
.knopf:disabled {
	opacity: 0.5;
	cursor: default;
}
.knopf.zweit {
	background: var(--secondary);
	color: var(--primary);
}
.knopf.leise {
	background: transparent;
	color: var(--primary);
}
.knopf.leise:hover {
	background: var(--fill);
}
.knopf.rot {
	background: transparent;
	color: var(--red);
}
.knopf.rot:hover {
	background: color-mix(in srgb, var(--red) 12%, transparent);
}
.knopf.klein {
	height: 30px;
	padding: 0 10px;
	font-size: 13px;
}
.knopf svg {
	width: 16px;
	height: 16px;
}
.feld {
	width: 100%;
	min-height: 38px;
	padding: 8px 12px;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	background: var(--background);
	outline: none;
	font-size: 16px;
}
.feld:focus {
	border-color: var(--blue);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 20%, transparent);
}
textarea.feld {
	min-height: 140px;
	resize: vertical;
	line-height: 1.45;
}
label.titel,
.vorschau-titel {
	display: block;
	font-weight: 550;
	margin-bottom: 6px;
}
.hinweis {
	color: var(--muted-foreground);
	font-size: 13px;
	margin-top: 4px;
}
.reihe {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}
.reihe > .feld {
	flex: 1;
	min-width: 160px;
}
:focus-visible {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}

/* Schalter */
.schalter-zeile {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 4px 0 12px;
}
.schalter-zeile .text {
	min-width: 0;
}
.schalter {
	position: relative;
	width: 46px;
	height: 28px;
	flex-shrink: 0;
}
.schalter input {
	position: absolute;
	inset: 0;
	opacity: 0;
	margin: 0;
	cursor: pointer;
}
.schalter span {
	position: absolute;
	inset: 0;
	border-radius: 99px;
	background: var(--fill);
	transition: background 150ms ease-out;
	pointer-events: none;
}
.schalter span::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--tertiary);
	box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
	transition: transform 150ms ease-out;
}
.schalter input:checked + span {
	background: var(--green);
}
.schalter input:checked + span::after {
	transform: translateX(18px);
}
.schalter input:focus-visible + span {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}
.zahlen {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	column-gap: 12px;
}
/* Aktion + Dauer: Auswahl-Texte sind länger */
.zahlen.breit {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
/* Titel, Feld und Hinweis stehen in allen Spalten auf einer Höhe, auch wenn ein Titel zwei Zeilen hat */
.zahlen > div {
	display: grid;
	grid-template-rows: subgrid;
	grid-row: span 3;
	align-content: start;
	margin-bottom: 12px;
}
.zahlen > div > label.titel {
	align-self: end;
}
.zahlen > div > .hinweis:empty {
	display: none;
}
.aus {
	opacity: 0.5;
}

/* Fälle */
.fall {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 4px 12px;
	padding: 12px 0;
	border-top: 1px solid var(--border);
	align-items: start;
}
.fall:first-child {
	border-top: 0;
}
.fall-kopf {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
	min-width: 0;
}
.art {
	font-size: 12px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 99px;
	background: var(--fill);
	white-space: nowrap;
}
.art.ban,
.art.kick {
	color: var(--red);
}
.art.timeout,
.art.warn {
	color: var(--orange);
}
.art.entbannt {
	color: var(--green);
}
.fall .wer {
	font: inherit;
	font-weight: 550;
	overflow-wrap: anywhere;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	text-align: left;
	cursor: pointer;
}
.fall .wer:hover {
	text-decoration: underline;
}
.fall-bild {
	display: inline-block;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	flex-shrink: 0;
	object-fit: cover;
}
.leer-bild {
	background: var(--secondary);
}
.fall .grund {
	grid-column: 1 / 3;
	overflow-wrap: anywhere;
	white-space: pre-wrap;
}
.fall .info {
	grid-column: 1 / 3;
	color: var(--muted-foreground);
	font-size: 13px;
	overflow-wrap: anywhere;
}
.leer {
	color: var(--muted-foreground);
	text-align: center;
	padding: 32px 0;
}

/* Vorlagen: Vorschau wie ein Discord-Embed */
.vorlagen {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr));
	gap: 12px;
}
.embed {
	border-left: 4px solid var(--embed, var(--blue));
	background: var(--background);
	border-radius: 4px;
	padding: 10px 12px;
	margin: 10px 0;
	overflow-wrap: anywhere;
}
.embed .e-titel {
	font-weight: 650;
	margin-bottom: 4px;
}
.embed .e-text {
	white-space: pre-wrap;
	font-size: 14px;
	max-height: 220px;
	overflow: auto;
}
.embed .e-feld {
	margin-top: 6px;
	font-size: 14px;
}
.embed .e-feld b {
	display: block;
}
.embed-knopf {
	display: inline-block;
	margin-top: 8px;
	padding: 4px 12px;
	border-radius: 4px;
	background: var(--blue);
	color: white;
	font-size: 13px;
	font-weight: 550;
}

/* Anmeldung */
.mitte {
	min-height: 100dvh;
	display: grid;
	place-items: center;
	padding: 24px 16px;
}
.anmelde-karte {
	width: 100%;
	max-width: 380px;
	text-align: center;
}
.anmelde-karte img {
	border-radius: 16px;
	margin-bottom: 16px;
}
.anmelde-karte .knopf {
	width: 100%;
	height: 44px;
	margin-top: 16px;
}
.fehlertext {
	color: var(--red);
	margin-top: 12px;
}

/* Meldungen (wie sonner) */
#meldung {
	position: fixed;
	left: 50%;
	top: calc(16px + env(safe-area-inset-top));
	transform: translateX(-50%);
	z-index: 50;
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: max-content;
	max-width: calc(100vw - 32px);
}
.toast {
	background: var(--tertiary);
	color: var(--primary);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 10px 14px;
	box-shadow: 0 6px 24px rgb(0 0 0 / 0.14);
	animation: rein 200ms ease-out;
	font-size: 14px;
}
.toast.fehler {
	color: var(--red);
}
@keyframes rein {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
}

/* Dialog */
dialog {
	border: 0;
	border-radius: calc(var(--radius) * 2);
	background: var(--tertiary);
	color: var(--primary);
	padding: 20px;
	width: min(420px, calc(100vw - 32px));
	box-shadow: 0 12px 40px rgb(0 0 0 / 0.25);
}
dialog::backdrop {
	background: rgb(0 0 0 / 0.4);
}
dialog .reihe {
	justify-content: flex-end;
	margin-top: 16px;
}

.speichern-leiste {
	position: sticky;
	bottom: 16px;
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding: 12px;
	background: var(--tertiary);
	border: 1px solid var(--border);
	border-radius: calc(var(--radius) * 1.5);
	box-shadow: 0 6px 24px rgb(0 0 0 / 0.1);
}
@media (max-width: 760px) {
	.speichern-leiste {
		bottom: calc(76px + env(safe-area-inset-bottom));
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}

/* Discord-Vorschau (discord.js, Idee + Farben aus cloudmod). Feste Discord-Farben:
   eine Nachricht sieht in Discord unabhängig vom Dashboard-Theme gleich aus. */
.dc-nachricht {
	background: #313338;
	color: #dbdee1;
	border-radius: var(--radius);
	padding: 14px 16px;
	font-size: 15px;
	line-height: 1.375;
	margin: 10px 0;
	overflow-wrap: anywhere;
}
.dc-zeile {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}
.dc-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	flex-shrink: 0;
	object-fit: cover;
}
.dc-avatar-leer {
	background: linear-gradient(135deg, #ff9797, #6d6aff);
}
.dc-inhalt {
	min-width: 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.dc-kopf {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}
.dc-name {
	color: #f2f3f5;
	font-weight: 500;
}
.dc-app {
	background: #5865f2;
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	padding: 1px 4px;
	border-radius: 3px;
	line-height: 14px;
}
.dc-embed {
	max-width: 520px;
	background: #2b2d31;
	border-left: 4px solid #1e1f22;
	border-radius: 4px;
	padding: 8px 16px 12px 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.dc-embed-oben {
	display: flex;
	gap: 12px;
}
.dc-embed-text {
	min-width: 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.dc-autor {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	color: #f2f3f5;
}
.dc-autor-bild {
	width: 24px;
	height: 24px;
	border-radius: 50%;
}
.dc-titel {
	color: #f2f3f5;
	font-weight: 600;
}
.dc-titel-link {
	color: #00a8fc;
}
.dc-beschreibung {
	font-size: 14px;
}
.dc-thumb {
	width: 80px;
	height: 80px;
	border-radius: 4px;
	object-fit: contain;
	flex-shrink: 0;
}
.dc-bild {
	width: 100%;
	max-height: 300px;
	border-radius: 4px;
	object-fit: cover;
}
.dc-felder {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px 12px;
}
.dc-feld {
	min-width: 0;
}
.dc-feld-breit {
	grid-column: 1 / -1;
}
.dc-feld-name {
	color: #f2f3f5;
	font-weight: 600;
	font-size: 14px;
}
.dc-feld-wert {
	font-size: 14px;
}
.dc-fuss {
	font-size: 12px;
	color: #949ba4;
}
.dc-link {
	color: #00a8fc;
	text-decoration: none;
}
.dc-link:hover {
	text-decoration: underline;
}
.dc-mention {
	background: rgb(88 101 242 / 0.3);
	color: #c9cdfb;
	border-radius: 3px;
	padding: 0 2px;
	font-weight: 500;
}
.dc-code {
	background: #1e1f22;
	border-radius: 3px;
	padding: 1px 4px;
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 0.85em;
}
.dc-pre {
	background: #1e1f22;
	border-radius: 4px;
	padding: 8px;
	margin: 4px 0;
	overflow-x: auto;
	font-size: 0.85em;
}
.dc-spoiler {
	background: #1e1f22;
	color: #1e1f22;
	border-radius: 3px;
	padding: 0 2px;
}
.dc-spoiler:hover {
	color: #dbdee1;
}
.dc-stempel {
	background: rgb(255 255 255 / 0.08);
	border-radius: 3px;
	padding: 0 2px;
}
.dc-zitat {
	border-left: 4px solid #4e5058;
	padding-left: 12px;
	margin: 2px 0;
}
.dc-h1 {
	font-size: 1.5em;
	font-weight: 700;
	margin: 2px 0;
}
.dc-h2 {
	font-size: 1.25em;
	font-weight: 700;
	margin: 2px 0;
}
.dc-h3 {
	font-size: 1.05em;
	font-weight: 700;
	margin: 2px 0;
}
.dc-sub {
	font-size: 0.8em;
	color: #949ba4;
}
.dc-liste {
	margin: 2px 0;
	padding-left: 24px;
}
.dc-leer {
	height: 8px;
}
.dc-knoepfe {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding-top: 4px;
}
.dc-knopf {
	color: #fff;
	border-radius: 4px;
	padding: 4px 14px;
	font-size: 14px;
	font-weight: 500;
}
.dc-k-blau {
	background: #5865f2;
}
.dc-k-grau {
	background: #4e5058;
}
.dc-k-gruen {
	background: #248046;
}
.dc-k-rot {
	background: #da373c;
}
@media (max-width: 480px) {
	.block .dc-nachricht {
		margin-left: -8px;
		margin-right: -8px;
	}
	.dc-nachricht {
		padding: 10px 8px;
		font-size: 14px;
	}
	.dc-zeile {
		gap: 8px;
	}
	.dc-avatar {
		display: none;
	}
	.dc-thumb {
		width: 48px;
		height: 48px;
	}
	.dc-embed {
		padding: 8px 8px 10px;
	}
	.dc-felder {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
.vorschau-titel {
	margin-top: 16px;
}
.kanal-feld {
	margin-bottom: 12px;
}
.block .reihe .knopf.zweit {
	background: var(--background);
}

/* Link-Schutz: Domainliste, Trennlinie zwischen zwei Schaltern */
textarea.klein-feld {
	min-height: 76px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 13px;
}
.trenner {
	border-top: 1px solid var(--border);
	margin: 16px 0 12px;
}
.versteckt {
	display: none !important;
}
.anmelde-karte h1 {
	margin-bottom: 8px;
}
a.knopf {
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

textarea.mittel-feld {
	min-height: 76px;
}

/* Knöpfe unter der Begrüßung: Text + Kanal */
.knopf-hinweis {
	margin: 0 0 8px;
}
.knopf-reihe {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 8px;
	margin-bottom: 8px;
}
@media (max-width: 480px) {
	.knopf-reihe {
		grid-template-columns: 1fr;
		padding-bottom: 8px;
		border-bottom: 1px solid var(--border);
	}
}

/* Seitenleiste: „Mehr“ nur am Handy, am PC stehen alle Reiter untereinander */
.neben {
	display: contents;
}
.nav.mehr {
	display: none;
	border: 0;
	background: none;
	font-family: inherit;
	cursor: pointer;
}
@media (max-width: 760px) {
	.nav.mehr {
		display: flex;
	}
	.neben {
		display: none;
		position: fixed;
		right: 8px;
		bottom: calc(68px + env(safe-area-inset-bottom));
		min-width: 220px;
		flex-direction: column;
		gap: 2px;
		padding: 6px;
		background: var(--background);
		border: 1px solid var(--border);
		border-radius: 14px;
		box-shadow: 0 8px 28px rgb(0 0 0 / 0.18);
	}
	.leiste.offen .neben {
		display: flex;
	}
	.neben .nav {
		flex-direction: row;
		gap: 10px;
		font-size: 15px;
		padding: 10px 12px;
		justify-content: flex-start;
	}
}

/* Changelog */
.cl-raster {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
	gap: 12px;
	align-items: start;
}
.cl-vorschau {
	position: sticky;
	top: 16px;
}
.cl-liste {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 12px;
}
.cl-eintrag {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 10px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}
.cl-kopf {
	display: grid;
	grid-template-columns: 150px 76px minmax(0, 1fr) auto;
	gap: 6px;
	align-items: center;
}
@media (max-width: 480px) {
	.cl-kopf {
		grid-template-columns: minmax(0, 1fr) 76px auto;
	}
	.cl-kopf .cl-titel {
		grid-column: 1 / -1;
		grid-row: 2;
	}
}
@media (max-width: 900px) {
	.cl-vorschau {
		position: static;
	}
}

/* Changelog importieren */
dialog.import-fenster {
	width: min(560px, calc(100vw - 32px));
}
dialog.import-fenster h2 {
	margin: 0 0 6px;
}
.import-feld {
	width: 100%;
	min-height: 220px;
	max-height: 50vh;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 13px;
	resize: vertical;
}
.fehler-text {
	color: var(--red);
}
.fehler-text:empty {
	display: none;
}
