/* =================== Für Mitarbeiter (Adressenversand + Honorare) =================== */

.mit-trigger { margin-right: 0; }

/* Staff area — persistent left sidebar (module switcher) + content */
.staff-area { display: flex; gap: 1.5rem; align-items: flex-start; }
.staff-area[hidden] { display: none; }
.staff-sidebar {
	flex: none; width: 224px;
	/* .app-main scrollt intern — oben am Scrollbereich kleben (nicht mehr am Viewport). */
	position: sticky; top: 0;
	display: flex; flex-direction: column; gap: 4px;
}
.staff-nav-item {
	display: flex; align-items: center; justify-content: flex-start; gap: 10px;
	width: 100%; height: auto; text-align: left;
	padding: 9px 12px; border-radius: var(--radius-md);
	background: transparent; border: 1px solid transparent; box-shadow: none;
	color: var(--text-muted); font-size: 0.9375rem; font-weight: 500; cursor: pointer;
}
.staff-nav-item[hidden] { display: none; }
.staff-nav-item svg { flex: none; color: var(--text-faint); }
.staff-nav-item:hover { background: var(--accent); color: var(--text-strong); }
.staff-nav-item.active { background: var(--accent); color: var(--text-strong); border-color: var(--card-border); }
.staff-nav-item.active svg { color: var(--gold); }
.staff-content { flex: 1 1 auto; min-width: 0; }
.staff-content .tab-panel { animation: none; }
@media (max-width: 760px) {
	.staff-area { flex-direction: column; gap: 0.75rem; }
	.staff-sidebar { width: 100%; position: static; flex-direction: row; flex-wrap: wrap; }
	.staff-nav-item { width: auto; }
}

.mit-dashboard-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 16px;
	max-width: 1100px;
}

/* Übersicht (Kennzahlen) — minimalistisch: keine Kacheln, eine Zeile pro Wert */
.dash-grid { max-width: none; }
.dash-row {
	display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
	width: 100%; padding: 14px 2px;
	background: none; border: 0; border-bottom: 1px solid var(--card-border); border-radius: 0;
	box-shadow: none; text-align: left; font: inherit; color: var(--text-strong);
	/* Neutralize the global `button` styles (fixed height, centered inline-flex, line-height 1). */
	height: auto; line-height: 1.4; white-space: normal;
}
.dash-row:last-child { border-bottom: 0; }
button.dash-row { cursor: pointer; transition: color .15s ease; }
button.dash-row:hover { color: var(--gold-strong); }
button.dash-row:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.dash-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-label { font-size: 0.95rem; font-weight: 500; }
.dash-sub { font-size: 0.82rem; color: var(--text-faint); }
.dash-value {
	flex: 0 0 auto; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em;
	font-variant-numeric: tabular-nums; white-space: nowrap;
}
@media (max-width: 520px) {
	.dash-row { flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 2px; }
	.dash-value { font-size: 1.35rem; white-space: normal; }
}
.dash-sync { margin-top: 16px; font-size: 0.85rem; color: var(--text-muted); }
.mit-module-card {
	background: var(--card-bg);
	border: 1px solid var(--card-border);
	border-radius: var(--radius-xl);
	padding: 22px;
	text-align: left;
	cursor: pointer;
	box-shadow: var(--card-shadow);
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
	display: flex; flex-direction: column; gap: 10px;
	color: var(--text-strong);
	font: inherit;
	height: auto;
	align-items: stretch;
	white-space: normal;
}
.mit-module-card:hover { border-color: var(--gold-tint-border); box-shadow: var(--shadow-md); }
.mit-module-card:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px var(--ring-soft); }
.mit-module-card[hidden] { display: none; }
.mit-module-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: var(--radius-lg);
	background: var(--gold-tint);
	color: var(--gold-strong);
	margin-bottom: 4px;
	transition: background .15s, color .15s;
}
.mit-module-icon svg { display: block; }
.mit-module-card:hover .mit-module-icon { background: var(--gold); color: #4a3a18; }
.mit-module-title { font-family: var(--font-head); font-size: 1.25rem; font-weight: 600; color: var(--text-strong); }
.mit-module-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; }

.mit-module-header {
	display: flex; gap: 16px; align-items: center;
	margin-bottom: 28px; flex-wrap: wrap;
}
.mit-module-header h1.page-title { margin: 0; flex: 1; }
/* Herkunfts-Tag (Zoho-/Notion-Spiegel) direkt neben den Titel statt ganz rechts:
   der Titel wächst dann nicht mehr, das Tag schiebt alles Weitere nach rechts. */
.mit-module-header h1.page-title:has(+ .prov-tag) { flex: 0 1 auto; }
.mit-module-header .prov-tag { margin-right: auto; }

/* Small screens: stack title above the tabs, smaller text, more breathing room
   between the header (title + tabs) and the content below it. */
@media (max-width: 900px) {
	.mit-module-header { gap: 12px; margin-bottom: 32px; }
	.mit-module-header h1.page-title { flex: 1 1 100%; font-size: 1.6rem; }
	.mit-subtab { padding: 6px 10px; font-size: 13px; }
	.mit-toolbar input[type="search"], .mit-toolbar select { font-size: 13px; }
	.mit-table-wrap table, #admin-table { font-size: 13px; }
	#admin-table th, #admin-table td { padding-left: 6px; padding-right: 6px; }
}

/* Segmented control sub-tabs (shadcn Tabs look) */
.mit-subtabs {
	display: inline-flex; gap: 2px;
	background: var(--muted);
	border: 1px solid var(--card-border);
	border-radius: var(--radius-lg);
	padding: 3px;
}
.mit-subtab, .hon-subtab, .vk-subtab, .rv-subtab {
	height: auto;
	padding: 6px 14px; background: transparent; border: 1px solid transparent;
	box-shadow: none; cursor: pointer;
	border-radius: var(--radius-md);
	font-size: 14px; font-weight: 500; color: var(--text-muted);
	transition: background .15s, color .15s, box-shadow .15s;
}
.mit-subtab.active, .hon-subtab.active, .vk-subtab.active, .rv-subtab.active {
	color: var(--text-strong);
	background: var(--card-bg);
	box-shadow: var(--shadow-xs);
}
.mit-subtab:hover:not(.active), .hon-subtab:hover:not(.active), .vk-subtab:hover:not(.active), .rv-subtab:hover:not(.active) { color: var(--text-strong); }
.mit-subtab:focus-visible, .hon-subtab:focus-visible, .vk-subtab:focus-visible, .rv-subtab:focus-visible { box-shadow: 0 0 0 3px var(--ring-soft); }
/* Einstellungen-Reiter: nur das Zahnrad. Etwas grösser, damit es neben den Wörtern
   gleich schwer wiegt, und ohne Wort-Padding. */
.vk-subtab[data-vk-sub="settings"] { font-size: 17px; line-height: 1; padding: 6px 10px; }
/* Sync-Seite: eigene Sub-Tabs, gleiche Optik wie .mit-subtab (aber ohne dessen Klick-Logik). */
.sync-subtab {
	height: auto;
	padding: 6px 14px; background: transparent; border: 1px solid transparent;
	box-shadow: none; cursor: pointer;
	border-radius: var(--radius-md);
	font-size: 14px; font-weight: 500; color: var(--text-muted);
	transition: background .15s, color .15s, box-shadow .15s;
}
.sync-subtab.active { color: var(--text-strong); background: var(--card-bg); box-shadow: var(--shadow-xs); }
.sync-subtab:hover:not(.active) { color: var(--text-strong); }
.sync-subtab:focus-visible { box-shadow: 0 0 0 3px var(--ring-soft); }
.mit-subpanel, .hon-subpanel { display: none; }
.mit-subpanel.active, .hon-subpanel.active { display: block; }

.mit-toolbar { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.mit-toolbar input[type="search"], .mit-toolbar select {
	height: 2.25rem;
	padding: 8px 12px; font-size: 14px;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	box-shadow: var(--shadow-xs);
	background: var(--input-bg); color: var(--text);
	font-family: inherit;
}
.mit-toolbar input[type="search"]:focus, .mit-toolbar select:focus {
	outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring);
}
.mit-toolbar input[type="search"] { flex: 1 1 280px; max-width: 360px; }

.mit-export-toolbar { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.mit-export-section { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.mit-export-section > select { height: 2.25rem; padding: 8px 12px; font-size: 14px;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	box-shadow: var(--shadow-xs); background: var(--input-bg); color: var(--text);
	font-family: inherit; }
.mit-export-section > select:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring); }
.mit-export-section > #mit-category-filter { flex-wrap: wrap; }
.mit-export-buttons { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.mit-section-label { font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.mit-export-summary { margin-bottom: 0; }
#mit-list-body:not([hidden]) { margin-top: 20px; }

.mit-status { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 12px; }
/* Ohne Meldung nimmt die Statuszeile keinen Platz weg (Honorare-Liste zeigt hier nichts mehr an). */
.mit-status:empty { display: none; }
.mit-table-wrap {
	overflow-x: auto;
	border: 1px solid var(--card-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--card-shadow);
}
#mit-table, #mit-hon-table, .hon-grp-table {
	width: 100%; border-collapse: collapse;
	background: var(--card-bg);
}
#mit-table th, #mit-table td,
#mit-hon-table th, #mit-hon-table td,
.hon-grp-table th, .hon-grp-table td {
	text-align: left; padding: 11px 14px;
	border-bottom: 1px solid var(--section-border);
	font-size: 0.875rem; vertical-align: top;
}
#mit-table tbody tr:last-child td, #mit-hon-table tbody tr:last-child td, .hon-grp-table tbody tr:last-child td { border-bottom: none; }
#mit-table tbody tr:hover, #mit-hon-table tbody tr:hover, .hon-grp-table tbody tr:hover { background: color-mix(in srgb, var(--muted) 60%, transparent); }
#mit-table th, #mit-hon-table th, .hon-grp-table th {
	background: var(--muted); font-weight: 500;
	color: var(--text-muted); font-size: 0.8125rem;
	text-transform: none; letter-spacing: 0;
}

.badge-Bezahlt, .badge-active { background: rgb(220 252 231); color: rgb(22 101 52); border-color: rgb(187 247 208); }
.badge-Offen, .badge-trial, .badge-future { background: rgb(255 243 214); color: rgb(138 90 0); border-color: rgb(253 230 138); }
.badge-Storniert, .badge-cancelled_from_dunning, .badge-dunning, .badge-inactive { background: rgb(253 232 232); color: rgb(161 48 48); border-color: rgb(254 202 202); }
:root.dark .badge-Bezahlt, :root.dark .badge-active { background: rgb(26 58 42); color: rgb(121 217 164); }
:root.dark .badge-Offen, :root.dark .badge-trial, :root.dark .badge-future { background: rgb(58 46 16); color: rgb(240 195 114); }
:root.dark .badge-Storniert, :root.dark .badge-cancelled_from_dunning, :root.dark .badge-dunning, :root.dark .badge-inactive { background: rgb(58 26 26); color: rgb(242 154 154); }

