/* Portfolio – ruhiges, edles Design. Helle und dunkle Darstellung nach Systemeinstellung. */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #1c2230;
  --ink-soft: #3b4252;
  --muted: #7a7f8a;
  --line: #e7e2d8;
  --accent: #a4683a;
  --accent-ink: #ffffff;
  --pos: #2e7d5b;
  --neg: #b4483c;
  --warn: #a86f12;
  --info-bg: #f1ede4;
  --ok-bg: #e9f3ec;
  --err-bg: #f8e9e6;
  --warn-bg: #f8f0e0;
  --shadow: 0 1px 2px rgba(28, 34, 48, .04), 0 8px 24px rgba(28, 34, 48, .05);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --k0: #a4683a; --k1: #3f5f7f; --k2: #6f8a6a; --k3: #b8956a; --k4: #7b6a93; --k5: #9aa0a8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111419;
    --surface: #181c23;
    --surface-2: #1d222a;
    --ink: #ece8e0;
    --ink-soft: #c9c5bc;
    --muted: #8f949d;
    --line: #2a303a;
    --accent: #d29563;
    --accent-ink: #141414;
    --pos: #5fb98d;
    --neg: #e5806f;
    --warn: #e0b25a;
    --info-bg: #1f242c;
    --ok-bg: #18271f;
    --err-bg: #2c1c1a;
    --warn-bg: #2a2416;
    --shadow: none;
    --k0: #d29563; --k1: #7d9ec0; --k2: #93b18d; --k3: #d6b88d; --k4: #a896c0; --k5: #7f858e;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 var(--sans); font-feature-settings: "tnum" 1, "lnum" 1;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; margin: 0 0 .5rem; }
h1 { font-size: 2rem; line-height: 1.2; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 .75rem; }
ul { margin: .25rem 0 0; padding-left: 1.2rem; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.main { flex: 1; padding-top: 32px; padding-bottom: 48px; }
.footer { color: var(--muted); font-size: 12px; padding-bottom: 24px; letter-spacing: .02em; }

/* Kopfzeile */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.brand { font-family: var(--serif); font-size: 1.25rem; text-decoration: none; white-space: nowrap; }
.brand-mark { color: var(--accent); font-size: .9em; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { text-decoration: none; padding: 8px 14px; border-radius: 999px; color: var(--ink-soft); }
.nav a.active, .nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { box-shadow: inset 0 0 0 1px var(--line); }
.nav-right { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.muted-link { color: var(--muted); text-decoration: none; }
.subnav { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin: -8px 0 24px; }
.subnav a { text-decoration: none; padding: 8px 0; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a.active { color: var(--ink); border-color: var(--accent); }

/* Seitenkopf */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.eyebrow a { text-decoration: none; }
.hero-number { font-size: 2.8rem; font-weight: 400; margin-bottom: 6px; }
.hero-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-size: 15px; }
.sep { color: var(--line); padding: 0 4px; }
.head-actions { text-align: right; }
.head-actions p { margin: 6px 0 0; }

/* Karten & Raster */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 560px; }
.card.empty { text-align: center; padding: 48px 24px; }
.grid { display: grid; gap: 24px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid > .card { margin-bottom: 0; }
.grid + .grid, .grid + .card, .card + .grid { margin-top: 24px; }
.link-card { text-decoration: none; display: block; transition: border-color .15s, transform .15s; }
.link-card:hover { border-color: var(--accent); color: inherit; transform: translateY(-1px); }
.big { font-family: var(--serif); font-size: 1.7rem; margin: 6px 0 2px; }

/* Tabellen */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tfoot td { font-weight: 600; border-bottom: none; background: var(--surface-2); }
.card:not(.flush) .table th:first-child, .card:not(.flush) .table td:first-child { padding-left: 0; }
.card:not(.flush) .table th:last-child, .card:not(.flush) .table td:last-child { padding-right: 0; }
.card:not(.flush) .table tfoot td { background: transparent; }
.num { text-align: right !important; white-space: nowrap; }
.name { font-weight: 500; }
.sub { font-size: 12px; margin-top: 2px; }
.strong { font-weight: 600; }
.row-warn td { background: var(--warn-bg); }
.actions-cell { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }

/* Farben für Werte */
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.warn { color: var(--warn); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.mono.big { font-size: 1.4rem; padding: 12px 16px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; display: inline-block; }

/* Aufteilung */
.alloc { display: grid; gap: 16px; }
.alloc-row { display: grid; grid-template-columns: 1fr; gap: 6px; }
.alloc-label { display: flex; justify-content: space-between; font-size: 14px; }
.alloc-value { font-size: 12px; color: var(--muted); }
progress.bar { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border: none; border-radius: 99px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
progress.bar::-webkit-progress-bar { background: var(--surface-2); border-radius: 99px; }
progress.bar::-webkit-progress-value { border-radius: 99px; background: var(--bar, var(--k0)); }
progress.bar::-moz-progress-bar { border-radius: 99px; background: var(--bar, var(--k0)); }
progress.k0 { --bar: var(--k0); } progress.k1 { --bar: var(--k1); } progress.k2 { --bar: var(--k2); }
progress.k3 { --bar: var(--k3); } progress.k4 { --bar: var(--k4); } progress.k5 { --bar: var(--k5); }

.movers { list-style: none; padding: 0; margin: 0; }
.movers li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.movers li:last-child { border-bottom: none; }
.history { list-style: none; padding: 0; margin: 0 0 16px; }
.history li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }

/* Hinweise */
.notice { border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; font-size: 14px; border: 1px solid transparent; }
.notice.ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--pos) 25%, transparent); }
.notice.err { background: var(--err-bg); border-color: color-mix(in srgb, var(--neg) 25%, transparent); }
.notice.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.notice.info { background: var(--info-bg); border-color: var(--line); }
.notice ul { margin-top: 6px; }

.tag { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft); white-space: nowrap; }
.tag.on { border-color: color-mix(in srgb, var(--pos) 40%, var(--line)); color: var(--pos); }
.tag.new { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--accent); }
.tag.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); color: var(--warn); }

