/* Local fonts: Nunito + Font Awesome (lokal) */
@font-face {
	font-family: 'Nunito';
	src: url('../fonts/Nunito-Regular.woff2') format('woff2'),
		url('../fonts/Nunito-Regular.woff') format('woff'),
		url('../fonts/Nunito-Regular.ttf') format('truetype');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* Font Awesome (minimal: only font-face declarations; icons via classes) */
@font-face {
	font-family: 'Font Awesome 6 Free';
	font-style: normal;
	font-weight: 400;
	src: url('../fonts/fontawesome/fa-regular-400.woff2') format('woff2'),
		url('../fonts/fontawesome/fa-regular-400.ttf') format('truetype');
	font-display: swap;
}

@font-face {
	font-family: 'Font Awesome 6 Free';
	font-style: normal;
	font-weight: 900;
	src: url('../fonts/fontawesome/fa-solid-900.woff2') format('woff2'),
		url('../fonts/fontawesome/fa-solid-900.ttf') format('truetype');
	font-display: swap;
}

@font-face {
	font-family: 'Font Awesome Brands';
	font-style: normal;
	font-weight: 400;
	src: url('../fonts/fontawesome/fa-brands-400.woff2') format('woff2'),
		url('../fonts/fontawesome/fa-brands-400.ttf') format('truetype');
	font-display: swap;
}

:root {
	--series-kpi-1: #1f6bff;
	--series-kpi-2: #3bffb0;
	--series-kpi-3: #ff8a00;
	--series-kpi-4: #7f5af0;
	--series-kpi-5: #e54848;
	--series-kpi-6: #0ea5a4;
}

/* Minimal Font Awesome helpers (lokal, ohne externes CSS) */
.fa,
.fas,
.far,
.fab {
	font-style: normal;
	display: inline-block;
	font-variant: normal;
	text-rendering: auto;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.fa,
.fas,
.fa-solid {
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
}

.far,
.fa-regular {
	font-family: 'Font Awesome 6 Free';
	font-weight: 400;
}

.fab,
.fa-brands {
	font-family: 'Font Awesome Brands';
	font-weight: 400;
}

/* Icon mappings (nur die benötigten) */
.fa-phone::before {
	content: "\f095";
}

.fa-envelope::before {
	content: "\f0e0";
}

.fa-whatsapp::before {
	content: "\f232";
}

.fa-pen-to-square::before {
	content: "\f044";
}

.fa-trash::before {
	content: "\f1f8";
}

.fa-calendar-check::before {
	content: "\f274";
}

.fa-times::before {
	content: "\f00d";
}

.fa-xmark::before {
	content: "\f00d";
}

/* Zusätzliche Icons, die im UI verwendet werden */
.fa-lock::before {
	content: "\f023";
}

.fa-unlock::before {
	content: "\f09c";
}

.fa-object-group::before {
	content: "\f247";
}

.fa-download::before {
	content: "\f019";
}

.fa-info-circle::before {
	content: "\f05a";
}

.fa-bell::before {
	content: "\f0f3";
}

.fa-check::before {
	content: "\f00c";
}

/* Ende Fonts (weiter unten folgt der bestehende style.css Inhalt) */
/* WellBlue CRM - style.css */
:root {
	/* Typography */
	--font-family: 'Nunito', Arial, Helvetica, sans-serif;
	--font-size: 15px;
	--line-height: 1.7;

	/* Colours */
	--color-primary: #003973;
	--color-primary-600: #004a99;
	--color-primary-700: #003060;
	--color-bg: #0f172a;
	--color-surface: #0b1220;
	--color-surface-2: #111a2e;
	--color-border: #1f2a44;
	--color-text: #e5e7eb;
	--color-muted: #a1a7b3;
	--color-success: #10b981;
	--color-warning: #f59e0b;
	--color-danger: #ef4444;

	/* Layout */
	--radius: 10px;
	--shadow-1: 0 1px 2px rgba(0, 0, 0, .2), 0 4px 12px rgba(0, 0, 0, .3);
	--shadow-2: 0 8px 30px rgba(0, 0, 0, .35);
	--space-1: .25rem;
	--space-2: .5rem;
	--space-3: .75rem;
	--space-4: 1rem;
	--space-5: 1.5rem;
	--space-6: 2rem;
	--sidebar-w: 260px;
	--header-h: 60px;
	--gradient-primary: linear-gradient(135deg, #003973 0%, #2b6bb0 100%);

	/* Aliases */
	--primary: var(--color-primary);
	--primary-600: var(--color-primary-600);
	--primary-700: var(--color-primary-700);
	--surface: var(--color-surface);
	--surface-2: var(--color-surface-2);
	--border: var(--color-border);
	--text: var(--color-text);
	--muted: var(--color-muted);
	--success: var(--color-success);
	--warning: var(--color-warning);
	--danger: var(--color-danger);
	--outline-color: #7ab8ff;

	/* Container widths */
	--container-max-width-sm: 85vw;
	--container-max-width-md: 70vw;
	--container-max-width-lg: 1100px;
	/* Einheitliche Höhe für Topbar-Controls (Suche, User-Toggle) */
	--topbar-control-h: 40px;
}

/* Reset & base */
*,
*::before,
*::after {
	box-sizing: border-box
}

/* Entfernt feste Höhe: Dokument soll natürlich wachsen können */
/* html, body { height: 100%; } */

html {
	scroll-behavior: smooth;
	scroll-padding-top: var(--header-h);
}

body {
	margin: 0;
	font-family: var(--font-family);
	font-size: var(--font-size);
	line-height: var(--line-height);
	color: var(--color-text);
	background:
		radial-gradient(1200px 800px at 0 -200px, rgba(0, 57, 115, .25), transparent 60%),
		radial-gradient(1000px 600px at 100% -150px, rgba(0, 57, 115, .20), transparent 60%),
		linear-gradient(180deg, #0e1323 0%, #0a0f1d 100%);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	/* Unter 320px Viewport Breite nicht weiter schrumpfen → horizontal scrollen */
	min-width: 320px;
}

img {
	max-width: 100%;
	height: auto
}

a {
	color: #7ab8ff;
	text-decoration: none
}

a:hover {
	text-decoration: underline
}

/* Focus styles */
:focus {
	outline: none;
}

/* Globale 2px-Outline für :focus-visible entfernt –
   Fokus-Hervorhebungen werden gezielt je Komponente/Control gesetzt */

.nav-link:focus-visible,
.btn:focus-visible,
.icon-btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	box-shadow: 0 0 0 3px rgba(122, 184, 255, .2);
}

/* Utilities */
.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 var(--space-5)
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0
}

/* Skip-Link sichtbar bei Fokus (A11y) */
#skip-to-content {
	position: absolute;
	left: -9999px;
	top: auto;
}

#skip-to-content:focus {
	left: 8px;
	top: 8px;
	background: #ffffff;
	color: #000000;
	padding: .5rem .75rem;
	border-radius: 6px;
	z-index: 100;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}

.hidden {
	display: none !important
}

.text-muted {
	color: var(--color-muted)
}

.mt-4 {
	margin-top: var(--space-4)
}

.mb-4 {
	margin-bottom: var(--space-4)
}

.p-4 {
	padding: var(--space-4)
}

.gap-4 {
	gap: var(--space-4)
}

.grid {
	display: grid
}

.grid-2 {
	grid-template-columns: repeat(2, 1fr)
}

.grid-3 {
	grid-template-columns: repeat(3, 1fr)
}

@media (max-width: 900px) {

	.grid-2,
	.grid-3 {
		grid-template-columns: 1fr
	}
}

/* App layout */
.app {
	display: grid;
	grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
	grid-template-rows: var(--header-h) 1fr auto;
	grid-template-areas:
		"header header"
		"sidebar main"
		"footer  footer";
	min-height: 100vh;
}

header.topbar {
	grid-area: header;
	height: var(--header-h);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 var(--space-5);
	background: linear-gradient(180deg, rgba(0, 0, 0, .25), rgba(0, 0, 0, 0)), var(--gradient-primary);
	box-shadow: var(--shadow-1);
	position: sticky;
	top: 0;
	z-index: 20;
}

.brand {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	font-weight: 700;
	letter-spacing: .2px
}

.brand-title {
	font-weight: 700;
}

.brand-subtitle {
	font-size: .8rem;
}

.brand-link {
	color: var(--color-text);
	text-decoration: none;
	font-weight: 700;
	letter-spacing: .2px;
}

.brand-link:hover {
	text-decoration: none;
}

.topbar-actions {
	display: flex;
	align-items: center;
	gap: var(--space-3)
}

.topbar-utility {
	display: flex;
	align-items: center;
	gap: var(--space-2);
}

.notification-bell {
	position: relative;
	text-decoration: none;
}

.notification-bell:hover,
.notification-bell:focus,
.notification-bell:focus-visible {
	text-decoration: none;
}

.notification-badge {
	position: absolute;
	top: -6px;
	right: -6px;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 999px;
	background: #e3342f;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	box-shadow: 0 0 0 2px rgba(0, 57, 115, .45);
}

/* Header-Suche */
.topbar-search {
	position: relative;
}

.topbar-search .search-input {
	width: 320px;
	max-width: 50vw;
	height: var(--topbar-control-h);
	line-height: calc(var(--topbar-control-h) - 2px);
	/* minus border */
	padding: 0 .75rem;
	border-radius: 999px;
	/* identisch zur .user-toggle */
	border: 1px solid rgba(255, 255, 255, .12);
	background: rgba(255, 255, 255, .06);
	color: var(--color-text);
}

.topbar-search .search-input::placeholder {
	color: var(--color-muted);
}

.topbar-search .suggestions {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 8px;
	box-shadow: var(--shadow-2);
	list-style: none;
	margin: 0;
	padding: 6px 0;
	max-height: 50vh;
	overflow: auto;
	z-index: 60;
}

.topbar-search .suggestions[hidden] {
	display: none;
}

/* Mobile: Header dreispaltig – [Burger] [Suche zentriert] [User rechts] */
@media (max-width: 540px) {

	header.topbar {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr) auto;
		align-items: center;
		column-gap: var(--space-2);
		padding: 0 var(--space-4);
	}

	.brand {
		grid-column: 1;
	}

	/* Kinder von .topbar-actions direkt in das Grid heben */
	.topbar-actions {
		display: contents;
	}

	.topbar-search {
		grid-column: 2;
		justify-self: center;
		position: relative;
		min-width: 0;
	}

	.topbar-search .search-input {
		width: 100%;
		max-width: 320px;
		min-width: 0;
	}

	.topbar-actions .topbar-utility,
	.topbar-actions .user-menu,
	.topbar-actions .guest-actions {
		grid-column: 3;
		justify-self: end;
	}

	.user-menu {
		min-width: 0;
	}

	.user-toggle {
		min-width: 0;
	}

	.user-toggle .name {
		display: none;
	}
}

@media (max-width: 1024px) {
	.user-toggle .name {
		display: none;
	}
}