.mit-hon-totals { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.mit-hon-totals .pill {
	background: var(--card-bg); border: 1px solid var(--card-border);
	padding: 12px 16px; border-radius: var(--radius-xl); font-size: 0.875rem;
	box-shadow: var(--card-shadow);
}
.mit-hon-totals .pill strong { display: block; font-size: 1.25rem; color: var(--text-strong); }

/* Kleines Achtung-Zeichen neben Autoren ohne Zoho-Verknüpfung */
.hon-warn { color: rgb(217 119 6); font-size: 0.75rem; cursor: help; }

.hon-mail-links { margin: 2px 0 8px; }
.hon-mail-links a { color: var(--text-muted); text-decoration: underline; }
.hon-mail-links a:hover { color: var(--text-strong); }

/* Honorar-Zeile öffnet die E-Mail-Vorschau */
#mit-hon-table tbody tr.hon-row, .hon-grp-table tbody tr.hon-row { cursor: pointer; }

/* Die letzten zwei Spalten (E-Mail, Honorar) brauchen Luft: Badges wie
   «Gesendet 12.08.2026» / «Nicht bezahlt» nie umbrechen und nicht quetschen.
   Sie sind zugleich die Bremse gegen leeren Raum rechts: nur diese beiden bekommen
   eine Mindestbreite, den Rest verteilt die Tabelle auf die Textspalten. */
#mit-hon-table th:nth-last-child(-n+2), #mit-hon-table td:nth-last-child(-n+2) { min-width: 130px; white-space: nowrap; }

/* Betrag und Währung stehen zusammen in EINER Spalte — das spart die halbe
   Spaltenbreite, die «CHF» sonst allein verbraucht hat. */
#mit-hon-table .hon-betrag, .hon-grp-table .hon-betrag { text-align: right; white-space: nowrap; }

/* Die Liste füllt ihre Breite aus; die Beitrags-Spalte bekommt den Rest, damit rechts
   kein toter Raum stehen bleibt. */
#mit-hon-table, .hon-grp-table { width: 100%; }
#mit-hon-table th:nth-child(2) { width: 100%; }
/* Die Spaltenbreiten der gruppierten Honorar-Liste stehen weiter unten (table-layout: fixed).
   Alte Mindestbreiten hier würden die Tabelle über die Seite hinaus schieben. */

/* Gruppierte Ansicht: angehakt wird nichts mehr — die Zahlungslisten entstehen immer
   für die ganze Ausgabe (Knopf im Ausgabe-Kopf). Pro Ausgabe ein eigener Block — Kopfzeile plus ein eigenes,
   abgeschlossenes Tabellen-Fragment mit eigenem Spaltenkopf. */
/* Nichts in der Honorar-Liste darf die Seite breiter machen: zu breite Tabellen scrollen
   in ihrem eigenen Rahmen, statt die ganze Ansicht seitlich zu verschieben. */
#hon-sub-list, #mit-hon-groups, .hon-grp-block, .hon-grp-head { min-width: 0; max-width: 100%; }
.hon-grp-head { overflow: hidden; }
.hon-grp-block { margin-top: 1.6rem; }
.hon-grp-block:first-child { margin-top: 0; }
.hon-grp-head {
	cursor: pointer;
	border-top: 2px solid var(--accent, #c8a15a);
	border-bottom: 1px solid var(--border, rgba(127, 127, 127, .35));
	background: var(--surface-2, rgba(127, 127, 127, .10));
	padding: .6rem .75rem;
}
.hon-grp-table { width: 100%; }
.hon-grp { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.hon-grp-title { font-size: 1.12rem; font-weight: 700; letter-spacing: .01em; }
.hon-grp-meta { margin-left: .2rem; }
/* Aktionsknöpfe zusammen rechtsbündig: nur der ERSTE schiebt sich nach rechts,
   sonst verteilt margin-left:auto die Knöpfe über die ganze Kopfzeile. */
.hon-grp-aktionen { margin-left: auto; display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
/* «+ Eintrag» gehört zur Ausgabe und steht deshalb direkt neben ihrer Nummer — nicht
   rechts bei den Sammel-Aktionen. */
.hon-grp-manuell {
	background: none; border: 1px solid var(--card-border); border-radius: 6px;
	color: var(--text-muted); padding: 1px .45rem; font-size: .8rem; line-height: 1.5;
	cursor: pointer; white-space: nowrap; margin-left: -.2rem;
}
.hon-grp-manuell:hover { color: var(--text-strong); border-color: var(--gold-tint-border); }

/* Die Vorschau zeigt die Excel-Tabelle 1:1 — viele schmale Spalten, darum kleiner
   Schriftgrad, kein Umbruch und horizontales Scrollen im Dialog. */
#hon-list-modal .hon-mail-card { width: min(1100px, 96vw); }
#hon-list-modal .mit-table-wrap { overflow-x: auto; }
.hon-list-preview { font-size: 0.78rem; white-space: nowrap; }
.hon-list-preview th, .hon-list-preview td { padding: 4px 8px; }

/* E-Mail-Vorschau / Nachschau eines Honorars */
.hon-mail-card { width: min(720px, 96vw); }
.hon-mail-status { margin-right: auto; }
.hon-mail-sub { margin: 0 0 4px; color: var(--text-strong); font-weight: 600; }
.hon-mail-note { margin: 0 0 16px; font-size: 0.85rem; color: var(--text-muted); }
.hon-mail-msg + .hon-mail-msg { margin-top: 18px; }
.hon-mail-msg h3 {
	margin: 0 0 8px; font-size: 0.78rem; font-weight: 600;
	letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
}
.hon-mail-meta {
	display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
	margin: 0 0 10px; font-size: 0.875rem;
}
.hon-mail-meta dt { color: var(--text-muted); }
.hon-mail-meta dd { margin: 0; overflow-wrap: anywhere; }
.hon-mail-files { margin: 0; padding-left: 18px; }
.hon-mail-preview {
	border: 1px solid var(--card-border); border-radius: var(--radius-lg);
	padding: 16px 18px; background: var(--input-bg); font-size: 0.9rem; line-height: 1.5;
	overflow-wrap: anywhere;
}
.hon-mail-preview p { margin: 0; }

.mit-category-filter {
	display: flex; gap: 4px; align-items: center;
}
.mit-category-filter label {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 4px 8px; font-size: 0.875rem; border-radius: var(--radius-sm); cursor: pointer;
}
.mit-category-filter label:hover { background: var(--accent); }
.mit-category-filter.status-filter { flex-wrap: wrap; }
.mit-category-filter.status-filter label { text-transform: capitalize; }

/* Abonnenten per-person rows: name + Zoho link, compact abo chips, selection column */
.col-sel { width: 1%; white-space: nowrap; text-align: center; padding-right: 0; }
.col-sel input { cursor: pointer; width: 16px; height: 16px; vertical-align: middle; }
.subs-person { display: inline-flex; align-items: center; gap: 2px; }
.subs-person-name { font-weight: 500; color: var(--text-strong); }
.subs-person-email { margin-top: 1px; }
.abo-list { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; overflow: hidden; }
.abo-chip {
	flex: 0 1 auto; min-width: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
	font-size: 0.72rem; line-height: 1.5; padding: 1px 7px; border-radius: 999px;
	background: var(--accent); color: var(--text-strong); border: 1px solid var(--card-border);
}
.abo-more { flex: none; font-size: 0.72rem; color: var(--text-faint); white-space: nowrap; }

/* Bulk-action bar (appears when people are checked) */
.subs-actions {
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
	padding: 10px 14px; border-radius: var(--radius-md);
	background: var(--accent); border: 1px solid var(--card-border);
}
.subs-actions[hidden] { display: none; }
.subs-actions-count { font-size: 0.9rem; color: var(--text-strong); }
.subs-actions select { font-size: 0.875rem; }
.subs-actions .link { margin-left: auto; }
#subs-action-status { flex-basis: 100%; }
/* Second floating progress badge stacks above the import one when both run */
.bulk-activity { bottom: 70px; }

/* Icon + label buttons (icons replace the old emojis) */
.has-icon { display: inline-flex; align-items: center; gap: 6px; }
.has-icon svg { flex: none; }

/* Collapsible additive filter builder (Abonnenten) */
.filter-toggle.has-active { color: var(--text-strong); font-weight: 600; }
.filter-panel {
	display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px;
	background: var(--card-bg); border: 1px solid var(--card-border);
	border-radius: var(--radius-md); padding: 12px 14px; box-shadow: var(--shadow-xs);
}
.filter-panel[hidden] { display: none; }
.filter-rows { display: flex; flex-direction: column; gap: 8px; }
.filter-rows:empty { display: none; }
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-row .cs--filter-conn { min-width: 88px; }
.filter-row .filter-conn-spacer { flex: none; width: 88px; }
.filter-row .cs--filter-cat { min-width: 150px; }
.filter-row .cs--filter-op { min-width: 104px; }
.filter-row .cs--filter-val { min-width: 220px; flex: 1 1 220px; max-width: 360px; }
.filter-remove {
	flex: none; width: 2rem; height: 2rem; padding: 0; line-height: 1;
	display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid var(--card-border); border-radius: var(--radius-md);
	background: var(--card-bg); color: var(--text-muted); cursor: pointer;
}
.filter-remove:hover { color: var(--danger, #c0392b); border-color: var(--danger, #c0392b); }
.filter-add { align-self: flex-start; }

.mit-settings-grid {
	/* Single column: Produkte on top, the other modules (Status-Filter, Interne
	   Verteilung, E-Mails) stacked below it. */
	display: grid; grid-template-columns: 1fr;
	gap: 24px; margin-bottom: 16px; align-items: start; /* don't stretch short blocks to full height */
	max-width: 720px;
}
.mit-settings-block {
	background: var(--card-bg); padding: 16px;
	border-radius: var(--radius-xl); border: 1px solid var(--card-border);
	box-shadow: var(--card-shadow);
}
.mit-settings-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }

.mit-options { display: flex; flex-direction: column; gap: 6px; }
.mit-options .option {
	display: flex; align-items: center; gap: 10px;
	padding: 6px 8px; border-radius: var(--radius-sm); font-size: 0.875rem; cursor: pointer;
}
.mit-options .option:hover { background: var(--accent); }

.mit-subhead { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); margin: 16px 0 8px; }
.mit-subhead:first-of-type { margin-top: 6px; }
/* Export-Produkte rows: Name + Abkürzung + remove. */
.ep-line { display: grid; grid-template-columns: 1fr 90px auto auto auto; gap: 14px; align-items: center; }
.ep-line .ep-main { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-text, #666); white-space: nowrap; cursor: pointer; }
.ep-line .ep-main input { height: auto; box-shadow: none; }
.ep-move { display: inline-flex; flex-direction: column; gap: 0; }
/* Compact arrows: override the global button height (2.25rem) so the two stack tightly and keep rows short. */
.ep-arrow { height: 14px; min-height: 0; padding: 0 6px; font-size: 9px; line-height: 1; border: none; background: transparent; box-shadow: none; color: var(--text-muted); cursor: pointer; border-radius: var(--radius-sm); }
.ep-arrow:hover:not(:disabled) { color: var(--text-strong); background: var(--accent); }
.ep-arrow:disabled { opacity: .25; cursor: default; }
.ep-line [data-remove-ep] { height: auto; min-height: 0; border: none; background: transparent; box-shadow: none; cursor: pointer; padding: 3px 8px; color: var(--destructive); font-size: 17px; line-height: 1; border-radius: var(--radius-sm); }
.ep-line [data-remove-ep]:hover { background: var(--accent); }
.ep-line input { height: 2rem; padding: 6px 8px; font-size: 13px; min-width: 0; border: 1px solid var(--input-border); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); background: var(--input-bg); color: var(--text); font-family: inherit; }
.ep-line input[data-ep="code"] { text-align: center; text-transform: uppercase; font-family: var(--font-mono); }
.ep-line input:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring); }
.mit-product-codes { display: flex; flex-direction: column; gap: 0; }
/* Flat list row: [× entfernen] · [Name/Code] · [Zuordnungs-Dropdown] — same
   layout whether the row is a whole product or a single plan. */
.pc-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(150px, 230px) auto;
	align-items: center; gap: 10px;
	padding: 10px 6px; border-bottom: 1px solid var(--section-border);
}
.pc-row:last-child { border-bottom: none; }
.pc-row select { width: 100%; min-width: 0; }
.mit-product-codes .product-row {
	display: block;
	padding: 12px 6px; border-bottom: 1px solid var(--section-border);
}
.mit-product-codes .product-head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(150px, 230px) 2rem;
	align-items: center; gap: 12px;
}
.mit-product-codes .product-head select { width: 100%; min-width: 0; }
.mit-product-codes .product-head .pc-perplan-hint {
	font-size: 12px; font-style: italic; text-align: right; align-self: center;
}
/* Plan row: [× entfernen] · [Name/Code] · [Zuordnungs-Dropdown]. */
.plan-row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) minmax(150px, 230px);
	align-items: center; gap: 10px;
}
.plan-remove {
	width: 22px; height: 22px; padding: 0; flex: 0 0 auto;
	display: inline-flex; align-items: center; justify-content: center;
	border: none; background: transparent; box-shadow: none; cursor: pointer;
	font-size: 18px; line-height: 1; color: var(--text-faint);
	border-radius: var(--radius-sm);
}
.plan-remove:hover { color: var(--destructive); background: var(--destructive-soft); }
.mit-product-codes .product-name { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.product-name .product-title {
	font-size: 14px; font-weight: 600; color: var(--text-strong);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.product-name .plan-count { font-size: 11px; color: var(--text-faint); }
.plan-toggle-bar {
	display: flex; align-items: center; gap: 8px; width: 100%;
	margin: 10px 0 2px; padding: 7px 12px;
	border: 1px dashed var(--input-border); border-radius: var(--radius-md);
	background: transparent; color: var(--text-muted); cursor: pointer;
	font-size: 12px; font-family: inherit; text-align: left; box-shadow: none;
}
.plan-toggle-bar:hover { color: var(--text); border-color: var(--text-muted); background: var(--input-bg); }
.plan-toggle-bar .chev { font-size: 13px; line-height: 1; }
.prod-spacer { display: inline-block; width: 22px; flex: 0 0 auto; }
.prod-plans {
	margin: 8px 0 2px; padding: 2px 0 2px 16px;
	border-left: 2px solid var(--section-border);
	display: flex; flex-direction: column; gap: 9px;
}
.prod-plans[hidden] { display: none; }
.plan-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
.plan-text .plan-name {
	font-size: 13px; color: var(--text);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plan-text .plan-code {
	font-family: var(--font-mono); font-size: 11px; color: var(--text-faint);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plan-row.plan-off .plan-text { opacity: 0.4; }
.plan-row select[data-plan-export] {
	width: 100%; min-width: 0; height: 1.85rem; padding: 3px 8px; font-size: 12px;
}
.mit-add-product {
	margin-top: 12px; height: 2rem; padding: 6px 8px; font-size: 13px;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	background: var(--input-bg); color: var(--text); font-family: inherit;
}
.mit-add-product:disabled { opacity: 0.5; }
/* Kommentar (Standard): free-text line for the PDF — full width so the whole comment is visible. */
.mit-comment-input { display: block; width: 100%; box-sizing: border-box; }
/* "For Goetheanum internal use only" caption above the internal-distribution block. */
.mit-internal-note {
	margin: 24px 0 -4px; font-family: var(--font-head); font-size: 0.75rem;
	font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
	color: var(--gold-strong, #e0a23f);
}

/* «+ Produkt aus Zoho» — custom dropdown with expandable tarif lists per product. */
.zp-wrap { position: relative; }
.zp-btn {
	width: 100%; display: flex; align-items: center; justify-content: space-between;
	gap: 8px; cursor: pointer; text-align: left;
}
.zp-btn .zp-caret { color: var(--text-faint); transition: transform 0.15s; }
.zp-btn.zp-btn-open .zp-caret { transform: rotate(180deg); }
.zp-panel {
	position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px);
	max-height: 340px; overflow-y: auto;
	background: var(--card-bg); border: 1px solid var(--card-border);
	border-radius: var(--radius-md); box-shadow: var(--card-shadow), 0 12px 32px rgb(0 0 0 / 0.35);
	padding: 4px;
}
.zp-panel[hidden] { display: none; }
.zp-row {
	width: 100%; display: flex; align-items: center; gap: 8px;
	border: none; background: transparent; color: var(--text); font-family: inherit;
	font-size: 13px; padding: 8px 10px; border-radius: var(--radius-sm);
	cursor: pointer; text-align: left;
}
.zp-row:hover:not(:disabled) { background: var(--accent); }
.zp-row:disabled { opacity: 0.45; cursor: default; }
.zp-row .zp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zp-row .zp-chev { width: 14px; color: var(--text-faint); font-size: 12px; }
.zp-row .zp-badge {
	flex: none; font-size: 11px; color: var(--text-faint);
	border: 1px solid var(--card-border); border-radius: 999px; padding: 1px 8px;
}
.zp-head { font-weight: 600; }
.zp-plans {
	margin: 0 0 4px 0; padding: 2px 0 2px 20px;
	border-left: 2px solid var(--card-border); margin-left: 16px;
}
.zp-plan { font-size: 12.5px; padding: 6px 10px; }
.zp-empty { padding: 10px; }

/* Status-Filter as chips: only chosen statuses, one line, + Hinzufügen dropdown. */
.status-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.status-chip { display: inline-flex; align-items: center; gap: 0; }
/* The × lives INSIDE the coloured badge — one self-contained tag. */
.status-chip .badge { gap: 4px; padding-right: 0.3125rem; }
.status-chip-label { display: inline-flex; align-items: center; }
.status-chip-x {
	border: none; background: transparent; cursor: pointer; color: currentColor;
	opacity: .55; font-size: 13px; line-height: 1; padding: 0; margin: 0;
	border-radius: 999px; display: inline-flex; align-items: center;
}
.status-chip-x:hover { opacity: 1; color: var(--destructive, #c0392b); }
.status-add-wrap { display: inline-flex; }
.status-add-panel { min-width: 260px; left: auto; right: auto; }
.status-add-panel .zp-row { gap: 0; }

/* Interne Verteilung — add-lines list: Produkt + Anzahl + Beschreibung per line. */
.mit-internal-list { display: flex; flex-direction: column; gap: 8px; }
.id-line, .iv-line { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1.4fr) 56px auto; gap: 8px; align-items: center; }
.iv-line { margin: 6px 0; }
.id-line select, .id-line input, .iv-line select, .iv-line input {
	height: 2rem; padding: 6px 8px; font-size: 13px; min-width: 0;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	box-shadow: var(--shadow-xs); background: var(--input-bg); color: var(--text); font-family: inherit;
}
.id-line input[type="number"], .iv-line input[type="number"] { text-align: center; font-family: var(--font-mono); }
.id-line select:focus, .id-line input:focus, .iv-line select:focus, .iv-line input:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring); }
.id-line .icon-btn, .iv-line .icon-btn { border: none; background: transparent; box-shadow: none; cursor: pointer; padding: 2px 6px; color: var(--destructive); font-size: 16px; line-height: 1; }
/* Externe Verteilung: gleiche Zeilen-Optik wie die Interne Verteilung. */
.ed-line { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1.4fr) 56px auto; gap: 8px; align-items: center; margin: 6px 0; }
.ed-line select, .ed-line input { height: 2rem; padding: 6px 8px; font-size: 13px; min-width: 0; border: 1px solid var(--input-border); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); background: var(--input-bg); color: var(--text); font-family: inherit; }
.ed-line input[type="number"] { text-align: center; font-family: var(--font-mono); }
.ed-line select:focus, .ed-line input:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring); }
.ed-line .icon-btn { border: none; background: transparent; box-shadow: none; cursor: pointer; padding: 2px 6px; color: var(--destructive); font-size: 16px; line-height: 1; }
.iv-footer { margin-top: 8px; display: flex; align-items: center; gap: 12px; font-size: 12px; min-height: 1.2em; }
.iv-footer a { color: var(--accent); }
.iv-saved { color: var(--text-muted); opacity: 0; transition: opacity .2s; }
.iv-saved.show { opacity: 1; }
.pv-internal-headrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pv-reset { font-size: 12px; color: var(--accent); white-space: nowrap; }
.iv-group { margin-top: 12px; }
.iv-group-head { font-style: italic; font-weight: 600; margin-bottom: 4px; }
.iv-remaining { font-weight: 600; margin-top: 4px; }
/* Feste, automatisch aus Notion befüllte Zeile (z. B. Extra-Auflage Redaktion) — nicht editierbar. */
.iv-fixed { margin-top: 4px; color: var(--text-muted); }
.iv-fixed-val { font-variant-numeric: tabular-nums; }
.pv-kommentar-input {
	width: 100%; height: 2rem; padding: 6px 8px; font-size: 13px; margin-top: 6px;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	box-shadow: var(--shadow-xs); background: var(--input-bg); color: var(--text); font-family: inherit;
}
.pv-kommentar-input:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring); }
/* Standalone add buttons reuse the SAME mini component as the tag-picker add button
   (.tp-add): identical dashed pill. .btn-add-line only adds the block spacing below a
   list — the visual comes entirely from .tp-add, so there is ONE source of truth. */
.btn-add-line { margin-top: 10px; }
.mit-product-codes .product-row:last-child { border-bottom: none; }
.mit-product-codes input[type="text"] {
	width: 80px; height: 2rem; padding: 6px 8px; font-size: 13px;
	font-family: var(--font-mono);
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	box-shadow: var(--shadow-xs);
	background: var(--input-bg); color: var(--text);
	text-align: center; text-transform: uppercase;
}
.mit-product-codes input[type="text"]:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring); }
.mit-product-codes select {
	height: 2rem; padding: 6px 8px; font-size: 13px;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	box-shadow: var(--shadow-xs);
	background: var(--input-bg); color: var(--text); min-width: 160px;
	font-family: inherit;
}

/* "Sync prüfen" — non-prominent cache verification control */
.check-sync { white-space: nowrap; }
.check-sync-result {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 0.8125rem; color: var(--text-muted);
}
.check-sync-result .spinner { width: 12px; height: 12px; border-width: 2px; margin: 0; }
.check-sync-result .check-ok { color: var(--text-muted); }
.check-sync-result .check-all { font-size: 0.8125rem; }

/* Login-Admin sync bar + table controls */
.admin-syncbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.admin-syncbar .spinner { border-color: currentColor; border-right-color: transparent; }
.admin-role {
	height: 2rem; padding: 6px 8px; font-size: 13px;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	box-shadow: var(--shadow-xs);
	background: var(--input-bg); color: var(--text); font-family: inherit;
}
.admin-role:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring); }
/* Berechtigungen: module access as compact toggle chips (replaces 8 separate columns). */
.admin-mods-cell { min-width: 240px; max-width: 400px; }
.admin-mod-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-mod-chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 3px 10px 3px 8px; border-radius: 999px;
	border: 1px solid var(--card-border); background: var(--muted);
	font-size: 12px; line-height: 1.4; color: var(--text-muted);
	cursor: pointer; user-select: none;
	transition: background .12s, color .12s, border-color .12s;
}
.admin-mod-chip .admin-mod {
	position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none;
}
.admin-mod-chip::before {
	content: ''; width: 13px; height: 13px; flex: none; box-sizing: border-box;
	border: 1.5px solid var(--input-border); border-radius: 4px; background: var(--input-bg);
	transition: background .12s, border-color .12s;
}
.admin-mod-chip:has(.admin-mod:checked) {
	background: var(--gold-tint); border-color: var(--gold-tint-border); color: var(--text-strong);
}
.admin-mod-chip:has(.admin-mod:checked)::before {
	border-color: var(--gold-strong); background-color: var(--gold-strong);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 6.2l2.2 2.3 4.8-5'/%3E%3C/svg%3E");
	background-size: 11px 11px; background-position: center; background-repeat: no-repeat;
}
.admin-mod-chip:has(.admin-mod:disabled) { cursor: default; opacity: .55; }
.admin-mod-chip:hover:not(:has(.admin-mod:disabled)) { border-color: var(--input-focus); }
.admin-mod-chip:has(.admin-mod:focus-visible) { box-shadow: 0 0 0 3px var(--ring-soft); }
#admin-table td { vertical-align: middle; }
.admin-save { height: 2rem; padding: 0.4rem 0.875rem; font-size: 0.75rem; }
.admin-rowstatus { margin-left: 8px; white-space: nowrap; }

/* Admin-Tools sub-tabs keep the segmented-control pill look. */
.admin-subtabs { display: inline-flex; }

/* Settings sub-tabs — minimalist, full-bleed underline bar. One row, horizontally
   scrollable with soft edge fades; the active section gets a gold underline. This
   replaces the old segmented pill (which overflowed / had to stack). */
