:root {
  --bg: #f4f5f4;
  --karte: #ffffff;
  --text: #1e1e1e;
  --leise: #6b706d;
  --linie: #e6e9e7;
  --gruen: #16904a;
  --mint: #a6f0c4;
  --mint-hell: #eafaf1;
  --rot: #c23b47;
  --rot-hell: #fdeeee;
  --radius: 18px;
  --schatten: 0 1px 2px rgba(20, 30, 25, 0.04), 0 4px 16px rgba(20, 30, 25, 0.04);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; font-size: 15px; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gruen); }
h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; margin: 2px 0 6px; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 2px; display: flex; align-items: center; gap: 8px; }
p { margin: 0 0 8px; }
.leise { color: var(--leise); }
.klein { font-size: 13px; }

/* Sidebar */
.seitenleiste { position: sticky; top: 0; height: 100vh; padding: 22px 16px; display: flex; flex-direction: column; gap: 18px; border-right: 1px solid var(--linie); background: #fbfcfb; }
.marke { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.marke .leise { font-weight: 500; }
.punkt { width: 12px; height: 12px; border-radius: 50%; background: var(--gruen); box-shadow: 0 0 0 4px var(--mint-hell); display: inline-block; }
.links { display: flex; flex-direction: column; gap: 2px; }
.links a { padding: 9px 12px; border-radius: 12px; color: var(--leise); font-weight: 500; }
.links a:hover { background: var(--bg); color: var(--text); }
.links a.aktiv { background: var(--karte); color: var(--text); box-shadow: var(--schatten); }
.seitenleiste .neu { margin-top: 4px; text-align: center; }
.seitenleiste form { margin-top: auto; }
.lokal { margin-top: auto; }

main { padding: 28px 32px 60px; max-width: 1280px; width: 100%; }

/* Header */
.kopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.kopf p { margin: 0; }
.werkzeuge { display: flex; gap: 8px; flex-wrap: wrap; }
.werkzeuge form { margin: 0; }

/* Buttons */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: #1e1e1e; color: #fff; border: 0; border-radius: 12px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.knopf:hover { background: #000; color: #fff; }
.knopf.zweit { background: var(--karte); color: var(--text); box-shadow: inset 0 0 0 1px var(--linie); }
.knopf.zweit:hover { box-shadow: inset 0 0 0 1px #c9cfcb; color: var(--text); }
.knopf.klein { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.textknopf { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: inherit; }
.textknopf:hover { text-decoration: underline; }
.rot { color: var(--rot); }

/* Cards */
.karte { background: var(--karte); border-radius: var(--radius); padding: 20px; box-shadow: var(--schatten); margin-bottom: 18px; }
.spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.spalten > .karte { margin-bottom: 0; }
.spalten.breit-links { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.spalten + .karte, .spalten + section { margin-top: 18px; }
.stapel { display: flex; flex-direction: column; gap: 18px; }
.stapel > .karte { margin: 0; }
.mehr { margin: 12px 0 0; font-size: 14px; }
.mehr a { color: var(--gruen); font-weight: 500; }
.leer { color: var(--leise); margin: 6px 0; }
.hinweis { background: var(--mint-hell); color: #0f5f32; border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-weight: 500; }
.warnung { background: var(--rot-hell); color: var(--rot); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-weight: 500; }

/* Tiles */
.kacheln { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kachel { background: var(--karte); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--schatten); display: flex; flex-direction: column; }
.kachel .wert { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.kachel .name { color: var(--leise); font-size: 13px; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 10%, white); border-radius: 999px; padding: 2px 9px; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.status { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; background: var(--bg); color: var(--leise); white-space: nowrap; }
.status.s-geplant { background: #eef2fd; color: #3c55b8; }
.status.s-fertig { background: var(--mint-hell); color: #0f6f38; }
.status.s-gepostet { background: var(--gruen); color: #fff; }
.status.s-verworfen { background: var(--bg); color: #9aa09c; text-decoration: line-through; }
.status.s-in_arbeit { background: #f3eefc; color: #6c3fb8; }
.status.s-aktiv { background: var(--mint-hell); color: #0f6f38; }
.status.s-aufwaermen { background: #eef2fd; color: #3c55b8; }
.status.s-anlegen { background: var(--bg); color: var(--leise); }
.status.s-pausiert { background: var(--bg); color: #9aa09c; }

/* Post rows */
.liste { display: flex; flex-direction: column; }
.zeile { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 6px; border-radius: 12px; border-top: 1px solid var(--linie); }
.liste > .zeile:first-child, .liste > .mitknopf:first-child .zeile { border-top: 0; }
.zeile:hover { background: #f8faf9; color: inherit; }
.zeile .mitte { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.zeile .oben { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.zeile .hook { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zeile .rechts { display: flex; align-items: center; gap: 12px; }
.aufrufe { display: flex; flex-direction: column; align-items: flex-end; font-weight: 600; line-height: 1.1; }
.aufrufe small { font-weight: 400; color: var(--leise); font-size: 11px; }
.mini { width: 44px; height: 64px; border-radius: 9px; object-fit: cover; background: var(--bg); display: block; }
.mini.ohne { background: linear-gradient(135deg, var(--bg), #e9ecea); }
.gross { width: 100%; max-width: 260px; border-radius: 14px; display: block; margin: 0 auto 12px; }
.mitknopf { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.mitknopf form { margin: 0; }
.mitknopf + .mitknopf .zeile { border-top: 1px solid var(--linie); }
.aufgabe + .aufgabe { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--linie); }
.zahl { font-size: 12px; background: var(--rot-hell); color: var(--rot); border-radius: 999px; padding: 0 8px; }

/* Accounts */
.konten { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.konto { border: 1px solid var(--linie); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.konto:hover { border-color: #c9cfcb; color: inherit; }
.konto .oben { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.konto .werte { display: flex; gap: 16px; margin-top: 8px; }
.konto .werte span { display: flex; flex-direction: column; }
.konto .werte b { font-size: 16px; }
.konto .werte small { color: var(--leise); font-size: 11px; }

/* Week */
.woche { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.tag { background: var(--karte); border-radius: 16px; padding: 10px; min-height: 180px; box-shadow: var(--schatten); display: flex; flex-direction: column; gap: 8px; }
.tag.heute { box-shadow: inset 0 0 0 2px var(--gruen), var(--schatten); }
.tagkopf { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 14px; }
.tagkopf .plus { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; color: var(--leise); }
.tagkopf .plus:hover { background: var(--bg); color: var(--text); }
.frei { margin: 0; }
.karte-post { border: 1px solid var(--linie); border-radius: 12px; padding: 8px 9px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.karte-post:hover { border-color: #c9cfcb; color: inherit; }
.karte-post .zeit { font-weight: 600; }
.karte-post .chip { align-self: flex-start; }
.karte-post .hook { font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.karte-post.s-gepostet { background: var(--mint-hell); border-color: transparent; }
.karte-post.s-idee, .karte-post.s-in_arbeit { border-style: dashed; }

/* Filters and forms */
.filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.kopf .filter { margin: 0; }
input, select, textarea { font: inherit; color: inherit; background: #fff; border: 1px solid var(--linie); border-radius: 11px; padding: 9px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--mint); border-color: var(--gruen); }
.filter input, .filter select { width: auto; min-width: 150px; }
textarea { resize: vertical; }
.formular { display: flex; flex-direction: column; gap: 12px; }
.formular label, .zahlen label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--leise); font-weight: 500; }
.formular label > input, .formular label > select, .formular label > textarea { color: var(--text); font-size: 15px; font-weight: 400; }
.reihe { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.aktionen { display: flex; justify-content: flex-end; }
.checkliste { border: 1px solid var(--linie); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.checkliste legend { font-size: 13px; color: var(--leise); font-weight: 600; padding: 0 4px; }
.formular .haken { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--text); font-size: 14px; font-weight: 400; }
.haken input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--gruen); flex: none; }
.haken.warn { color: var(--rot); font-weight: 500; }
.zahlen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; margin-top: 12px; }
.zahlen input { padding: 7px 9px; }
.details { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; margin: 0; }
.details dt { color: var(--leise); }
.details dd { margin: 0; overflow-wrap: anywhere; }

/* Tables */
.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle th { text-align: left; font-size: 12px; color: var(--leise); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--linie); }
.tabelle td { padding: 8px; border-bottom: 1px solid var(--linie); }
.tabelle tr:last-child td { border-bottom: 0; }
.auswertung .name { font-weight: 500; max-width: 320px; }
.balkenzelle { width: 28%; }
.balken1 { display: block; height: 8px; border-radius: 99px; background: var(--gruen); min-width: 4px; }
.balken { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin-bottom: 8px; }
.balken span { flex: 1; background: var(--mint); border-radius: 4px 4px 0 0; min-height: 4px; }
.balken span:last-child { background: var(--gruen); }

/* Login */
body.anmelden { display: grid; place-items: center; grid-template-columns: 1fr; padding: 16px; }
.login { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--leise); }
.fehler { color: var(--rot); margin: 0; }

/* Narrow screens */
@media (max-width: 1100px) {
  .woche { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .seitenleiste { position: sticky; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; gap: 12px; z-index: 5; border-right: 0; border-bottom: 1px solid var(--linie); overflow-x: auto; }
  .seitenleiste .marke .leise, .seitenleiste form, .lokal { display: none; }
  .links { flex-direction: row; }
  .links a { padding: 7px 10px; white-space: nowrap; }
  .seitenleiste .neu { margin: 0; padding: 7px 12px; }
  main { padding: 18px 16px 48px; }
  .spalten, .spalten.breit-links { grid-template-columns: 1fr; }
  .woche { grid-template-columns: 1fr; }
  .tag { min-height: 0; }
  .reihe { grid-template-columns: 1fr; }
  .zahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zeile .rechts .status { display: none; }
  h1 { font-size: 24px; }
}
