@font-face { font-family: Montserrat; src: url(fonts/Montserrat-Regular.ttf) format('truetype'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: Montserrat; src: url(fonts/Montserrat-SemiBold.ttf) format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: Montserrat; src: url(fonts/Montserrat-Bold.ttf) format('truetype'); font-weight: 700; font-display: swap; }
:root { --blue: #2E3192; --blue-d: #1E2070; --ink: #1B1B2F; --muted: #4A4A5E; --soft: #6B6B7E; --bg: #F5F6FB; --line: #E4E5F2; --field: #D5D7EA; --light: #EEEFF8; --ok: #1F7A3A; --okbg: #E7F5EC; --warn: #9A5B00; --warnbg: #FFF4E0; --red: #C2410C; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Montserrat, system-ui, sans-serif; color: var(--ink); background: var(--bg); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid #7A86E8; outline-offset: 2px; }

/* Felder */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .lbl { font-size: 12px; font-weight: 600; color: var(--muted); }
.in { height: 46px; border: 1px solid var(--field); border-radius: 10px; padding: 0 12px; font-size: 15px; background: #fff; width: 100%; }
.in.big { height: 50px; font-size: 18px; font-weight: 600; }
.btn { height: 48px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; font-size: 15px; font-weight: 700; padding: 0 18px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sec { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--field); font-weight: 600; }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #F1C7B5; }
.btn.sm { height: 38px; font-size: 13px; border-radius: 9px; padding: 0 12px; }
.err { color: var(--red); font-size: 13px; font-weight: 600; min-height: 18px; }
.note { font-size: 12px; color: var(--soft); }
.pill { font-size: 12px; font-weight: 600; border-radius: 10px; padding: 3px 8px; white-space: nowrap; }
.pill.offen { color: var(--warn); background: var(--warnbg); }
.pill.freigegeben { color: var(--blue); background: var(--light); }
.pill.abgerechnet { color: var(--ok); background: var(--okbg); }

/* Anmeldung */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--blue); }
.login form { background: #fff; border-radius: 18px; padding: 28px 24px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.brand { font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.login h1 { margin: 0; font-size: 22px; color: var(--blue); }

/* Handy */
.m { max-width: 520px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; background: var(--bg); position: relative; }
.m-head { background: var(--blue); color: #fff; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; z-index: 2; }
.m-head .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.m-head .hi { font-size: 13px; opacity: .9; text-align: right; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: rgba(255,255,255,.14); border-radius: 12px; padding: 4px; }
.seg button { height: 40px; border: 0; border-radius: 9px; background: transparent; color: #fff; font-weight: 700; font-size: 14px; }
.seg button[aria-selected="true"] { background: #fff; color: var(--blue); }
.m-body { flex: 1; padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.m-foot { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 10px 20px calc(8px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.tabs { display: flex; justify-content: space-around; }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 500; color: var(--soft); text-decoration: none; min-width: 72px; min-height: 44px; justify-content: center; }
.tabs a[aria-current="page"] { color: var(--blue); font-weight: 700; }
.tasks { max-height: 236px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tasks button { min-height: 44px; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; text-align: left; line-height: 1.25; border: 1.5px solid var(--line); background: #F8F8FC; }
.tasks button[aria-pressed="true"] { border-color: var(--blue); background: var(--blue); color: #fff; }
.picked { font-size: 12px; font-weight: 600; color: var(--blue); }
.spread { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; }
.dur { display: flex; justify-content: space-between; align-items: center; background: var(--light); border-radius: 10px; padding: 10px 14px; font-size: 13px; color: var(--muted); }
.dur b { font-size: 16px; color: var(--blue); }
.timer { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 6px; text-align: center; }
.clock { font-size: 48px; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.live { font-size: 12px; font-weight: 600; color: var(--ok); }
.live::before { content: '● '; animation: blink 1.2s step-end infinite; }
.round { width: 176px; height: 176px; border-radius: 50%; border: 0; font-size: 18px; font-weight: 700; color: #fff; background: var(--blue); box-shadow: 0 8px 24px rgba(46,49,146,.25); }
.round.stop { background: var(--red); }
.cards { display: flex; flex-direction: column; gap: 8px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.card .d { width: 46px; text-align: center; flex-shrink: 0; }
.card .d b { display: block; font-size: 18px; color: var(--blue); line-height: 1.1; }
.card .d span { font-size: 11px; color: var(--soft); }
.card .t { flex: 1; min-width: 0; }
.card .t b { display: block; font-size: 14px; }
.card .t span { font-size: 12px; color: var(--soft); }
.card .r { text-align: right; font-size: 14px; font-weight: 700; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--light); border-radius: 12px; padding: 10px 12px; }
.kpi small { font-size: 11px; color: var(--muted); display: block; }
.kpi b { font-size: 18px; color: var(--blue); }
.monthnav { display: flex; align-items: center; justify-content: space-between; }
.iconbtn { width: 44px; height: 44px; border: 1px solid var(--field); border-radius: 10px; background: #fff; color: var(--blue); display: inline-flex; align-items: center; justify-content: center; }

/* Blatt (Bearbeiten) */
.sheet-bg { position: fixed; inset: 0; background: rgba(27,27,47,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet { background: #fff; width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 20px; display: flex; flex-direction: column; gap: 12px; max-height: 92vh; overflow: auto; }
@media (min-width: 900px) { .sheet-bg { align-items: center; } .sheet { border-radius: 18px; max-width: 560px; } }
.sheet h2 { margin: 0; font-size: 18px; color: var(--blue); }

/* Dankeschön */
.thx-bg { position: fixed; inset: 0; background: rgba(27,27,47,.55); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 30; overflow: hidden; }
.thx { background: #fff; border-radius: 20px; padding: 28px 24px 22px; width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; animation: pop .55s ease-out both; position: relative; }
.thx .ic { width: 96px; height: 96px; border-radius: 50%; background: var(--light); display: flex; align-items: center; justify-content: center; }
.thx h2 { margin: 0; font-size: 22px; color: var(--blue); }
.thx p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted); }
.thx .saved { font-size: 13px; font-weight: 600; color: var(--ok); background: var(--okbg); border-radius: 14px; padding: 6px 12px; }
.thx .btn { width: 100%; margin-top: 6px; }
.cf { position: absolute; top: 0; width: 10px; height: 14px; border-radius: 2px; animation: fall 2.6s ease-in infinite; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0 } 70% { transform: scale(1.08) } 100% { transform: scale(1); opacity: 1 } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes bounce { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-18px) } }
@keyframes pulse { 0%, 100% { transform: scale(1) } 50% { transform: scale(1.18) } }
@keyframes wiggle { 0%, 100% { transform: rotate(0) } 25% { transform: rotate(-14deg) } 75% { transform: rotate(14deg) } }
@keyframes fall { 0% { transform: translateY(-40px) rotate(0); opacity: 1 } 100% { transform: translateY(110vh) rotate(540deg); opacity: 0 } }
@keyframes blink { 50% { opacity: .35 } }
@keyframes draw { from { stroke-dashoffset: 60 } to { stroke-dashoffset: 0 } }
.a-pop { animation: pop .6s ease-out both } .a-spin { animation: spin 2.4s linear infinite } .a-bounce { animation: bounce .9s ease-in-out infinite }
.a-pulse { animation: pulse 1s ease-in-out infinite } .a-wiggle { animation: wiggle .8s ease-in-out infinite } .a-slow { animation: spin 8s linear infinite }
.a-draw path { stroke-dasharray: 60; animation: draw 1s ease-out both }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; } }

/* Admin */
.a { display: flex; flex-wrap: wrap; min-height: 100%; }
.a-side { flex: 1 1 220px; max-width: 260px; background: var(--blue); color: #fff; padding: 24px 18px; display: flex; flex-direction: column; gap: 4px; }
.a-side .brand { margin-bottom: 18px; }
.a-side .brand span { font-weight: 500; opacity: .85; letter-spacing: 0; display: block; }
.a-side a { color: #fff; text-decoration: none; border-radius: 8px; padding: 11px 12px; font-size: 14px; opacity: .9; }
.a-side a[aria-current="page"] { background: rgba(255,255,255,.16); font-weight: 600; opacity: 1; }
.a-side .grow { flex: 1; }
.a-main { flex: 999 1 560px; min-width: 0; padding: 28px 32px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 800px) { .a-side { max-width: none; flex-direction: row; flex-wrap: wrap; padding: 12px; } .a-side .brand { width: 100%; margin-bottom: 4px; } .a-side .grow { display: none; } .a-main { padding: 18px 14px; } }
.a-main h1 { margin: 0; font-size: 24px; color: var(--blue); }
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: space-between; }
.bar .left, .bar .right { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.box h2 { margin: 0 0 10px; font-size: 15px; color: var(--blue); }
.tbl { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--bg); }
td.num, th.num { text-align: right; }
td.wrap { white-space: normal; min-width: 160px; }
.kpirow { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kpirow .box small { font-size: 12px; color: var(--muted); display: block; }
.kpirow .box b { font-size: 22px; color: var(--blue); display: block; }
.calc .r { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.calc .tot { display: flex; justify-content: space-between; padding: 12px 14px; margin-top: 10px; background: var(--light); border-radius: 10px; font-size: 17px; font-weight: 700; color: var(--blue); }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.cols { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.cols > * { flex: 1 1 340px; min-width: 0; }
.list-item { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.list-item input.in { height: 40px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 40; max-width: 90vw; }
#app { min-height: 100%; }
.a { min-height: 100vh; }
.a-main h2 { margin: 6px 0 0; font-size: 17px; color: var(--blue); }
.list-item label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
