/*
 * ESD-Storage — Phase 1 UI mit Dark Mode
 * Branding: Navy #1A1A4E + Orange #FF8400
 * Light = Default. Dark via prefers-color-scheme ODER data-theme="dark"
 */

:root {
    --navy: #1A1A4E;
    --orange: #FF8400;
    --orange-dark: #CC6900;

    --bg: #F5F5F8;
    --card: #FFFFFF;
    --card-inner: #F5F5F8;
    --text: #1A1A1A;
    --text-strong: #1A1A4E;
    --muted: #6B6B7A;
    --border: #E1E1E8;
    --input-bg: #FFFFFF;
    --input-border: #E1E1E8;
    --topbar-bg: #1A1A4E;
    --footer-bg: #FFFFFF;
    --error: #C8312A;
    --error-bg: #FCE8E8;
    --success: #2A8C3C;
    --success-bg: #E8F5EC;
    --shadow: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-topbar: 0 2px 6px rgba(0,0,0,0.1);
    --focus-ring: rgba(255, 132, 0, 0.15);
}

/* Dark Mode — Auto (System) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0E0E1A;
        --card: #15152A;
        --card-inner: #0E0E1A;
        --text: #E5E5EE;
        --text-strong: #FFFFFF;
        --muted: #8A8AA0;
        --border: #2A2A45;
        --input-bg: #1F1F38;
        --input-border: #2A2A45;
        --topbar-bg: #0F0F32;
        --footer-bg: #15152A;
        --error: #FF6B61;
        --error-bg: #3A1A18;
        --success: #5FCF74;
        --success-bg: #163A1D;
        --shadow: 0 1px 3px rgba(0,0,0,0.4);
        --shadow-topbar: 0 2px 8px rgba(0,0,0,0.5);
        --focus-ring: rgba(255, 132, 0, 0.25);
    }
}

/* Dark Mode — Expliziter Toggle */
:root[data-theme="dark"] {
    --bg: #0E0E1A;
    --card: #15152A;
    --card-inner: #0E0E1A;
    --text: #E5E5EE;
    --text-strong: #FFFFFF;
    --muted: #8A8AA0;
    --border: #2A2A45;
    --input-bg: #1F1F38;
    --input-border: #2A2A45;
    --topbar-bg: #0F0F32;
    --footer-bg: #15152A;
    --error: #FF6B61;
    --error-bg: #3A1A18;
    --success: #5FCF74;
    --success-bg: #163A1D;
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-topbar: 0 2px 8px rgba(0,0,0,0.5);
    --focus-ring: rgba(255, 132, 0, 0.25);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color-scheme: light dark;
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--topbar-bg);
    color: #FFFFFF;
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-topbar);
}

.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; letter-spacing: 0.05em; font-size: 1rem; }
.brand-tagline { color: var(--orange); font-size: 0.75rem; font-weight: 500; }
.app-name { margin-left: auto; font-weight: 600; font-size: 1.05rem; }
.logout-form { margin: 0; }

.btn-link {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: #FFF;
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.btn-link:hover { background: rgba(255,255,255,0.1); }

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: #FFF;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    transition: background 0.15s;
}

.theme-toggle:hover { background: rgba(255,255,255,0.1); }

/* Icon-Sichtbarkeit per Theme */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }

:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }
    :root:not([data-theme="light"]):not([data-theme="dark"]) .theme-toggle .icon-sun { display: inline; }
}

