/**
 * IFM Connect — Frontend-Styles.
 *
 * Look & Feel: Cleversoft-Bestand (docs/example-screenshot-fonds-page/)
 * + Factsheet-Anmutung (docs/example-factsheet/): Cards mit goldenen
 * Blocktiteln. Kopfbereich (abgesegnet 2026-07-18): Fondsname als Headline
 * mit Gold-Klassen-Badge, Anteilsklassen als kompakte Pills, Eckdaten als
 * helle Leiste — Navy-Vollfläche exklusiv für die Sektions-Balken.
 * Farbwerte gesampelt: Navy #2F426B, Gold #C2A96C, Link-Rot #E63051,
 * Zebra #F1F1F1. Typografie: Helvetica Neue, Basis 14px (Kundenwunsch).
 *
 * Alles unter `.ifm-fund` gescopt (defensive Integration, kein globales
 * Leaken).
 */

.ifm-fund {
	--ifm-navy: #2f426b;
	--ifm-gold: #c2a96c;
	--ifm-red: #b03a3a;
	--ifm-red-link: #e63051;
	--ifm-line: #e4e6ec;
	--ifm-muted: #6b7280;
	--ifm-stripe: #f1f1f1;
	--ifm-bg-soft: #f8f8f8;

	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: inherit;
}

.ifm-fund * {
	box-sizing: border-box;
}

.ifm-fund .ifm-muted {
	color: var(--ifm-muted);
}

/* --- Fondsseiten-Kopf (Headline + Klassen-Badge + Anteilsklassen-Pills) ----- */

.ifm-fund .ifm-fund-head {
	padding: 0 0 20px;
	border-bottom: 1px solid var(--ifm-line);
	margin: 0 0 24px;
}

