/* ==========================================================================
   FranchiseMacher-CRM – Oberfläche der Instanz (Konzept Abschnitt 14)

   Eine Datei, Präfix `fm-`, Werte als Variablen. Struktur nach den neuen
   CRM-Seiten der Ausgangsinstanz (Konzept 14.1), Farb- und Abstandsdisziplin nach der
   Layout-Leitlinie des Deliver-Admin-Panels. Nichts hieraus gehört in
   style.css oder die Theme-Dateien der Vorlage.
   ========================================================================== */

:root {
	/* Marke (aus docs/franchisemacher-logo.svg) */
	--fm-akzent: #ec8c00;
	--fm-akzent-text: #9a5b00;     /* Orange als Schrift auf Weiß: #ec8c00 hat nur 2,6:1 */
	--fm-akzent-hell: #fdf1e0;
	--fm-grau-marke: #807d7f;

	/* Aktion */
	--fm-primaer: #1d5aa8;
	--fm-primaer-dunkel: #164888;
	--fm-primaer-hell: #e0ecfb;

	/* Neutral */
	--fm-tinte: #0f172a;
	--fm-text: #334155;
	--fm-gedaempft: #475569;
	--fm-grau-900: #0f172a; --fm-grau-800: #1e293b; --fm-grau-700: #334155;
	--fm-grau-600: #475569; --fm-grau-500: #64748b; --fm-grau-400: #94a3b8;
	--fm-grau-300: #cbd5e1; --fm-grau-200: #e2e8f0; --fm-grau-100: #f1f5f9;
	--fm-grau-50:  #f8fafc;
	--fm-linie: #e2e8f0;
	--fm-flaeche: #f8fafc;
	--fm-weiss: #ffffff;

	/* Status (Semantik bleibt Bootstrap, nur als Pastell mit dunkler Schrift) */
	--fm-ok-100: #dcfce7;     --fm-ok-800: #166534;
	--fm-warn-100: #fef3c7;   --fm-warn-800: #92400e;
	--fm-gefahr-100: #fee2e2; --fm-gefahr-800: #991b1b;
	--fm-info-100: #e0f2fe;   --fm-info-800: #075985;

	/* Schrift: Kleinschrift nie unter 13 px (Leitlinie, Lesbarkeit) */
	--fm-f12: 13px; --fm-f13: 14px; --fm-f14: 14px; --fm-f16: 16px;
	--fm-f18: 18px; --fm-f20: 20px; --fm-f24: 24px; --fm-f30: 30px;

	/* Abstände, Radien, Schatten */
	--fm-s1: 4px; --fm-s2: 8px; --fm-s3: 12px; --fm-s4: 16px;
	--fm-s5: 24px; --fm-s6: 32px; --fm-s7: 48px;
	--fm-radius-feld: .375rem; --fm-radius-karte: .75rem; --fm-radius-pille: 999px;
	--fm-schatten-1: 0 1px 3px rgba(15, 23, 42, .12);
	--fm-schatten-2: 0 5px 15px rgba(15, 23, 42, .12);

	/* Stapelreihenfolge (Konzept 14.4). Im Seiteninhalt nichts über 99. */
	--fm-z-select2: 99;
	--fm-z-seitenkopf: 1010;
	--fm-z-topbar: 1020;
}

/* --------------------------------------------------------------------------
   Grundfläche und Schrift
   -------------------------------------------------------------------------- */
body { background: var(--fm-flaeche); color: var(--fm-text); }
.page-wrapper { background: var(--fm-flaeche); }
.page-wrapper > .page-content { padding: var(--fm-s4) var(--fm-s5) var(--fm-s6); }
@media (max-width: 767.98px) { .page-wrapper > .page-content { padding: var(--fm-s3) var(--fm-s4) var(--fm-s5); } }

.page-content h1, .page-content h2, .page-content h3, .page-content h4, .page-content h5 { color: var(--fm-tinte); }
.page-content .text-muted, .page-content .form-text, .page-content small { color: var(--fm-gedaempft) !important; }
.page-content small { font-size: .92em; }
.page-content .badge { font-weight: 600; font-size: var(--fm-f12); padding: .3em .65em; border-radius: var(--fm-radius-pille); }
.page-content .badge.bg-success  { background: var(--fm-ok-100) !important;     color: var(--fm-ok-800) !important; }
.page-content .badge.bg-danger   { background: var(--fm-gefahr-100) !important; color: var(--fm-gefahr-800) !important; }
.page-content .badge.bg-warning  { background: var(--fm-warn-100) !important;   color: var(--fm-warn-800) !important; }
.page-content .badge.bg-info     { background: var(--fm-info-100) !important;   color: var(--fm-info-800) !important; }
.page-content .badge.bg-light    { color: var(--fm-grau-800) !important; }
.page-content .badge.bg-secondary, .page-content .badge.bg-dark { background: var(--fm-grau-200) !important; color: var(--fm-grau-800) !important; }