/* Container */
.container {
    flex: 1;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.auth-page .container {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.auth-card { max-width: 420px; width: 100%; }
.auth-card-wide { max-width: 560px; }

h1 {
    margin: 0 0 1.25rem 0;
    color: var(--text-strong);
    font-size: 1.5rem;
    font-weight: 700;
}

h2 {
    color: var(--text-strong);
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.muted { color: var(--muted); font-size: 0.9rem; }

/* Form */
form label {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-strong);
    font-weight: 500;
}

input[type="email"], input[type="password"], input[type="text"] {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    margin-top: 0.35rem;
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.btn {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    width: 100%;
    text-decoration: none;
}
.btn:hover, .btn:focus, .btn:active { text-decoration: none; }

.btn-primary { background: var(--orange); color: #FFF; }
.btn-primary:hover { background: var(--orange-dark); }

/* Flash */
.flash { padding: 0.75rem 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: 0.9rem; }
.flash-error { background: var(--error-bg); color: var(--error); border: 1px solid var(--error); }
.flash-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }

/* TOTP Setup */
.totp-setup {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem;
    background: var(--card-inner);
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.qr {
    width: 180px;
    height: 180px;
    background: #FFF;
    padding: 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.totp-info { flex: 1; min-width: 0; }
.totp-secret-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.35rem; }

.totp-secret {
    display: inline-block;
    background: var(--input-bg);
    color: var(--text-strong);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

/* Status-Liste */
.status-list { list-style: none; padding: 0; margin: 0.75rem 0; }
.status-list li { padding: 0.35rem 0; color: var(--text); font-size: 0.95rem; }

/* Footer */
.footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: var(--footer-bg);
}

@media (max-width: 600px) {
    .totp-setup { flex-direction: column; align-items: stretch; }
    .qr { margin: 0 auto; }
    .topbar { flex-wrap: wrap; gap: 0.5rem; }
    .app-name { margin-left: 0; }
}

/* ---------- Phase 2 ---------- */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.page-header h1 { margin-bottom: 0; }

.btn-inline { width: auto; display: inline-block; }
.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--card-inner); }

.btn-link-inline {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
}
.btn-link-inline:hover { color: var(--orange); }

.btn-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.btn-mini {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    color: var(--orange);
    border: 1px solid var(--orange);
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.15s;
}
.btn-mini:hover { background: var(--orange); color: #FFF; }

textarea {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    margin-top: 0.35rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    transition: border-color 0.15s, box-shadow 0.15s;
    resize: vertical;
}
textarea:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

select {
    display: block;
    width: 100%;
    padding: 0.55rem 0.85rem;
    font: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
}

input[type="file"] {
    display: block;
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.35rem;
    background: var(--input-bg);
    border: 1px dashed var(--input-border);
    border-radius: 4px;
    color: var(--text);
}

/* Stat-Grid (Dashboard + Report) */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-tile {
    background: var(--card-inner);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color 0.15s, transform 0.05s;
}
.stat-tile:hover { border-color: var(--orange); }
a.stat-tile:active { transform: scale(0.98); }

.stat-num {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-strong);
    line-height: 1;
}
.stat-label {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.3rem;
}
.stat-warn .stat-num { color: var(--error); }
.stock-green-bg { border-color: var(--success); }

/* Tabellen */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.92rem;
}
.data-table th, .data-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    background: var(--card-inner);
    color: var(--text-strong);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.data-table tr:hover td { background: var(--card-inner); }
.data-table code {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--text-strong);
}
.text-right { text-align: right; }

.table-scroll {
    overflow-x: auto;
    margin: 0.5rem 0 1rem 0;
    border: 1px solid var(--border);
    border-radius: 4px;
}

/* Stock-Badges */
.stock-badge {
    display: inline-block;
    min-width: 2.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
}
.stock-red    { background: var(--error-bg); color: var(--error); }
.stock-yellow { background: rgba(255,132,0,0.15); color: var(--orange); }
.stock-green  { background: var(--success-bg); color: var(--success); }

/* Tabs (Detail + Import) */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 2px solid var(--border);
    margin: 1.5rem 0 0 0;
}
.tab {
    display: inline-block;
    padding: 0.65rem 1rem;
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    background: transparent;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    font-family: inherit;
}
.tab:hover { color: var(--text-strong); }
.tab-active {
    color: var(--orange);
    border-bottom-color: var(--orange);
    font-weight: 600;
}
.tab-count {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.5rem;
    background: var(--card-inner);
    border-radius: 10px;
    font-size: 0.75rem;
    color: var(--muted);
}
.tab-active .tab-count { background: var(--orange); color: #FFF; }

/* Import-Form Grid */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Mapping-Tabelle */
.mapping-table td:first-child { width: 35%; }
.required-mark { color: var(--orange); font-weight: 700; margin-left: 0.2rem; }
.preview-table { font-size: 0.8rem; }
.preview-table th, .preview-table td { padding: 0.4rem 0.5rem; white-space: nowrap; }

/* Note-Box (Produkt-Stammdaten-Notiz) */
.note-box {
    background: var(--card-inner);
    border-left: 3px solid var(--orange);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
    white-space: pre-wrap;
    color: var(--text);
    font-size: 0.92rem;
}

.rejected-row td { background: var(--error-bg); color: var(--error); }
.rejected-row code { color: var(--error); }

/* ---------- Suche ---------- */

.brand-link {
    text-decoration: none;
    color: inherit;
    display: block;
    flex-shrink: 0;
}

.topbar-search {
    position: relative;
    flex: 1;
    max-width: 600px;
    margin: 0 1rem;
}

.topbar-search input {
    width: 100%;
    padding: 0.5rem 0.85rem;
    margin-top: 0;
    font-size: 0.92rem;
    color: #FFF;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    transition: background 0.15s, border-color 0.15s;
}
.topbar-search input::placeholder { color: rgba(255,255,255,0.55); }
.topbar-search input:focus {
    outline: none;
    background: rgba(255,255,255,0.15);
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255,132,0,0.2);
}

