/* Projekte – Gestaltung wie neu.jeremia-werk.de: eckig, Linien 3 px, Sand und Gelb. Systemschrift. */

:root {
  --ink: #292927;
  --sand: #e0ded4;
  --sand-hell: #f2f1ec;
  --gelb: #eac867;
  --weiss: #ffffff;
  --grau: #5e5d58;
  --linie: #cfcdc2;
  --rot: #b3261e;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --unten: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sand-hell); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.4; }
a { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gelb); outline-offset: 1px; }
h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1.2; }
.rubrik { text-transform: uppercase; letter-spacing: .06em; font-size: 13px; font-weight: 800; color: var(--grau); margin: 22px 0 8px; }

/* ---------- Kopf ---------- */
.kopf { position: sticky; top: 0; z-index: 20; background: var(--weiss); border-bottom: 3px solid var(--ink); padding-top: env(safe-area-inset-top); }
.kopf-innen { max-width: 900px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 12px; min-height: 56px; }
.marke { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 17px; }
.marke img { width: 32px; height: 32px; }
.kopf nav { display: flex; gap: 4px; margin-left: auto; }
.kopf nav a { padding: 10px 12px; text-decoration: none; font-weight: 700; border-bottom: 3px solid transparent; }
.kopf nav a[aria-current="page"] { border-bottom-color: var(--gelb); }
.konto-knopf { width: 40px; height: 40px; border: 3px solid var(--ink); background: var(--sand); font-weight: 800; cursor: pointer; flex: 0 0 auto; }

/* Unten-Leiste auf dem Handy statt Navigation im Kopf */
.leiste { display: none; }
@media (max-width: 640px) {
  .kopf nav { display: none; }
  .konto-knopf { margin-left: auto; }
  .leiste { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--weiss); border-top: 3px solid var(--ink); padding-bottom: var(--unten); }
  .leiste a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; text-decoration: none; font-size: 12px; font-weight: 700; color: var(--grau); }
  .leiste a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 3px 0 var(--gelb); }
}

/* ---------- Seite ---------- */
.seite { max-width: 900px; margin: 0 auto; padding: 16px 16px calc(120px + var(--unten)); }
.seitenkopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.seitenkopf h1 { font-size: 24px; }
.unterzeile { color: var(--grau); font-size: 14px; margin-top: 4px; }
.leer { padding: 28px 16px; text-align: center; color: var(--grau); background: var(--sand); }

/* ---------- Knöpfe ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 3px solid var(--ink); background: var(--weiss); font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--ink); color: var(--weiss); text-transform: uppercase; letter-spacing: .06em; }
.btn-gelb { background: var(--gelb); }
.btn-gefahr { color: var(--rot); border-color: var(--rot); }
.btn-block { width: 100%; min-height: 50px; }
.btn-klein { min-height: 36px; padding: 0 12px; font-size: 14px; }
.link-knopf { background: none; border: 0; padding: 8px 0; font-weight: 700; text-decoration: underline; cursor: pointer; }

.fab { position: fixed; right: 18px; bottom: calc(22px + var(--unten)); z-index: 15; width: 60px; height: 60px; border: 3px solid var(--ink); background: var(--gelb); font-size: 34px; line-height: 1; font-weight: 400; cursor: pointer; box-shadow: 4px 4px 0 var(--ink); }
@media (max-width: 640px) { .fab { bottom: calc(80px + var(--unten)); } }

/* ---------- Filter ---------- */
.seg { display: flex; border: 3px solid var(--ink); background: var(--weiss); margin-bottom: 12px; }
.seg button { flex: 1; min-height: 40px; border: 0; background: transparent; cursor: pointer; font-weight: 700; font-size: 14px; }
.seg button + button { border-left: 3px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--weiss); }

/* ---------- Aufgabenliste ---------- */
.liste { list-style: none; margin: 0; padding: 0; background: var(--weiss); border: 3px solid var(--ink); }
.aufgabe { display: flex; align-items: flex-start; gap: 4px; border-bottom: 1px solid var(--linie); }
.aufgabe:last-child { border-bottom: 0; }
.haken { flex: 0 0 auto; width: 52px; min-height: 52px; display: flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; }
.haken span { width: 26px; height: 26px; border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; background: var(--weiss); }
.aufgabe.erledigt .haken span { background: var(--ink); }
.aufgabe.erledigt .haken span::after { content: ''; width: 7px; height: 13px; border: solid var(--weiss); border-width: 0 3px 3px 0; transform: translateY(-2px) rotate(45deg); }
.aufgabe-text { flex: 1; min-width: 0; padding: 10px 12px 10px 0; background: none; border: 0; text-align: left; cursor: pointer; }
.aufgabe-titel { font-weight: 700; overflow-wrap: anywhere; }
.aufgabe.erledigt .aufgabe-titel { text-decoration: line-through; color: var(--grau); }
.aufgabe-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; font-size: 13px; color: var(--grau); }
.marke-ueber { color: var(--rot); font-weight: 700; }
.marke-heute { color: var(--ink); font-weight: 700; }
.etikett { display: inline-block; padding: 1px 6px; background: var(--sand); color: var(--ink); font-weight: 700; font-size: 12px; }
.etikett-block { background: var(--gelb); }

