/* style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:       #f5f3ef;
    --surface:  #ffffff;
    --border:   #ddd8d0;
    --text:     #2c2825;
    --muted:    #7a7067;
    --accent:   #4a7c59;
    --accent-h: #3a6348;
    --danger:   #b94040;
    --radius:   8px;
    --shadow:   0 2px 8px rgba(0,0,0,.08);
    --font-head: 'Lora', Georgia, serif;
    --font-body: 'Source Sans 3', Helvetica, sans-serif;
}

html { font-size: 16px; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── HEADER ─────────────────────────────────── */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 100;
}
.header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.logo { display: flex; align-items: center; gap: .75rem; }
.logo-icon { font-size: 1.6rem; }
.logo-title {
    display: block;
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}
.logo-sub { display: block; font-size: .75rem; color: var(--muted); }

nav { display: flex; gap: .25rem; }
nav a {
    text-decoration: none;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 600;
    padding: .4rem .85rem;
    border-radius: var(--radius);
    transition: background .15s, color .15s;
}
nav a:hover { background: var(--bg); color: var(--text); }
nav a.active { background: var(--accent); color: #fff; }

/* ── MAIN ────────────────────────────────────── */
main {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* ── CARDS ───────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
}
.card h1, .card h2 {
    font-family: var(--font-head);
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    color: var(--text);
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--border);
}

/* ── FORM ────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .9rem 1.2rem;
}
.form-group { display: flex; flex-direction: column; gap: .3rem; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: .83rem; font-weight: 600; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; }
input, select, textarea {
    font-family: var(--font-body);
    font-size: .95rem;
    padding: .55rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,124,89,.15); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .6rem 1.4rem;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #9a3333; }

/* ── ALERTS ──────────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: .93rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.alert-success { background: #e8f5ec; border: 1px solid #b5dfc0; color: #2d6640; }
.alert-error   { background: #fbeaea; border: 1px solid #e8b4b4; color: #8b2020; }

/* ── FILTER BAR ──────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.filter-bar .form-group { flex: 1; min-width: 160px; }

/* ── TABLE ───────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: .93rem;
}
thead tr { background: var(--bg); }
th {
    text-align: left;
    padding: .55rem .85rem;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 2px solid var(--border);
}
td {
    padding: .65rem .85rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #faf9f7; }
.qty-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border-radius: 4px;
    padding: .1rem .5rem;
    font-size: .82rem;
    font-weight: 600;
}
.person-tag {
    display: inline-block;
    background: #e8f0eb;
    color: var(--accent);
    border-radius: 4px;
    padding: .1rem .5rem;
    font-size: .82rem;
    font-weight: 600;
}
.date-cell { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--muted);
}
.empty-state .empty-icon { font-size: 2.5rem; display: block; margin-bottom: .5rem; }

/* ── SUMMARY ROW ─────────────────────────────── */
.summary-note { font-size: .8rem; color: var(--muted); margin-top: .5rem; font-style: italic; }

/* ── FOOTER ──────────────────────────────────── */
footer {
    text-align: center;
    padding: 1.25rem;
    font-size: .8rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: var(--surface);
    margin-top: auto;
}

/* ── MENGE-ZEILE (Anzahl + Einheit) ─────────── */
.menge-row {
    display: grid;
    grid-template-columns: 1fr 1.6fr auto;
    gap: .5rem;
    align-items: center;
}
.menge-anzahl  { /* inherits input styles */ }
.menge-einheit { /* inherits select styles */ }

.menge-preview {
    font-size: .82rem;
    color: var(--muted);
    white-space: nowrap;
    font-style: italic;
    min-width: 4rem;
    padding-left: .1rem;
}
.menge-preview.has-value { color: var(--accent); font-style: normal; font-weight: 600; }

/* Einheit-Tag innerhalb eines Badges */
.qty-unit {
    opacity: .82;
    font-weight: 400;
    font-size: .9em;
    margin-left: .15em;
}

/* Einheit in eigener Tabellenspalte */
.qty-unit-cell {
    display: inline-block;
    background: #e8f0eb;
    color: var(--accent);
    border-radius: 4px;
    padding: .1rem .45rem;
    font-size: .82rem;
    font-weight: 600;
}