.topbar-search .suggestions:empty {
	display: none;
}

.topbar-search .suggestions li {
	padding: 6px 10px;
}

.topbar-search .suggestions__status {
	padding: 6px 10px;
	display: flex;
	align-items: center;
	gap: .4rem;
	font-size: .9rem;
	color: var(--color-muted);
}

.topbar-search .suggestions__status--loading::before {
	content: '';
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .2);
	border-top-color: var(--color-primary);
	animation: spin .9s linear infinite;
}

.topbar-search .suggestions__status--error {
	color: var(--color-danger);
}

.topbar-search .suggestions li a {
	display: block;
	color: var(--color-text);
	text-decoration: none;
}

.topbar-search .suggestion-title {
	display: block;
	font-weight: 600;
}

.topbar-search .suggestion-context {
	display: block;
	font-size: .85rem;
	color: var(--color-muted);
	margin-top: 2px;
}

.topbar-search .suggestions li a:hover {
	background: rgba(255, 255, 255, .06);
}

.topbar-search .hl {
	background: rgba(122, 184, 255, .25);
	border-radius: 4px;
}

/* User Menu / Profil-Dropdown */
.user-menu {
	position: relative;
}

.user-toggle {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .35rem .6rem;
	min-height: var(--topbar-control-h);
	border-radius: 999px;
	background: rgba(255, 255, 255, .06);
	border: 1px solid rgba(255, 255, 255, .12);
	color: var(--color-text);
	cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease;
}

.user-toggle:hover {
	background: rgba(255, 255, 255, .12);
	border-color: rgba(255, 255, 255, .18);
}

.user-toggle[aria-expanded="true"] {
	background: rgba(255, 255, 255, .15);
	border-color: rgba(255, 255, 255, .25);
}

.user-toggle .avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #1f2a44;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: .9rem;
	overflow: hidden;
}

.user-toggle .avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.user-toggle .name {
	font-weight: 600;
	max-width: 180px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dropdown-arrow {
	font-size: .7rem;
	opacity: .7;
	transition: transform .2s ease;
}

.user-toggle[aria-expanded="true"] .dropdown-arrow {
	transform: rotate(180deg);
}

.user-dropdown {
	position: fixed;
	top: 0;
	left: 0;
	transform: none;
	min-width: 220px;
	max-width: calc(100vw - 12px);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-2);
	padding: .5rem 0;
	z-index: 50;
}

.user-dropdown[hidden] {
	display: none;
}

.user-dropdown__info {
	padding: .75rem 1rem;
	color: var(--color-text);
	font-size: .9rem;
}

.user-dropdown__email {
	margin-top: 2px;
	font-size: .9em;
	opacity: .8;
}

/* Installer / readonly fields */
.readonly {
	width: 100%;
	box-sizing: border-box;
}

.user-dropdown__divider {
	margin: .5rem 0;
	border: none;
	border-top: 1px solid var(--color-border);
}

.user-dropdown__item {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .75rem 1rem;
	color: var(--color-text);
	text-decoration: none;
	transition: background-color .2s ease;
	font-size: .9rem;
}

.user-dropdown__item:hover {
	background: rgba(255, 255, 255, .06);
	text-decoration: none;
}

.user-dropdown__item .icon {
	font-size: 1rem;
	opacity: .8;
}

nav.sidebar {
	grid-area: sidebar;
	position: sticky;
	top: var(--header-h);
	height: auto;
	max-height: calc(100vh - var(--header-h));
	overflow-y: auto;
	background: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, .0) 160px), #0a0f1d;
	border-right: 1px solid var(--color-border);
	padding: var(--space-5) var(--space-4);
	display: flex;
	flex-direction: column;
	gap: var(--space-4)
}

/* Close-Icon standardmäßig ausblenden (nur mobil sichtbar) */
nav.sidebar .sidebar-close {
	display: none;
}

.sidebar .nav-title {
	font-size: .8rem;
	color: var(--color-muted);
	text-transform: uppercase;
	letter-spacing: .08em;
	margin: var(--space-2) 0
}


.nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px
}

.nav-link {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .6rem .8rem;
	border-radius: 8px;
	color: var(--color-text);
	border: 1px solid transparent;
	transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.nav-link .icon {
	width: 1.1rem;
	height: 1.1rem;
	display: inline-block;
	border-radius: 4px;
	background: linear-gradient(135deg, #133157, #244e83)
}

.nav-link:hover {
	background: rgba(255, 255, 255, .06);
	border-color: rgba(255, 255, 255, .08);
	text-decoration: none
}

.nav-link.active,
.nav-link[aria-current="page"] {
	background: rgba(0, 57, 115, .25);
	border-color: #1b4b86;
	box-shadow: inset 0 0 0 1px rgba(122, 184, 255, .18), 0 6px 20px rgba(0, 57, 115, .18)
}

main.content {
	grid-area: main;
	padding: var(--space-5);
	min-width: 0;
	/* Kein hartes X-Hide: horizontales Scrollen bleibt möglich, falls Viewport < min Breite */
	overflow-x: visible;
}

.content .page-title {
	font-size: 1.35rem;
	font-weight: 700;
	margin: 0 0 var(--space-4)
}

/* Page Header (Listenüberschriften + Actions) */
.page-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	flex-wrap: wrap;
}

.page-header__actions {
	display: flex;
	gap: var(--space-2);
	flex-wrap: wrap;
	align-items: center;
}

.page-header__subtitle {
	margin: 4px 0 0 0;
	color: var(--color-muted);
}

/* Toolbar (Filter/Suche oberhalb der Tabelle) */
.toolbar {
	margin-top: var(--space-3);
	display: flex;
	gap: var(--space-3);
	flex-wrap: wrap;
	align-items: center;
}

/* Tabellen-Wrapper für horizontales Scrollen bei schmalen Screens */
.table-wrap {
	margin-top: 10px;
	overflow-x: auto;
	overflow-y: hidden;
	width: 100%;
	max-width: 100%;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-inline: contain;
}

/* Helferklassen */
.nowrap {
	white-space: nowrap;
}

/* Transaktions-Aktionen (Icons) an den rechten Rand ausrichten */
.tx-actions {
	display: flex;
	gap: 6px;
	justify-content: flex-end;
	width: 100%;
}

.text-sm {
	font-size: 12px;
}

.subtext {
	font-size: 12px;
	color: var(--color-muted);
}

.mt-3 {
	margin-top: var(--space-3);
}

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	padding: .6rem .9rem;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, .12);
	background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0));
	color: var(--color-text);
	cursor: pointer;
	box-shadow: var(--shadow-1);
	transition: transform .12s ease, background-color .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.btn:hover {
	transform: translateY(-1px)
}

.btn:active {
	transform: translateY(0)
}

.btn-primary {
	background: var(--gradient-primary);
	border-color: #1b4b86;
	color: white
}

.btn-ghost {
	background: transparent;
	border-color: rgba(255, 255, 255, .15)
}

.btn-danger {
	background: linear-gradient(135deg, #9b1c1c, #ef4444);
	border-color: #c52c2c;
	color: white
}

/* Cards */
.card {
	background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0));
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-1);
	padding: var(--space-5)
}

.card.has-badge {
	position: relative;
}

.reserve-badge {
	position: absolute;
	top: 15px;
	right: 10px;
	background: rgba(239, 68, 68, 0.18);
	/* dezent rot */
	border: 1px solid rgba(239, 68, 68, 0.35);
	color: var(--color-text);
	padding: 3px 8px;
	border-radius: 999px;
	font-size: 12px;
	line-height: 1.3;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.reserve-badge .fa-lock {
	color: #ff9a9a;
	font-size: 12px;
}

.card+.card {
	margin-top: var(--space-4)
}

.card-title {
	margin: 0 0 var(--space-3);
	font-weight: 700
}

/* Contact Show Layout (Flex-based two columns) */
.contact-grid {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	flex-wrap: wrap;
}

.contact-left,
.left-column {
	flex: 1 1 380px;
	min-width: 360px;
}

.left-column {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
}

.contact-right {
	flex: 1 1 520px;
	min-width: 460px;
}

/* Wichtige Guards gegen Überlauf aus Spalteninhalten */
.contact-grid>* {
	min-width: 0;
}

.contact-grid .card {
	max-width: 100%;
	overflow: hidden;
}

/* Früherer, stabiler Stack: zwei Spalten werden untereinander erst ab ≤1285px */
@media (max-width: 1285px) {

	.contact-left,
	.left-column,
	.contact-right {
		min-width: 100%;
		flex-basis: 100%;
	}
}

/* Ausnahme: Wenn die Sidebar eingeklappt ist, soll bei gleicher Viewportbreite
   die zweispaltige Kontaktansicht beibehalten werden. Dafür die obige
   Einspalten-Regel gezielt überschreiben. */
@media (max-width: 1285px) {

	.app.app--sidebar-collapsed .contact-left,
	.app.app--sidebar-collapsed .left-column {
		/* zurück zu den Basiswerten */
		min-width: 360px;
		flex-basis: 380px;
	}

	.app.app--sidebar-collapsed .contact-right {
		min-width: 460px;
		flex-basis: 520px;
	}
}

.toolbar {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	align-items: center;
}

.note-actions {
	margin-bottom: 12px;
}

.contact-actions {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	align-items: center;
}

.contact-actions--top {
	margin-bottom: 16px;
}

.contact-actions--middle {
	margin-bottom: 20px;
}

.contact-actions__item {
	display: flex;
	align-items: center;
	gap: 12px;
}


.contact-actions__item--category,
.contact-actions__item--quicknote {
	justify-content: flex-end;
}

.contact-actions__item--followup .crm-inline-form {
	flex-wrap: nowrap;
}

.contact-actions__item--followup .crm-inline-form .input-compact,
.contact-actions__item--followup .crm-inline-form input[type="datetime-local"] {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
}

.contact-actions__item--followup .crm-inline-form .icon-btn {
	flex: 0 0 auto;
}

.contact-actions__item--quicknote select {
	max-width: 280px;
}

@media (max-width: 760px) {
	.contact-actions {
		grid-template-columns: 1fr;
	}

	.contact-actions__item,
	.contact-actions__item--category,
	.contact-actions__item--quicknote {
		justify-content: flex-start;
	}

	.contact-actions__item--score {
		justify-content: center;
	}

	.contact-actions__item--score .star-rating {
		margin: 0 auto;
		justify-content: center;
	}

	.contact-actions__item form {
		width: 100%;
	}

	.contact-actions__item--quicknote select {
		max-width: none;
		width: 100%;
	}
}

.note-actions-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 8px;
}

.note-actions-row .crm-form-actions {
	margin-top: 0;
}

.note-actions-row #note-type-buttons {
	padding: 0;
	gap: 8px;
}

.note-actions-row .toolbar {
	margin-top: 0;
}

/* Mentions */
.crm-field--mention {
	position: relative;
}

.crm-field--mention textarea {
	position: relative;
	z-index: 2;
	background: transparent;
	font-family: var(--font-family);
	font-size: var(--font-size);
	font-weight: 400;
	letter-spacing: normal;
	color: transparent;
	caret-color: var(--color-text);
}

