/* =========================================================
   AlpCloud Lagerverwaltung – Farben aus alpcloud.de
   ========================================================= */
:root {
    --ac-dunkel: #300068;
    --ac-cyan: #00DDFF;
    --ac-blau: #0072FF;
    --ac-violett: #7F00FF;
    --ac-magenta: #FF00D4;
    --ac-verlauf: linear-gradient(90deg, var(--ac-cyan), var(--ac-blau) 35%, var(--ac-violett) 70%, var(--ac-magenta));
    --ac-verlauf-button: linear-gradient(90deg, var(--ac-blau), var(--ac-violett));

    --text: #24212f;
    --text-muted: #6b6880;
    --bg: #f4f3f9;
    --card: #ffffff;
    --rand: #e3e0ef;
    --rand-stark: #cbc6de;
    --hover: #f3efff;
    --auswahl: #ebe3ff;

    --erfolg: #12a150;
    --fehler: #e0245e;
    --warnung: #c26a00;

    --radius: 12px;
    --radius-klein: 8px;
    --schatten: 0 1px 2px rgba(48, 0, 104, .06), 0 4px 16px rgba(48, 0, 104, .06);
    --fokus: 0 0 0 3px rgba(0, 114, 255, .25);
}

* { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }

body {
    margin: 0;
    font-family: Montserrat, Arial, sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.45;
}

button, input, select, textarea { font: inherit; color: inherit; }

h2 { font-size: 1.3rem; margin: 0 0 .75rem; font-weight: 700; }
h3 { font-size: 1rem; margin: 1.5rem 0 .75rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--ac-blau); }

.muted { color: var(--text-muted); }
.klein { font-size: .85rem; }

/* ---------- Kopfzeile ---------- */
.topbar {
    background: linear-gradient(90deg, var(--ac-dunkel), #000);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-inner {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 32px;
    min-height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo { height: 46px; }
.brand-title { font-weight: 600; font-size: 1.1rem; letter-spacing: .02em; }

.tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tab {
    position: relative;
    color: rgba(255, 255, 255, .7);
    text-decoration: none;
    font-weight: 500;
    padding: 21px 14px;
    white-space: nowrap;
    transition: color .15s;
}

.tab:hover { color: #fff; }
.tab.aktiv { color: #fff; }
.tab.aktiv::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--ac-verlauf);
}

.brand-line { height: 3px; background: var(--ac-verlauf); }

main {
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px;
}

/* ---------- Karten ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    box-shadow: var(--schatten);
    --pad: 20px;
    padding: var(--pad);
}

.card-kopf {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}
.card-kopf h2 { margin-bottom: 2px; }

.form-card { max-width: 760px; margin: 0 auto; }
.form-card.breit { max-width: 1100px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-klein);
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s, background-color .15s, border-color .15s, opacity .15s;
}

.btn:focus-visible, .icon-btn:focus-visible, .link-btn:focus-visible { outline: none; box-shadow: var(--fokus); }
.btn:disabled { opacity: .55; cursor: wait; }

.btn-primary { background: var(--ac-verlauf-button); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(.92); }

.btn-secondary { background: #fff; border-color: var(--rand-stark); color: var(--ac-dunkel); }
.btn-secondary:hover:not(:disabled) { background: var(--hover); border-color: var(--ac-violett); }

.btn-danger { background: #fff; border-color: var(--fehler); color: var(--fehler); }
.btn-danger:hover:not(:disabled) { background: var(--fehler); color: #fff; }

.icon-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}
.icon-btn:hover { background: var(--hover); color: var(--fehler); }

.link-btn {
    border: none;
    background: none;
    padding: 4px 0;
    color: var(--ac-blau);
    cursor: pointer;
    font-size: .85rem;
    font-weight: 500;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- Formulare ---------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}
.form-grid .voll { grid-column: 1 / -1; }

.feld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.feld label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

input[type="text"], input[type="number"], input[type="search"], textarea {
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--rand-stark);
    border-radius: var(--radius-klein);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }

input:focus, textarea:focus {
    outline: none;
    border-color: var(--ac-blau);
    box-shadow: var(--fokus);
}

input::placeholder, textarea::placeholder { color: #a9a5bb; }

input[type="file"] { font-size: .9rem; }

.hinweis { font-size: .8rem; color: var(--text-muted); }

.feld-fehler, .feld-fehler:focus { border-color: var(--fehler) !important; box-shadow: 0 0 0 3px rgba(224, 36, 94, .18) !important; }
.fehler-text { font-size: .8rem; color: var(--fehler); font-weight: 500; }

.form-aktionen { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 4px;
    cursor: pointer;
}
.checkbox input { width: 18px; height: 18px; accent-color: var(--ac-violett); }

/* ---------- Autocomplete ---------- */
.autocomplete-wrapper { position: relative; }

.dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    display: none;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--rand-stark);
    border-radius: var(--radius-klein);
    box-shadow: 0 8px 24px rgba(48, 0, 104, .14);
    z-index: 40;
}
/* Hinweistext unter dem Feld nicht vom Dropdown-Abstand verschieben */
.feld.autocomplete-wrapper .dropdown { top: 70px; }

