/* =====================================================================
   Lagerbestand V2 – Design-System
   Farbwelt: Professionelles Navy/Slate mit blauem Akzent (#0369A1)
   Themes:   Light (Standard) & Dark über [data-theme="dark"]
   ===================================================================== */

:root {
    /* Marken- & Statusfarben */
    --primary: #0369a1;
    --primary-hover: #075985;
    --primary-soft: #e0f2fe;
    --success: #15803d;
    --success-soft: #dcfce7;
    --warning: #b45309;
    --warning-soft: #fef3c7;
    --danger: #b91c1c;
    --danger-soft: #fee2e2;
    --info: #0e7490;
    --info-soft: #cffafe;

    /* Flächen & Text (Light) */
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #475569;
    --text-faint: #94a3b8;

    /* Sidebar (immer dunkel – Markenanker) */
    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5e1;
    --sidebar-active-bg: #1e293b;
    --sidebar-active-text: #ffffff;
    --sidebar-border: #1e293b;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, .10);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .18);

    --radius: 10px;
    --radius-sm: 7px;
    --sidebar-width: 248px;

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;

    color-scheme: light;
}

[data-theme="dark"] {
    --primary: #38bdf8;
    --primary-hover: #7dd3fc;
    --primary-soft: #0c3450;
    --success: #4ade80;
    --success-soft: #14351f;
    --warning: #fbbf24;
    --warning-soft: #3a2c0d;
    --danger: #f87171;
    --danger-soft: #3f1717;
    --info: #22d3ee;
    --info-soft: #0c3038;

    --bg: #0b1220;
    --surface: #121b2e;
    --surface-2: #16203a;
    --border: #24304a;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-faint: #64748b;

    --sidebar-bg: #0a101d;
    --sidebar-border: #1a2438;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .45);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .6);

    color-scheme: dark;
}

/* ---------------- Basis ---------------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    background: var(--bg);
    color: var(--text);
}

img { max-width: 100%; display: block; }
svg { flex-shrink: 0; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.3; }

code { font-family: var(--mono); font-size: .85em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: .1em .35em; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: .82rem; }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-nowrap  { white-space: nowrap; }
.text-success { color: var(--success); font-weight: 600; }
.text-danger  { color: var(--danger); font-weight: 600; }
.mono         { font-family: var(--mono); font-size: .82rem; }

/* ---------------- App-Shell ---------------- */

.app-shell { display: flex; min-height: 100vh; }

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
}

.content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

.app-footer {
    padding: 1rem 1.5rem;
    font-size: .78rem;
    color: var(--text-faint);
    border-top: 1px solid var(--border);
}

/* ---------------- Sidebar ---------------- */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0369a1, #075985);
    color: #fff;
}

.brand-mark-lg { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto; }

.brand-text { font-weight: 700; color: #fff; font-size: 1.02rem; letter-spacing: .01em; }

.brand-version {
    font-size: .62rem;
    font-weight: 700;
    background: #0369a1;
    color: #fff;
    border-radius: 4px;
    padding: .1em .4em;
    margin-left: .45em;
    vertical-align: middle;
    letter-spacing: .05em;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: .8rem .7rem; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .62rem .8rem;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: .92rem;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.nav-item:hover { background: var(--sidebar-active-bg); color: #fff; }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); box-shadow: inset 3px 0 0 var(--primary); }

.nav-item-button { width: 100%; background: none; border: none; font: inherit; text-align: left; }

.nav-badge {
    margin-left: auto;
    background: #0369a1;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .05em .55em;
}

.sidebar-footer { padding: .7rem; border-top: 1px solid var(--sidebar-border); display: flex; flex-direction: column; gap: 2px; }

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, .55);
    z-index: 35;
}

/* ---------------- Topbar ---------------- */

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .8rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-title { font-size: 1.15rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar-actions { display: flex; align-items: center; gap: .4rem; }

.icon-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.icon-button:hover { background: var(--surface-2); color: var(--text); }

.sidebar-toggle { display: none; }

.indicator-badge {
    position: absolute;
    top: 4px;
    right: 3px;
    min-width: 17px;
    height: 17px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark  { display: inline-flex; }
.theme-icon-dark  { display: none; }
.theme-icon-light { display: inline-flex; }

.user-chip {
    display: flex;
    align-items: center;
    gap: .55rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: .28rem .75rem .28rem .3rem;
    cursor: pointer;
    font: inherit;
    transition: background-color .15s;
}

.user-chip:hover { background: var(--surface-2); }

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0369a1, #075985);
    color: #fff;
    font-weight: 700;
    font-size: .82rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------------- Dropdowns ---------------- */

.dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 230px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: .35rem;
    z-index: 50;
}

.dropdown-menu-wide { min-width: 330px; max-width: 92vw; }

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .55rem .7rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .3rem;
}

.dropdown-header .text-muted { display: block; font-size: .78rem; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .55rem .7rem;
    border: none;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text);
    font: inherit;
    font-size: .9rem;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s;
}

