/* ecoEn Team-App – mobil zuerst, hell/dunkel, Druck.
   Farben aus ecoen.ch (Avada): Orange #d15e0d, Logo-Amber #f6a21e, Waldgrün #17382f,
   Creme #f1efe6, Grün #168947. */
:root {
	--brand: #d15e0d;          /* Akzente, Icons, Fortschritt */
	--brand-strong: #b64f0a;   /* gefüllte Buttons, Links (Kontrast ≥ 4.5:1 auf Hell) */
	--brand-ink: #ffffff;
	--brand-soft: #fbeadd;
	--amber: #f6a21e;          /* Logo-Farbe */
	--forest: #17382f;         /* Navigation, Kopfzeile */
	--forest-2: #1f4a3e;
	--forest-ink: #e9f1ec;
	--lime: #def93d;           /* aktiver Menüpunkt auf Grün */
	--link: var(--brand-strong);
	--bg: #f4f2eb;
	--card: #ffffff;
	--ink: #1f211c;
	--muted: #66706b;
	--line: #e3e0d6;
	--ok: #168947;
	--ok-soft: #e2f3e8;
	--warn: #9a5b00;
	--warn-soft: #fff2d6;
	--danger: #c0392b;
	--danger-soft: #fbe5e2;
	--info: #1f6aa5;
	--info-soft: #e3eef8;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(23, 56, 47, 0.06), 0 2px 8px rgba(23, 56, 47, 0.06);
	--tabbar-h: 64px;
	--topbar-h: 52px;
	color-scheme: light;
}
:root[data-theme="dark"] {
		--brand: #ec7a2a;
		--brand-soft: #3a2414;
		--link: #f59a52;
		--forest: #0f241e;
		--forest-2: #17382f;
		--bg: #0f1714;
		--card: #172320;
		--ink: #e8eee9;
		--muted: #9db0a7;
		--line: #2a3c35;
		--ok: #3cc47a;
		--ok-soft: #133524;
		--warn: #f6b54a;
		--warn-soft: #3a2c10;
		--danger: #f07468;
		--danger-soft: #3f1a16;
		--info: #6fb0e6;
		--info-soft: #142a3d;
		--shadow: none;
		color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--brand: #ec7a2a;
		--brand-soft: #3a2414;
		--link: #f59a52;
		--forest: #0f241e;
		--forest-2: #17382f;
		--bg: #0f1714;
		--card: #172320;
		--ink: #e8eee9;
		--muted: #9db0a7;
		--line: #2a3c35;
		--ok: #3cc47a;
		--ok-soft: #133524;
		--warn: #f6b54a;
		--warn-soft: #3a2c10;
		--danger: #f07468;
		--danger-soft: #3f1a16;
		--info: #6fb0e6;
		--info-soft: #142a3d;
		--shadow: none;
		color-scheme: dark;
	}
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.35rem; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; }
h3 { font-size: 0.98rem; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--card);
	min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--brand); flex: none; }
textarea { resize: vertical; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Layout */
.layout { min-height: 100vh; }
.main { padding: 12px 16px calc(var(--tabbar-h) + 24px); max-width: 980px; margin: 0 auto; min-width: 0; }
.sidebar { display: none; }

/* Kopfzeile (mobil): Waldgrün mit Logo */
.topbar {
	position: sticky; top: 0; z-index: 25; height: calc(var(--topbar-h) + env(safe-area-inset-top));
	padding: env(safe-area-inset-top) 16px 0; display: flex; align-items: center; justify-content: space-between;
	background: var(--forest); color: var(--forest-ink);
}
.topbar .logo { height: 22px; width: auto; display: block; }
.topbar-user { font-size: 0.8rem; opacity: 0.8; }

.tabbar {
	position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
	padding-bottom: env(safe-area-inset-bottom);
	display: flex; background: var(--card); border-top: 1px solid var(--line); z-index: 20;
	box-shadow: 0 -2px 10px rgba(23, 56, 47, 0.06);
}
.tabbar a, .tabbar button {
	flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
	color: var(--muted); font-size: 0.72rem; background: none; border: 0; padding: 6px 0; cursor: pointer; position: relative;
}
.tabbar .active { color: var(--brand); font-weight: 600; }
.tabbar .active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.sheet-bg { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(15, 30, 25, 0.45); z-index: 30; display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--card); border-radius: 18px 18px 0 0; padding: 8px 8px calc(var(--tabbar-h) + 8px); }
.sheet a { display: flex; align-items: center; gap: 12px; padding: 14px 12px; color: var(--ink); border-radius: 10px; }
.sheet a .icon { color: var(--brand); }
.sheet a:active { background: var(--bg); }

