/*
 * Mandatspipeline – Oberfläche. Aufbau nach dem mv it SystemBoard (style.css + mvit-ci.css):
 * dunkle Topbar mit Marke/Navigation/Benutzermenü, Inhalt bis 1400 px, KPI-Kacheln, Panels, Datentabellen, Badges.
 * Farben: CI der G&B Steuerberatung digital (gbs-digital.de, 16.10.2026):
 *   Bordeaux #8B2939 (Akzent)   Dunkel #0F0D14 (Topbar, Text)   Grau #747474   Hell #F6F6F6
 * Schriften Ubuntu (Überschriften) und Inter (Text) nur, wenn lokal installiert. Keine externen Ressourcen (DSGVO).
 */
:root {
	--ci-bordeaux: #8B2939;
	--ci-bordeaux-dark: #6f2030;
	--ci-bordeaux-bg: #f6e9ec;
	--ci-dark: #0F0D14;
	--ci-grau: #747474;
	--ci-light: #F6F6F6;

	--color-bg: var(--ci-light);
	--color-surface: #ffffff;
	--color-surface-2: #fafafa;
	--color-border: #dcdcdf;
	--color-text: var(--ci-dark);
	--color-muted: var(--ci-grau);
	--color-primary: var(--ci-bordeaux);
	--color-primary-dark: var(--ci-bordeaux-dark);
	--color-green: #1b7a43; --color-green-bg: #e5f4ea;
	--color-yellow: #8a6300; --color-yellow-bg: #fdf3d9;
	--color-red: #a5231f; --color-red-bg: #fbe6e5;
	--color-blue: #14508a; --color-blue-bg: #e4edf6;
	--color-grey-bg: #ececee;
	--radius: 8px;
	--shadow: 0 1px 2px rgba(15, 13, 20, 0.06), 0 2px 8px rgba(15, 13, 20, 0.05);
	--font-head: "Ubuntu", "Segoe UI Variable Display", "Segoe UI", Roboto, Arial, sans-serif;
	--font-body: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 1rem; }
body {
	margin: 0;
	font-family: var(--font-body);
	background: var(--color-bg);
	color: var(--color-text);
	font-size: 15px;
	line-height: 1.5;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}