.schnell { display: flex; gap: 8px; margin-bottom: 12px; }
.schnell input { flex: 1; min-width: 0; min-height: 48px; padding: 0 12px; border: 3px solid var(--ink); background: var(--weiss); }

/* ---------- Projekte ---------- */
.projekte { display: grid; gap: 10px; }
.projekt-karte { display: block; padding: 14px 16px; background: var(--weiss); border: 3px solid var(--ink); text-decoration: none; }
.projekt-karte h2 { font-size: 17px; overflow-wrap: anywhere; }
.projekt-karte .aufgabe-meta { margin-top: 6px; }
.balken { height: 6px; background: var(--sand); margin-top: 10px; }
.balken div { height: 100%; background: var(--ink); }
.personen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- Fenster (Sheets) ---------- */
dialog.sheet { border: 0; padding: 0; width: min(640px, 100%); max-height: 92vh; margin: auto auto 0; background: var(--weiss); border-top: 3px solid var(--ink); }
@media (min-width: 641px) { dialog.sheet { margin: auto; border: 3px solid var(--ink); } }
dialog.sheet::backdrop { background: rgba(41, 41, 39, .45); }
.sheet-kopf { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: var(--weiss); border-bottom: 3px solid var(--ink); }
.sheet-kopf h2 { font-size: 18px; }
.sheet-inhalt { padding: 16px 16px calc(20px + var(--unten)); display: grid; gap: 14px; }
.zu { width: 40px; height: 40px; border: 0; background: none; font-size: 26px; cursor: pointer; }

.feld { display: grid; gap: 6px; }
.feld > span, .feld legend { font-weight: 700; font-size: 14px; }
.feld input[type=text], .feld input[type=date], .feld select, .feld textarea { width: 100%; min-height: 46px; padding: 8px 10px; border: 3px solid var(--ink); background: var(--weiss); border-radius: 0; }
.feld textarea { min-height: 120px; resize: vertical; }
.feld small { color: var(--grau); }
fieldset.feld { border: 0; padding: 0; margin: 0; }
.auswahl { display: flex; flex-wrap: wrap; gap: 6px; }
.auswahl label { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 3px solid var(--ink); background: var(--weiss); cursor: pointer; font-weight: 600; }
.auswahl input { position: absolute; opacity: 0; pointer-events: none; }
.auswahl label:has(input:checked) { background: var(--ink); color: var(--weiss); }
.auswahl-liste { display: grid; gap: 0; border: 3px solid var(--ink); max-height: 220px; overflow: auto; }
.auswahl-liste label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--linie); cursor: pointer; }
.auswahl-liste label:last-child { border-bottom: 0; }
.auswahl-liste input { width: 20px; height: 20px; accent-color: var(--ink); }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }

.details { background: var(--sand); padding: 12px 14px; overflow-wrap: anywhere; }
.details p { margin: 0 0 8px; }
.details p:last-child, .details ul:last-child { margin-bottom: 0; }
.details ul { margin: 0 0 8px; padding-left: 20px; }

/* ---------- Konto-Menü ---------- */
.menue { display: grid; }
.menue a, .menue button { display: block; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--linie); background: none; text-align: left; text-decoration: none; font-weight: 700; cursor: pointer; width: 100%; }

/* ---------- Meldung ---------- */
.toast { position: fixed; left: 50%; bottom: calc(150px + var(--unten)); transform: translateX(-50%); z-index: 50; max-width: calc(100% - 32px); padding: 12px 16px; background: var(--ink); color: var(--weiss); font-weight: 700; }

/* ---------- Anmeldung ---------- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--sand); }
.login-box { width: min(420px, 100%); background: var(--weiss); border: 3px solid var(--ink); padding: 28px 24px; text-align: center; }
.login-logo { width: 64px; height: 64px; margin: 0 auto 12px; display: block; }
.login-box h1 { text-transform: uppercase; letter-spacing: .12em; margin-bottom: 14px; }
.login-box p { color: var(--grau); }
.hinweis { text-align: left; background: var(--sand); padding: 12px 14px; color: var(--ink) !important; font-size: 14px; }

/* ---------- Tabelle (Verwaltung) ---------- */
.tabelle { width: 100%; border-collapse: collapse; background: var(--weiss); border: 3px solid var(--ink); font-size: 14px; }
.tabelle th, .tabelle td { padding: 10px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