.dropdown div { padding: 9px 12px; cursor: pointer; font-size: .92rem; }
.dropdown div:hover, .dropdown div.aktiv { background: var(--hover); }
.dropdown div.aktiv { box-shadow: inset 3px 0 0 var(--ac-violett); }

/* ---------- Lager-Ansicht ---------- */
.lager-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.lager-layout.mit-details { grid-template-columns: minmax(0, 1fr) 440px; }

.liste-card { padding: 0; overflow: hidden; }

.liste-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--rand);
}

.suche {
    flex: 1 1 320px;
    min-height: 46px !important;
    font-size: 1rem;
    padding-left: 40px !important;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236b6880' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") no-repeat 13px center !important;
}

#artikel-zusammenfassung { font-size: .85rem; }

.tabelle-scroll { max-height: calc(100vh - 210px); overflow: auto; }

.artikel-tabelle { width: 100%; border-collapse: collapse; }

.artikel-tabelle th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #faf9fd;
    border-bottom: 1px solid var(--rand);
    padding: 0;
    text-align: left;
}

.artikel-tabelle th button {
    width: 100%;
    border: none;
    background: none;
    padding: 11px 14px;
    text-align: inherit;
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
}
.artikel-tabelle th button:hover { color: var(--ac-dunkel); }
.artikel-tabelle th.sortiert button { color: var(--ac-violett); }

.artikel-tabelle td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0eef6;
    vertical-align: middle;
}

.artikel-tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.artikel-tabelle .nr { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.artikel-tabelle tbody tr { cursor: pointer; transition: background-color .1s; }
.artikel-tabelle tbody tr:hover { background: var(--hover); }
.artikel-tabelle tbody tr:focus-visible { outline: none; background: var(--hover); box-shadow: inset 3px 0 0 var(--ac-blau); }
.artikel-tabelle tbody tr.ausgewaehlt { background: var(--auswahl); box-shadow: inset 3px 0 0 var(--ac-violett); }

.artikel-tabelle tr.gruppe td:nth-child(2) { font-weight: 600; }
.artikel-tabelle tr.kind td:nth-child(2) { padding-left: 38px; color: var(--text-muted); }
.artikel-tabelle tr.kind { background: #fcfbff; }

.pfeil { display: inline-block; width: 16px; color: var(--ac-violett); transition: transform .15s; }
.pfeil.offen { transform: rotate(90deg); }

.badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--auswahl);
    color: var(--ac-dunkel);
    font-size: .75rem;
    font-weight: 600;
}

.bestand-null { color: var(--fehler); font-weight: 600; }

/* Auswahl für Mehrfach-Etikettendruck */
.artikel-tabelle th.auswahl, .artikel-tabelle td.auswahl { width: 40px; padding: 0 0 0 14px; text-align: left; }
.artikel-tabelle th.auswahl { padding-top: 4px; }
.auswahl-box { width: 18px; height: 18px; margin: 0; vertical-align: middle; cursor: pointer; accent-color: var(--ac-violett); }

.auswahl-leiste {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 10px 20px;
    background: var(--auswahl);
    border-bottom: 1px solid rgba(127, 0, 255, .25);
    color: var(--ac-dunkel);
}

.leer-zustand {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-muted);
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: -3px;
    border: 2px solid var(--rand-stark);
    border-top-color: var(--ac-violett);
    border-radius: 50%;
    animation: drehen .8s linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }

/* ---------- Artikeldetails ---------- */
.detail-card {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
}
.detail-card::before {
    content: "";
    display: block;
    height: 4px;
    margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 16px;
    background: var(--ac-verlauf);
}

.detail-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail-kopf h2 { margin: 2px 0 4px; }
#artikel-beschreibung:empty { display: none; }

.kacheln {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.kachel {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid var(--rand);
    border-radius: var(--radius-klein);
    background: #faf9fd;
}

.kachel-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.kachel-wert { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kachel-sub { font-size: .8rem; color: var(--text-muted); }

.kachel-bestand { background: linear-gradient(135deg, rgba(0, 114, 255, .08), rgba(127, 0, 255, .1)); border-color: rgba(127, 0, 255, .25); }
.kachel-bestand .kachel-wert { font-size: 1.9rem; color: var(--ac-dunkel); }

.kachel.marge-schlecht .kachel-wert { color: var(--fehler); }
.kachel.marge-gut .kachel-wert { color: var(--erfolg); }

.block { margin-top: 14px; padding: 16px; border: 1px solid var(--rand); border-radius: var(--radius-klein); }
.block h3 { margin-top: 0; }
.block-hervorgehoben { border-color: rgba(127, 0, 255, .3); background: #fdfcff; }

.umbuchen-zeile { display: flex; align-items: flex-end; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.umbuchen-zeile .btn-primary { flex: 1; min-height: 46px; }

.stepper { display: flex; }
.stepper .btn { min-width: 42px; padding: 0; font-size: 1.2rem; }
.stepper .btn:first-child { border-radius: var(--radius-klein) 0 0 var(--radius-klein); }
.stepper .btn:last-child { border-radius: 0 var(--radius-klein) var(--radius-klein) 0; }
.stepper input { width: 70px; border-radius: 0; text-align: center; border-left: none; border-right: none; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper input { -moz-appearance: textfield; }

.klappbar summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.klappbar summary::-webkit-details-marker { display: none; }
.klappbar summary::before { content: "›"; color: var(--ac-violett); font-size: 1.3rem; line-height: 1; transition: transform .15s; }
.klappbar[open] summary::before { transform: rotate(90deg); }
.klappbar[open] summary { margin-bottom: 14px; }

.codes { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
#bar-code svg { max-width: 100%; height: auto; }

.link-reihe { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; }

.gefahrenzone {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(224, 36, 94, .3);
    border-radius: var(--radius-klein);
    background: rgba(224, 36, 94, .04);
}

/* ---------- Rechnung: Positionen ---------- */
.artikel-row {
    display: grid;
    grid-template-columns: 2.2fr .7fr 1fr 1fr 1.5fr 1.5fr auto;
    gap: 10px;
    align-items: start;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--rand);
    border-radius: var(--radius-klein);
    background: #faf9fd;
}
.artikel-row .icon-btn { margin-top: 26px; }

#tag-container { display: flex; flex-wrap: wrap; gap: 6px; }
#tag-container:empty { display: none; }

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 4px 3px 10px;
    border-radius: 999px;
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
}

.tag-chip .remove-tag {
    border: none;
    background: rgba(0, 0, 0, .15);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
}

#dropzone {
    padding: 28px 16px;
    border: 2px dashed var(--rand-stark);
    border-radius: var(--radius);
    background: #faf9fd;
    color: var(--text-muted);
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
#dropzone:hover, #dropzone:focus-visible { outline: none; border-color: var(--ac-violett); }
#dropzone.dragover { border-color: var(--ac-blau); background: rgba(0, 114, 255, .06); }
#dropzone.beleg-gewaehlt { border-style: solid; border-color: var(--erfolg); background: rgba(18, 161, 80, .06); color: var(--erfolg); font-weight: 600; }

#rechnung-result:empty { display: none; }
#rechnung-result {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: var(--radius-klein);
    border: 1px solid var(--rand);
    background: #faf9fd;
}
#rechnung-result.erfolg { border-color: rgba(18, 161, 80, .4); background: rgba(18, 161, 80, .06); }
#rechnung-result.fehler { border-color: rgba(224, 36, 94, .4); background: rgba(224, 36, 94, .05); color: var(--fehler); }

.rechnung-artikel-liste { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.rechnung-artikel-liste .btn { align-self: flex-start; margin-top: 8px; }
.rechnung-fehler { margin-top: 8px; color: var(--warnung); font-weight: 500; }

/* ---------- Offene Belege ---------- */
.belege-tabelle { width: 100%; border-collapse: collapse; }
.belege-tabelle th {
    text-align: left;
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--rand);
}
.belege-tabelle td { padding: 10px 12px; border-bottom: 1px solid #f0eef6; vertical-align: middle; }
.belege-tabelle .aktionen { display: flex; gap: 8px; justify-content: flex-end; }
.belege-tabelle .btn { min-height: 36px; padding: 6px 14px; }

/* ---------- Toasts ---------- */
#toasts {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
    max-width: min(420px, calc(100vw - 40px));
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius-klein);
    background: #fff;
    border-left: 4px solid var(--erfolg);
    box-shadow: 0 8px 28px rgba(48, 0, 104, .2);
    font-weight: 500;
    animation: rein .2s ease-out;
    transition: opacity .3s, transform .3s;
}
.toast-fehler { border-left-color: var(--fehler); }
.toast-info { border-left-color: var(--ac-blau); }
.toast.weg { opacity: 0; transform: translateY(8px); }
@keyframes rein { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Benutzer-Menü in der Kopfzeile ---------- */
.benutzer-menue {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.benutzer-name { color: rgba(255, 255, 255, .85); font-size: .9rem; font-weight: 500; }
.btn-abmelden {
    border: 1px solid rgba(255, 255, 255, .35);
    background: transparent;
    color: #fff;
    border-radius: var(--radius-klein);
    padding: 6px 12px;
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
}
.btn-abmelden:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Login / Einrichtung ---------- */
.auth-seite main { display: flex; justify-content: center; padding-top: 8vh; }
.auth-card { width: 100%; max-width: 440px; text-align: center; --pad: 32px; }
.auth-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 114, 255, .12), rgba(127, 0, 255, .16));
}
.auth-card h2 { margin-bottom: 8px; }
.auth-card p { margin-bottom: 20px; }
.btn-gross { width: 100%; min-height: 50px; font-size: 1rem; text-decoration: none; }
.auth-meldung {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-klein);
    border: 1px solid rgba(224, 36, 94, .35);
    background: rgba(224, 36, 94, .06);
    color: var(--fehler);
    font-weight: 500;
    text-align: left;
}
.auth-fusszeile { margin: 24px 0 0 !important; line-height: 1.6; }

