:root{
  --bg:#F5F6F2; --card:#fff; --ink:#15201B; --muted:#5B665F; --line:#ECEEE9; --border:#DCE0D9;
  --green:#1F6B4F; --green-d:#15503B; --green-l:#E3F0E9; --blue:#2F5596; --blue-l:#E6ECF7;
  --out:#B4410C; --orange:#E08A3C; --orange-l:#FBEBDD; --seg:#E7EAE4; --dark:#15201B;
  --r:16px; --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);font-size:15px;line-height:1.35}
body{min-height:100vh;overscroll-behavior-y:none}
a{color:var(--green);text-decoration:none}
button,input,select,textarea{font:inherit;color:inherit}
h1,h2,h3{margin:0}
.wrap{max-width:560px;margin:0 auto;padding:20px 16px 110px}
.admin .wrap{padding-top:16px}
.row{display:flex;align-items:center;gap:12px}
.between{justify-content:space-between}
.grow{flex:1;min-width:0}
.col{display:flex;flex-direction:column;gap:12px}
.muted{color:var(--muted)}
.small{font-size:12.5px}
.tiny{font-size:11.5px}
.bold{font-weight:600}
.in{color:var(--green)} .out{color:var(--out)} .tr{color:var(--blue)}
.num{font-variant-numeric:tabular-nums;white-space:nowrap}
.ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hidden{display:none!important}