.crm-field--mention textarea::placeholder {
	color: var(--color-muted);
}

.mention-highlights {
	position: absolute;
	inset: 0;
	z-index: 1;
	padding: .6rem .9rem;
	border-radius: 8px;
	background: #0f172a;
	color: var(--color-text);
	font-family: var(--font-family);
	font-size: var(--font-size);
	font-weight: 400;
	letter-spacing: normal;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow: hidden;
	box-sizing: border-box;
	pointer-events: none;
	line-height: 1.2;
}

.mention-suggestions {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 10px;
	box-shadow: var(--shadow-2);
	list-style: none;
	margin: 0;
	padding: 6px 0;
	max-height: 240px;
	overflow: auto;
	z-index: 30;
}

.mention-suggestions[hidden] {
	display: none;
}

.mention-suggestion {
	padding: 0 8px;
}

.mention-suggestion__btn {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--color-text);
	cursor: pointer;
	text-align: left;
}

.mention-suggestion.is-active .mention-suggestion__btn,
.mention-suggestion__btn:hover {
	background: rgba(255, 255, 255, .08);
}

.mention-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #1f2a44;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: .85rem;
}

.mention-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}

.mention-label {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.mention-name {
	font-weight: 600;
}

.mention-username {
	font-size: .78rem;
	color: var(--color-muted);
}

.mention-status {
	padding: 8px 12px;
	font-size: .9rem;
	color: var(--color-muted);
}

.mention-status--error {
	color: var(--color-danger);
}

.mention-suggestions .hl {
	background: rgba(122, 184, 255, .25);
	border-radius: 4px;
	padding: 0 2px;
}

.mention-pill {
	display: inline;
	padding: 0;
	border-radius: 4px;
	background: rgba(0, 57, 115, .2);
	box-shadow: inset 0 0 0 1px #002a55;
	color: var(--color-text);
	font-weight: 600;
	box-decoration-break: clone;
}

.mention-highlights .mention-pill {
	background: none;
	box-shadow: none;
	color: #9cc7ff;
	font-weight: 600;
}

.note-actions-row .icon-btn {
	width: 42px;
	height: 42px;
}

.input-compact {
	width: 220px;
	max-width: 100%;
}

.contact-grid .card+.card {
	margin-top: 0;
}

/* Kontakt-Metadaten: max. zwei Felder pro Zeile, gleichmäßig verteilt.
   Auf schmalen Breiten (< ~560px) untereinander. */
.meta {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.meta .full-row {
	grid-column: 1 / -1;
}

@media (max-width: 560px) {
	.meta {
		grid-template-columns: 1fr;
	}
}

.meta>div {
	background: rgba(255, 255, 255, .04);
	border: 1px solid var(--color-border);
	padding: 10px;
	border-radius: 8px;
}

.field label {
	display: block;
	font-size: 12px;
	color: #cbd5e1;
	margin-bottom: 4px;
}

.field .val {
	font-weight: 600;
	color: #fff;
}

/* Kontakt-Übersicht (Show): Werte nicht fett darstellen */
.contact-grid .field .val {
	font-weight: 400;
}

/* Kontakt-Übersicht: Lange Werte einkürzen (einzeilig, Ellipsis) */
.meta .val {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100%;
}

/* Page Header (Kontakt) */
.page-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.page-header__left,
.page-header__actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.page-title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
}

.page-header .page-title {
	margin: 0;
}

@media (max-width: 640px) {
	.page-header {
		justify-content: flex-start;
		align-items: center;
	}
}

.card-actions {
	margin-top: 10px;
}

/* Callcenter elements */
.cc-icon {
	font-size: 4.5em;
	line-height: 1;
}

.crm-inline-form {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.crm-inline-form .input-compact,
.crm-inline-form select,
.crm-inline-form input[type="datetime-local"] {
	flex: 1 1 220px;
	min-width: 0;
}

.crm-inline-form .crm-btn,
.crm-inline-form .icon-btn {
	flex: 0 0 auto;
}

/* Kontaktseite (Show): Mobile-Zentrierung für Wiedervorlage und Kategorie */
@media (max-width: 760px) {
	/* Kategorie-Select auf volle Breite bringen */
	.contact-right #category-form select {
		width: 100%;
	}

	/* Wiedervorlage: Eingabefeld soll flexibel die Breite füllen */
	.contact-right #followup-form .input-compact {
		flex: 1 1 auto;
		width: auto;
		/* überschreibt die Basisbreite 220px */
		min-width: 0;
	}
}

/* Callcenter Index (moved from inline CSS) */
.cc-container {
	max-width: 1100px;
	margin: 0 auto;
	padding: 12px;
}

.cc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.cc-title {
	margin: 0;
}

.cc-subtitle {
	margin: 4px 0 0;
	color: #cbd5e1;
	font-size: 14px;
}

.cc-card {
	margin-top: 16px;
	background: #fff;
	color: #111827;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 16px;
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 16px;
}

@media (max-width: 900px) {
	.cc-card {
		grid-template-columns: 1fr;
	}
}

.cc-empty {
	/* Dunkles Theme, passend zur App */
	border: 1px solid var(--color-border);
	background:
		radial-gradient(800px 400px at 50% -120px, rgba(0, 57, 115, .22), transparent 60%),
		linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, 0));
	border-radius: 14px;
	padding: 36px 28px;
	min-height: 220px;
	text-align: center;
	color: var(--color-text);
	box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}

.cc-celebrate {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.cc-celebrate .icon,
.cc-icon {
	line-height: 1;
	animation: cc-bounce 2.2s ease-in-out infinite;
	font-size: 4.5em;
}

@keyframes cc-bounce {

	0%,
	100% {
		transform: translateY(0)
	}

	50% {
		transform: translateY(-4px)
	}
}

.cc-celebrate h2 {
	margin: 0;
	font-size: 26px;
	font-weight: 800;
	/* Heller Verlauf: Weiß → hellblau → Primärblau */
	background: linear-gradient(135deg, #ffffff 0%, #cfe8ff 38%, #0ea5e9 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.cc-celebrate p {
	margin: 0;
	font-size: 15px;
}

.cc-celebrate .cta {
	display: flex;
	gap: 10px;
	margin-top: 8px;
	flex-wrap: wrap;
	justify-content: center;
}

.cc-actions {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	align-items: center;
}

.cc-actions--mt {
	margin-top: 12px;
}

.cc-countdown {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #003973 0%, #1b5fa6 100%);
	color: #fff;
	border-radius: 12px;
	padding: 18px;
	text-align: center;
}

.cc-countdown .value {
	font-variant-numeric: tabular-nums;
	font-size: 44px;
	line-height: 1;
	font-weight: 700;
	letter-spacing: 1px;
}

.cc-countdown .label {
	font-size: 13px;
	opacity: .9;
	margin-top: 6px;
	display: block;
}

.cc-sticky-actions {
	position: sticky;
	bottom: 0;
	background: #fff;
	border-top: 1px solid #e5e7eb;
	padding: 12px;
	border-bottom-left-radius: 12px;
	border-bottom-right-radius: 12px;
}

@media (max-width: 720px) {
	.cc-sticky-actions .cc-actions {
		position: fixed;
		left: 12px;
		right: 12px;
		bottom: 12px;
		background: #ffffff;
		border: 1px solid #e5e7eb;
		border-radius: 12px;
		padding: 10px;
		box-shadow: 0 6px 30px rgba(0, 0, 0, .12);
		justify-content: center;
		z-index: 40;
	}

	.cc-sticky-actions .hint {
		padding-bottom: 64px;
	}
}

.crm-btn-cta {
	font-size: 18px;
	padding: 12px 16px;
}

.crm-btn-success {
	background: #166534;
	color: #fff;
}

.crm-btn-warning {
	background: #92400e;
	color: #fff;
}

.crm-btn-danger {
	background: #7f1d1d;
	color: #fff;
}



.cc-meta {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	font-size: 14px;
	margin-top: 12px;
}

.cc-meta div {
	background: #f8fafc;
	border: 1px solid #e5e7eb;
	padding: 8px 10px;
	border-radius: 8px;
}

.cc-field label {
	display: block;
	font-size: 12px;
	color: #6b7280;
	margin-bottom: 4px;
}

.cc-field .val {
	font-weight: 600;
	color: #111827;
}

.cc-shortcuts {
	color: #475569;
	font-size: 13px;
	margin-top: 12px;
}

.cc-shortcuts kbd {
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	border-bottom-width: 2px;
	border-radius: 6px;
	padding: 2px 6px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Small utility classes used by Callcenter */
.cc-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.cc-between {
	justify-content: space-between;
}

.cc-no-margin {
	margin: 0;
}

.cc-subline {
	color: #475569;
	margin-top: 2px;
}

.ml-6 {
	margin-left: 6px;
}

.w-100 {
	width: 100%;
}

.cc-hint {
	margin-top: 8px;
	font-size: 12px;
	color: #6b7280;
}

/* Small utilities */
.mt-8 {
	margin-top: 8px;
}

.crm-input-full {
	width: 100%;
}

/* Note Widget */
.crm-note-widget {
	display: block;
}

.crm-note-widget-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.crm-note-widget-title {
	font-weight: 600;
}

.crm-note-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.crm-note-item {
	background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0));
	border: 1px solid var(--color-border);
	border-radius: 8px;
	padding: 10px;
	width: 100%;
	min-width: 0;
}

.crm-note-item__meta {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	flex-wrap: wrap;
}

.crm-note-item__meta-left {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.crm-note-avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #1f2a44;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 12px;
	color: #fff;
	flex: 0 0 auto;
	overflow: hidden;
}

.crm-note-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.crm-note-item__author {
	font-weight: 600;
	min-width: 0;
}

.crm-note-item__time {
	color: var(--color-muted);
	font-size: 12px;
}

.crm-note-item__text {
	margin: 6px 0 8px 0;
	line-height: 1.5;
	white-space: normal;
	max-width: 100%;
}

.crm-note-edit-textarea {
	width: 100%;
	max-width: 100%;
}

.crm-note-edit-actions {
	display: flex;
	gap: 6px;
	justify-content: flex-end;
}

.crm-note-item__text,
.crm-note-item__text a {
	/* Lange, zusammenhängende Strings (URLs etc.) umbrechen */
	overflow-wrap: anywhere;
	/* moderne Browser */
	word-wrap: break-word;
	/* Legacy Alias */
	word-break: break-word;
	/* Safari/Edge Fallback */
}

/* Mentions in Notizen: hellblau, ohne Hintergrund */
.crm-note-item__text .mention-pill {
	background: none;
	box-shadow: none;
	color: #9cc7ff;
	font-weight: 600;
}

/* Links im Notiztext: weiß und unterstrichen (nur hier) */
.crm-note-item__text a,
.crm-note-item__text a:visited {
    color: var(--color-text);
    text-decoration: underline;
}
.crm-note-item__text a:hover,
.crm-note-item__text a:focus {
    color: var(--color-text);
    text-decoration: underline;
}

.crm-note-item__contact {
	font-size: 13px;
	color: var(--color-text);
	opacity: .9;
}

.crm-note-sentinel {
	height: 1px;
}

.crm-empty {
	color: var(--color-muted);
}

/* Small button variant for widget header */
.crm-btn-sm {
	padding: .35rem .55rem;
	min-height: 30px;
	font-size: .9rem;
}

/* Danger variant for crm-btn */
.crm-btn-danger {
	background: linear-gradient(135deg, #9b1c1c, #ef4444);
	border-color: #c52c2c;
	color: #fff;
}

/* Badges */
.badge {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .25rem .5rem;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, .15);
	font-size: .8rem
}

.badge.success {
	background: rgba(16, 185, 129, .15);
	border-color: rgba(16, 185, 129, .35)
}

.badge.warn {
	background: rgba(245, 158, 11, .15);
	border-color: rgba(245, 158, 11, .35)
}

.badge.danger {
	background: rgba(239, 68, 68, .15);
	border-color: rgba(239, 68, 68, .35)
}

/* Alerts (Flash messages) */
.alert {
	padding: .75rem 1rem;
	border-radius: 10px;
	margin: .5rem 0;
	border: 1px solid;
	display: flex;
	align-items: flex-start;
	gap: .75rem
}

.alert .close {
	margin-left: auto;
	background: transparent;
	border: 0;
	color: inherit;
	cursor: pointer
}

.alert.info {
	background: rgba(122, 184, 255, .12);
	border-color: #2c65a8;
	color: #cfe3ff
}

.alert.success {
	background: rgba(16, 185, 129, .12);
	border-color: #1f8f69;
	color: #c5f3e3
}

.alert.warn {
	background: rgba(245, 158, 11, .12);
	border-color: #a86a0d;
	color: #fdecc8
}

.alert.error {
	background: rgba(239, 68, 68, .12);
	border-color: #a83232;
	color: #ffd0d0
}

/* Callcenter: Aktive Logik (Systemeinstellungen) */
.crm-callcenter-logic {
	flex: 1;
	min-width: 0;
}

.crm-callcenter-logic__title {
	margin: 0 0 .25rem;
	font-size: 1rem;
	font-weight: 700;
	color: inherit
}

.crm-callcenter-logic__intro {
	margin: 0 0 .6rem;
	color: inherit
}

.crm-callcenter-logic__h {
	margin: .8rem 0 .15rem;
	font-size: .95rem;
	font-weight: 700;
	color: inherit
}

.crm-callcenter-logic__p {
	margin: .2rem 0 0;
	color: inherit;
	overflow-wrap: anywhere
}

.crm-hl {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 999px;
	border: 1px solid transparent;
	font-weight: 700;
	font-size: .92em;
	line-height: 1.45;
	max-width: 100%;
	overflow-wrap: anywhere;
	vertical-align: baseline
}

.crm-hl--var {
	background: rgba(122, 184, 255, .22);
	border-color: rgba(122, 184, 255, .55);
	color: #eaf4ff
}

.crm-hl[data-crm-focus] {
	cursor: pointer;
}

.crm-hl[data-crm-focus]:focus-visible {
	outline: 2px solid rgba(122, 184, 255, .9);
	outline-offset: 2px;
}

.crm-hl--default {
	background: rgba(148, 163, 184, .08);
	border-color: rgba(148, 163, 184, .25);
	color: #d7deea;
	font-weight: 500
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="datetime-local"],
input[type="date"],
input[type="time"],
textarea,
select {
	width: 100%;
	padding: .6rem .7rem;
	border-radius: 8px;
	background: #0f172a;
	border: 1px solid #203055;
	color: var(--color-text)
}

/* Einheitliche Kompakthöhe und Paddings für Form Controls (globale Basis) */
input:not(.search-input):not([type="checkbox"]):not([type="radio"]),
select,
textarea {
	min-height: 42px;
	line-height: 1.2;
	padding: .6rem .9rem;
	/* mehr horizontaler Innenabstand wie Buttons */
}

/* Tabellen (crm-table) */
.crm-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0));
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	overflow: hidden;
}

