/* Workmark Kundenportal — warm-helles Premium-Theme. Kanon: docs/DESIGN_SYSTEM_PORTAL.md */
:root {
	--bg: #f4f0e8;
	--bg-topbar: #f9f6ef;
	--surface: #fffdf8;
	--field: #fbf8f1;
	--tint: #f6f0e5;
	--dark: #2a251d;

	--text-hi: #2a251d;
	--text: #3a352c;
	--text-med: #4a4438;
	--muted: #6a6355;
	--soft: #9a9082;
	--faint: #b0a695;

	--accent: #bf4f2a;
	--accent-hover: #a5401f;
	--green: #3f7d5f;
	--amber: #c07a2a;
	--blue: #4a76b8;
	--grey: #8a8072;

	--line: #e4ddcf;
	--line-card: #e8e0d1;
	--line-row: #efe8db;

	--font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--font-serif: 'Newsreader', Georgia, "Times New Roman", serif;

	--radius-chip: 8px;
	--radius-btn: 9px;
	--radius-field: 10px;
	--radius-menu: 11px;
	--radius-bubble: 12px;
	--radius-card-sm: 14px;
	--radius-card: 16px;
	--radius-pill: 20px;
	--shadow-soft: 0 1px 2px rgba(42, 37, 29, .04), 0 14px 34px rgba(42, 37, 29, .05);
	--shadow-pop: 0 10px 30px rgba(42, 37, 29, .14);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--font-sans);
	font-size: 15px;
	line-height: 1.7;
	color: #26221b;
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}
::selection { background: rgba(191, 79, 42, .18); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1 { font-family: var(--font-serif); font-weight: 500; font-size: 27px; letter-spacing: -.01em; line-height: 1.2; margin: 0 0 4px; color: var(--text-hi); }
h2 { font-family: var(--font-serif); font-weight: 500; font-size: 19px; margin: 32px 0 14px; color: var(--text-hi); }
h3 { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); margin: 20px 0 8px; }
p { margin: 0 0 12px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tnum { font-variant-numeric: tabular-nums; }
.sub { color: var(--muted); margin: 0; }
.lead { color: var(--muted); }

/* ---------- Top bar / nav ---------- */
.topbar {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(249, 246, 239, .82);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--line);
}
.topbar-inner {
	max-width: 1000px;
	margin: 0 auto;
	padding: 0 24px;
	height: 60px;
	display: flex;
	align-items: center;
	gap: 24px;
}
.brand {
	font-family: var(--font-serif);
	font-weight: 600;
	font-size: 18px;
	color: var(--text-hi);
	letter-spacing: -.01em;
	display: inline-flex;
	align-items: baseline;
	gap: 9px;
}
.brand:hover { color: var(--text-hi); }
.brand-tag {
	font-family: var(--font-sans);
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .09em;
	color: var(--accent);
	background: rgba(191, 79, 42, .09);
	border-radius: 5px;
	padding: 2px 6px;
}
.topnav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topnav a {
	color: var(--text-med);
	padding: 7px 12px;
	border-radius: var(--radius-chip);
	font-weight: 500;
	font-size: 14px;
}
.topnav a:hover { background: var(--tint); color: var(--text-hi); }
.topnav a.is-active { color: var(--accent); font-weight: 600; }
.topnav-quiet { color: var(--muted) !important; }
.nav-toggle { display: none; }
.nav-burger { display: none; margin-left: auto; font-size: 20px; line-height: 1; padding: 6px 10px; border-radius: var(--radius-chip); color: var(--text); cursor: pointer; }
.nav-burger:hover { background: var(--tint); }