/* Formulare */
form { margin: 0; }
form.inline { display: inline; }
label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
label.check { display: flex; gap: 8px; align-items: center; }
input, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; margin-top: 6px; transition: border-color .15s, box-shadow .15s; }
input[type=checkbox] { width: auto; margin: 0; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input.code { font-family: var(--mono); font-size: 1.5rem; letter-spacing: .3em; text-align: center; }
label.file input { padding: 8px; background: var(--surface-2); }
.row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.row input, .row select { margin-top: 0; }
.row.compact input, .row.compact select { padding: 6px 8px; font-size: 13px; width: auto; }
.actions { display: flex; gap: 12px; }

.btn { font: inherit; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--accent); color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--neg); }
.btn.danger:hover { border-color: var(--neg); }
.btn.small { padding: 5px 12px; font-size: 12.5px; }
.btn.wide { width: 100%; margin-top: 6px; }
.btn-link { background: none; border: none; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
.btn-link:hover { color: var(--accent); }

details summary { cursor: pointer; }
details.help, details.manual { margin-top: 16px; }
details.danger-zone { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; }
details.danger-zone summary { color: var(--muted); }
.inline-details { display: inline-block; }
.inline-details summary { list-style: none; }
.inline-details summary::-webkit-details-marker { display: none; }

/* Anmeldung */
body.auth .main { display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 36px; box-shadow: var(--shadow); }
.auth-card.wide-card { max-width: 480px; }
.auth-brand { font-family: var(--serif); font-size: 1.2rem; margin-bottom: 24px; }
.auth-card h1 { font-size: 1.6rem; }
.steps { display: flex; gap: 8px; margin-bottom: 18px; font-size: 12px; }
.steps span { padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.steps .on { border-color: var(--accent); color: var(--accent); }
.steps .done { color: var(--pos); }
.howto { padding-left: 1.1rem; font-size: 14px; color: var(--ink-soft); }
.howto li { margin-bottom: 4px; }
.qr { display: flex; justify-content: center; margin: 18px 0 6px; }
.qr svg, .qr img { background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--line); max-width: 240px; height: auto; }

@media (max-width: 860px) {
  .grid.two { grid-template-columns: 1fr; }
  .topbar-inner { gap: 12px; }
  .nav a { padding: 8px 10px; }
  .hero-number { font-size: 2.2rem; }
  .head-actions { text-align: left; }
}
@media (max-width: 620px) {
  .wrap { padding: 0 16px; }
  .nav-right a { display: none; }
  .brand { font-size: 0; }
  .brand-mark { font-size: 1.3rem; }
  .table th, .table td { padding: 12px 10px; }
}