.crm-table th,
.crm-table td {
	text-align: left;
	padding: .6rem .8rem;
	border-bottom: 1px solid var(--color-border);
}

.crm-table thead th {
	background: rgba(0, 57, 115, .25);
	font-weight: 700;
}

.table-responsive {
	overflow-x: auto;
	width: 100%;
}

.crm-table tbody tr:hover {
	background: rgba(255, 255, 255, .04);
}

.crm-table th.text-right,
.crm-table td.text-right {
	text-align: right;
}

/* Kontakte-Tabelle: Responsive Spaltensteuerung */
/*
   Ziel: Unter < 1360px die Spalten E‑Mail & Telefon ausblenden,
   damit die Kontakt-Spalte groß/lesbar bleibt. In der Mobil-Ansicht
   (<= 760px) nur noch: Kontakt | Wiedervorlage | Aktionen anzeigen.
*/
@media (max-width: 1359px) {

	.crm-table .col-email,
	.crm-table .col-phone {
		display: none;
	}
}

@media (max-width: 760px) {

	.crm-table .col-location,
	.crm-table .col-status,
	.crm-table .col-score {
		display: none;
	}

	/* Kontakt-Spalte darf wachsen */
	.crm-table .col-contact {
		width: auto;
	}
}

/* Notizenliste: Textspalte umbrechen (lange URLs etc.) */
#notesTable tbody td:nth-child(5) {
	overflow-wrap: anywhere;
	word-wrap: break-word;
	word-break: break-word;
}

.crm-link {
	color: #7ab8ff;
	text-decoration: none;
}

.crm-link:hover {
	text-decoration: underline;
}

/* Button im Link-Stil (für Aktionen wie "API-Token erneuern" neben "Bearbeiten") */
.crm-btn-link {
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	color: #7ab8ff;
	cursor: pointer;
	text-decoration: none;
}

.crm-btn-link:hover {
	text-decoration: underline;
}

.crm-btn-link i {
	margin-right: .35rem;
}

.crm-btn-link[aria-disabled="true"],
.crm-btn-link:disabled {
	opacity: .55;
	cursor: default;
	text-decoration: none;
}

/* Kompakte Eingabefelder (z. B. Token im Modal) */
.crm-input-short {
	width: 100%;
	max-width: 520px;
}

/* Modal: Form-Grids immer einspaltig halten, um Überlauf zu vermeiden */
.crm-dialog-body .crm-form-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
}

/* Modal CTA-Reihe: Button optisch auf Eingabefeld-Baseline */
.cta-row .cta-align-end {
	align-self: flex-end;
}

/* Transaktionen (crm-tx-table): Bezeichnung erhält mehr Platz als Betrag */
.crm-tx-table {
	table-layout: auto;
}

/* Datum/Betrag/Aktionen so schmal wie möglich, ohne Umbruch */
.crm-tx-table th:nth-child(1),
.crm-tx-table td.crm-tx-date {
	width: 1%;
	white-space: nowrap;
}

.crm-tx-table th:nth-child(3),
.crm-tx-table td.crm-tx-amount {
	width: 1%;
	white-space: nowrap;
	min-width: 120px;
}

.crm-tx-table th:nth-child(4),
.crm-tx-table td:nth-child(4) {
	width: 1%;
	white-space: nowrap;
}

/* Bezeichnung flexibel und mit Mindestbreite */
.crm-tx-table td.crm-tx-desc {
	width: auto;
	min-width: 180px;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.crm-tx-table .crm-tx-edit-desc {
	width: 100%;
	max-width: 100%;
	min-width: 0;
}

.crm-tx-table .crm-tx-edit-amount {
	width: auto;
	min-width: 0;
	max-width: 150px;
}

.tx-actions--editing {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
	width: 100%;
}

.crm-tx-table .crm-tx-edit-date {
	min-width: 0;
	width: auto;
	max-width: 160px;
}

@media (max-width: 760px) {
	.crm-tx-table th:nth-child(1),
	.crm-tx-table td.crm-tx-date {
		display: none;
	}

	.crm-tx-table td.crm-tx-desc {
		min-width: 130px;
	}

	.crm-tx-table th:nth-child(3),
	.crm-tx-table td.crm-tx-amount {
		width: auto;
		min-width: 110px;
	}

	.crm-tx-table th:nth-child(4),
	.crm-tx-table td:nth-child(4) {
		width: auto;
	}

	.tx-actions--editing {
		justify-content: flex-start;
	}

	.crm-tx-table .crm-tx-edit-amount {
		max-width: 100%;
		width: 100%;
	}

	.crm-tx-table .crm-tx-edit-date {
		max-width: 100%;
		width: 100%;
	}
}

/* Utilities */
.text-right {
	text-align: right;
}

.card-title__meta {
	font-size: .9em;
	font-weight: 400;
	color: var(--color-muted, #6b7280);
	display: inline-flex;
	align-items: center;
}

.card-title__meta .card-title__meta-tooltip {
	display: none !important;
}

.card-title--with-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

@media (max-width: 760px) {
	.card-title__meta-text {
		display: none;
	}
	.card-title__meta .card-title__meta-tooltip {
		display: inline-flex !important;
	}
	.card-title__meta {
		gap: 6px;
		align-items: center;
	}
}

.nowrap {
	white-space: nowrap;
}

/* Pagination */
.crm-pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 12px;
	flex-wrap: wrap;
}

.crm-pagination .page-summary {
	color: var(--color-muted);
	font-size: .95rem;
}

.crm-pagination nav .pagination {
	list-style: none;
	display: flex;
	gap: 6px;
	padding: 0;
	margin: 0;
	flex-wrap: wrap;
}

.crm-pagination .pagination li {
	display: inline-block;
}

.crm-pagination .pagination a,
.crm-pagination .pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 .6rem;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, .12);
	background: rgba(255, 255, 255, .06);
	color: var(--color-text);
	text-decoration: none;
}

.crm-pagination .pagination a:hover {
	background: rgba(255, 255, 255, .12);
	text-decoration: none;
}

.crm-pagination .pagination li.active a {
	background: var(--gradient-primary);
	border-color: #1b4b86;
	color: #fff;
}

.crm-pagination .pagination li.disabled span {
	opacity: .6;
	border-color: rgba(255, 255, 255, .08);
}

/* Stats: Kanalauswertung soll auf Mobile niemals die Seite verbreitern */
.stats-page #section-channels .card,
.stats-page #section-channels [data-crm-channel-list] {
	max-width: 100%;
	min-width: 0;
}
.stats-page #section-channels .table-responsive {
	max-width: 100%;
	min-width: 0;
	-webkit-overflow-scrolling: touch;
}
.stats-page #section-channels .crm-table {
	/* Tabelle ist i. d. R. breiter als Mobile: horizontales Scrollen bleibt im Wrapper */
	width: max-content;
	min-width: 100%;
}
.stats-page #section-channels .crm-table td:first-child {
	/* Lange Kanalnamen/UTM-Werte sollen umbrechen statt Layout zu sprengen */
	overflow-wrap: anywhere;
	word-break: break-word;
}
.stats-page #section-channels .crm-table th {
	overflow-wrap: anywhere;
	word-break: break-word;
	white-space: normal;
}
.stats-page #section-channels .crm-pagination > * {
	min-width: 0;
}

