:root {
    color-scheme: light;
    font: 16px/1.5 "Inter", system-ui, sans-serif;
    color: #172936;
    background: #edf2f5;
    --nav: #122637;
    --accent: #185b65;
    --line: #d3dee6;
    --muted: #4a6474;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; }
body.logged { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
aside { display: flex; flex-direction: column; min-width: 0; background: var(--nav); color: #f0f6fa; padding: 22px 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; font-size: 1.15rem; padding: 4px 8px 26px; }
.brand img { width: 44px; height: 44px; border-radius: 12px; }
nav { display: grid; gap: 4px; }
nav a { color: #ddeaf3; padding: 8px 12px; border-radius: 8px; text-decoration: none; }
nav a:hover, nav a[aria-current] { background: #24485b; color: #fff; }
.nav-group { margin: 18px 12px 3px; color: #a7bfd1; font-weight: 650; font-size: .79rem; }
.user { margin-top: auto; padding: 30px 12px 0; color: #b7cbd6; }
.user form { margin-top: 5px; }
main { width: 100%; max-width: 1300px; padding: clamp(16px, 3vw, 40px); margin-inline: auto; }
.guest main { min-height: 100dvh; display: grid; align-content: center; gap: 14px; max-width: 460px; }
.signin { border-top: 3px solid var(--accent); }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 19px; }
h1, h2, p { margin: 0 0 12px; }
h1 { margin: 0; font-size: clamp(1.55rem, 3vw, 2rem); line-height: 1.2; letter-spacing: -.025em; overflow-wrap: anywhere; }
h2 { font-size: 1.08rem; }
a { color: #145a64; text-underline-offset: 3px; }
section, .stat { display: block; min-width: 0; background: white; border: 1px solid var(--line); border-radius: 12px; padding: clamp(14px, 2vw, 24px); margin-bottom: 15px; }
.stats, .columns, .grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { text-decoration: none; }
.stat strong { display: block; color: #142a39; font-size: 1.75rem; }
article { padding-block: 10px; border-bottom: 1px solid var(--line); }
article:last-of-type { border: 0; }
.notice { padding: 12px 16px; border: 1px solid #8fc1ae; background: #e8f4ec; border-radius: 8px; }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
label { display: block; margin: 0 0 11px; font-size: .9rem; font-weight: 650; }
input, select, textarea, button { font: inherit; }
input, select, textarea { display: block; width: 100%; min-width: 0; margin-top: 4px; padding: 9px 10px; border: 1px solid #aebfc9; border-radius: 8px; color: inherit; background: #fff; font-size: 1rem; }
textarea { min-height: 96px; resize: vertical; }
button, .button { display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: white; border-radius: 8px; padding: 9px 15px; cursor: pointer; font-weight: 650; text-decoration: none; }
button:hover, .button:hover { filter: brightness(.92); }
.secondary { background: #fff; color: var(--accent); }
.small { font-size: .85rem; padding: 5px 8px; }
.link { background: transparent; padding: 0; border: 0; text-decoration: underline; font-weight: 400; }
:focus-visible { outline: 3px solid #0086a4; outline-offset: 2px; }
.filters, .actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.filters { align-items: end; margin-bottom: 14px; }
.filters label { flex: 1 1 165px; margin: 0; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 10px; vertical-align: top; border-bottom: 1px solid #e0e8ee; }
th { font-size: .79rem; text-transform: uppercase; letter-spacing: .04em; background: #f2f6f9; color: var(--muted); white-space: nowrap; }
td small, article small { display: block; color: var(--muted); }
td a { font-weight: 650; }
.empty { padding-block: 18px; color: var(--muted); }
.badge { display: inline-block; border-radius: 16px; background: #e9f1f5; color: #244351; padding: 3px 8px; font-size: .82rem; font-weight: 650; vertical-align: middle; }
.badge.fertig { background: #dff3e8; color: #24543b; }
.badge.folge { background: #fff0cf; color: #6b4407; }
.entry, #add-line { margin-top: 15px; }
.line { display: grid; align-items: center; grid-template-columns: 3fr 1fr 1fr 1.3fr auto; gap: 8px; }
.totals { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 5px 20px; }
.totals dd { margin: 0; text-align: right; }
.stack { display: grid; gap: 6px; }
@media (max-width: 740px) {
    body.logged { display: block; }
    aside { padding: 10px 12px; }
    .brand { padding: 3px 5px 8px; }
    .brand img { width: 36px; height: 36px; }
    nav { display: flex; flex-wrap: wrap; gap: 5px; }
    nav a { padding: 6px 9px; font-size: .88rem; }
    .nav-group { display: none; }
    .user { display: flex; gap: 15px; padding: 7px 5px 0; font-size: .86rem; }
    .user form { margin: 0; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .columns { grid-template-columns: 1fr; }
    .line { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
    .line label:first-child { grid-column: 1/-1; }
}
