:root {
  --bg: #F5F6F8; --card: #FFFFFF; --line: #E4E7EC; --line2: #EEF0F3; --text: #101828; --muted: #5B6676; --sub: #344054;
  --akzent: #3355E0; --akzent-d: #2443B8; --akzent-bg: #EEF2FF;
  --Mutter: #B4236F; --Vater: #1F5FAE; --Tobias: #1B7A4B; --offen: #7B8494;
  --gelb: #8A5A00; --gelb-bg: #FFF4D6; --rot: #B42318; --rot-bg: #FEECEB; --gruen: #0E5A34; --gruen-bg: #E6F4EC;
  --balken: #CBD5E4; --balken-h: #B7C4D8; --miriam: #F1D49A; --sel: #FFD84D;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif; }
a { color: var(--akzent); } a:hover { color: var(--akzent-d); }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin: 0; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 14.5px; font-weight: 600; margin: 0 0 6px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .klein { font-size: 13.5px; color: var(--muted); }
button, .btn, input, select, textarea { font: inherit; }
button, .btn { font-size: 14px; font-weight: 500; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid #D0D5DD; background: #fff; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
button:hover:not(:disabled), .btn:hover { background: #F9FAFB; }
button:disabled { opacity: .5; cursor: default; }
button.p { background: var(--akzent); border-color: var(--akzent); color: #fff; font-weight: 600; } button.p:hover:not(:disabled) { background: var(--akzent-d); }
button.k { min-height: 36px; padding: 0 10px; font-size: 13.5px; }
button.link { border: 0; background: none; color: var(--akzent); padding: 0 4px; min-height: 32px; text-decoration: underline; } button.link.rot { color: var(--rot); }
:focus-visible { outline: 3px solid #9DB2F7; outline-offset: 2px; }
input[type=text], input[type=password], input[type=date], input[type=number], select, textarea { font-size: 15px; min-height: 44px; padding: 8px 12px; border: 1px solid #D0D5DD; border-radius: 10px; background: #fff; color: var(--text); width: 100%; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--akzent); }
label.f { display: grid; gap: 4px; font-size: 13.5px; color: var(--muted); }
.icon { width: 18px; height: 18px; flex: 0 0 18px; }

/* Anmeldung */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login form { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; width: min(400px, 100%); display: grid; gap: 14px; box-shadow: 0 8px 30px rgba(16,24,40,.08); }
.marke { display: flex; align-items: center; gap: 10px; }
.marke .l { width: 36px; height: 36px; border-radius: 10px; background: var(--akzent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.marke b { display: block; line-height: 1.2; font-size: 15.5px; } .marke span { font-size: 12.5px; color: var(--muted); }

/* Gerüst */
.geruest { display: grid; grid-template-columns: 244px minmax(0, 1fr) auto; min-height: 100vh; }
nav.seite { background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow: auto; }
nav.seite .marke { padding: 0 8px 16px; }
nav.seite .gr { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
nav.seite a.n { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 0 10px; border-radius: 9px; color: var(--sub); text-decoration: none; }
nav.seite a.n:hover { background: #F5F6F8; } nav.seite a.n.on { background: var(--akzent-bg); color: var(--akzent-d); font-weight: 600; }
.zahl { margin-left: auto; background: var(--gelb-bg); color: var(--gelb); font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; }
.ich { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 0; display: flex; align-items: center; gap: 10px; font-size: 13.5px; line-height: 1.3; }
.avatar { flex: 0 0 32px; height: 32px; border-radius: 50%; background: var(--akzent); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
main { padding: 28px 32px 60px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.kopf { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.kopf .akt { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(16,24,40,.04); min-width: 0; }
.reihe { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; } .reihe > * { flex: 1 1 300px; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.tag.ok { color: var(--gruen); background: var(--gruen-bg); } .tag.offen { color: var(--gelb); background: var(--gelb-bg); } .tag.fehlt { color: var(--rot); background: var(--rot-bg); } .tag.neutral { color: #475467; background: #EEF0F3; }
.punkt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.mobilkopf, .kiknopf { display: none; }

/* Übersicht */
.frist { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #F0D48A; border-radius: 12px; padding: 10px 16px; }
.frist .t { font-size: 30px; font-weight: 700; color: var(--gelb); line-height: 1; }
a.antrag { color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 10px; } a.antrag:hover { border-color: var(--akzent); color: inherit; }
.antrag .z { display: flex; align-items: center; gap: 8px; font-weight: 600; } .antrag .z .tag { margin-left: auto; }
.antrag .eur { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.fort { height: 6px; border-radius: 3px; background: #EAECF0; } .fort > i { display: block; height: 6px; border-radius: 3px; background: var(--c); }
.liste > * { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line2); } .liste > *:first-child { border-top: 0; }
.liste .t { flex: 1; min-width: 0; } .liste .t b { display: block; font-weight: 600; }
.liste input[type=checkbox] { margin-top: 2px; }
.erledigt b { text-decoration: line-through; color: var(--muted); font-weight: 400 !important; }

/* Ergebnis und Annahmen im Kalender */
.summen { display: flex; gap: 28px; flex-wrap: wrap; } .summen .z { font-size: 26px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
table.t { width: 100%; border-collapse: collapse; } table.t th, table.t td { text-align: left; padding: 8px 10px 8px 0; border-top: 1px solid var(--line2); vertical-align: top; }
table.t thead th { border-top: 0; font-size: 12.5px; color: var(--muted); font-weight: 600; } table.t .r { text-align: right; white-space: nowrap; }
.annahme { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line2); } .annahme:first-of-type { border-top: 0; padding-top: 0; }
.annahme .klein, .annahme .betraege { grid-column: 1 / -1; } .betraege { display: flex; flex-wrap: wrap; gap: 8px 14px; } .betraege input { width: 96px; }
.seg { display: inline-flex; border: 1px solid #D0D5DD; border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { border: 0; border-radius: 0; border-right: 1px solid #D0D5DD; min-height: 40px; min-width: 56px; } .seg button:last-child { border-right: 0; }
.seg button.on { background: var(--text); color: #fff; font-weight: 600; }
.leiste { position: sticky; top: 0; z-index: 6; padding: 8px 14px; background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 10px rgba(16,24,40,.07); display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 14px; }
.leiste .leg { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-right: auto; }
.pille { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 11.5px; background: var(--offen); vertical-align: middle; }
.pille.Mutter { background: var(--Mutter); } .pille.Vater { background: var(--Vater); } .pille.Tobias { background: var(--Tobias); }
.pille.mit { background: #fff; color: var(--offen); box-shadow: inset 0 0 0 2px currentColor; } .pille.mit.Mutter { color: var(--Mutter); } .pille.mit.Vater { color: var(--Vater); } .pille.mit.Tobias { color: var(--Tobias); }
.pille.warn { outline: 3px solid var(--rot); outline-offset: 1px; }
h3.mon { margin: 14px 0 6px; font-size: 15px; }
.kal { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.kal table { border-collapse: collapse; font-size: 13px; user-select: none; -webkit-user-select: none; }
.kal th, .kal td { width: 31px; min-width: 31px; height: 38px; text-align: center; padding: 0; border-left: 1px solid #F0F2F5; }
.kal tr + tr td { border-top: 1px solid #F0F2F5; }
.kal th { font-weight: 400; color: var(--muted); line-height: 1.15; font-size: 11.5px; border-bottom: 1px solid var(--line); } .kal th b { display: block; font-size: 13.5px; color: var(--text); font-weight: 600; }
.kal .we { background: #F7F8FA; }
.kal .name { width: 108px; min-width: 108px; text-align: left; padding: 0 10px; font-weight: 600; font-size: 14px; white-space: nowrap; position: sticky; left: 0; background: #fff; z-index: 2; border-left: 0; }
.kal .name small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; line-height: 1; }
.kal td.c { position: relative; cursor: pointer; }
.kal td.c:not(.da):hover::after { content: "+"; color: #98A2B3; font-size: 18px; font-weight: 600; } .kal td.c.sel::after { content: ""; }
.bar { position: absolute; left: -1px; right: 0; top: 8px; height: 22px; background: var(--balken); }
.bar.s { left: 3px; border-radius: 11px 0 0 11px; } .bar.e { right: 3px; border-top-right-radius: 11px; border-bottom-right-radius: 11px; }
.bar.gaim { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.75) 0 4px, transparent 4px 8px); } .bar.miriam { background: var(--miriam); }
td.c.da:hover .bar { background-color: var(--balken-h); } td.c.sel { background: var(--sel) !important; }
.kal .pille { position: relative; z-index: 1; margin: 0 -3px; }
.kal tr.ev td { height: 26px; position: relative; } .kal tr.ev .name { font-weight: 400; color: var(--muted); font-size: 13px; }
.evb { position: absolute; left: -1px; right: 0; top: 5px; height: 16px; background: #F3B8B1; } .evb.reise { background: #D5DBE5; } .evb.tod { background: #2A3040; }
.evt { position: absolute; left: 6px; top: 4px; z-index: 1; white-space: nowrap; font-size: 11.5px; line-height: 18px; color: #6D1B12; pointer-events: none; } .evt.reise { color: #3C4658; } .evt.tod { color: #fff; }
.auswahlleiste { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 20; background: var(--text); color: #fff; border-radius: 12px; padding: 10px 14px; display: none; gap: 12px; align-items: center; max-width: calc(100% - 24px); box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.auswahlleiste.zeigen { display: flex; } .auswahlleiste button { min-height: 36px; }

/* Antrag */
.weg { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; font-size: 13px; text-align: center; }
.weg button { border: 0; background: none; padding: 0; min-height: 0; display: block; color: var(--muted); font-weight: 400; cursor: pointer; }
.weg button::before { content: ""; display: block; height: 6px; border-radius: 3px; background: #EAECF0; margin-bottom: 8px; }
.weg button.f { color: var(--Tobias); font-weight: 600; } .weg button.f::before { background: var(--Tobias); }
.weg button.a { color: var(--text); font-weight: 600; } .weg button.a::before { background: #D99A00; }
.reiter { display: flex; gap: 6px; flex-wrap: wrap; } .reiter button { border-radius: 999px; min-height: 40px; color: var(--sub); } .reiter button.on { background: var(--text); border-color: var(--text); color: #fff; font-weight: 600; }
.blatt { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 40px 44px; box-shadow: 0 4px 16px rgba(16,24,40,.06); font-size: 14.5px; line-height: 1.6; display: flex; flex-direction: column; gap: 14px; }
.blatt .abs { white-space: pre-line; border-radius: 6px; margin: -4px -8px; padding: 4px 8px; cursor: pointer; position: relative; }
.blatt .abs:hover { background: var(--akzent-bg); } .blatt .abs.geaendert { box-shadow: inset 3px 0 0 var(--akzent); }
.blatt table { width: 100%; border-collapse: collapse; font-size: 13.5px; } .blatt th, .blatt td { border-bottom: 1px solid var(--line); padding: 5px 8px 5px 0; text-align: left; } .blatt .r { text-align: right; white-space: nowrap; }
.zeile { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line2); } .zeile:first-of-type { border-top: 0; }

/* Dokumente */
.ablage { border: 2px dashed #B9C3D3; border-radius: 14px; padding: 22px; text-align: center; color: var(--muted); background: #FAFBFC; }
.ablage.drueber { border-color: var(--akzent); background: var(--akzent-bg); }
.dok .typ { flex: 0 0 40px; height: 46px; border-radius: 6px; background: var(--akzent-bg); color: var(--akzent-d); font-weight: 700; font-size: 10.5px; display: grid; place-items: center; }

/* KI-Helfer */
aside.ki { width: 360px; background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.ki .kk { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line2); }
.ki .kk .i { width: 32px; height: 32px; border-radius: 10px; background: var(--akzent-bg); color: var(--akzent); display: grid; place-items: center; }
.ki .verlauf { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.blase { max-width: 92%; background: #F5F6F8; border-radius: 4px 14px 14px 14px; padding: 11px 14px; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.blase.ich2 { align-self: flex-end; background: var(--akzent); color: #fff; border-radius: 14px 14px 4px 14px; }
.vorschlag { border: 1.5px dashed var(--akzent); border-radius: 12px; padding: 14px; background: #FAFBFF; display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.vorschlag .u { font-size: 12px; font-weight: 600; color: var(--akzent-d); letter-spacing: .04em; text-transform: uppercase; }
.vorschlag .kn { display: flex; gap: 8px; } .vorschlag .kn .p { flex: 1; }
.vorschlag.fertig { border-style: solid; border-color: var(--line); background: #fff; color: var(--muted); }
.ki form { padding: 14px 18px 18px; border-top: 1px solid var(--line2); display: flex; gap: 8px; }
.ki form button { width: 44px; padding: 0; flex: 0 0 44px; }
.beisp { text-align: left; justify-content: flex-start; font-weight: 400; height: auto; padding: 10px 13px; }

/* Fenster, Meldung */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(620px, calc(100% - 20px)); max-height: calc(100% - 30px); box-shadow: 0 12px 48px rgba(0,0,0,.35); color: var(--text); }
dialog::backdrop { background: rgba(16,24,40,.5); }
.dk { display: flex; align-items: flex-start; gap: 10px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 3; }
.dk h2 { font-size: 19px; margin: 0; } .dk .t { flex: 1; } .dk .x { width: 40px; min-height: 40px; padding: 0; border-radius: 50%; }
.di { padding: 16px 20px; display: grid; gap: 16px; }
.df { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }
.zwei { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.fahrt { border: 1px solid var(--line); border-left: 6px solid var(--offen); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; margin-bottom: 10px; }
.fahrt.Mutter { border-left-color: var(--Mutter); } .fahrt.Vater { border-left-color: var(--Vater); } .fahrt.Tobias { border-left-color: var(--Tobias); }
.fahrt .fk { display: flex; gap: 10px; align-items: baseline; } .fahrt .fk .was { flex: 1; font-weight: 600; } .fahrt .fk .eur { font-weight: 700; white-space: nowrap; }
.fuer { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.fuer .seg button.on[data-v=Mutter] { background: var(--Mutter); } .fuer .seg button.on[data-v=Vater] { background: var(--Vater); } .fuer .seg button.on[data-v=Tobias] { background: var(--Tobias); } .fuer .seg button.on[data-v=""] { background: var(--offen); }
.mehr { display: grid; gap: 10px; padding-top: 8px; border-top: 1px dashed var(--line); } .mehr .z { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; } .mehr input, .mehr select { width: auto; }
.w-r, .w-o { font-size: 13px; padding: 3px 9px; border-radius: 6px; display: inline-block; } .w-r { background: var(--rot-bg); color: var(--rot); } .w-o { background: var(--gelb-bg); color: var(--gelb); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 60; background: var(--text); color: #fff; border-radius: 12px; padding: 11px 16px; display: none; max-width: calc(100% - 24px); box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.toast.zeigen { display: block; } .toast.warn { background: #7A4B00; }
#druck { display: none; }

@media (max-width: 1180px) {
  .geruest { grid-template-columns: 244px minmax(0, 1fr); }
  aside.ki { position: fixed; right: 0; top: 0; z-index: 40; width: min(380px, 100%); box-shadow: -8px 0 30px rgba(16,24,40,.2); display: none; } aside.ki.auf { display: flex; }
  .kiknopf { display: grid; position: fixed; right: 18px; bottom: 18px; z-index: 30; width: 56px; height: 56px; border-radius: 50%; padding: 0; background: var(--akzent); color: #fff; border: 0; place-items: center; box-shadow: 0 6px 20px rgba(51,85,224,.45); }
  .ki .kk .zu { display: inline-flex; }
}
@media (min-width: 1181px) { .ki .kk .zu { display: none; } }
@media (max-width: 860px) {
  .geruest { grid-template-columns: minmax(0, 1fr); }
  nav.seite { position: fixed; z-index: 45; left: 0; top: 0; width: 264px; transform: translateX(-100%); transition: transform .15s; box-shadow: 8px 0 30px rgba(16,24,40,.2); } nav.seite.auf { transform: none; }
  .mobilkopf { display: flex; align-items: center; gap: 10px; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 12px; position: sticky; top: 0; z-index: 10; }
  main { padding: 18px 14px 90px; } h1 { font-size: 22px; } .leiste { position: static; } .blatt { padding: 22px 18px; }
  .weg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fuer .seg { display: flex; width: 100%; } .fuer .seg button { flex: 1; min-width: 0; padding: 0 4px; }
}
@media print {
  #app, dialog, .toast, .auswahlleiste, .kiknopf { display: none !important; }
  #druck { display: block; } body { background: #fff; font-size: 11pt; }
  #druck .blatt { border: 0; box-shadow: none; padding: 0; break-after: page; } #druck .blatt:last-child { break-after: auto; }
  #druck .abs { margin: 0; padding: 0; box-shadow: none !important; }
  @page { size: A4; margin: 20mm 18mm; }
}