/* Kopfzeile */
.top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:16px;min-height:44px}
.top h1{font-size:23px;font-weight:650;letter-spacing:-.2px}
.top .sub{font-size:13px;color:var(--muted)}
.top.center h1{font-size:18px;text-align:center;flex:1}
.iconbtn{width:44px;height:44px;border:none;background:transparent;border-radius:22px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;position:relative;color:var(--ink);padding:0}
.iconbtn:active{background:var(--seg)}
.iconbtn svg{width:22px;height:22px}
.badge{position:absolute;top:6px;right:6px;min-width:17px;height:17px;border-radius:9px;background:var(--out);color:#fff;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;padding:0 4px}

/* Karten */
.card{background:var(--card);border-radius:var(--r);padding:16px}
.card.dark{background:var(--dark);color:#fff}
.card.dark .muted{color:#B9C4BD}
.list{background:var(--card);border-radius:var(--r);overflow:hidden}
.item{display:flex;align-items:center;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line);min-height:56px;width:100%;background:none;border-left:0;border-right:0;border-top:0;text-align:left;cursor:pointer;color:inherit}
.item:last-child{border-bottom:none}
.item:active{background:#FAFBF8}
.item .t{font-size:15px;font-weight:500}
.item .s{font-size:12.5px;color:var(--muted);margin-top:1px}
.item .amt{font-weight:600;font-size:15px}
.section{display:flex;justify-content:space-between;align-items:baseline;margin:22px 2px 10px}
.section h2{font-size:16.5px;font-weight:650}
.label{font-size:12.5px;font-weight:650;color:var(--muted);letter-spacing:.3px;text-transform:uppercase;margin:20px 2px 8px}
.ico{width:38px;height:38px;border-radius:11px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.ico svg{width:19px;height:19px}
.dot{width:11px;height:11px;border-radius:6px;flex-shrink:0}
.avatar{width:40px;height:40px;border-radius:20px;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:650;font-size:14px;flex-shrink:0}
.pill{display:inline-flex;align-items:center;font-size:11px;font-weight:650;padding:2px 7px;border-radius:7px;background:var(--line);color:#3E4943}
.pill.g{background:var(--green-l);color:var(--green-d)} .pill.o{background:var(--orange-l);color:#8A3A0A} .pill.b{background:var(--blue-l);color:#23427A}
.empty{padding:28px 16px;text-align:center;color:var(--muted);font-size:14px}

/* Hero */
.hero .big{font-size:33px;font-weight:650;letter-spacing:-.5px;margin-top:4px}
.mini{display:flex;gap:10px;margin-top:14px}
.mini>div{flex:1;background:#22302A;border-radius:12px;padding:10px 12px}
.mini .v{font-weight:650;font-size:15.5px;margin-top:2px}
.mini .pos{color:#7FD3A8} .mini .neg{color:#FDBA8C}

/* Formulare */
.field{display:flex;flex-direction:column;gap:6px}
.field>span{font-size:13px;color:var(--muted)}
.input,select.input,textarea.input{height:48px;border:1px solid var(--border);background:#fff;border-radius:12px;padding:0 14px;font-size:16px;width:100%;outline:none;appearance:none;-webkit-appearance:none}
select.input{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235B665F' stroke-width='2'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 14px center;padding-right:36px}
textarea.input{height:auto;min-height:72px;padding:12px 14px}
.input:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(31,107,79,.15)}
.two{display:flex;gap:10px}.two>*{flex:1;min-width:0}
.amount-in{border:none;background:transparent;text-align:center;font-size:44px;font-weight:650;width:100%;outline:none;letter-spacing:-.5px;padding:4px 0}
.amount-in::placeholder{color:#C3C9C1}
.seg{display:grid;grid-auto-columns:1fr;grid-auto-flow:column;background:var(--seg);border-radius:12px;padding:4px;gap:4px}
.seg button{height:40px;border:none;border-radius:9px;background:transparent;font-size:14px;color:#3E4943;cursor:pointer;font-weight:500;padding:0 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.seg button.on{background:#fff;font-weight:650;color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.06)}
.seg.kind button.on[data-v=out]{color:var(--out)} .seg.kind button.on[data-v=in]{color:var(--green)} .seg.kind button.on[data-v=transfer]{color:var(--blue)}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{height:36px;padding:0 13px;border-radius:18px;border:1px solid var(--border);background:#fff;font-size:13.5px;cursor:pointer;display:inline-flex;align-items:center;gap:7px;white-space:nowrap}
.chip.on{background:var(--green);border-color:var(--green);color:#fff}
.chip.dash{border-style:dashed;background:transparent;color:#3E4943}
.chip .dot{width:9px;height:9px}
.scrollx{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.scrollx::-webkit-scrollbar{display:none}
.switch{width:50px;height:30px;border-radius:15px;border:none;background:#CBD1C8;position:relative;padding:0;cursor:pointer;flex-shrink:0;transition:background .15s}
.switch::after{content:"";position:absolute;left:3px;top:3px;width:24px;height:24px;border-radius:12px;background:#fff;transition:left .15s;box-shadow:0 1px 2px rgba(0,0,0,.2)}
.switch.on{background:var(--green)} .switch.on::after{left:23px}
.toggle-row{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border:1px solid var(--border);border-radius:14px;padding:11px 14px}
.colors{display:flex;flex-wrap:wrap;gap:10px}
.colors button{width:34px;height:34px;border-radius:17px;border:3px solid transparent;cursor:pointer;padding:0}
.colors button.on{border-color:var(--ink)}

/* Buttons */
.btn{height:52px;border:none;border-radius:14px;background:var(--green);color:#fff;font-size:16px;font-weight:650;width:100%;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 16px}
.btn:active{background:var(--green-d)}
.btn[disabled]{opacity:.55}
.btn.sec{background:#fff;color:var(--green);border:1px solid var(--green)}
.btn.ghost{background:transparent;color:var(--out);height:46px}
.btn.small{height:40px;font-size:14px;width:auto;border-radius:20px;padding:0 14px}
.btn.danger{background:#fff;color:var(--out);border:1px solid #E7C2AE}
.linkbtn{background:none;border:none;color:var(--green);font-weight:600;font-size:13.5px;cursor:pointer;padding:6px 0}

/* FAB + Navigation */
.fab{position:fixed;right:max(18px,calc(50% - 262px));bottom:94px;width:58px;height:58px;border-radius:29px;background:var(--green);color:#fff;border:none;display:flex;align-items:center;justify-content:center;box-shadow:0 6px 18px rgba(21,32,27,.28);cursor:pointer;z-index:20}
.fab svg{width:26px;height:26px}
nav.bottom{position:fixed;left:0;right:0;bottom:0;background:#fff;border-top:1px solid #E3E6E0;display:grid;grid-template-columns:repeat(4,1fr);padding-bottom:env(safe-area-inset-bottom);z-index:20}
nav.bottom a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;height:66px;font-size:11.5px;color:var(--muted)}
nav.bottom a svg{width:23px;height:23px}
nav.bottom a.on{color:var(--green);font-weight:650}
.admin nav.bottom{background:var(--dark);border-top:none;grid-template-columns:repeat(3,1fr)}
.admin nav.bottom a{color:#C9D2CC} .admin nav.bottom a.on{color:#7FD3A8}
.adminbar{background:var(--dark);color:#fff;padding:18px 16px 16px}
.adminbar .inner{max-width:560px;margin:0 auto;display:flex;justify-content:space-between;align-items:center}
.adminbar .k{font-size:11.5px;font-weight:700;color:#7FD3A8;letter-spacing:.5px}
.adminbar h1{font-size:21px;font-weight:650}
.adminbar .btn.small{background:transparent;border:1px solid #4A5A52;color:#fff}

/* Sheet (Dialog) */
.sheet-bg{position:fixed;inset:0;background:rgba(21,32,27,.42);z-index:50;display:flex;align-items:flex-end;justify-content:center;animation:fade .15s}
.sheet{background:var(--bg);width:100%;max-width:560px;border-radius:22px 22px 0 0;padding:10px 18px calc(22px + env(safe-area-inset-bottom));max-height:92vh;overflow-y:auto;animation:up .2s ease-out}
.sheet .grab{width:42px;height:5px;border-radius:3px;background:#CBD1C8;margin:0 auto 12px}
.sheet h2{font-size:18px;font-weight:650;margin-bottom:14px}
@keyframes up{from{transform:translateY(40px);opacity:.4}to{transform:none;opacity:1}}
@keyframes fade{from{opacity:0}to{opacity:1}}

/* Toast */
.toast{position:fixed;left:50%;bottom:96px;transform:translateX(-50%);background:var(--dark);color:#fff;border-radius:14px;padding:12px 16px;font-size:14px;z-index:60;display:flex;gap:14px;align-items:center;max-width:calc(100% - 32px);box-shadow:0 6px 20px rgba(0,0,0,.25);animation:up .2s}
.toast button{background:none;border:none;color:#7FD3A8;font-weight:700;cursor:pointer;font-size:14px}
.toast.err{background:#7A2A08}

/* Fortschritt */
.bar{height:8px;background:var(--line);border-radius:4px;overflow:hidden}
.bar>div{height:100%;border-radius:4px;background:var(--green)}
.bar.warn>div{background:var(--orange)} .bar.over>div{background:var(--out)}

/* Diagramme */
.donut-wrap{display:flex;align-items:center;gap:16px}
.donut{position:relative;width:148px;height:148px;flex-shrink:0}
.donut svg{transform:rotate(-90deg)}
.donut .c{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
.legend{flex:1;display:flex;flex-direction:column;gap:7px;font-size:13px;min-width:0}
.legend .row{gap:8px}
.bars{display:grid;grid-template-columns:repeat(6,1fr);align-items:end;height:120px;gap:8px;border-bottom:1px solid var(--line)}
.bars .g{display:flex;align-items:flex-end;justify-content:center;gap:3px;height:100%}
.bars .g div{width:13px;border-radius:3px 3px 0 0;min-height:2px}
.bars-l{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;font-size:11.5px;color:var(--muted);text-align:center;margin-top:6px}

/* Login */
.login{max-width:420px;margin:0 auto;padding:12vh 26px 40px;display:flex;flex-direction:column;gap:16px}
.logo{width:64px;height:64px;border-radius:18px;background:var(--green);display:flex;align-items:center;justify-content:center}
.logo svg{width:32px;height:32px}
.check{display:flex;align-items:center;gap:10px;font-size:14px;cursor:pointer}
.check input{width:20px;height:20px;accent-color:var(--green)}
.err-msg{background:#FBE6DC;color:#7A2A08;border-radius:12px;padding:10px 14px;font-size:14px}
.info{background:var(--green-l);border-radius:12px;padding:12px 14px;font-size:13.5px;color:#1F4D3A;line-height:1.45}
.warn-box{background:var(--orange-l);border-radius:12px;padding:12px 14px;font-size:13.5px;color:#6B2E08;line-height:1.45}
.thumb{width:64px;height:64px;border-radius:12px;object-fit:cover;border:1px solid var(--border)}
.spinner{width:20px;height:20px;border:3px solid rgba(255,255,255,.35);border-top-color:#fff;border-radius:50%;animation:spin .8s linear infinite}
.spinner.dark{border-color:rgba(31,107,79,.2);border-top-color:var(--green)}
@keyframes spin{to{transform:rotate(360deg)}}
.monthnav{display:flex;align-items:center;justify-content:space-between;margin:12px 0}
.monthnav b{font-size:15px}
table.imp{width:100%;border-collapse:collapse}
.imgview{max-width:100%;border-radius:12px;display:block}
@media (min-width:600px){ .wrap{padding-top:28px} }
.btn svg,.item>svg,.linkbtn svg,.chip svg{width:20px;height:20px;flex-shrink:0}
.btn.small svg{width:18px;height:18px}
.row>svg,.card>svg{width:20px;height:20px;flex-shrink:0}
.update-bar{position:fixed;top:0;left:0;right:0;z-index:70;background:#1F6B4F;color:#fff;display:flex;justify-content:center;align-items:center;gap:14px;padding:10px 16px calc(10px);font-size:14px}
.update-bar button{background:#fff;color:#1F6B4F;border:none;border-radius:16px;height:32px;padding:0 14px;font-weight:700;cursor:pointer}
.cbadge{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;flex-shrink:0}
.cbadge svg{display:block}
.chip .cbadge{margin-left:-6px}
.ipick{display:grid;grid-template-columns:repeat(auto-fill,minmax(44px,1fr));gap:8px}
.ipick button{border:2px solid transparent;background:none;border-radius:50%;padding:0;width:48px;height:48px;display:flex;align-items:center;justify-content:center;cursor:pointer}
.ipick button.on{border-color:var(--ink)}
.datebtns{display:flex;gap:6px}
.datebtns button{height:26px;padding:0 10px;border-radius:13px;border:1px solid var(--border);background:#fff;font-size:12.5px;cursor:pointer}
.datebtns button.on{background:var(--green);border-color:var(--green);color:#fff}
