/* Illgen Kundenportal – gemeinsame Gestaltung.
   Regel: Bereichs-Dateien (shop.css, kunde.css, illgen.css) nutzen nur Klassen mit eigenem Präfix
   (shop-, kd-, il-), damit nichts eine Grundklasse überschreibt. */
:root {
  --rot: #c2102a; --rot-dunkel: #9c0c21; --rot-hell: #fbe8eb;
  --grau: #575656; --text: #222; --leise: #6b6b6b; --linie: #e4e4e4;
  --flaeche: #f5f5f4; --karte: #fff; --gruen: #1d7a46; --gruen-hell: #e3f3ea;
  --gelb: #9a6700; --gelb-hell: #fff4d6; --blau: #1f5d99; --blau-hell: #e6f0fa;
  --radius: 10px; --schatten: 0 1px 2px rgba(0,0,0,.06), 0 1px 8px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--flaeche); color: var(--text);
       font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--rot); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }
img { max-width: 100%; }

/* ---------- Rahmen ---------- */
.kopf { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--linie);
        display: flex; align-items: center; gap: 14px; padding: 8px 16px; min-height: 58px; }
.kopf .marke img { height: 36px; display: block; }
.kopf .kundenlogo { height: 30px; max-width: 140px; object-fit: contain; }
.kopf .trenner { width: 1px; height: 28px; background: var(--linie); }
.kopf .titel { font-weight: 600; color: var(--grau); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf .rechts { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.symbolknopf { position: relative; display: inline-flex; align-items: center; justify-content: center;
               min-width: 40px; height: 40px; border-radius: 8px; color: var(--grau); padding: 0 8px; }
.symbolknopf:hover { background: var(--flaeche); text-decoration: none; }
.symbolknopf svg { width: 22px; height: 22px; }
.zaehler { position: absolute; top: 2px; right: 0; background: var(--rot); color: #fff; font-size: 11px;
           font-weight: 700; border-radius: 9px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 4px; }
.menueknopf { display: none; }

.hinweisleiste { background: var(--gelb-hell); color: var(--gelb); padding: 8px 16px; font-size: 14px;
                 display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid #f0dca0; }

.rahmen { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 58px); }
.seitenleiste { background: #fff; border-right: 1px solid var(--linie); padding: 14px 10px; }
.seitenleiste .abschnitt { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
                           color: var(--leise); margin: 16px 10px 6px; }
.seitenleiste .abschnitt:first-child { margin-top: 2px; }
.seitenleiste a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
                  color: var(--text); font-size: 14.5px; }
.seitenleiste a:hover { background: var(--flaeche); text-decoration: none; }
.seitenleiste a.aktiv { background: var(--rot-hell); color: var(--rot); font-weight: 600; }
.seitenleiste a .anz { margin-left: auto; background: var(--rot); color: #fff; border-radius: 9px;
                       font-size: 11px; font-weight: 700; padding: 0 6px; line-height: 18px; }
.inhalt { padding: 22px 26px 60px; max-width: 1280px; width: 100%; }
.seitenkopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
              flex-wrap: wrap; margin-bottom: 18px; }
.seitenkopf .unter { color: var(--leise); font-size: 14px; }
.brotkrume { font-size: 13px; color: var(--leise); margin-bottom: 6px; }
.brotkrume a { color: var(--leise); }

@media (max-width: 900px) {
  .rahmen { grid-template-columns: minmax(0, 1fr); }
  .seitenleiste { display: none; position: fixed; inset: 58px 0 0 0; z-index: 30; overflow-y: auto; border: 0; }
  .seitenleiste.offen { display: block; }
  .menueknopf { display: inline-flex; }
  .inhalt { padding: 16px 16px 90px; }
  .kopf .titel, .kopf .trenner { display: none; }
  .kopf .marke img { height: 30px; }
}

/* ---------- Bausteine ---------- */
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius);
         padding: 16px 18px; box-shadow: var(--schatten); }