/* Schmale Viewports: Username im Header einkürzen */
@media (max-width: 650px) {
	.user-toggle .name {
		display: none;
	}
}

input:focus,
textarea:focus,
select:focus {
	border-color: #2f65a0;
	outline: none;
	box-shadow: none;
}

/* Form controls: keine zusätzliche Browser-Outline bei Fokus
   (verhindert doppelte Hervorhebung in Chrome/Brave) */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline: none;
	/* globale :focus-visible-Outline für Inputs neutralisieren */
	/* gleiche, moderate Hervorhebung wie bei :focus */
	box-shadow: none;
}

label {
	display: block;
	margin: .25rem 0 .4rem;
	color: #c9d2df
}

label .crm-help {
	margin-left: 6px;
	width: 22px;
	height: 22px;
	font-size: .85rem;
	line-height: 1;
	border-radius: 50%;
}

/* CRM form layout helpers */
.section-form {
	/* Einheitlich: Formulare starten linksbündig und laufen nicht über volle Breite */
	margin-top: 12px;
	max-width: 900px;
}

/* Tabs (z. B. Einstellungen: Profil/System) */
.crm-tabs {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin: 6px 0 12px;
}

.crm-tab {
	display: inline-flex;
	align-items: center;
	padding: .45rem .75rem;
	border-radius: 999px;
	border: 1px solid var(--color-border);
	color: var(--color-text);
	text-decoration: none;
	background: rgba(255, 255, 255, .04);
}

.crm-tab:hover {
	background: rgba(255, 255, 255, .08);
	text-decoration: none;
}

.crm-tab.is-active {
	background: rgba(0, 57, 115, .35);
	border-color: rgba(122, 184, 255, .35);
}

.crm-tab:focus-visible {
	text-decoration: none;
}

/* Einstellungen: Profilbild */
.settings-avatar-row {
	display: grid;
	grid-template-columns: 80px minmax(0, 1fr);
	gap: 12px;
	align-items: start;
}

.settings-avatar-preview {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	overflow: hidden;
	background: #1f2a44;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.settings-avatar-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.settings-avatar-fallback {
	color: #fff;
	font-weight: 700;
}

.settings-avatar-dropzone {
	display: grid;
	gap: 4px;
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px dashed var(--color-border);
	background: rgba(255, 255, 255, .02);
	cursor: pointer;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.settings-avatar-dropzone__title {
	font-weight: 600;
}

.settings-avatar-dropzone__status {
	color: var(--color-muted);
	font-size: .9rem;
}

.settings-avatar-dropzone.is-dragover {
	border-color: rgba(122, 184, 255, .7);
	background: rgba(0, 57, 115, .12);
	box-shadow: 0 0 0 3px rgba(122, 184, 255, .15);
}

.settings-avatar-dropzone.has-file {
	border-color: rgba(16, 185, 129, .8);
	background: rgba(16, 185, 129, .08);
}

.settings-avatar-dropzone:focus-visible {
	outline: none;
	border-color: rgba(122, 184, 255, .7);
	box-shadow: 0 0 0 3px rgba(122, 184, 255, .2);
}

/* Schmalere Formular-Variante (z. B. Nutzer-Formulare) */
.section-form--narrow {
	max-width: 640px;
}

.crm-form {
	max-width: 100%;
}

.crm-form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(260px, 1fr));
	gap: 12px;
}

/* Auf schmalen Screens auf eine Spalte reduzieren */
@media (max-width: 760px) {
	.crm-form-grid {
		grid-template-columns: 1fr;
	}
}

.crm-field {
	display: block;
}

.crm-field+.crm-field {
	margin-top: 8px;
}

/* In zweispaltigen Formularrastern soll die zweite Spalte nicht vertikal versetzt sein. */
.crm-form-grid .crm-field {
	margin-top: 0;
}

.crm-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.crm-form-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	margin-top: 12px;
}

/* Split actions bar: left/ right aligned groups (z. B. Edit-Formulare) */
.crm-form-actions-split {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 12px;
}

.crm-form-actions-split .crm-form-actions {
	margin-top: 0;
}

/* Feld über gesamte Formularbreite (Grid-Spalte 1..-1) */
.crm-field--full {
	grid-column: 1 / -1;
}

/* Transaktionsformular: Standard 3 Spalten (Bezeichnung ~60% | Betrag ~28% | Button ~12%).
   Bleibt so bis wirklich wenig Platz vorhanden ist. */
.crm-form-grid--tx {
	/* Robust: Restbreite für Bezeichnung, feste Klammern für Betrag/Action */
	grid-template-columns: minmax(200px, 1fr) clamp(120px, 28%, 240px) clamp(96px, 12%, 160px);
	align-items: end;
	max-width: 100%;
}

.crm-form-grid--tx .crm-field-submit {
	justify-self: end;
}

/* Grid-Inhalte dürfen kollabieren, nicht herausragen */
.crm-form-grid--tx .crm-field input,
.crm-form-grid--tx .crm-field select,
.crm-form-grid--tx .crm-field textarea {
	min-width: 0;
	width: 100%;
}

/* Enger Zweispalten-Layoutbereich (zwei Hauptspalten aktiv, linke Spalte begrenzt):
   Button in die nächste Zeile verlagern, um Überlauf zu verhindern. */
@media (min-width: 1286px) and (max-width: 1449px) {
	.crm-form-grid--tx {
		grid-template-columns: minmax(200px, 1fr) clamp(120px, 33%, 260px);
	}

	.crm-form-grid--tx .crm-field-submit {
		grid-column: 1 / -1;
		justify-self: end;
	}
}

/* Klein: alles untereinander (verhindert horizontales Scrollen/Überlauf) */
@media (max-width: 560px) {
	.crm-form-grid--tx {
		grid-template-columns: 1fr;
	}

	.crm-form-grid--tx .crm-field-submit {
		grid-column: 1 / -1;
	}
}

/* Fehlerzustände auf Feldebene */
.crm-field [aria-invalid="true"] {
	border-color: #b00020 !important;
	box-shadow: 0 0 0 3px rgba(176, 0, 32, .12);
}

/* Form Controls – systemweite Akzentfarbe */
input[type="checkbox"],
input[type="radio"] {
	accent-color: var(--primary);
}

/* Browser-Autofill (neutralisieren: kein gelbes Feld etc.) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--color-text) !important;
	caret-color: var(--color-text) !important;
	-webkit-box-shadow: 0 0 0px 1000px var(--color-bg) inset !important;
	box-shadow: 0 0 0px 1000px var(--color-bg) inset !important;
	transition: background-color 5000s ease-in-out 0s;
}

input:-moz-autofill,
textarea:-moz-autofill,
select:-moz-autofill {
	-moz-text-fill-color: var(--color-text) !important;
	box-shadow: 0 0 0px 1000px var(--color-bg) inset !important;
}

/* Deaktivierte Felder */
input[disabled],
select[disabled],
textarea[disabled] {
	opacity: .6;
	cursor: not-allowed;
}

/* Empty state */
.empty {
	border: 1px dashed var(--color-border);
	background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, 0));
	border-radius: 12px;
	padding: 2rem;
	text-align: center;
	color: var(--color-muted)
}

.empty .title {
	font-weight: 700;
	color: var(--color-text);
	margin: 0 0 .5rem
}

.empty .desc {
	margin: 0 0 1rem
}

/* Responsive */
.menu-toggle {
	display: none
}

@media (max-width: 1024px) {
	.app {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: var(--header-h) minmax(0, 1fr) auto;
		grid-template-areas:
			"header"
			"main"
			"footer";
	}

	nav.sidebar {
		position: fixed;
		left: 0;
		top: 0;
		bottom: 0;
		width: min(88vw, 320px);
		height: 100vh;
		max-height: none;
		overflow-y: auto;
		transform: translateX(-100%);
		transition: transform .2s ease-out, box-shadow .2s ease-out;
		z-index: 40;
	}

	nav.sidebar.crm-nav-open {
		transform: translateX(0);
		box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
	}

	nav.sidebar .sidebar-close {
		position: absolute;
		top: 10px;
		right: 12px;
		width: 36px;
		height: 36px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		border-radius: 50%;
		border: 1px solid rgba(255, 255, 255, .18);
		background: rgba(255, 255, 255, .06);
		color: var(--color-text);
		cursor: pointer;
	}

	.menu-toggle {
		display: inline-flex
	}
}

/* Topbar buttons */
.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, .12);
	background: rgba(255, 255, 255, .06);
	color: var(--color-text);
	cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .12s ease;
}

.icon-btn:hover {
	background: rgba(255, 255, 255, .12)
}

/* Icon-Auswahl (Notiz-Typ): aktiv markiert analog .crm-btn-primary */
.icon-btn.crm-btn-primary,
#note-type-buttons .icon-btn.crm-btn-primary {
	background: var(--gradient-primary);
	border-color: #1b4b86;
	color: #fff;
}

/* Einheitliche Icon-Größe in Buttons */
.icon-btn i {
	font-size: 16px;
}

/* Icons in Buttons sauber ausrichten, nicht kursiv */
.icon-btn i.fa,
.icon-btn i.fas,
.icon-btn i.far,
.icon-btn i.fab,
.icon-btn i.fa-solid,
.icon-btn i.fa-regular,
.icon-btn i.fa-brands {
	font-style: normal;
	line-height: 1;
	display: inline-block;
}

/* Während Bearbeitung einer Notiz: Aktions-Icons ausblenden */
.crm-note-item[data-editing] .crm-note-item__actions {
	display: none !important;
}

/* Abstand zwischen Aktionen (Buttons) und "Letzte Notizen" im Kontakt-View */
#note-form+.crm-note-widget {
	margin-top: 1.3rem;
}

/* Footer */
footer.app-footer {
	grid-area: footer;
	margin-top: 0;
	padding: var(--space-4);
	color: var(--color-muted);
	border-top: 1px solid var(--color-border)
}

footer.app-footer .container {
	text-align: center;
}

/* Kleinere Screens: reduzierte Innenabstände für Content/Container */
@media (max-width: 600px) {
	.container {
		padding: 0 var(--space-4);
	}

	main.content {
		padding: var(--space-4);
	}

	/* Kontakt-Aktionsformulare auf kleinen Screens gestapelt halten */
	.contact-actions__item:not(.contact-actions__item--followup) .crm-inline-form {
		flex-direction: column;
		align-items: stretch;
	}

	.contact-actions__item:not(.contact-actions__item--followup) .crm-inline-form select,
	.contact-actions__item:not(.contact-actions__item--followup) .crm-inline-form .input-compact,
	.contact-actions__item:not(.contact-actions__item--followup) .crm-inline-form input[type="datetime-local"] {
		flex: 0 0 auto;
		width: 100%;
	}

	.contact-actions__item:not(.contact-actions__item--followup) .crm-inline-form .crm-btn {
		width: 100%;
	}

	.contact-actions__item:not(.contact-actions__item--followup) .crm-inline-form .icon-btn {
		align-self: flex-end;
	}
}

