:root {
  --blau: #0b4f8a;
  --blau-hell: #e8eef5;
  --text: #1d2430;
  --grau: #5b6573;
  --linie: #d5dbe3;
  --hinter: #f4f6f9;
  --weiss: #ffffff;
  --rot: #b00020;
  --gruen: #1e7b1e;
  --schatten: 0 1px 3px rgba(0, 0, 0, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text); background: var(--hinter);
  min-height: 100vh; display: flex; flex-direction: column;
}
.versteckt { display: none !important; }
h1 { font-size: 1.5rem; margin: 0 0 .8rem; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
a { color: var(--blau); }
.klein { font-size: .85rem; color: var(--grau); }
.hinweis { color: var(--grau); white-space: pre-line; }
.fehler { color: var(--rot); min-height: 1.2em; margin: .5rem 0 0; }
.vorformatiert { white-space: pre-line; }
.r { text-align: right; }

/* Kopf */
#kopf { background: var(--blau); color: var(--weiss); }
.kopf-innen { max-width: 1200px; margin: 0 auto; padding: .7rem 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.firma { font-weight: 700; font-size: 1.1rem; }
.titel { font-size: .9rem; opacity: .85; }
.nav { display: flex; gap: .3rem; flex-wrap: wrap; }
.navknopf { background: transparent; color: var(--weiss); border: 1px solid rgba(255,255,255,.35);
  border-radius: 6px; padding: .4rem .7rem; font: inherit; font-size: .95rem; cursor: pointer; }
.navknopf:hover, .navknopf.aktiv { background: rgba(255,255,255,.18); }
.navknopf.leise { border-color: transparent; opacity: .85; }
.zahl { display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: 1em;
  background: var(--weiss); color: var(--blau); font-weight: 700; font-size: .8rem; text-align: center; }

/* Inhalt */
#inhalt { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.2rem 16px 2rem; }
.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: 10px;
  padding: 1.1rem 1.2rem; margin-bottom: 1rem; box-shadow: var(--schatten); }
.karte.schmal { max-width: 460px; margin: 1.5rem auto; }
label { display: block; margin: .55rem 0; font-size: .92rem; color: var(--grau); }
input, textarea, select { display: block; width: 100%; margin-top: .25rem; padding: .55rem .65rem;
  font: inherit; color: var(--text); border: 1px solid var(--linie); border-radius: 6px; background: var(--weiss); }
input:focus, textarea:focus { outline: 2px solid var(--blau); outline-offset: 0; border-color: var(--blau); }
button.haupt { background: var(--blau); color: var(--weiss); border: 0; border-radius: 6px;
  padding: .6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; margin-top: .6rem; }
button.haupt:hover { filter: brightness(1.1); }
button.haupt:disabled { opacity: .5; cursor: default; }
button.gross { font-size: 1.05rem; padding: .8rem 1.4rem; }
button.zweit { background: var(--weiss); color: var(--blau); border: 1px solid var(--blau);
  border-radius: 6px; padding: .4rem .7rem; font: inherit; cursor: pointer; }
button.loeschen { background: none; border: 0; color: var(--rot); cursor: pointer; font-size: 1.1rem; }
.haken { display: flex; gap: .5rem; align-items: flex-start; color: var(--text); }
.haken input { width: auto; margin-top: .25rem; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
details { margin: .6rem 0; }
summary { cursor: pointer; color: var(--blau); }

/* Katalog */
.katalog { display: grid; grid-template-columns: 240px 1fr; gap: 1.2rem; }
.gruppen { background: var(--weiss); border: 1px solid var(--linie); border-radius: 10px;
  padding: .9rem; align-self: start; box-shadow: var(--schatten); }
.gruppen ul { list-style: none; margin: 0; padding: 0; }
.gruppen li button { width: 100%; text-align: left; background: none; border: 0; padding: .35rem .4rem;
  font: inherit; font-size: .93rem; color: var(--text); border-radius: 5px; cursor: pointer; }
.gruppen li button:hover { background: var(--blau-hell); }
.gruppen li button.aktiv { background: var(--blau); color: var(--weiss); }
.gruppen li.e1 button { padding-left: 1.2rem; }
.gruppen li.e2 button { padding-left: 2rem; }
.gruppen li.e3 button, .gruppen li.e4 button, .gruppen li.e5 button { padding-left: 2.6rem; }
.suchzeile input { margin-top: 0; }
.artikelliste { display: grid; gap: .6rem; margin-top: .6rem; }
.artikel { background: var(--weiss); border: 1px solid var(--linie); border-radius: 10px; padding: .8rem 1rem;
  display: grid; grid-template-columns: 72px 1fr auto; gap: .9rem; align-items: center; box-shadow: var(--schatten); }
.artikel .bild { width: 72px; height: 72px; border-radius: 6px; background: var(--hinter);
  display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--grau); font-size: .75rem; }
.artikel .bild img { max-width: 100%; max-height: 100%; object-fit: contain; }
.artikel .nr { font-size: .8rem; color: var(--grau); }
.artikel .bez { font-weight: 600; }
.artikel .bez2 { font-size: .88rem; color: var(--grau); white-space: pre-line; }
.artikel .marken { margin-top: .2rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.marke-k { font-size: .75rem; border-radius: 4px; padding: .05rem .4rem; background: var(--blau-hell); color: var(--blau); }
.marke-k.gruen { background: #e5f3e5; color: var(--gruen); }
.marke-k.grau { background: #eceff3; color: var(--grau); }
.artikel .kauf { text-align: right; min-width: 170px; }
.artikel .preis { font-size: 1.15rem; font-weight: 700; }
.artikel .einheit { font-size: .8rem; color: var(--grau); }
.artikel .mengenzeile { display: flex; gap: .4rem; justify-content: flex-end; margin-top: .4rem; }
.artikel .mengenzeile input { width: 5.5rem; margin: 0; text-align: right; }
.artikel .mengenzeile button { margin: 0; padding: .45rem .7rem; }
.staffel { font-size: .78rem; color: var(--grau); }

/* Tabellen */
.tabelle { width: 100%; border-collapse: collapse; background: var(--weiss); border: 1px solid var(--linie);
  border-radius: 10px; overflow: hidden; box-shadow: var(--schatten); }
.tabelle th, .tabelle td { padding: .55rem .7rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle th { background: var(--blau-hell); text-align: left; font-size: .88rem; }
.tabelle td input { width: 6rem; margin: 0 0 0 auto; text-align: right; }
.summen { margin: .8rem 0 1rem auto; max-width: 380px; background: var(--weiss); border: 1px solid var(--linie);
  border-radius: 10px; padding: .7rem 1rem; }
.summen div { display: flex; justify-content: space-between; padding: .15rem 0; }
.summen .gesamt { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--linie); margin-top: .3rem; padding-top: .4rem; }
.hinweise { color: var(--rot); }

/* Fuß, Dialog, Toast */
.fuss { text-align: center; padding: 1rem 16px 1.4rem; display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; font-size: .9rem; }
.dialog { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.dialog-innen { background: var(--weiss); border-radius: 10px; max-width: 760px; width: 100%; max-height: 85vh; overflow: auto; padding: 1.2rem 1.4rem; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--weiss);
  padding: .6rem 1rem; border-radius: 8px; z-index: 20; max-width: calc(100% - 32px); }

@media (max-width: 760px) {
  .katalog { grid-template-columns: 1fr; }
  .gruppen ul { display: flex; flex-wrap: wrap; gap: .3rem; }
  .gruppen li button { padding: .3rem .6rem !important; border: 1px solid var(--linie); }
  .artikel { grid-template-columns: 56px 1fr; }
  .artikel .bild { width: 56px; height: 56px; }
  .artikel .kauf { grid-column: 1 / -1; text-align: left; min-width: 0; }
  .artikel .mengenzeile { justify-content: flex-start; }
  .tabelle th:nth-child(3), .tabelle td:nth-child(3) { display: none; }
  #belegtabelle th:nth-child(4), #belegtabelle td:nth-child(4),
  #belegtabelle th:nth-child(2), #belegtabelle td:nth-child(2) { display: none; }
}
.tabelle th.r, .tabelle td.r { text-align: right; }
