/* MSW OS — gemeinsames Token-CSS (increment-7-design)
   Offizielle CI-Werte (Wabnik_CI-Vorgaben_v2, UngerDesign 2016):
   Grünverlauf #799D2E→#C3D226 · Blauverlauf #2E67B0→#009FE3 · Anthrazit #3C3C3B
   Schrift Roboto Light/Medium. Mobil-first, große Tippflächen. */
:root {
  --gruen: #799d2e;
  --gruen-2: #c3d226;
  --blau: #2e67b0;
  --blau-2: #009fe3;
  --blau-dunkel: #2e67b0;
  --anthrazit: #3c3c3b;
  --tinte: #262625;
  --tinte-schwach: #6f6f6d;
  --papier: #f4f5f7;
  --karte: #ffffff;
  --linie: #e4e3e0;
  --gruen-hell: #eef4dc;
  --blau-hell: #e4f2fc;
  --gelb-hell: #fdf3e0;
  --rot: #b3261e;
  --rot-hell: #f9e0de;
  --verlauf-blau: linear-gradient(135deg, #2e67b0, #009fe3);
  --verlauf-gruen: linear-gradient(135deg, #799d2e, #c3d226);
  --radius: 12px;
  --schatten: 0 1px 2px rgba(60, 60, 59, 0.06), 0 4px 16px rgba(60, 60, 59, 0.07);
}

/* CI-Schriften: Roboto Light (Fließtext) + Medium (Auszeichnung) */
@font-face {
  font-family: "Roboto";
  src: url("schriften/Roboto-Light.ttf") format("truetype");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("schriften/Roboto-LightItalic.ttf") format("truetype");
  font-weight: 300; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("schriften/Roboto-Medium.ttf") format("truetype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("schriften/Roboto-MediumItalic.ttf") format("truetype");
  font-weight: 500; font-style: italic; font-display: swap;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 300;
  background: var(--papier);
  color: var(--tinte);
  font-size: 16px;
  line-height: 1.5;
}

/* Kopf: weiß mit Logo (Home), Navigation, Benutzer */
header.app-kopf {
  background: var(--karte);
  border-bottom: 1px solid var(--linie);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo-link { display: flex; align-items: center; flex-shrink: 0; }
.logo-bild { height: 30px; width: auto; display: block; }
nav.haupt-nav {
  display: flex;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
nav.haupt-nav a {
  color: var(--tinte-schwach);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
}
nav.haupt-nav a:hover { background: var(--papier); color: var(--tinte); }
nav.haupt-nav a.aktiv {
  color: var(--blau-dunkel);
  background: var(--blau-hell);
  font-weight: 500;
}
.benutzer {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: var(--anthrazit);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.benutzer:hover { background: var(--blau-dunkel); }

main { max-width: 760px; margin: 0 auto; padding: 16px 16px 56px; }
h1.seitentitel { font-size: 22px; margin: 6px 0 14px; letter-spacing: -0.2px; }

.karte {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 16px;
  margin-bottom: 14px;
}

button, .knopf {
  font: inherit;
  font-weight: 500;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  min-height: 44px;
  background: var(--anthrazit);
  color: #fff;
  cursor: pointer;
  transition: filter .12s ease;
}
button:hover { filter: brightness(1.12); }
button.akzent { background: var(--verlauf-blau); }
button.gruen { background: var(--verlauf-gruen); }
button.leise {
  background: transparent;
  color: var(--blau-dunkel);
  border: 1px solid var(--linie);
  font-weight: 500;
}
button.leise:hover { background: var(--blau-hell); filter: none; }
button.klein { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 8px; }
button:disabled { opacity: 0.45; cursor: default; }

input, select, textarea {
  font: inherit;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: #fff;
  margin: 4px 0 12px;
  color: var(--tinte);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--blau);
  outline-offset: 0;
  border-color: var(--blau);
}
label { font-size: 13px; font-weight: 500; color: var(--tinte-schwach); }

.status {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  padding: 3px 10px;
  background: var(--linie);
  color: var(--tinte);
  white-space: nowrap;
}
.status.angelegt      { background: #ececec; }
.status.beauftragt    { background: var(--blau-hell); color: var(--blau-dunkel); }
.status.terminiert    { background: var(--gelb-hell); color: #8a5a00; }
.status.in_arbeit     { background: var(--gelb-hell); color: #8a5a00; }
.status.geleistet     { background: var(--gruen-hell); color: #4a7212; }
.status.abgerechnet   { background: var(--gruen-hell); color: #4a7212; }
.status.abgeschlossen { background: #e6e6e6; color: #555; }
.status.storniert     { background: var(--rot-hell); color: var(--rot); }
.status.entwurf       { background: #ececec; }
.status.freigegeben   { background: var(--blau-hell); color: var(--blau-dunkel); }
.status.erfasst       { background: #ececec; }
.status.gebucht       { background: var(--gelb-hell); color: #8a5a00; }
.status.bezahlt       { background: var(--gruen-hell); color: #4a7212; }
.status.offen         { background: var(--gelb-hell); color: #8a5a00; }
.status.erledigt      { background: var(--gruen-hell); color: #4a7212; }

.leer-hinweis { text-align: center; color: var(--tinte-schwach); padding: 32px 16px; }
.fehler { color: var(--rot); font-size: 14px; margin: 8px 0; }
.zeile { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.wachsen { flex: 1 1 160px; }
small, .klein-text { font-size: 13px; color: var(--tinte-schwach); }
ul.schlicht { list-style: none; padding: 0; margin: 8px 0; }
ul.schlicht li { padding: 8px 0; border-bottom: 1px solid var(--linie); }
ul.schlicht li:last-child { border-bottom: 0; }
a { color: var(--blau-dunkel); }

/* Startbildschirm: Bereichs-Kacheln */
h2.bereich-titel {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tinte-schwach);
  margin: 22px 0 10px;
}
.kachel-gitter {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.kachel {
  display: block;
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 14px;
  text-decoration: none;
  color: var(--tinte);
}
a.kachel:hover { border-color: var(--blau-2); box-shadow: 0 4px 18px rgba(46,103,176,.18); }
.kachel.bald { opacity: 0.55; }
.kachel-name { font-weight: 500; margin-bottom: 2px; }
.kachel .status { margin-top: 8px; }

/* Handy: untere Tab-Leiste, oben nur Logo + Benutzer */
nav.tab-leiste {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--karte);
  border-top: 1px solid var(--linie);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 20;
}
nav.tab-leiste a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--tinte-schwach);
  text-decoration: none;
  padding: 4px 2px;
  border-radius: 8px;
  min-height: 44px;
  justify-content: center;
}
nav.tab-leiste a.aktiv { color: var(--blau-dunkel); background: var(--blau-hell); }
.tab-symbol { font-size: 19px; line-height: 1; }
@media (max-width: 640px) {
  nav.haupt-nav { display: none; }
  nav.tab-leiste { display: flex; }
  main { padding-bottom: 92px; }
  footer.app-fuss { padding-bottom: 84px; }
  header.app-kopf { gap: 8px; justify-content: space-between; }
}

footer.app-fuss {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 24px;
  font-size: 12px;
  color: var(--tinte-schwach);
  display: flex;
  gap: 8px;
  align-items: center;
}
footer.app-fuss a { cursor: pointer; text-decoration: underline; color: inherit; }
pre.changelog {
  white-space: pre-wrap;
  font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--papier);
  border-radius: 8px;
  padding: 12px;
  max-height: 50vh;
  overflow: auto;
}
strong, b, h1, h2, h3 { font-weight: 500; }