.dropdown-item:hover { background: var(--surface-2); color: var(--text); }

.dropdown-empty { padding: 1.2rem .7rem; text-align: center; color: var(--text-faint); font-size: .88rem; }

.dropdown-footer {
    display: block;
    text-align: center;
    padding: .55rem;
    font-size: .85rem;
    font-weight: 600;
    border-top: 1px solid var(--border);
    margin-top: .3rem;
}

.notif-item { flex-direction: column; align-items: flex-start; gap: .15rem; }
.notif-item.unread { background: var(--primary-soft); }
.notif-item.unread:hover { background: var(--primary-soft); filter: brightness(.97); }
.notif-title { font-weight: 600; font-size: .86rem; }
.notif-meta { font-size: .76rem; color: var(--text-muted); }

/* ---------------- Buttons ---------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .55rem 1.05rem;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
[data-theme="dark"] .btn-primary { color: #06222f; }
[data-theme="dark"] .btn-primary:hover { color: #06222f; }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.08); color: #fff; }
[data-theme="dark"] .btn-success { color: #05230f; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); color: #fff; }
[data-theme="dark"] .btn-danger { color: #2b0707; }

.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm { padding: .35rem .7rem; min-height: 34px; font-size: .82rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }

.link-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
}
.link-button:hover { text-decoration: underline; }

.link { font-size: .86rem; font-weight: 600; }

/* ---------------- Cards ---------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    padding: .95rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.card-header h2 { font-size: .98rem; }

.card-body { padding: 1.25rem; }
.card-body-flush { padding: 0; }
.card-footer { padding: .95rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2); }

.card-form { max-width: 980px; }

/* ---------------- Statistiken (Dashboard) ---------------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.1rem;
    color: var(--text);
}

.stat-card-link { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.stat-card-link:hover { box-shadow: var(--shadow-md); border-color: var(--primary); color: var(--text); }

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-primary { background: var(--primary-soft); color: var(--primary); }
.stat-icon-success { background: var(--success-soft); color: var(--success); }
.stat-icon-warning { background: var(--warning-soft); color: var(--warning); }
.stat-icon-danger  { background: var(--danger-soft);  color: var(--danger); }
.stat-icon-info    { background: var(--info-soft);    color: var(--info); }

.stat-value { font-size: 1.45rem; font-weight: 750; line-height: 1.15; }
.stat-label { font-size: .8rem; color: var(--text-muted); }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.dashboard-grid .card { margin-bottom: 0; }

@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

.chart { width: 100%; min-height: 240px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart-donut { display: flex; align-items: center; justify-content: center; }

.empty-hint { color: var(--text-faint); text-align: center; padding: 2rem 1rem; margin: 0; }

/* ---------------- Tabellen ---------------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table { width: 100%; border-collapse: collapse; font-size: .88rem; }

.table th {
    text-align: left;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    background: var(--surface-2);
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table th.text-right { text-align: right; }

.table td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr { transition: background-color .12s; }
.table-hover tbody tr:hover { background: var(--surface-2); }
tr[data-href] { cursor: pointer; }

.table-compact th, .table-compact td { padding: .5rem .9rem; }

.table-link { color: var(--text); }
.table-link:hover { color: var(--primary); }
.table-actions { display: inline-flex; gap: .25rem; align-items: center; }
.table-actions form { display: inline-flex; }

/* ---------------- Badges ---------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: .3em;
    padding: .22em .65em;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-info    { background: var(--info-soft);    color: var(--info); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-muted   { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

/* ---------------- Formulare ---------------- */