/* Bewegungsreduktion respektieren */
@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}

	html {
		scroll-behavior: auto !important;
	}
}

/* High-Contrast / forced-colors */
@media (forced-colors: active) {
	:root {
		--outline-color: Highlight;
	}

	:focus-visible {
		outline-color: Highlight;
	}

	.btn,
	.nav-link,
	.icon-btn {
		forced-color-adjust: none;
	}
}

/* Accessibility Tweaks */
.alert .close:focus-visible {
	outline: 2px solid var(--outline-color);
	outline-offset: 2px;
	border-radius: 6px;
}

/* Loading & Progress */
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.spinner {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .25);
	border-top-color: var(--outline-color);
	animation: spin .8s linear infinite;
}

.loading {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	color: var(--color-muted);
}

.loading-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .35);
	backdrop-filter: blur(2px);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.loading-overlay.active {
	display: flex;
}

.btn[aria-busy="true"] {
	pointer-events: none;
	opacity: .8;
	position: relative;
}

.btn[aria-busy="true"]::after {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-left: .5rem;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .25);
	border-top-color: var(--outline-color);
	vertical-align: -2px;
	animation: spin .8s linear infinite;
}


/* Dashboard Components */
.dashboard-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	flex-wrap: wrap;
	margin-bottom: var(--space-5);
}

.dashboard-header__title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
}

.dashboard-header__subtitle {
	margin: var(--space-1) 0 0 0;
	color: var(--color-muted);
}

.dashboard-header__actions {
	display: flex;
	gap: var(--space-2);
	flex-wrap: wrap;
	align-items: center;
}

/* KPI Grid */
.kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: var(--space-3);
	margin-top: var(--space-4);
}

.kpi-card {
	background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0));
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: var(--space-4);
	box-shadow: var(--shadow-1);
	text-align: center;
	position: relative;
}

.kpi-card__title {
	font-size: 0.8rem;
	color: var(--color-muted);
	text-transform: uppercase;
	letter-spacing: .08em;
	margin-bottom: var(--space-2);
	/* Titelhöhe vereinheitlichen: Platz für bis zu 2 Zeilen reservieren,
	   damit unterschiedliche Längen (z. B. "Angebote diesen Monat")
	   die Ausrichtung der Zahlen nicht verschieben. */
	line-height: 1.2;
	min-height: calc(1.2em * 2);
}

.kpi-card__value {
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--color-text);
	font-variant-numeric: tabular-nums;
}

.kpi-card__metric {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	align-items: center;
	justify-content: center;
	position: relative;
	padding-bottom: 0;
}

.kpi-card__metric-main {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--color-text);
	font-variant-numeric: tabular-nums;
}

.kpi-card__metric-sub {
	position: absolute;
	bottom: -0.12rem;
	left: 50%;
	transform: translateX(-50%);
	font-size: 0.68rem;
	color: var(--color-muted);
	letter-spacing: .02em;
	text-transform: none;
	line-height: 1.05;
	pointer-events: none;
}

.crm-tooltip {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: var(--space-1);
	cursor: pointer;
}

.crm-tooltip--inline {
	margin-left: 0
}

.crm-tooltip__icon {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 0;
	background: var(--color-primary);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
	transition: transform .15s ease, box-shadow .15s ease;
}

.crm-tooltip__icon:focus-visible {
	outline: 2px solid var(--color-primary-600);
	outline-offset: 2px;
}

.crm-tooltip:hover .crm-tooltip__icon,
.crm-tooltip:focus-within .crm-tooltip__icon {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
}

.crm-tooltip__bubble {
	position: fixed;
	top: 0;
	left: 0;
	transform: translateY(4px);
	background: var(--surface-2);
	color: var(--color-text);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: var(--space-3) var(--space-4);
	width: max-content;
	min-width: min(320px, calc(100vw - 8px));
	max-width: min(640px, calc(100vw - 8px));
	text-align: left;
	font-size: 0.73rem; /* ~15% kleiner */
	line-height: 1.32;
	box-shadow: var(--shadow-2);
	opacity: 0;
	pointer-events: none;
	transition: opacity .16s ease, transform .16s ease;
	z-index: 20;
	text-transform: none;
	cursor: pointer;
}

.card-title__meta-tooltip .crm-tooltip__bubble {
	min-width: auto;
	width: max-content;
	max-width: calc(100vw - 20px);
	white-space: nowrap;
	padding: var(--space-2) var(--space-3);
}

.crm-callcenter-logic .crm-tooltip__bubble {
	min-width: 0;
	width: max-content;
	max-width: min(560px, calc(100vw - 16px));
}

.crm-tooltip__bubble::after {
	display: none;
}

.crm-tooltip:hover .crm-tooltip__bubble,
.crm-tooltip:focus-within .crm-tooltip__bubble {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

/* Klickbare KPI-Karte (z. B. fällige Leads) */
.kpi-card--clickable {
	cursor: pointer;
}

.kpi-card--clickable:hover {
	box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
	border-color: rgba(255, 255, 255, .35);
}

/* Dashboard Content */
.dashboard-content {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: var(--space-4);
	margin-top: var(--space-4);
}

.dashboard-section,
.section {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
}

.section__header,
.dashboard-section__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--space-3);
	flex-wrap: wrap;
	padding: var(--space-3);
	border-radius: var(--radius);
	border: 1px solid var(--color-border);
	background: linear-gradient(135deg, rgba(0, 57, 115, 0.12), rgba(0, 57, 115, 0.05));
	min-height: 64px;
}

.section__title,
.dashboard-section__title {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	flex: 1 1 auto;
}

.activity-filter {
	display: inline-flex;
	gap: var(--space-2);
	align-items: center;
	flex-wrap: wrap;
	margin-left: auto;
}

.activity-filter__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.35rem 0.9rem;
	border-radius: 999px;
	border: 1px solid var(--color-border);
	background: rgba(255, 255, 255, 0.06);
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--color-muted);
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.activity-filter__button:hover,
.activity-filter__button:focus-visible {
	border-color: var(--color-primary-600);
	color: #fff;
	background: linear-gradient(135deg, rgba(0, 57, 115, 0.85), rgba(0, 57, 115, 0.65));
	text-decoration: none;
}

.activity-filter__button:focus-visible {
	outline: 2px solid var(--color-primary-600);
	outline-offset: 2px;
}

.activity-filter__button.is-active {
	background: linear-gradient(135deg, rgba(0, 57, 115, 0.95), rgba(0, 57, 115, 0.75));
	color: #fff;
	border-color: transparent;
	box-shadow: 0 4px 14px rgba(0, 57, 115, 0.25);
}

.activity-list-wrapper {
	margin-top: 0;
}

.activity-list-wrapper.is-loading {
	opacity: 0.6;
	pointer-events: none;
	position: relative;
}

.activity-list-wrapper.is-loading::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: var(--radius);
	background: rgba(0, 0, 0, 0.08);
	animation: activity-loading 1.2s ease-in-out infinite alternate;
}

@keyframes activity-loading {
	from {
		opacity: 0.2;
	}

	to {
		opacity: 0.5;
	}
}

.activity-pagination {
	margin-top: var(--space-3);
}

/* Activity List */
.activity-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
}

.activity-item {
	background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, 0));
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: var(--space-3);
}

.activity-item__header {
	display: flex;
	justify-content: space-between;
	gap: var(--space-2);
	flex-wrap: wrap;
	margin-bottom: var(--space-2);
}

.activity-item__author {
	font-weight: 600;
	color: var(--color-text);
}

.activity-item__time {
	color: var(--color-muted);
	font-size: 0.8rem;
}

.activity-item__content {
	margin: var(--space-2) 0;
	line-height: 1.4;
	color: var(--color-text);
}

.activity-item__content,
.activity-item__content a {
	/* Lange URLs/Text in Dashboard-Aktivitäten umbrechen */
	overflow-wrap: anywhere;
	word-wrap: break-word;
	word-break: break-word;
}

.activity-item__contact {
	font-size: 0.85rem;
	color: var(--color-muted);
}

/* Notifications */
.notifications {
	margin-top: var(--space-4);
}

.notification-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
}

.notification-item {
	display: flex;
	gap: var(--space-3);
	justify-content: space-between;
	align-items: flex-start;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: var(--space-3);
	background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, 0));
	position: relative;
	overflow: hidden;
}

.notification-item.is-unread {
	border-color: rgba(122, 184, 255, .7);
	background: linear-gradient(135deg, rgba(0, 57, 115, .28), rgba(255, 255, 255, 0));
	box-shadow: inset 0 0 0 1px rgba(122, 184, 255, .25), 0 6px 16px rgba(0, 0, 0, .25);
}

.notification-item.is-unread::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	background: linear-gradient(180deg, #7ab8ff, #2b6bb0);
	pointer-events: none;
}

.notification-item__main {
	flex: 1 1 auto;
	min-width: 0;
}

.notification-link {
	display: flex;
	gap: var(--space-3);
	align-items: flex-start;
	color: var(--color-text);
	text-decoration: none;
}

.notification-link:hover {
	text-decoration: none;
}

.notification-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #1f2a44;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: .9rem;
	flex: 0 0 auto;
}

.notification-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}

.notification-content {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.notification-title {
	font-weight: 600;
}

.notification-text {
	line-height: 1.4;
	color: var(--color-text);
	overflow-wrap: anywhere;
	word-break: break-word;
}

.notification-text a {
	color: var(--color-text);
	text-decoration: underline;
}

.notification-item__meta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
	flex: 0 0 auto;
}

.notification-time {
	font-size: .8rem;
	color: var(--color-muted);
	white-space: nowrap;
}

.notification-read[aria-disabled="true"] {
	opacity: .5;
	cursor: default;
}

@media (max-width: 700px) {
	.notification-item {
		flex-direction: column;
	}

	.notification-item__meta {
		flex-direction: row;
		align-items: center;
		justify-content: flex-end;
		width: 100%;
	}
}

/* Contact List */
.contact-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
}

.contact-item {
	background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, 0));
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: var(--space-3);
}

/* Einheitliche Kartengröße für Dashboard-Karten auf Desktop */
.activity-item,
.contact-item {
	min-height: 110px;
}

@media (max-width: 900px) {
	.section__header,
	.dashboard-section__header {
		min-height: auto;
		padding: var(--space-2) var(--space-3);
	}

	.activity-item,
	.contact-item {
		min-height: auto;
	}
}

@media (max-width: 760px) {
	.section__header,
	.dashboard-section__header {
		flex-direction: column;
		align-items: center;
		justify-content: center;
		text-align: center;
	}

	.section__title,
	.dashboard-section__title {
		flex: 0 1 auto;
		width: 100%;
	}

	.activity-filter {
		margin-left: 0;
	}
}

