/*
 * Ein einziges Stylesheet, keine externen Schriften, keine Trackingpixel.
 * Die Content-Security-Policy verbietet Inline-Styles - Diagrammfarben kommen
 * deshalb über die Klassen am Ende dieser Datei.
 */

:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --border: #e2e5ea;
    --text: #1c2024;
    --muted: #6b7280;
    --accent: #2f6f4f;
    --accent-text: #ffffff;
    --accent-soft: #d7e8de;
    --error: #9b2c2c;
    --error-bg: #fdeaea;
    --radius: 10px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #16181c;
        --surface: #1f2227;
        --border: #303540;
        --text: #e8eaed;
        --muted: #9aa2ae;
        --accent: #6cc48f;
        --accent-text: #101a14;
        --accent-soft: #26382e;
        --error: #f2a0a0;
        --error-bg: #3a2222;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

h1 { font-size: 1.3rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
h3 { font-size: 0.95rem; margin: 0 0 0.4rem; }

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85em;
    background: var(--bg);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1.5rem;
}

section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    background: transparent;
    border: 0;
    padding: 0;
}

.split > div {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.filters label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

select, input[type="password"] {
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    min-width: 9rem;
}

button {
    font: inherit;
    cursor: pointer;
    background: var(--accent);
    color: var(--accent-text);
    border: 0;
    border-radius: 6px;
    padding: 0.5rem 1.1rem;
}

button.link {
    background: none;
    color: var(--muted);
    padding: 0;
    text-decoration: underline;
}

.inline { margin: 0; }

.summary {
    margin: 0 0 1.25rem;
    color: var(--muted);
}

.summary strong {
    color: var(--text);
    font-size: 1.4rem;
}

table.totals {
    width: 100%;
    border-collapse: collapse;
}

table.totals th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-weight: 600;
    padding-bottom: 0.4rem;
}

table.totals td {
    padding: 0.45rem 0.5rem 0.45rem 0;
    border-top: 1px solid var(--border);
    vertical-align: middle;
}

table.totals td.num, table.totals th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

table.totals td.barcell,
table.totals th.barcol { width: 40%; padding-left: 1.25rem; }

.callout {
    margin-top: 1.25rem;
    padding: 0.9rem 1rem;
    background: var(--accent-soft);
    border-radius: var(--radius);
}

ul.tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.5rem 0 0;
    padding: 0;
}

ul.tags li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
    font-size: 0.85rem;
}

.muted { color: var(--muted); font-size: 0.85rem; }
.empty { color: var(--muted); font-style: italic; }

.error {
    background: var(--error-bg);
    color: var(--error);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
}

footer {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.6;
    padding: 0 0.25rem 2rem;
}

.login {
    max-width: 22rem;
    margin: 12vh auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}

.login form { margin-top: 1.25rem; }
.login label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.3rem; }
.login input { width: 100%; margin-bottom: 1rem; }
.login button { width: 100%; }

/* --- Diagramme ------------------------------------------------------- */

svg.bar {
    width: 100%;
    height: 10px;
    display: block;
}

svg.chart {
    width: 100%;
    height: 200px;
    display: block;
    overflow: visible;
}

.bar-fill { fill: var(--accent); }
.area-fill { fill: var(--accent-soft); }
.line { stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.axis { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.axis-label { font-size: 4px; fill: var(--muted); }