.page-content .btn-primary { background: var(--fm-primaer); border-color: var(--fm-primaer); }
.page-content .btn-primary:hover, .page-content .btn-primary:focus { background: var(--fm-primaer-dunkel); border-color: var(--fm-primaer-dunkel); }
.page-content .btn-outline-primary { color: var(--fm-primaer); border-color: var(--fm-primaer); }
.page-content .btn-outline-primary:hover { background: var(--fm-primaer); border-color: var(--fm-primaer); color: #fff; }
.page-content .form-control:focus, .page-content .form-select:focus { border-color: var(--fm-akzent); box-shadow: 0 0 0 .18rem rgba(236, 140, 0, .18); }
.page-content a:not(.btn):not(.badge):not(.nav-link):not(.dropdown-item) { color: var(--fm-primaer); }

/* Hinweise: gelb mit dunkler Schrift, nie weiß auf gelb */
.page-content .alert-warning, .page-content .alert-warning.text-white { background: var(--fm-warn-100) !important; color: var(--fm-warn-800) !important; }
.page-content .alert-warning .btn-close { filter: none; }

/* --------------------------------------------------------------------------
   Stapelreihenfolge (Konzept 14.4) – übernommen aus dem Deliver-Panel.
   Das Theme gibt .alert 99 und .topbar 50; das Megamenü lebt im Kontext der
   Topbar und wäre damit unter jedem Hinweis. Select2 hängt sich mit 1051 an
   body und läge ebenfalls über dem Megamenü.
   -------------------------------------------------------------------------- */
.page-wrapper .alert { z-index: auto; }
.topbar { z-index: var(--fm-z-topbar); }
.select2-container--open { z-index: var(--fm-z-select2) !important; }
.page-content .select2-container:not(.select2-container--open) { z-index: auto; }
.select2-container--open .select2-dropdown { max-width: 480px; }

/* --------------------------------------------------------------------------
   Kopfleiste und Logo
   -------------------------------------------------------------------------- */
.topbar { background: var(--fm-weiss); box-shadow: 0 1px 0 var(--fm-linie); }
.topbar .navbar-header { border-right: 1px solid var(--fm-linie) !important; }
.topbar .navbar-brand { display: flex; align-items: center; gap: var(--fm-s2); }
.fm-logo { height: 24px; width: auto; max-width: 200px; display: block; }   /* Betreiber 09.11.2026: schmaler, nie breiter als die Leiste */
.fm-logo-icon { height: 30px; width: 30px; display: block; border-radius: 7px; }
.topbar .top-navbar .navbar-nav > .nav-item > .nav-link { color: var(--fm-grau-600); }
.topbar .top-navbar .navbar-nav > .nav-item > .nav-link:hover { color: var(--fm-tinte); }
.topbar .mega-dropdown .dropdown-menu { border-top: 3px solid var(--fm-akzent); }
.topbar .mega-dropdown h4 { font-size: var(--fm-f14); font-weight: 700; color: var(--fm-grau-600); text-transform: uppercase; letter-spacing: .04em; }
.topbar .mega-dropdown .nav-link { color: var(--fm-grau-800); font-size: var(--fm-f14); }
.topbar .mega-dropdown .nav-link .mdi { color: var(--fm-grau-500); margin-right: var(--fm-s1); }
.topbar .app-search .form-control { background: var(--fm-grau-100); border: 1px solid var(--fm-linie); border-radius: var(--fm-radius-pille); }

/* --------------------------------------------------------------------------
   Seitenkopf (Leitlinie): Titel links, Pfad rechts, ohne Fläche und Schatten;
   ab 768 px bleibt er unter der Kopfleiste stehen. Sticky liegt auf dem
   Wrapper .breadcrumb-hidden; body und #main-wrapper brauchen dafür
   overflow: clip statt hidden, sonst greift Sticky nie.
   -------------------------------------------------------------------------- */
.page-breadcrumb.fm-seitenkopf {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
	gap: var(--fm-s1) var(--fm-s4); padding: var(--fm-s3) var(--fm-s5);
	background: transparent; box-shadow: none; border-bottom: 1px solid var(--fm-linie);
}
.fm-seitenkopf .fm-seitentitel { margin: 0; font-size: var(--fm-f20); font-weight: 700; color: var(--fm-tinte); }
.fm-seitenkopf .breadcrumb { background: transparent; margin: 0; padding: 0; font-size: var(--fm-f13); }
.fm-seitenkopf .breadcrumb .breadcrumb-item, .fm-seitenkopf .breadcrumb .breadcrumb-item > a { color: var(--fm-gedaempft); text-decoration: none; }
.fm-seitenkopf .breadcrumb .breadcrumb-item > a:hover { color: var(--fm-tinte); }
.fm-seitenkopf .breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: var(--fm-grau-400); }
.fm-seitenkopf nav { margin-top: 0 !important; }
@media (min-width: 768px) {
	body { overflow-x: clip; }
	#main-wrapper { overflow: clip; }
	.page-wrapper > .breadcrumb-hidden { position: sticky; top: 60px; z-index: var(--fm-z-seitenkopf); background: var(--fm-flaeche); }
}
@media (max-width: 767.98px) {
	.page-breadcrumb.fm-seitenkopf { padding: var(--fm-s2) var(--fm-s4); flex-direction: column; align-items: flex-start; }
}

/* --------------------------------------------------------------------------
   Seitenleiste: weiße Fläche, dunkle Schrift, orangene Innenkante am aktiven
   Punkt. Das Theme hat die Links weiß und den gewählten Punkt rot.
   -------------------------------------------------------------------------- */