@media (min-width: 900px) {
	.layout { display: grid; grid-template-columns: 236px 1fr; }
	.topbar { display: none; }
	.sidebar {
		display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh;
		padding: 18px 12px; background: var(--forest); color: var(--forest-ink);
	}
	.sidebar a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--forest-ink); opacity: 0.88; }
	.sidebar a:hover { background: var(--forest-2); opacity: 1; }
	.sidebar a.active { background: var(--forest-2); color: #fff; opacity: 1; font-weight: 600; box-shadow: inset 3px 0 0 var(--amber); }
	.sidebar a.active .icon { color: var(--amber); }
	.tabbar, .sheet-bg { display: none; }
	.main { padding: 24px 32px 48px; width: 100%; }
}
.brand { display: flex; align-items: flex-end; gap: 8px; padding: 6px 12px 22px; }
.brand .logo { height: 28px; width: auto; display: block; }
.brand small { color: var(--forest-ink); opacity: 0.7; font-size: 0.8rem; font-weight: 500; padding-bottom: 2px; }

/* Seiten & Karten */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 14px; min-height: 40px; }
.page-head h1 { flex: 1 1 auto; overflow-wrap: break-word; }
.page-actions { display: flex; gap: 8px; align-items: center; }
.back { font-size: 1.8rem; line-height: 1; color: var(--ink); padding: 0 6px 4px 0; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 14px; margin-bottom: 12px; display: block; color: inherit; }
.card > h2 { margin-bottom: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
a.card:hover { border-color: var(--brand); }
.add-card { width: 100%; text-align: left; color: var(--brand); font-weight: 600; cursor: pointer; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.grid2, .grid3 { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) {
	.grid2 { grid-template-columns: 1fr 1fr; }
	.grid3 { grid-template-columns: 1fr 1fr 1fr; }
}
.center { text-align: center; display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar input[type="search"] { flex: 1; min-width: 180px; }
.toolbar .check { width: auto; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.block { display: block; }
.pre { white-space: pre-wrap; margin: 6px 0; }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }
.danger { color: var(--danger); }
.neg { color: var(--danger); }
.pos { color: var(--ok); }
.prose ul { padding-left: 20px; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.hint { color: var(--muted); font-size: 0.8rem; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checks { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.seg button.active { background: var(--card); color: var(--brand-strong); font-weight: 600; box-shadow: var(--shadow); }
:root[data-theme="dark"] .seg button.active { color: var(--link); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.active { color: var(--link); } }
.seg.tabs { margin-bottom: 12px; flex-wrap: wrap; }
.user-picker { width: auto; }
.mini { width: 110px; min-height: 36px; padding: 6px 8px; }

/* Buttons */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px;
	padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; cursor: pointer;
	text-decoration: none; transition: filter 0.15s;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:not(:disabled):hover { filter: brightness(0.96); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 0.88rem; border-radius: 10px; }
.btn-primary { background: var(--brand-strong); color: var(--brand-ink); }
.btn-secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-go { background: #168947; color: #fff; }  /* feste Töne: weisse Schrift auch im Dunkelmodus lesbar */
.btn-warn { background: var(--amber); color: #1f211c; }
.btn-stop { background: #b83227; color: #fff; }
.link { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; }
.link.danger { color: var(--danger); }
.icon-btn { background: none; border: 1px solid var(--line); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; flex: none; }

/* Badges, Meldungen */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.warn-box { background: var(--warn-soft); color: var(--warn); padding: 8px 10px; border-radius: 10px; margin: 6px 0; }
.error-box { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: 10px; margin: 0; }
.warn-text { color: var(--warn); font-size: 0.8rem; }
.statusbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; margin-bottom: 10px; font-size: 0.88rem; }
.statusbar.off { background: var(--danger-soft); color: var(--danger); }
.statusbar.warn { background: var(--warn-soft); color: var(--warn); }
.toast {
	position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 16px); z-index: 50;
	background: var(--ink); color: var(--card); padding: 10px 16px; border-radius: 12px; max-width: calc(100% - 32px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.toast-error { background: var(--danger); color: #fff; }
.toast-warn { background: var(--warn); color: #fff; }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* Spinner */
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
.spinner-sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-error { max-width: 22rem; padding: 1rem; text-align: center; }
.boot-error .btn { margin-top: .75rem; }

/* Modal */
.modal-bg { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0, 0, 0, 0.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--card); width: 100%; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 0 16px 20px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--card); padding: 14px 0 10px; z-index: 1; }
@media (min-width: 640px) {
	.modal-bg { align-items: center; }
	.modal { max-width: 520px; border-radius: 16px; }
	.modal-wide { max-width: 760px; }
}

/* Anmeldung */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(120% 80% at 50% 0%, var(--forest-2) 0%, var(--forest) 60%); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0 6px; }
.auth-brand .logo { height: 40px; width: auto; }
.auth-brand small { color: var(--muted); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.lang-switch { display: flex; justify-content: center; gap: 8px; }
.lang-switch button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.lang-switch .active { color: var(--link); font-weight: 600; }
.qr { image-rendering: pixelated; background: #fff; padding: 6px; border-radius: 8px; }
.secret { display: block; word-break: break-all; padding: 8px; background: var(--bg); border-radius: 8px; margin-top: 6px; }

/* Stempeluhr */
.clock-card { background: var(--card); border-radius: 20px; padding: 18px; margin-bottom: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); border-top: 6px solid var(--line); }
.clock-work { border-top-color: var(--ok); }
.clock-travel { border-top-color: var(--info); }
.clock-break { border-top-color: var(--amber); }
.clock-state { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 14px; }
.clock-timer { font-size: 3.4rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -1px; color: var(--forest); }
:root[data-theme="dark"] .clock-timer { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .clock-timer { color: var(--ink); } }
.clock-timer.idle { color: var(--muted); opacity: 0.35; }
.clock-meta { color: var(--muted); }
.clock-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.clock-actions { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.clock-actions .btn { min-height: 58px; font-size: 1.05rem; }
.clock-actions .btn:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.day-sum { display: flex; gap: 18px; margin-bottom: 8px; }

/* Fallback für alte Android-WebViews ohne Flexbox-«gap» (Chrome < 84) */
@supports not (aspect-ratio: 1 / 1) {
	.day-sum > * + *, .row > * + *, .toolbar > * + *, .page-actions > * + *, .task-meta > * + * { margin-left: 10px; }
	.stack > * + * { margin-top: 12px; }
	.thumbs > * { margin: 0 8px 8px 0; }
}

/* Einsatzplan */
.plan-wrap { overflow-x: auto; padding: 0; }
.plan-grid { border-collapse: collapse; width: 100%; min-width: 860px; font-size: 0.85rem; }
.plan-grid th, .plan-grid td { border: 1px solid var(--line); padding: 6px; vertical-align: top; }
.plan-grid thead th { background: var(--bg); font-weight: 600; text-align: left; }
.plan-grid thead th.today { background: var(--brand-soft); color: var(--brand-strong); }
.plan-grid tbody th { text-align: left; white-space: nowrap; background: var(--card); }
.plan-grid td { min-width: 110px; height: 64px; cursor: pointer; }
.plan-grid td:hover { background: var(--bg); }
.plan-grid td.hol { background: var(--info-soft); }
.plan-grid td.abs { background: var(--warn-soft); }
.plan-chip { display: block; width: 100%; text-align: left; border: 0; border-left: 4px solid var(--brand); background: var(--brand-soft); color: var(--ink); border-radius: 8px; padding: 6px 8px; margin: 0 0 4px; cursor: grab; font-size: 0.82rem; }
.plan-chip small { display: block; color: var(--muted); }
.plan-abs { display: inline-block; font-size: 0.75rem; font-weight: 600; color: var(--warn); margin-bottom: 4px; }
.plan-abs.req { font-style: italic; }
.day-tabs { display: flex; width: 100%; margin-bottom: 12px; }
.day-tabs button { flex: 1; padding: 6px 2px; font-size: 0.8rem; }
.plan-item { padding: 6px 0; border-bottom: 1px solid var(--line); }
.plan-item:last-child { border-bottom: 0; }
.plan-day.today { border-color: var(--brand); }
.plan-today { border-left: 4px solid var(--brand); }

/* Rapport-Pflicht */
.report-bar { display: flex; flex-direction: column; gap: 4px; width: 100%; max-width: 360px; margin-top: 6px; color: var(--muted); font-size: 0.85rem; }
.report-bar .progress > span { background: var(--info); }
.report-bar.soon { color: var(--warn); }
.report-bar.soon .progress > span { background: var(--warn); }
.report-bar.due { color: var(--danger); font-weight: 700; }
.report-bar.due .progress > span { background: var(--danger); }

/* Zeitleiste */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 96px 1fr auto; gap: 8px; padding: 8px 0 8px 10px; border-left: 3px solid var(--ok); border-bottom: 1px solid var(--line); cursor: pointer; }
.timeline li:last-child { border-bottom: 0; }
.timeline .tl-travel { border-left-color: var(--info); }
.timeline .tl-break { border-left-color: var(--amber); }
.tl-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; }
.tl-dur { font-weight: 600; font-variant-numeric: tabular-nums; }
.week-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Statistik */
.stats-row, .stats-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); margin-bottom: 12px; }
@media (min-width: 700px) { .stats-row { grid-template-columns: repeat(4, 1fr); } .stats-grid { grid-template-columns: repeat(3, 1fr); } }
.stats-grid a, .stats-row a { color: inherit; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 2px; height: 100%; }
.stat-label { font-size: 0.8rem; color: var(--muted); }
.stat-value { font-size: 1.45rem; font-variant-numeric: tabular-nums; color: var(--forest); }
:root[data-theme="dark"] .stat-value { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stat-value { color: var(--ink); } }
.stat-sub { font-size: 0.78rem; color: var(--muted); }
.stat-neg .stat-value { color: var(--danger); }
.stat-pos .stat-value { color: var(--ok); }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 34%) 1fr 56px; gap: 8px; align-items: center; font-size: 0.85rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.bar-track { position: relative; height: 12px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.bar-fill { position: absolute; top: 0; bottom: 0; left: 0; background: var(--brand); border-radius: 6px; }
.bar-target { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
/* Aktionen untereinander (kein display:flex auf der Zelle – das bricht das Tabellenlayout). */
.table td.actions > * { display: inline-block; margin: 0 12px 4px 0; }
.table .link { text-align: left; }
@media (max-width: 639px) {
	.table .hide-sm { display: none; }
	.table td.actions { min-width: 8rem; }
	.table td.actions > * { display: block; margin: 0 0 6px; }
}
.row-warn td:first-child { box-shadow: inset 3px 0 var(--warn); }
.card .table { display: block; overflow-x: auto; }
@media (min-width: 640px) { .card .table { display: table; } }

/* Aufgaben, Checklisten, Projekte */
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.prio { color: var(--danger); font-weight: 800; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 10px 0; }
.facts dt { color: var(--muted); font-size: 0.88rem; }
.facts dd { margin: 0; }
.run-row { display: grid; grid-template-columns: 1fr 90px auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; }
.progress { display: block; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ok); }
.progress.big { height: 12px; margin: 10px 0 4px; }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; counter-reset: c; }
.check-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; }
.check-item.done { border-color: var(--ok); }
.check-item.missing:not(.done) { border-left: 4px solid var(--warn); }
.check-main { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check-main input { margin-top: 1px; }
.check-item.done .check-main span { color: var(--muted); }
.req { color: var(--danger); margin-left: 4px; font-weight: 700; }
.check-extra { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 0 32px; }
.value-field { display: flex; align-items: center; gap: 6px; }
.value-field input { width: 110px; min-height: 38px; padding: 6px 8px; }
.tpl-items { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.tpl-items li { display: flex; flex-direction: column; gap: 6px; }
.comment { border-bottom: 1px solid var(--line); padding: 8px 0; }
.log-card .card-head { margin-bottom: 4px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.absence-row { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* Dateien */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.thumb { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-img { border: 0; padding: 0; width: 100%; height: 100%; cursor: zoom-in; background: none; }
.thumb.add { cursor: pointer; border-style: dashed; color: var(--brand); font-size: 0.75rem; text-align: center; padding: 4px; }
.thumb-x { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; cursor: pointer; line-height: 1; }
.file-icon { display: flex; flex-direction: column; align-items: center; font-weight: 700; color: var(--muted); font-size: 0.8rem; }
.lightbox { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0, 0, 0, 0.88); z-index: 60; display: grid; place-items: center; padding: 12px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.thumb-wrap { display: flex; flex-direction: column; align-items: flex-start; width: 76px; }
.photo-info { font-size: 0.68rem; line-height: 1.2; color: var(--muted); margin-top: 3px; max-width: 76px; }
.photo-info.warn { color: var(--danger); font-weight: 600; }
.lightbox { flex-direction: column; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-height: calc(100% - 120px); }
.photo-details { margin-top: 10px; background: rgba(255, 255, 255, 0.95); color: #1f211c; border-radius: 10px; padding: 10px 14px; font-size: 0.85rem; cursor: default; max-width: 100%; }
.photo-details a { color: #b64f0a; }
@media print { .thumb-wrap { width: 110px; } .photo-info { max-width: 110px; } }
.report-log { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }

.print-only { display: none; }
.native .pwa-tip { display: none; }
@media print {
	body { background: #fff; color: #000; font-size: 11pt; }
	.sidebar, .tabbar, .page-actions, .no-print, .statusbar, .toast, .back { display: none !important; }
	.layout { display: block; }
	.main { padding: 0; max-width: none; }
	.card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
	.print-only { display: block; }
	.thumb { width: 110px; height: 110px; }
	a { color: #000; }
}

/* ===== 1.5.0: Navigation, Mitteilungen, Board, Kalender, Projekt-Zentrale, Dashboard, Wissen, Formulare ===== */

/* Menü-Gruppen + Glocke */
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.nav-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.55; padding: 4px 12px 2px; }
.sidebar { overflow-y: auto; }
.bell { position: relative; display: inline-flex; align-items: center; gap: 10px; color: inherit; }
.sidebar .bell { padding: 10px 12px; border-radius: 10px; color: var(--forest-ink); }
.sidebar .bell:hover { background: var(--forest-2); }
.bell-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 0.72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-left: auto; }
.bell.compact .bell-count { position: absolute; top: -6px; right: -10px; margin: 0; }
.sheet .nav-label { display: block; color: var(--muted); opacity: 1; padding: 10px 12px 2px; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }

/* Laden + leere Zustände */
.skeleton { display: flex; flex-direction: column; gap: 10px; }
.sk-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.sk-line { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--bg) 25%, var(--line) 50%, var(--bg) 75%); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; }
.sk-line.w40 { width: 40%; }
.sk-line.w60 { width: 60%; }
.sk-line.w90 { width: 90%; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 12px; }
.empty p { margin: 0; max-width: 34rem; }
.empty-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
@media (prefers-reduced-motion: reduce) { .sk-line, .spinner { animation: none; } }

/* Chips (Filter) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 0.85rem; }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--ink); font-weight: 600; }

/* Board (Kanban) */
.kanban { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(200px, 1fr)); overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.kb-col { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-height: 160px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; }
.kb-col.over { outline: 2px dashed var(--brand); outline-offset: -4px; }
.kb-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 0.85rem; padding: 8px 4px 2px; border-top: 3px solid var(--line); border-radius: 4px; }
.kb-open .kb-head { border-top-color: var(--muted); }
.kb-progress .kb-head { border-top-color: var(--info); }
.kb-done .kb-head { border-top-color: var(--ok); }
.kb-verified .kb-head { border-top-color: var(--forest-2); }
.kb-count { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-size: 0.75rem; color: var(--muted); }
.kb-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 4px; cursor: grab; box-shadow: var(--shadow); }
.kb-card:active { cursor: grabbing; }
.kb-title { color: var(--ink); font-weight: 600; }
.kb-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); align-items: center; }
.kb-people { display: flex; gap: 4px; }
.kb-next { align-self: flex-start; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; font-size: 0.75rem; color: var(--link); cursor: pointer; }
.kb-empty { color: var(--muted); font-size: 0.8rem; text-align: center; margin: 8px 0; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--forest-2); color: #fff; font-size: 0.65rem; font-weight: 700; display: inline-grid; place-items: center; }
@media (max-width: 899px) { .kanban { grid-template-columns: repeat(4, 82%); } }

/* Kalender */
.cal-title { font-weight: 700; text-transform: capitalize; min-width: 9em; text-align: center; }
.cal-grid { display: none; }
.cal-agenda { display: block; }
@media (min-width: 900px) {
	.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
	.cal-agenda { display: none; }
}
.cal-wd { background: var(--bg); padding: 6px; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.cal-day { background: var(--card); min-height: 108px; padding: 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-day.other { background: var(--bg); opacity: 0.6; }
.cal-day.today .cal-num { background: var(--brand); color: #fff; border-radius: 50%; }
.cal-day.hol { background: var(--info-soft); }
.cal-num { font-size: 0.78rem; font-weight: 700; width: 22px; height: 22px; display: grid; place-items: center; }
.cal-hol { font-size: 0.68rem; color: var(--info); }
.cal-more { font-size: 0.7rem; color: var(--muted); }
.cal-chip { display: block; font-size: 0.72rem; line-height: 1.3; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); border-left: 3px solid var(--line); background: var(--bg); }
.cal-task { border-left-color: var(--brand); background: var(--brand-soft); }
.cal-task.done { text-decoration: line-through; opacity: 0.65; }
.cal-plan { border-left-color: var(--ok); background: var(--ok-soft); }
.cal-abs { border-left-color: var(--warn); background: var(--warn-soft); }
.cal-abs.req { font-style: italic; }
.cal-proj { border-left-color: var(--info); background: var(--info-soft); }
.cal-agenda-items { display: flex; flex-direction: column; gap: 4px; }
.cal-agenda-items .cal-chip { font-size: 0.85rem; padding: 6px 8px; white-space: normal; }
.cal-agenda-day.today { border-color: var(--brand); }
.chip.cal-key-plan.on { border-color: var(--ok); background: var(--ok-soft); }
.chip.cal-key-absences.on { border-color: var(--warn); background: var(--warn-soft); }
.chip.cal-key-projects.on { border-color: var(--info); background: var(--info-soft); }

/* Projekt: Phasen */
.phase-steps { list-style: none; display: flex; margin: 4px 0 0; padding: 0; overflow-x: auto; scrollbar-width: none; position: relative; }
.phase-steps::-webkit-scrollbar { display: none; }
.phase-steps li { flex: 1 0 auto; min-width: 74px; position: relative; }
.phase-steps li::before { content: ""; position: absolute; top: 13px; left: -50%; right: 50%; height: 3px; background: var(--line); }
.phase-steps li:first-child::before { display: none; }
.phase-steps li.past::before, .phase-steps li.current::before { background: var(--ok); }
.phase-steps button { position: relative; width: 100%; background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 2px 4px; cursor: pointer; color: var(--muted); font-size: 0.72rem; }
.phase-steps button:disabled { cursor: default; }
.phase-steps .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 2px solid var(--line); font-weight: 700; font-size: 0.75rem; z-index: 1; }
.phase-steps .past .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.phase-steps .current .dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.phase-steps .current .lbl { color: var(--ink); font-weight: 700; }
.phase-steps button:not(:disabled):hover .dot { border-color: var(--brand); }
.phase-dots { display: flex; gap: 3px; margin: 8px 0 4px; }
.phase-dots i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.phase-dots i.past { background: var(--ok); }
.phase-dots i.cur { background: var(--brand); }
.phase-badge { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); white-space: nowrap; }
.phase-badge.ph-abgeschlossen { background: var(--ok-soft); color: var(--ok); }
.phase-badge.ph-anfrage, .phase-badge.ph-offerte { background: var(--bg); color: var(--muted); }

/* Verlauf + Galerie */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 8px 0 8px 4px; position: relative; }
.feed-item::before { content: ""; position: absolute; left: 9px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.feed-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; margin-top: 6px; position: relative; z-index: 1; border: 2px solid var(--card); }
.feed-phase .feed-dot { background: var(--brand); }
.feed-package .feed-dot { background: var(--info); }
.feed-task_done .feed-dot { background: var(--ok); }
.feed-form .feed-dot { background: var(--warn); }
.feed-log .feed-dot { background: var(--forest-2); }
.feed-log .card { margin-bottom: 0; }
.gallery .thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }

/* Diagramme + Budget */
.chart { width: 100%; height: auto; display: block; }
.chart-axis { stroke: var(--line); }
.chart-bar { fill: var(--forest-2); opacity: 0.55; }
.chart-bar.accent { fill: var(--brand); opacity: 1; }
.chart-value { font-size: 15px; fill: var(--ink); font-variant-numeric: tabular-nums; }
.chart-label { font-size: 14px; fill: var(--muted); }
.pipeline { display: flex; flex-direction: column; gap: 4px; }
.pipe-row { display: grid; grid-template-columns: minmax(96px, 34%) 1fr 32px; gap: 8px; align-items: center; background: none; border: 0; padding: 4px 2px; cursor: pointer; color: inherit; font-size: 0.85rem; text-align: left; border-radius: 6px; }
.pipe-row:hover { background: var(--bg); }
.pipe-row.empty { opacity: 0.5; }
.pipe-track { height: 14px; background: var(--bg); border-radius: 7px; overflow: hidden; }
.pipe-fill { display: block; height: 100%; background: var(--brand); border-radius: 7px; min-width: 2px; }
.pipe-value { text-align: right; font-variant-numeric: tabular-nums; }
.budget { display: inline-flex; flex-direction: column; gap: 3px; min-width: 160px; }
.budget-track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.budget-fill { display: block; height: 100%; }
.budget-fill.ok { background: var(--ok); }
.budget-fill.near { background: var(--amber); }
.budget-fill.over { background: var(--danger); }
.budget-text { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.budget-list { display: flex; flex-direction: column; }
.budget-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); color: inherit; }
.budget-row:last-child { border-bottom: 0; }
.project-card .budget { margin-top: 6px; width: 100%; }

/* Dashboard */
.dash-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .dash-grid { grid-template-columns: 1fr 1fr; } .main { max-width: 1180px; } }
.dash-grid .card { margin-bottom: 0; }
.stat-warn .stat-value { color: var(--warn); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.table td.warn { color: var(--warn); font-weight: 600; }
.table td.ok { color: var(--ok); }
ul.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

/* Mitteilungen */
.inbox { padding: 0; overflow: hidden; }
.inbox-row { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 14px; cursor: pointer; color: inherit; font: inherit; }
.inbox-row:last-child { border-bottom: 0; }
.inbox-row:hover { background: var(--bg); }
.inbox-row.unread { background: var(--brand-soft); }
.inbox-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inbox-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--brand); flex: none; }
.inbox-text { font-weight: 600; }
.inbox-row:not(.unread) .inbox-text { font-weight: 500; }
.inbox-excerpt { color: var(--muted); font-size: 0.85rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); flex: none; margin-top: 8px; }