/* Hinweis für Externe, die einen Inventar-QR-Code gescannt haben */
.qr-hinweis {
    margin-top: 24px;
    padding: 14px 16px;
    text-align: left;
    font-size: .85rem;
    line-height: 1.5;
    border-radius: var(--radius-klein);
    border: 1px solid rgba(48, 0, 104, .15);
    border-left: 4px solid var(--ac-violett);
    background: rgba(48, 0, 104, .04);
}
.qr-hinweis h3 { font-size: .95rem; margin: 0 0 6px; }
.auth-card .qr-hinweis p { margin: 0 0 8px; }
.auth-card .qr-hinweis p:last-child { margin-bottom: 0; }
.qr-hinweis ul { margin: 0 0 8px; padding-left: 18px; }
.qr-hinweis li { margin-bottom: 2px; }
.auth-liste { text-align: left; padding-left: 20px; margin: 0 0 20px; font-size: .9rem; }
.auth-liste li { margin-bottom: 6px; }

/* ---------- Admin ---------- */
.admin-main { display: flex; flex-direction: column; gap: 20px; }
.form-grid.drei-spalten { grid-template-columns: repeat(3, minmax(0, 1fr)); }

select {
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--rand-stark);
    border-radius: var(--radius-klein);
    background: #fff;
}
select:focus { outline: none; border-color: var(--ac-blau); box-shadow: var(--fokus); }

.btn-klein { min-height: 32px; padding: 4px 10px; font-size: .8rem; }

.tabelle-scroll-x { overflow-x: auto; }
.protokoll-scroll { max-height: 520px; overflow-y: auto; }

