/* Herstellerunterlagen — Grundgestalt
 *
 * Nur, was jede Ansicht braucht. Farben und Schriften kommen aus der
 * Firmen-Identitaet, Hell/Dunkel aus /shared/dark-mode.css.
 */

:root {
    --ci-blau:   #0080C9;
    --ci-orange: #DC500F;
    --akzent:    #A16207;   /* Ocker — Kopfzeile, aktive Auswahl, Hauptknopf */
    --akzent-text: #8A5206; /* Ocker für Text und Linien auf hellem Grund */
    --akzent-hell: #fbf3e2;

    --grund:     #ffffff;
    --flaeche:   #f5f7f9;
    --rand:      #e2e8f0;
    --text:      #1a202c;
    --text-leise:#5a6b7c;

    --radius: 10px;
    --kopf-hoehe: 52px;
    --seitenleiste-breite: 232px;
    --seitenleiste-schmal: 56px;
}

html.dark, [data-theme="dark"] {
    --akzent-text: #E3A93C;
    --akzent-hell: #2a2214;
    --grund:     #12171d;
    --flaeche:   #1a212a;
    --rand:      #2c3742;
    --text:      #e8edf2;
    --text-leise:#9aa9b8;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--grund);
    color: var(--text);
    font-family: 'Open Sans', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

h1, h2, h3 { font-family: 'Montserrat', system-ui, sans-serif; font-weight: 700; }
h1 { font-size: 1.6rem; margin: 0 0 .3em; }
h2 { font-size: 1.2rem; margin: 1.4em 0 .5em; }
code, pre { font-family: 'Fira Code', monospace; }

/* Erst sichtbar, wenn jemand mit der Tastatur navigiert. */
.sprungmarke {
    position: absolute; left: -999px;
    background: var(--akzent); color: #fff; padding: 10px 16px; z-index: 100;
}
.sprungmarke:focus { left: 8px; top: 8px; }

:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

/* ── Kopfzeile: links Navigation, Mitte Aktionen, rechts Person ────── */
.kopf {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; height: var(--kopf-hoehe); padding: 0 14px;
    background: var(--akzent); color: #fff;
    position: sticky; top: 0; z-index: 20;
}
.kopf-links, .kopf-mitte, .kopf-rechts { display: flex; align-items: center; gap: 8px; }
.kopf-titel { font-family: 'Montserrat', sans-serif; font-weight: 700; white-space: nowrap; }

.kopf-knopf {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0;
    background: rgba(255,255,255,.14); color: #fff;
    border: 1px solid rgba(255,255,255,.24); border-radius: 8px;
    cursor: pointer; transition: background .16s ease;
}
.kopf-knopf:hover { background: rgba(255,255,255,.26); }
/* App-Icon (HDR) im Kopf wie im PPS: 36 px, ohne Knopfrahmen */
.kopf-knopf.kopf-app-icon { width: 36px; height: 36px; background: transparent; border: 0; border-radius: 8px; overflow: hidden; transition: transform .16s ease; }
.kopf-knopf.kopf-app-icon:hover { background: transparent; transform: scale(1.05); }
.kopf-app-favicon { width: 36px; height: 36px; object-fit: contain; display: block; }

.kopf-benutzer {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 9px;
    background: rgba(255,255,255,.2); border-radius: 8px;
    font-weight: 600; font-size: .82rem;
}
.kopf-benutzer:empty { display: none; }   /* ohne Anmeldung kein leeres Feld */
.kopf-uhr { display: flex; flex-direction: column; line-height: 1.15; font-size: .74rem; opacity: .9; }

/* ── Seitenleiste, einklappbar ─────────────────────────────────────── */
.rumpf { display: flex; min-height: calc(100vh - var(--kopf-hoehe) - 34px); }

.seitenleiste {
    width: var(--seitenleiste-breite); flex-shrink: 0;
    background: var(--flaeche); border-right: 1px solid var(--rand);
    padding: 12px 8px; transition: width .18s ease;
    overflow: hidden;
}
.seitenleiste.schmal { width: var(--seitenleiste-schmal); }
.seitenleiste.schmal .nav-text { display: none; }

.nav-eintrag {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; margin-bottom: 2px; border-radius: 8px;
    color: var(--text); text-decoration: none; white-space: nowrap;
}
.nav-eintrag:hover { background: rgba(0,0,0,.05); }
html.dark .nav-eintrag:hover, [data-theme="dark"] .nav-eintrag:hover { background: rgba(255,255,255,.07); }
.nav-eintrag.aktiv { background: var(--akzent); color: #fff; }
.nav-icon { display: inline-flex; flex-shrink: 0; }

/* ── Inhalt ────────────────────────────────────────────────────────── */
.inhalt { flex: 1; min-width: 0; padding: 20px 24px; max-width: 1200px; }
.ansicht[hidden] { display: none; }

.hero {
    display: flex; align-items: center; gap: 22px;
    background: var(--flaeche); border: 1px solid var(--rand);
    border-radius: var(--radius); padding: 20px; margin-bottom: 22px;
}
.hero-bild { width: 190px; height: auto; border-radius: var(--radius); flex-shrink: 0; }
.hero-text p { color: var(--text-leise); margin: 0; }

.karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.karte {
    background: var(--flaeche); border: 1px solid var(--rand);
    border-radius: var(--radius); padding: 15px;
}
.karte h3 { margin: 0 0 .35em; font-size: 1rem; }

/* Leerer Zustand sagt, was zu tun ist — keine leere Flaeche. */
.leer-zustand { text-align: center; padding: 44px 16px; color: var(--text-leise); }
.leer-hinweis { font-size: .88rem; }

/* Statusmarken statt Statuswoerter im Satz */
.marke {
    display: inline-block; padding: 2px 9px; border-radius: 8px;
    font-size: .78rem; font-weight: 600;
}
.marke-gut    { background: #d1fae5; color: #065f46; }
.marke-warnung{ background: #fef3c7; color: #92400e; }
.marke-schlecht{ background: #fee2e2; color: #991b1b; }

.fuss {
    display: flex; justify-content: space-between; gap: 12px;
    align-items: center; height: 34px; padding: 0 16px; border-top: 1px solid var(--rand);
    color: var(--text-leise); font-size: .8rem;
}

.dialog { border: none; border-radius: var(--radius); padding: 22px; max-width: 620px; }
.dialog::backdrop { background: rgba(0,0,0,.45); }

/* ── Handy ─────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .seitenleiste {
        position: fixed; top: var(--kopf-hoehe); bottom: 0; left: 0; z-index: 15;
        transform: translateX(-100%);
    }
    .seitenleiste.offen { transform: none; }
    .inhalt { padding: 14px; }
    .hero { flex-direction: column; text-align: center; }
    .hero-bild { width: 100%; max-width: 300px; }
    .kopf-uhr { display: none; }
}

/* Schmales Handy (390 px): Kopf passt ohne waagerechtes Scrollen — Titel weg, Abstände enger (Abnahme AP-14). */
@media (max-width: 480px) {
    .kopf { gap: 6px; padding: 0 8px; }
    .kopf-links, .kopf-mitte, .kopf-rechts { gap: 5px; min-width: 0; }
    .kopf-titel, .kopf-benutzer { display: none; }   /* Kürzel entfällt auf schmalen Handys */
    .kopf-knopf { width: 32px; height: 32px; flex-shrink: 0; }
    .kopf-knopf.kopf-app-icon, .kopf-app-favicon { width: 32px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ══ Herstellerunterlagen: Ansichten (Gerüst) ═══════════════════════ */
.ansicht-intro { color: var(--text-leise); margin: 0 0 18px; }

/* Kennzahlenkarten im Start */
.karte { display: flex; flex-direction: column; gap: 2px; border-top: 3px solid var(--akzent); }
.karte-label { font-size: .78rem; font-weight: 600; color: var(--akzent-text); text-transform: uppercase; letter-spacing: .04em; }
.karte-wert { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1.8rem; line-height: 1.2; }
.karte-text { font-size: .85rem; color: var(--text-leise); }

.leer-icon { display: inline-flex; color: var(--akzent-text); opacity: .75; margin-bottom: 6px; }
.leer-zustand { border: 1px dashed var(--rand); border-radius: var(--radius); margin-top: 18px; }
.leer-zustand p { margin: .2em 0; }
.leer-zustand p:not(.leer-hinweis) { color: var(--text); font-weight: 600; }
.leer-hinweis { max-width: 46ch; margin-left: auto !important; margin-right: auto !important; }

.marke-neutral { background: var(--flaeche); color: var(--text-leise); border: 1px solid var(--rand); }
html.dark .marke-gut, [data-theme="dark"] .marke-gut { background: #12372a; color: #8de0b9; }
html.dark .marke-warnung, [data-theme="dark"] .marke-warnung { background: #3b2d0c; color: #f3cd7a; }
html.dark .marke-schlecht, [data-theme="dark"] .marke-schlecht { background: #46181a; color: #f5a3a3; }
.dienststatus { margin: 18px 0 0; font-size: .85rem; }

.nav-eintrag.aktiv { background: var(--akzent); color: #fff; }

/* Filterchips (Artikel) */
.chipleiste { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 4px 12px; border: 1px solid var(--rand); border-radius: 999px;
    background: var(--flaeche); font-size: .84rem; color: var(--text-leise);
}

/* Artikelmaske: immer dasselbe Gerüst */
.maske { border: 1px solid var(--rand); border-radius: var(--radius); background: var(--flaeche); overflow: hidden; }
.maske-kopf { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--rand); }
.ring { color: var(--akzent); display: inline-flex; }
.maske-titel { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1.1rem; }
.maske-sub { color: var(--text-leise); font-size: .85rem; }
.maske-spalten { display: grid; grid-template-columns: 1fr 1.8fr 1fr; }
.zone { padding: 14px 16px; border-right: 1px solid var(--rand); min-height: 150px; }
.zone:last-child { border-right: none; }
.zone h2 { margin: 0 0 .4em; font-size: .9rem; color: var(--akzent-text); }
.zone-leer { margin: 0; color: var(--text-leise); font-size: .88rem; }
.zone-buehne { background: var(--grund); }

/* Neue Suche */
.suchformular { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.suchformular label { display: flex; flex-direction: column; gap: 4px; font-size: .84rem; font-weight: 600; color: var(--text-leise); }
.suchformular input {
    min-width: 200px; padding: 8px 10px; font: inherit; color: var(--text);
    background: var(--grund); border: 1px solid var(--rand); border-radius: 8px;
}
.suchformular .oder { color: var(--text-leise); padding-bottom: 9px; font-size: .85rem; }
.knopf-haupt {
    padding: 9px 18px; font: inherit; font-weight: 600; color: #fff;
    background: var(--akzent); border: none; border-radius: 8px; cursor: pointer;
}
.knopf-haupt:disabled, .suchformular input:disabled { opacity: .55; cursor: not-allowed; }

@media (max-width: 760px) {
    .maske-spalten { grid-template-columns: 1fr; }
    .zone { border-right: none; border-bottom: 1px solid var(--rand); min-height: 0; }
    .suchformular input { min-width: 0; width: 100%; }
    .suchformular label, .suchformular .knopf-haupt { width: 100%; }
}

/* Anmelde-Leiste (H-6): erscheint nur ohne gültige Anmeldung, über jeder Ansicht. */
.anmelde-leiste {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin: 0 0 18px; padding: 14px 16px;
    background: var(--akzent-hell); color: var(--text);
    border: 1px solid var(--rand); border-left: 4px solid var(--akzent); border-radius: var(--radius);
}
.anmelde-icon { display: inline-flex; color: var(--akzent-text); }
.anmelde-text { flex: 1 1 260px; }
.anmelde-text p { margin: 0; }
.anmelde-titel { font-weight: 600; color: var(--akzent-text); }