.contact-item__name {
	font-weight: 600;
	color: var(--color-text);
	margin-bottom: var(--space-1);
}

.contact-item__date {
	font-size: 0.8rem;
	color: var(--color-muted);
	margin-bottom: var(--space-1);
}

.contact-item__city {
	margin-top: var(--space-1);
	color: var(--color-text);
}

.contact-item__actions {
	margin-top: var(--space-2);
	display: flex;
	gap: var(--space-2);
	flex-wrap: wrap;
}

.contact-link {
	color: #7ab8ff;
	text-decoration: none;
	font-size: 0.9rem;
}

.contact-link:hover {
	text-decoration: underline;
}

/* Auth Components */
.auth {
	display: grid;
	place-items: center;
	padding: var(--space-6) 0;
	min-height: calc(100vh - var(--header-h) - 80px);
}

.auth-login {
	width: 100%;
	max-width: 460px;
	margin: 0 auto;
}

/* Auth pages: center content both axes via layout container */
.auth-page .auth-container {
	/* Vollhöhe sicherstellen und Inhalt sauber zentrieren */
	min-height: 100vh;
	/* Fallback für Browser ohne *vh Viewport-Units */
	min-height: 100svh;
	/* Mobile-Viewport: vermeidet "zu weit unten" durch Browser-UI */
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	padding: var(--space-6) var(--space-4);
	gap: var(--space-3);
}

.crm-note-widget {
	margin-bottom: .5em;
}

/* Quick star rating on contact view */
.star-rating {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.star-rating .star {
	appearance: none;
	background: none;
	border: none;
	padding: 0 3px;
	line-height: 1;
	font-size: 1.85rem;
	cursor: pointer;
	color: #9aa8bd;
	/* muted */
	transition: transform .08s ease, color .15s ease;
}

.star-rating .star.is-active {
	color: #f6c04d;
}

.star-rating .star:hover,
.star-rating .star:focus {
	color: #ffd77a;
	transform: scale(1.1);
}

.star-rating .star:focus {
	outline: 2px solid var(--outline-color);
	outline-offset: 2px;
	border-radius: 4px;
}

.star-rating .star-clear {
	appearance: none;
	background: none;
	border: 1px solid rgba(255, 255, 255, .18);
	color: var(--color-text);
	border-radius: 999px;
	font-size: .8rem;
	padding: 0 .4rem;
	margin-left: 6px;
	line-height: 1.3;
	cursor: pointer;
	opacity: .7;
}

.star-rating .star-clear:hover {
	opacity: 1;
}

/* Kontaktansicht: Sterne weiter rechts ausrichten */
.contact-right .star-rating {
	margin-left: 0;
}

@media (min-width: 761px) {
	.contact-right #category-form {
		margin-left: auto;
	}
}

/* Kontaktansicht: Titel-Abstände wie global (.card-title); kein extra top-margin rechts */
.contact-right .card-title {
	margin-top: 0;
}

/* Wiedervorlage: Datumsfeld kompakter darstellen und Höhe an Buttons angleichen */
#followup-form .input-compact {
	width: 170px;
	min-height: 42px;
	line-height: 1.2;
	padding: .6rem .7rem;
}

/* .input-compact bleibt als Breiten-Helfer (siehe weiter oben: width/max-width) */

/* Selects harmonisieren: eigener Pfeil, Abstand rechts, nicht „ankleben“ */
/* Einheitliche Select-Darstellung (alle einfachen Selects, nicht multiple) */
select:not([multiple]) {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 2rem;
	/* Platz für den Chevron */
	background-repeat: no-repeat;
	background-position: right .55rem center;
	background-size: 12px 12px;
	/* Heller Chevron als Pfeil */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Verstecke IE/Legacy-Edge Pfeil */
select::-ms-expand {
	display: none;
}

/* Inline-Fehlerausgabe an Formularfeldern */
.crm-field-error {
	color: #b00020;
	font-size: 0.9em;
	margin-top: 4px;
}

/* Mobile Sidebar: Off-Canvas Verhalten (bis 1024px) */
/* Desktop: einklappbare Sidebar über Klasse an .app (nur ≥1025px) */
@media (min-width: 1025px) {
	.app.app--sidebar-collapsed {
		/* Desktop-collapsed: Sidebar vollständig aus dem Grid nehmen, Main über volle Breite */
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: var(--header-h) minmax(0, 1fr) auto;
		grid-template-areas:
			"header"
			"main"
			"footer";
	}

	.app.app--sidebar-collapsed nav.sidebar {
		display: none;
	}
}

/* Avoid double spacing: let container control vertical rhythm */
.auth-page .auth {
	min-height: auto;
	padding: 0;
}

/* Inner center wrapper to hard-center content */
.auth-page .auth-center {
	width: 100%;
	max-width: 100%;
	/* Das eigentliche Zentrieren übernimmt .auth-container; hier keine eigene Höhe erzwingen */
	display: grid;
	place-items: center;
	min-height: auto;
	padding: 0;
}

/* Auth card wrapper: mittig + schöner Frame (analog Installer-Card) */
.auth-card {
	width: 100%;
	max-width: 520px;
	margin: 0 auto;
	box-shadow: var(--shadow-2);
}

/* Button-Normalisierung für gleiche Höhe (Button vs. Link) */
.btn,
.crm-btn {
	min-height: 42px;
	line-height: 1.2;
	text-decoration: none;
}

.field {
	margin-bottom: var(--space-3);
}

.checkbox {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
}

.cta-row {
	display: flex;
	gap: var(--space-3);
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
}

/* Button aliases for crm-btn compatibility */
.crm-btn,
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	padding: .6rem .9rem;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, .12);
	background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0));
	color: var(--color-text);
	cursor: pointer;
	box-shadow: var(--shadow-1);
	transition: transform .12s ease, background-color .2s ease, box-shadow .2s ease, border-color .2s ease;
	text-decoration: none;
}

.crm-btn-primary,
.btn-primary {
	background: var(--gradient-primary);
	border-color: #1b4b86;
	color: white;
}

.crm-btn:hover,
.btn:hover {
	transform: translateY(-1px);
}

.crm-btn:active,
.btn:active {
	transform: translateY(0);
}

/* Buttons und Button-Links: keine Unterstreichung beim Hover */
a.btn:hover,
.btn:hover,
a.crm-btn:hover,
.crm-btn:hover {
	text-decoration: none;
}

/* Dialog / Modal (Bestätigungs-Dialog) */
.crm-dialog-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	backdrop-filter: blur(2px);
	display: grid;
	place-items: center;
	z-index: 10000;
	animation: crm-fade-in .12s ease-out;
}

.crm-dialog {
	width: min(520px, 92vw);
	background: var(--surface);
	color: var(--text);
	border-radius: var(--radius);
	box-shadow: var(--shadow-2);
	border: 1px solid var(--border);
	overflow: hidden;
}

.crm-dialog-header {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	padding: var(--space-4);
	background: var(--gradient-primary);
	color: #fff;
	position: relative;
}

.crm-dialog-header .crm-dialog-icon {
	width: 36px;
	height: 36px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, .16);
	flex: 0 0 auto;
}

.crm-dialog-header .crm-dialog-icon .fa {
	font-size: 18px;
	position: relative;
	top: 2px;
}

.crm-dialog-title {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 600;
}

.crm-dialog-body {
	padding: var(--space-5);
}

.crm-dialog-body p {
	margin: 0;
	line-height: 1.45;
}

.crm-dialog-actions {
	display: flex;
	justify-content: flex-end;
	gap: var(--space-3);
	padding: var(--space-4) var(--space-5);
	background: var(--surface-2);
}

/* Close-Button oben rechts im Dialog */
.crm-dialog-close {
	position: absolute;
	top: 8px;
	right: 8px;
}

.crm-dialog-close.icon-btn {
	width: 34px;
	height: 34px;
	background: rgba(255, 255, 255, .18);
	border-color: rgba(255, 255, 255, .25);
	color: #fff;
}

/* Kompakter Button für Dialoge */
/* Varianten werden weiter oben bereits definiert (.crm-btn-sm, .crm-btn-danger) */

.contact-merge-dialog {
	width: min(900px, 92vw);
	max-height: 85vh;
}

.contact-merge-dialog .crm-dialog-body {
	max-height: calc(85vh - 180px);
	overflow-y: auto;
}

/* Kontakt-Zusammenführen Modal */
.contact-merge {
 display: flex;
 flex-direction: column;
 gap: var(--space-4);
}

.contact-merge__notice {
    font-size: .95rem;
    color: var(--muted);
}

.contact-merge__search {
	display: grid;
	gap: var(--space-2);
}

.contact-merge__search input {
	width: 100%;
}

.contact-merge__results {
	border: 1px solid var(--border);
	border-radius: 8px;
	max-height: 220px;
	overflow: auto;
	background: var(--surface-2);
}

.contact-merge__results table {
	width: 100%;
	border-collapse: collapse;
}

.contact-merge__results th,
.contact-merge__results td {
	padding: 8px 12px;
	border-bottom: 1px solid rgba(255, 255, 255, .05);
	text-align: left;
}

.contact-merge__results tbody tr {
	cursor: pointer;
	transition: background .15s ease;
}

.contact-merge__results tbody tr:hover {
	background: rgba(255, 255, 255, .05);
}

.contact-merge__results tbody tr.is-active {
	background: rgba(0, 57, 115, .35);
}

.contact-merge__summary {
	display: grid;
	gap: 4px;
	font-size: .95rem;
	color: var(--muted);
}

.contact-merge__summary strong {
	color: var(--text);
}



.contact-merge__field {
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: var(--space-3);
	background: var(--surface-2);
	display: grid;
	gap: var(--space-2);
	margin-bottom: var(--space-3);
}

.contact-merge__field.needs-choice {
	border-color: var(--color-warning);
	box-shadow: 0 0 0 1px rgba(245, 158, 11, .35);
}

.contact-merge__field-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--space-2);
}

.contact-merge__field-header .label {
	font-weight: 600;
	color: var(--text);
}

.contact-merge__field-values {
	display: grid;
	gap: 4px;
	font-size: .9rem;
	color: var(--muted);
}

.contact-merge__field select {
	max-width: 100%;
	margin-top: var(--space-3);
}

.contact-merge__field-values > div {
	margin-bottom: 4px;
}

.contact-merge__field-values > div:last-child {
	margin-bottom: 0;
}

.contact-merge__automatic {
    border-top: 1px solid var(--border);
    padding-top: var(--space-3);
    display: grid;
    gap: var(--space-2);
    font-size: .95rem;
    color: var(--muted);
}

.contact-merge__automatic-item {
	display: grid;
	gap: 2px;
}

.contact-merge__automatic-title {
	font-weight: 600;
	color: var(--text);
}

.contact-merge__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: .85rem;
	background: rgba(255, 255, 255, .08);
	border-radius: 999px;
	padding: 2px 10px;
	color: var(--text);
}