.form-group { margin-bottom: 1.05rem; }

.form-group label {
    display: block;
    font-size: .84rem;
    font-weight: 600;
    margin-bottom: .35rem;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: .58rem .8rem;
    min-height: 42px;
    font: inherit;
    font-size: .92rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

.form-control::placeholder { color: var(--text-faint); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 70px; }
input[type="file"].form-control { padding: .45rem .8rem; cursor: pointer; }

.form-hint { font-size: .78rem; color: var(--text-muted); margin: .35rem 0 0; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.25rem;
}

.form-group-full { grid-column: 1 / -1; }

.form-actions { display: flex; justify-content: flex-end; gap: .7rem; }

.checkbox-label { display: flex; align-items: center; gap: .55rem; font-size: .92rem; cursor: pointer; }
.checkbox-label input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }

.form-control-code {
    font-family: var(--mono);
    font-size: 1.5rem;
    letter-spacing: .45em;
    text-align: center;
}

.qty-input { width: 84px; text-align: center; }

/* ---------------- Seitenkopf & Filter ---------------- */

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

.page-actions-right { display: flex; gap: .6rem; flex-wrap: wrap; }
.page-actions form { margin: 0; }

.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; flex: 1; min-width: 0; }
.filter-bar .form-control { width: auto; min-width: 150px; flex: 0 1 auto; }
.filter-bar .input-with-icon { flex: 1 1 240px; }
.filter-bar .input-with-icon .form-control { width: 100%; min-width: 0; }
.filter-dir { min-width: 130px; }

.input-with-icon { position: relative; }
.input-with-icon > svg {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    pointer-events: none;
}
.input-with-icon .form-control { padding-left: 2.4rem; }

/* ---------------- Artikel-Grid ---------------- */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.1rem;
    margin-bottom: 1.25rem;
}

.product-card { display: flex; flex-direction: column; margin-bottom: 0; transition: box-shadow .15s; }
.product-card:hover { box-shadow: var(--shadow-md); }

.product-thumb {
    display: block;
    aspect-ratio: 4 / 3;
    background: var(--surface-2);
    overflow: hidden;
}

.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.product-thumb:hover img { transform: scale(1.04); }

.product-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-faint);
}

.product-card-body { display: flex; flex-direction: column; gap: .35rem; padding: .9rem 1rem 1rem; flex: 1; }

.product-card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

.product-number { font-weight: 700; font-size: .95rem; color: var(--text); }
.product-number:hover { color: var(--primary); }

.product-title {
    font-size: .84rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}

.product-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .76rem; color: var(--text-faint); }
.product-meta span { display: inline-flex; align-items: center; gap: .3em; }

.product-cart-form { display: flex; gap: .5rem; margin-top: auto; padding-top: .6rem; }
.product-cart-form .btn { flex: 1; }

.product-unavailable {
    margin-top: auto;
    padding-top: .6rem;
    text-align: center;
    color: var(--text-faint);
    font-size: .84rem;
    font-weight: 600;
}

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-faint); }
.empty-state p { margin: .8rem 0 1.2rem; }
.empty-icon { opacity: .5; }

