/* Purpurwerk Büro – Oberfläche im Purpurwerk-Design (Grau, Schwarz, Purpur, Schibsted Grotesk) */
@font-face { font-family: 'Schibsted Grotesk'; src: url('schrift/schibsted-grotesk.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
:root {
  --grund: #E3E3E3; --hell: #F1F1F0; --weiss: #FBFBFA; --schwarz: #0C0C0D; --text: #1B1B1D; --leise: #57575B; --matt: #8A8A8F;
  --linie: #D6D6D4; --purpur: #86209A; --purpur-tief: #6A1580; --purpur-hauch: #F1E4F4; --limette: #A3D11B; --limette-hauch: #EAF4CC;
  --rot: #B3261E; --rot-hauch: #F8E2E0; --gelb-hauch: #FBEFC8; --gelb: #7A5A00;
  --rund: 22px; --weich: cubic-bezier(.2, .7, .2, 1); --unten: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--grund); color: var(--text); font: 16px/1.5 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--purpur); }
h1, h2, h3 { margin: 0; color: var(--schwarz); font-weight: 500; letter-spacing: -.015em; line-height: 1.15; }
strong, b { font-weight: 600; }
:focus-visible { outline: 3px solid var(--purpur); outline-offset: 2px; }

/* Anmeldung */
.anmeldung { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
.anmeldung form { width: min(400px, 100%); background: var(--weiss); border-radius: 30px; padding: 40px 30px 30px; text-align: center; box-shadow: 0 50px 90px -60px rgba(12, 12, 13, .5); }
.anmeldung img { width: 150px; height: auto; }
.anmeldung h1 { font-size: 28px; font-weight: 400; margin: 10px 0 24px; }
.meldung { min-height: 1.5em; margin: 12px 0 0; font-size: 14px; color: var(--rot); }

/* Rahmen */
.rahmen { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100svh; }
.seite { position: sticky; top: 0; height: 100svh; overflow-y: auto; padding: 26px 16px 20px; display: flex; flex-direction: column; gap: 2px; }
.seite .marke { display: flex; align-items: center; gap: 12px; padding: 0 10px 22px; font-weight: 500; font-size: 20px; letter-spacing: -.01em; color: var(--schwarz); }
.seite .marke img { width: 44px; height: auto; }
.seite button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: 0; border-radius: 14px; background: none; text-align: left; font-weight: 450; color: var(--leise); cursor: pointer; transition: background .2s, color .2s; }
.seite button:hover { background: rgba(12, 12, 13, .06); color: var(--schwarz); }
.seite button[aria-current="page"] { background: var(--schwarz); color: #fff; }
.seite button svg, .leiste button svg { width: 20px; height: 20px; flex: none; }
.seite .luecke { flex: 1; min-height: 16px; }
.inhalt { padding: 34px clamp(18px, 4vw, 54px) 120px; max-width: 1240px; width: 100%; outline: none; }
.leiste { display: none; }

.kopfzeile { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 18px; margin-bottom: 26px; }
.kopfzeile h1 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 400; letter-spacing: -.025em; flex: 1 1 auto; }
.kopfzeile .unter { flex: 1 0 100%; margin: -6px 0 0; color: var(--leise); max-width: 70ch; }
.werkzeug { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Suche und Filter */
.filter .zeitraum { display: inline-flex; align-items: center; gap: 6px; }
.filter .eingabe { min-height: 42px; padding: 8px 12px; }
@media (max-width: 860px) { .filter > input[type="search"], .filter > select { width: 100% !important; } .filter .zeitraum { flex: 1; } .filter .zeitraum input { flex: 1; min-width: 0; } }

/* Knöpfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 22px; border: 0; border-radius: 999px; background: var(--schwarz); color: #fff; font-weight: 500; cursor: pointer; text-decoration: none; transition: background .2s, transform .15s var(--weich); white-space: nowrap; }
.knopf:hover { background: #2E2E31; }
.knopf:active { transform: scale(.97); }
.knopf[disabled] { opacity: .5; cursor: default; }
.knopf--purpur { background: var(--purpur); }
.knopf--purpur:hover { background: var(--purpur-tief); }
.knopf--leise { background: rgba(12, 12, 13, .08); color: var(--schwarz); }
.knopf--leise:hover { background: rgba(12, 12, 13, .15); }
.knopf--rot { background: var(--rot-hauch); color: var(--rot); }
.knopf--rot:hover { background: #F2CFCC; }
.knopf--breit { width: 100%; }
.knopf--klein { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.wahlreihe { display: flex; flex-wrap: wrap; gap: 6px; }
.wahlreihe button { min-height: 40px; padding: 7px 16px; border: 0; border-radius: 999px; background: rgba(12, 12, 13, .07); font-weight: 450; font-size: 14.5px; color: var(--leise); cursor: pointer; }
.wahlreihe button[aria-pressed="true"] { background: var(--schwarz); color: #fff; }

/* Karten und Listen */
.karte { background: var(--hell); border-radius: var(--rund); padding: 22px 24px; }
.karte--weiss { background: var(--weiss); }
.karte h2 { font-size: 19px; font-weight: 500; margin-bottom: 12px; }
.raster { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 14px; }
.raster--zwei { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.kennzahl .name { font-size: 14px; font-weight: 400; color: var(--leise); }
.kennzahl .wert { font-size: clamp(24px, 2.6vw, 32px); font-weight: 400; letter-spacing: -.025em; color: var(--schwarz); line-height: 1.15; margin-top: 4px; }
.kennzahl .zusatz { font-size: 13.5px; color: var(--leise); margin-top: 2px; }
.liste { display: flex; flex-direction: column; gap: 8px; }
.eintrag { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; width: 100%; padding: 15px 20px; border: 0; border-radius: 18px; background: var(--hell); text-align: left; cursor: pointer; transition: background .2s, transform .2s var(--weich); }
.eintrag:hover { background: var(--weiss); transform: translateY(-1px); }
.eintrag .haupt { font-weight: 500; color: var(--schwarz); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag .neben { grid-column: 1; font-size: 14px; color: var(--leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag .rechts { grid-row: 1 / span 2; grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.eintrag .betrag { font-weight: 500; color: var(--schwarz); white-space: nowrap; }
.eintrag .betrag.minus { color: var(--rot); }
.eintrag .betrag.plus { color: #3F6B00; }
.leer { padding: 34px 24px; border-radius: var(--rund); background: var(--hell); color: var(--leise); text-align: center; }
.leer strong { display: block; color: var(--schwarz); font-size: 18px; font-weight: 500; margin-bottom: 4px; }
.marke-s { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: rgba(12, 12, 13, .08); color: var(--leise); white-space: nowrap; }
.marke-s.gut { background: var(--limette-hauch); color: #3F6B00; }
.marke-s.warn { background: var(--gelb-hauch); color: var(--gelb); }
.marke-s.schlecht { background: var(--rot-hauch); color: var(--rot); }
.marke-s.purpur { background: var(--purpur-hauch); color: var(--purpur-tief); }
.gruppe-titel { margin: 22px 4px 8px; font-size: 14px; font-weight: 500; color: var(--leise); }
.balken { height: 12px; border-radius: 999px; background: rgba(12, 12, 13, .09); overflow: hidden; margin: 12px 0 8px; }
.balken i { display: block; height: 100%; border-radius: 999px; background: var(--limette); transition: width .6s var(--weich); }
.balken.gelb i { background: #E0B000; }
.balken.rot i { background: var(--rot); }
.hinweis { display: flex; gap: 12px; align-items: flex-start; padding: 13px 18px; border-radius: 16px; background: var(--purpur-hauch); color: #3D0F47; font-size: 15px; margin-bottom: 8px; }
.hinweis.warn { background: var(--gelb-hauch); color: #4D3900; }
.hinweis.schlecht { background: var(--rot-hauch); color: #6B1712; }
.hinweis button { margin-left: auto; flex: none; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabelle th { text-align: left; font-size: 13px; color: var(--leise); font-weight: 400; padding: 6px 10px 6px 0; }
.tabelle td { padding: 9px 10px 9px 0; border-top: 1px solid var(--linie); vertical-align: top; }
.tabelle .r { text-align: right; padding-right: 0; white-space: nowrap; }
.tabelle tr.summe td { font-weight: 600; color: var(--schwarz); border-top: 1px solid var(--schwarz); }
.klein { font-size: 14px; color: var(--leise); }
.absatz { margin: 0 0 10px; max-width: 75ch; }

/* Formulare */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 14px; }
.feld { display: block; text-align: left; grid-column: 1 / -1; min-width: 0; }
.feld.halb { grid-column: span 1; }
.feld > span { display: block; font-size: 13.5px; font-weight: 450; color: var(--leise); margin-bottom: 5px; }
.feld small { display: block; font-size: 13px; color: var(--leise); margin-top: 4px; }
.feld input, .feld select, .feld textarea, .eingabe { width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid var(--linie); border-radius: 14px; background: #fff; outline: none; transition: border-color .2s, box-shadow .2s; }
.feld textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.feld input:focus, .feld select:focus, .feld textarea:focus, .eingabe:focus { border-color: var(--purpur); box-shadow: 0 0 0 3px rgba(134, 32, 154, .16); }
.feld input[readonly], .feld textarea[readonly] { background: var(--hell); color: var(--leise); }
.haken { display: flex; gap: 10px; align-items: center; grid-column: 1 / -1; min-height: 44px; font-weight: 450; }
.haken input { width: 22px; height: 22px; accent-color: var(--purpur); }
.form h3, .abschnitt-titel { grid-column: 1 / -1; font-size: 18px; font-weight: 500; margin-top: 12px; }
.positionen { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; }
.position { display: grid; grid-template-columns: minmax(0, 1fr) 80px 96px 120px 40px; gap: 8px; padding: 12px; border-radius: 16px; background: var(--hell); }
.position textarea { grid-column: 1 / -1; min-height: 52px; }
.position .weg { border: 0; border-radius: 12px; background: none; color: var(--leise); cursor: pointer; font-size: 20px; }
.position .weg:hover { background: var(--rot-hauch); color: var(--rot); }
.summenzeile { display: flex; justify-content: space-between; align-items: center; padding: 6px 4px; font-weight: 500; font-size: 18px; color: var(--schwarz); }
.dateien { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dateien a, .dateien .neu { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--purpur-hauch); color: var(--purpur-tief); font-size: 14px; font-weight: 450; text-decoration: none; max-width: 100%; }
.dateien .neu { background: var(--limette-hauch); color: #3F6B00; }
.dateien button.x { border: 0; background: none; cursor: pointer; color: inherit; font-size: 16px; padding: 0 0 0 4px; }

/* Blatt (Bearbeiten) */
.schleier { position: fixed; inset: 0; z-index: 50; background: rgba(12, 12, 13, .42); display: flex; justify-content: flex-end; animation: ein .25s ease both; }
.blatt { width: min(760px, 100%); height: 100%; background: var(--weiss); display: flex; flex-direction: column; border-radius: 30px 0 0 30px; animation: schieb .38s var(--weich) both; }
.blatt > header { display: flex; align-items: center; gap: 12px; padding: 22px 26px 14px; }
.blatt > header h2 { flex: 1; font-size: 24px; font-weight: 400; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; }
.blatt > header .zu { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(12, 12, 13, .07); font-size: 22px; cursor: pointer; flex: none; }
.blatt > .rumpf { flex: 1; overflow-y: auto; padding: 6px 26px 26px; -webkit-overflow-scrolling: touch; }
.blatt > footer { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 26px calc(14px + var(--unten)); border-top: 1px solid var(--linie); }
.blatt > footer .knopf:first-child { margin-right: auto; }
.blatt > footer:empty { display: none; }
.aktionen { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
@keyframes ein { from { opacity: 0; } }
@keyframes schieb { from { transform: translateX(60px); opacity: 0; } }

.hinweise { position: fixed; left: 50%; bottom: calc(26px + var(--unten)); transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(560px, calc(100% - 32px)); pointer-events: none; }
.hinweise div { padding: 13px 20px; border-radius: 18px; background: var(--schwarz); color: #fff; font-weight: 450; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .5); animation: schieb .3s var(--weich) both; white-space: pre-line; pointer-events: auto; }
.hinweise div.fehler { background: var(--rot); }
.qr { image-rendering: pixelated; width: 190px; height: 190px; border-radius: 12px; background: #fff; padding: 8px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 15px; background: var(--hell); padding: 10px 14px; border-radius: 12px; word-break: break-all; }

@media (max-width: 860px) {
  .rahmen { display: block; }
  .seite { display: none; }
  .inhalt { padding: 22px 16px calc(110px + var(--unten)); }
  .leiste { display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(10px + var(--unten)); z-index: 30; background: var(--schwarz); border-radius: 26px; padding: 6px; box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .55); }
  .leiste button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 54px; padding: 7px 2px; border: 0; border-radius: 20px; background: none; color: #B9B9BD; font-size: 10.5px; font-weight: 450; cursor: pointer; min-width: 0; }
  .leiste button[aria-current="page"] { background: #fff; color: var(--schwarz); }
  .blatt { width: 100%; border-radius: 26px 26px 0 0; height: calc(100% - 26px); margin-top: 26px; }
  .schleier { align-items: flex-end; }
  @keyframes schieb { from { transform: translateY(50px); opacity: 0; } }
  .blatt > header { padding: 18px 18px 10px; }
  .blatt > .rumpf { padding: 6px 18px 22px; }
  .blatt > footer { padding: 12px 18px calc(12px + var(--unten)); }
  .blatt > footer .knopf { flex: 1; }
  .position { grid-template-columns: 1fr 1fr 1fr 40px; }
  .position > input:first-child { grid-column: 1 / -1; }
  .form { grid-template-columns: 1fr 1fr; }
  .kopfzeile .werkzeug { width: 100%; }
  .hinweise { bottom: calc(96px + var(--unten)); }
  .eintrag { padding: 14px 16px; }
}
@media (max-width: 430px) { .feld.halb.breit-mobil { grid-column: 1 / -1; } }
@media print { .seite, .leiste, .werkzeug { display: none; } .rahmen { display: block; } }