@keyframes crm-fade-in {
	from {
		opacity: 0
	}

	to {
		opacity: 1
	}
}

/* Responsive Dashboard */
@media (max-width: 900px) {
	.dashboard-content {
		grid-template-columns: 1fr;
	}

	.dashboard-header {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (max-width: 600px) {
	.kpi-grid {
		grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
		gap: var(--space-2);
	}

	.dashboard-header__actions {
		width: 100%;
	}

	.activity-filter {
		margin-left: 0;
		justify-content: flex-start;
	}

	.section__header,
	.dashboard-section__header {
		gap: var(--space-2);
		padding: var(--space-2);
	}

	.activity-list-wrapper {
		margin-top: 0;
	}
}

/* --- Utility and small layout helpers (added) --- */
/* Flex grow helper */
.flex-1 {
	flex: 1 1 auto;
	min-width: 0;
}

/* Split layout 2:1 (e.g., notes page) */
.crm-split-2-1 {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 16px;
	margin-top: 12px;
}

@media (max-width: 900px) {
	.crm-split-2-1 {
		grid-template-columns: 1fr;
	}
}

/* Narrow checkbox column in tables */
.th-select {
	width: 36px;
}

/* Note item actions alignment */
.crm-note-item__actions {
	display: flex;
	gap: 6px;
	justify-content: flex-end;
}

/* Repeatable items (contact modal) */
.repeatable-items {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.repeatable-row {
	display: flex;
	gap: 6px;
	align-items: center;
}
.kpi-card__metric--contact-stats {
	padding-bottom: 4px;
}

.kpi-card__metric-main--contact {
	font-size: 1.4rem;
	letter-spacing: 0.01em;
	margin-bottom: 4px;
}

.kpi-card__metric--contact-stats .kpi-card__metric-sub {
	bottom: -0.05rem;
}

.stats-section + .stats-section {
	margin-top: 18px;
}

@media (max-width: 600px) {
	.kpi-card__title {
		font-size: 0.65rem;
	}

	.kpi-card__title .crm-tooltip {
		position: absolute;
		bottom: var(--space-2);
		right: var(--space-2);
		top: auto;
		margin-left: 0;
	}

	.kpi-card__metric-main {
		font-size: 1.3rem;
	}

	.kpi-card__metric-main--contact {
		font-size: 1.2rem;
	}
}

@media (max-width: 1400px) {
	.kpi-card__title .crm-tooltip {
		position: absolute;
		bottom: var(--space-2);
		right: var(--space-2);
		top: auto;
		margin-left: 0;
	}
}

/* --- Stats / CRM Überblick --- */
.stats-page .stats-section {
	/* Jede Section darf auf Mobile niemals die Grid-/Viewport-Breite erzwingen */
	min-width: 0;
	max-width: 100%;
}

.stats-page .stats-section > * {
	/* Flex-Items in Column-Flex dürfen sonst min-content breiten */
	min-width: 0;
	max-width: 100%;
}

.chart-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 12px;
}
.chart-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.95rem;
}
.chart-toggle input {
	margin: 0;
}
.chart-toggle[data-series="revenue"] span { color: var(--series-kpi-1); }
.chart-toggle[data-series="contacts"] span { color: var(--series-kpi-2); }
.chart-toggle[data-series="transactions"] span { color: var(--series-kpi-3); }
.chart-toggle[data-series="processed"] span { color: var(--series-kpi-6); }
.chart-toggle[data-series="cr"] span { color: var(--series-kpi-4); }
.chart-toggle[data-series="arpu"] span { color: var(--series-kpi-5); }
.chart-wrapper {
	width: 100%;
	overflow: hidden;
}
.stats-chart {
	width: 100%;
	display: block;
}
.chart-tooltip {
	position: fixed;
	pointer-events: none;
	opacity: 0;
	transition: opacity 120ms ease, transform 120ms ease;
	transform: translate(-50%, -120%);
	z-index: 2000;
	background: #0b1220;
	color: #e8f1ff;
	border: 1px solid #1f2a44;
	border-radius: 10px;
	padding: 10px 12px;
	box-shadow: 0 14px 34px rgba(0, 13, 34, 0.35);
	font-size: 12px;
	line-height: 1.35;
	max-width: 260px;
	white-space: nowrap;
}
.stats-page .stats-chart {
	height: 320px;
}
.crm-table th[data-crm-sortable] {
	cursor: pointer;
}
.crm-tip-bubble {
	background: #0b1220;
	color: #e8f1ff;
	border: 1px solid #1f2a44;
	border-radius: 10px;
	padding: 8px 10px;
	box-shadow: 0 14px 34px rgba(0, 13, 34, 0.35);
	font-size: 12px;
	line-height: 1.35;
	max-width: 260px;
	white-space: pre-line;
}
.chart-tooltip strong {
	color: #d7e4ff;
}
.chart-tooltip .dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
}
.chart-tooltip__row {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 210px;
}
.chart-tooltip__text {
	color: #d7e4ff;
	max-width: 160px;
	white-space: normal;
}
.chart-tooltip__value {
	margin-left: auto;
	font-weight: 600;
}
.stats-page {
	color: #e8f1ff;
	padding: 4px 0 24px;
	max-width: 100%;
}
.stats-page .dashboard-header__title,
.stats-page .dashboard-header__subtitle,
.stats-page .section__title {
	color: #e8f1ff;
}
.stats-page .activity-filter__button {
	border-color: #1f2a44;
	color: #e8f1ff;
	background: #101a2f;
}
.stats-page .activity-filter__button.is-active,
.stats-page .activity-filter__button:focus {
	background: linear-gradient(90deg, #0f4ba8, #00a0dc);
	color: #e8f1ff;
	border-color: #00a0dc;
}
.stats-page .card {
	background: #0f172a;
	border: 1px solid #1f2a44;
	color: #e8f1ff;
	box-shadow: 0 16px 36px rgba(0, 13, 34, 0.35);
}
.stats-page .muted { color: #9eb3d9; }
.stats-page .chart-toggle span { color: #e8f1ff; }
.stats-page .chart-toggle input { accent-color: #00a0dc; }
.stats-page .chart-toggle[data-series="revenue"] span { color: var(--series-kpi-1); }
.stats-page .chart-toggle[data-series="contacts"] span { color: var(--series-kpi-2); }
.stats-page .chart-toggle[data-series="transactions"] span { color: var(--series-kpi-3); }
.stats-page .chart-toggle[data-series="processed"] span { color: var(--series-kpi-6); }
.stats-page .chart-toggle[data-series="cr"] span { color: var(--series-kpi-4); }
.stats-page .chart-toggle[data-series="arpu"] span { color: var(--series-kpi-5); }
.stats-page .chart-wrapper { background: #0b1220; border-radius: 8px; }
.stats-page .stats-card {
	padding: 16px;
}
.stats-page .chart-controls__note {
	margin-left: auto;
}
.stats-page .stats-panel__title {
	margin: 0 0 8px;
}
.compare-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 14px;
}
.compare-card {
	background: #0f172a;
	border: 1px solid #1f2a44;
	border-radius: 12px;
	padding: 14px;
	box-shadow: 0 16px 36px rgba(0, 13, 34, 0.35);
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}
.compare-card--center {
	justify-content: center;
}
.select-row {
	display: flex;
	align-items: center;
	gap: 10px;
}
.select-row--dual {
	gap: 14px;
	flex-wrap: wrap;
}
.select-col {
	min-width: 200px;
	flex: 1;
	display: flex;
	align-items: center;
	gap: 8px;
}
.select-label {
	color: #9eb3d9;
	font-size: 0.9rem;
	display: inline-block;
}
.crm-select {
	background: #0f172a;
	color: #e8f1ff;
	border: 1px solid #1f2a44;
	border-radius: 8px;
	padding: 8px 10px;
	min-width: 140px;
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, #7ab8ff 50%), linear-gradient(135deg, #7ab8ff 50%, transparent 50%);
	background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
}
.crm-select:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(122, 184, 255, .25);
}
.stats-page .select-row {
	min-width: 0;
	max-width: 100%;
}
.stats-page .select-row .crm-select {
	/* In Flex-Reihen darf das Select nicht implizit > Viewport werden (global ist select { width: 100% }) */
	width: auto;
	max-width: 100%;
	flex: 1 1 160px;
	min-width: 0;
}
.compare-title {
	font-size: 0.95rem;
	color: #9eb3d9;
	margin-bottom: 6px;
	font-weight: 700;
}
.compare-current {
	font-size: 1.6rem;
	font-weight: 700;
	color: #e8f1ff;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	align-items: center;
	min-width: 0;
	max-width: 100%;
	overflow-wrap: anywhere;
}
.compare-current--stacked {
	flex-direction: column;
	gap: 6px;
}
.compare-current--compact {
	font-size: 1rem;
	font-weight: 500;
	flex-direction: column;
	gap: 4px;
}
.compare-prev {
	color: #9eb3d9;
	margin-top: 2px;
}
.compare-meta {
	color: #9eb3d9;
	margin-top: 4px;
	font-size: 0.9rem;
}
.badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 700;
	white-space: nowrap;
}
.badge-up { background: rgba(16, 185, 129, 0.18); color: #5cf0c0; border: 1px solid rgba(16,185,129,0.3); }
.badge-down { background: rgba(239, 68, 68, 0.18); color: #ff9c9c; border: 1px solid rgba(239,68,68,0.35); }
.badge-neutral { background: rgba(158, 179, 217, 0.2); color: #e8f1ff; border: 1px solid rgba(158,179,217,0.35); }
.time-insights {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 16px;
}
.time-panel {
	background: #0f172a;
	border: 1px solid #1f2a44;
	border-radius: 10px;
	padding: 14px;
	box-shadow: 0 16px 36px rgba(0, 13, 34, 0.35);
	color: #e8f1ff;
}
.bar-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.bar-row {
	display: grid;
	grid-template-columns: 1fr auto 90px;
	gap: 8px;
	align-items: center;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid #1f2a44;
	border-radius: 8px;
	padding: 9px 10px;
}
.bar-row__label {
	font-size: 0.95rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: #e8f1ff;
}
.bar-row__bar {
	background: #1f2a44;
	height: 8px;
	position: relative;
	border-radius: 4px;
	overflow: hidden;
}
.bar-row__bar span {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, #00a0dc, #5ce1ff);
}
.bar-row__value {
	text-align: right;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	font-size: 0.95rem;
	color: #e8f1ff;
}

@media (max-width: 760px) {
	.stats-page .compare-card--center {
		display: none;
	}

	.stats-page .compare-grid,
	.stats-page .time-insights {
		grid-template-columns: 1fr;
	}

	.stats-page .select-row {
		flex-wrap: wrap;
		justify-content: center;
	}

	.stats-page .select-col {
		min-width: 0;
		width: 100%;
		justify-content: center;
	}

	.stats-page .chart-controls__note {
		margin-left: 0;
		flex: 1 1 100%;
		text-align: center;
	}
}