/* ---------------- Detailseiten ---------------- */

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
    margin-bottom: 1.25rem;
}

.detail-grid .card { margin-bottom: 0; }

@media (max-width: 1024px) {
    .detail-grid { grid-template-columns: 1fr; }
}

.product-detail { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.5rem; }

@media (max-width: 768px) {
    .product-detail { grid-template-columns: 1fr; }
}

.gallery-main {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-empty { display: flex; align-items: center; justify-content: center; color: var(--text-faint); }

.gallery-thumbs { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }

.gallery-thumb {
    width: 60px;
    height: 60px;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    background: var(--surface-2);
    transition: border-color .15s;
}

.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--primary); }

.product-info-head { display: flex; align-items: center; gap: .7rem; }
.product-info-head h2 { font-size: 1.3rem; }
.product-info-title { font-size: 1rem; color: var(--text-muted); margin: .25rem 0 .8rem; }

.detail-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .45rem 1.4rem;
    margin: 0;
}

.detail-list dt { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.detail-list dd { margin: 0; font-size: .9rem; }

.image-manage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
.image-manage-item { display: flex; flex-direction: column; gap: .5rem; }
.image-manage-item img { border-radius: var(--radius-sm); border: 1px solid var(--border); aspect-ratio: 1; object-fit: cover; }

.two-col-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .two-col-grid { grid-template-columns: 1fr; }
}

.section-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 1.1rem 0 .5rem; }
.role-hints { margin: .6rem 0 0; padding-left: 1.1rem; font-size: .78rem; color: var(--text-muted); }
.role-hints li { margin-bottom: .2rem; }

.setup-steps { font-size: .88rem; padding-left: 1.2rem; }
.setup-steps li { margin-bottom: .4rem; }
.secret-code { user-select: all; }
.totp-qr { margin: 1rem 0; display: flex; justify-content: center; }
.totp-qr img, .totp-qr canvas { border: 8px solid #fff; border-radius: var(--radius-sm); }

.import-spec { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem 1rem; margin-bottom: 1.1rem; }
.import-columns { display: block; overflow-x: auto; white-space: nowrap; padding: .45em .6em; }

/* ---------------- Benachrichtigungen ---------------- */

.notification-list { list-style: none; margin: 0; padding: 0; }

.notification-row {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    padding: .9rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.notification-row:last-child { border-bottom: none; }

.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin-top: .5rem; }
.notification-row.unread { background: var(--primary-soft); }
.notification-row.unread .notif-dot { background: var(--primary); }

.notification-content .notif-title { color: var(--text); font-weight: 600; font-size: .92rem; }
.notification-content .notif-title:hover { color: var(--primary); }

/* ---------------- Audit ---------------- */

.audit-changes details summary { cursor: pointer; font-size: .82rem; color: var(--primary); font-weight: 600; }
.change-list { list-style: none; margin: .4rem 0 0; padding: 0; font-size: .78rem; }
.change-list li { padding: .15rem 0; }
.change-list del { color: var(--danger); text-decoration: line-through; }
.change-list ins { color: var(--success); text-decoration: none; font-weight: 600; }

/* ---------------- Pagination ---------------- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .8rem;
    margin: 1.25rem 0;
}

.pagination-info { font-size: .82rem; color: var(--text-muted); }
.pagination-links { display: flex; gap: .3rem; }

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 .5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: .88rem;
    font-weight: 600;
    transition: background-color .15s, border-color .15s;
}

.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }
[data-theme="dark"] .page-link.active { color: #06222f; }

/* ---------------- Toasts & Alerts ---------------- */

.toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    max-width: min(430px, calc(100vw - 2rem));
}

.toast {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: .8rem 1rem;
    font-size: .9rem;
    animation: toast-in .25s ease;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: none; }
}

