/* Dienstbericht – Gestaltung nach Design v2 (ruhige Karten, große Felder, Türkis sparsam) */

:root {
  --bg: #F2F4F5; --card: #FFFFFF; --field: #F3F5F6; --text: #1B2426; --muted: #56666B; --border: #E1E6E8;
  --accent: #007A7A; --accent-text: #006B6B; --on-accent: #FFFFFF; --sum-bg: #E3F3F2; --off: #C9D1D4;
  --warn-bg: #FFF4DB; --warn-text: #6B4E00; --danger: #B3261E; --danger-bg: #FDECEA;
  --info-bg: #E8EEF9; --info-text: #23406E;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15191B; --card: #1F2528; --field: #2A3135; --text: #E8EDEE; --muted: #A3B0B4; --border: #323B3F;
    --accent: #3CC4C0; --accent-text: #5FD3CF; --on-accent: #0E2726; --sum-bg: #183230; --off: #3A4448;
    --warn-bg: #3A3120; --warn-text: #F2D48A; --danger: #FF8A80; --danger-bg: #3B2220;
    --info-bg: #1E2A3D; --info-text: #B8CCF0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15191B; --card: #1F2528; --field: #2A3135; --text: #E8EDEE; --muted: #A3B0B4; --border: #323B3F;
  --accent: #3CC4C0; --accent-text: #5FD3CF; --on-accent: #0E2726; --sum-bg: #183230; --off: #3A4448;
  --warn-bg: #3A3120; --warn-text: #F2D48A; --danger: #FF8A80; --danger-bg: #3B2220;
  --info-bg: #1E2A3D; --info-text: #B8CCF0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .5; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.seite {
  max-width: 860px; margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 20px;
}
@media (max-width: 560px) { .seite { padding-left: 16px; padding-right: 16px; gap: 16px; } }

/* Kopf */
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.kopf h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.5px; }
.kopf-zeile { font-size: 15px; color: var(--muted); margin-top: 4px; }
.knopf-rund {
  min-height: 48px; padding: 0 18px; border-radius: 24px; border: 1px solid var(--border);
  background: var(--card); display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500;
}
.knopf-rund svg { width: 20px; height: 20px; }

/* Bereichswahl */
.modi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .modi { gap: 8px; } }
.modi button, .pille {
  min-height: 56px; border-radius: 14px; font-size: 17px; font-weight: 600;
  border: 1px solid var(--border); background: var(--card); color: var(--text); padding: 0 8px;
}
.modi button { min-height: 64px; }
.modi button[aria-pressed="true"], .pille[aria-pressed="true"] {
  border: 2px solid var(--accent); background: var(--sum-bg); color: var(--accent-text);
}
.pillen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

#inhalt { display: flex; flex-direction: column; gap: 20px; }