.search-dropdown {
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    margin-top: 6px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    z-index: 1000;
    max-height: 70vh;
    overflow-y: auto;
}

.sr-section {
    padding: 0.4rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    background: var(--card-inner);
    border-top: 1px solid var(--border);
}
.sr-section:first-child { border-top: 0; }

.sr-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem;
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.05s;
}
.sr-item:last-child { border-bottom: 0; }
.sr-item:hover, .sr-item.sr-active {
    background: var(--card-inner);
    color: var(--text-strong);
}

.sr-icon { flex-shrink: 0; font-size: 1rem; width: 1.5rem; text-align: center; }
.sr-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-text code { font-family: 'Courier New', monospace; font-size: 0.85rem; }
.sr-muted { color: var(--muted); font-size: 0.85rem; margin-left: 0.4rem; }

.sr-exact {
    background: rgba(255,132,0,0.08);
    border-left: 3px solid var(--orange);
}

.sr-counter {
    background: var(--card-inner);
    color: var(--muted);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sr-status {
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}
.sr-st-LAGER     { background: var(--success-bg); color: var(--success); }
.sr-st-VERGEBEN  { background: rgba(255,132,0,0.15); color: var(--orange); }
.sr-st-FAULTY,
.sr-st-RMA,
.sr-st-BLOCKIERT { background: var(--error-bg); color: var(--error); }
.sr-st-ERSATZ    { background: var(--card-inner); color: var(--muted); }

.sr-empty {
    padding: 1rem 0.85rem;
    color: var(--muted);
    text-align: center;
    font-size: 0.9rem;
}

.sr-more {
    color: var(--orange) !important;
    font-weight: 600;
    background: var(--card-inner);
}

mark {
    background: rgba(255,132,0,0.35);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 700;
}

.search-page-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.search-page-form input[type="text"] { margin-top: 0; }

.exact-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    background: rgba(255,132,0,0.08);
    border: 1px solid var(--orange);
    border-radius: 6px;
}
.exact-icon { font-size: 1.5rem; }
.exact-text { flex: 1; }
.exact-text code {
    font-family: 'Courier New', monospace;
    background: var(--card-inner);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

.result-count {
    background: var(--card-inner);
    color: var(--muted);
    padding: 0.15rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.no-results {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 1rem;
}

kbd {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    background: var(--card-inner);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-strong);
}

@media (max-width: 700px) {
    .topbar-search { display: none; }
}

/* ---------- Phase 3: Modals + Aktionen ---------- */

.action-cell { white-space: nowrap; }
.action-cell .btn-mini { margin-left: 0.25rem; }

.btn-mini-primary {
    color: #FFF !important;
    background: var(--orange);
    border-color: var(--orange) !important;
}
.btn-mini-primary:hover { background: var(--orange-dark); }

.warning-box {
    background: rgba(200, 49, 42, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 0.7rem 0.85rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Native <dialog>-Styling */
.dlg {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.75rem;
    background: var(--card);
    color: var(--text);
    max-width: 520px;
    width: calc(100% - 2rem);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.dlg::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}
.dlg h2 {
    margin-top: 0;
    color: var(--text-strong);
    font-size: 1.2rem;
    font-weight: 700;
}
.dlg form > label {
    display: block;
    margin: 0.75rem 0;
}
.dlg .btn-row {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.dlg input[type="text"],
.dlg input[type="number"],
.dlg select,
.dlg textarea {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text);
}

/* ============================================================
   Pagination (Detail-Page)
   ============================================================ */
.pagination-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1rem 0;
    padding: 0.6rem 0;
}
.pagination-toolbar.pagination-bottom {
    border-top: 1px solid var(--border-color, #2a2a4a);
    margin-top: 0;
    padding-top: 0.8rem;
    justify-content: center;
}
.pagination-info { font-size: 0.92em; }
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.pagination-select-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}
.pagination-select-label select {
    padding: 0.4rem 0.6rem;
    min-height: 38px;
    min-width: 70px;
    font-size: 1em;
    background: var(--bg-card, #1a1a3a);
    color: var(--text-color, #fff);
    border: 1px solid var(--border-color, #2a2a4a);
    border-radius: 6px;
}
.page-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}
.page-info {
    font-size: 0.95em;
    padding: 0 0.4rem;
    white-space: nowrap;
}
.btn-mini-disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}

/* ============================================================
   Status-Badges (Import-Report)
   ============================================================ */
.badge {
    display: inline-block;
    padding: 0.15em 0.6em;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-lager     { background: #1f6d3a; color: #fff; }
.badge-vergeben  { background: #4a4a4a; color: #fff; }
.badge-faulty    { background: #8a4a1f; color: #fff; }
.badge-ersatz    { background: #2c5d8c; color: #fff; }
.badge-blockiert { background: #6d1f1f; color: #fff; }
.badge-rma       { background: #6d3a1f; color: #fff; }
.badge-extern    { background: #ff8400; color: #fff; }
.badge-nomatch   { background: #55607a; color: #fff; }

/* ============================================================
   Mobile-Anpassung Pagination
   ============================================================ */
@media (max-width: 600px) {
    .pagination-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .pagination-controls {
        justify-content: space-between;
        gap: 0.8rem;
    }
    .page-nav { gap: 0.4rem; }
    .pagination-select-label select { min-height: 44px; min-width: 80px; }
    .btn-mini { min-height: 44px; padding: 0.5rem 0.8rem; }
}

/* ============================================================
   Topbar Nav-Icons (Punkt 1)
   ============================================================ */
.topbar { flex-wrap: wrap; row-gap: 0.5rem; }
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.nav-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.7rem;
    color: #FFF;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}
.nav-icon svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.nav-icon:hover, .nav-icon:focus {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    text-decoration: none;
}
.nav-icon-active {
    background: rgba(255,132,0,0.15);
    border-color: var(--orange);
    color: var(--orange);
}
.nav-icon-active:hover {
    background: rgba(255,132,0,0.25);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
}

/* ============================================================
   Product Image / Thumbnails (Punkt 2)
   ============================================================ */
.product-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.product-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color, #2a2a4a);
    border-radius: 6px;
    flex-shrink: 0;
}
.product-thumb {
    width: 36px;
    height: 36px;
    object-fit: contain;
    background: rgba(255,255,255,0.04);
    border-radius: 4px;
    display: block;
}
.product-thumb-preview {
    width: 100px;
    height: 100px;
    object-fit: contain;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color, #2a2a4a);
    border-radius: 6px;
    margin-top: 0.5rem;
}
.thumb-placeholder {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    opacity: 0.4;
}
.col-thumb {
    width: 50px;
    padding: 0.4rem 0.6rem;
}
.image-preview-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.3rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* ============================================================
   Top-10-Bestand-Box (Punkt 4)
   ============================================================ */
.top10-box {
    background: rgba(255,132,0,0.05);
    border: 1px solid rgba(255,132,0,0.2);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}
.top10-title {
    font-weight: 600;
    display: block;
    margin-bottom: 0.4rem;
}
.top10-list {
    list-style: decimal inside;
    margin: 0;
    padding: 0;
    columns: 2;
    column-gap: 2rem;
}
.top10-list li {
    padding: 0.15rem 0;
    break-inside: avoid;
}
.top10-list a {
    color: var(--text, #FFF);
    text-decoration: none;
}
.top10-list a:hover {
    color: var(--orange);
    text-decoration: underline;
}

/* ============================================================
   Audit-Log View
   ============================================================ */
.audit-table .event-type {
    background: rgba(255,132,0,0.1);
    color: var(--orange);
    padding: 0.15em 0.5em;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
}
.audit-details {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 480px;
    color: var(--text-muted, #aaa);
    line-height: 1.4;
}
.audit-filter-form {
    margin: 0;
    display: flex;
    align-items: center;
}
.audit-filter-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}
.audit-filter-label select {
    padding: 0.4rem 0.6rem;
    background: var(--bg-card, #1a1a3a);
    color: var(--text, #FFF);
    border: 1px solid var(--border-color, #2a2a4a);
    border-radius: 4px;
    min-height: 38px;
}

/* ============================================================
   Tabellen-Scroll bei Overflow (Punkt 3 — Mobile)
   ============================================================ */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
}
.table-scroll table {
    min-width: 100%;
}

/* ============================================================
   Mobile / Tablet Anpassungen (Punkt 3)
   ============================================================ */
@media (max-width: 900px) {
    .topbar {
        padding: 0.5rem 0.75rem;
        gap: 0.75rem;
    }
    .topbar-search {
        order: 99;
        width: 100%;
        margin-top: 0.4rem;
    }
    .nav-icon {
        padding: 0.55rem 0.6rem;
    }
    .nav-icon svg {
        width: 22px;
        height: 22px;
    }
    .brand-tagline {
        display: none;
    }
}

@media (max-width: 600px) {
    .topbar {
        padding: 0.5rem;
    }
    .topbar-actions {
        margin-left: auto;
    }
    .brand-name {
        font-size: 0.9rem;
    }
    .product-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
    .product-image {
        width: 64px;
        height: 64px;
    }
    .top10-list {
        columns: 1;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
    .page-header .btn-row {
        width: 100%;
    }
    .page-header .btn-inline {
        width: 100%;
    }
    .btn-mini {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 0.5rem 0.85rem;
    }
}

/* ============================================================
   Button-Underline-Fix global (Punkt 5)
   ============================================================ */
a.btn, a.btn-mini, a.btn-link, a.btn-inline,
a.btn-primary, a.btn-secondary, a.btn-link-inline,
.btn:link, .btn:visited, .btn:hover, .btn:active,
.btn-mini:link, .btn-mini:visited, .btn-mini:hover, .btn-mini:active {
    text-decoration: none;
}

/* ============================================================
   Profil-Page + 2FA-Checkbox
   ============================================================ */
.profil-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #2a2a4a);
}
.profil-section:first-of-type {
    margin-top: 1rem;
    padding-top: 0;
    border-top: none;
}
.profil-section h2 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.6rem;
    margin: 1rem 0 !important;
    cursor: pointer;
    font-weight: normal !important;
    color: var(--text, #FFF);
    font-size: 0.9rem;
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}
.trust-revoke-form {
    margin-top: 1rem;
}

/* ============================================================
   Action-Icons (Archive, Trash, Restore, Delete-Permanent)
   ============================================================ */
.action-icons {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.inline-form {
    display: inline-flex;
    margin: 0;
}
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border-color, rgba(255,255,255,0.2));
    border-radius: 4px;
    cursor: pointer;
    color: var(--text, #FFF);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    padding: 0;
}
.icon-btn svg {
    width: 16px;
    height: 16px;
}
.icon-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.4);
}
.icon-btn-primary {
    color: var(--orange);
    border-color: rgba(255,132,0,0.4);
}
.icon-btn-primary:hover {
    background: rgba(255,132,0,0.15);
    border-color: var(--orange);
}
.icon-btn-danger {
    color: #e88; /* helles rot */
    border-color: rgba(220,80,80,0.3);
}
.icon-btn-danger:hover {
    background: rgba(220,80,80,0.15);
    border-color: rgba(220,80,80,0.6);
    color: #f88;
}
.icon-btn-danger-strong {
    color: #fff;
    background: rgba(180,40,40,0.5);
    border-color: rgba(180,40,40,0.8);
}
.icon-btn-danger-strong:hover {
    background: rgba(220,40,40,0.8);
    border-color: rgba(255,80,80,1);
}

/* ============================================================
   Status-Banner für archived/trashed Produkt-Detail
   ============================================================ */
.status-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1rem;
    margin: 0 0 1rem;
    border-radius: 6px;
    font-size: 0.92rem;
    flex-wrap: wrap;
}
.status-banner-warn {
    background: rgba(255,132,0,0.12);
    border: 1px solid rgba(255,132,0,0.4);
    color: var(--orange);
}
.status-banner-danger {
    background: rgba(220,80,80,0.12);
    border: 1px solid rgba(220,80,80,0.4);
    color: #f88;
}
.status-banner .btn-mini-primary {
    background: var(--orange);
    color: #fff;
    border-color: var(--orange);
    margin-left: auto;
}

/* ============================================================
   Listenfooter mit Archiv/Papierkorb-Link
   ============================================================ */
.list-footer-links {
    margin-top: 1rem;
    font-size: 0.85rem;
}
.list-footer-links a {
    color: var(--text-muted, #aaa);
    text-decoration: none;
}
.list-footer-links a:hover {
    color: var(--orange);
}

/* Mobile-Anpassung für Action-Icons */
@media (max-width: 600px) {
    .icon-btn {
        width: 44px;
        height: 44px;
    }
    .icon-btn svg {
        width: 20px;
        height: 20px;
    }
    .action-icons {
        gap: 0.5rem;
    }
}

/* ============================================================
   Top 10 — Lagerbestand Card
   ============================================================ */
.top10-card {
    background: rgba(255, 132, 0, 0.04);
    border: 1px solid rgba(255, 132, 0, 0.2);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1rem 0 1.5rem;
}
.top10-heading {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--orange);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.top10-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.top10-table thead th {
    text-align: left;
    color: var(--text-muted, #aaa);
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.top10-table tbody td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.top10-table tbody tr:last-child td {
    border-bottom: none;
}
.top10-table .rank-col {
    width: 2.5rem;
    color: var(--text-muted, #aaa);
    font-variant-numeric: tabular-nums;
}
.top10-table .text-right {
    text-align: right;
}
.top10-table a {
    color: var(--text, #FFF);
    text-decoration: none;
}
.top10-table a:hover {
    color: var(--orange);
}
.top10-empty {
    margin: 0;
    padding: 0.5rem 0;
    font-style: italic;
}

/* ============================================================
   Inventur-Page
   ============================================================ */
.inventur-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0 1.5rem;
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
}
.inventur-form input[type="date"] {
    height: 38px;
    padding: 0 0.6rem;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    background: var(--input-bg, #1a1a2e);
    color: var(--text, #FFF);
    font-family: inherit;
    font-size: 0.95rem;
    color-scheme: dark;
    margin: 0;
}
.inventur-form .btn,
.inventur-form .btn-inline,
.inventur-form a.btn-inline {
    height: 38px !important;
    padding: 0 1.2rem !important;
    font-size: 0.95rem !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    min-height: 38px !important;
    max-height: 38px !important;
}
.inventur-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 1.25rem 0;
}
.inventur-summary .stat-tile {
    background: rgba(255, 132, 0, 0.06);
    border: 1px solid rgba(255, 132, 0, 0.25);
}
.inventur-hint {
    margin: 1.5rem 0 0;
    padding: 0.8rem 1rem;
    background: rgba(255,255,255,0.03);
    border-left: 3px solid var(--orange);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-muted, #aaa);
    line-height: 1.5;
}
.inventur-hint code {
    background: rgba(255,132,0,0.1);
    color: var(--orange);
    padding: 0.05em 0.35em;
    border-radius: 3px;
    font-size: 0.85em;
}
@media (max-width: 700px) {
    .inventur-summary {
        grid-template-columns: 1fr;
    }
    .inventur-form {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================================
   Phase 8 — Such-Dropdown Produkt-Cards (große Cards statt sr-item)
   ============================================================ */
.sr-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background 0.05s;
}
.sr-card:last-child { border-bottom: 0; }
.sr-card:hover,
.sr-card.sr-active {
    background: var(--card-inner);
}

.sr-card-thumb {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 4px;
    object-fit: contain;
    background: var(--card-inner);
    border: 1px solid var(--border);
}
.sr-card-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--muted);
}

.sr-card-content {
    flex: 1;
    min-width: 0;
}
.sr-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    color: var(--text-strong);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.sr-card-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.2rem;
}
.sr-card-meta code {
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
}

.sr-card-badge {
    flex-shrink: 0;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.sr-card-badge-ok {
    background: var(--success-bg);
    color: var(--success);
}
.sr-card-badge-empty {
    background: var(--error-bg);
    color: var(--error);
}

/* ============================================================
   Phase 8 — Copy-Button in Key-Tabelle
   ============================================================ */
.key-cell {
    white-space: nowrap;
}
.key-cell code {
    margin-right: 0.4rem;
}
.btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    vertical-align: middle;
    transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.05s;
}
.btn-copy:hover,
.btn-copy:focus-visible {
    color: var(--orange);
    border-color: var(--orange);
    background: var(--card-inner);
    outline: none;
}
.btn-copy:active {
    transform: scale(0.92);
}
.btn-copy svg { display: block; }

@media (max-width: 900px) {
    .btn-copy {
        width: 44px;
        height: 44px;
    }
    .btn-copy svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================================
   Phase 8 — Toast (singleton, bottom-right)
   ============================================================ */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.7rem 1.1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #FFF;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    pointer-events: none;
    z-index: 2000;
}
.toast-visible {
    opacity: 1;
    transform: translateY(0);
}
.toast-success { background: var(--success); }
.toast-error   { background: var(--error); }

/* ============================================================
   Phase 8 — Wide-Pages für Listen/Tabellen mit vielen Spalten
   (Produkte, Audit-Log, Archiv, Papierkorb, Inventur)
   Detail-/Form-Seiten bleiben bei 960px für gute Lesbarkeit.
   ============================================================ */
body.wide-page .container {
    max-width: 1400px;
}

/* ============================================================
   Phase 8.1 — Lesbare Links in Datentabellen
   (Browser-Default ist auf Dark-BG schlecht lesbar)
   ============================================================ */
.data-table a {
    color: var(--text-strong);
    text-decoration: underline;
    text-decoration-color: var(--muted);
    text-underline-offset: 2px;
    transition: color 0.15s, text-decoration-color 0.15s;
}
.data-table a:hover,
.data-table a:focus-visible {
    color: var(--orange);
    text-decoration-color: var(--orange);
    outline: none;
}

/* ============================================================
   Phase 8.1 — Pagination-Counter sichtbarer (grün, fett)
   + Counter auch in der unteren Toolbar
   ============================================================ */
.pagination-counter {
    color: var(--success);
    font-weight: 700;
    font-size: 0.92em;
}
.pagination-toolbar.pagination-bottom {
    justify-content: space-between;
}

/* ============================================================
   Phase 8.2 — Layout-Fixes Detail-Seite
   - "Pro Seite:" Label nicht mehr zerrissen (nowrap)
   - KEY-Spalte: lange Keys umbrechen, andere Spalten profitieren
   ============================================================ */
.pagination-select-label {
    white-space: nowrap;
}
.pagination-select-label select {
    margin-left: 0.4rem;
}

.data-table th.col-key,
.data-table td.col-key {
    word-break: break-all;
    max-width: 480px;
}

/* ============================================================
   Phase 8.2 — Sortierbare Tabellen-Header
   - Header sind Links, Cursor pointer, Pfeil-Indikator
   - Aktive Spalte hervorgehoben (Orange), Pfeil voll sichtbar
   - Inaktive Spalten zeigen dezenten Doppelpfeil ⇅
   ============================================================ */
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}
.data-table th.sortable a {
    color: var(--text-strong);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}
.data-table th.sortable a:hover {
    color: var(--orange);
}
.data-table th.sortable .sort-arrow {
    font-size: 0.75em;
    line-height: 1;
}
.data-table th.sortable.sortable-active a {
    color: var(--orange);
}
.data-table th.sortable.sortable-active .sort-arrow {
    color: var(--orange);
}
.data-table th.sortable .sort-arrow-inactive {
    opacity: 0.35;
}
.data-table th.sortable a:hover .sort-arrow-inactive {
    opacity: 0.7;
}

/* ============================================================
   Phase 8.2 — Counter-Farbe nach Status
   - LAGER/ERSATZ: grün (Default, schon gesetzt)
   - VERGEBEN/BLOCKIERT: rot (verkauft / nicht verfügbar)
   - FAULTY/RMA: orange (problematisch)
   ============================================================ */
.pagination-counter-VERGEBEN,
.pagination-counter-BLOCKIERT {
    color: var(--error);
}
.pagination-counter-FAULTY,
.pagination-counter-RMA {
    color: var(--orange);
}

/* ============================================================
   Phase 9 — Search-Dropdown: Section-Label für Auslieferungen
   ============================================================ */
.sr-section-label {
    padding: 0.5rem 0.75rem 0.3rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    border-top: 1px solid var(--border);
    margin-top: 0.3rem;
    font-weight: 600;
}

/* ============================================================
   Phase 9.2 — Auslieferungs-Liste: Filter-Form + Tabelle responsive
   ============================================================ */

.ausl-filter-form {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: center;
    margin: 0.5rem 0 1.25rem;
}
.ausl-filter-source {
    flex: 0 0 auto;
}
.ausl-filter-source select {
    min-width: 150px;
    height: 38px;
    padding: 0 0.6rem;
    box-sizing: border-box;
    font-size: 0.95rem;
}
.ausl-filter-search {
    flex: 1 1 0;
    min-width: 200px;
}
.ausl-filter-search input {
    width: 100%;
    height: 38px;
    padding: 0 0.7rem;
    box-sizing: border-box;
    font-size: 0.95rem;
    margin: 0;
}
.ausl-filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 0 0 auto;
}
.ausl-filter-actions .btn,
.ausl-filter-actions .btn-inline,
.ausl-filter-actions a.btn-inline {
    height: 38px !important;
    padding: 0 1.2rem !important;
    font-size: 0.95rem !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    min-height: 38px !important;
    max-height: 38px !important;
}

/* Produktname: max 2 Zeilen, dann Ellipsis. SKU dezent darunter. */
.ausl-col-produkt {
    max-width: 320px;
    min-width: 180px;
}
.ausl-produkt-link {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    line-height: 1.3;
}
.ausl-produkt-sku {
    margin-top: 0.15rem;
    font-size: 0.78em;
    color: var(--muted);
}
.ausl-sub {
    font-size: 0.8em;
    color: var(--muted);
    margin-top: 0.15rem;
}

/* Spalten-Vorgaben */
.ausl-col-date     { white-space: nowrap; min-width: 105px; }
.ausl-col-key code,
.ausl-col-ref code,
.ausl-col-source code { font-size: 0.82em; }
.ausl-col-key      { word-break: break-all; max-width: 220px; }
.ausl-col-ref      { white-space: nowrap; }
.ausl-col-source   { white-space: nowrap; }
.ausl-col-empfaenger,
.ausl-col-ebay     { max-width: 200px; word-break: break-word; }

/* ----- Mobile / Tablet ----- */
@media (max-width: 1100px) {
    /* Quelle als Tag, weniger Platz */
    .ausl-col-source code { font-size: 0.75em; }
    .ausl-col-produkt { max-width: 220px; }
}
@media (max-width: 820px) {
    /* Filter-Form vertikal stack auf schmalem Screen */
    .ausl-filter-form {
        flex-wrap: wrap;
        flex-direction: column;
        align-items: stretch;
    }
    .ausl-filter-source,
    .ausl-filter-search { width: 100%; }
    .ausl-filter-source select,
    .ausl-filter-search input { width: 100%; }
    .ausl-filter-actions { justify-content: flex-end; }

    /* Tabelle: Empfänger-Name + eBay-User in eine Spalte zusammenfassen optisch nicht möglich
       ohne Markup-Change. Stattdessen: weniger wichtige Spalten dezenter. */
    .ausl-col-source { display: none; } /* Quelle versteckt — bei Bedarf via Filter klar */
    .ausl-col-produkt { max-width: 180px; }
}
@media (max-width: 600px) {
    /* eBay-User in die Empfänger-Zelle "logisch" reinrücken durch verstecken */
    .ausl-col-ebay { display: none; }
    .ausl-col-produkt { max-width: 140px; min-width: 120px; }
    .ausl-col-key { max-width: 140px; }
    .ausl-produkt-link { -webkit-line-clamp: 3; line-clamp: 3; }
}

/* ============================================================
   Phase 9.3 — Bulk-Edit für Keys (Detail-View)
   ============================================================ */

.bulk-col {
    width: 36px;
    text-align: center;
    padding: 0 0.3rem;
}
.bulk-col input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}

.bulk-edit-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    margin: 0.5rem 0 1rem;
    background: rgba(255, 132, 0, 0.12);
    border: 1px solid rgba(255, 132, 0, 0.4);
    border-radius: 6px;
    color: var(--text);
}
.bulk-edit-bar .bulk-edit-count {
    font-weight: 600;
}
.bulk-edit-bar [data-bulk-count] {
    color: #ff8400;
    font-weight: 700;
}

.bulk-edit-panel {
    background: var(--card-bg, #1a1f3a);
    border: 1px solid var(--border, #2a2f4a);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 0 0 1.25rem;
}
.bulk-edit-title {
    margin: 0 0 0.3rem;
    font-size: 1.1rem;
    font-weight: 600;
}
.bulk-edit-hint {
    margin: 0 0 1rem;
    font-size: 0.85rem;
}
.bulk-edit-fields {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.bulk-edit-row {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0.75rem;
    align-items: center;
}
.bulk-edit-fieldlabel {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.95rem;
}
.bulk-edit-fieldlabel input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.bulk-edit-row input[type="text"],
.bulk-edit-row textarea {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
}
.bulk-edit-row textarea {
    resize: vertical;
    min-height: 50px;
}
.bulk-edit-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Mobile */
@media (max-width: 720px) {
    .bulk-edit-row {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
    .bulk-edit-bar {
        flex-wrap: wrap;
    }
}

/* Info-Hint-Icon in Bulk-Edit Field-Labels */
.bulk-field-hint {
    display: inline-block;
    margin-left: 0.3rem;
    color: var(--muted);
    cursor: help;
    font-size: 0.9rem;
    font-weight: normal;
}
.bulk-field-hint:hover {
    color: var(--orange);
}