[hidden] { display: none !important; }
h1, h2, h3, .brand, .kpi-value, .data-table th { font-family: var(--font-head); }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 1rem; }
h1::after { content: ""; display: block; width: 2.5rem; height: 3px; margin-top: 0.35rem; background: var(--ci-bordeaux); border-radius: 2px; }
.page-header h1 { margin-bottom: 0; }
h2 { font-size: 1.1rem; font-weight: 600; color: var(--ci-bordeaux-dark); margin: 0 0 0.75rem; }
h3 { font-size: 0.95rem; font-weight: 600; margin: 1rem 0 0.5rem; }
a { color: var(--ci-bordeaux); text-decoration: none; }
a:hover { color: var(--ci-bordeaux-dark); text-decoration: underline; }
code { font-family: var(--font-mono); font-size: 0.9em; background: var(--color-grey-bg); padding: 0 0.3rem; border-radius: 4px; }
.muted { color: var(--color-muted); }
.klein { font-size: 0.8rem; color: var(--color-muted); }
.nowrap { white-space: nowrap; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.r { text-align: right; }
:focus-visible { outline: 2px solid var(--ci-bordeaux); outline-offset: 2px; }

/* ---- Kopfleiste */
.topbar { background: var(--ci-dark); color: #fff; border-bottom: 3px solid var(--ci-bordeaux); }
.topbar-inner { max-width: 1400px; margin: 0 auto; padding: 0.65rem 1.5rem; display: flex; align-items: center; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: #fff; font-weight: 700; font-size: 1.05rem; }
.brand:hover { text-decoration: none; color: #fff; }
.brand-mark { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; color: #fff; background: var(--ci-bordeaux); padding: 0.05rem 0.5rem; border-radius: 4px; }
.brand-app { font-weight: 500; font-size: 0.95rem; color: rgba(255, 255, 255, 0.85); }
.nav { display: flex; gap: 1.25rem; flex: 1; }
.nav a { color: rgba(255, 255, 255, 0.8); border-bottom: 2px solid transparent; padding: 0.35rem 0; cursor: pointer; }
.nav a:hover { color: #fff; text-decoration: none; }
.nav a.current { color: #fff; border-bottom-color: var(--ci-bordeaux); }
.nav a .n { font-family: var(--font-mono); font-size: 0.72rem; background: rgba(255, 255, 255, 0.14); padding: 0 0.45rem; border-radius: 99px; margin-left: 0.35rem; }
.user-menu { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; color: rgba(255, 255, 255, 0.75); }
.user-menu a { color: rgba(255, 255, 255, 0.75); cursor: pointer; }
.user-menu a:hover { color: #fff; text-decoration: none; }
.nav-toggle { display: none; background: none; border: 1px solid rgba(255, 255, 255, 0.4); color: #fff; border-radius: 6px; padding: 0.3rem 0.6rem; cursor: pointer; }

/* ---- Inhalt */
.content { max-width: 1400px; width: 100%; margin: 0 auto; padding: 1.5rem; flex: 1; }
.footer { color: var(--color-muted); font-size: 0.8rem; text-align: center; padding: 1.5rem 1rem 2rem; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-header .sub { color: var(--color-muted); font-size: 0.9rem; margin-top: 0.5rem; }
.header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.panel-kopf { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.panel-kopf h2 { margin: 0; }
.spalten-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.spalten-2 .panel { margin-bottom: 0; }

/* ---- KPI-Kacheln */
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.9rem; margin-bottom: 1.5rem; }
.kpi-card { background: var(--color-surface); border: 1px solid var(--color-border); border-top: 3px solid var(--ci-bordeaux); border-radius: var(--radius); padding: 0.9rem 1rem; text-align: center; box-shadow: var(--shadow); min-width: 0; }
.kpi-card.money { background: var(--color-surface-2); border-top-color: var(--ci-dark); }
.kpi-value { font-size: 1.6rem; font-weight: 700; color: var(--ci-bordeaux-dark); font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.kpi-card.money .kpi-value { color: var(--ci-dark); }
.kpi-label { font-size: 0.72rem; color: var(--color-muted); margin-top: 0.3rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.kpi-sub { font-size: 0.78rem; color: var(--color-muted); margin-top: 0.2rem; }
.kpi-warn { border-top-color: #e0a100; }
.kpi-warn .kpi-value { color: var(--color-yellow); }
.kpi-alert { border-top-color: var(--color-red); }
.kpi-alert .kpi-value { color: var(--color-red); }

/* ---- Tabellen */
.tablewrap { overflow-x: auto; border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; background: var(--color-surface); }
.data-table th, .data-table td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; vertical-align: top; }
.data-table th { color: var(--ci-bordeaux-dark); background: var(--color-surface-2); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.data-table tbody tr:hover { background: #faf7f8; }
.data-table tbody tr.klickbar { cursor: pointer; }
.data-table tfoot td { font-weight: 600; background: var(--color-surface-2); border-bottom: 0; }
.data-table input, .data-table select { padding: 0.3rem 0.45rem; font-size: 0.88rem; width: 100%; min-width: 5rem; }
.data-table .aktionen { white-space: nowrap; text-align: right; }

/* ---- Badges, Chips, Hinweise */
.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.76rem; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--color-green-bg); color: var(--color-green); }
.badge-yellow { background: var(--color-yellow-bg); color: var(--color-yellow); }
.badge-red { background: var(--color-red-bg); color: var(--color-red); }
.badge-blue { background: var(--color-blue-bg); color: var(--color-blue); }
.badge-grey { background: var(--color-grey-bg); color: var(--color-muted); }
.badge-ci { background: var(--ci-bordeaux-bg); color: var(--ci-bordeaux-dark); }
.alert { padding: 0.7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-green { background: var(--color-green-bg); color: var(--color-green); }
.alert-yellow { background: var(--color-yellow-bg); color: var(--color-yellow); }
.alert-red { background: var(--color-red-bg); color: var(--color-red); }
.alert-blue { background: var(--color-blue-bg); color: var(--color-blue); }
.leer { color: var(--color-muted); background: var(--color-surface-2); border: 1px dashed var(--color-border); border-radius: var(--radius); padding: 0.9rem 1rem; text-align: center; font-size: 0.88rem; }

/* ---- Formulare, Knöpfe */
label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; color: var(--color-muted); font-weight: 500; min-width: 0; }
label.c { flex-direction: row; align-items: center; gap: 0.5rem; font-size: 0.88rem; color: var(--color-text); }
label.c input { width: 16px; height: 16px; accent-color: var(--ci-bordeaux); margin: 0; }
input, select, textarea { padding: 0.45rem 0.6rem; border: 1px solid var(--color-border); border-radius: 6px; font-size: 0.93rem; font-family: inherit; color: var(--color-text); background: #fff; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ci-bordeaux); box-shadow: 0 0 0 3px rgba(139, 41, 57, 0.15); }
input:disabled, select:disabled, textarea:disabled { background: var(--color-surface-2); color: var(--color-muted); }
textarea { resize: vertical; min-height: 70px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1rem; }
.form-grid .w { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; align-items: center; }
fieldset { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.75rem 1rem 1rem; margin: 0 0 1rem; background: var(--color-surface); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1rem; }
legend { font-family: var(--font-head); font-weight: 700; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0 0.4rem; color: var(--ci-bordeaux); }
fieldset .w, fieldset label.c, fieldset .hint { grid-column: 1 / -1; }
.hint { font-size: 0.78rem; color: var(--color-muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.45rem 0.9rem; border-radius: var(--radius); border: 1px solid var(--color-border); background: #fff; color: var(--color-text); cursor: pointer; font-size: 0.9rem; font-family: inherit; font-weight: 500; text-decoration: none; line-height: 1.3; }
.btn:hover { background: #f1f1f3; border-color: #c9c9ce; text-decoration: none; color: var(--color-text); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--ci-bordeaux); border-color: var(--ci-bordeaux); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--ci-bordeaux-dark); border-color: var(--ci-bordeaux-dark); color: #fff; }
.btn-danger { color: var(--color-red); border-color: var(--color-red); }
.btn-danger:hover { background: var(--color-red-bg); }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.8rem; }
.btn-ms { background: #fff; border-color: #8c8c8c; color: #5e5e5e; font-weight: 600; }
.btn-ms svg { width: 18px; height: 18px; }
.tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.tabs .btn.current { background: var(--ci-dark); border-color: var(--ci-dark); color: #fff; }
.filter-bar { display: flex; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
.filter-bar input, .filter-bar select { width: auto; }

/* ---- Kanban-Board */
.boardscroll { overflow-x: auto; padding-bottom: 0.5rem; margin: 0 -0.25rem; }
.board { display: grid; grid-template-columns: repeat(6, minmax(230px, 1fr)); gap: 0.9rem; min-width: min-content; padding: 0 0.25rem; }
.col { background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 260px; }
.col.over { border-color: var(--ci-bordeaux); background: var(--ci-bordeaux-bg); }
.col.nq { opacity: 0.92; }
.colhead { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; padding: 0.7rem 0.8rem 0.5rem; border-bottom: 2px solid var(--ci-bordeaux); }
.col.nq .colhead { border-bottom-color: var(--color-border); }
.colhead h2 { font-size: 0.86rem; margin: 0; color: var(--ci-dark); }
.colhead .n { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ci-bordeaux-dark); background: var(--ci-bordeaux-bg); padding: 0 0.45rem; border-radius: 99px; }
.colsum { font-size: 0.72rem; color: var(--color-muted); font-family: var(--font-mono); padding: 0.3rem 0.8rem 0; }
.cards { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.6rem; flex: 1; }
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-left: 3px solid var(--ci-bordeaux); border-radius: 6px; padding: 0.55rem 0.7rem; cursor: grab; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.35rem; text-align: left; width: 100%; font: inherit; color: inherit; }
.card:hover { border-color: var(--ci-bordeaux); border-left-color: var(--ci-bordeaux); }
.card.dragging { opacity: 0.4; }
.card.nq { border-left-color: var(--color-muted); }
.card .t { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; font-family: var(--font-head); }
.card .meta { font-size: 0.78rem; color: var(--color-muted); overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.chip { font-size: 0.7rem; padding: 0.05rem 0.45rem; border-radius: 99px; background: var(--color-grey-bg); color: var(--color-muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 0.25rem; }
.chip.ok { background: var(--color-green-bg); color: var(--color-green); }
.chip.warn { background: var(--color-yellow-bg); color: var(--color-yellow); }
.chip.bad { background: var(--color-red-bg); color: var(--color-red); }
.chip.ci { background: var(--ci-bordeaux-bg); color: var(--ci-bordeaux-dark); }
.chip svg { width: 11px; height: 11px; fill: currentColor; }
.prog { height: 4px; background: var(--color-border); border-radius: 2px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--color-green); }
body.readonly .card { cursor: pointer; }
.tab-drop.over { outline: 2px dashed var(--ci-bordeaux); outline-offset: 2px; background: var(--ci-bordeaux-bg); color: var(--ci-bordeaux-dark); }

/* ---- Detail-Schublade */
.scrim { position: fixed; inset: 0; background: rgba(15, 13, 20, 0.4); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100%); background: var(--color-bg); z-index: 21; display: flex; flex-direction: column; border-left: 1px solid var(--color-border); box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18); }
.dhead { display: flex; gap: 0.75rem; align-items: center; justify-content: space-between; padding: 0.9rem 1.1rem; border-bottom: 3px solid var(--ci-bordeaux); background: var(--ci-dark); color: #fff; }
.dhead h3 { margin: 0; font-size: 1.05rem; min-width: 0; overflow-wrap: anywhere; font-family: var(--font-head); }
.dhead .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.dhead .btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.dbody { overflow-y: auto; padding: 1rem 1.1rem 3rem; display: flex; flex-direction: column; gap: 0.25rem; }
.contacts { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.4rem; }
.crow { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.82rem; padding: 0.4rem 0.6rem; background: var(--color-surface-2); border-radius: 6px; border: 1px solid var(--color-border); }
.crow .d { font-family: var(--font-mono); white-space: nowrap; color: var(--color-muted); }
.crow .x { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.addc { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.5rem; align-items: end; background: var(--color-surface-2); padding: 0.6rem; border-radius: 6px; }
.addc .note { grid-column: 1 / -1; }
.audit { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.78rem; color: var(--color-muted); }
.audit div { display: flex; gap: 0.6rem; }
.audit .d { font-family: var(--font-mono); white-space: nowrap; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 1.25rem; background: var(--ci-dark); color: #fff; padding: 0.55rem 1rem; border-radius: 6px; z-index: 40; font-size: 0.88rem; max-width: calc(100% - 2rem); box-shadow: var(--shadow); }

/* ---- Benutzer, Kampagnen, System */
.urow { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 0.5rem; align-items: end; padding: 0.6rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 6px; margin-bottom: 0.5rem; }
.urow.off { opacity: 0.6; }
.urow .tools { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.info-grid { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; font-size: 0.9rem; }
.info-grid dt { color: var(--color-muted); }
.info-grid dd { margin: 0; overflow-wrap: anywhere; }
.status-dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--color-muted); margin-right: 0.35rem; vertical-align: middle; }
.status-dot.ok { background: var(--color-green); }
.status-dot.warn { background: #e0a100; }
.status-dot.bad { background: var(--color-red); }

/* ---- Anmeldung */
.login-page .content { display: grid; place-items: center; }
.login-box { width: min(420px, 100%); background: var(--color-surface); border: 1px solid var(--color-border); border-top: 4px solid var(--ci-bordeaux); border-radius: 10px; padding: 1.75rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.85rem; }
.login-box h1 { font-size: 1.35rem; margin: 0; }
.login-box h1::after { display: none; }
.login-box form { display: flex; flex-direction: column; gap: 0.85rem; }
.login-box .btn { width: 100%; }
.login-box .btn-ms { padding: 0.6rem 0.9rem; }
.login-trenner { display: flex; align-items: center; gap: 0.75rem; color: var(--color-muted); font-size: 0.8rem; }
.login-trenner::before, .login-trenner::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.qr { display: flex; justify-content: center; padding: 0.5rem; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); }
.qr svg { width: min(240px, 100%); height: auto; }
code.secret { display: block; text-align: center; font-size: 1rem; letter-spacing: 0.08em; padding: 0.5rem; overflow-wrap: anywhere; }
ul.recovery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
ul.recovery li code { display: block; text-align: center; padding: 0.4rem; font-size: 0.95rem; letter-spacing: 0.05em; }

/* ---- Rechtstexte */
.legal .panel p, .legal .panel li { font-size: 0.92rem; line-height: 1.6; }
.legal address { font-style: normal; line-height: 1.6; }
.legal h2 { margin-top: 0; }
.legal .panel { max-width: 900px; }

/* ---- Druck */
@media print {
	.topbar, .footer, .header-actions, .filter-bar, .drawer, .scrim, .toast { display: none !important; }
	.content { padding: 0; max-width: none; }
	.board { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Responsiv */
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
	.topbar-inner { padding: 0.6rem 1rem; flex-wrap: wrap; gap: 0.75rem; }
	.nav { display: none; flex-basis: 100%; flex-direction: column; gap: 0.2rem; }
	.nav.offen { display: flex; }
	.nav-toggle { display: inline-block; margin-left: auto; }
	.content { padding: 1rem; }
	.spalten-2, .form-grid, fieldset { grid-template-columns: 1fr; }
	.urow { grid-template-columns: 1fr 1fr; }
	.kpi-grid { grid-template-columns: repeat(2, 1fr); }
	.kpi-value { font-size: 1.35rem; }
}
@media (max-width: 560px) {
	.addc { grid-template-columns: 1fr 1fr; }
	ul.recovery { grid-template-columns: 1fr; }
	.page-header { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* ---- Hilfsklassen (CSP erlaubt keine Inline-Styles) ---- */
.leer.gross { padding: 1.75rem; }
.addc label.c.auto { grid-column: auto; }
.rot { color: var(--color-red); }
.mt { margin-top: 0.75rem; }
fieldset.mt { margin-top: 1rem; }
.urow .w { grid-column: 1 / -1; }