.toast-success { border-left-color: var(--success); }
.toast-success svg { color: var(--success); }
.toast-danger { border-left-color: var(--danger); }
.toast-danger svg { color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-warning svg { color: var(--warning); }
.toast-info svg { color: var(--info); }
.toast-token { border-left-color: var(--warning); flex-wrap: wrap; }
.token-value { word-break: break-all; flex: 1; }

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    padding: .2rem;
    display: inline-flex;
    border-radius: 4px;
}
.toast-close:hover { color: var(--text); background: var(--surface-2); }

.alert {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    margin-bottom: 1.1rem;
    border: 1px solid transparent;
}

.alert svg { flex-shrink: 0; margin-top: .1em; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.alert-danger  { background: var(--danger-soft);  color: var(--danger);  border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.alert-info    { background: var(--info-soft);    color: var(--info);    border-color: color-mix(in srgb, var(--info) 30%, transparent); }

/* ---------------- Login ---------------- */

.auth-body {
    background:
        radial-gradient(1000px 500px at 85% -10%, color-mix(in srgb, var(--primary) 14%, transparent), transparent),
        var(--bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.auth-wrapper { width: 100%; max-width: 420px; }

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 2.2rem 2rem;
}

.auth-brand { text-align: center; margin-bottom: 1.6rem; }
.auth-brand h1 { font-size: 1.35rem; margin-top: .9rem; }
.auth-brand p { margin: .3rem 0 0; font-size: .85rem; }

.auth-form .btn { margin-top: .4rem; }
.auth-footer { text-align: center; font-size: .76rem; color: var(--text-faint); margin-top: 1.2rem; }
.auth-alt-link { text-align: center; margin: 1.1rem 0 0; font-size: .86rem; }
.auth-2fa-info { text-align: center; font-size: .9rem; color: var(--text-muted); margin-bottom: 1.2rem; }

/* ---------------- Scanner ---------------- */

.scanner-viewport {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #0b1220;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1rem;
}

.scanner-viewport video { width: 100%; height: 100%; object-fit: cover; }

.scanner-overlay {
    position: absolute;
    inset: 15% 12%;
    border: 2px solid rgba(255, 255, 255, .8);
    border-radius: 12px;
    box-shadow: 0 0 0 999px rgba(2, 6, 23, .35);
    pointer-events: none;
}

.scanner-result { margin-top: 1.1rem; }

.scanner-result-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    background: var(--surface-2);
}

.scanner-result-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.scanner-result-card .btn { align-self: flex-start; margin-top: .5rem; }

/* ---------------- Etikett / Druck ---------------- */

.print-body { background: var(--bg); padding: 1.5rem; }

.label-page { max-width: 560px; margin: 0 auto; }
.label-toolbar { display: flex; justify-content: space-between; gap: .8rem; margin-bottom: 1.2rem; }

.label-card {
    background: #fff;
    color: #000;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 1.4rem;
}

.label-head { display: flex; flex-direction: column; gap: .15rem; margin-bottom: 1rem; }
.label-number { font-size: 1.3rem; }
.label-title { font-size: .95rem; }
.label-location { font-size: .82rem; color: #334155; }

.label-codes { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap; }
.label-codes svg { max-width: 100%; }
#labelQr img, #labelQr canvas { image-rendering: pixelated; }

@media print {
    .no-print { display: none !important; }
    .print-body { background: #fff; padding: 0; }
    .label-card { border: none; }
}

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
    .main { margin-left: 0; }
    .sidebar-toggle { display: inline-flex; }
    .content { padding: 1rem; }
    .topbar { padding: .7rem 1rem; }
    .user-chip-name { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    .page-actions > .btn { width: 100%; }
    .filter-bar .form-control { flex: 1 1 46%; min-width: 0; }
    .detail-list { grid-template-columns: 1fr; gap: .1rem; }
    .detail-list dd { margin-bottom: .55rem; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr 1fr; }
    .product-cart-form { flex-direction: column; }
    .qty-input { width: 100%; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}