/* @Erwähnung */
.mention-wrap { position: relative; }
.mention-list { position: absolute; left: 8px; right: 8px; top: 100%; z-index: 30; list-style: none; margin: 4px 0 0; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); max-height: 220px; overflow: auto; }
.mention-list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.mention-list li.active, .mention-list li:hover { background: var(--brand-soft); }
.mention { color: var(--link); font-weight: 600; }

/* Wissen */
.wiki-grid, .form-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.wiki-grid .card, .form-grid .card { margin-bottom: 0; }
.wiki-card h3 { margin: 4px 0; }
.wiki-cat { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-strong); }
.wiki-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.md { line-height: 1.6; }
.md h2 { font-size: 1.15rem; margin: 18px 0 6px; }
.md h3 { font-size: 1rem; margin: 14px 0 4px; }
.md h2:first-child, .md h3:first-child { margin-top: 0; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md-note { background: var(--info-soft); border-left: 4px solid var(--info); padding: 8px 12px; border-radius: 8px; }
.md-preview { min-height: 200px; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.9rem; }

/* Formulare + Pakete */
.form-card { display: flex; gap: 12px; align-items: flex-start; }
.form-card .icon { color: var(--brand); flex: none; margin-top: 2px; }
.entry-row h3 { font-size: 0.95rem; }
.clamp2 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin: 4px 0; }
.note-box { background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.row-card { width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; cursor: pointer; font: inherit; }
.row-card:hover { border-color: var(--brand); }
.pkg-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.grid-pkg { display: grid; gap: 8px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 560px) { .grid-pkg { grid-template-columns: 1fr 110px 110px; } }
.inline-field { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); }
.inline-field input { min-height: 38px; padding: 6px 8px; }
.pkg-preview { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.pkg-preview li span { margin-right: 6px; }
.toolbar .seg button { display: inline-flex; align-items: center; gap: 6px; }

/* Dunkel: Texte auf hellen Akzentflächen */
:root[data-theme="dark"] .phase-badge, :root[data-theme="dark"] .wiki-cat { color: var(--link); }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .phase-badge, :root:not([data-theme="light"]) .wiki-cat { color: var(--link); }
}
button.file-icon { background: none; border: 0; cursor: pointer; width: 100%; height: 100%; justify-content: center; font: inherit; font-weight: 700; color: var(--muted); }
