* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif;
    background: linear-gradient(135deg, #0a0a10 0%, #13131e 100%);
    color: #f5f6fa;
    padding: 2rem;
    min-height: 100vh;
}

.container { max-width: 1400px; margin: 0 auto; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
h1 { font-size: 2.25rem; font-weight: bold; margin-bottom: 0.4rem; }
.subtitle { color: #a9abb6; }

/* ── Statuszeile ────────────────────────────────────────────────────────── */
.status-bar {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    background: #10101a; border: 1px solid rgba(255,255,255,0.07);
    border-radius: 0.75rem; padding: 0.85rem 1.25rem; margin-bottom: 1.5rem;
}
.sb-item { display: flex; flex-direction: column; align-items: center; min-width: 90px; }
.sb-num { font-size: 1.5rem; font-weight: bold; font-variant-numeric: tabular-nums; }
.sb-lbl { font-size: 0.7rem; color: #a9abb6; text-transform: uppercase; letter-spacing: 0.05em; }
.sb-sep { width: 1px; height: 32px; background: rgba(255,255,255,0.08); }
.sb-blue .sb-num { color: #7981e2; }
.sb-green .sb-num { color: #4fbf8b; }
.sb-orange .sb-num { color: #e0a458; }
.sb-cyan .sb-num { color: #4fa8b8; }
.sb-purple .sb-num { color: #a3a9ec; }

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 1.5rem; }
.tab {
    background: none; border: none; border-bottom: 2px solid transparent;
    color: #a9abb6; font-size: 0.9rem; font-weight: 500; font-family: inherit;
    padding: 0.7rem 0.2rem; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.tab:hover { color: #e8e8f0; }
.tab.active { color: #a3a9ec; border-bottom-color: #5b63d6; }
.tab-section { display: none; }
.tab-section.active { display: block; }

/* ── Karten ─────────────────────────────────────────────────────────────── */
.card {
    background: #10101a; border: 1px solid rgba(255,255,255,0.07);
    border-radius: 0.75rem; padding: 1.25rem; margin-bottom: 1.5rem;
}
.card h2 { font-size: 1rem; font-weight: bold; margin-bottom: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card-head h2 { margin-bottom: 0; }

/* ── Formulare ──────────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-size: 0.75rem; color: #b8bac6; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
input, select, textarea {
    background: #0a0a12; border: 1px solid rgba(255,255,255,0.1); border-radius: 0.5rem;
    color: #f5f6fa; padding: 0.6rem 0.75rem; font-size: 0.9rem; font-family: inherit; width: 100%;
    transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #5b63d6; }
input::placeholder { color: #6b6d78; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 0.4rem; justify-content: center;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
    color: #e8e8f0; padding: 0.55rem 0.9rem; border-radius: 0.5rem; font-size: 0.85rem;
    font-weight: 500; font-family: inherit; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,0.09); border-color: #83868f; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: rgba(91,99,214,0.2); border-color: #5b63d6; color: #a3a9ec; }
.btn-primary:hover { background: rgba(91,99,214,0.3); }
.btn-danger { color: #ea8b82; border-color: rgba(226,105,95,0.3); }
.btn-danger:hover { background: rgba(226,105,95,0.12); }
.btn-sm { padding: 0.35rem 0.6rem; font-size: 0.78rem; }
.btn-ghost { background: none; border: none; color: #83868f; padding: 0.3rem; }
.btn-ghost:hover { color: #e8e8f0; background: rgba(255,255,255,0.06); }

/* ── Tabellen ───────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th {
    text-align: left; color: #b8bac6; font-weight: 600; font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 0.04em; padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
td { padding: 0.7rem 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: middle; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── SKU-Badges ─────────────────────────────────────────────────────────── */
.sku {
    display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 0.375rem;
    background: rgba(91,99,214,0.15); color: #a3a9ec; white-space: nowrap;
}
.sku-b { background: rgba(121,129,226,0.15); color: #b0b6ef; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; }
.muted { color: #6b6d78; }

/* ── Status-Pills ───────────────────────────────────────────────────────── */
.pill { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.pill-neu { background: rgba(91,99,214,0.18); color: #a3a9ec; }
.pill-offen { background: rgba(224,164,88,0.16); color: #e0a458; }
.pill-fertig { background: rgba(79,191,139,0.16); color: #6fd0a6; }

/* ── Produktsuche (Typeahead) ───────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-list {
    border: 1px solid rgba(255,255,255,0.1); border-radius: 0.5rem; margin-top: 0.5rem;
    overflow: hidden; max-height: 320px; overflow-y: auto; background: #0d0d16;
}
.search-item {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.6rem 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover, .search-item.sel { background: rgba(91,99,214,0.14); }
.search-item .si-name { font-size: 0.88rem; }
.search-item .si-marke { font-size: 0.72rem; color: #83868f; }
.search-new { padding: 0.6rem 0.8rem; color: #a3a9ec; cursor: pointer; font-size: 0.82rem; display: flex; align-items: center; gap: 0.4rem; }
.search-new:hover { background: rgba(91,99,214,0.1); }
.search-empty { padding: 0.8rem; color: #6b6d78; font-size: 0.82rem; }

/* ── Checkliste ─────────────────────────────────────────────────────────── */
.chk-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.chk-row:last-child { border-bottom: none; }
.chk-box {
    width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 0.8rem; transition: all 0.15s;
}
.chk-box.done { background: rgba(79,191,139,0.2); border-color: #4fbf8b; color: #6fd0a6; }
.chk-row .chk-name { flex: 1; font-size: 0.9rem; }
.chk-row.done .chk-name { color: #83868f; }
.chk-row .chk-input { flex: 1; display: none; }
.editing .chk-row .chk-name { display: none; }
.editing .chk-row .chk-input { display: block; }
.chk-del { color: #83868f; cursor: pointer; display: none; }
.editing .chk-del { display: inline-flex; }
.chk-del:hover { color: #ea8b82; }

/* ── Detail-Panel / Bundle-Liste ────────────────────────────────────────── */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 0.4rem 1rem; font-size: 0.88rem; }
.kv dt { color: #b8bac6; }
.bundle-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2000;
    display: none; align-items: flex-start; justify-content: center; padding: 4rem 1rem; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: #13131e; border: 1px solid rgba(255,255,255,0.1); border-radius: 0.75rem;
    padding: 1.5rem; width: 100%; max-width: 640px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-head h2 { font-size: 1.1rem; font-weight: bold; }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ── Filter ─────────────────────────────────────────────────────────────── */
.filter-row { display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filter-row input { flex: 1; min-width: 200px; }
.filter-row select { width: 220px; }

.empty { text-align: center; color: #6b6d78; padding: 2.5rem 1rem; font-size: 0.9rem; }

/* ── Register: aufklappbare Zeilen ──────────────────────────────────────── */
.reg-main { cursor: pointer; }
.reg-main:hover td { background: rgba(91,99,214,0.06); }
.reg-arrow { display: inline-block; width: 0.9em; color: #7981e2; font-size: 0.8rem; }
.reg-sub td { padding: 0.25rem 1rem 0.9rem; }
.reg-sub table th { border-bottom-color: rgba(255,255,255,0.06); }

@media (max-width: 700px) {
    body { padding: 1rem; }
    h1 { font-size: 1.6rem; }
    .kv { grid-template-columns: 1fr; gap: 0.2rem; }
    .kv dt { margin-top: 0.5rem; }
}