/* Karten */
.karte {
  background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
@media (max-width: 560px) { .karte { padding: 18px; } }
.karte h2 { margin: 0; font-size: 18px; font-weight: 600; }
.karte-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.karte-kopf .klein { font-size: 13px; color: var(--muted); }
.abschnitt { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding-top: 16px; }
.abschnitt-titel { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.abschnitt-titel b { font-size: 16px; font-weight: 600; }
.leise { font-size: 13px; color: var(--muted); }
.raster2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.raster2.eng { gap: 10px; }
.raster3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .raster2 { grid-template-columns: minmax(0, 1fr); } .raster2.eng { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gruppe { display: flex; flex-direction: column; gap: 10px; }
.gruppe-titel { font-size: 13px; font-weight: 600; letter-spacing: .6px; color: var(--muted); }

/* Textfelder */
.textfeld { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 500; color: var(--muted); }
.textfeld input, .textfeld textarea {
  min-height: 52px; border-radius: 12px; border: 1px solid var(--border); background: var(--field); color: var(--text);
  padding: 0 16px; font-size: 17px; font-weight: 400; width: 100%;
}
.textfeld textarea { padding: 14px 16px; resize: vertical; min-height: 80px; font-size: 16px; }

/* Uhrzeit-/Dauer-/Datumsfelder (nativer Picker im großen Feld) */
.zeitfeld {
  position: relative; min-height: 64px; border-radius: 12px; border: 1px solid var(--border); background: var(--field);
  display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 14px; min-width: 0;
}
.zeitfeld.leer { border-style: dashed; }
.zeitfeld .feldname { font-size: 12px; color: var(--muted); font-weight: 500; pointer-events: none; }
.zeitfeld input {
  -webkit-appearance: none; appearance: none; border: 0; background: transparent; padding: 0; margin: 0;
  font-size: 19px; font-weight: 600; color: var(--text); width: 100%; min-height: 30px; text-align: left;
  font-variant-numeric: tabular-nums;
}
.zeitfeld input::-webkit-date-and-time-value { text-align: left; }
.zeitfeld.leer input { color: transparent; }
.zeitfeld .platzhalter { position: absolute; left: 14px; bottom: 10px; font-size: 19px; font-weight: 600; color: var(--muted); pointer-events: none; display: none; }
.zeitfeld.leer .platzhalter { display: block; }
.zeitfeld .weg {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 22px;
  border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.zeitfeld.leer .weg { display: none; }
.zeitfeld.mit-weg input { padding-right: 40px; }
.zeitfeld.schmal { max-width: 220px; }

/* Knöpfe */
.knopf-haupt {
  min-height: 60px; border-radius: 16px; border: none; background: var(--accent); color: var(--on-accent);
  font-size: 18px; font-weight: 600; padding: 0 20px;
}
.knopf-rahmen {
  min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid var(--accent); background: transparent;
  color: var(--accent-text); font-size: 15px; font-weight: 600; align-self: flex-start;
}
.knopf-zweit {
  min-height: 52px; border-radius: 14px; border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: 16px; font-weight: 600; padding: 0 18px; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.knopf-zweit .leise { font-weight: 400; }
.knopf-gefahr { min-height: 48px; border-radius: 14px; border: 1px solid var(--danger); background: transparent; color: var(--danger); font-size: 16px; font-weight: 600; padding: 0 18px; }
.knopfreihe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pfeil { min-width: 52px; min-height: 52px; border-radius: 14px; border: 1px solid var(--border); background: var(--card); font-size: 22px; font-weight: 600; }

/* Schalter */
.schalter-zeile { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--border); min-height: 56px; }
.schalter-zeile:first-of-type { border-top: 0; }
.schalter-zeile .beschr { display: flex; flex-direction: column; gap: 2px; }
.schalter-zeile .beschr span:first-child { font-size: 16px; font-weight: 500; }
.schalter {
  width: 56px; height: 32px; flex-shrink: 0; border-radius: 16px; border: none; padding: 3px; display: flex;
  justify-content: flex-start; background: var(--off); position: relative;
}
.schalter::before { content: ""; position: absolute; inset: -6px; } /* größere Tippfläche (44 px) */
.schalter span { width: 26px; height: 26px; border-radius: 13px; background: #FFFFFF; display: block; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.schalter[aria-checked="true"] { justify-content: flex-end; background: var(--accent); }

/* Hinweise */
.hinweis { font-size: 14px; background: var(--warn-bg); color: var(--warn-text); border-radius: 12px; padding: 10px 14px; }
.hinweis.info { background: var(--info-bg); color: var(--info-text); }
.hinweis.fehler { background: var(--danger-bg); color: var(--danger); }
.hinweise { display: flex; flex-direction: column; gap: 10px; }
.hinweise:empty { display: none; }
.hinweis-zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hinweis-zeile button { min-height: 44px; border-radius: 12px; border: 1px solid currentColor; background: transparent; color: inherit; font-weight: 600; padding: 0 14px; }

/* Live-Übersicht */
.summe { background: var(--sum-bg); border-radius: 20px; padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.summe-werte { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.summe-werte div { display: flex; flex-direction: column; gap: 4px; }
.summe-werte .name { font-size: 13px; color: var(--muted); }
.summe-werte .wert { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.summe .klein { font-size: 14px; color: var(--muted); }
.summe .klein b { color: var(--text); font-variant-numeric: tabular-nums; }

/* Datumskarte */
.datum-reihe { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: stretch; }
.status-marke { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 10px; background: var(--field); color: var(--muted); }
.status-marke.da { background: var(--sum-bg); color: var(--accent-text); }
.status-marke.warn { background: var(--warn-bg); color: var(--warn-text); }

/* Listen (Urlaub/Krank-Vorschau, Monatsliste) */
.liste { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 4px 24px; display: flex; flex-direction: column; }
@media (max-width: 560px) { .liste { padding: 4px 14px; } }
.zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--border); padding: 6px 0; }
.zeile:last-child { border-bottom: 0; }
.zeile .links { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.zeile .tag { font-size: 16px; font-weight: 500; min-width: 84px; font-variant-numeric: tabular-nums; }
.zeile.grau .tag { color: var(--muted); }
.marke { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-text); }
.marke.info { background: var(--info-bg); color: var(--info-text); }
.haken {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--off); background: transparent; color: var(--text);
}
.haken[aria-checked="true"] { border: none; background: var(--accent); color: var(--on-accent); }
.haken svg { width: 18px; height: 18px; }

.monatszeile { width: 100%; border: 0; background: transparent; text-align: left; padding: 6px 0; }
.monatszeile .rechts { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.monatszeile .was { font-size: 16px; }
.monatszeile.leer .was { color: var(--muted); }
.monatszeile.wochenende .tag { color: var(--muted); }

.monats-summen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .monats-summen { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.monats-summen div { display: flex; flex-direction: column; gap: 2px; }
.monats-summen .name { font-size: 13px; color: var(--muted); }
.monats-summen .wert { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.monats-summen .wert.minus { color: var(--danger); }

.ungespeichert { font-size: 14px; color: var(--warn-text); text-align: center; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: min(92vw, 640px); background: var(--text); color: var(--bg); border-radius: 14px; padding: 14px 18px;
  font-size: 15px; font-weight: 500; box-shadow: 0 6px 24px rgba(0,0,0,.25); z-index: 10;
}
.toast[hidden] { display: none; }

.fuss { text-align: center; font-size: 13px; color: var(--muted); padding: 4px 0 8px; }
.versteckt { display: none !important; }
.monatstitel { align-self: center; text-align: center; }
