/* Fluent 2 im Outlook-Maß: Segoe UI, 4-px-Raster, Outlook-Blau. Keine L.A.T.E.-Farbwelt. */
:root {
	--bg: #ffffff;
	--fg: #242424;
	--fg2: #616161;
	--fg3: #707070;
	--line: #e0e0e0;
	--hover: #f5f5f5;
	--press: #ebebeb;
	--brand: #0f6cbd;
	--brand-hover: #115ea3;
	--brand-press: #0f548c;
	--on-brand: #ffffff;
	--brand-tint: #ebf3fc;
	--danger: #b10e1c;
	--danger-hover: #8f0b16;
	--danger-press: #6e0811;
	--on-danger: #ffffff;
	--danger-bg: #fdf3f4;
	--warn: #bc4b09;
	--warn-press: #a8420a;
	--warn-bg: #fff9f5;
	--focus: #0f6cbd;
	--font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #292929; --fg: #ffffff; --fg2: #d6d6d6; --fg3: #adadad; --line: #424242;
		--hover: #333333; --press: #3d3d3d; --brand: #479ef5; --brand-hover: #62abf5; --brand-press: #2886de;
		--on-brand: #0a0a0a; --brand-tint: #082338; --danger: #dc626d; --danger-hover: #e87f88; --danger-bg: #3b1a1d;
		--danger-press: #d4565f; --on-danger: #0a0a0a; --warn-press: #f4a068;
		--warn: #f4a068; --warn-bg: #3a2616; --focus: #62abf5; color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--bg: #292929; --fg: #ffffff; --fg2: #d6d6d6; --fg3: #adadad; --line: #424242;
	--hover: #333333; --press: #3d3d3d; --brand: #479ef5; --brand-hover: #62abf5; --brand-press: #2886de;
	--on-brand: #0a0a0a; --brand-tint: #082338; --danger: #dc626d; --danger-hover: #e87f88; --danger-bg: #3b1a1d;
	--danger-press: #d4565f; --on-danger: #0a0a0a; --warn-press: #f4a068;
	--warn: #f4a068; --warn-bg: #3a2616; --focus: #62abf5; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font: 400 14px/20px var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2 { margin: 0; }
.muted { color: var(--fg2); }
.grow { flex: 1; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

.app { display: flex; flex-direction: column; min-height: 100vh; max-width: 100%; }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 4px 8px 4px 16px; }
.bar-title { font-size: 16px; line-height: 22px; font-weight: 600; }
.bar-actions { display: flex; gap: 4px; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
.icon-btn:hover { background: var(--hover); }
.icon-btn:active { background: var(--press); }

/* Reiter (Pivot) */
.tabs { padding: 0 8px; border-bottom: 1px solid var(--line); }
.tablist { display: flex; gap: 4px; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px; border: 0; background: transparent; color: var(--fg2); cursor: pointer; position: relative; border-radius: 4px; }
.tab:hover { background: var(--hover); color: var(--fg); }
.tab.selected { color: var(--fg); font-weight: 600; }
.tab.selected::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; border-radius: 1px; background: var(--brand); }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--hover); font-size: 12px; line-height: 20px; font-weight: 600; text-align: center; }
.tab.selected .count { background: var(--brand); color: var(--on-brand); }

.content { flex: 1; padding-bottom: 16px; }

/* Liste */
.group-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px 4px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--fg2); }
.group-count { font-weight: 400; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.row:hover { background: var(--hover); }
.row:active { background: var(--press); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--fg2); font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-age { flex: none; color: var(--fg3); font-size: 12px; line-height: 16px; white-space: nowrap; }
.row-age.stale { color: var(--warn); font-weight: 600; }
.row:active .row-age { color: var(--fg2); }
.row:active .row-age.stale { color: var(--warn-press); }

.avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-size: 12px; font-weight: 600; }
.avatar.large { width: 40px; height: 40px; font-size: 14px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 16px; color: var(--fg2); }
.empty svg { width: 32px; height: 32px; color: var(--fg3); }
.center { display: flex; justify-content: center; padding: 48px 16px; }
.spinner { width: 24px; height: 24px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* Meldungsleiste */
.msgbar { display: flex; align-items: center; gap: 8px; margin: 8px 16px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--hover); }
.msgbar svg { flex: none; }
.msgbar.warn { background: var(--warn-bg); border-color: var(--warn); }
.msgbar.warn svg { color: var(--warn); }
.msgbar.error { background: var(--danger-bg); border-color: var(--danger); color: var(--fg); }
.msgbar[hidden] { display: none; }

/* Schaltflächen */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--hover); }
.btn:active { background: var(--press); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.primary:active { background: var(--brand-press); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.btn.danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn.danger:active { background: var(--danger-press); border-color: var(--danger-press); }
.btn.subtle { border-color: transparent; background: transparent; padding-left: 4px; }
.btn.subtle:hover { background: var(--hover); }
.btn.small { padding: 0 8px; }
.btn:disabled { opacity: .5; cursor: default; pointer-events: none; }

/* Detail */
.detail-top { padding: 4px 12px 0; }
.detail-head { display: flex; align-items: center; gap: 12px; padding: 8px 16px; }
.title { font-size: 16px; line-height: 22px; font-weight: 600; }
.facts { margin: 0; padding: 0 16px; }
.fact { display: grid; grid-template-columns: 96px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.fact dt { color: var(--fg2); }
.fact:last-child { border-bottom: 0; }
.fact dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.actions { position: sticky; bottom: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; background: var(--bg); border-top: 1px solid var(--line); margin-top: 16px; }
.actions:empty { display: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Formulare */
.form { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-weight: 600; }
.input { width: 100%; min-height: 32px; padding: 5px 10px; border: 1px solid var(--line); border-bottom-color: var(--fg3); border-radius: 4px; background: var(--bg); }
.input:focus-visible { outline: 0; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.area { resize: vertical; min-height: 64px; }
.form .msgbar { margin: 0; }
