/* GB Design App – Gestaltung nach dem Logo: Dunkelgrün, Blattgrün, Creme, Rosa, Gelb */
:root {
  --gruen: #284b1b; --gruen-2: #3d6b2c; --blatt: #8dbf6a; --blatt-hell: #e5f0dc;
  --creme: #f4f1e8; --karte: #fffdf8; --rosa: #f2a7a0; --rosa-hell: #fbe6e3; --gelb: #f5c542; --gelb-hell: #fdf3d3;
  --text: #22261f; --grau: #6b6f66; --linie: #e2ddd0; --rot: #b3362c;
  --radius: 14px; --schatten: 0 1px 3px rgba(40, 75, 27, .08), 0 4px 14px rgba(40, 75, 27, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--creme); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-text-size-adjust: 100%; }
body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
h1, h2, h3 { color: var(--gruen); margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
a { color: var(--gruen-2); }
.kopf { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--karte); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 5; }
.kopf-logo { width: 42px; height: 42px; }
.kopf-text { display: flex; flex-direction: column; line-height: 1.15; }
.kopf-text strong { color: var(--gruen); font-size: 1.05rem; letter-spacing: .04em; }
.kopf-text span { color: var(--grau); font-size: .82rem; }
.marke { margin-left: auto; background: var(--gelb); color: var(--text); font-weight: 700; font-size: .75rem; padding: 3px 8px; border-radius: 99px; }
main { max-width: 860px; margin: 0 auto; padding: 16px; }
.laden { color: var(--grau); text-align: center; margin-top: 40px; }
.karte { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten); padding: 16px; margin-bottom: 14px; }
.raster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.zahl { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten); padding: 12px; }
.zahl .l { color: var(--grau); font-size: .8rem; } .zahl .w { font-size: 1.15rem; font-weight: 700; color: var(--gruen); white-space: nowrap; }
.zahl.neg .w { color: var(--rot); }
@media (max-width: 520px) { .raster { grid-template-columns: 1fr 1fr; } .raster .zahl:last-child { grid-column: span 2; } }
.knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.btn { appearance: none; border: 1px solid var(--linie); background: var(--karte); color: var(--gruen); font: inherit; font-weight: 600; padding: 10px 14px; border-radius: 11px; cursor: pointer; min-height: 44px; }
.btn:hover { border-color: var(--blatt); }
.btn.primaer { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.btn.primaer:hover { background: var(--gruen-2); }
.btn.warn { color: var(--rot); border-color: #e8c1bc; }
.btn.klein { min-height: 34px; padding: 6px 10px; font-size: .88rem; }
.btn:disabled { opacity: .5; cursor: default; }
.hinweis { border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: .94rem; border: 1px solid transparent; }
.hinweis.gelb { background: var(--gelb-hell); border-color: #f1dc9a; }
.hinweis.rot { background: var(--rosa-hell); border-color: #efc2bc; }
.hinweis.gruen { background: var(--blatt-hell); border-color: #cfe2bf; }
.hinweis strong { display: block; margin-bottom: 2px; }
.hinweis .btn { margin-top: 8px; }
.ampel { display: flex; align-items: center; gap: 10px; }
.ampel .punkt { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.punkt.gruen { background: var(--blatt); } .punkt.gelb { background: var(--gelb); } .punkt.rot { background: var(--rot); }
meter { width: 100%; height: 12px; margin: 8px 0 2px; }
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; gap: 10px; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--linie); cursor: pointer; }
.liste li:last-child { border-bottom: 0; }
.liste .info { flex: 1; min-width: 0; }
.liste .t1 { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste .t2 { color: var(--grau); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste .betrag { font-weight: 700; white-space: nowrap; }
.betrag.e { color: var(--gruen-2); } .betrag.a { color: var(--text); }
.storniert .t1, .storniert .betrag { text-decoration: line-through; color: var(--grau); }
.leer { color: var(--grau); text-align: center; padding: 20px 0; }
table.tab { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tab th, .tab td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tab th { color: var(--grau); font-weight: 600; font-size: .82rem; }
.tab .r { text-align: right; white-space: nowrap; }
.tab tr.summe td { font-weight: 700; border-top: 2px solid var(--gruen); }
.tab tr.gruppe td { color: var(--gruen); font-weight: 700; padding-top: 14px; }
.tabwrap { overflow-x: auto; }
.filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filter select, .filter input { flex: 1 1 140px; }
label { display: block; font-size: .86rem; color: var(--grau); margin: 10px 0 4px; font-weight: 600; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px 11px; border: 1px solid var(--linie); border-radius: 10px; background: #fff; color: var(--text); min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blatt); border-color: var(--blatt); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; margin-right: 6px; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.umschalter { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--creme); padding: 4px; border-radius: 12px; }
.umschalter button { border: 0; background: transparent; font: inherit; font-weight: 600; padding: 10px; border-radius: 9px; color: var(--grau); cursor: pointer; }
.umschalter button.an { background: var(--karte); color: var(--gruen); box-shadow: var(--schatten); }
.klein { font-size: .84rem; color: var(--grau); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; word-break: break-all; }
.leiste { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--karte); border-top: 1px solid var(--linie); padding-bottom: env(safe-area-inset-bottom); z-index: 6; }
.leiste button { border: 0; background: none; font: inherit; font-size: .72rem; color: var(--grau); padding: 8px 2px 9px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; min-height: 56px; }
.leiste .ic { font-size: 1.25rem; line-height: 1; }
.leiste button.aktiv { color: var(--gruen); font-weight: 700; }
.modal { position: fixed; inset: 0; background: rgba(34, 38, 31, .45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.dialog { background: var(--karte); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .modal { align-items: center; } .dialog { border-radius: 18px; } }
.dialog-kopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dialog-kopf h2 { margin: 0; }
.x { border: 0; background: none; font-size: 1.6rem; color: var(--grau); cursor: pointer; padding: 4px 8px; }
.dialog .knoepfe { margin-top: 16px; justify-content: flex-end; }
.fehler { color: var(--rot); font-weight: 600; margin-top: 10px; }
#toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--gruen); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: .93rem; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; max-width: 90vw; }
#toast.an { opacity: 1; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 10px; font-size: .92rem; }
.kv dt { color: var(--grau); } .kv dd { margin: 0; word-break: break-word; }
.beleg-bild { max-width: 100%; border-radius: 10px; margin-top: 8px; border: 1px solid var(--linie); }
details summary { cursor: pointer; color: var(--gruen); font-weight: 600; }

/* OneDrive-Status */
.marke.od { border: 0; cursor: pointer; background: var(--creme); color: var(--gruen); }
.marke + .marke.od, .marke[hidden] + .marke.od { margin-left: 6px; }
.marke[hidden] + .marke.od { margin-left: auto; }
.marke.od.fehler, .marke.od.abgemeldet, .marke.od.konflikt { background: var(--gelb); color: var(--text); }
.od-status.fehler, .od-status.konflikt { color: #9b2c2c; font-weight: 600; }
.od-status.ok { color: var(--gruen); }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- 0.3.0: Anmeldung, Tresor, Seitenleiste ---------- */
.tor { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.tor[hidden], #app[hidden] { display: none; }
body:has(#app[hidden]) { padding-bottom: 0; }
.tor-karte { background: var(--karte); border-radius: 18px; box-shadow: var(--schatten); padding: 22px 18px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
.tor-karte h2 { text-align: center; margin-bottom: 2px; }
.tor-karte p { margin: 0; }
.tor-logo { width: 120px; height: auto; align-self: center; }
.btn.breit { width: 100%; }
.tor-notweg { margin-top: 6px; font-size: .92rem; }
.tor-notweg p { margin: 8px 0; }
.tor-demo { text-align: center; }
.tor-karte input[type=password] { width: 100%; }
body.verdeckt #app { visibility: hidden; }

.menue-knopf { border: 0; background: none; font-size: 1.4rem; color: var(--gruen); padding: 4px 6px; cursor: pointer; min-width: 40px; min-height: 40px; }
.seite { background: var(--karte); }
.seite nav { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; }
.m-punkt { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; font: inherit; color: var(--text); padding: 10px 12px; border-radius: 10px; cursor: pointer; text-decoration: none; min-height: 42px; }
.m-punkt:hover { background: var(--creme); }
.m-punkt.aktiv { background: var(--blatt-hell); color: var(--gruen); font-weight: 700; }
.m-punkt .ic, .m-gruppe summary .ic { width: 22px; text-align: center; color: var(--gruen); }
.m-gruppe summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; min-height: 42px; }
.m-gruppe summary::-webkit-details-marker { display: none; }
.m-gruppe summary::after { content: "›"; margin-left: auto; transition: transform .15s; color: var(--grau); }
.m-gruppe[open] summary::after { transform: rotate(90deg); }
.m-gruppe summary:hover { background: var(--creme); }
.m-gruppe .m-punkt { padding-left: 42px; font-size: .95rem; }
.m-fuss { padding: 6px 20px 16px; }
.schleier { display: none; }
@media (max-width: 899px) {
  .seite { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 84vw); z-index: 15; overflow-y: auto; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--schatten); padding-top: env(safe-area-inset-top); }
  body.menue-auf .seite { transform: none; }
  body.menue-auf .schleier { display: block; position: fixed; inset: 0; background: rgba(34, 38, 31, .35); z-index: 14; }
  .menue-knopf { display: none; }
}
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .leiste { display: none; }
  .rahmen { display: grid; grid-template-columns: 260px 1fr; align-items: start; }
  .seite { position: sticky; top: 63px; height: calc(100vh - 63px); overflow-y: auto; border-right: 1px solid var(--linie); }
  .menue-knopf { display: none; }
  #toast { bottom: 24px; }
}
.marke.od.veraltet { background: var(--rosa); color: var(--text); }
.od-status.veraltet { color: #9b2c2c; font-weight: 600; }
.klein-marke { font-size: .7rem; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }
.bk-liste li { cursor: default; flex-wrap: wrap; }
.punkte { margin: 4px 0 10px; padding-left: 20px; }
.punkte li { margin-bottom: 4px; }
.aend { border-bottom: 1px solid var(--linie); padding: 8px 0; }
.aend summary { font-weight: 400; color: var(--text); }
.roadmap { padding: 8px 0; border-bottom: 1px solid var(--linie); }
.roadmap .t1 { font-weight: 600; }
.rot { color: var(--rot); }
.kv { margin: 10px 0; }

/* Schnellzugriff (Etsy, LUCID, Lizenzero) als abgesetzte Knöpfe */
.link-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 4px 0 12px; }
.link-knopf { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); background: var(--creme); border: 1px solid var(--linie); border-radius: 14px; padding: 12px 14px; min-height: 60px; font: inherit; text-align: left; cursor: pointer; box-shadow: 0 1px 2px rgba(40, 75, 27, .06); transition: border-color .15s, box-shadow .15s, transform .15s; }
.link-knopf:hover { border-color: var(--blatt); box-shadow: var(--schatten); transform: translateY(-1px); }
.link-knopf:active { transform: none; }
.link-knopf:focus-visible { outline: 3px solid var(--blatt); outline-offset: 2px; }
.lk-ic { flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--karte); border: 1px solid var(--linie); display: grid; place-items: center; font-size: 1.15rem; }
.lk-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.lk-t { font-weight: 700; color: var(--gruen); }
.lk-s { font-size: .82rem; color: var(--grau); }
.lk-pfeil { flex: none; color: var(--grau); font-size: .95rem; }
.m-links { display: flex; flex-direction: column; gap: 6px; margin: 4px 8px 10px; padding: 10px; background: var(--creme); border: 1px solid var(--linie); border-radius: 14px; }
.link-knopf.klein { background: var(--karte); padding: 8px 10px; min-height: 44px; gap: 10px; border-radius: 11px; }
.link-knopf.klein .lk-ic { width: 30px; height: 30px; font-size: 1rem; border-radius: 8px; }
.link-knopf.klein .lk-t { font-size: .95rem; }

/* =====================================================================
   0.3.0 Gestaltung nach Firmen-App (buennagel-app.de) in GB-Farben:
   großes Logo in der Seitenleiste, Seitenkopf mit Titel und Aktionen,
   kompakte Knöpfe mit Symbol, Statusanzeige unten in der Seitenleiste
   ===================================================================== */
:root { --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; --radius-sm: 9px; --flaeche-2: #f1ede2; --flaeche-3: #e9e3d4; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: .005em; }
.karte { border: 1px solid #ece6d8; box-shadow: 0 1px 2px rgba(40, 75, 27, .05); padding: 18px 18px 16px; }
.karte h2 { font-size: 1.12rem; }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; min-height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--linie); background: var(--flaeche-2); color: var(--text); font-weight: 500; font-size: .93rem; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--flaeche-3); border-color: var(--linie); }
.btn.primaer { background: var(--gruen); border-color: var(--gruen); color: #fff; font-weight: 600; }
.btn.primaer:hover { background: var(--gruen-2); border-color: var(--gruen-2); }
.btn.warn { background: transparent; color: var(--rot); border-color: rgba(179, 54, 44, .35); }
.btn.warn:hover { background: var(--rosa-hell); }
.btn.klein { min-height: 32px; padding: 5px 10px; font-size: .85rem; }
.btn svg, .pill svg, .sortier-reihe svg, .app-konto svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-reihe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.knoepfe { gap: 8px; }

/* Seitenkopf */
.seiten-kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 18px; flex-wrap: wrap; margin: 4px 0 6px; }
.seiten-kopf h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; color: var(--gruen); }
.seiten-kopf .sub { color: var(--grau); font-size: .92rem; margin-top: 3px; }
.zier-linie { height: 2px; background: linear-gradient(90deg, var(--gruen) 0, var(--rosa) 38%, transparent 100%); opacity: .6; margin: 10px 0 20px; border-radius: 2px; }
@media (max-width: 899px) { .seiten-kopf h1 { font-size: 1.35rem; } .seiten-kopf .btn-reihe { width: 100%; } .seiten-kopf .btn-reihe .btn { flex: 1 1 auto; } }

/* Kopf (nur Handy) mit größerem Logo */
.kopf-logo { width: 58px; height: auto; }
.kopf { padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px; }
@media (min-width: 900px) { .kopf { display: none; } .seite { top: 0; height: 100vh; } main { padding: 26px 32px 60px; max-width: 1040px; } }

/* Seitenleiste: Logo oben, Status unten */
.seite { display: flex; flex-direction: column; }
.seite nav { flex: 1; }
.seite-logo { padding: 22px 20px 14px; border-bottom: 1px solid var(--linie); text-align: center; }
.seite-logo img { width: 170px; max-width: 100%; height: auto; display: block; margin: 0 auto; }
.seite-name { font-family: var(--serif); color: var(--grau); font-size: .9rem; margin-top: 4px; letter-spacing: .02em; }
@media (max-width: 899px) { .seite-logo img { width: 130px; } }
.status-fuss { padding: 14px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linie); font-size: .8rem; color: var(--grau); }
.pillen { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: .76rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--linie); background: transparent; color: var(--grau); white-space: nowrap; cursor: default; }
button.pill { cursor: pointer; }
.pill svg { width: 13px; height: 13px; }
.pill.ok { color: #3d7a2a; border-color: rgba(61, 122, 42, .4); background: var(--blatt-hell); }
.pill.laeuft { color: #8a6a12; border-color: rgba(245, 197, 66, .6); background: var(--gelb-hell); }
.pill.aus, .pill.warn { color: #8a6a12; border-color: rgba(217, 164, 65, .5); background: var(--gelb-hell); }
.pill.fehler { color: var(--rot); border-color: rgba(179, 54, 44, .4); background: var(--rosa-hell); }
.app-version { margin-top: 2px; }
.app-konto { display: flex; align-items: center; gap: 5px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-konto svg { width: 13px; height: 13px; }
.m-fuss { display: none; }

/* Sortieren */
.sortier-reihe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -2px 0 12px; }
.sortier-reihe .klein { display: inline-flex; align-items: center; gap: 5px; margin-right: 2px; }
.sortier-reihe .klein svg { width: 14px; height: 14px; }
.chip { font: inherit; font-size: .82rem; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--linie); background: var(--karte); color: var(--text); cursor: pointer; }
.chip:hover { border-color: var(--blatt); }
.chip.an { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.tor-logo { width: 190px; }