.admin-tabelle { width: 100%; border-collapse: collapse; }
.admin-tabelle th {
    position: sticky;
    top: 0;
    background: #faf9fd;
    text-align: left;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--rand);
    white-space: nowrap;
}
.admin-tabelle td { padding: 12px; border-bottom: 1px solid #f0eef6; vertical-align: top; }
.admin-tabelle tr.gesperrt td { opacity: .55; }
.admin-tabelle tr.gesperrt td:last-child { opacity: 1; }
.protokoll-tabelle td { padding: 8px 12px; font-size: .88rem; }

.konto-name { font-weight: 600; }
.konto-aktionen { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; min-width: 220px; }

.badge-admin { background: var(--ac-dunkel); color: #fff; }

.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.status-an { background: rgba(18, 161, 80, .12); color: var(--erfolg); }
.status-aus { background: rgba(224, 36, 94, .1); color: var(--fehler); }
.status-wartet { background: rgba(194, 106, 0, .12); color: var(--warnung); }

.aktion-fehler { color: var(--fehler); font-weight: 600; }
.nowrap { white-space: nowrap; }
.protokoll-suche { max-width: 240px; }

.link-dialog {
    width: min(480px, calc(100vw - 32px));
    border: none;
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 20px 60px rgba(48, 0, 104, .35);
}
.link-dialog::backdrop { background: rgba(48, 0, 104, .45); }
.link-dialog p { margin-bottom: 14px; }
.link-qr { display: flex; justify-content: center; margin: 8px 0 18px; }
.link-feld { display: flex; gap: 8px; margin-bottom: 8px; }
.link-feld input { font-size: .85rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .lager-layout.mit-details { grid-template-columns: minmax(0, 1fr) 380px; }
    .artikel-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .artikel-row .feld:first-child { grid-column: 1 / -1; }
    .artikel-row .feld.autocomplete-wrapper { grid-column: span 2; }
    .artikel-row .icon-btn { grid-column: 1 / -1; justify-self: end; margin-top: 0; }
}

@media (max-width: 900px) {
    .lager-layout.mit-details { grid-template-columns: minmax(0, 1fr); }
    /* Am Handy/Tablet stehen die Details über der Liste */
    .detail-card { order: -1; position: static; max-height: none; }
    .tabelle-scroll { max-height: none; }
    .artikel-tabelle th { top: 0; }
}

@media (max-width: 640px) {
    body { font-size: 16px; }
    main { padding: 12px; }
    .topbar-inner { flex-wrap: wrap; flex-direction: row; align-items: center; gap: 0; padding: 0 12px; }
    .brand { padding: 10px 0 2px; }
    .tabs { order: 3; width: 100%; }
    .benutzer-menue { padding-top: 8px; gap: 8px; }
    .benutzer-name { display: none; }
    .form-grid.drei-spalten { grid-template-columns: minmax(0, 1fr); }
    .auth-seite main { padding-top: 24px; }
    .auth-card { --pad: 22px; }
    .card-kopf .protokoll-suche { max-width: none; }
    .brand-logo { height: 36px; }
    .tab { padding: 12px 10px; }
    .tab.aktiv::after { left: 6px; right: 6px; }

    .card { --pad: 16px; }
    .liste-card { padding: 0; }
    .liste-toolbar { padding: 12px; }

    .spalte-preis, .spalte-nr { display: none; }
    .nur-desktop { display: none; }
    .topbar { position: static; }
    .artikel-tabelle td, .artikel-tabelle th button { padding-left: 10px; padding-right: 10px; }

    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .artikel-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .artikel-row .feld.autocomplete-wrapper { grid-column: 1 / -1; }

    .kachel-wert { font-size: 1.1rem; }
    .kachel-bestand .kachel-wert { font-size: 1.6rem; }

    .form-aktionen .btn, .gefahrenzone .btn { width: 100%; }
    .gefahrenzone { flex-direction: column; align-items: stretch; }
    .card-kopf { flex-direction: column; }

    .belege-tabelle thead { display: none; }
    .belege-tabelle tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 0; border-bottom: 1px solid var(--rand); }
    .belege-tabelle td { border: none; padding: 2px 4px; }
    .belege-tabelle .aktionen { grid-column: 1 / -1; justify-content: flex-start; padding-top: 8px; }

    #toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}
