/* Klemmbausteindave Buchhaltung – ruhiges Banking-Layout */
:root {
  --bg: #f4f4f6;
  --side: #f4f4f6;
  --karte: #ffffff;
  --text: #16161a;
  --grau: #6e6e76;
  --grau2: #9a9aa2;
  --linie: #e9e9ed;
  --hover: #ebebee;
  --aktiv: #e4e4e8;
  --schwarz: #16161a;
  --blau: #2f6bff;
  --gruen: #138a4b;
  --rot: #d0342c;
  --gelb: #b7791f;
  --r: 22px;
  --font: "Inter", "SF Pro Text", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
.zahl, td.num, .num { font-variant-numeric: tabular-nums; }

/* Rahmen */
.rahmen { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.seite { padding: 40px 48px 64px; max-width: 1180px; width: 100%; min-width: 0; }
.tabelle-wrap { overflow-x: auto; }
.leiste { background: var(--side); border-right: 1px solid var(--linie); padding: 22px 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.marke { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; font-weight: 700; letter-spacing: .01em; font-size: 15px; text-transform: uppercase; }
.marke-bild { display: block; width: 100%; max-width: 180px; height: auto; }
.anmelde-karte .marke-bild { max-width: 240px; }
.marke-logo { width: 30px; height: 30px; border-radius: 8px; background: var(--schwarz); display: grid; place-items: center; flex: none; }
.marke-logo i { display: block; width: 14px; height: 10px; background: #fff; border-radius: 2px; position: relative; }
.marke-logo i::before, .marke-logo i::after { content: ""; position: absolute; top: -3px; width: 4px; height: 3px; background: #fff; border-radius: 1px 1px 0 0; }
.marke-logo i::before { left: 2px; } .marke-logo i::after { right: 2px; }
.nav { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 14px; color: var(--text); font-size: 15.5px; }
.nav svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.6; flex: none; color: #4a4a52; }
.nav:hover { background: var(--hover); }
.nav.aktiv { background: var(--aktiv); font-weight: 600; }
.nav-abstand { flex: 1; }
.nutzer { border-top: 1px solid var(--linie); margin-top: 10px; padding: 14px 14px 4px; font-size: 13.5px; color: var(--grau); }
.nutzer b { display: block; color: var(--text); font-weight: 600; font-size: 14px; }
.nutzer a { color: var(--grau); text-decoration: underline; text-underline-offset: 2px; }

/* Typografie */
h1 { font-size: 34px; line-height: 1.15; margin: 0 0 22px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 21px; margin: 0 0 18px; font-weight: 700; }
h3 { font-size: 16px; margin: 0 0 10px; font-weight: 600; }
.klein { font-size: 13px; color: var(--grau); }
.grau { color: var(--grau); }

/* Aktionen */
.aktionen { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 22px; }
.knopf { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 999px; border: 0; background: #e8e8ec; color: var(--text); font: 600 14.5px var(--font); cursor: pointer; white-space: nowrap; }
.knopf:hover { background: #dedee3; }
.knopf.primaer { background: var(--schwarz); color: #fff; }
.knopf.primaer:hover { background: #33333a; }
.knopf.rand { background: transparent; border: 1.5px solid #d6d6dc; }
.knopf.rand:hover { background: var(--hover); }
.knopf.klein { padding: 6px 14px; font-size: 13.5px; }
.knopf svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Karten */
.raster { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 20px; }
.karte { background: var(--karte); border-radius: var(--r); padding: 28px 30px; }
.karte + .karte { margin-top: 20px; }
.raster > .karte + .karte { margin-top: 0; }
.karte-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.karte-kopf h2 { margin: 0; }
.betrag-gross { font-size: 40px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 18px; font-variant-numeric: tabular-nums; }
.zeile { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; }
.zeile + .zeile { border-top: 1px solid var(--linie); }
.zeile .num { font-weight: 500; white-space: nowrap; }
.tabelle td.num { white-space: nowrap; }
.punkt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.mini-icon { width: 38px; height: 38px; border-radius: 11px; background: #f0f0f3; display: grid; place-items: center; flex: none; }
.mini-icon svg { width: 19px; height: 19px; stroke: #3c3c44; fill: none; stroke-width: 1.7; }
.posten { display: flex; align-items: center; gap: 14px; }

/* Tabellen */
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th { text-align: left; font-weight: 500; font-size: 13px; color: var(--grau); padding: 0 12px 10px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.tabelle td { padding: 13px 12px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle tbody tr.klickbar { cursor: pointer; }
.tabelle tbody tr.klickbar:hover td { background: #fafafb; }
.tabelle .num, .tabelle th.num { text-align: right; }
.tabelle td:first-child, .tabelle th:first-child { padding-left: 0; }
.tabelle td:last-child, .tabelle th:last-child { padding-right: 0; }
.sku { white-space: nowrap; font: 600 13px ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .02em; }

/* Status-Marken */
.marke-s { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: #efeff2; color: #45454d; white-space: nowrap; }
.s-eingekauft { background: #fff4dd; color: #8a5a00; }
.s-unterwegs { background: #fbefe3; color: #9a4b0b; }
.s-vereinnahmt { background: #e6eeff; color: #2149b8; }
.s-verkauft { background: #e5f6ec; color: #0f6e3b; }
.s-ausbezahlt { background: #efeff2; color: #55555d; }
.s-storniert { background: #fde8e7; color: #a3241d; }
.hinweis { background: #fff8e6; color: #7a5200; padding: 12px 16px; border-radius: 14px; font-size: 14px; margin-bottom: 18px; }
.hinweis.ok { background: #e8f6ee; color: #0f6e3b; }
.hinweis.fehler { background: #fde8e7; color: #a3241d; }

/* Filter */
.filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.chip { padding: 7px 14px; border-radius: 999px; background: #fff; font-size: 14px; border: 1px solid var(--linie); }
.chip.aktiv { background: var(--schwarz); color: #fff; border-color: var(--schwarz); }
.suche { flex: 1; min-width: 220px; max-width: 360px; }

/* Formulare */
.formular { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 18px; }
.feld { display: flex; flex-direction: column; gap: 6px; }
.feld.breit { grid-column: 1 / -1; }
.feld label { font-size: 13px; color: var(--grau); font-weight: 500; }
input, select, textarea { font: 15px var(--font); color: var(--text); padding: 11px 14px; border-radius: 12px; border: 1.5px solid #dedee4; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--schwarz); }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { width: auto; }
.feld .hilfe { font-size: 12.5px; color: var(--grau2); }
.feld .fehlertext, .errorlist { color: var(--rot); font-size: 13px; margin: 0; padding: 0; list-style: none; }
.formular-fuss { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.setzeilen td { padding: 6px 8px 6px 0; border: 0; }
.setzeilen input, .setzeilen select { padding: 9px 11px; }
.ergebnis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 20px; }
.ergebnis div { background: #f6f6f8; border-radius: 14px; padding: 14px 16px; }
.ergebnis b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }

/* Anmeldung */
.anmelde-seite { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.anmelde-karte { background: #fff; border-radius: 28px; padding: 40px; width: 100%; max-width: 420px; }
.anmelde-karte .marke { padding: 0 0 26px; }
.anmelde-karte h1 { font-size: 26px; margin-bottom: 8px; }
.anmelde-karte form { display: grid; gap: 14px; margin-top: 22px; }
.anmelde-karte .knopf { justify-content: center; padding: 13px; }

.leer { color: var(--grau); padding: 26px 0; text-align: center; }
.zweispaltig { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
dl.daten { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; margin: 0; }
dl.daten dt { color: var(--grau); font-size: 14px; }
dl.daten dd { margin: 0; }
.pos { color: var(--gruen); } .neg { color: var(--rot); }

@media (max-width: 900px) {
  .rahmen { grid-template-columns: 1fr; }
  .leiste { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 10px; border-right: 0; border-bottom: 1px solid var(--linie); }
  .marke { padding: 6px 10px; flex: none; }
  .marke-bild { width: auto; height: 30px; }
  .nav { padding: 9px 12px; }
  .nav span, .nav-abstand, .nutzer { display: none; }
  .seite { padding: 24px 18px 48px; }
  .zweispaltig { grid-template-columns: 1fr; }
  h1 { font-size: 27px; }

}

.stoerung-band { display: block; font-weight: 600; }
.zaehler { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--rot); color: #fff; font-size: 11.5px; line-height: 18px; text-align: center; }
.stoerung-details { white-space: pre-wrap; font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: #f6f6f8; padding: 10px 12px; border-radius: 10px; max-height: 220px; overflow: auto; margin-top: 8px; }