.ifm-fund .ifm-fund-title {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

.ifm-fund .ifm-fund-name {
	color: var(--ifm-navy);
	font-size: 27px;
	font-weight: 700;
	line-height: 1.15;
}

.ifm-fund .ifm-pills {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	margin-top: 14px;
}

.ifm-fund .ifm-pills-label {
	color: var(--ifm-muted);
	font-size: 10.5px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-right: 6px;
}

.ifm-fund .ifm-pill {
	display: inline-flex;
	align-items: center;
	padding: 6px 14px;
	border: 1px solid var(--ifm-line);
	border-radius: 3px;
	color: var(--ifm-muted);
	font-size: 0.85em;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.ifm-fund a.ifm-pill:hover,
.ifm-fund a.ifm-pill:focus {
	color: var(--ifm-navy);
	border-color: var(--ifm-navy);
	background: var(--ifm-bg-soft);
}

.ifm-fund .ifm-pill--active {
	background: var(--ifm-navy);
	border-color: var(--ifm-navy);
	color: #fff;
}

/* --- Sektionen (Navy-Balken + Gold-Chevron, natives <details>) ------------- */

.ifm-fund .ifm-sections {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.ifm-fund .ifm-section {
	border: none;
	margin: 0 0 34px;
}

/* Zugeklappt rücken die Navy-Balken bis auf eine dünne Linie zusammen. */
.ifm-fund .ifm-section:not([open]) {
	margin: 0 0 1px;
}

.ifm-fund .ifm-section-title {
	cursor: pointer;
	list-style: none;
	padding: 15px 22px;
	background: var(--ifm-navy);
	color: #fff;
	font-weight: 700;
	font-size: 1.08em;
	letter-spacing: 0.01em;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.ifm-fund .ifm-section-title::-webkit-details-marker {
	display: none;
}

/* Weißes Dreieck rechts (zeigt bei offen nach unten, bei zu nach links). */
.ifm-fund .ifm-section-title::after {
	content: "";
	width: 0;
	height: 0;
	margin-left: 14px;
	border-left: 7px solid transparent;
	border-right: 7px solid transparent;
	border-top: 8px solid #fff;
	transition: transform 0.2s ease;
}

.ifm-fund .ifm-section:not([open]) .ifm-section-title::after {
	transform: rotate(-90deg);
}

.ifm-fund .ifm-section-body {
	padding: 4px 0 0;
}

/* Statische Sektion (z. B. Wertentwicklung): Navy-Balken ohne
   Aufklapp-Funktion — kein Chevron, kein Pointer, normaler Abstand. */
.ifm-fund .ifm-section.ifm-section--static {
	margin: 0 0 34px;
}

.ifm-fund .ifm-section.ifm-section--static .ifm-section-title {
	cursor: default;
}

.ifm-fund .ifm-section.ifm-section--static .ifm-section-title::after {
	display: none;
}

/* --- Untertitel (navy, dünne Linie darunter) ------------------------------- */

.ifm-fund .ifm-sec-title {
	margin: 26px 0 0;
	padding: 0 0 12px;
	color: var(--ifm-navy);
	font-size: 15px;
	font-weight: 700;
	border-bottom: 1px solid var(--ifm-navy);
}

.ifm-fund .ifm-sec-title:first-child {
	margin-top: 18px;
}

.ifm-fund .ifm-sec-title + * {
	margin-top: 18px;
}

/* --- Cards + Raster (Factsheet-Anmutung) ------------------------------------ */

.ifm-fund .ifm-grid {
	display: grid;
	grid-template-columns: 1fr; /* Vorerst auch auf Desktop 1-spaltig (Kundenwunsch). */
	gap: 20px;
	margin: 18px 0 8px;
	align-items: start;
}

.ifm-fund .ifm-card {
	background: #fff;
	border: 1px solid var(--ifm-line);
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(30, 38, 70, 0.06);
	padding: 16px 18px 14px;
	min-width: 0; /* Grid-Item darf schrumpfen (Tabellen-Scroll). */
}

.ifm-fund .ifm-card--wide {
	grid-column: 1 / -1;
}

/* Blocktitel gold — wie die Abschnitts-Titel im Factsheet. */
.ifm-fund .ifm-card-title {
	margin: 0 0 4px;
	padding: 0 0 10px;
	color: var(--ifm-gold);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.01em;
	border-bottom: 1px solid var(--ifm-line);
}

.ifm-fund .ifm-card .ifm-table-wrap {
	margin: 10px 0 0;
}

.ifm-fund .ifm-card .ifm-chart-canvas--columns {
	height: 340px;
}

/* --- Portfolio-Donut: Chart links, Tabelle rechts (wie Prototyp/Factsheet) --- */

.ifm-fund .ifm-portfolio {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.ifm-fund .ifm-chart-canvas--donut {
	flex: 1 1 360px;
	min-width: min(300px, 100%);
	height: 360px;
}

.ifm-fund .ifm-portfolio-side {
	flex: 1 1 280px;
	min-width: min(260px, 100%);
}

.ifm-fund .ifm-alloc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.ifm-fund .ifm-alloc-table td {
	padding: 7px 8px;
	border-bottom: 1px solid var(--ifm-line);
	color: var(--ifm-navy);
}

.ifm-fund .ifm-alloc-table td:last-child {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.ifm-fund .ifm-alloc-dot {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 2px;
	margin-right: 8px;
	vertical-align: 1px;
}

.ifm-fund .ifm-alloc-table tr.is-neg td {
	color: var(--ifm-red);
}

.ifm-fund .ifm-alloc-table tr.is-total td {
	font-weight: 700;
	border-bottom: none;
	border-top: 2px solid var(--ifm-navy);
}

/* --- Tabellen: Grundstil (Zebra, keine Rahmen) ------------------------------ */

.ifm-fund .ifm-table-wrap {
	overflow-x: auto;
	margin: 18px 0 8px;
}

.ifm-fund .ifm-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.ifm-fund .ifm-table th,
.ifm-fund .ifm-table td {
	padding: 10px 14px;
	text-align: left;
	vertical-align: top;
	border: none;
	color: var(--ifm-navy);
}

.ifm-fund .ifm-table tbody tr:nth-child(odd) th,
.ifm-fund .ifm-table tbody tr:nth-child(odd) td {
	background: var(--ifm-stripe);
}

/* Kopfzeile: dezent, keine Streifen. */
.ifm-fund .ifm-table thead th {
	color: var(--ifm-muted);
	font-weight: 400;
	font-size: 0.92em;
	background: none;
}

/* Feld/Wert-Tabellen: Label fett, 50/50. */
.ifm-fund .ifm-table tbody th {
	width: 50%;
	font-weight: 700;
}

/* Hover wie im Bestand: Gold-Zeile mit weißem Text. */
.ifm-fund .ifm-table tbody tr:hover th,
.ifm-fund .ifm-table tbody tr:hover td {
	background: var(--ifm-gold);
	color: #fff;
}

.ifm-fund .ifm-info {
	color: inherit;
	opacity: 0.75;
	font-size: 0.9em;
}

/* --- Zahlen-Matrix (Monatliche/Jährliche Wertentwicklung) ------------------- */

.ifm-fund .ifm-table--matrix thead th,
.ifm-fund .ifm-table--matrix td {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.ifm-fund .ifm-table--matrix td:first-child,
.ifm-fund .ifm-table--matrix thead th:first-child {
	text-align: left;
	font-weight: 700;
}

.ifm-fund .ifm-table--matrix td:last-child,
.ifm-fund .ifm-table--matrix thead th:last-child {
	font-weight: 700;
}

/* --- Allokations-Tabellen mit Gold-Balken ----------------------------------- */

.ifm-fund .ifm-bar-table td {
	white-space: nowrap;
}

.ifm-fund .ifm-bar-table td:first-child {
	width: 42%;
	white-space: normal;
	font-weight: 600;
}

.ifm-fund .ifm-bar-table .ifm-bar-value {
	width: 90px;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.ifm-fund .ifm-bar-table .ifm-bar-cell {
	width: auto;
}

.ifm-fund .ifm-bar {
	display: inline-block;
	vertical-align: middle;
	height: 14px;
	min-width: 2px;
	background: var(--ifm-gold);
}

/* Gepflegte Excel-Farben stehen als Inline-Style am Balken — der Hover-Zustand
   (weisser Balken auf Gold) muss ihn deshalb ueberschreiben duerfen. */
.ifm-fund .ifm-bar-table tbody tr:hover .ifm-bar {
	background: #fff !important;
}

/* --- Wertentwicklungs-Chart -------------------------------------------------- */

.ifm-fund .ifm-chart--nav {
	margin: 0 0 6px;
}

.ifm-fund .ifm-legend-row {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 16px 0 2px;
	color: var(--ifm-navy);
	font-size: 0.9em;
	font-weight: 600;
}

.ifm-fund .ifm-legend-swatch {
	width: 12px;
	height: 12px;
	background: var(--ifm-gold);
	flex: 0 0 auto;
}

.ifm-fund .ifm-stats {
	display: flex;
	gap: 34px;
	flex-wrap: wrap;
	margin: 10px 0 4px;
}

.ifm-fund .ifm-stat {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ifm-fund .ifm-stat-label {
	font-size: 0.72em;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--ifm-muted);
}

.ifm-fund .ifm-stat-value {
	font-size: 1.2em;
	font-weight: 700;
	color: var(--ifm-navy);
}

.ifm-fund .ifm-stat-value.is-pos {
	color: #2e7d4f;
}

.ifm-fund .ifm-stat-value.is-neg {
	color: var(--ifm-red);
}

/* Kopfzeile über dem Chart: Stats links, Modus-Buttons rechts oben
   (Kundenwunsch 2026-07-25). */
.ifm-fund .ifm-chart-top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	flex-wrap: wrap;
	gap: 8px 24px;
}

.ifm-fund .ifm-chart-top .ifm-modes {
	margin-top: 12px;
}

/* Perf.-Stats auf Kundenwunsch ausgeblendet — Rückweg über den Filter
   `ifm_connect_chart_extended_stats` (PHP), nicht per CSS löschen. */
.ifm-fund .ifm-stat--hidden {
	display: none;
}

.ifm-fund .ifm-chart-canvas--nav {
	width: 100%;
	height: 420px;
}

.ifm-fund .ifm-chart-canvas--columns {
	width: 100%;
	height: 400px;
}

.ifm-fund .ifm-chart-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
	border: 1px dashed var(--ifm-line);
	background: var(--ifm-bg-soft);
	color: var(--ifm-muted);
	font-size: 0.95em;
}

/* Steuerzeile: Datumswahl links, Zeitraum-Buttons rechts (wie Bestand). */
.ifm-fund .ifm-chart-controls {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	padding: 8px 0 4px;
}

.ifm-fund .ifm-ranges,
.ifm-fund .ifm-modes {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.ifm-fund .ifm-ranges button {
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.05em;
	padding: 6px 10px;
	border: none;
	border-radius: 2px;
	background: var(--ifm-gold);
	color: #fff;
	cursor: pointer;
	line-height: 1.2;
	transition: background-color 0.15s;
}

.ifm-fund .ifm-ranges button:hover {
	background: var(--ifm-navy);
	color: #fff;
}

.ifm-fund .ifm-ranges button.is-active {
	background: var(--ifm-navy);
	color: #fff;
}

.ifm-fund .ifm-modes button {
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.04em;
	padding: 6px 10px;
	border: 1px solid var(--ifm-line);
	border-radius: 2px;
	background: #fff;
	color: var(--ifm-navy);
	cursor: pointer;
	line-height: 1.2;
	transition: all 0.15s;
}

.ifm-fund .ifm-modes button:hover {
	border-color: var(--ifm-gold);
	color: var(--ifm-gold);
}

.ifm-fund .ifm-modes button.is-active {
	background: var(--ifm-navy);
	border-color: var(--ifm-navy);
	color: #fff;
}

.ifm-fund .ifm-dates {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--ifm-muted);
}

.ifm-fund .ifm-dates input {
	font-size: 12px;
	padding: 5px 8px;
	border: 1px solid var(--ifm-navy);
	border-radius: 0;
	color: var(--ifm-navy);
	background: #fff;
}

.ifm-fund .ifm-dates input:focus {
	outline: none;
	border-color: var(--ifm-gold);
}

/* Legende der Risikokennzahlen: dezente Fußnote statt Tabellenspalte. */
.ifm-fund .ifm-legend-note {
	margin: 6px 0 0;
	text-align: right;
	font-size: 0.85em;
	color: var(--ifm-muted);
}

/* Fußnoten unter einem Allokations-Chart (Sternchen-Zeilen der Excel-Lieferung).
   Bewusst linksbündig — es ist Fließtext zur Grafik, keine Quellenangabe. */
.ifm-fund .ifm-chart-footnotes {
	margin: 10px 0 0;
}

.ifm-fund .ifm-chart-footnote {
	margin: 4px 0 0;
	font-size: 0.85em;
	line-height: 1.45;
	color: var(--ifm-muted);
}

/* Link-Einträge in Datentabellen (Fondsdaten-Gruppen): als Link erkennbar,
   also unterstrichen — der Anzeigetext kommt aus dem Wert-Feld. */
.ifm-fund .ifm-kv-link {
	color: var(--ifm-red-link);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ifm-fund .ifm-kv-link:hover,
.ifm-fund .ifm-kv-link:focus {
	color: var(--ifm-navy);
	text-decoration: underline;
}

/* Gold-Hover der Tabellenzeile: Link bleibt lesbar (weißer Text). */
.ifm-fund .ifm-table tbody tr:hover .ifm-kv-link {
	color: inherit;
}

/* --- Fragen und Antworten (je Frage ein kleines Akkordion) ------------------- */

.ifm-fund .ifm-faq-item {
	border-bottom: 1px solid var(--ifm-line);
}

.ifm-fund .ifm-faq-item:last-child {
	border-bottom: none;
}

.ifm-fund .ifm-faq-q {
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 2px;
	color: var(--ifm-navy);
	font-weight: 600;
}

.ifm-fund .ifm-faq-q::-webkit-details-marker {
	display: none;
}

/* Goldenes Dreieck links (offen: nach unten, zu: nach rechts). */
.ifm-fund .ifm-faq-q::before {
	content: "";
	flex: 0 0 auto;
	width: 0;
	height: 0;
	margin-top: 0.45em;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 7px solid var(--ifm-gold);
	transition: transform 0.2s ease;
}

.ifm-fund .ifm-faq-item:not([open]) .ifm-faq-q::before {
	transform: rotate(-90deg);
}

.ifm-fund .ifm-faq-q:hover {
	color: var(--ifm-red-link);
}

.ifm-fund .ifm-faq-a {
	padding: 0 2px 14px 22px;
}

.ifm-fund .ifm-faq-a p {
	margin: 0 0 10px;
}

.ifm-fund .ifm-faq-a p:last-child,
.ifm-fund .ifm-faq-a ul:last-child,
.ifm-fund .ifm-faq-a ol:last-child {
	margin-bottom: 0;
}

.ifm-fund .ifm-faq-a ul,
.ifm-fund .ifm-faq-a ol {
	margin: 0 0 10px;
	padding-left: 20px;
}

.ifm-fund .ifm-faq-a a {
	color: var(--ifm-red-link);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ifm-fund .ifm-faq-a a:hover,
.ifm-fund .ifm-faq-a a:focus {
	color: var(--ifm-navy);
}

/* --- Downloads (rote Links, Datum rechts, Zebra) ----------------------------- */

.ifm-fund .ifm-doc-table td {
	color: var(--ifm-navy);
}

.ifm-fund .ifm-doc-table .ifm-doc-date {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	color: var(--ifm-muted);
	font-size: 0.95em;
}

.ifm-fund .ifm-doc-link {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	color: var(--ifm-red-link);
	font-weight: 600;
	text-decoration: none;
}

.ifm-fund .ifm-doc-ico {
	flex: none;
	color: var(--ifm-gold);
}

.ifm-fund .ifm-doc-link:hover {
	color: var(--ifm-navy);
	text-decoration: underline;
}

.ifm-fund .ifm-doc-link:hover .ifm-doc-ico {
	color: var(--ifm-navy);
}

.ifm-fund .ifm-doc-table tbody tr:hover td {
	background: var(--ifm-bg-soft);
	color: var(--ifm-navy);
}

.ifm-fund .ifm-doc-table tbody tr:hover .ifm-doc-link {
	color: var(--ifm-red-link);
}

/* --- Eckdaten-Leiste oben (weiße Card, Hairline-Trenner, Gold-Label) --------- */

.ifm-fund .ifm-kpis {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
	gap: 0;
	background: #fff;
	border: 1px solid var(--ifm-line);
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(30, 38, 70, 0.06);
	overflow: hidden;
	margin: 0 0 34px;
}

/* Hairlines in beide Richtungen (auch wenn die Zellen umbrechen):
   jede Zelle bringt Trennlinien links/oben mit, die Außenkanten
   verschwinden per Negativ-Margin unter dem Card-Rand. */
.ifm-fund .ifm-kpi {
	display: flex;
	flex-direction: column;
	gap: 5px;
	padding: 14px 18px;
	border-left: 1px solid #eef0f4;
	border-top: 1px solid #eef0f4;
	margin-left: -1px;
	margin-top: -1px;
}

.ifm-fund .ifm-kpi-label {
	color: #8a6d2f;
	font-size: 10.5px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.ifm-fund .ifm-kpi-value {
	color: var(--ifm-navy);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	font-variant-numeric: tabular-nums;
}

/* --- Einzelblock-Variante (Abgrenzung übernehmen die Cards) --------------------- */

.ifm-fund--block {
	background: transparent;
}

/* --- Responsive ------------------------------------------------------------------ */

@media (max-width: 782px) {
	.ifm-fund .ifm-fund-name {
		font-size: 22px;
	}

	.ifm-fund .ifm-pill {
		padding: 5px 11px;
	}

	.ifm-fund .ifm-bar-table td:first-child {
		width: 50%;
	}

	.ifm-fund .ifm-kpis {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.ifm-fund .ifm-table th,
	.ifm-fund .ifm-table td {
		padding: 9px 10px;
	}

	.ifm-fund .ifm-card {
		padding: 12px 12px 10px;
	}

	.ifm-fund .ifm-bar-table .ifm-bar-cell {
		display: none; /* Auf sehr schmalen Screens nur Label + Wert. */
	}

	.ifm-fund .ifm-chart-canvas--nav {
		height: 320px;
	}
}
