/* =====================================================================
   DESIGN DER APP
   ---------------------------------------------------------------------
   Die Seite ist zuerst für das Smartphone gebaut ("Mobile First").
   Auf großen Bildschirmen wird der Inhalt einfach mittig begrenzt.
   ===================================================================== */

/* ---------- Farben an EINER Stelle festlegen (hier anpassen!) ---------- */
:root {
    --farbe-haupt:        #e8590c;   /* Orange: Knöpfe, Kopfleiste */
    --farbe-haupt-dunkel: #c2410c;
    --farbe-hintergrund:  #f5f3f0;
    --farbe-karte:        #ffffff;
    --farbe-text:         #1f2328;
    --farbe-text-leise:   #6b7280;
    --farbe-rand:         #e5e1dc;
    --farbe-gruen:        #15803d;
    --farbe-rot:          #b91c1c;
    --farbe-blau:         #1d4ed8;
    --rundung:            14px;
    --schatten:           0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

/* ---------- Grundeinstellungen ---------- */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--farbe-text);
    background: var(--farbe-hintergrund);
    /* Platz unten für die Navigationsleiste */
    padding-bottom: 90px;
}

a { color: var(--farbe-haupt-dunkel); }
h1 { font-size: 1.5rem; margin: .2em 0 .6em; }
h2 { font-size: 1.15rem; margin: 0 0 .5em; }
img { max-width: 100%; }

/* ---------- Kopfleiste oben ---------- */
.kopfleiste {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--farbe-haupt);
    color: #fff;
}
.logo { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.kopf-name { font-size: .9rem; opacity: .9; }

/* ---------- Inhaltsbereich ---------- */
.inhalt {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
}

/* ---------- Untere Navigation (wie eine App) ---------- */
.navigation {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    display: flex;
    background: #fff;
    border-top: 1px solid var(--farbe-rand);
    padding-bottom: env(safe-area-inset-bottom);   /* iPhone-Balken */
    z-index: 10;
}
.nav-knopf {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 2px;
    font-size: .72rem;
    color: var(--farbe-text-leise);
    text-decoration: none;
}
.nav-symbol { font-size: 1.4rem; line-height: 1.2; }
.nav-knopf.aktiv { color: var(--farbe-haupt); font-weight: 600; }

/* ---------- Karten (weiße Kästen) ---------- */
.karte {
    background: var(--farbe-karte);
    border-radius: var(--rundung);
    box-shadow: var(--schatten);
    padding: 16px;
    margin-bottom: 14px;
}
.karte-hervorgehoben { border: 2px solid var(--farbe-haupt); }
.unterzeile { color: var(--farbe-text-leise); font-size: .9rem; margin: 0; }

/* ---------- Knöpfe ---------- */
.knopf {
    display: inline-block;
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    background: var(--farbe-haupt);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.knopf:hover { background: var(--farbe-haupt-dunkel); }
.knopf-zweit { background: #fff; color: var(--farbe-text); border: 1px solid var(--farbe-rand); }
.knopf-zweit:hover { background: #f3f1ee; }
.knopf-gefahr { background: var(--farbe-rot); }
.knopf-gruen { background: var(--farbe-gruen); }
.knopf-klein { padding: 7px 12px; font-size: .88rem; }
.knopf-breit { display: block; width: 100%; }
.knopf-reihe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.knopf:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Formulare ---------- */
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=date], select, textarea {
    width: 100%;
    padding: 12px;
    font-size: 1rem;            /* 16px verhindert Zoomen auf dem iPhone */
    border: 1px solid var(--farbe-rand);
    border-radius: 10px;
    background: #fff;
    font-family: inherit;
}
textarea { min-height: 100px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--farbe-haupt); border-color: transparent; }
.checkbox-zeile { display: flex; align-items: center; gap: 8px; font-weight: normal; }
.zwei-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.inline-formular { display: inline; }

/* ---------- Meldungen ---------- */
.meldung { padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; font-weight: 500; }
.meldung-erfolg { background: #dcfce7; color: #14532d; }
.meldung-fehler { background: #fee2e2; color: #7f1d1d; }
.meldung-info   { background: #dbeafe; color: #1e3a8a; }

/* ---------- Kleine Abzeichen ("Badges") ---------- */
.abzeichen {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    background: #eee;
}
.abzeichen-gruen { background: #dcfce7; color: #14532d; }
.abzeichen-rot   { background: #fee2e2; color: #7f1d1d; }
.abzeichen-blau  { background: #dbeafe; color: #1e3a8a; }
.abzeichen-grau  { background: #eee;    color: #444; }

/* ---------- Große Verkäufernummer ---------- */
.gross-nummer {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--farbe-haupt);
    line-height: 1;
}

/* ---------- Artikelliste (Karten mit Bild) ---------- */
.artikel-zeile {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 0;
    border-top: 1px solid var(--farbe-rand);
}
.artikel-zeile:first-child { border-top: none; }
.artikel-bild {
    width: 64px; height: 64px;
    flex-shrink: 0;
    border-radius: 10px;
    object-fit: cover;
    background: #f0ede9;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
}
.artikel-info { flex: 1; min-width: 0; }
.artikel-titel { font-weight: 600; overflow-wrap: anywhere; }
.preis { font-weight: 700; white-space: nowrap; }
.artikel-verkauft { opacity: .6; }

/* ---------- Fortschrittsbalken (z.B. 12 von 20 Artikeln) ---------- */
.fortschritt { height: 8px; background: #eee; border-radius: 99px; overflow: hidden; margin: 6px 0; }
.fortschritt > div { height: 100%; background: var(--farbe-haupt); }

/* ---------- Kacheln (Admin-Menü) ---------- */
.kachel-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kachel {
    background: #fff;
    border-radius: var(--rundung);
    box-shadow: var(--schatten);
    padding: 20px 12px;
    text-align: center;
    text-decoration: none;
    color: var(--farbe-text);
    font-weight: 600;
}
.kachel span { display: block; font-size: 2rem; margin-bottom: 4px; }

/* ---------- Tabellen ---------- */
.tabelle-rahmen { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--farbe-rand); text-align: left; vertical-align: top; }
th { color: var(--farbe-text-leise); font-weight: 600; }
.rechts { text-align: right; }
tfoot td { font-weight: 700; border-bottom: none; }

/* ---------- Scanner (Kamera) ---------- */
.scanner-bereich { width: 100%; border-radius: var(--rundung); overflow: hidden; margin-bottom: 10px; }
.scan-eingabe { display: flex; gap: 8px; }
.scan-eingabe input { flex: 1; }

/* ---------- Kasse: große Summe ---------- */
.summe-gross { font-size: 2rem; font-weight: 800; text-align: right; }

/* ---------- Sonstiges ---------- */
.leer { text-align: center; color: var(--farbe-text-leise); padding: 24px 8px; }
.versteckt { display: none; }
.trenner { border: none; border-top: 1px solid var(--farbe-rand); margin: 16px 0; }
.zeilenumbruch { white-space: pre-line; }

/* Beim Ausdrucken (z.B. Abrechnung) Navigation weglassen */
@media print {
    .kopfleiste, .navigation, .knopf, .nicht-drucken { display: none !important; }
    body { background: #fff; padding: 0; }
    .karte { box-shadow: none; padding: 0; }
}

/* Auf größeren Bildschirmen etwas mehr Platz */
@media (min-width: 600px) {
    .kachel-raster { grid-template-columns: repeat(3, 1fr); }
}