.karte + .karte { margin-top: 14px; }
.karte .kartenkopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.raster { display: grid; gap: 14px; }
.raster.zwei { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.raster.drei { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.raster.vier { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .raster.zwei, .raster.drei { grid-template-columns: minmax(0, 1fr); } .raster.vier { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.kennzahl { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; }
.kennzahl .wert { font-size: 26px; font-weight: 700; line-height: 1.1; }
.kennzahl .name { color: var(--leise); font-size: 13px; }
.kennzahl.warn .wert { color: var(--rot); }
a.kennzahl { color: inherit; display: block; }
a.kennzahl:hover { border-color: var(--rot); text-decoration: none; }

.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--linie);
         background: #fff; color: var(--text); border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 14px;
         font-weight: 600; cursor: pointer; min-height: 38px; white-space: nowrap; }
.knopf:hover { border-color: #bbb; text-decoration: none; }
.knopf.haupt { background: var(--rot); border-color: var(--rot); color: #fff; }
.knopf.haupt:hover { background: var(--rot-dunkel); }
.knopf.gruen { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.knopf.gefahr { color: var(--rot); }
.knopf.klein { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.knopf.breit { width: 100%; }
.knopf[disabled] { opacity: .5; cursor: not-allowed; }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.marke-status { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600;
                background: var(--flaeche); color: var(--grau); white-space: nowrap; }
.marke-status.WARTET, .marke-status.OFFEN, .marke-status.gelb { background: var(--gelb-hell); color: var(--gelb); }
.marke-status.BESTELLT, .marke-status.IN_ARBEIT, .marke-status.BEI_ILLGEN, .marke-status.blau { background: var(--blau-hell); color: var(--blau); }
.marke-status.TEILGELIEFERT, .marke-status.GELIEFERT { background: #efe7fb; color: #5b3a99; }
.marke-status.ERLEDIGT, .marke-status.gruen { background: var(--gruen-hell); color: var(--gruen); }
.marke-status.ABGELEHNT, .marke-status.STORNIERT, .marke-status.rot { background: var(--rot-hell); color: var(--rot); }

table.liste { width: 100%; border-collapse: collapse; font-size: 14px; }
table.liste th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--leise);
                 font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
table.liste td { padding: 9px 10px; border-bottom: 1px solid var(--linie); vertical-align: top; }
table.liste tr:last-child td { border-bottom: 0; }
table.liste tr.klickbar { cursor: pointer; }
table.liste tr.klickbar:hover td { background: #fafafa; }
table.liste .zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabellenrahmen { overflow-x: auto; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); }
.leise { color: var(--leise); }
.klein { font-size: 13px; }
.fett { font-weight: 600; }
.leer { text-align: center; color: var(--leise); padding: 36px 12px; }

/* Formulare */
.formular { display: grid; gap: 14px; }
.formular.zwei { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .formular.zwei { grid-template-columns: minmax(0, 1fr); } }
.feld label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--grau); }
.feld .hilfe { font-size: 12.5px; color: var(--leise); margin-top: 3px; }
.feld .fehler { font-size: 13px; color: var(--rot); margin-top: 3px; }
.feld.breit { grid-column: 1 / -1; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search],
input[type=tel], input[type=url], select, textarea {
  width: 100%; font: inherit; font-size: 15px; padding: 9px 11px; border: 1px solid #cfcfcf; border-radius: 8px;
  background: #fff; color: var(--text); min-height: 40px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--rot-hell); border-color: var(--rot); }
.haken { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; }
.haken input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--rot); }
.mehrfach { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 14px; }
.filterleiste { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filterleiste input[type=search] { max-width: 320px; }
.filterleiste select { width: auto; }

.meldung { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14.5px; border: 1px solid; }
.meldung.success { background: var(--gruen-hell); color: var(--gruen); border-color: #b9e0c8; }
.meldung.error { background: var(--rot-hell); color: var(--rot); border-color: #f2c3ca; }
.meldung.warning, .meldung.info { background: var(--gelb-hell); color: var(--gelb); border-color: #f0dca0; }

.balken { height: 10px; background: #ececec; border-radius: 6px; overflow: hidden; }
.balken > span { display: block; height: 100%; background: var(--gruen); border-radius: 6px; }
.balken.warn > span { background: #e0a100; }
.balken.voll > span { background: var(--rot); }

.reiter { display: flex; gap: 4px; border-bottom: 1px solid var(--linie); margin-bottom: 16px; overflow-x: auto; }
.reiter a { padding: 9px 14px; color: var(--grau); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent;
            white-space: nowrap; }
.reiter a.aktiv { color: var(--rot); border-bottom-color: var(--rot); }
.reiter a:hover { text-decoration: none; color: var(--text); }

.zeitleiste { list-style: none; padding: 0; margin: 0; }
.zeitleiste li { padding: 6px 0 6px 18px; border-left: 2px solid var(--linie); position: relative; font-size: 14px; }
.zeitleiste li::before { content: ""; position: absolute; left: -6px; top: 12px; width: 10px; height: 10px;
                         border-radius: 50%; background: #fff; border: 2px solid var(--rot); }

.unterschrift { border: 2px dashed #bbb; border-radius: 10px; background: #fff; touch-action: none;
                width: 100%; height: 180px; display: block; }

.artikelbild { width: 56px; height: 56px; object-fit: contain; background: #fff; border: 1px solid var(--linie);
               border-radius: 8px; flex-shrink: 0; }
.platzhalterbild { width: 56px; height: 56px; border-radius: 8px; background: var(--flaeche); display: flex;
                   align-items: center; justify-content: center; color: #bbb; flex-shrink: 0; }

/* Anmeldung */
.anmeldeseite { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
                background: linear-gradient(160deg, #fff 0%, var(--flaeche) 100%); }
.anmeldekarte { width: 100%; max-width: 400px; }
.anmeldekarte .logo { display: block; height: 52px; margin: 0 auto 18px; }

/* Druck (Lieferschein, Ausgabebeleg) */
@media print {
  .kopf, .seitenleiste, .hinweisleiste, .nicht-drucken, .meldung { display: none !important; }
  .rahmen { display: block; } .inhalt { padding: 0; max-width: none; }
  body { background: #fff; } .karte { box-shadow: none; border: 0; padding: 0; }
}

/* Zweispaltige Seite: Hauptteil + Seitenspalte (bricht auf dem Handy um) */
.raster.seite { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; }
@media (max-width: 900px) { .raster.seite { grid-template-columns: minmax(0, 1fr); } }
.raster > .karte + .karte { margin-top: 0; }
/* Breite Tabellen scrollen innerhalb der Karte statt die ganze Seite zu verbreitern (Handy) */
.karte { overflow-x: auto; }