.settings-subtabs {
	flex: 1 1 100%;
	display: flex; flex-wrap: nowrap; gap: 0;
	margin: 4px calc(-1 * var(--app-pad)) 0;
	padding: 0 var(--app-pad);
	border-bottom: 1px solid var(--card-border);
	overflow-x: auto; overflow-y: hidden;
	scrollbar-width: none; -webkit-overflow-scrolling: touch;
	-webkit-mask-image: linear-gradient(to right, transparent, #000 var(--app-pad), #000 calc(100% - var(--app-pad)), transparent);
	        mask-image: linear-gradient(to right, transparent, #000 var(--app-pad), #000 calc(100% - var(--app-pad)), transparent);
}
.settings-subtabs::-webkit-scrollbar { display: none; }
.settings-subtabs .admin-subtab {
	flex: 0 0 auto; height: auto;
	margin: 0; padding: 12px 16px 13px;
	background: none; border: none; border-bottom: 2px solid transparent;
	border-radius: 0; box-shadow: none; cursor: pointer;
	font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--text-muted);
	transition: color .15s, border-color .15s;
}
.settings-subtabs .admin-subtab:hover:not(.active) { color: var(--text-strong); background: none; }
.settings-subtabs .admin-subtab.active {
	color: var(--text-strong); background: none; box-shadow: none;
	border-bottom-color: var(--gold-strong);
}
.settings-subtabs .admin-subtab:focus-visible { color: var(--text-strong); border-bottom-color: var(--ring); }
/* Admin Tools sub-tabs (Import / Bereinigung) — same look as admin sub-tabs */
.tools-subtab {
	height: auto; padding: 6px 14px; background: transparent; border: 1px solid transparent;
	box-shadow: none; cursor: pointer; border-radius: var(--radius-md);
	font-size: 14px; font-weight: 500; color: var(--text-muted);
	transition: background .15s, color .15s, box-shadow .15s;
}
.tools-subtab.active { color: var(--text-strong); background: var(--card-bg); box-shadow: var(--shadow-xs); }
.tools-subtab:hover:not(.active) { color: var(--text-strong); }
.tools-subpanel { display: none; }
.tools-subpanel.active { display: block; }
.sync-subpanel { display: none; }
.sync-subpanel.active { display: block; }

/* Generic admin/list tables — one harmonized look for every staff list
   (Abonnenten/Kunden, Rechnungen, Produkte, Pläne, plus the Notion-Listen and
   Zahlungen). All share: header band, row padding, hover, borderless last row and
   the leading selection column. */
#subs-table, #prods-table, #plans-table, #inv-table,
#nart-table, #naus-table, #naut-table, #nkun-table, #zlist-table {
	width: 100%; border-collapse: collapse;
	background: var(--card-bg); font-size: 0.875rem;
}
#subs-table th, #prods-table th, #plans-table th, #inv-table th,
#nart-table th, #naus-table th, #naut-table th, #nkun-table th, #zlist-table th,
#subs-table td, #prods-table td, #plans-table td, #inv-table td,
#nart-table td, #naus-table td, #naut-table td, #nkun-table td, #zlist-table td {
	text-align: left; padding: 11px 14px;
	border-bottom: 1px solid var(--section-border); vertical-align: middle;
}
#subs-table tbody tr:last-child td, #prods-table tbody tr:last-child td,
#plans-table tbody tr:last-child td, #inv-table tbody tr:last-child td,
#nart-table tbody tr:last-child td, #naus-table tbody tr:last-child td, #naut-table tbody tr:last-child td,
#nkun-table tbody tr:last-child td, #zlist-table tbody tr:last-child td { border-bottom: none; }
#subs-table th, #prods-table th, #plans-table th, #inv-table th,
#nart-table th, #naus-table th, #naut-table th, #nkun-table th, #zlist-table th {
	background: var(--muted); font-weight: 500;
	color: var(--text-muted); font-size: 0.8125rem;
}
#subs-table tbody tr:hover, #prods-table tbody tr:hover,
#plans-table tbody tr:hover, #inv-table tbody tr:hover,
#nart-table tbody tr:hover, #naus-table tbody tr:hover, #naut-table tbody tr:hover,
#nkun-table tbody tr:hover, #zlist-table tbody tr:hover { background: color-mix(in srgb, var(--muted) 60%, transparent); }
/* Right-aligned numeric cells keep their alignment even under the generic rule above. */
/* Ausgaben-Liste: Nummer und Datum nie umbrechen (sonst «2024-38-⏎39»), Titelspalte
   nimmt die Breite, die Artikelliste bleibt lesbar klein und gedeckt. */
#naus-table td.nr, #naus-table td.datum { white-space: nowrap; }
#naus-table td.artikelliste { font-size: 0.8125rem; color: var(--text-muted); }
#nart-table td.num, #naus-table td.num, #naut-table td.num, #nkun-table td.num, #zlist-table td.num,
#nart-table th.num, #naus-table th.num, #naut-table th.num, #nkun-table th.num, #zlist-table th.num { text-align: right; }

/* Dialog — shadcn modal */
.mit-dialog {
	position: fixed; inset: 0; background: rgba(0,0,0,.6);
	display: flex; align-items: center; justify-content: center; z-index: 50;
	animation: overlay-in .2s ease both;
}
.mit-dialog[hidden] { display: none; }
.mit-dialog-card {
	background: var(--card-bg); color: var(--text);
	padding: 24px; border-radius: var(--radius-xl);
	border: 1px solid var(--card-border);
	width: min(780px, 96vw); max-height: 92vh; overflow-y: auto;
	box-shadow: var(--shadow-lg);
	animation: dialog-in .2s cubic-bezier(.2,.7,.2,1) both;
}
.mit-dialog-card h2 {
	font-family: var(--font-head); font-size: 1.125rem; font-weight: 600;
	text-transform: none; letter-spacing: 0; color: var(--text-strong); margin: 0 0 12px;
}
.mit-dialog-grid {
	display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px;
}
.mit-issue-grid { grid-template-columns: 1.6fr 1fr 1fr; align-items: end; }
/* Read-only values (Ausgabe / Datum / Seitenanzahl) — shown as plain text, NOT as edit fields. */
.mit-readonly {
	height: 2.25rem; display: flex; align-items: center;
	padding: 8px 2px; font-size: 14px; font-weight: 600;
	border: none; background: transparent; color: var(--text-strong); font-variant-numeric: tabular-nums;
}
.mit-dialog-grid select, .mit-dialog-grid input {
	height: 2.25rem; padding: 8px 10px; font-size: 14px;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	box-shadow: var(--shadow-xs);
	background: var(--input-bg); color: var(--text); width: 100%;
	font-family: inherit;
}
.mit-dialog-grid select:focus, .mit-dialog-grid input:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring); }
.mit-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.mit-field input { height: 2.25rem; padding: 8px 12px; font-size: 14px; border: 1px solid var(--input-border); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); background: var(--input-bg); color: var(--text); }
.mit-ausgabe-blocks { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.ausgabe-block {
	border: 1px solid var(--card-border); border-radius: var(--radius-lg);
	padding: 12px 14px; background: var(--sub-bg);
}
.ausgabe-block h3 { font-size: 14px; margin: 0 0 8px; color: var(--text-strong); }
.ausgabe-block .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; margin: 0; }
.ausgabe-block .field > span { color: var(--text-muted); }
.ausgabe-block .row { display: grid; grid-template-columns: 1fr 90px auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.ausgabe-block input[type="text"], .ausgabe-block input[type="number"] {
	height: 2rem; padding: 6px 8px; font-size: 13px; border: 1px solid var(--input-border); border-radius: var(--radius-md);
	box-shadow: var(--shadow-xs);
	background: var(--input-bg); color: var(--text); width: 100%;
}
.ausgabe-block input:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring); }
.ausgabe-block input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
.ausgabe-block .block-grid { display: grid; grid-template-columns: 1fr 90px; gap: 8px; margin-bottom: 8px; }
.ausgabe-block .auto-stat { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; color: var(--text-muted); }
.ausgabe-block .icon-btn { height: auto; border: none; background: transparent; box-shadow: none; cursor: pointer; padding: 2px 6px; color: var(--destructive); font-size: 16px; line-height: 1; }
.ausgabe-block .add-line {
	height: auto;
	background: transparent; border: 1px dashed var(--card-border); color: var(--text-muted);
	padding: 4px 10px; font-size: 12px; border-radius: var(--radius-md); margin-top: 4px; cursor: pointer;
	box-shadow: none;
}
.ausgabe-block .add-line:hover { background: var(--accent); color: var(--text); }
/* Export dialog: read-only preview that mirrors the exported PDF. */
#mit-preview { max-width: 620px; }
.pv-title { font-weight: 700; font-size: 15px; margin: 2px 0 14px; }
.pv-pdf-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.pv-pdf-head .pv-title { margin: 0; flex: 1; }
.pv-pdf-state { font-size: 12px; color: var(--muted-text, #666); }
.pv-pdf-open { font-size: 13px; text-decoration: none; color: var(--link, #2563eb); white-space: nowrap; }
.pv-pdf-doc { background: var(--card-border, #e5e5e5); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 10px; display: flex; flex-direction: column; gap: 10px; max-height: 78vh; overflow: auto; -webkit-overflow-scrolling: touch; }
.pv-pdf-doc:empty { min-height: 200px; }
.pv-pdf-page { display: block; width: 100%; background: #fff; border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.pv-subtitle { display: block; font-weight: 400; font-size: 0.85em; color: var(--text-muted); margin-top: 3px; }
.pv-block { border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 12px 14px; }
.pv-block h3 { margin: 0 0 2px; font-size: 14px; }
.pv-sub { color: var(--text-muted); font-size: 12px; margin-bottom: 8px; }
.pv-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.pv-total { border-top: 1px solid var(--section-border); margin-top: 4px; padding-top: 6px; font-weight: 700; }
.pv-internal { background: var(--muted); }
.pv-internal-note { font-style: italic; color: var(--text-muted); font-size: 12px; }
.pv-internal-head { font-weight: 700; margin: 2px 0 6px; }
.mit-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
/* Confirmation dialog: compact card + destructive confirm button. */
.mit-confirm-card { width: min(420px, 94vw); }
.mit-confirm-card .hint { margin: 0 0 4px; color: var(--text); }
.mit-confirm-card .hint[hidden] { display: none; }
.app-modal-input { width: 100%; height: 2.25rem; margin-top: 10px; padding: 8px 12px; font-size: 14px; border: 1px solid var(--input-border); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); background: var(--input-bg); color: var(--text); font-family: inherit; }
.app-modal-input:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring); }
.app-modal-input[hidden] { display: none; }
/* Rückfragen dürfen mehrzeilig sein (z. B. die Empfängerliste vor dem ZIP-Versand). */
#app-modal-message { white-space: pre-line; }
button.primary.danger { background: var(--destructive); border-color: var(--destructive); color: #fff; }
button.primary.danger:hover { background: #e35d5d; border-color: #e35d5d; }

/* Administrator hinzufügen dialog */
#admin-add-search {
	width: 100%; height: 2.25rem; padding: 8px 12px; margin: 4px 0 12px;
	font-size: 14px; border: 1px solid var(--input-border); border-radius: var(--radius-md);
	box-shadow: var(--shadow-xs); background: var(--input-bg); color: var(--text); font-family: inherit;
}
#admin-add-search:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring); }
.admin-add-results {
	display: flex; flex-direction: column;
	max-height: 50vh; overflow-y: auto;
	border: 1px solid var(--card-border); border-radius: var(--radius-lg);
}
.admin-add-item {
	display: flex; flex-direction: column; gap: 2px;
	align-items: flex-start; justify-content: center;
	width: 100%; height: auto; text-align: left;
	background: transparent; border: none; border-bottom: 1px solid var(--section-border);
	border-radius: 0; box-shadow: none; padding: 10px 12px; cursor: pointer;
}
.admin-add-item:last-child { border-bottom: none; }
.admin-add-item:hover { background: var(--accent); }
.admin-add-name { font-size: 0.9375rem; color: var(--text-strong); font-weight: 500; }
.admin-add-email { font-size: 0.8125rem; color: var(--text-muted); }
.admin-add-empty { padding: 12px; margin: 0; }

/* All pages/modules share ONE container width for a coherent layout.
   Wide tables scroll horizontally inside .mit-table-wrap rather than
   widening the page, so switching tabs never shifts the body width. */
.mit-dashboard-grid { max-width: none; }

/* Benutzer table: full-bleed — spans the whole content width edge-to-edge next to the
   sidebar. Cancel the page gutter, drop side borders/rounding so it isn't a boxed card. */
#admin-sub-users .mit-table-wrap {
	margin-left: calc(-1 * var(--app-pad));
	margin-right: calc(-1 * var(--app-pad));
	border-left: none; border-right: none; border-radius: 0;
	box-shadow: none;
}
/* A real, tabular list — single-line rows, clean header, row dividers + hover. */
#admin-table { width: 100%; border-collapse: collapse; background: var(--card-bg); font-size: 0.875rem; }
#admin-table th, #admin-table td { text-align: left; vertical-align: middle; }
#admin-table thead th {
	padding: 11px 14px; background: var(--muted); border-bottom: 1px solid var(--section-border);
	font-weight: 500; color: var(--text-muted); font-size: 0.8125rem;
}
#admin-table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--section-border); }
#admin-table tbody tr:last-child td { border-bottom: none; }
#admin-table tbody tr:hover { background: color-mix(in srgb, var(--muted) 55%, transparent); }
/* First/last cells keep the page gutter so text lines up with the title, not the pixel edge. */
#admin-table th:first-child, #admin-table td:first-child { padding-left: var(--app-pad); }
#admin-table th:last-child, #admin-table td:last-child { padding-right: var(--app-pad); }
.admin-name-cell { font-weight: 500; color: var(--text-strong); white-space: nowrap; }
.admin-email-cell { color: var(--text-muted); }
.admin-perm-cell { max-width: 460px; }
.perm-list { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; color: var(--text-muted); }
.perm-all { color: var(--text); font-size: 0.8125rem; }
.admin-detail-td { text-align: right; white-space: nowrap; width: 1%; }
.admin-detail-btn {
	height: auto; padding: 6px 15px; font-size: 0.8125rem; font-weight: 500; cursor: pointer;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	background: var(--input-bg); color: var(--text); box-shadow: none;
}
.admin-detail-btn:hover { border-color: var(--input-focus); }

/* Role badge (read-only in the table; editable in the detail dialog). */
.role-badge {
	display: inline-block; padding: 3px 10px; border-radius: 999px;
	font-size: 0.75rem; font-weight: 500; white-space: nowrap;
	border: 1px solid var(--card-border); color: var(--text-muted); background: var(--muted);
}
.role-badge.role-super_admin { color: var(--gold-strong); border-color: var(--gold-tint-border); background: var(--gold-tint); }

/* Discreet "add person" button — pushed to the far right of the toolbar. */
.admin-add-btn {
	margin-left: auto; height: 2.25rem; padding: 0 14px; cursor: pointer;
	font-size: 0.8125rem; font-weight: 500; color: var(--text-muted);
	background: transparent; border: 1px solid var(--card-border);
	border-radius: var(--radius-md); box-shadow: none;
}
.admin-add-btn:hover { color: var(--text-strong); border-color: var(--input-focus); background: var(--accent); }

/* Benutzer-Detail dialog */
.admin-detail-card { max-width: 560px; width: 92%; }
.admin-detail-card h2 { margin-bottom: 2px; }
#admin-detail-body .detail-email { font-size: 0.875rem; margin: 0 0 16px; }
.detail-field { margin-bottom: 18px; }
.detail-label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 8px; }
.detail-role { width: 100%; max-width: 260px; height: 2.25rem; padding: 6px 10px; font-family: inherit; border: 1px solid var(--input-border); border-radius: var(--radius-md); background: var(--input-bg); color: var(--text); }
.detail-role:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring); }
.detail-mods { gap: 8px; }
.detail-views { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
.detail-view { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.detail-view:hover { background: var(--accent); }
.detail-view input { width: 15px; height: 15px; accent-color: var(--gold-strong); }
.detail-subhint { margin: 8px 0 0; }
.detail-meta { margin-bottom: 0; }
.detail-actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--card-border); }
.admin-imp-btn {
	height: auto; padding: 8px 16px; font-size: 0.875rem; cursor: pointer;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	background: var(--input-bg); color: var(--text); box-shadow: none;
}
.admin-imp-btn:hover { border-color: var(--input-focus); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-remove-btn {
	height: auto; padding: 8px 16px; font-size: 0.875rem; cursor: pointer;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	background: var(--input-bg); color: var(--danger, #c0392b); box-shadow: none;
}
.admin-remove-btn:hover { border-color: var(--danger, #c0392b); }
.admin-detail-status { margin-right: auto; }
/* "Produkte" restriction — a button (shows the allowed product names) that opens a modal. */
.prod-restrict-btn {
	cursor: pointer; padding: 4px 10px; font-size: 0.8125rem; white-space: normal; text-align: left; max-width: 340px; line-height: 1.3;
	border: 1px solid var(--input-border); border-radius: var(--radius-md); background: var(--input-bg); color: var(--text); box-shadow: none;
}
.prod-restrict-btn:hover:not([disabled]) { border-color: var(--input-focus); }
.prod-restrict-btn[disabled] { opacity: .5; cursor: default; }
.prod-modal-list { margin: 10px 0; max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.prod-opt { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.prod-opt:hover { background: var(--accent); }

/* ---------- Abonnenten-Views editor ---------- */
.views-list { display: flex; flex-direction: column; gap: 16px; }
.view-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--card); }
.view-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.view-card-head .view-name { flex: 1; font-size: 1rem; font-weight: 600; padding: 6px 8px; }
.view-card-head .view-rowstatus { margin-left: auto; }
.view-subhead { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 14px 0 6px; }
.view-plans { display: flex; flex-wrap: wrap; gap: 14px; }
.view-plan-group { min-width: 200px; }
.view-plan-prod { font-weight: 600; font-size: 0.8125rem; margin-bottom: 2px; }
.view-tabs { display: flex; flex-direction: column; gap: 10px; }
.view-tab { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; }
.view-tab-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.view-tab-head .view-tab-name { flex: 1; padding: 5px 8px; font-weight: 500; }
.view-tab-crits { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.view-crit { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.view-crit select, .view-crit input { padding: 4px 6px; font-size: 0.875rem; }
.view-crit .view-crit-value { flex: 1; min-width: 140px; }
.view-card-actions { margin-top: 12px; display: flex; gap: 8px; }
.view-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; background: var(--card); }
.view-summary-main { display: flex; flex-direction: column; gap: 2px; }
.view-summary-name { font-weight: 600; }
.view-summary-actions { display: flex; gap: 4px; }
.view-plan-prodhead { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.view-plan-caret { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 0.9rem; width: 18px; padding: 0; }
.view-plan-prodlabel { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.view-plan-plans { padding: 4px 0 8px 26px; display: flex; flex-direction: column; gap: 2px; }
.view-plan-group { border-bottom: 1px solid var(--border); }
.view-plans { display: block; }

/* Websites (SSO) admin panel — uses theme vars so it reads in light AND dark mode */
/* ── SSO website modal — one systematic layout ───────────────────────────────
   Every row: a muted label on top, a full-width control below. Read-only values
   (callback, credentials, endpoints) all share .sso-val-row: value stretches,
   action icons sit inline on the right — never below. Spacing comes from flex
   `gap`, never ad-hoc margins. Title + footer are fixed; only the body scrolls. */
.sso-modal-card { max-width: 760px; width: 94vw; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.sso-modal-card .sso-form { overflow-y: auto; min-height: 0; padding-right: 6px; }
.sso-modal-card .mit-dialog-actions { border-top: 1px solid var(--card-border); padding-top: 14px; margin-top: 14px; }

.sso-modal-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.sso-modal-titlebar .sso-modal-title { margin: 0; }
.sso-copyall { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--input-border); border-radius: var(--radius-md); background: var(--input-bg); color: var(--text-muted); font: inherit; font-size: 0.8rem; cursor: pointer; white-space: nowrap; }
.sso-copyall:hover { color: var(--text); border-color: var(--ghost-border); }
.sso-copyall svg { width: 15px; height: 15px; }

.sso-form { display: flex; flex-direction: column; gap: 16px; margin: 6px 0 8px; }
.sso-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.875rem; }
.sso-field > span { color: var(--text-muted); font-size: 0.8rem; }
.sso-field > input, .sso-field > textarea, .sso-field > select,
.sso-val-row > input, .sso-val {
	padding: 9px 12px; border: 1px solid var(--input-border); border-radius: var(--radius-sm);
	font: inherit; background: var(--input-bg); color: var(--text); resize: vertical;
}
.sso-field-error { color: var(--destructive); font-size: 0.78rem; line-height: 1.3; min-height: 1.3em; }
.sso-field > input.invalid { border-color: var(--destructive); }
.sso-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* Read-only value row: stretchy value + inline action icon(s). */
.sso-val-row { display: flex; align-items: center; gap: 8px; }
.sso-val-row > input, .sso-val-row > .sso-val { flex: 1; min-width: 0; }
.sso-val { display: block; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); word-break: break-all; }
.sso-field > input[readonly], .sso-val-row > input[readonly] { color: var(--text-muted); cursor: default; }

/* Icon-only action button — square, used for copy / edit / reset / regenerate. */
.sso-icon-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--input-border); border-radius: var(--radius-sm); background: var(--input-bg); color: var(--text-muted); cursor: pointer; }
.sso-icon-btn:hover { color: var(--text); border-color: var(--ghost-border); }
.sso-icon-btn.ok { color: var(--gold-strong); border-color: var(--gold-strong); }

/* Einrichtung group — always visible (no collapsible); separated by a hairline. */
.sso-advanced { display: flex; flex-direction: column; gap: 16px; border-top: 1px solid var(--card-border); padding-top: 16px; margin-top: 2px; }
.sso-modal-instructions { display: flex; flex-direction: column; gap: 16px; }
.sso-modal-instructions > * { margin: 0; }
.sso-fields { display: flex; flex-direction: column; gap: 16px; }

.sso-check-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sso-check-row input { padding: 9px 12px; border: 1px solid var(--input-border); border-radius: var(--radius-sm); font: inherit; background: var(--input-bg); color: var(--text); flex: 1 1 240px; }
.sso-check-result { line-height: 1.6; }
.sso-caveat { padding: 12px 14px; border-left: 3px solid var(--gold-strong); background: var(--gold-tint); border-radius: var(--radius-sm); font-size: 0.82rem; line-height: 1.55; }

/* Tag picker (reusable multi-select with chips + searchable dropdown) */
.tp-chips { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; margin-bottom: 0; min-height: 4px; }
.tp-empty { color: var(--text-muted); font-size: 0.8rem; }
/* Chips AND the add button are the SAME mini component: identical solid pill
   (same background, border box, radius, colour, font-size). The add button is just
   a chip without a × — so it inherits the whole look from this shared rule. */
.tp-chip, .tp-add { display: inline-flex; align-items: center; gap: 6px; background: var(--ghost-hover-bg); color: var(--text); border: 1px solid transparent; border-radius: 999px; padding: 3px 6px 3px 11px; font-size: 0.82rem; }
.tp-chip-x { appearance: none; -webkit-appearance: none; border: none; background: none; box-shadow: none; height: auto; cursor: pointer; color: var(--text-muted); font-size: 1rem; line-height: 1; padding: 0 2px; border-radius: 999px; }
.tp-chip-x:hover { background: none; color: var(--destructive); }
/* The × is a <button>, so the global button:focus-visible ring would draw a small
   circle around it — suppress it here so no border ever frames the cross. */
.tp-chip-x:focus, .tp-chip-x:focus-visible { border-color: transparent; box-shadow: none; outline: none; }
/* The add button is the last chip in the .tp-chips flow: symmetric padding (no ×),
   a pointer cursor, and a subtle hover so it reads as clickable. Spacing to the chips
   comes from the row gap, like every other chip — no extra margin. */
/* Neutralise the global `button {}` chrome (fixed height, box-shadow, line-height)
   so the add button is pixel-identical to a chip <span>, not a taller raised button.
   The global button:hover is switched off for .tp-add in base.css. */
.tp-add { padding-right: 11px; padding-left: 11px; cursor: pointer; font-family: inherit; height: auto; line-height: 1.4; box-shadow: none; }
.tp-add:hover { filter: brightness(1.25); }
/* Nothing left to add: greyed out; clicking flashes the "Keine weitere Optionen"
   note (.tp-note) instead of opening an empty popup, and hover shows it as a title. */
.tp-add--empty { opacity: .5; cursor: default; }
.tp-note { display: inline-flex; align-items: center; font-size: 0.78rem; color: var(--text-muted); background: var(--ghost-hover-bg); border-radius: 999px; padding: 3px 11px; }
/* In-flow (not absolute) so it can never be clipped by a scrolling modal/panel. */
.tp-pop { margin-top: 6px; width: 100%; max-width: 460px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow-md, 0 4px 16px rgba(0,0,0,.18)); padding: 8px; box-sizing: border-box; }
/* Modal flavour: a small centred popup over a dimmed backdrop. */
.tp-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1200; }
.tp-pop--modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 1201; margin: 0; width: min(360px, 92vw); max-width: none; max-height: 72vh; overflow: auto; }
.tp-search { width: 100%; box-sizing: border-box; padding: 7px 10px; border: 1px solid var(--input-border); border-radius: var(--radius-sm); font: inherit; background: var(--input-bg); color: var(--text); margin-bottom: 6px; }
.tp-list { max-height: 260px; overflow: auto; }
.tp-group { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 8px 6px 3px; }
.tp-opt { display: block; width: 100%; text-align: left; border: none; background: none; cursor: pointer; padding: 7px 8px; border-radius: var(--radius-sm); font: inherit; font-size: 0.85rem; color: var(--text); }
.tp-opt:hover { background: var(--ghost-hover-bg); }
.tp-hint { color: var(--text-muted); font-size: 0.78rem; }
.tp-none { color: var(--text-muted); font-size: 0.82rem; padding: 8px; }
/* Coloured flavour: the chip / option IS a badge (Status-Auswahl). The badge class
   supplies the colours, so the neutral chip shell is stripped and the × lives inside. */