.left-sidebar { background: var(--fm-weiss); box-shadow: none; border-right: 1px solid var(--fm-linie); }
.left-sidebar .scroll-sidebar { padding-bottom: 96px; }           /* Platz für den Profilfuß */
.sidebar-nav ul .sidebar-item .sidebar-link { color: var(--fm-grau-700); opacity: 1; font-weight: 500; padding: 11px 14px; line-height: 24px; font-size: var(--fm-f14); }
.sidebar-nav ul .sidebar-item .sidebar-link i { color: var(--fm-grau-500); font-size: 20px; line-height: 24px; }
.sidebar-nav ul .sidebar-item:hover { background: var(--fm-grau-50); }
.sidebar-nav ul .sidebar-item .sidebar-link:hover, .sidebar-nav ul .sidebar-item .sidebar-link:hover i { color: var(--fm-tinte); }
.sidebar-nav ul .sidebar-item.selected > .sidebar-link,
.sidebar-nav ul .sidebar-item > .sidebar-link.active {
	background: var(--fm-akzent-hell); color: var(--fm-tinte); font-weight: 600;
	border-left: 0; box-shadow: inset 3px 0 0 var(--fm-akzent);
}
.sidebar-nav ul .sidebar-item.selected > .sidebar-link i, .sidebar-nav ul .sidebar-item > .sidebar-link.active i { color: var(--fm-akzent-text); }
.sidebar-nav ul .nav-small-cap { color: var(--fm-grau-500); font-size: var(--fm-f12); letter-spacing: .06em; font-weight: 700; padding: 10px 14px 4px; margin-top: var(--fm-s2); line-height: 20px; }
.sidebar-nav .devider { border-top-color: var(--fm-linie); opacity: 1; }
.sidebar-nav .has-arrow::after { border-color: var(--fm-grau-500); }

/* Profilmenü unten in der Seitenleiste (Konzept 14.3, Muster Gebietsmanager).
   Absolut am Fuß der Leiste, klappt nach oben, zeigt Name und Mandant. */