/* Rein-numerischer Badge (kein Einheit drin) */
.qty-badge-num {
    min-width: 2rem;
    text-align: center;
}

/* ── PRODUKTINFO-PANEL ───────────────────────── */
.produkt-info {
    margin-top: .6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    overflow: hidden;
    font-size: .88rem;
    animation: pi-fade .2s ease;
}
@keyframes pi-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.pi-header {
    background: var(--surface);
    padding: .5rem .85rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.pi-produktname {
    font-weight: 700;
    font-size: .92rem;
    color: var(--text);
}

.pi-status {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .85rem;
    font-size: .82rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}
.pi-status svg { flex-shrink: 0; }
.pi-status-ok   { background: #e8f5ec; color: #2d6640; }
.pi-status-warn { background: #fef9e7; color: #7a5c00; }

.pi-row {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .5rem .85rem;
    border-bottom: 1px solid var(--border);
}
.pi-row:last-child { border-bottom: none; }

.pi-label {
    flex-shrink: 0;
    min-width: 120px;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    padding-top: .15rem;
}
.pi-mengen { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.pi-count  { font-size: .78rem; color: var(--muted); }
.pi-none   { font-size: .83rem; color: var(--muted); font-style: italic; }

.pi-mindest .pi-mindest-val {
    font-weight: 700;
    color: var(--accent);
    font-size: .9rem;
}

/* ── NAV HELP BUTTON ─────────────────────────── */
.nav-help {
    display: inline-flex !important;
    align-items: center;
    gap: .3rem;
}
.nav-help svg { flex-shrink: 0; }

/* ── TOOLTIPS ────────────────────────────────── */
label { position: relative; }  /* anchor for tooltip bubbles */

.tooltip-wrap {
    display: inline-flex;
    align-items: center;
    position: relative;
    cursor: help;
    margin-left: .25rem;
    vertical-align: middle;
}
.tooltip-icon {
    color: var(--muted);
    transition: color .15s;
    display: block;
}
.tooltip-wrap:hover .tooltip-icon,
.tooltip-wrap:focus .tooltip-icon {
    color: var(--accent);
    outline: none;
}

.tooltip-bubble {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 200;
    background: var(--text);
    color: #fff;
    font-size: .8rem;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
    text-transform: none;
    padding: .55rem .75rem;
    border-radius: 6px;
    width: 230px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    pointer-events: none;
}
/* small arrow */
.tooltip-bubble::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 10px;
    border-width: 0 5px 5px 5px;
    border-style: solid;
    border-color: transparent transparent var(--text) transparent;
}
/* left-aligned variant (tooltip flies right) */
.tooltip-bubble-left {
    left: auto;
    right: 0;
}
.tooltip-bubble-left::before {
    left: auto;
    right: 10px;
}

.tooltip-wrap:hover .tooltip-bubble,
.tooltip-wrap:focus .tooltip-bubble {
    display: block;
}

/* ── PRINT BUTTON ────────────────────────────── */
.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
}
.card-title-row h1 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}
.btn-print {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .85rem;
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
}
.btn-print:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-print svg { flex-shrink: 0; }

/* ── PRINT LAYOUT ────────────────────────────── */
.print-header { display: none; }

@media print {
    /* Seitenränder */
    @page { margin: 1.5cm 2cm; }

    /* UI-Elemente ausblenden */
    header, footer, .filter-bar, .btn-print,
    .alert, .summary-note, .empty-state a,
    a[href="eintragen.php"] { display: none !important; }

    /* Druckkopf einblenden */
    .print-header {
        display: block;
        margin-bottom: 1.25rem;
        padding-bottom: .75rem;
        border-bottom: 2px solid #000;
    }
    .print-header h2 {
        font-family: var(--font-head);
        font-size: 1.3rem;
        margin-bottom: .25rem;
    }
    .print-header p { font-size: .85rem; color: #555; }

    /* Statistik-Zeile kompakt */
    body, main { background: #fff !important; }
    .card {
        box-shadow: none;
        border: none;
        padding: 0;
    }
    .card-title-row h1 { display: none; } /* ersetzt durch .print-header */

    /* Tabelle druckfreundlich */
    table { border-collapse: collapse; width: 100%; font-size: .9rem; }
    th { background: #eee !important; color: #000 !important; }
    th, td { border: 1px solid #ccc !important; padding: .4rem .6rem !important; }
    tbody tr:hover { background: transparent !important; }

    /* Badges als Klartext */
    .qty-badge, .person-tag {
        background: transparent !important;
        color: #000 !important;
        padding: 0;
        font-weight: 600;
    }

    /* Seitenumbrüche */
    table { page-break-inside: auto; }
    tr { page-break-inside: avoid; }
}

/* ── TOGGLE-ZEILE (eigenständige Zeile über Name + Produkt) ── */
.toggle-row {
    border-bottom: 1px solid var(--border);
    padding-bottom: .65rem;
    margin-bottom: .1rem;
}
.toggle-row-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.toggle-row-label {
    font-size: .83rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: .03em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

/* Legacy – wird nicht mehr direkt genutzt, bleibt für Kompatibilität */
.produkt-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .35rem;
}
.produkt-toggle-row label { margin-bottom: 0; }

.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: .2rem .5rem;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s;
}
.toggle-switch:hover { border-color: var(--accent); }
.toggle-switch:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

.toggle-opt {
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    transition: color .15s;
    padding: .05rem .1rem;
}
.toggle-opt.active { color: var(--accent); }

.toggle-knob {
    width: 28px;
    height: 16px;
    background: var(--border);
    border-radius: 8px;
    position: relative;
    transition: background .2s;
    flex-shrink: 0;
}
.toggle-knob::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform .2s;
}
.toggle-switch.is-freitext .toggle-knob {
    background: var(--accent);
}
.toggle-switch.is-freitext .toggle-knob::after {
    transform: translateX(12px);
}

/* ── TRASH BUTTON ────────────────────────────── */
.td-action {
    padding: .35rem .5rem !important;
    text-align: center;
    width: 2.75rem;
}
.btn-trash {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--muted);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.btn-trash:hover {
    background: #fbeaea;
    color: var(--danger);
    border-color: #e8b4b4;
}

/* ── PRINT: hide trash column & hints ───────── */
@media print {
    .no-print { display: none !important; }
}

/* ── HILFE-SEITE ─────────────────────────────── */
.hilfe-hero {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}
.hilfe-hero-icon { font-size: 2.5rem; line-height: 1; flex-shrink: 0; }
.hilfe-title {
    font-family: var(--font-head);
    font-size: 1.35rem;
    margin-bottom: .35rem;
    border: none;
    padding: 0;
}
.hilfe-intro { font-size: .95rem; color: var(--muted); line-height: 1.55; }

/* TOC */
.hilfe-toc {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .6rem;
    font-size: .85rem;
}
.hilfe-toc-label { color: var(--muted); font-weight: 600; }
.hilfe-toc a {
    color: var(--accent);
    text-decoration: none;
    padding: .15rem .5rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: background .15s, border-color .15s;
}
.hilfe-toc a:hover { background: #e8f0eb; border-color: var(--accent); }

/* Section titles */
.hilfe-section-title {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-family: var(--font-head);
    font-size: 1.15rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: .6rem;
    margin-bottom: 1rem;
}
.hilfe-section-icon { font-size: 1.1rem; }

.hilfe-text { font-size: .93rem; line-height: 1.6; color: var(--text); margin-bottom: .75rem; }
.hilfe-text:last-child { margin-bottom: 0; }

/* Steps */
.hilfe-steps { display: flex; flex-direction: column; gap: .85rem; margin: .9rem 0; }
.hilfe-step {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
}
.step-num {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    margin-top: .1rem;
}
.hilfe-step strong { display: block; margin-bottom: .2rem; font-size: .93rem; }
.hilfe-step p { font-size: .88rem; color: var(--muted); line-height: 1.5; margin: 0; }

/* Hint boxes */
.hilfe-hint {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    background: #e8f5ec;
    border: 1px solid #b5dfc0;
    border-radius: var(--radius);
    padding: .7rem .9rem;
    font-size: .88rem;
    color: #2d6640;
    margin-top: .9rem;
    line-height: 1.5;
}
.hilfe-hint-warn {
    background: #fef9e7;
    border-color: #f0d060;
    color: #7a5c00;
}
.hint-icon { font-size: 1rem; flex-shrink: 0; margin-top: .05rem; }

/* Two columns for Auswahl/Freitext */
.hilfe-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
    margin-top: .65rem;
}
.hilfe-option {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .6rem .75rem;
    font-size: .86rem;
    line-height: 1.5;
    color: var(--muted);
}
.option-badge {
    display: inline-block;
    border-radius: 4px;
    padding: .1rem .5rem;
    font-size: .75rem;
    font-weight: 700;
    margin-bottom: .3rem;
}
.option-green { background: #e8f0eb; color: var(--accent); }
.option-blue  { background: #e8eef8; color: #3060a0; }

/* Compare blocks (filter comparison) */
.hilfe-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin: .75rem 0;
}
.hilfe-compare-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem;
}
.compare-label {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .5rem;
    padding: .2rem .5rem;
    border-radius: 4px;
    display: inline-block;
}
.compare-label-grey  { background: var(--border); color: var(--muted); }
.compare-label-green { background: #e8f0eb; color: var(--accent); }

.hilfe-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.hilfe-list li {
    font-size: .86rem;
    color: var(--muted);
    padding-left: 1.1rem;
    position: relative;
    line-height: 1.45;
}
.hilfe-list li::before {
    content: '·';
    position: absolute;
    left: .3rem;
    color: var(--accent);
    font-weight: 700;
}

/* Demo table inside hilfe */
.hilfe-table-demo {
    margin: .75rem 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.hilfe-table-demo table { font-size: .86rem; }
.hilfe-table-demo th, .hilfe-table-demo td { padding: .45rem .7rem; }

/* Tipps grid */
.hilfe-tipps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}
.tipp-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .85rem;
}
.tipp-icon { font-size: 1.3rem; display: block; margin-bottom: .35rem; }
.tipp-box strong { display: block; font-size: .9rem; margin-bottom: .3rem; }
.tipp-box p { font-size: .84rem; color: var(--muted); line-height: 1.5; margin: 0; }

code {
    background: var(--border);
    padding: .05rem .3rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: .88em;
}

/* ── RESPONSIVE – HILFE & TOOLTIPS ──────────── */
   ════════════════════════════════════════════════ */

/* ── TABLET  (≤ 768 px) ──────────────────────── */
@media (max-width: 768px) {

    /* Etwas weniger Außenabstand */
    main { margin: 1.25rem auto; padding: 0 1rem; }
    .card { padding: 1.25rem 1.25rem; }

    /* Header bleibt einzeilig, Schrift leicht kleiner */
    .logo-title { font-size: 1rem; }
    .logo-sub   { display: none; }          /* Untertitel weglassen */

    /* Formular: zwei Spalten bleiben, aber enger */
    .form-grid { gap: .75rem 1rem; }

    /* Filter-Bar untereinander wenn nötig */
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .form-group { min-width: unset; }
    .filter-bar .btn,
    .filter-bar a.btn { width: 100%; justify-content: center; }

    /* Statistik-Zeile umbrechen */
    .stats-row { flex-wrap: wrap; gap: .75rem 1.25rem; }

    /* Tabelle: Schrift etwas kleiner, Padding reduzieren */
    table   { font-size: .86rem; }
    th, td  { padding: .5rem .6rem; }

    /* Drucken-Label ausblenden – nur Icon */
    .btn-print-label { display: none; }
    .btn-print { padding: .45rem .55rem; }

    /* Hilfe: zweispaltige Elemente auf Tablet einspaltiger */
    .hilfe-two-col,
    .hilfe-tipps-grid { grid-template-columns: 1fr; }
    .hilfe-compare    { grid-template-columns: 1fr; }

    /* Tooltip-Bubble nicht über den Rand */
    .tooltip-bubble { width: 200px; }
}

/* ── PHONE  (≤ 480 px) ───────────────────────── */
@media (max-width: 480px) {

    main  { margin: .75rem auto; padding: 0 .75rem; }
    .card { padding: 1rem .9rem; margin-bottom: 1rem; border-radius: 6px; }

    /* Header: Logo + Nav in zwei Zeilen */
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
        padding: .6rem .9rem;
    }
    nav { width: 100%; }
    nav a {
        flex: 1;
        text-align: center;
        padding: .45rem .5rem;
        font-size: .85rem;
    }

    /* Formular: eine Spalte */
    .form-grid { grid-template-columns: 1fr; gap: .65rem; }
    .form-group.full { grid-column: 1; }

    /* Inputs & Selects größer tippen */
    input, select, textarea { font-size: 1rem; padding: .6rem .7rem; }
    .btn { width: 100%; justify-content: center; font-size: .95rem; }

    /* Toggle-Zeile nicht umbrechen */
    .produkt-toggle-row { gap: .5rem; }

    /* ── TABELLE als Karten-Layout ─────────────
       Jede <tr> wird zu einem eigenständigen Block.
       <th> wird via data-label als Pseudo-Label
       vor den Zellinhalt gestellt.
    ── */
    .table-wrap { overflow-x: unset; }

    table, thead, tbody, th, td, tr { display: block; }

    /* Kopfzeile verstecken (Labels kommen per data-label) */
    thead tr { display: none; }

    tbody tr {
        border: 1px solid var(--border);
        border-radius: 6px;
        margin-bottom: .65rem;
        background: var(--surface);
        box-shadow: 0 1px 4px rgba(0,0,0,.06);
        overflow: hidden;
    }
    tbody tr:last-child { margin-bottom: 0; }
    /* kein hover-Hintergrund auf Mobile nötig */
    tbody tr:hover { background: var(--surface); }

    td {
        display: flex;
        align-items: flex-start;
        gap: .5rem;
        padding: .55rem .75rem;
        border-bottom: 1px solid var(--border);
        font-size: .9rem;
        line-height: 1.4;
    }
    td:last-child { border-bottom: none; }

    /* Pseudo-Label aus data-label Attribut */
    td[data-label]::before {
        content: attr(data-label);
        flex-shrink: 0;
        min-width: 80px;
        font-size: .72rem;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: var(--muted);
        padding-top: .15rem;
    }

    /* Trash-Button bleibt kompakt */
    .td-action {
        width: auto;
        justify-content: flex-end;
        padding: .4rem .75rem !important;
    }
    .td-action::before { display: none; }   /* kein Label vor dem Icon */

    /* Datum etwas kleiner */
    .date-cell { font-size: .82rem; white-space: normal; }

    /* Badges */
    .qty-badge, .person-tag { font-size: .8rem; }

    /* Statistik-Blöcke untereinander */
    .stats-row { flex-direction: column; gap: .4rem; }

    /* Hinweis-Fußnote */
    .summary-note { font-size: .78rem; }

    /* Menge-Zeile: einspaltig auf kleinem Screen */
    .menge-row { grid-template-columns: 1fr 1fr; }
    .menge-preview { grid-column: 1 / -1; padding-left: 0; }

    /* Filter aufheben Link */
    .filter-bar a.btn { text-decoration: none; }

    /* Hilfe: volle Breite für alle Grids */
    .hilfe-two-col,
    .hilfe-tipps-grid,
    .hilfe-compare { grid-template-columns: 1fr; }
    .hilfe-hero { gap: .65rem; }
    .hilfe-hero-icon { font-size: 1.75rem; }
    .hilfe-title { font-size: 1.1rem; }

    /* Tooltip auf Mobile: fixiere Breite und verhindere Rand-Clipping */
    .tooltip-bubble {
        width: 190px;
        font-size: .78rem;
    }
    .tooltip-bubble-left { right: auto; left: 0; }
    .tooltip-bubble-left::before { right: auto; left: 10px; }

    /* Nav-Hilfe-Label ebenfalls ausblenden auf kleinstem Screen */
    .nav-help-label { display: none; }
}

