/* Christ & Kölzer Brennholz – Gestaltung
   Farben aus dem Logo: Waldgrün, Bernstein (Holz), Creme. Schrift: Barlow (lokal eingebunden). */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(fonts/barlow-400.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(fonts/barlow-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(fonts/barlow-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url(fonts/barlow-700.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(fonts/barlowcond-700.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url(fonts/barlowcond-800.woff2) format("woff2"); }

:root {
  --bg: #f5f0e8;
  --card: #ffffff;
  --card-2: #faf7f2;
  --text: #231f1a;
  --muted: #6f675d;
  --line: #e7dfd3;
  --green: #2f4a3a;
  --green-2: #3e604b;
  --amber: #c8833a;
  --amber-2: #e2a75f;
  --amber-soft: #f7ead8;
  --bark: #5a3a22;
  --primary: var(--green);
  --primary-fg: #fff;
  --pos: #2e7d4f;
  --neg: #b5452f;
  --res: #b9741f;
  --pos-soft: #e0f0e5;
  --neg-soft: #f8e1dc;
  --res-soft: #f9ead4;
  --radius: 16px;
  --radius-s: 11px;
  --shadow: 0 1px 2px rgba(47, 74, 58, .05), 0 6px 20px rgba(47, 74, 58, .06);
  --font: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-cond: "Barlow Condensed", "Barlow", -apple-system, sans-serif;
  --side: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131915;
    --card: #1b231e;
    --card-2: #202a24;
    --text: #eeebe4;
    --muted: #a3a99f;
    --line: #2d3832;
    --primary: #e2a75f;
    --primary-fg: #1b1610;
    --amber-soft: #3a2d1d;
    --pos: #74c995;
    --neg: #f08b74;
    --res: #e8b064;
    --pos-soft: #1f3a2a;
    --neg-soft: #432520;
    --res-soft: #3d2f1a;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--font);
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
a { color: var(--amber); }
h1 { font: 800 1.9rem/1.1 var(--font-cond); letter-spacing: .2px; margin: .3rem 0 1rem; }
h1 small { font: 500 1rem var(--font); color: var(--muted); letter-spacing: 0; }
h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 .8rem; }
h2 .more { float: right; font-size: .88rem; font-weight: 600; text-decoration: none; }
main { max-width: 1120px; margin: 0 auto; padding: 18px 16px; }
.muted { color: var(--muted); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.num, .kpi strong { font-variant-numeric: tabular-nums; }

/* ---------- Kopf, Seitenleiste, Tabs ---------- */
header.top {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--green); color: #f4ede1; position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand b { display: block; font: 800 1.2rem/1 var(--font-cond); letter-spacing: .5px; text-transform: uppercase; }
.brand small { display: block; font-size: .66rem; letter-spacing: 3.5px; color: var(--amber-2); font-weight: 600; margin-top: 2px; }
.avatar {
  margin-left: auto; width: 36px; height: 36px; border-radius: 50%; background: rgba(244, 237, 225, .14); color: #f4ede1;
  display: grid; place-items: center; font-weight: 700; text-decoration: none; font-size: .95rem;
}
aside.side { display: none; }
nav.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 20; box-shadow: 0 -4px 18px rgba(0, 0, 0, .04);
}
nav.tabs a { flex: 1; text-align: center; padding: 4px 0 2px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; }
nav.tabs a i { display: block; width: 52px; height: 30px; margin: 0 auto 2px; border-radius: 999px; display: grid; place-items: center; }
nav.tabs a.on { color: var(--text); }
nav.tabs a.on i { background: var(--amber-soft); color: var(--amber); }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

@media (min-width: 960px) {
  body { padding-bottom: 32px; padding-left: var(--side); }
  header.top, nav.tabs { display: none; }
  aside.side {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--green);
    color: #f4ede1; padding: 22px 14px; z-index: 20;
  }
  aside.side .logo { display: block; padding: 0 8px 22px; }
  aside.side .logo img { width: 100%; height: auto; display: block; }
  aside.side nav { display: flex; flex-direction: column; gap: 2px; }
  aside.side nav a {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: rgba(244, 237, 225, .82);
    text-decoration: none; font-weight: 600;
  }
  aside.side nav a:hover { background: rgba(244, 237, 225, .08); color: #fff; }
  aside.side nav a.on { background: rgba(226, 167, 95, .18); color: #fff; }
  aside.side nav a.on .ic { color: var(--amber-2); }
  aside.side .user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(244, 237, 225, .14); font-size: .9rem; }
  aside.side .user a { color: var(--amber-2); font-size: .82rem; }
  main { padding: 28px 32px; }
}

/* ---------- Karten, Raster ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; border: 1px solid var(--line); }
.card.flush { padding: 0; overflow: hidden; }
.pad { padding: 16px; margin: 0; }
.grid2 { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.grid3 { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .grid3 { grid-template-columns: 2fr 1fr; } }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: .4rem; }
.head h1 { margin-bottom: .5rem; }
.back { margin: 0 0 .35rem; font-size: .92rem; }
.back a { text-decoration: none; font-weight: 600; }
.narrow { max-width: 420px; margin: 0 auto; }
.narrow-form { max-width: 520px; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }

/* Startseite: Kontostand-Karte und Schnellaktionen */
.hero {
  background: var(--green); color: #f4ede1; border-radius: 20px; padding: 20px; margin-bottom: 16px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: repeating-radial-gradient(circle, rgba(226, 167, 95, .16) 0 6px, transparent 6px 22px);
}
.hero span { font-size: .85rem; opacity: .8; }
.hero strong { display: block; font: 800 2.6rem/1.05 var(--font-cond); margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.hero .split { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .88rem; opacity: .9; position: relative; z-index: 1; }
.hero .split b { color: var(--amber-2); font-weight: 600; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.quick a {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: var(--text); font-weight: 600; font-size: .85rem; text-align: center; box-shadow: var(--shadow);
}
.quick a i { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); }
.quick a.main i { background: var(--green); color: #f4ede1; }
@media (min-width: 960px) { .quick a { flex-direction: row; justify-content: flex-start; padding: 12px 14px; font-size: .95rem; } }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 820px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow); }
.kpi span { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; }
.kpi strong { font: 800 1.55rem/1.2 var(--font-cond); }
.kpi small { display: block; color: var(--res); font-size: .8rem; }
.kpi small.muted { color: var(--muted); }

/* Fortschritt / Balken */
.meter { height: 10px; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; display: flex; }
.meter i { display: block; height: 100%; background: var(--green-2); }
.meter i.res { background: var(--amber-2); }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; padding: 7px 0; font-size: .95rem; }
.hbar .t { height: 9px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.hbar .t i { display: block; height: 100%; border-radius: 999px; background: var(--amber); }
.hbar b { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 16px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; min-height: 44px; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.accent { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn.big { padding: 14px 18px; font-size: 1.05rem; }
.btn.small { min-height: 36px; padding: 6px 11px; font-size: .9rem; }
.btn.link-danger { color: var(--neg); background: none; border-color: transparent; }
.btn .ic { width: 19px; height: 19px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.actions .btn.big { flex: 1 1 180px; }
form.inline { display: contents; }
form.danger { margin-top: 12px; text-align: right; }

/* ---------- Formulare ---------- */
.form label, .field { display: block; margin-bottom: 13px; font-size: .84rem; color: var(--muted); font-weight: 600; }
.field > span { display: block; margin-bottom: 6px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 11px 13px; font: inherit; font-size: 16px; color: var(--text);
  background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-s); -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--amber); outline-offset: 0; border-color: transparent; }
input[type=checkbox], input[type=radio] { display: inline; width: auto; margin: 0 7px 0 0; -webkit-appearance: auto; appearance: auto; accent-color: var(--green); }
input.betrag { font: 800 1.6rem var(--font-cond); }
.row { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.switch { display: flex !important; align-items: center; font-size: 1rem !important; color: var(--text) !important; font-weight: 500 !important; }
.switch input { width: 22px; height: 22px; flex: none; }
.form.compact { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.form.compact p { min-width: 200px; }
.form.compact label { flex: 1; margin: 0; }
details > summary { cursor: pointer; font-weight: 600; padding: 2px 0; }
details[open] > summary { margin-bottom: 12px; }
fieldset { border: 0; padding: 0; margin: 0; }

/* Auswahlknöpfe (Holzart, Einnahme/Ausgabe) */
.pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pick label { margin: 0; }
.pick input, .seg.radio input { position: absolute; opacity: 0; pointer-events: none; }
.pick span {
  display: inline-block; padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card-2);
  color: var(--text); font-size: 1rem; font-weight: 600; cursor: pointer;
}
.pick input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.pick input:focus-visible + span { outline: 2px solid var(--amber); }
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 14px; overflow-x: auto; }
.seg a, .seg span { flex: 1; text-align: center; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; font-size: .93rem; }
.seg a.on, .seg input:checked + span { background: var(--green); color: #fff; }
.seg a b { font-weight: 500; opacity: .75; margin-left: 2px; }
.seg.radio label { flex: 1; margin: 0; }
.seg.radio span { display: block; cursor: pointer; font-size: 1rem; }
.seg.radio label:first-child input:checked + span { background: var(--neg); }
.seg.radio label:last-child input:checked + span { background: var(--pos); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters > * { flex: 1 1 140px; margin: 0; width: auto; }

/* Chips und Status */
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--amber-soft); color: var(--bark); margin: 2px 4px 2px 0; text-decoration: none; }
.chip.c1 { background: #dfe9f5; color: #24507f; }
.chip.c2 { background: #dcefdc; color: #2b6a2f; }
.chip.c3 { background: #f6dcd6; color: #8f3424; }
.chip.c4 { background: #f3e7c6; color: #74560f; }
.chip.c5 { background: #e8e0f3; color: #573a85; }
.chip.c6 { background: #d6efec; color: #1d6a63; }
.chip.c7 { background: #fbe3d0; color: #8a4513; }
.chip.c0 { background: #ebe8e3; color: #4a453e; }
.chip.pos { background: var(--pos-soft); color: var(--pos); }
.chip.neg { background: var(--neg-soft); color: var(--neg); }
@media (prefers-color-scheme: dark) {
  .chip { background: #3a2d1d; color: #f0c48c; }
  .chip.c1 { background: #1f2f44; color: #a9c8ef; }
  .chip.c2 { background: #1f3a24; color: #a5dca9; }
  .chip.c3 { background: #44241e; color: #f3ab9b; }
  .chip.c4 { background: #3e3317; color: #ead48f; }
  .chip.c5 { background: #33284a; color: #cdb8f0; }
  .chip.c6 { background: #183a37; color: #95dcd4; }
  .chip.c7 { background: #43291a; color: #f3bc92; }
  .chip.c0 { background: #2f2f2c; color: #cfccc4; }
}
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge.offen { background: var(--res-soft); color: var(--res); }
.badge.bezahlt, .badge.angenommen { background: var(--pos-soft); color: var(--pos); }
.badge.storniert, .badge.abgelehnt { background: var(--neg-soft); color: var(--neg); }
.badge.ueberfaellig { background: var(--neg); color: #fff; }

/* ---------- Lager-Kacheln ---------- */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(5, 1fr); } }
.tile {
  display: block; background: var(--card); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text);
  border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; cursor: pointer; transition: transform .12s;
}
.tile:active { transform: scale(.98); }
.tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; z-index: 1; background: var(--line); }
.tile.voll::before { background: var(--green-2); }
.tile.res::before { background: var(--amber); }
.tile.leer .pic { filter: grayscale(.6); opacity: .7; }
.tile .pic { position: relative; aspect-ratio: 4 / 3; background: var(--card-2) repeating-radial-gradient(circle at 50% 120%, transparent 0 10px, rgba(200, 131, 58, .1) 10px 12px); }
.tile .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .nr { position: absolute; left: 10px; bottom: 10px; background: rgba(27, 35, 30, .82); color: #fff; font: 800 1.35rem/1 var(--font-cond); padding: 5px 11px; border-radius: 10px; backdrop-filter: blur(4px); }
.tile .st { position: absolute; right: 10px; top: 12px; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .9); color: #333; }
.tile.voll .st { color: var(--green); }
.tile.res .st { background: var(--amber); color: #fff; }
.tile .info { padding: 9px 12px 12px; }
.tile .info small { display: block; color: var(--muted); font-size: .76rem; }
.tile .resv { color: var(--res) !important; font-weight: 700; }
.pickbox .tile input { position: absolute; right: 10px; top: 12px; width: 26px; height: 26px; z-index: 2; accent-color: var(--green); }
.pickbox .tile:has(input:checked) { border-color: var(--green); outline: 3px solid var(--green); }
.pickbox .tile .preis { font-weight: 700; color: var(--text); }

.boxhead { display: grid; grid-template-columns: 1fr; gap: 16px; background: var(--card); border-radius: var(--radius); padding: 16px; border: 1px solid var(--line); margin-bottom: 16px; box-shadow: var(--shadow); border-top: 5px solid var(--line); }
@media (min-width: 560px) { .boxhead { grid-template-columns: 240px 1fr; } }
.boxhead.voll { border-top-color: var(--green-2); }
.boxhead.res { border-top-color: var(--amber); }
.boxhead .pic img { width: 100%; border-radius: 12px; display: block; max-height: 280px; object-fit: cover; }
.boxhead h1 { margin: 0 0 .3rem; }
.boxhead .status { font-weight: 700; margin-bottom: 4px; }
.boxhead.res .status { color: var(--res); }
.boxhead.voll .status { color: var(--pos); }
.kommentar { white-space: normal; background: var(--card-2); padding: 9px 12px; border-radius: 10px; }

/* ---------- Tabellen / Listen ---------- */
table.list { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.list td, table.list th { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
table.list th { font-size: .76rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
table.list tr:last-child td { border-bottom: 0; }
table.list .num { text-align: right; white-space: nowrap; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--card-2); }
table.list tr.sum td { font-weight: 700; border-top: 2px solid var(--line); }
.card.flush table.list td:first-child, .card.flush table.list th:first-child { padding-left: 16px; }
.card.flush table.list td:last-child, .card.flush table.list th:last-child { padding-right: 16px; }
.buchungen td:last-child { font-weight: 700; }
.buchungen td.d { white-space: nowrap; color: var(--muted); width: 1%; }
.buchungen .meta { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.buchungen .dm { display: none; }
@media (max-width: 600px) {
  .buchungen td.d { display: none; }
  .buchungen .dm { display: inline; }
  .hide-s { display: none; }
}
.clip { font-size: .8rem; color: var(--muted); }
.months .bars { width: 30%; }
.bar { height: 7px; border-radius: 4px; margin: 3px 0; min-width: 0; }
.bar.pos, .sw.pos { background: var(--pos); }
.bar.neg, .sw.neg { background: var(--neg); }
.legend { font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 10px; }
@media (max-width: 600px) { .months .bars { display: none; } .months td, .months th { padding: 8px 4px; font-size: .88rem; } }
ul.log { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
ul.log li { padding: 7px 0; border-bottom: 1px solid var(--line); }
ul.log small { color: var(--muted); }
.log-table td.d { width: 1%; white-space: nowrap; }

/* Listeneinträge (Kunden, Dokumente) */
.items { list-style: none; margin: 0; padding: 0; }
.items > li > a, .items > li > div { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.items > li:last-child > a, .items > li:last-child > div { border-bottom: 0; }
.items > li > a:hover { background: var(--card-2); }
.items .ini { width: 40px; height: 40px; border-radius: 50%; background: var(--amber-soft); color: var(--amber); display: grid; place-items: center; font-weight: 700; flex: none; }
.items .main { flex: 1; min-width: 0; }
.items .main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.items .main small { display: block; color: var(--muted); font-size: .84rem; }
.items .end { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.items .end small { display: block; color: var(--muted); font-size: .8rem; }

/* ---------- Angebote / Rechnungen ---------- */
.positionen { width: 100%; border-collapse: collapse; }
.positionen th { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; text-align: left; padding: 0 4px 6px; }
.positionen td { padding: 4px; vertical-align: top; }
.positionen input, .positionen textarea { margin: 0; padding: 9px 10px; }
.positionen textarea { min-height: 44px; resize: vertical; }
.positionen .m { width: 78px; }
.positionen .e { width: 86px; }
.positionen .p { width: 110px; }
.positionen .g { width: 100px; text-align: right; padding-top: 14px; font-weight: 700; white-space: nowrap; }
.positionen .x { width: 40px; }
@media (max-width: 700px) {
  .positionen thead { display: none; }
  .positionen tr { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .positionen td { padding: 0; width: auto !important; }
  .positionen td.b { grid-column: 1 / -1; }
  .positionen td.g { grid-column: 1 / 4; text-align: left; padding-top: 4px; }
}
.summe { display: flex; justify-content: flex-end; align-items: baseline; gap: 14px; padding: 12px 4px 0; font-size: 1.05rem; }
.summe strong { font: 800 1.7rem var(--font-cond); }
.boxwahl { display: flex; flex-wrap: wrap; gap: 8px; }
.boxwahl button { font: inherit; font-weight: 600; font-size: .92rem; padding: 8px 12px; border-radius: 10px; border: 1.5px dashed var(--line); background: var(--card-2); color: var(--text); cursor: pointer; }
.boxwahl button small { color: var(--muted); font-weight: 500; }
.boxwahl button.drin { border-style: solid; border-color: var(--green); background: var(--pos-soft); }
.docmeta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 16px; margin-bottom: 14px; }
.docmeta div span { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; }
.adresse { white-space: pre-line; }
.warn { background: var(--res-soft); color: var(--text); padding: 10px 13px; border-radius: 10px; font-size: .92rem; margin-bottom: 14px; border-left: 4px solid var(--amber); }

/* ---------- Dateien / Upload ---------- */
.dateien { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 14px; }
.datei { width: 110px; }
.datei img, .datei .pdf { width: 110px; height: 110px; object-fit: cover; border-radius: 12px; display: flex; border: 1px solid var(--line); }
.datei .pdf { flex-direction: column; align-items: center; justify-content: center; text-decoration: none; background: var(--neg-soft); color: var(--neg); padding: 6px; text-align: center; }
.datei .pdf span { font-weight: 800; font-size: 1.2rem; }
.datei .pdf small { font-size: .65rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.datei .del { font-size: .75rem; font-weight: 500; margin: 4px 0 0; display: flex; align-items: center; }
.upload { border: 2px dashed var(--line); border-radius: 14px; padding: 14px; background: var(--card-2); }
.upload > span { display: block; color: var(--text); font-size: 1rem; }
.upload input { background: var(--card); }
.upload small { display: block; font-weight: 400; margin-top: 6px; }

/* Meldungen */
.flash { padding: 12px 15px; border-radius: 12px; margin-bottom: 14px; font-weight: 600; }
.flash.ok { background: var(--pos-soft); color: var(--pos); }
.flash.err { background: var(--neg-soft); color: var(--neg); }

/* ---------- Menü, Login, Einstellungen ---------- */
.menu { padding: 0; }
.menu a { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 600; }
.menu a:last-child { border-bottom: 0; }
.menu a::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.menu a .ic { color: var(--amber); }
.menu-title { font-size: .76rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; margin: 18px 4px 8px; }
body.login-seite { padding: 0; background: var(--green); min-height: 100vh; }
.login { padding: calc(8vh + env(safe-area-inset-top)) 16px 40px; max-width: 420px; margin: 0 auto; }
.login .logo { display: block; width: 100%; max-width: 330px; margin: 0 auto 26px; }
.login form { text-align: left; }
.login .flash { margin-top: 0; }
.optrow { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.optrow input { margin: 0; padding: 8px 10px; }
ul.check { list-style: none; padding: 0; }
ul.check .ok { color: var(--pos); }
ul.check .err { color: var(--neg); font-weight: 700; }

/* PayPal-Abgleich */
.hint { font-size: .86rem; color: var(--muted); background: var(--card-2); padding: 9px 12px; border-radius: 10px; }
.pprow { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pprow:last-child { border-bottom: 0; }
.ppinfo { min-width: 0; }
.ppinfo small { display: block; }
.pprow .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ppact { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ppform { display: flex; gap: 6px; align-items: center; margin: 0; }
.ppform select { margin: 0; padding: 7px 30px 7px 10px; max-width: 280px; }
td .ppform { justify-content: flex-end; margin-top: 4px; }
[hidden] { display: none !important; }
aside.side .user .avatar { margin-left: 0; }
.head { margin-bottom: 12px; }

/* Aktivitäten und Zähler */
.zahl { position: absolute; top: -4px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--neg); color: #fff; font: 700 .7rem/18px var(--font); font-style: normal; text-align: center; }
nav.tabs a i { position: relative; }
aside.side nav a .zahl { position: static; margin-left: auto; }
.akt .ini { background: var(--card-2); color: var(--muted); }
.akt .ini .ic { width: 19px; height: 19px; }
.akt .main b { white-space: normal; font-weight: 600; font-size: .95rem; line-height: 1.3; }
.akt a.neu { background: var(--amber-soft); }
.akt a.neu .ini { background: var(--amber); color: #fff; }
.akt .punkt { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); flex: none; }
h2 .badge { vertical-align: 2px; margin-left: 4px; }

/* iPhone/iPad als Home-Bildschirm-App: Apple legt oben einen Verlauf über die Statusleiste.
   Die Kopfleiste bekommt dort mehr Abstand, damit Logo und Schrift klar darunter stehen. */
@media (display-mode: standalone) {
  header.top { padding-top: calc(env(safe-area-inset-top) + 26px); padding-bottom: 14px; }
}
@media (display-mode: standalone) and (min-width: 960px) {
  aside.side { padding-top: calc(env(safe-area-inset-top) + 30px); }
  main { padding-top: calc(env(safe-area-inset-top) + 30px); }
}

/* ---------- Aufgaben ---------- */
.badge.grau { background: var(--card-2); color: var(--muted); }
.menu-title.neg { color: var(--neg); }
.items > li.aufgabe > div { padding: 6px 12px 6px 6px; gap: 6px; }
.items > li.aufgabe .main { display: block; padding: 8px 0; text-decoration: none; color: var(--text); }
.items > li.aufgabe .main b { white-space: normal; }
.haken { flex: none; width: 44px; height: 44px; border: 0; background: none; padding: 0; cursor: pointer; display: grid; place-items: center; }
.haken::before { content: ""; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--green-2); box-sizing: border-box; transition: background .12s; }
.haken:hover::before { background: var(--pos-soft); }
li.wichtig .haken::before { border-color: var(--amber); border-width: 3px; }
li.fertig .haken::before { background: var(--green-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 16px no-repeat; }
li.fertig .main b { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.stern { font-style: normal; color: #fff; background: var(--amber); border-radius: 4px; padding: 0 5px; font-size: .8rem; }
form.schnell { display: grid; gap: 8px; }
form.schnell > input[name=titel] { font-size: 1.05rem; }
form.schnell .row label { margin: 0; }

/* Datumsfelder: iOS zeigt leere Felder sonst flach und ohne Hinweis */
input[type=date], input[type=time], input[type=datetime-local] {
  min-height: 48px; line-height: 24px; text-align: left; padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8378' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3.5' y='5' width='17' height='15' rx='2.5'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: calc(100% - 13px) 50%; background-size: 20px;
}
input::-webkit-date-and-time-value { text-align: left; min-height: 24px; }
input::-webkit-calendar-picker-indicator { opacity: 0; }

/* iOS-Home-Bildschirm: auf kurzen Seiten rutschte die Tab-Leiste hoch. Seite immer bildschirmhoch, Fläche unter der Leiste auffüllen. */
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; min-height: 100lvh; }
nav.tabs::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 120px; background: var(--card); }

/* PayPal-Sammelzahlung */
.items.sammel > li > label { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); margin: 0; color: var(--text); font-size: 1rem; font-weight: 400; cursor: pointer; }
.items.sammel input[type=checkbox] { width: 22px; height: 22px; margin: 0; flex: none; }
.hint.pos { color: var(--pos); font-weight: 700; }