.fm-profilfuss {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
	background: var(--fm-weiss); border-top: 1px solid var(--fm-linie); padding: var(--fm-s2);
}
.fm-profilknopf {
	display: flex; align-items: center; gap: 10px; padding: 6px 8px;
	border-radius: 8px; color: var(--fm-grau-700); text-decoration: none;
}
.fm-profilknopf:hover, .fm-profilknopf:focus-visible { background: var(--fm-grau-100); color: var(--fm-tinte); }
.fm-profilbild { flex: none; width: 32px; height: 32px; object-fit: cover; }
.fm-profiltext { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.fm-profilname { font-weight: 600; font-size: var(--fm-f13); color: var(--fm-tinte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-profilmandant { font-size: var(--fm-f12); color: var(--fm-gedaempft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-profilpfeil { margin-left: auto; color: var(--fm-grau-400); }
.fm-profilmenue { min-width: 240px; border: 1px solid var(--fm-linie); border-radius: var(--fm-radius-karte); box-shadow: var(--fm-schatten-2); padding: var(--fm-s2) 0; }
.fm-profilmenue .dropdown-item { font-size: var(--fm-f14); color: var(--fm-grau-800); padding: 7px 14px; }
.fm-profilmenue .dropdown-item i { width: 22px; color: var(--fm-grau-500); }
.fm-profilmenue .dropdown-item:hover { background: var(--fm-grau-50); color: var(--fm-tinte); }
.fm-profilmenue .fm-profilkopf { padding: 6px 14px 10px; }
.fm-profilmenue .fm-profilkopf strong { display: block; font-size: var(--fm-f14); color: var(--fm-tinte); }
.fm-profilmenue .fm-profilkopf small { display: block; font-size: var(--fm-f12); color: var(--fm-gedaempft); overflow: hidden; text-overflow: ellipsis; }
.fm-profilmenue .fm-rechtliches { display: flex; gap: var(--fm-s3); padding: 6px 14px 0; font-size: var(--fm-f12); }
.fm-profilmenue .fm-rechtliches a { color: var(--fm-grau-500); text-decoration: none; }
.fm-profilmenue .fm-rechtliches a:hover { color: var(--fm-tinte); }
#main-wrapper[data-sidebartype="mini-sidebar"] .fm-profilknopf { justify-content: center; }
#main-wrapper[data-sidebartype="mini-sidebar"] .left-sidebar:not(:hover) .fm-profiltext,
#main-wrapper[data-sidebartype="mini-sidebar"] .left-sidebar:not(:hover) .fm-profilpfeil { display: none; }
#main-wrapper[data-sidebartype="mini-sidebar"] .left-sidebar .scroll-sidebar { padding-bottom: 64px; }

/* --------------------------------------------------------------------------
   Bausteine (Konzept 14.1): Listenkopf, Filter, Liste, Werkzeuge, Reiter,
   Fläche, Identität, Status, Karten. Struktur wie in der Ausgangsinstanz, Farbe ruhig.
   -------------------------------------------------------------------------- */
.fm-seite { max-width: 1420px; }
.fm-eyebrow { display: block; margin-bottom: var(--fm-s1); color: var(--fm-akzent-text); font-size: var(--fm-f12); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.fm-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--fm-s3) var(--fm-s5); margin-bottom: var(--fm-s4); padding: var(--fm-s4) var(--fm-s5); border: 1px solid var(--fm-linie); border-radius: var(--fm-radius-karte); background: var(--fm-weiss); }
.fm-kopf h1 { margin: 0; font-size: clamp(1.4rem, 1.8vw, 1.85rem); font-weight: 650; color: var(--fm-tinte); }
.fm-kopf p { margin: var(--fm-s1) 0 0; color: var(--fm-gedaempft); font-size: var(--fm-f14); }
.fm-kopf-aktionen { display: flex; flex-wrap: wrap; gap: var(--fm-s2); justify-content: flex-end; margin-left: auto; }

.fm-filter { padding: var(--fm-s4) var(--fm-s5); margin-bottom: var(--fm-s4); border: 1px solid var(--fm-linie); border-radius: var(--fm-radius-karte); background: var(--fm-weiss); }
.fm-filter h3 { margin: 0 0 var(--fm-s3); padding-bottom: var(--fm-s2); border-bottom: 1px solid var(--fm-linie); font-size: var(--fm-f16); font-weight: 600; }
.fm-filter label, .fm-filter .form-label { margin-bottom: var(--fm-s1); color: var(--fm-grau-700); font-size: var(--fm-f13); font-weight: 600; }
.fm-filter .form-check { margin: 0 var(--fm-s2) var(--fm-s2) 0; padding: .4rem .7rem .4rem 2.2rem; border: 1px solid var(--fm-grau-300); border-radius: var(--fm-radius-feld); background: var(--fm-weiss); }
.fm-filter .form-check-input { margin-left: -1.5rem; margin-top: .2rem; }
.fm-filter .form-check:has(.form-check-input:checked) { border-color: var(--fm-akzent); background: var(--fm-akzent-hell); }
.fm-filter .form-check:has(.form-check-input:checked) .form-check-label { color: var(--fm-akzent-text); font-weight: 600; }

.fm-liste { overflow: hidden; border: 1px solid var(--fm-linie); border-top: 3px solid var(--fm-akzent); border-radius: var(--fm-radius-karte); background: var(--fm-weiss); box-shadow: var(--fm-schatten-1); }
.fm-liste > h4, .fm-liste > .fm-liste-kopf { margin: 0; padding: var(--fm-s3) var(--fm-s5); border-bottom: 1px solid var(--fm-linie); font-size: var(--fm-f16); font-weight: 600; color: var(--fm-tinte); }
.fm-liste .table { margin: 0; --bs-table-striped-bg: var(--fm-grau-50); color: var(--fm-grau-800); }
.fm-liste .table thead th { padding: .8rem .75rem; border-bottom: 1px solid var(--fm-linie); background: var(--fm-grau-50); color: var(--fm-grau-600); font-size: var(--fm-f12); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.fm-liste .table tbody td { padding: .8rem .75rem; border-color: var(--fm-grau-100); vertical-align: middle; }
.fm-liste .table tbody tr > :first-child { position: relative; }
.fm-liste .table tbody tr > :first-child::before { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--fm-akzent); content: ""; opacity: 0; transition: opacity 120ms ease; }
.fm-liste .table tbody tr:hover > * { --bs-table-accent-bg: var(--fm-akzent-hell); }
.fm-liste .table tbody tr:hover > :first-child::before { opacity: 1; }
.fm-liste .table a:not(.btn):not(.badge) { color: var(--fm-grau-900); font-weight: 600; text-decoration: none; }
.fm-liste .table a:not(.btn):not(.badge):hover { color: var(--fm-primaer); text-decoration: underline; }
.fm-liste .table .fm-sekundaer { color: var(--fm-gedaempft); font-size: var(--fm-f13); }

.fm-werkzeuge { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fm-s2); margin-bottom: var(--fm-s4); padding: var(--fm-s2) var(--fm-s3); border: 1px solid var(--fm-linie); border-radius: var(--fm-radius-karte); background: var(--fm-weiss); }
.fm-werkzeuge .btn { box-shadow: none; }

.fm-reiter { margin: var(--fm-s4) 0 var(--fm-s3); padding: var(--fm-s2); border: 1px solid var(--fm-linie); border-radius: var(--fm-radius-karte); background: var(--fm-grau-50); }
.fm-reiter .nav-tabs { gap: var(--fm-s2); border: 0; }
.fm-reiter .nav-tabs .nav-link { border: 1px solid var(--fm-grau-300); border-radius: var(--fm-radius-feld); background: var(--fm-weiss); color: var(--fm-grau-700); font-weight: 600; font-size: var(--fm-f14); }
.fm-reiter .nav-tabs .nav-link:hover { border-color: var(--fm-akzent); color: var(--fm-tinte); }
.fm-reiter .nav-tabs .nav-link.active { border-color: var(--fm-akzent); background: var(--fm-akzent-hell); color: var(--fm-akzent-text); }
@media (max-width: 767.98px) { .fm-reiter .nav-tabs { flex-wrap: nowrap; overflow-x: auto; } .fm-reiter .nav-tabs .nav-link { white-space: nowrap; } }

.fm-flaeche { padding: var(--fm-s5); border: 1px solid var(--fm-linie); border-radius: var(--fm-radius-karte); background: var(--fm-weiss); box-shadow: var(--fm-schatten-1); }
.fm-flaeche h3 { font-size: var(--fm-f16); font-weight: 600; color: var(--fm-tinte); }
.fm-flaeche + .fm-flaeche { margin-top: var(--fm-s4); }

.fm-identitaet { display: flex; align-items: center; gap: var(--fm-s3); margin-bottom: var(--fm-s4); padding-bottom: var(--fm-s3); border-bottom: 1px solid var(--fm-linie); }
.fm-identitaet-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--fm-akzent-hell); color: var(--fm-akzent-text); font-size: 1.1rem; }
.fm-identitaet h2 { margin: 0; font-size: var(--fm-f20); font-weight: 650; color: var(--fm-tinte); }
.fm-identitaet p { margin: 2px 0 0; color: var(--fm-gedaempft); font-size: var(--fm-f14); }

.fm-status.input-group { overflow: hidden; border: 1px solid var(--fm-grau-300); border-radius: var(--fm-radius-feld); background: var(--fm-weiss); }
.fm-status .input-group-text { border: 0; border-right: 1px solid var(--fm-linie); border-radius: 0; background: var(--fm-grau-50); color: var(--fm-grau-700); font-size: var(--fm-f13); font-weight: 700; }
.fm-status .form-select { border: 0; border-radius: 0; font-weight: 600; cursor: pointer; }
.fm-status:focus-within { border-color: var(--fm-akzent); box-shadow: 0 0 0 .18rem rgba(236, 140, 0, .18); }

/* Formular mit Orientierungsspalte (Leitlinie, Refactoring UI S. 80/81) */
.fm-abschnitt { display: grid; grid-template-columns: minmax(12rem, 24%) minmax(0, 1fr); gap: var(--fm-s4) var(--fm-s7); align-items: start; padding: var(--fm-s5) 0; border-top: 1px solid var(--fm-linie); }
.fm-abschnitt:first-of-type, .fm-abschnitt.fm-abschnitt-erster { padding-top: 0; border-top: 0; }
.fm-abschnitt-kopf h5 { margin: 0 0 var(--fm-s1); font-size: var(--fm-f16); font-weight: 700; color: var(--fm-tinte); }
.fm-abschnitt-kopf p { margin: 0 0 var(--fm-s2); font-size: var(--fm-f13); line-height: 1.55; color: var(--fm-gedaempft); }
.fm-abschnitt-kopf p:last-child { margin-bottom: 0; }
.fm-abschnitt-felder { min-width: 0; max-width: 52rem; }
.fm-formfuss { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fm-s2); padding-top: var(--fm-s5); border-top: 1px solid var(--fm-linie); }
.page-content .form-label { margin-bottom: .3rem; font-size: var(--fm-f14); font-weight: 600; color: var(--fm-grau-700); }
@media (max-width: 991.98px) { .fm-abschnitt { grid-template-columns: 1fr; gap: var(--fm-s3); } }