/* ---------- Layout ---------- */
.container { max-width: 1000px; margin: 0 auto; padding: 32px 24px 72px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.greeting h1 { margin-bottom: 2px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn, button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 11px 18px;
	border: 1px solid transparent;
	border-radius: var(--radius-btn);
	background: var(--accent);
	color: #fff;
	font-family: var(--font-sans);
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	white-space: nowrap;
}
.btn:hover, button:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary, button.btn-secondary {
	background: #fff;
	color: var(--text);
	border-color: var(--line);
	font-weight: 500;
}
.btn-secondary:hover, button.btn-secondary:hover { background: #fff; border-color: #c9bfad; color: var(--text); }
.btn-dark { background: var(--dark); color: #f4ede0; }
.btn-dark:hover { background: #3a342a; color: #f4ede0; }
.btn-sm, button.btn-sm { padding: 8px 14px; font-size: 12px; border-radius: var(--radius-chip); }
.btn-link { background: none; border: none; color: var(--accent); padding: 0; font-weight: 500; }
.btn-link:hover { background: none; color: var(--accent-hover); }
.done-months { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 16px; }
.done-month { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; background: var(--surface-2, #f4ede0); border: 1px solid var(--bd-soft, #e5dcc9); border-radius: 10px; min-width: 110px; }
.done-month .dm-month { font-size: 11px; color: var(--muted, #8a7f6a); }
.done-month .dm-hours { font-weight: 600; }
.done-month .dm-amt { font-size: 12px; }
.attach-add { display: block; font-size: 12px; color: var(--muted, #8a7f6a); margin: 8px 0; }
.reopen-form { margin-bottom: 14px; }
.approve-cell { white-space: nowrap; }
.approve-acts { display: inline-flex; gap: 8px; }
.approve-acts .mini { display: inline; margin: 0; }

/* ---------- Cards / panels ---------- */
.card {
	background: var(--surface);
	border: 1px solid var(--line-card);
	border-radius: var(--radius-card);
	padding: 22px;
	margin-bottom: 16px;
}
.dev-box { border-color: rgba(74, 118, 184, .3); background: rgba(74, 118, 184, .06); }
.section-note { color: var(--muted); font-size: 12.5px; margin: 4px 0 16px; }
.field-hint { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 5px; }

/* ---------- Forms ---------- */
label { display: block; margin-bottom: 16px; font-size: 12.5px; font-weight: 600; color: var(--text-med); }
label .req { color: var(--accent); }
input, select, textarea {
	display: block;
	width: 100%;
	margin-top: 8px;
	padding: 12px 14px;
	background: var(--field);
	border: 1px solid var(--line);
	border-radius: var(--radius-field);
	color: #26221b;
	font-family: var(--font-sans);
	font-size: 14.5px;
	font-weight: 400;
}
textarea { font-size: 14px; line-height: 1.6; resize: vertical; }
::placeholder { color: #a89f8e; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 40px;
	background-image:
		linear-gradient(var(--line), var(--line)),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23bf4f2a' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat, no-repeat;
	background-position: right 33px center, right 14px center;
	background-size: 1px 18px, 10px 7px;
}
input[type=file] { padding: 9px 12px; background: var(--field); font-size: 13.5px; }
input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); border-radius: 5px; }
label.checkbox { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
.row { display: flex; gap: 16px; }
.row > label { flex: 1; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 16px; }
table.grid { width: 100%; min-width: 460px; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line-card); border-radius: var(--radius-card); overflow: hidden; }
table.grid th, table.grid td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line-row); font-size: 14px; vertical-align: middle; }
table.grid thead th { background: var(--tint); color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tbody tr[onclick] { cursor: pointer; }
table.grid tbody tr[onclick]:hover { background: var(--tint); }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid tfoot th { background: var(--tint); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; border-top: 1px solid var(--line); }
table.grid td a { color: var(--text-hi); font-weight: 500; }
table.grid td a:hover { color: var(--accent); }
.amount { font-family: var(--font-serif); font-variant-numeric: tabular-nums; font-weight: 500; font-size: 15px; }
.pid { font-family: var(--font-sans); color: var(--faint); font-weight: 500; font-size: 12.5px; letter-spacing: .02em; }

/* ---------- Badges & Status-Pills ---------- */
.badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 11px;
	border-radius: var(--radius-pill);
	background: rgba(138, 128, 114, .12);
	font-size: 12.5px;
	font-weight: 500;
	color: var(--grey);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-warn { background: rgba(192, 122, 42, .1); color: var(--amber); }
.badge-success { background: rgba(63, 125, 95, .1); color: var(--green); }
.badge.status-progress, .badge.status-active { background: rgba(192, 122, 42, .1); color: var(--amber); }
.badge.status-attention { background: rgba(192, 122, 42, .1); color: var(--amber); }
.badge.status-review { background: rgba(74, 118, 184, .1); color: var(--blue); }
.badge.status-done { background: rgba(63, 125, 95, .1); color: var(--green); }
.badge.status-billed { background: rgba(138, 128, 114, .12); color: var(--grey); }

/* Wertstunden-Chip — zentrale Werteinheit gegenüber dem Kunden */
.vh {
	display: inline-block;
	padding: 3px 9px;
	border-radius: var(--radius-chip);
	background: rgba(63, 125, 95, .1);
	color: var(--green);
	font-weight: 500;
	font-size: 14px;
}

/* ---------- Flash / Inline-Alerts ---------- */
.flash {
	border-left: 3px solid;
	border-radius: var(--radius-menu);
	padding: 12px 15px;
	margin-bottom: 18px;
	font-size: 13.5px;
}
.flash-ok { border-color: var(--green); background: rgba(63, 125, 95, .07); color: #2f5f47; }
.flash-error { border-color: var(--accent); background: rgba(191, 79, 42, .07); color: var(--accent-hover); }

/* ---------- Dashboard: Hero + Aufmerksamkeit ---------- */
.summary-panel {
	display: grid;
	grid-template-columns: minmax(280px, 1.15fr) 1fr;
	gap: 16px;
	margin-bottom: 32px;
}
.summary-figure {
	background: var(--dark);
	border-radius: var(--radius-card);
	padding: 26px 28px;
	color: #fff;
}
.summary-figure .summary-eyebrow { color: #c9bda6; }
.summary-amount { display: block; font-family: var(--font-serif); font-weight: 500; font-size: 40px; line-height: 1.05; letter-spacing: -.02em; }
.summary-figure .summary-caption { color: #b3a992; }
.summary-attention {
	background: var(--surface);
	border: 1px solid var(--line-card);
	border-radius: var(--radius-card);
	padding: 24px 26px;
}
.summary-eyebrow { display: block; color: var(--soft); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.summary-caption { display: block; color: var(--muted); font-size: 13px; margin-top: 10px; }
.attention-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.attention-list li { font-size: 14.5px; }
.attention-list a { color: var(--text); display: inline-flex; align-items: baseline; gap: 7px; }
.attention-list a:hover { color: var(--accent); }
.attention-list strong { color: var(--accent); font-family: var(--font-serif); font-weight: 500; font-variant-numeric: tabular-nums; }
.summary-allclear { color: var(--muted); margin: 0; font-size: 14.5px; }

/* ---------- Nachrichten-Blasen (Verlauf) ---------- */
.thread { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.msg { display: flex; gap: 11px; align-items: flex-start; max-width: 82%; }
.msg-team { align-self: flex-start; }
.msg-you { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar {
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	border-radius: 9px;
	background: #f0e7d8;
	border: 1px solid #e0d6c4;
	color: var(--accent);
	font-family: var(--font-serif);
	font-weight: 500;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.bubble { border-radius: var(--radius-bubble); padding: 10px 14px; }
.msg-team .bubble { background: var(--surface); border: 1px solid var(--line-card); }
.msg-you .bubble { background: #f5ece0; border: 1px solid #ecdfc9; }
.bubble .meta { font-size: 11.5px; color: var(--soft); margin-bottom: 3px; }
.bubble .who { font-weight: 600; font-size: 13px; color: var(--text-med); }
.msg-body { font-size: 14px; line-height: 1.65; color: var(--text); }

.inline-form { display: flex; gap: 10px; align-items: flex-start; margin-top: 6px; }
.inline-form textarea { flex: 1; margin-top: 0; }
.inline-form button { flex-shrink: 0; }

/* ---------- Anhänge ---------- */
.attach-list { display: flex; flex-direction: column; gap: 8px; }
.attach-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line-card); border-radius: var(--radius-card-sm); background: var(--surface); font-size: 14px; }
.attach-row .meta { color: var(--muted); font-size: 12.5px; margin-left: auto; }

/* ---------- Empty ---------- */
.empty {
	border: 1px solid var(--line-card);
	border-radius: var(--radius-card);
	background: var(--surface);
	padding: 40px 26px;
	text-align: center;
}
.empty::before {
	content: "";
	display: block;
	width: 48px;
	height: 48px;
	margin: 0 auto 16px;
	border-radius: var(--radius-bubble);
	background: #f3e9da url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23bf4f2a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h10'/%3E%3C/svg%3E") center / 24px no-repeat;
}
.empty .empty-title { font-family: var(--font-serif); font-weight: 500; font-size: 17px; color: var(--text-hi); margin-bottom: 6px; }
.empty p { color: var(--muted); margin: 0 auto 16px; max-width: 460px; }
td .empty, .grid .empty { border: none; background: none; padding: 24px; }
td .empty::before, .grid .empty::before { display: none; }

/* ---------- Login ---------- */
.login-wrap { max-width: 400px; margin: 64px auto 0; }
.login-wrap h1 { text-align: center; margin-bottom: 8px; }
.login-wrap .lead { text-align: center; margin-bottom: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
	.topbar-inner { gap: 12px; }
	.nav-burger { display: block; }
	.topnav {
		position: absolute;
		top: 60px;
		right: 16px;
		margin-left: 0;
		flex-direction: column;
		align-items: stretch;
		gap: 2px;
		min-width: 200px;
		padding: 8px;
		background: var(--surface);
		border: 1px solid var(--line-card);
		border-radius: var(--radius-menu);
		box-shadow: var(--shadow-pop);
		display: none;
	}
	.nav-toggle:checked ~ .topnav { display: flex; }
	.topnav .btn { justify-content: flex-start; }
	/* Tap-Targets >= 44px auf Touch (vorher ~30px hohe Nav-Links/Burger). */
	.topnav a { padding: 12px 14px; min-height: 44px; display: flex; align-items: center; font-size: 15px; }
	.nav-burger { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
	.summary-panel { grid-template-columns: 1fr; }
	.page-head { flex-direction: column; }
	.row { flex-direction: column; gap: 0; }
	.msg { max-width: 92%; }
}
