:root {
  --bg: #f4f5f8; --card: #ffffff; --ink: #1c2230; --muted: #667085; --line: #e3e6ee;
  --accent: #2f5bea; --accent-ink: #ffffff; --nav: #1f2a44;
  --ok: #1d7f4a; --ok-bg: #e5f5ec; --warn: #9a5b00; --warn-bg: #fff3dc;
  --err: #b42318; --err-bg: #fde8e6; --info-bg: #eef1f8;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c; --card: #1b2030; --ink: #e8ebf2; --muted: #98a2b8; --line: #2b3247;
    --accent: #6d8dff; --accent-ink: #0d1220; --nav: #0e1118;
    --ok: #5fd08f; --ok-bg: #16301f; --warn: #f1b35a; --warn-bg: #3a2c12;
    --err: #ff8a80; --err-bg: #3b1a18; --info-bg: #222a3f;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
main { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(88px + env(safe-area-inset-bottom)); }
h1 { font-size: 1.35rem; margin: 0 0 12px; }
h2 { font-size: 1.05rem; margin: 0; }
h3 { font-size: .95rem; margin: 16px 0 6px; }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.sr { position: absolute; left: -9999px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 14px; }
.card.alert { border-color: var(--warn); }
.card.inactive { opacity: .65; }
.cardhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sum { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { margin-bottom: 10px; }

.flash { border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; white-space: pre-line; background: var(--ok-bg); color: var(--ok); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.flash.err { background: var(--err-bg); color: var(--err); }
.token { display: block; margin: 8px 0; padding: 8px; background: var(--card); color: var(--ink); border-radius: 8px; word-break: break-all; user-select: all; }

label { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 10px; }
input, select, textarea { width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); }
label.check input { width: auto; margin: 0; }
@media (max-width: 480px) { .row3 { grid-template-columns: 1fr 1fr; } .row3 > :first-child { grid-column: 1 / -1; } }

.btn { display: inline-block; padding: 10px 16px; font: inherit; font-weight: 600; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; text-align: center; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--err); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn.wide { width: 100%; margin-top: 6px; }
.btn[disabled] { opacity: .5; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.actions form, .inlineform { display: inline; margin: 0; }
.inline-delete { margin-top: 12px; }
.billrow { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.billrow input { margin: 0; }

.capture textarea { margin: 0 0 8px; font-size: 1.05rem; }
.capture .btn { width: 100%; }
.hint { margin: 8px 0 0; font-size: .8rem; color: var(--muted); }

.daynav { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 18px 0 12px; }
.daynav a { font-size: 1.6rem; line-height: 1; padding: 0 10px; }
.daynav a.today { font-size: .85rem; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.daytotal { text-align: center; padding: 12px; border-radius: var(--radius); background: var(--info-bg); margin: 4px 0 14px; }

ul.entries, ul.history { list-style: none; margin: 8px 0 0; padding: 0; }
.entry { display: grid; grid-template-columns: 72px 1fr auto 18px; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.entry:first-child { border-top: 0; }
.entry .time { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.entry .cust { font-weight: 600; font-size: .9rem; }
.entry .desc { overflow-wrap: anywhere; }
.entry .mins { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.entry .edit { color: var(--muted); font-size: 1.3rem; line-height: 1; }
.entry.proposal { grid-template-columns: 72px 1fr; }
.meta, .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chips { margin: 0 0 4px; }
ul.history li { padding: 6px 0; border-top: 1px solid var(--line); font-size: .85rem; }
ul.history li:first-child { border-top: 0; }

.badge, .flag { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: var(--info-bg); color: var(--muted); }
.badge.proposal { background: var(--warn-bg); color: var(--warn); }
.badge.reviewed { background: var(--ok-bg); color: var(--ok); }
.badge.billed { background: var(--ink); color: var(--card); }
.flag.warn { background: var(--warn-bg); color: var(--warn); }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: var(--nav); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 10; }
.tabs a { flex: 1; text-align: center; color: #aab3c9; font-size: .7rem; padding: 4px 0; }
.tabs a span { display: block; font-size: 1.15rem; line-height: 1.2; }
.tabs a.on { color: #fff; }

.login { max-width: 380px; margin: 12vh auto 0; }

/* Bericht */
.reportpage main { display: none; }
.reportbar { max-width: 820px; margin: 0 auto; padding: 14px 16px 0; display: flex; justify-content: space-between; align-items: center; }
.report { max-width: 820px; margin: 14px auto 40px; background: #fff; color: #1c2230; padding: 36px 40px; border: 1px solid var(--line); border-radius: var(--radius); position: relative; }
.report header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #1f2a44; padding-bottom: 14px; margin-bottom: 18px; }
.report h1 { margin: 0; font-size: 1.6rem; color: #1f2a44; }
.report .period { margin: 2px 0 0; color: #667085; font-size: 1.05rem; }
.report .issuer { font-weight: 700; color: #1f2a44; text-align: right; }
.report dl.meta { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; margin: 0 0 22px; }
.report dt { color: #667085; } .report dd { margin: 0; }
.report table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.report th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #667085; border-bottom: 1px solid #cfd4e0; padding: 6px 8px; }
.report td { padding: 6px 8px; vertical-align: top; border-bottom: 1px solid #eef0f5; }
.report .num { text-align: right; font-variant-numeric: tabular-nums; }
.report .nowrap { white-space: nowrap; }
.report tr.daysum td { background: #f3f5fa; font-size: .85rem; color: #3b4357; border-bottom: 1px solid #cfd4e0; }
.report tfoot td { font-weight: 700; font-size: 1rem; padding-top: 12px; border-top: 2px solid #1f2a44; border-bottom: 0; }
.report .foot { margin-top: 18px; font-size: .8rem; color: #667085; }
.report .muted { color: #667085; }
.watermark { background: #fff3dc; color: #9a5b00; text-align: center; padding: 8px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; }
.reportpage { background: var(--bg); }
@media (max-width: 600px) { .report { padding: 20px 14px; } .report .nowrap { white-space: normal; } }
@media print {
  .noprint { display: none !important; }
  body, .reportpage { background: #fff; }
  .report { border: 0; margin: 0; padding: 0; max-width: none; border-radius: 0; }
  .report tbody { break-inside: avoid; }
  @page { margin: 18mm 15mm; }
}