/* Leerer Zustand */
.fm-leer { display: flex; flex-direction: column; align-items: center; gap: var(--fm-s2); padding: var(--fm-s6) var(--fm-s4); color: var(--fm-grau-500); text-align: center; background: var(--fm-grau-50); border: 1px dashed var(--fm-grau-300); border-radius: var(--fm-radius-karte); }
.fm-leer .mdi { font-size: var(--fm-f30); color: var(--fm-grau-400); }
.fm-leer strong { color: var(--fm-grau-700); }

/* --------------------------------------------------------------------------
   Startseite: Karten der Dashboard-Blöcke der Vorlage (sie bringen kein CSS mit)
   -------------------------------------------------------------------------- */
.fm-start-gruss { margin-bottom: var(--fm-s4); }
.fm-start-gruss h1 { margin: 0; font-size: clamp(1.4rem, 1.8vw, 1.85rem); font-weight: 650; color: var(--fm-tinte); }
.fm-start-gruss p { margin: var(--fm-s1) 0 0; color: var(--fm-gedaempft); }

.dashboard-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--fm-linie); border-radius: var(--fm-radius-karte); background: var(--fm-weiss); box-shadow: var(--fm-schatten-1); }
.dashboard-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--fm-s3); padding: var(--fm-s4) var(--fm-s5) var(--fm-s3); border-top: 3px solid var(--fm-akzent); border-bottom: 1px solid var(--fm-linie); }
.dashboard-card--resubmissions .dashboard-card__header { border-top-color: #d28c2b; }
.dashboard-card--projects .dashboard-card__header { border-top-color: var(--fm-primaer); }
.dashboard-card--activity .dashboard-card__header { border-top-color: var(--fm-grau-400); }
.dashboard-card__header h2 { margin: 0; font-size: var(--fm-f18); font-weight: 650; color: var(--fm-tinte); }
.dashboard-card__eyebrow { display: block; margin-bottom: 2px; color: var(--fm-gedaempft); font-size: var(--fm-f12); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-card__count { display: inline-block; margin-left: var(--fm-s1); padding: 0 .5em; border-radius: var(--fm-radius-pille); background: var(--fm-primaer-hell); color: var(--fm-primaer); font-size: var(--fm-f13); vertical-align: middle; }
.dashboard-card__all-link, .dashboard-card__hint { font-size: var(--fm-f13); color: var(--fm-gedaempft); white-space: nowrap; }
.dashboard-card__all-link { color: var(--fm-primaer); text-decoration: none; font-weight: 600; }
.dashboard-card__metrics { display: flex; gap: var(--fm-s4); padding: var(--fm-s3) var(--fm-s5) 0; }
.dashboard-metric strong { display: block; font-size: var(--fm-f24); font-weight: 700; line-height: 1.1; color: var(--fm-tinte); }
.dashboard-metric span { font-size: var(--fm-f13); color: var(--fm-gedaempft); }
.dashboard-metric--danger strong { color: var(--fm-gefahr-800); }
.dashboard-card__body { padding: var(--fm-s2) var(--fm-s3) var(--fm-s3); }
.dashboard-list-row { display: flex; align-items: center; gap: var(--fm-s3); padding: var(--fm-s2) var(--fm-s2); border-radius: var(--fm-radius-feld); color: inherit; text-decoration: none; }
.dashboard-list-row, .dashboard-list-row:hover, .dashboard-list-row * { text-decoration: none !important; }   /* das Thema unterstreicht sonst jeden Link samt Inhalt */
.dashboard-list-row:hover { background: var(--fm-grau-50); color: inherit; }
.dashboard-list-row__signal { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--fm-grau-300); }
.dashboard-list-row__signal.is-overdue, .dashboard-list-row__signal.due-overdue { background: var(--fm-gefahr-800); }
.dashboard-list-row__signal.is-today, .dashboard-list-row__signal.due-today { background: var(--fm-akzent); }
.dashboard-list-row__content { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.dashboard-list-row__content strong { font-size: var(--fm-f14); font-weight: 600; color: var(--fm-tinte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-list-row__content small { font-size: var(--fm-f13); color: var(--fm-gedaempft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-list-row time, .dashboard-project-meta time { font-size: var(--fm-f13); color: var(--fm-gedaempft); white-space: nowrap; }
.dashboard-project-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.dashboard-empty { padding: var(--fm-s4); color: var(--fm-grau-500); font-size: var(--fm-f14); text-align: center; }
.dashboard-activity-row { display: flex; gap: var(--fm-s3); align-items: flex-start; padding: var(--fm-s2); border-top: 1px solid var(--fm-grau-100); }
.dashboard-activity-row:first-child { border-top: 0; }
.dashboard-activity-row__time { flex: none; width: 7.5rem; font-size: var(--fm-f13); color: var(--fm-gedaempft); }
.dashboard-activity-row__time small { display: block; font-size: var(--fm-f12); }
.dashboard-activity-row__content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.dashboard-activity-row__content strong { font-size: var(--fm-f14); color: var(--fm-tinte); }
.dashboard-activity-row__content span { font-size: var(--fm-f14); }
.dashboard-activity-row__content small { font-size: var(--fm-f13); color: var(--fm-gedaempft); }
.dashboard-activity-row__action { flex: none; align-self: center; }
@media (max-width: 767.98px) { .dashboard-activity-row { flex-wrap: wrap; } .dashboard-activity-row__time { width: 100%; } }

/* Fußzeile */
.footer { background: transparent; color: var(--fm-grau-500); font-size: var(--fm-f13); }
.footer a { color: var(--fm-grau-600); }

/* --------------------------------------------------------------------------
   CRM (Schritt 3): Projektkarten, Adresskarten, Statusabzeichen
   -------------------------------------------------------------------------- */
.fm-projektkarte { border: 1px solid var(--fm-linie); border-radius: var(--fm-radius-karte); color: var(--fm-text); transition: border-color 120ms ease, box-shadow 120ms ease; }
.fm-projektkarte:hover { border-color: var(--fm-akzent); box-shadow: var(--fm-schatten-1); color: var(--fm-text); }
.fm-projektkarte .card-title { font-size: var(--fm-f16); color: var(--fm-tinte); }
.fm-adresskarte { border: 1px solid var(--fm-linie); border-radius: var(--fm-radius-feld); padding: var(--fm-s2) var(--fm-s3); background: var(--fm-grau-50); }
.fm-adresskarte h4 { font-size: var(--fm-f14); font-weight: 600; margin: 0 0 var(--fm-s1); color: var(--fm-tinte); }
.fm-adresskarte p { margin: 0; font-size: var(--fm-f14); }
.page-content .status { display: inline-block; padding: .2em .65em; border-radius: var(--fm-radius-pille); font-size: var(--fm-f12); font-weight: 600; border: 1px solid transparent; background: var(--fm-grau-100); color: var(--fm-grau-800); }
.page-content .status-grey   { background: var(--fm-grau-100); color: var(--fm-grau-800); }
.page-content .status-blue   { background: var(--fm-info-100); color: var(--fm-info-800); }
.page-content .status-yellow { background: var(--fm-warn-100); color: var(--fm-warn-800); }
.page-content .status-orange { background: var(--fm-akzent-hell); color: var(--fm-akzent-text); }
.page-content .status-green  { background: var(--fm-ok-100); color: var(--fm-ok-800); }
.page-content .status-red    { background: var(--fm-gefahr-100); color: var(--fm-gefahr-800); }
.page-content select.form-select[class*="status-"] { background-color: var(--fm-weiss); color: var(--fm-tinte); }
.fm-kundendetails .fm-flaeche h3, .fm-projektdetails .fm-flaeche h3 { font-size: var(--fm-f14); text-transform: uppercase; letter-spacing: .06em; color: var(--fm-gedaempft); margin-bottom: var(--fm-s3); }
.fm-notizen .timeline { margin-top: var(--fm-s3); }
.cursor-pointer { cursor: pointer; }
.fm-projektkarte[class*="status-"] { background: var(--fm-weiss); }   /* Theme färbt .card.status-* komplett ein */

/* --------------------------------------------------------------------------
   Kanban-Board der Projekte (O18): hellgraue Spalten, weiße Karten, Farbe
   nur als Linie am Spaltenkopf. Volle Breite, waagerecht scrollbar.
   -------------------------------------------------------------------------- */
.fm-board { max-width: none; }
.fm-board-scroll { overflow-x: auto; padding: 2px 2px 12px; }
.fm-board-spalten { display: flex; align-items: flex-start; gap: var(--fm-s3); min-height: 60vh; }
.fm-board-spalte { flex: 1 1 0; min-width: 200px; max-width: 320px; background: var(--fm-grau-100); border-radius: var(--fm-radius-karte); padding-bottom: var(--fm-s2); }
.fm-board-kopf { display: flex; justify-content: space-between; align-items: center; gap: var(--fm-s2); padding: var(--fm-s2) var(--fm-s3); border-bottom: 2px solid var(--fm-grau-300); margin-bottom: var(--fm-s2); }
.fm-board-farbe-red .fm-board-kopf { border-bottom-color: var(--fm-gefahr-800); }
.fm-board-farbe-orange .fm-board-kopf { border-bottom-color: var(--fm-akzent); }
.fm-board-farbe-yellow .fm-board-kopf { border-bottom-color: var(--fm-warn-800); }
.fm-board-farbe-green .fm-board-kopf { border-bottom-color: var(--fm-ok-800); }
.fm-board-farbe-blue .fm-board-kopf { border-bottom-color: var(--fm-info-800); }
.fm-board-titel { font-weight: 600; font-size: var(--fm-f14); color: var(--fm-tinte); }
.fm-board-hinweis { font-weight: 400; font-size: var(--fm-f12); color: var(--fm-gedaempft); margin-left: 4px; }
.fm-board-zahl { font-size: var(--fm-f13); color: var(--fm-gedaempft); font-variant-numeric: tabular-nums; }
.fm-board-karten { min-height: 60px; padding: 2px var(--fm-s2); }
.fm-board-karte { background: var(--fm-weiss); border: 1px solid var(--fm-linie); border-radius: var(--fm-radius-feld); padding: var(--fm-s2) var(--fm-s3); margin-bottom: var(--fm-s2); cursor: grab; box-shadow: var(--fm-schatten-1); }
.fm-board-karte:hover { border-color: var(--fm-akzent); }
.fm-board-karte.is-busy { opacity: .5; }
.fm-board-karte.gu-mirror { box-shadow: var(--fm-schatten-2); transform: rotate(-1deg); cursor: grabbing; }
.fm-board-karte-link, .fm-board-karte-link:hover { display: block; color: inherit; text-decoration: none !important; }
.fm-board-karte-titel { display: block; font-weight: 600; font-size: var(--fm-f14); color: var(--fm-tinte); line-height: 1.3; }
.fm-board-karte-sub { display: block; font-size: var(--fm-f13); color: var(--fm-gedaempft); }
.fm-board-karte-meta { margin-top: 4px; font-size: var(--fm-f12); color: var(--fm-gedaempft); display: flex; justify-content: space-between; gap: 6px; }
.fm-board-karte-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-board-karte-mandant { color: var(--fm-akzent-text); font-weight: 600; }
.fm-board-karte-fuss { display: flex; justify-content: space-between; margin-top: 6px; font-size: var(--fm-f12); color: var(--fm-gedaempft); }
.fm-board-karte-fuss a { color: var(--fm-primaer); text-decoration: none; }
.gu-transit { opacity: .3; }
@media (max-width: 767.98px) { .fm-board-spalte { flex: 0 0 82vw; min-width: 82vw; max-width: 82vw; } }

/* Kopfleiste: Logo und Suche vertikal mittig, Suche mit Abstand rechts (Betreiber 08.11.2026) */
.topbar .top-navbar .navbar-header { height: 60px; display: flex; align-items: center; }
.topbar .top-navbar .navbar-brand { margin: 0; padding: 0 var(--fm-s4); display: flex; align-items: center; }
.topbar .top-navbar .navbar-nav .search-box { display: flex; align-items: center; height: 60px; margin-right: var(--fm-s4); }
.topbar .app-search { margin-top: 0; }
.fm-logo-icon { border-radius: 0; background: transparent; }

/* Stammdaten: Herkunft und Merkmale (Feldliste) */
.fm-herkunft li { font-size: 13px; }
.fm-herkunft .mdi { color: var(--fm-grau-marke); }
.fm-auswahl .fm-inaktiv td { color: #999; }
.fm-profil-zugehoerigkeit dt { font-weight: 500; color: #6c757d; }

/* Dashboard: zusammengefasste Aktionen eines Bearbeiters am selben Kunden */
.dashboard-activity-row__liste { list-style: none; margin: var(--fm-s1) 0 0; padding: 0; font-size: var(--fm-f13); color: var(--fm-gedaempft); }
.dashboard-activity-row__liste li { padding: 1px 0; }
.dashboard-activity-row__liste .mdi { color: var(--fm-grau-marke); }

/* Statusverlauf (Zeitleiste) */
.fm-verlauf { list-style: none; margin: 0; padding: 0; }
.fm-verlauf-zeile { display: grid; grid-template-columns: 6.5rem 1rem 1fr auto; gap: var(--fm-s2); align-items: center; padding: 6px 0; position: relative; }
.fm-verlauf-zeile + .fm-verlauf-zeile { border-top: 1px dashed var(--fm-grau-100); }
.fm-verlauf-datum { font-size: var(--fm-f13); color: var(--fm-text); }
.fm-verlauf-datum small { display: block; color: var(--fm-gedaempft); font-size: var(--fm-f13); }
.fm-verlauf-punkt { width: 10px; height: 10px; border-radius: 50%; padding: 0; justify-self: center; }
.fm-verlauf-aktuell .fm-verlauf-punkt { box-shadow: 0 0 0 3px var(--fm-primaer-hell); }
.fm-verlauf-dauer { font-size: var(--fm-f13); white-space: nowrap; }
.fm-status-datum { max-width: 10.5rem; }

/* Auswertungen: eine Reihe je Tabelle, ein Farbton, Werte immer als Text daneben */
.fm-aw-zahl { font-size: 2rem; font-weight: 700; color: var(--fm-tinte); line-height: 1.2; margin-top: var(--fm-s1); }
.fm-aw-balkenspalte { width: 40%; min-width: 120px; }
.fm-aw-balken { display: block; height: 10px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--fm-primaer); }
.fm-aw-abschluss .fm-aw-balken { background: var(--fm-primaer-dunkel); }
.fm-aw-archiv .fm-aw-balken { background: var(--fm-grau-400); }
.fm-aw-tabelle td, .fm-aw-tabelle th { font-size: var(--fm-f14); }

/* Vermittlung und Provision (Betreiber) */
.fm-vorgang { border: 1px solid var(--fm-grau-100); border-radius: var(--fm-radius-feld, 8px); padding: var(--fm-s3); margin-top: var(--fm-s3); }
.fm-vorgang-zu { background: var(--fm-grau-50, #f8fafc); }
.fm-vorgang-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--fm-s2); margin-bottom: var(--fm-s2); }
.fm-nachfassen { list-style: none; padding: 0; margin: 0; font-size: var(--fm-f14); }
.fm-nachfassen li { padding: 3px 0; }
.fm-nachfassen-datum { display: inline-block; width: 6.5rem; color: var(--fm-gedaempft); }
.fm-nachfassen li.is-overdue .fm-nachfassen-datum { color: var(--fm-gefahr-800); font-weight: 600; }
.fm-nachfassen li.is-done { color: var(--fm-gedaempft); text-decoration: line-through; }
.fm-nachfassen li.is-done .fm-sekundaer { text-decoration: none; display: inline-block; }

/* Merkmal-Pille (eigene Klasse: das Thema setzt .badge auf weiße Schrift) */
.fm-merkmal { display: inline-block; padding: 2px 10px; margin: 0 4px 4px 0; border: 1px solid var(--fm-grau-200); border-radius: var(--fm-radius-pille, 999px); background: var(--fm-grau-50); color: var(--fm-text); font-size: var(--fm-f13); font-weight: 500; line-height: 1.5; }
.fm-verlauf-punkt { border: 2px solid currentColor; }
.fm-aw-tabelle td.text-end, .fm-aw-tabelle th.text-end { white-space: nowrap; }

/* Bearbeiter (A8) */
.fm-bearbeiter { margin-top: var(--fm-s3); padding-top: var(--fm-s2); border-top: 1px dashed var(--fm-grau-100); font-size: var(--fm-f14); }
.fm-bearbeiter-form summary { cursor: pointer; color: var(--fm-primaer); font-size: var(--fm-f13); }

/* Fremder Eigentümer am Lead und fremde Leads in der Liste (Betreiber 12.11.2026) */
.fm-fremd-eigentuemer {
	display: inline-flex; align-items: center; gap: .4rem;
	padding: .4rem .8rem; border: 2px solid #dc2626; border-radius: 6px;
	background: var(--fm-gefahr-100); color: var(--fm-gefahr-800);
}
.fm-fremd-eigentuemer strong { color: var(--fm-gefahr-800); }
.table tr.fm-zeile-fremd { --bs-table-bg: #fff8db; --bs-table-hover-bg: #fdf0bf; }
.fm-legende-fremd { display: inline-block; width: .9rem; height: .9rem; vertical-align: -2px; border-radius: 3px; background: #fff8db; border: 1px solid #f0d77a; }
/* Sortierbare Spaltenköpfe (Betreiber 12.11.2026) */
a.fm-sortkopf { color: inherit; text-decoration: none; white-space: nowrap; }
a.fm-sortkopf:hover, a.fm-sortkopf.is-aktiv { color: var(--fm-primaer); }