.tp-chip--badge { background: none; border: none; padding: 0; border-radius: 0; }
.tp-chip--badge .badge { gap: 4px; padding-right: 0.3125rem; }
.tp-chip--badge .tp-chip-x {
	border: none; background: transparent; cursor: pointer; color: currentColor;
	opacity: .55; font-size: 13px; line-height: 1; padding: 0 0 0 2px; margin: 0;
	border-radius: 999px; display: inline-flex; align-items: center;
}
.tp-chip--badge .tp-chip-x:hover { opacity: 1; color: var(--destructive, #c0392b); }
.tp-opt--badge { padding: 5px 6px; }
/* Export-Produkt-Filter im Druckauftrag-Toolbar hostet einen Tag-Picker. `display:contents`
   dissolves the wrapper so its chips row sits on the SAME toolbar line as the Ausgabe-Select
   (instead of a full-width block below it); the dropdown still drops to its own full-width line. */
#mit-category-filter { display: contents; }
#mit-category-filter .tp-chips { flex: 1 1 240px; margin: 0; }
#mit-category-filter .tp-pop { flex-basis: 100%; }
/* Druckauftrag: Ausgabe-Nummer + Export-Button direkt nebeneinander auf der ersten
   Zeile, die Export-Produkt-Tags brechen auf eine eigene Zeile darunter um. */
.mit-export-toolbar #mit-category-filter .tp-chips { flex: 1 1 100%; }

/* Druckauftrag → E-Mails settings */
/* Box-Kopf: Titel links, Aktions-Button (Senden / Testen) oben rechts. */
.mit-box-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.mit-box-head h2 { margin: 0; }
.mit-box-head button { flex: 0 0 auto; }
.mit-email-actions { margin-top: 10px; display: flex; gap: 10px; align-items: center; min-height: 1.2em; }
.mit-field-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.mit-field-row > span { font-size: 0.875rem; }

/* E-Mail-Tab: Betreff/Text-Felder über die volle Breite des Blocks. */
#mit-sub-email .mit-add-product { display: block; width: 100%; box-sizing: border-box; }
#mit-sub-email textarea.mit-add-product { height: auto; resize: vertical; line-height: 1.45; }

/* E-Mail-Empfänger — Tags OBEN (separate Chips, kein Feld), darunter das Hinzufügen-Formular. */
.mit-email-taglist, .mit-email-autolist { margin-top: 6px; }
.mit-tags-row { margin-bottom: 10px; }
.mit-tag-input { flex: 1 1 220px; min-width: 160px; margin-top: 0 !important; }
.mit-tag-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Automatik-Formular: E-Mail + Zeitplan-Felder + Button in einer Zeile. */
.mit-auto-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.mit-auto-add .mit-tag-input { flex: 1 1 200px; }
.mit-auto-field { display: flex; flex-direction: column; gap: 3px; font-size: 0.72rem; color: var(--text-muted); }
.mit-auto-field select, .mit-auto-field input {
	height: 2rem; padding: 3px 8px; font-size: 13px; border: 1px solid var(--input-border);
	border-radius: var(--radius-md); background: var(--input-bg); color: var(--text); font-family: inherit;
}
.mit-auto-field input[type="number"] { width: 5.5rem; }

/* Automatik-Tag: Adresse + Zeitplan in einem Chip. */
.tp-chip--auto { gap: 8px; }
.mit-auto-chip-email { font-weight: 600; }
.mit-auto-chip-sched { color: var(--text-muted); font-size: 0.76rem; }

/* Wiederkehrende Nachrichten: je Nachricht eine Karte mit eigenem Rahmen. */
.mit-rt-card {
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	padding: 14px 16px 16px; margin-bottom: 14px; background: var(--card-bg, transparent);
}
.mit-rt-head { align-items: center; }
.mit-rt-name {
	flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 0.95rem;
	height: 2.1rem; padding: 3px 10px; border: 1px solid var(--input-border);
	border-radius: var(--radius-md); background: var(--input-bg); color: var(--text); font-family: inherit;
}
.mit-rt-head-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.mit-rt-del { font-size: 1.15rem; color: var(--text-muted); }
.mit-rt-del:hover { color: var(--destructive, #c0392b); }
.mit-rt-card .mit-subhead { margin-top: 14px; }
/* Ein-/Ausklapp-Pfeil links im Kopf jeder Nachricht. */
.mit-rt-collapse {
	flex: 0 0 auto; width: 1.9rem; height: 2.1rem; padding: 0; line-height: 1;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	background: var(--input-bg); color: var(--text-muted); cursor: pointer; font-size: 0.9rem;
}
.mit-rt-collapse:hover { color: var(--text); }
/* Zugeklappte Nachricht: nur der Kopf, kompakt. */
.mit-rt-card--collapsed { padding-bottom: 14px; }
.mit-rt-card--collapsed .mit-rt-head { margin: 0; }
.mit-rt-collapsed-info { flex: 0 0 auto; white-space: nowrap; }

/* Kopfzeile über einem Feld: nur der Titel (der „+ Platzhalter"-Knopf sitzt IM Feld). */
.mit-field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 8px; }
.mit-field-head .mit-subhead { margin: 0; }
/* Feld + „+ Platzhalter"-Knopf: der Knopf liegt oben rechts INNERHALB des Feldes. */
/* Honorare-Einstellungen: Felder über die ganze Breite (wie in den Druckauftrag-
   Einstellungen); nur die Währung bleibt schmal. */
#hon-settings-form .mit-add-product { display: block; width: 100%; box-sizing: border-box; }
#hon-settings-form textarea.mit-add-product { height: auto; resize: vertical; line-height: 1.45; }
#hon-set-admin-email, #hon-set-sender { max-width: 32rem; }
#hon-set-currency { max-width: 8rem; }

.mit-field-wrap { position: relative; display: block; margin-top: 12px; }
/* Kill the field's own top margin so the absolutely-positioned button anchors to the
   field's TOP EDGE (not the margin gap above it) — that gap is what pushed it "outside". */
.mit-field-wrap > .mit-add-product { width: 100%; box-sizing: border-box; margin-top: 0; }
.mit-field-wrap > input.mit-add-product { padding-right: 128px; }
.mit-field-wrap > textarea.mit-add-product { padding-top: 36px; }
.mit-ph-select {
	height: 1.9rem; padding: 2px 8px; font-size: 0.78rem;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	background: var(--input-bg); color: var(--text-muted); font-family: inherit; cursor: pointer;
	max-width: 60%;
}
.mit-ph-select:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring); }
/* The native <select> is progressively enhanced into a custom widget (.cs--mit-ph-select
   by dropdown.js), so the VISIBLE control is that wrapper — float IT (not the hidden
   native select) inside the field, top-right, small, with a shadow so it reads as floating. */
.mit-field-wrap > .cs--mit-ph-select {
	position: absolute; top: 5px; right: 6px; z-index: 3;
	min-width: 0; max-width: 116px;
}
.mit-field-wrap > .cs--mit-ph-select .cs-trigger {
	height: 1.6rem; padding: 0 5px 0 8px; gap: 0.25rem; font-size: 0.72rem;
	box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

/* „+"-Knopf am Ende der Empfängerliste (inline, gleiche Zeile). */
.tp-add--plus {
	appearance: none; -webkit-appearance: none;
	width: 1.75rem; height: 1.75rem; padding: 0; align-self: center;
	display: inline-flex; align-items: center; justify-content: center;
	border: 1px dashed var(--card-border); background: transparent; color: var(--text-muted);
	border-radius: 999px; font-size: 1.1rem; line-height: 1; cursor: pointer;
	box-shadow: none;
}
.tp-add--plus:hover { border-style: solid; border-color: var(--input-focus); color: var(--text); background: var(--ghost-hover-bg); }

/* Anklickbarer Empfänger-Chip: öffnet das Bearbeiten-Modal. */
.tp-chip--click { cursor: pointer; }
.tp-chip--click:hover { border-color: var(--input-border); }
.tp-chip--click:focus-visible { outline: 2px solid var(--input-focus); outline-offset: 1px; }

/* Empfänger-Modal (Adresse + optional Zeitplan). */
.mit-recipient-card { width: min(460px, 94vw); }
.mit-recipient-card .mit-recipient-email { margin-bottom: 14px; }
.mit-recipient-card .mit-field > span { color: var(--text-muted); }
.mit-recipient-sched { grid-template-columns: 1fr 1fr 1fr; }
.mit-recipient-sched .mit-field { font-size: 0.72rem; }

/* Import Script module */
.imp-step { margin: 12px 0; display: flex; align-items: center; gap: 12px; }
.imp-upload {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 0.55rem 1rem;
	border-radius: var(--radius-md);
	border: 1px solid var(--card-border);
	background: var(--card-bg);
	color: var(--text-strong);
	font-size: 0.9375rem; font-weight: 600;
	cursor: pointer;
	transition: background .15s, border-color .15s, box-shadow .15s;
}
.imp-upload:hover { border-color: var(--ring); background: var(--toggle-hover-bg); }
.imp-upload:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px var(--ring-soft); }
.imp-upload svg { flex: 0 0 auto; opacity: 0.8; }
.imp-paste-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; max-width: 640px; color: var(--text-muted); font-size: 0.8125rem; }
.imp-paste-or::before, .imp-paste-or::after { content: ""; flex: 1; height: 1px; background: var(--card-border); }
.imp-paste-box { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.imp-paste-label { font-size: 0.8125rem; color: var(--text-muted); }
#imp-paste {
	width: 100%; box-sizing: border-box; resize: vertical; min-height: 96px;
	padding: 0.55rem 0.7rem;
	border-radius: var(--radius-md);
	border: 1px solid var(--card-border);
	background: var(--card-bg); color: var(--text-strong);
	font: inherit; font-size: 0.875rem; line-height: 1.4;
	white-space: pre; overflow-wrap: normal; overflow-x: auto;
}
#imp-paste:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px var(--ring-soft); }
#imp-paste-btn { align-self: flex-start; }
.imp-actions { margin: 14px 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.imp-opt { display: flex; align-items: center; gap: 6px; font-size: 0.875rem; }
.imp-req { color: var(--destructive); }
/* Abo-Start preset: radios + date, dark-mode-readable native date control. */
.imp-startmode { flex-wrap: wrap; gap: 10px 16px; }
.imp-startmode-radios { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.imp-startmode-radios label { display: inline-flex; align-items: center; gap: 4px; }
.imp-startmode-date { display: inline-flex; align-items: center; gap: 6px; }
.imp-startmode input[type="date"] { color-scheme: dark; background: var(--input-bg, #1d2127); color: var(--text, #e6e6e6); border: 1px solid var(--card-border, #3a3f47); border-radius: 6px; padding: 3px 8px; }
.imp-startmode input[type="date"]:disabled { opacity: 0.55; }
.imp-warn { color: #b07b00; font-size: 0.8125rem; }
#imp-mapping-table select.imp-map { padding: 4px 6px; min-width: 180px; }
.imp-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; line-height: 1.45; }
.imp-badge.imp-ok { background: #e8f4e8; color: #1e6b32; }
.imp-badge.imp-skip { background: #eee; color: #555; }
.imp-badge.imp-new { background: #e6eefb; color: #2a3f9c; }
.imp-badge.imp-warn { background: #fdf0d5; color: #8a5a00; }
.imp-badge.imp-err { background: #fde8e8; color: #a13030; }
.danger-action { background: var(--destructive, #b8336a); }
/* Step-1 correspondence cell with a per-row Zoho-customer picker */
.imp-corr { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.imp-row-commit, .imp-pick-customer, .imp-pick-plan { padding: 3px 12px; font-size: 0.8rem; }

/* 4-step wizard: progress menu */
.imp-steps { display: flex; gap: 6px; margin: 18px 0; flex-wrap: wrap; }
.imp-stepbtn { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); color: var(--text-muted); font-size: 0.9rem; cursor: pointer; }
.imp-stepbtn .imp-stepno { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 999px; background: var(--border); color: var(--text); font-size: 0.78rem; font-weight: 700; }
.imp-stepbtn.active { border-color: var(--link-color); color: var(--text); font-weight: 600; }
.imp-stepbtn.active .imp-stepno { background: var(--link-color); color: #fff; }
.imp-nav-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.imp-nav-actions .imp-next { margin-left: auto; }

/* Import + cleanup tables — full width, same look as the other staff tables */
#imp-cust-table, #imp-sub-table, #imp-plans-table, #cleanup-table {
	width: 100%; border-collapse: collapse; background: var(--card-bg);
}
#imp-cust-table th, #imp-cust-table td,
#imp-sub-table th, #imp-sub-table td,
#imp-plans-table th, #imp-plans-table td,
#cleanup-table th, #cleanup-table td {
	text-align: left; padding: 5px 10px;
	border-bottom: 1px solid var(--section-border);
	font-size: 0.82rem; line-height: 1.3; vertical-align: middle;
}
#imp-cust-table th, #imp-sub-table th, #imp-plans-table th, #cleanup-table th {
	background: var(--muted); font-weight: 500; color: var(--text-muted); font-size: 0.76rem; padding-top: 6px; padding-bottom: 6px;
}
#imp-cust-table tbody tr:last-child td, #imp-sub-table tbody tr:last-child td, #imp-plans-table tbody tr:last-child td, #cleanup-table tbody tr:last-child td { border-bottom: none; }
#imp-cust-table tbody tr:hover, #imp-sub-table tbody tr:hover, #imp-plans-table tbody tr:hover, #cleanup-table tbody tr:hover { background: color-mix(in srgb, var(--muted) 60%, transparent); }
.imp-corr { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.imp-corr .imp-pick-customer { margin-left: auto; }

/* Search-picker modal list */
.imp-picker-list { margin: 10px 0; max-height: 56vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.imp-picker-item { text-align: left; background: transparent; border: none; border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer; font-size: 0.875rem; color: var(--text); }
.imp-picker-item:hover { background: var(--accent); }
#imp-picker-search { width: 100%; padding: 8px 10px; }
/* mapping: example navigator + matched grids (horizontal) + not-recognized list */
.imp-example-nav { display: flex; align-items: center; gap: 8px; margin: 6px 0 12px; font-size: 0.85rem; }
.imp-example-nav button { padding: 1px 10px; line-height: 1.4; font-size: 1rem; }
.imp-example-nav button:disabled { opacity: 0.4; cursor: default; }
.imp-group-head { font-size: 0.95rem; margin: 16px 0 6px; }
.imp-fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; }
.imp-frow { display: grid; grid-template-columns: minmax(110px, max-content) auto minmax(120px, 1fr) minmax(0, 1.1fr); align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; font-size: 0.85rem; }
.imp-frow:hover { background: rgba(127,127,127,0.06); }
.imp-frow-req { background: rgba(176,123,0,0.10); }
.imp-flabel { white-space: nowrap; font-weight: 500; }
.imp-arrow { color: var(--text-muted); }
.imp-frow select.imp-map { padding: 3px 6px; width: 100%; min-width: 0; font-size: 0.82rem; }
.imp-fsample { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-mok { color: #1e9e4a; font-weight: 700; }
.imp-mdash { color: var(--text-muted); }
@media (max-width: 1100px) { .imp-fgrid { grid-template-columns: 1fr; } }

/* ---------- "Für Mitarbeiter" empty state (staff with no modules) ---------- */
.mit-empty {
	margin: 8px 4px;
	padding: 18px 20px;
	border: 1px dashed var(--gold-tint-border);
	border-radius: var(--radius-xl);
	background: var(--gold-tint);
	color: var(--text-muted, inherit);
	max-width: 640px;
}

/* ---------- Login-Admin sub-panels (Benutzer / Abonnements / Produkte / Pläne / Rechnungen) ---------- */
.admin-subpanel { display: none; }
.admin-subpanel.active { display: block; }
/* invoice / status badge colours reusing the existing palette */
.badge-paid { background: rgb(220 252 231); color: rgb(22 101 52); border-color: rgb(187 247 208); }
.badge-overdue { background: rgb(254 226 226); color: rgb(153 27 27); border-color: rgb(254 202 202); }
html.dark .badge-paid { background: rgba(22,101,52,.25); color: rgb(187 247 208); border-color: rgba(22,101,52,.5); }
html.dark .badge-overdue { background: rgba(153,27,27,.25); color: rgb(254 202 202); border-color: rgba(153,27,27,.5); }

/* Section headings inside the combined "Produkte & Pläne" sub-panel */
.admin-section-title {
	font-family: var(--font-head);
	font-size: 1.05rem; font-weight: 600; margin: 22px 4px 10px;
	color: var(--text-strong);
}
.admin-subpanel > .admin-section-title:first-child { margin-top: 4px; }

/* Öffentliche Module (Login-Admin → Module) */
.pubmods-list { display: flex; flex-direction: column; gap: 4px; max-width: 28rem; }

/* Clickable customer rows (Abonnenten / Rechnungen) → open the cached-data dialog */
tr.row-clickable { cursor: pointer; }
tr.row-clickable:hover td { background: color-mix(in srgb, var(--muted) 60%, transparent); }
#tab-customer-detail .cust-detail-wrap { max-width: 760px; }
a.cust-zoho-link { font-size: 18px; text-decoration: none; align-self: center; }
/* "⋯" actions menu next to the customer name */
.cust-kebab { position: relative; display: inline-flex; align-self: center; }
.cust-kebab > button {
	background: none; border: 1px solid var(--border); border-radius: 8px;
	color: var(--text); cursor: pointer; font-size: 18px; line-height: 1;
	padding: 2px 8px 6px;
}
.cust-kebab > button:hover { background: color-mix(in srgb, var(--muted) 60%, transparent); }
.cust-kebab-menu {
	position: absolute; top: calc(100% + 4px); right: 0; z-index: 40;
	min-width: 220px; padding: 4px;
	background: var(--card-bg, var(--bg, #fff)); border: 1px solid var(--border);
	border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
	display: flex; flex-direction: column;
}
.cust-kebab-menu[hidden] { display: none; }
.cust-kebab-menu button {
	background: none; border: none; border-radius: 6px; color: var(--text);
	cursor: pointer; font: inherit; padding: 8px 10px; text-align: left;
}
.cust-kebab-menu button:hover { background: color-mix(in srgb, var(--muted) 60%, transparent); }
.cust-kebab-menu button.danger { color: var(--danger, #c0392b); }
.cust-detail h3 { font-size: 13px; margin: 14px 0 6px; }
.cust-detail .cust-list { margin: 0; padding-left: 18px; }
.cust-detail .cust-list li { margin: 2px 0; }

/* Zoho-Import (batched backfill) */
.zimport-list { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.zimport-row { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.zimport-row-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.zimport-step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent, #2d6cdf); color: #fff; font-size: 12px; font-weight: 600; }
.zimport-row-ctrls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.zimport-row-ctrls select { margin-left: 4px; }

/* ---- Sync-Übersicht: eine Karte je Datenquelle (Zoho / Notion) ---- */
.sync-list { display: flex; flex-direction: column; gap: 10px; max-width: 680px; }
.sync-source {
	display: flex; align-items: center; gap: 14px;
	border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
	background: var(--card-bg); transition: border-color .15s ease, box-shadow .15s ease;
}
.sync-source.is-active { border-color: var(--gold, #c8a04a); box-shadow: 0 0 0 3px rgba(200,160,74,.12); }
/* Die vier Notion-Einzelquellen liegen unter der Sammelquelle «Alle Notion-Daten» und
   werden erst auf Klick eingeblendet — der Alltag braucht nur den einen Knopf. */
.sync-more-toggle {
	align-self: flex-start; background: none; border: 0; padding: 2px 0;
	color: var(--link-color); font-size: 0.8125rem; cursor: pointer;
}
.sync-more-toggle:hover { color: var(--link-hover); }
.sync-detail-block { display: flex; flex-direction: column; gap: 10px; }
/* «↻ Von Notion holen» (Honorare, Druckauftrag): der Knopf IST die Fortschrittsanzeige —
   keine zweite Statuszeile daneben, die die Werkzeugleiste auseinanderzieht. Während des Laufs
   wandert ein Balken hinter der Beschriftung durch, die Beschriftung nennt Quelle und Schritt. */
.notion-sync-btn { position: relative; overflow: hidden; }
.notion-sync-btn .nsb-fill {
	position: absolute; left: 0; top: 0; bottom: 0; width: 0;
	background: var(--gold-tint); transition: width .6s ease; pointer-events: none;
}
.notion-sync-btn .nsb-label { position: relative; }
.notion-sync-btn.is-running { border-color: var(--gold-tint-border); }
/* Der laufende Knopf ist absichtlich nicht ausgegraut — sonst sieht Fortschritt aus wie «tot». */
.notion-sync-btn.is-running[disabled] { opacity: 1; cursor: progress; }
.notion-sync-btn.is-err { color: var(--destructive); border-color: var(--destructive-soft); }
.sync-source-main { flex: 1 1 auto; min-width: 0; }
.sync-source-head { display: flex; align-items: center; gap: 9px; }
.sync-source-head strong { font-size: 0.95rem; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-source-meta { margin-top: 3px; font-size: 0.8125rem; color: var(--text-muted); }
.sync-source-ctrl { flex: none; }
.sync-source-ctrl .primary { padding: 6px 14px; font-size: 0.85rem; }
/* Split-Button: Synchronisieren + ▾-Menü (Verbindungstest «Sync 50 Datensätze») */
.sync-split { position: relative; display: inline-flex; align-items: stretch; gap: 2px; }
.sync-menu-toggle {
	padding: 6px 8px; font-size: 0.85rem; cursor: pointer;
	border: 1px solid var(--border, #d5d9e0); border-radius: 6px;
	background: var(--panel, #fff); color: inherit;
}
.sync-menu-toggle:disabled { opacity: .5; cursor: default; }
.sync-menu {
	position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 200px;
	background: var(--panel, #fff); border: 1px solid var(--border, #d5d9e0); border-radius: 8px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .12); padding: 4px;
}
.sync-menu button {
	display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
	padding: 8px 10px; font-size: 0.85rem; border-radius: 6px; color: inherit;
}
.sync-menu button:hover { background: rgba(45, 108, 223, .08); }
:root.dark .sync-menu, :root.dark .sync-menu-toggle { background: #23262d; border-color: #3a3f49; }
.sync-err { color: #b4231c; }
:root.dark .sync-err { color: #f3968f; }

/* Group badge — same palette family as the sidebar nav tags. */
.sync-badge {
	flex: none; font-size: 0.625rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
	padding: 2px 8px; border-radius: 999px; line-height: 1.5;
}
.sync-badge-zoho { background: rgba(59,130,190,.16); color: rgb(37 99 145); }
.sync-badge-notion { background: rgba(120,113,108,.18); color: rgb(87 83 78); }
:root.dark .sync-badge-zoho { color: rgb(140 190 232); }
:root.dark .sync-badge-notion { color: rgb(198 193 188); }

/* Indeterminate progress bar while a source is syncing (Zoho background + Notion foreground). */
.sync-bar { position: relative; height: 6px; margin-top: 8px; border-radius: 999px; background: var(--accent, #eee); overflow: hidden; }
.sync-bar > span {
	position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: 999px;
	background: var(--gold, #c8a04a); animation: syncBar 1.1s ease-in-out infinite;
}
@keyframes syncBar { 0% { left: -40%; } 100% { left: 100%; } }
.sync-progress-text { margin-top: 5px; font-size: 0.75rem; color: var(--text-muted); }

@media (max-width: 560px) {
	.sync-source { flex-wrap: wrap; }
	.sync-source-ctrl { width: 100%; }
	.sync-source-ctrl .primary { width: 100%; }
}

/* Abonnenten / Rechnungen list pagination (200 per page) */
.mit-pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 12px 0; }
.mit-pager[hidden] { display: none; }
.mit-pager button { background: none; border: 0; color: var(--accent, #2d6cdf); cursor: pointer; font-size: 13px; padding: 4px 6px; }
.mit-pager button[disabled] { opacity: .4; cursor: default; }
.mit-pagesize { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mit-pagesize select { font-size: 13px; }

/* ---- Import: background-run activity indicator + Zoho deep-links ---- */
.imp-activity {
	position: fixed; right: 18px; bottom: 18px; z-index: 1200;
	display: inline-flex; align-items: center; gap: 8px;
	padding: 10px 16px; border: none; border-radius: 999px;
	background: var(--primary-bg, #37404c); color: #fff;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .28); cursor: pointer;
	font-size: 13px; font-weight: 600; line-height: 1;
}
.imp-activity:hover { background: var(--primary-bg-hover, #2a313b); }
.imp-activity[hidden] { display: none; }
.imp-activity-spinner {
	width: 14px; height: 14px; border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
	animation: imp-spin .8s linear infinite;
}
@keyframes imp-spin { to { transform: rotate(360deg); } }
.imp-zoho-link {
	display: inline-block; margin-left: 6px;
	text-decoration: none; font-weight: 700; font-size: 14px;
	color: var(--primary-bg, #37404c); opacity: .75;
}
.imp-zoho-link:hover { opacity: 1; text-decoration: underline; }
/* «Bei my.goetheanum ansehen» steht als Knopf neben dem Zoho-Pfeil — gleiche Optik. */
button.imp-zoho-link { background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
button.imp-zoho-link[disabled] { opacity: .4; cursor: default; }

.imp-cur-btn {
	display: inline-block; padding: 1px 7px; margin: 0;
	border: 1px solid var(--primary-bg, #37404c); border-radius: 999px;
	background: transparent; color: var(--primary-bg, #6f9bff); white-space: nowrap;
	font-size: 10px; font-weight: 600; cursor: pointer; line-height: 1.5;
}
.imp-cur-btn:hover { background: var(--primary-bg, #37404c); color: #fff; }
.imp-cur-status { margin-left: 2px; }

.imp-diff-btn {
	display: inline-block; padding: 1px 7px; margin: 0;
	border: 1px solid #c2841b; border-radius: 999px;
	background: transparent; color: #c2841b; white-space: nowrap;
	font-size: 10px; font-weight: 600; cursor: pointer; line-height: 1.5;
}
.imp-diff-btn:hover { background: #c2841b; color: #fff; }
.imp-diff-status-OBSOLETE { margin-left: 2px; }
/* Clarifies that a conflict isn't auto-resolved by the bulk import. */
.imp-diff-note { margin-top: 4px; max-width: 260px; font-size: 11px; line-height: 1.35; color: var(--text-muted); }

/* Easy case: Zoho field is empty, the file fills it → informational green badge (auto-imported). */
/* Consolidated status cell: one bold status-coloured comment + small inline chips, all on one line
   so every row keeps the same height. */
.imp-status-cell { display: flex; flex-direction: row; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.imp-status-text { font-weight: 600; font-size: 0.82rem; line-height: 1.35; white-space: nowrap; }
.imp-status-text.imp-ok { color: #3fae6e; }
.imp-status-text.imp-new { color: #6f9bff; }
.imp-status-text.imp-warn { color: #d49a3a; }
.imp-status-text.imp-err { color: #e06a6a; }
.imp-status-text.imp-skip { color: var(--text-muted); font-weight: 500; }
/* Equal-height rows: single line, clipped, vertically centred — regardless of content. */
#imp-sub-table td { height: 38px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
#imp-sub-table td:last-child { overflow: visible; }
.imp-fill-badge {
	display: inline-block; padding: 1px 7px; margin: 0;
	border: 1px solid rgba(46,139,87,.35); border-radius: 999px;
	background: rgba(46,139,87,.16); color: #3fae6e; white-space: nowrap;
	font-size: 10px; font-weight: 600; line-height: 1.5; cursor: pointer;
}
.imp-fill-badge:hover { background: rgba(46,139,87,.30); }

.imp-diff-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.imp-diff-table th, .imp-diff-table td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--card-border); vertical-align: top; }
.imp-diff-table th { font-weight: 600; color: var(--text-muted); }
.imp-diff-table td input[type="checkbox"] { transform: scale(1.1); }
/* Conflict report: file value stands out, Zoho's current value is muted/struck context. */
.imp-diff-table .imp-diff-file strong { color: var(--text-strong); }
.imp-diff-table .imp-diff-zoho { color: var(--text-muted); }
/* Person/context header on the conflict modal (good for screenshots to customer service). */
.imp-diff-ctx { margin: 2px 0 10px; }
.imp-diff-ctx .imp-diff-person { font-size: 15px; }
#imp-diff .mit-dialog-card { max-width: 640px; width: 92%; }

/* Per-row selection checkboxes in the import table. */
.imp-sel-th, .imp-sel-td { width: 34px; text-align: center !important; }
.imp-sel-td input[type="checkbox"], .imp-sel-th input[type="checkbox"] { transform: scale(1.15); cursor: pointer; }
/* Rows that already exist in Zoho (Übersprungen): dimmed, nothing to import. */
.imp-row-done td { opacity: 0.5; }
.imp-row-done td:last-child { opacity: 1; }
/* Post-import results: green tint for rows that were actually written to Zoho. */
.imp-row-ok td { background: rgba(46,139,87,.12); }
/* Date + commit controls pinned above the import list. */
.imp-actions-top { margin: 6px 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--card-border); }

/* Compact import result list (step 5) */
#imp-sub-table { font-size: 12.5px; }
#imp-sub-table th, #imp-sub-table td { padding: 4px 8px; }
#imp-sub-table td:first-child { font-weight: 600; white-space: nowrap; }

/* ---- Webhook log (Administration → Webhooks): incoming hooks + queue outcome ---- */
#wh-table { width: 100%; }
#wh-table td.nowrap { white-space: nowrap; }
#wh-table td.wh-result { max-width: 520px; overflow-wrap: anywhere; color: var(--text-muted); }
.wh-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.wh-badge.wh-ok { background: rgb(220 252 231); color: rgb(22 101 52); border-color: rgb(187 247 208); }
.wh-badge.wh-err { background: rgb(253 232 232); color: rgb(161 48 48); border-color: rgb(254 202 202); }
.wh-badge.wh-queue { background: rgb(255 243 214); color: rgb(138 90 0); border-color: rgb(253 230 138); }
:root.dark .wh-badge.wh-ok { background: rgb(26 58 42); color: rgb(121 217 164); }
:root.dark .wh-badge.wh-err { background: rgb(58 26 26); color: rgb(242 154 154); }
:root.dark .wh-badge.wh-queue { background: rgb(58 46 16); color: rgb(240 195 114); }
/* E-Mail-Versand (Postmark/SMTP) status card in the E-Mails admin panel */
.mail-status-card { border: 1px solid var(--input-border); border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 18px; background: var(--input-bg); }
.mail-status-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mail-dot { width: 10px; height: 10px; border-radius: 999px; background: rgb(180 180 180); flex: 0 0 auto; }
.mail-dot.mail-dot-ok { background: rgb(34 160 90); }
.mail-dot.mail-dot-err { background: rgb(200 60 60); }
.mail-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; margin-left: auto; }
.mail-badge.wh-ok { background: rgb(220 252 231); color: rgb(22 101 52); border-color: rgb(187 247 208); }
.mail-badge.wh-err { background: rgb(253 232 232); color: rgb(161 48 48); border-color: rgb(254 202 202); }
:root.dark .mail-badge.wh-ok { background: rgb(26 58 42); color: rgb(121 217 164); }
:root.dark .mail-badge.wh-err { background: rgb(58 26 26); color: rgb(242 154 154); }
.mail-status-detail { line-height: 1.5; }
.mail-test-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.mail-test-row input { flex: 1 1 240px; min-width: 0; padding: 7px 10px; border: 1px solid var(--input-border); border-radius: var(--radius-md); background: var(--bg); color: var(--text); font: inherit; }
.mit-status.wh-ok { color: rgb(22 101 52); }
.mit-status.wh-err { color: rgb(161 48 48); }
:root.dark .mit-status.wh-ok { color: rgb(121 217 164); }
:root.dark .mit-status.wh-err { color: rgb(242 154 154); }
.wh-more { margin-top: 12px; display: flex; align-items: center; gap: 12px; }
.wh-more button { padding: 6px 14px; border: 1px solid var(--input-border); border-radius: var(--radius-md); background: var(--input-bg); color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer; }
.wh-more button:hover { border-color: var(--accent); }

/* Druckauftrag: serverseitig paginierte Adressliste */
.mit-list-block { margin-top: 28px; }
.mit-list-title { font-size: 1.05rem; margin: 0 0 10px; }
/* Kleiner, unterstrichener Textlink zum Ein-/Ausklappen der Adressliste. */
.mit-list-toggle {
	background: none; border: none; box-shadow: none; padding: 0; height: auto;
	font: inherit; font-size: 0.85rem; color: var(--text-muted);
	text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.mit-list-toggle:hover { background: none; color: var(--text); }
/* Warnhinweis direkt neben dem Titel «Belegexemplare» — sichtbar auch wenn die Liste
   zugeklappt ist (z. B. Empfänger ohne Zoho-ID, die in der Lieferung fehlen). */
.mit-beleg-warn {
	display: inline-block; margin-left: 10px; padding: 2px 8px; border-radius: 999px;
	font-size: 0.78rem; font-weight: 600; line-height: 1.5;
	color: #b42318; background: rgba(217, 45, 32, 0.12); border: 1px solid rgba(217, 45, 32, 0.35);
}
html.dark .mit-beleg-warn { color: #ff9a90; background: rgba(255, 120, 105, 0.14); border-color: rgba(255, 120, 105, 0.4); }
.mit-list-pager { display: flex; align-items: center; gap: 12px; margin-top: 10px; }

/* ===== Erinnerungen / Mahnwesen ============================================ */
/* Sub-Tabs — gleicher Look wie die Admin-Tools-Sub-Tabs */
.erin-subtab {
	height: auto; padding: 6px 14px; background: transparent; border: 1px solid transparent;
	box-shadow: none; cursor: pointer; border-radius: var(--radius-md);
	font-size: 14px; font-weight: 500; color: var(--text-muted);
	transition: background .15s, color .15s, box-shadow .15s;
}
.erin-subtab.active { color: var(--text-strong); background: var(--card-bg); box-shadow: var(--shadow-xs); }
.erin-subtab:hover:not(.active) { color: var(--text-strong); }
.erin-subpanel { display: none; }
.erin-subpanel.active { display: block; }

/* Kandidaten-/Logs-Tabellen — gleiche Optik wie die anderen Admin-Tabellen */
#erin-cand-table, #erin-logs-table {
	width: 100%; border-collapse: collapse;
	background: var(--card-bg); font-size: 0.875rem;
}
#erin-cand-table th, #erin-logs-table th,
#erin-cand-table td, #erin-logs-table td {
	text-align: left; padding: 11px 14px;
	border-bottom: 1px solid var(--section-border); vertical-align: middle;
}
#erin-cand-table th, #erin-logs-table th {
	background: var(--muted); font-weight: 500; color: var(--text-muted); font-size: 0.8125rem;
}
#erin-cand-table tbody tr:last-child td, #erin-logs-table tbody tr:last-child td { border-bottom: none; }
#erin-cand-table tbody tr:hover, #erin-logs-table tbody tr:hover { background: color-mix(in srgb, var(--muted) 60%, transparent); }
#erin-cand-table td.num, #erin-cand-table th.num { text-align: right; white-space: nowrap; }

.badge-warn { background: rgb(255 243 214); color: rgb(138 90 0); border-color: rgb(253 230 138); margin-left: 6px; }
:root.dark .badge-warn { background: rgb(58 46 16); color: rgb(240 195 114); }

/* Spaltenbreiten der Kandidatenliste: Rechnungen und «Fällig seit» brauchen den Platz
   (Nummer + Stufen-Tag bzw. «vor 306 Tagen» sollen nicht umbrechen), Person darf schrumpfen. */
#erin-cand-table { table-layout: fixed; width: 100%; }
#erin-cand-table th:nth-child(2), #erin-cand-table td:nth-child(2) { width: 22%; }
#erin-cand-table th:nth-child(3), #erin-cand-table td:nth-child(3) { width: auto; }
#erin-cand-table th:nth-child(4), #erin-cand-table td:nth-child(4) { width: 8.5rem; white-space: nowrap; }
#erin-cand-table th:nth-child(5), #erin-cand-table td:nth-child(5) { width: 9rem; }
#erin-cand-table th:last-child, #erin-cand-table td:last-child { width: 3.5rem; }
#erin-cand-table td:nth-child(2) { overflow-wrap: anywhere; }

/* Rechnungsnummern mit kleinem Mahnstufen-Tag daneben (statt einer eigenen Spalte). */
.erin-inv-list { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.erin-inv { color: var(--text-faint); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.erin-lvl-tag { font-size: 11px; padding: 1px 6px; white-space: nowrap; }

/* „⋯"-Menü je Zeile (das Menü selbst hängt fix positioniert am <body>). */
.erin-row-menu-btn {
	background: none; border: 1px solid var(--border); border-radius: 8px;
	color: var(--text); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 8px 6px;
}
.erin-row-menu-btn:hover { background: color-mix(in srgb, var(--muted) 60%, transparent); }
.erin-row-menu { position: fixed; top: 0; left: 0; right: auto; width: max-content; }

/* «Kürzlich gemahnt»: das Versanddatum ist schmal, damit die nächste Stufe Platz hat. */
.erin-when-col { width: 1%; white-space: nowrap; }

/* Mahnstufen-Filter über der Kandidatenliste (Alle · 1. Mahnstufe · …). */
.erin-lvl-filter { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.erin-lvl-btn {
	background: none; border: 1px solid var(--border); border-radius: 999px;
	color: var(--text); cursor: pointer; font: inherit; font-size: 12px; padding: 3px 12px;
	display: inline-flex; align-items: center; gap: 6px;
}
.erin-lvl-btn:hover { background: color-mix(in srgb, var(--muted) 60%, transparent); }
.erin-lvl-btn.active { background: var(--accent, #b8860b); border-color: transparent; color: #fff; }
.erin-lvl-count { color: var(--text-faint); font-size: 11px; }
.erin-lvl-btn.active .erin-lvl-count { color: inherit; opacity: .8; }

/* Sprachumschalter über den Mahntexten (Grundsprache + Übersetzungen). */
.erin-lang-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 6px; }
.erin-lang-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.erin-lang-tab {
	background: none; border: 1px solid var(--border); border-radius: 999px;
	color: var(--text); cursor: pointer; font: inherit; font-size: 12px; padding: 3px 12px;
}
.erin-lang-tab:hover { background: color-mix(in srgb, var(--muted) 60%, transparent); }
.erin-lang-tab.active { background: var(--accent, #b8860b); border-color: transparent; color: #fff; }
/* Briefsprache einer Person in der Kandidatenliste (nur wenn nicht Deutsch). */
.erin-lang-badge { font-size: 11px; padding: 1px 6px; }

/* Vorschau-Knopf je Mahnstufe: klein und rechts, nicht als Block mitten im Formular. */
.erin-level-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.erin-level-actions .erin-level-preview { font-size: 12px; padding: 2px 6px; }

/* Beilagen (Rechnungskopien) unter dem Brief in der Vorschau. */
.erin-encl { margin-top: 18px; }
.erin-encl-title { font-size: 13px; margin: 0 0 10px; }
.erin-encl-item { margin-bottom: 14px; }
.erin-encl-label { font-size: 12px; color: var(--text-faint); margin-bottom: 4px; }

/* Mahnstufe farblich codiert (eskalierend): 1 = gelb, 2 = orange, 3+ = rot. */
.erin-lvl-1 { background: rgb(255 243 214); color: rgb(138 90 0); border-color: rgb(253 230 138); }
.erin-lvl-2 { background: rgb(255 231 204); color: rgb(154 74 0); border-color: rgb(253 205 150); }
.erin-lvl-3 { background: rgb(253 232 232); color: rgb(161 48 48); border-color: rgb(254 202 202); }
:root.dark .erin-lvl-1 { background: rgb(58 46 16); color: rgb(240 195 114); border-color: rgba(146,64,14,.5); }
:root.dark .erin-lvl-2 { background: rgb(64 40 14); color: rgb(244 178 120); border-color: rgba(154,74,0,.5); }
:root.dark .erin-lvl-3 { background: rgb(58 26 26); color: rgb(242 154 154); border-color: rgba(153,27,27,.5); }

/* Vorschau als reines Auge-Icon. */
.erin-eye {
	display: inline-flex; align-items: center; justify-content: center;
	background: none; border: 0; padding: 4px; cursor: pointer;
	color: var(--text-muted); border-radius: 6px; line-height: 0;
}
.erin-eye:hover { color: var(--link-hover); background: var(--muted); }
.chk-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--text); cursor: pointer; }

/* Einstellungen */
.erin-settings-grid { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.erin-settings-grid label, .erin-block, .erin-level label { display: flex; flex-direction: column; gap: 4px; font-size: 0.875rem; color: var(--text-muted); }
.erin-settings-grid input { width: 120px; }
.erin-block { max-width: 520px; margin-bottom: 16px; }
.erin-block input, .erin-block textarea,
.erin-level input, .erin-level textarea {
	font: inherit; padding: 8px 10px; border: 1px solid var(--section-border);
	border-radius: var(--radius-md); background: var(--card-bg); color: var(--text); width: 100%;
}
.erin-ph code { background: var(--muted); padding: 1px 6px; border-radius: 4px; font-size: 0.8em; margin-right: 2px; white-space: nowrap; }
.erin-level {
	border: 1px solid var(--section-border); border-radius: var(--radius-lg);
	padding: 14px 16px; margin: 0 0 16px; max-width: 700px; display: flex; flex-direction: column; gap: 12px;
}
.erin-level legend { font-weight: 600; color: var(--text-strong); padding: 0 6px; }

/* Brief-Vorschau-Modal (Erinnerungen) */
.erin-modal {
	position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55);
	display: flex; align-items: center; justify-content: center; padding: 24px;
}
.erin-modal[hidden] { display: none; }
.erin-modal-card {
	background: var(--card-bg); color: var(--text); border-radius: var(--radius-xl);
	box-shadow: var(--shadow-lg, 0 10px 40px rgba(0,0,0,.3));
	width: min(760px, 100%); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
}
.erin-modal-head {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 12px 16px; border-bottom: 1px solid var(--section-border);
}
.erin-modal-title { font-weight: 600; color: var(--text-strong); font-size: 0.95rem; }
.erin-modal-close {
	background: transparent; border: none; cursor: pointer; font-size: 16px;
	color: var(--text-muted); padding: 4px 8px; border-radius: var(--radius-md);
}
.erin-modal-close:hover { background: var(--muted); color: var(--text-strong); }
.erin-modal-body { padding: 20px; overflow: auto; background: var(--muted); }
.erin-sheet {
	width: 100%; min-height: 60vh; border: none; background: #fff;
	box-shadow: 0 1px 6px rgba(0,0,0,.15); border-radius: 4px; padding: 0;
	/* A4-Seitenverhältnis-Gefühl; der Briefinhalt selbst bringt seine Ränder mit */
	aspect-ratio: 210 / 297; padding: 28px;
}

/* Kunden-Übersicht im Mahnwesen (Klick auf eine Zeile der Kandidatenliste) */
#erin-cand-table tbody tr[data-id] { cursor: pointer; }
#erin-sheet-modal .erin-modal-card { width: min(920px, 100%); }
.erin-cust-body { background: var(--card-bg); }
.erin-cust-head { margin-bottom: 16px; }
.erin-cust-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.erin-cust-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.erin-cust-table th {
	text-align: left; font-weight: 500; color: var(--text-muted); font-size: 0.8125rem;
	padding: 8px 10px; border-bottom: 1px solid var(--section-border); white-space: nowrap;
}
.erin-cust-table td { padding: 10px; border-bottom: 1px solid var(--section-border); vertical-align: top; }
.erin-cust-table tbody tr:last-child td { border-bottom: none; }
.erin-cust-table .num { text-align: right; white-space: nowrap; }
.erin-rem-list { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; }
.erin-rem-list li { line-height: 1.45; }
.erin-rem-zip { padding: 0; font-size: inherit; }
.erin-err { color: var(--danger, #c00); }

/* Erinnerungen — „+ Platzhalter"-Dropdown in Betreff/Text (wie Druckauftrag-Mails) */
.erin-level .mit-field-wrap { margin-top: 0; }
.erin-level .mit-field-wrap > input,
.erin-level .mit-field-wrap > textarea { width: 100%; box-sizing: border-box; }
.erin-level .mit-field-wrap > input { padding-right: 122px; }
.erin-level .mit-field-wrap > textarea { padding-top: 34px; }
/* Falls dropdown.js den Select (noch) nicht in ein Widget verwandelt hat: nativen
   Select trotzdem oben rechts schweben lassen, damit er das Feld nicht verschiebt. */
.erin-level .mit-field-wrap > select.mit-ph-select { position: absolute; top: 5px; right: 6px; z-index: 3; max-width: 150px; }

/* ===== Bankzahlungen / Zahlungsabgleich ===== */
.zahl-upload-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 12px 0 16px; }
.zahl-subpanel { display: none; }
.zahl-subpanel.active { display: block; }
#zahl-match-table td.num, #zahl-verlauf-table td.num { text-align: right; white-space: nowrap; }
#zahl-match-table select.zahl-inv { max-width: 320px; }
/* ---- Echte Tabelle für Abgleich/Bewegungen: klare Zellen, Trennlinien,
   mehrzeilige Inhalte statt abgeschnittener Texte. ---- */
.zahl-table { width: 100%; border-collapse: collapse; background: var(--card-bg); table-layout: fixed; }
.zahl-table th, .zahl-table td {
	text-align: left; padding: 10px 12px; vertical-align: top;
	font-size: 0.875rem; line-height: 1.4;
	border-bottom: 1px solid color-mix(in srgb, var(--section-border) 55%, transparent);
	overflow-wrap: anywhere;
}
.zahl-table th:first-child, .zahl-table td:first-child { padding-left: 0; }
.zahl-table th:last-child, .zahl-table td:last-child { padding-right: 0; }
.zahl-table tbody tr:last-child td { border-bottom: none; }
.zahl-table thead th {
	background: var(--card-bg); font-weight: 600; color: var(--text-faint);
	font-size: 0.72rem; text-transform: uppercase; letter-spacing: .04em;
	white-space: nowrap; position: sticky; top: 0; z-index: 1;
	border-bottom: 1px solid var(--section-border); padding-bottom: 6px;
}
.zahl-table tbody tr:hover { background: color-mix(in srgb, var(--muted) 45%, transparent); }
.zahl-table td.num, .zahl-table th.num { text-align: right; }
.zahl-table .zahl-c-chk { text-align: center; padding-left: 6px; padding-right: 6px; }
.zahl-table .zahl-c-date { white-space: nowrap; color: var(--text-muted); }
.zahl-table .zahl-c-amount { white-space: nowrap; }
/* Spalte «Zahlung»: Zeile 1 Datum + Betrag, Zeile 2 Zahler — nie mehr als zwei Zeilen. */
.zahl-table .zahl-c-pay { white-space: normal; }
.zahl-pay-top { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.zahl-pay-date { color: var(--text-muted); font-size: .8125rem; }
.zahl-pay-amount { font-variant-numeric: tabular-nums; }
/* Nichts wird abgeschnitten: Zahler und Beschreibung tragen die Angaben, mit denen
   die Rechnung von Hand gefunden wird (im Verwendungszweck steckt oft der wahre
   Name). Ein «…» versteckt genau das — darum umbrechen statt kürzen. */
.zahl-pay-name {
	font-weight: 500; font-size: .8125rem; margin-top: 1px;
	white-space: normal; overflow-wrap: anywhere; line-height: 1.35;
}
.zahl-table .zahl-c-desc { white-space: normal; color: var(--text-muted); }
.zahl-desc { line-height: 1.35; overflow-wrap: anywhere; }
/* Mindesthöhe statt fester Höhe — kurze Zeilen bleiben ruhig, lange dürfen wachsen. */
.zahl-table tbody td { min-height: 74px; }
.zahl-table .zahl-c-inv { white-space: normal; }
/* Rechnung: fertige Zuordnung als Text, «Ändern» öffnet das Suchfenster. */
.zahl-invcell { display: flex; flex-direction: column; gap: 1px; }
.zahl-inv-no { font-weight: 600; font-variant-numeric: tabular-nums; }
.zahl-inv-sub { white-space: normal; overflow-wrap: anywhere; }
.zahl-inv-none { color: var(--text-faint); font-style: italic; }
.zahl-inv-edit {
	align-self: flex-start; padding: 0; margin-top: 2px; height: auto; width: auto;
	background: none; border: 0; box-shadow: none; font-size: .72rem; cursor: pointer;
}

/* Suchfenster für die Rechnungswahl (frei über der Seite positioniert). */
.zahl-pick {
	position: fixed; z-index: 1200; width: 460px; max-width: calc(100vw - 24px);
	background: var(--card-bg); border: 1px solid var(--card-border);
	border-radius: var(--radius-md, 10px); box-shadow: var(--shadow-lg, 0 12px 32px rgb(0 0 0 / .18));
	padding: 8px; display: flex; flex-direction: column; gap: 6px;
}
.zahl-pick-input { width: 100%; height: 34px; font-size: .875rem; }
.zahl-pick-list { max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.zahl-pick-item {
	display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
	width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px;
	background: transparent; color: inherit; cursor: pointer; font-size: .8125rem; line-height: 1.35;
}
.zahl-pick-item:hover, .zahl-pick-item.is-active { background: var(--accent); }
.zahl-pick-line1 { display: flex; gap: 8px; width: 100%; align-items: baseline; }
.zahl-pick-no { font-weight: 600; font-variant-numeric: tabular-nums; }
.zahl-pick-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zahl-pick-amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.zahl-pick-sub { color: var(--text-muted); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.zahl-pick-others { color: var(--text-muted); font-size: .75rem; }
.zahl-pick-empty { padding: 10px 8px; }
.zahl-table .zahl-c-conf { white-space: normal; }
/* Die drei Kriterien untereinander, jedes mit Haken oder Kreuz. */
.zahl-crits { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 3px; }
.zahl-crit { color: var(--text-muted); font-size: .75rem; white-space: nowrap; }
/* Dezenter Haken statt buntem Emoji. */
.zahl-crit-tick { color: var(--text-faint); margin-right: 5px; font-size: .7rem; }
.zahl-crit-none { color: var(--text-faint); font-style: italic; }
/* Letzte Spalte: «Verbuchen» für genau diese eine Zeile. */
.zahl-table .zahl-c-act { text-align: right; white-space: nowrap; }
.zahl-book-one {
	width: auto; height: auto; padding: 5px 10px;
	font-size: 0.75rem; font-weight: 500; border-radius: var(--radius-md, 8px);
}
.zahl-book-one:disabled { opacity: .45; cursor: not-allowed; }
/* Die Bewegungsliste hat keine feste Spaltenaufteilung — sie darf sich am Inhalt ausrichten. */
#zahl-tx-table.zahl-table { table-layout: auto; }

/* Aktionsleiste über der Tabelle: Auswahlhilfen gruppiert, Verbuchen rechts. */
/* Eine einzige Zeile: Auswahlhilfen links, Verbuchen-Knopf rechts aussen.
   Der lange Zoho-Statustext darf schrumpfen, damit der Knopf nicht umbricht. */
.zahl-actionbar { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; margin: 0 0 12px; }
.zahl-actionbar-spacer { flex: 1 1 auto; }
.zahl-actionbar > .zahl-selwrap, .zahl-actionbar > .zahl-book-btn { flex: none; }
.zahl-actionbar > #zahl-file-status {
	flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.zahl-actionbar > #zahl-abgleich-count { flex: none; white-space: nowrap; }
@media (max-width: 720px) { .zahl-actionbar { flex-wrap: wrap; } }
/* Auswahl-Dropdown (Eindeutige / Alle / Keine) über der Tabelle. */
.zahl-selwrap {
	display: inline-flex; align-items: center; gap: 0;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	background: var(--card-bg); box-shadow: var(--shadow-xs); overflow: hidden;
}
.zahl-selwrap select {
	border: none; box-shadow: none; background: transparent; height: 34px;
	padding: 0 28px 0 12px; font-size: .8125rem; border-radius: 0; min-width: 0;
}
.zahl-selwrap select:focus { outline: none; }

/* ---- Ladezustand nach einem Kontowechsel ----
   Die Ergebnisbereiche werden gedimmt und gesperrt, damit sofort erkennbar ist,
   dass gerade neu geladen wird. Die Kontowahl selbst bleibt bedienbar. */
.zahl-loading .zahl-subpanel.active > #zahl-abgleich-results,
.zahl-loading .zahl-subpanel.active > .mit-table-wrap,
.zahl-loading .zahl-subpanel.active > .mit-toolbar {
	opacity: .35; pointer-events: none; filter: grayscale(.4);
	transition: opacity .15s ease;
}
.zahl-loading .zahl-navrow { opacity: .85; }
.mit-status.is-busy { display: flex; align-items: center; gap: 8px; }
.zahl-spinner {
	width: 14px; height: 14px; flex: none; border-radius: 50%;
	border: 2px solid color-mix(in srgb, var(--text-faint) 45%, transparent);
	border-top-color: var(--accent, var(--text));
	animation: zahl-spin .7s linear infinite;
}
@keyframes zahl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .zahl-spinner { animation-duration: 2s; } }

tr.zahl-booked { opacity: 0.6; }
/* Verbucht: die Zeile leuchtet kurz grün auf und blendet sich dann aus. */
.zahl-flash > td { background: rgba(34, 160, 90, 0.22); transition: background 140ms ease; }
.zahl-flash { transition: opacity 200ms ease; }
.zahl-flash-out { opacity: 0; }

.zahl-badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.zahl-badge.zahl-ok { background: rgba(34, 160, 90, 0.16); color: rgb(22 101 52); }
.zahl-badge.zahl-warn { background: rgba(214, 158, 46, 0.18); color: rgb(146 94 12); }
.zahl-badge.zahl-muted { background: var(--toggle-hover-bg); color: var(--text-muted); }
:root.dark .zahl-badge.zahl-ok { color: rgb(121 217 164); }
:root.dark .zahl-badge.zahl-warn { color: rgb(233 190 118); }

/* ===== Provenienz-Etiketten (Datenquelle je Modul) ===== */
/* Kompaktes Chip in der Seitenleiste (rechtsbündig, im eingeklappten Menü ausgeblendet). */
.nav-tag {
	margin-left: auto; flex: none;
	font-size: 0.625rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
	padding: 1px 6px; border-radius: 999px; line-height: 1.5;
}
.nav-tag-zoho { background: rgba(59, 130, 190, 0.16); color: rgb(37 99 145); }
.nav-tag-test { background: rgba(214, 158, 46, 0.20); color: rgb(146 94 12); }
:root.dark .nav-tag-zoho { color: rgb(140 190 232); }
:root.dark .nav-tag-test { color: rgb(233 190 118); }
.nav-tag-notion { background: rgba(120, 113, 108, 0.16); color: rgb(87 83 78); }
:root.dark .nav-tag-notion { color: rgb(190 185 180); }
.nav-tag-bank { background: rgba(34, 160, 90, 0.16); color: rgb(22 101 52); }
:root.dark .nav-tag-bank { color: rgb(121 217 164); }

/* Herkunfts-Chip in einer Tabellen-Kopfzeile (Bank = camt-Datei, Zoho = Books). */
th .nav-tag { margin-left: 6px; vertical-align: middle; display: inline-block; }

/* Pfeil zur Rechnung in Zoho Books, direkt neben der Nummer. */
.zahl-inv-open { margin-left: 6px; text-decoration: none; color: var(--text-muted); font-size: 0.85em; }
.zahl-inv-open:hover { color: var(--accent, rgb(37 99 145)); }

/* Grösseres Etikett neben dem Modultitel. */
.prov-tag {
	display: inline-flex; align-items: center; gap: 5px;
	font-size: 0.75rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap;
}
.prov-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.prov-zoho { background: rgba(59, 130, 190, 0.14); color: rgb(37 99 145); }
.prov-test { background: rgba(214, 158, 46, 0.18); color: rgb(146 94 12); }
:root.dark .prov-zoho { color: rgb(140 190 232); }
:root.dark .prov-test { color: rgb(233 190 118); }
.prov-notion { background: rgba(120, 113, 108, 0.14); color: rgb(87 83 78); }
:root.dark .prov-notion { color: rgb(190 185 180); }


#zlist-table td.num { text-align: right; white-space: nowrap; }

/* ---------- Rechnungsversand: strukturierte Liste im Stil der Benutzer-Tabelle ---------- */
#rv-table {
	width: 100%; border-collapse: collapse; background: var(--card-bg);
	border: 1px solid var(--section-border); border-radius: var(--radius-lg); overflow: hidden;
}
#rv-table thead th {
	padding: 11px 14px; background: var(--muted); border-bottom: 1px solid var(--section-border);
	text-align: left; font-weight: 500; color: var(--text-muted); font-size: 0.8125rem; white-space: nowrap;
}
#rv-table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--section-border); vertical-align: middle; }
#rv-table tbody tr:last-child td { border-bottom: none; }
#rv-table tbody tr:hover { background: color-mix(in srgb, var(--muted) 55%, transparent); }
#rv-table th:first-child, #rv-table td:first-child { padding-left: var(--app-pad); }
#rv-table th:last-child, #rv-table td:last-child { padding-right: var(--app-pad); }
.rv-nr-cell { font-weight: 500; color: var(--text-strong); white-space: nowrap; }
.rv-name { font-weight: 500; color: var(--text-strong); }
.rv-sub { margin-top: 2px; color: var(--text-muted); font-size: 0.8125rem; }
.rv-date-cell { color: var(--text-muted); white-space: nowrap; }
.rv-amount-th, .rv-amount-cell { text-align: right; }
.rv-amount-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rv-actions-td { text-align: right; white-space: nowrap; width: 1%; }
.rv-btn {
	height: auto; padding: 6px 13px; margin-left: 6px; font-size: 0.8125rem; font-weight: 500; cursor: pointer;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	background: var(--input-bg); color: var(--text); box-shadow: none;
}
.rv-btn:hover { border-color: var(--input-focus); }
.rv-btn[disabled] { opacity: .55; cursor: default; }
/* Mehrfachauswahl (Sammel-ZIP) + Archiv-Reiter */
.rv-subpanel { display: none; }
.rv-subpanel.active { display: block; }
.rv-check-th, .rv-check-td { width: 1%; white-space: nowrap; }
.rv-check-th input, .rv-check-td input { width: 15px; height: 15px; margin: 0; cursor: pointer; accent-color: var(--ring, #2563eb); }
#rv-arch-table {
	width: 100%; border-collapse: collapse; background: var(--card-bg);
	border: 1px solid var(--section-border); border-radius: var(--radius-lg); overflow: hidden;
}
#rv-arch-table thead th {
	padding: 11px 14px; background: var(--muted); border-bottom: 1px solid var(--section-border);
	text-align: left; font-weight: 500; color: var(--text-muted); font-size: 0.8125rem; white-space: nowrap;
}
#rv-arch-table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--section-border); vertical-align: middle; }
#rv-arch-table tbody tr:last-child td { border-bottom: none; }
/* Zeilenaktionen: unauffälliger Drei-Punkte-Knopf + freischwebendes Menü */
.rv-menu-btn {
	height: 28px; width: 28px; padding: 0; line-height: 1; font-size: 17px; cursor: pointer;
	border: 1px solid transparent; border-radius: var(--radius-md);
	background: transparent; color: var(--text-muted); box-shadow: none;
}
.rv-menu-btn:hover { color: var(--text-strong); border-color: var(--input-border); background: var(--input-bg); }
.rv-menu-btn[disabled] { opacity: .55; cursor: default; }
.rv-row-menu {
	position: fixed; z-index: 60; min-width: 190px; padding: 4px;
	background: var(--card-bg); border: 1px solid var(--card-border);
	border-radius: var(--radius-md); box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.18));
}
.rv-row-menu button {
	display: block; width: 100%; height: auto; padding: 8px 12px; text-align: left;
	background: transparent; border: none; box-shadow: none; cursor: pointer;
	font-size: 0.875rem; color: var(--text); border-radius: var(--radius-sm, 6px);
}
.rv-row-menu button:hover { background: var(--muted); color: var(--text-strong); }
.rv-warn { color: var(--warn, #b45309); cursor: help; }
.rv-zip-cell { white-space: nowrap; }
.rv-zip-tag {
	height: auto; padding: 3px 9px; font-size: 0.75rem; font-weight: 500; cursor: pointer;
	border: 1px solid var(--section-border); border-radius: 999px;
	background: var(--muted); color: var(--text-muted); box-shadow: none;
}
.rv-zip-tag:hover { color: var(--text-strong); border-color: var(--input-focus); }
.rv-arch-hl > td { background: color-mix(in srgb, var(--ring, #2563eb) 12%, transparent); }
#rv-arch-table th:first-child, #rv-arch-table td:first-child { padding-left: var(--app-pad); }
#rv-arch-table th:last-child, #rv-arch-table td:last-child { padding-right: var(--app-pad); }

/* ---------- "Heute"-Leiste auf der Übersicht (vier Kern-Kennzahlen als Kacheln) ---------- */
.dash-today {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
	max-width: none;
	margin-bottom: 22px;
}
.dash-tile {
	display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
	padding: 14px 16px; text-align: left; font: inherit;
	background: var(--card-bg); border: 1px solid var(--card-border);
	border-radius: var(--radius-md); box-shadow: none; color: var(--text-strong);
	height: auto; line-height: 1.3; white-space: normal;
}
button.dash-tile { cursor: pointer; transition: border-color .15s ease; }
button.dash-tile:hover { border-color: var(--gold-strong); }
button.dash-tile:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.dash-tile-value { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.dash-tile-label { font-size: 0.78rem; color: var(--text-faint); }
.dash-tile-warn .dash-tile-value { color: #b4423a; }

/* ---------- Globale Suche (mittig in der Kopfleiste; Ctrl/Cmd+K fokussiert) ---------- */
.gs-box {
	display: flex; align-items: center; gap: 7px;
	padding: 0 10px;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	background: var(--input-bg); color: var(--text-faint);
	width: min(400px, 100%);
}
.gs-box[hidden] { display: none; }
.gs-box:focus-within { border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring); }
.gs-box-icon { flex: 0 0 auto; }
.gs-box input[type="search"] {
	flex: 1 1 auto; min-width: 0; width: 100%;
	font: inherit; font-size: 0.9rem; color: var(--text);
	padding: 8px 0; background: none; border: 0; box-shadow: none; outline: none;
}
/* Tastenkürzel-Hinweis rechts im Feld; verschwindet, sobald man tippt (Fokus). */
.gs-kbd {
	flex: 0 0 auto; font-size: 0.68rem; color: var(--text-faint);
	border: 1px solid var(--card-border); border-radius: 4px; padding: 1px 5px;
	line-height: 1.4; white-space: nowrap;
}
.gs-box:focus-within .gs-kbd { display: none; }
@media (max-width: 700px) { .gs-kbd { display: none; } }
.gs-dropdown {
	position: fixed; z-index: 1000;
	/* left = Mitte des Suchfelds (in JS gesetzt) → hier auf die Mitte zentrieren. */
	transform: translateX(-50%);
	width: min(420px, 92vw);
	max-height: min(440px, 60vh); overflow: auto;
	padding: 6px;
	background: var(--card-bg); border: 1px solid var(--card-border);
	border-radius: var(--radius-md); box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
}
.gs-dropdown[hidden] { display: none; }
.gs-hint { padding: 6px 4px; }
.gs-group {
	font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
	color: var(--text-faint); padding: 10px 4px 4px;
}
.gs-item {
	display: flex; align-items: baseline; gap: 10px; width: 100%;
	padding: 9px 8px; text-align: left; font: inherit; color: var(--text-strong);
	background: none; border: 0; border-radius: var(--radius-md); box-shadow: none;
	height: auto; line-height: 1.35; white-space: normal; cursor: pointer;
}
.gs-item:hover, .gs-item:focus-visible { background: var(--input-bg); outline: none; }
/* Vorausgewählter Treffer (Enter öffnet ihn; ↑/↓ verschieben die Auswahl). */
.gs-item.gs-active { background: var(--accent); }
.gs-item-main { font-weight: 500; flex: 0 0 auto; }
.gs-item-sub { font-size: 0.82rem; color: var(--text-faint); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
.gs-item .copy-btn { margin-left: auto; }

/* ---------- Copy-to-clipboard-Knöpfe ---------- */
.copy-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 22px; height: 22px; padding: 0; margin-left: 4px; vertical-align: middle;
	background: none; border: 0; border-radius: 5px; box-shadow: none;
	color: var(--text-faint); cursor: pointer; line-height: 1;
}
.copy-btn:hover { color: var(--text-strong); background: var(--input-bg); }
.copy-btn.copied { color: #2e7d4f; }

/* Vorschau der Auszahlungsliste: Mitarbeiter-Zeilen (interne PDF-Liste, nicht im Excel). */
.hon-list-preview tr.hon-prev-intern td { color: var(--text-muted); font-style: italic; }

/* Honorare-Toolbar: die Ausgabe-Auswahl springt in der Liste zur gewählten Ausgabe. */
/* NUR den sichtbaren Auswahlknopf breiter machen. Das echte <select> wird von dropdown.js
   durch .cs-native ersetzt: absolut positioniert und 1px gross. Gibt man IHM eine Breite oder
   margin-left:auto, steht es unsichtbar weit rechts und schiebt die ganze Seite seitwärts
   (2026-08-13: genau das war der Grund, warum sich die Honorar-Seite verschieben liess). */
.cs--hon-ausgabe-jump, #mit-hon-ausgabe:not(.cs-native) { min-width: 240px; }
/* Die Ausgabe-Auswahl steht rechts in der Werkzeugleiste — die Suche bekommt den Rest. */
#hon-sub-list .mit-toolbar #mit-hon-search { flex: 1 1 auto; }
#hon-sub-list .mit-toolbar .cs--hon-ausgabe-jump { margin-left: auto; }

/* ---------- Honorare: E-Mail-Vorschau inline unter der Zeile (statt Modal) ---------- */
tr.hon-row.hon-open > td { background: color-mix(in srgb, var(--muted) 45%, transparent); }
.hon-detail-row > td { padding: 0; background: color-mix(in srgb, var(--muted) 22%, transparent); }
.hon-detail { padding: 14px 18px 18px; border-left: 3px solid var(--ring, var(--text-muted)); }
.hon-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.hon-detail-head strong { font-size: 1rem; }
.hon-detail-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.hon-detail .hon-mail-body { max-height: 60vh; overflow: auto; }

/* Rechnungsversand — E-Mail-Vorlage (Empfänger/Betreff/Text) und die aufgeklappte Nachricht
   im Verlauf. Die Vorlage bestimmt, an wen das Sammel-ZIP verschickt wird. */
.rv-mail-form { display: grid; gap: 14px; max-width: 720px; }
.rv-mail-form label { display: grid; gap: 5px; font-size: 0.875rem; font-weight: 500; color: var(--text-strong); }
/* Die Felder stehen nicht in einem <form>, greifen die Basis-Formularstile also nicht ab —
   ohne diese Regel blieben sie im Dark Mode weiss. Gleiche Tokens wie überall sonst. */
.rv-mail-form textarea,
.rv-mail-form input[type="text"],
.rv-subpanel input[type="email"] {
	width: 100%; font: inherit; font-size: 0.875rem;
	padding: 0.5rem 0.75rem;
	color: var(--text-strong);
	background: var(--input-bg);
	border: 1px solid var(--input-border);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-xs);
	transition: border-color .15s, box-shadow .15s, background-color .2s;
}
.rv-subpanel input[type="email"] { width: auto; height: 2.25rem; }
.rv-mail-form textarea::placeholder,
.rv-mail-form input[type="text"]::placeholder,
.rv-subpanel input[type="email"]::placeholder { color: var(--text-faint); }
.rv-mail-form textarea:focus,
.rv-mail-form input[type="text"]:focus,
.rv-subpanel input[type="email"]:focus {
	outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring);
}
.rv-mail-form textarea { resize: vertical; min-height: 60px; }
.rv-mail-cell { white-space: nowrap; }
.rv-mail-cell .rv-btn { margin-top: 4px; }
.rv-mail-detail {
	display: grid; gap: 5px; padding: 12px 14px; font-size: 0.8125rem;
	background: var(--muted); border-radius: var(--radius-md);
}
.rv-mail-body {
	margin: 4px 0 0; padding: 10px 12px; white-space: pre-wrap; font: inherit;
	background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-sm, 6px);
}

/* Anzeigekunden: Absprung-Links (Notion / Zoho) */
.nkun-links a { color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.nkun-links a:hover { color: var(--text-strong); text-decoration: underline; }

/* Institutionsabos: Balken «x von y Zugängen vergeben» + Kundensuche */
.inst-seats { min-width: 180px; }
.inst-bar { height: 6px; border-radius: 3px; background: var(--line, #e4e4ea); overflow: hidden; margin-bottom: 4px; }
.inst-bar span { display: block; height: 100%; background: var(--accent, #a99566); }
.inst-hits { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.inst-hit { text-align: left; border: 1px solid var(--line, #e4e4ea); border-radius: 6px; background: #fff;
	padding: 8px 10px; cursor: pointer; font: inherit; }
.inst-hit:hover { border-color: var(--text-strong, #5b5c78); }

/* Kampagnenlinks: Ausgabezeile mit Adresse + Aktionen */
.lk-out { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.lk-out input { flex: 1; min-width: 260px; border: 1px solid var(--line, #e4e4ea); border-radius: 6px;
	padding: 9px 10px; font-size: .95rem; background: #fff; }
.lk-url-cell code { font-size: .82rem; word-break: break-all; }
.lk-card { margin-top: 14px; }
.lk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lk-head h3 { margin: 0; }
.lk-body { display: flex; gap: 20px; margin-top: 12px; flex-wrap: wrap; }
.lk-qr { text-align: center; }
.lk-qr img { display: block; border: 1px solid var(--line, #e4e4ea); border-radius: 8px; background: #fff; padding: 6px; }
.lk-qr-actions { display: flex; gap: 10px; justify-content: center; margin-top: 6px; font-size: .85rem; }
.lk-info { flex: 1; min-width: 240px; }
.lk-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: .9rem; }
.lk-row code { word-break: break-all; }
.lk-row .lk-long { font-size: .78rem; opacity: .8; }
.lk-stats { display: flex; gap: 22px; margin: 12px 0 6px; flex-wrap: wrap; }
.lk-num { display: flex; flex-direction: column; }
.lk-num strong { font-size: 1.4rem; line-height: 1.1; }
.lk-num span { font-size: .8rem; opacity: .7; }
.lk-spark { display: flex; align-items: flex-end; gap: 2px; height: 36px; margin-top: 4px; }
.lk-spark span { width: 7px; background: var(--accent, #a99566); border-radius: 2px 2px 0 0; display: block; }

/* Zahlungsabgleich-Kopf: Import/Konvertieren sind Aktionen — gleiche Outline-Optik
   (Rand, Karten-Hintergrund, feiner Schatten) wie die Knöpfe in Honorare. */
.zahl-tools { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.zahl-tools select {
	height: 2.25rem; padding: 8px 12px; font-size: 14px;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	box-shadow: var(--shadow-xs);
	background: var(--input-bg); color: var(--text);
	font-family: inherit; max-width: 260px;
}
.zahl-tools select:focus {
	outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--input-focus-ring);
}
/* Kontowahl + Sub-Tabs in EINER Zeile unter dem Titel. */
.zahl-navrow {
	display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
	margin: -12px 0 24px;
}
.zahl-navrow .zahl-tools { margin-right: 4px; }
/* Ablagefläche der Sub-Tabs «Importieren» / «Konvertieren» (camt.053-Datei). */
.zahl-dropzone {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
	width: 100%; height: auto; min-height: 140px; padding: 28px 16px;
	border: 2px dashed var(--border, #e5e7eb); border-radius: var(--radius-md, 10px);
	background: var(--sub-bg, rgb(250 250 250)); box-shadow: none; cursor: pointer;
	transition: border-color .15s, background .15s;
}
.zahl-dropzone:hover, .zahl-dropzone.drag { border-color: var(--primary, #2563eb); background: var(--card-bg); }
.zahl-dropzone:focus-visible { box-shadow: 0 0 0 3px var(--ring-soft); }
.zahl-dropzone-title { font-size: 15px; font-weight: 600; color: var(--text-strong); }
.zahl-dropzone-hint { font-size: 13px; color: var(--text-muted); }
/* Kindelemente dürfen keine Drag-Ereignisse fangen, sonst flackert der .drag-Zustand. */
.zahl-dropzone > span { pointer-events: none; }

/* Sub-Tabs Abgleich/Verlauf: dieselbe Segment-Optik wie .hon-subtab in Honorare
   (vorher ungestylt → sie erbten die Outline-Knopf-Optik und doppelten den Rahmen). */
.zahl-subtab {
	height: auto;
	padding: 6px 14px; background: transparent; border: 1px solid transparent;
	box-shadow: none; cursor: pointer;
	border-radius: var(--radius-md);
	font-size: 14px; font-weight: 500; color: var(--text-muted);
	transition: background .15s, color .15s, box-shadow .15s;
}
.zahl-subtab.active { color: var(--text-strong); background: var(--card-bg); box-shadow: var(--shadow-xs); }
.zahl-subtab:hover:not(.active) { color: var(--text-strong); }
.zahl-subtab:focus-visible { box-shadow: 0 0 0 3px var(--ring-soft); }

/* Notion-Webhook-Token (Sync → Webhooks): URL + Verification token zum Kopieren. */
.nwh-box { border: 1px solid var(--border, #e5e7eb); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; background: var(--sub-bg, rgb(250 250 250)); color: var(--text); }
.nwh-title { margin: 0 0 4px; font-size: 15px; }
.nwh-list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.nwh-item { border-top: 1px solid var(--border, #e5e7eb); padding-top: 8px; }
.nwh-item:first-child { border-top: 0; padding-top: 0; }
.nwh-head { margin-bottom: 2px; }
.nwh-when { color: var(--text-muted, #6b7280); font-weight: 400; font-size: 12px; }
.nwh-url code, .nwh-token { font-size: 12px; word-break: break-all; }
.nwh-tok { margin-top: 4px; }

/* ---------- Manuelle Honorar-/Beleg-Einträge ----------
   Kompaktes Formular in der Honorar-Liste: Zweit-Autor:innen, Bildautor:innen und reine
   Belegexemplare, die Notion nicht kennt. */
/* Der Dialog ist schmaler als die grossen Formulare — es sind nur fünf Felder. */
.man-card { width: min(560px, 94vw); }
.man-card .mit-dialog-actions { align-items: center; }
.man-card .mit-dialog-actions #man-msg { margin-right: auto; }
/* Zurückhaltender Abbrechen-Knopf neben dem farbigen «Speichern». */
.man-still {
	background: none; border: 1px solid var(--border); border-radius: var(--radius-md);
	color: var(--text-muted); padding: 6px 12px; font: inherit; cursor: pointer;
}
.man-still:hover { background: color-mix(in srgb, var(--muted) 50%, transparent); color: var(--text); }
.hon-manuell-form { display: flex; flex-wrap: wrap; gap: .6rem .75rem; align-items: flex-end; }
.hon-manuell-form label {
	display: flex; flex-direction: column; gap: .2rem;
	font-size: .75rem; color: var(--text-muted); position: relative;
}
/* Ohne diese Zeile schlägt display:flex das hidden-Attribut — das ausgeblendete
   Ausgabe-Feld blieb dann trotzdem sichtbar. */
.hon-manuell-form label[hidden] { display: none; }
/* Alle Felder wie die übrigen Eingaben der Oberfläche — dunkel, eckig, gleiche Höhe. */
.man-card .man-input {
	height: 1.9rem; padding: 3px 7px; font-size: 12.5px; font-family: inherit;
	border: 1px solid var(--input-border); border-radius: var(--radius-md);
	background: var(--input-bg); color: var(--text); appearance: none; -webkit-appearance: none;
}
.man-card .man-input.gewaehlt { font-weight: 600; }
.man-f-kunde .man-input { width: 240px; }
.man-f-ausgabe .man-input { width: 250px; }
.man-f-grund .man-input { width: 100%; box-sizing: border-box; }
.man-f-grund { flex: 1 1 100%; }
.man-f-num .man-input { width: 92px; text-align: right; }
.hon-manuell-treffer {
	position: absolute; top: 100%; left: 0; min-width: 100%; z-index: 5;
	background: var(--input-bg); border: 1px solid var(--border); border-radius: 6px;
	max-height: 200px; overflow: auto; padding: .2rem; white-space: nowrap;
}
.hon-manuell-treffer[hidden] { display: none; }
.hon-manuell-treffer-item {
	display: block; width: 100%; text-align: left; padding: .3rem .45rem;
	background: none; border: none; cursor: pointer; color: inherit; font-size: .78rem;
}
.hon-manuell-treffer-item:hover { background: var(--muted); }
.man-card #man-msg.error { color: var(--danger, #c0392b); }
.hon-manuell-check { display: flex; align-items: center; gap: .4rem; font-size: .82rem; margin-top: .8rem; }
.hon-manuell-liste { margin-top: 1.2rem; border-top: 1px solid var(--border); padding-top: .6rem; }
.hon-manuell-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.hon-manuell-table th, .hon-manuell-table td { padding: .3rem .45rem; border-bottom: 1px solid var(--border); text-align: left; }
.hon-manuell-table .r { text-align: right; }
.hon-manuell-toggle { white-space: nowrap; }
/* Von Hand erfasste Zeile in der Honorar-Liste — als solche erkennbar. */
.hon-badge-manuell {
	font-size: .7rem; padding: .05rem .35rem; border-radius: 4px;
	border: 1px solid var(--border); color: var(--text-muted); margin-left: .35rem;
}

/* Digitales Belegexemplar: einfache Checkbox in der Honorar-Liste (aus = keine PDF-Mail). */
.hon-digital { cursor: pointer; }
.hon-digital[disabled] { opacity: .5; cursor: progress; }

/* Stand der ganzen Ausgabe im Kopf (ersetzt die früheren Spalten «E-Mail» und «Honorar»). */
.hon-grp-head .badge { margin-left: .4rem; font-size: .72rem; }
/* Schon versendete Zeilen treten optisch zurück. */
tr.hon-row-gesendet td { opacity: .72; }

/* Zeilen-Aktionen der Honorar-Liste: bearbeiten (✎) und ignorieren (✕ / ↺). */
/* Ignorierte Zeile: sichtbar zurückgenommen, wenn sie eingeblendet wird. */
tr.hon-row-ignoriert td { opacity: .5; text-decoration: line-through; }
tr.hon-row-ignoriert .hon-digital { text-decoration: none; }
.hon-ignoriert-link { margin: .5rem 0 0; font-size: .8rem; }

/* «Währung festlegen» im Kopf einer Ausgabe — holt fehlende Kundenwährungen bei Zoho. */
.hon-waehrung-holen[disabled] { opacity: .6; cursor: progress; }

/* Spaltenbreiten der Honorar-Liste: jede Spalte bekommt eine feste, knappe Breite —
   der Beitrag bekommt allen übrigen Platz. Feste Tabellenbreite, damit lange Namen
   oder Kopfzeilen die Spalten nicht aufblähen. */
.hon-grp-table { width: 100%; table-layout: fixed; }
.hon-grp-table th, .hon-grp-table td { overflow: hidden; text-overflow: ellipsis; }
/* Nur der Beitrag darf umbrechen. */
.hon-grp-table th:not(:nth-child(2)) { white-space: normal; overflow-wrap: anywhere; }
.hon-grp-table td:not(:nth-child(2)) { white-space: nowrap; }
.hon-grp-table th:nth-child(2), .hon-grp-table td:nth-child(2) { white-space: normal; width: auto; }
.hon-grp-table .hon-sp-autor { width: 11rem; }
.hon-grp-table .hon-sp-datum { width: 7.5rem; }
.hon-grp-table .hon-betrag, .hon-grp-table th:nth-child(4) { width: 7rem; }
.hon-grp-table .hon-sp-pdf { width: 3rem; text-align: center; padding-left: .3rem; padding-right: .3rem; }
.hon-grp-table .hon-aktionen, .hon-grp-table th:nth-child(6) { width: 2.4rem; padding-left: 0; }
/* Der ⋯-Knopf der Zeile: kein Rahmen, kein Hintergrund — nur die Punkte, auf der Höhe
   der PDF-Checkbox. */
.hon-aktionen { white-space: nowrap; text-align: right; vertical-align: middle; }
.hon-aktionen .hon-menu-btn {
	background: none; border: 0; box-shadow: none; color: var(--text-muted, #9aa);
	padding: 0 2px; font-size: 1.05rem; line-height: 1; cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
}
.hon-aktionen .hon-menu-btn:hover { color: var(--text-strong); background: none; }
.hon-grp-table td { vertical-align: middle; }

/* «Währung korrigieren» — die einzige orange hervorgehobene Aktion im Ausgabe-Kopf. */
.hon-btn-gold {
	color: var(--gold-strong) !important;
	border-color: var(--gold-tint-border) !important;
	background: var(--gold-tint) !important;
}
.hon-btn-gold:hover { color: var(--gold) !important; }

/* Zahlungsprotokoll: je Dokument «Herunterladen» und «Per E-Mail senden» — von hier (und nur
   von hier) geht die Abrechnung an die Administration hinaus. */
.hon-doc-actions { white-space: nowrap; }
.hon-doc-actions button { margin-right: .6rem; }
.hon-doc-actions .muted { white-space: normal; margin-top: 2px; }

/* Vorschau des Imports: Fortschritt, während die Zeilen portionsweise mit Zoho abgeglichen
   werden (grosse Dateien brauchen mehrere Anfragen — die Tabelle wächst dabei mit). */
.imp-prog { display: inline-flex; align-items: center; gap: .5rem; }
.imp-spin { width: .8em; height: .8em; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; opacity: .7; animation: imp-spin 0.8s linear infinite; }
@keyframes imp-spin { to { transform: rotate(360deg); } }
.imp-prog-bar { display: inline-block; width: 120px; height: 6px; border-radius: 999px; background: rgba(128,128,128,.25); overflow: hidden; }
.imp-prog-bar > span { display: block; height: 100%; background: currentColor; opacity: .6; transition: width .2s ease; }
