/* ============================================================
   EventLager – Haupt-Stylesheet
   Light Mode (Standard) + Dark Mode via [data-theme="dark"]
   ============================================================ */

/* ── Variablen ─────────────────────────────────────────────── */
:root {
    --bg-app:           #f0f2f5;
    --bg-sidebar:       #ffffff;
    --bg-card:          #ffffff;
    --bg-input:         #ffffff;
    --bg-hover:         #f9fafb;
    --bg-table-head:    #f9fafb;
    --bg-table-row-alt: #fafafa;

    --text-primary:     #1f2937;
    --text-secondary:   #6b7280;
    --text-muted:       #9ca3af;
    --text-sidebar:     #374151;

    --border:           #e5e7eb;
    --border-input:     #d1d5db;
    --border-focus:     #6366f1;

    --sidebar-w:        220px;
    --sidebar-active-bg:   #fff4ee;
    --sidebar-active-text: #f97316;
    --sidebar-active-border: #f97316;
    --sidebar-hover-bg: #f3f4f6;

    --card-shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --card-shadow-hover:0 4px 12px rgba(0,0,0,.10);

    --color-green:  #10b981;
    --color-red:    #ef4444;
    --color-blue:   #3b82f6;
    --color-purple: #8b5cf6;
    --color-orange: #f97316;
    --color-yellow: #f59e0b;
    --color-gray:   #6b7280;

    --radius:   10px;
    --radius-sm: 6px;
    --radius-lg: 14px;

    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --transition: 150ms ease;
}

[data-theme="dark"] {
    --bg-app:           #111827;
    --bg-sidebar:       #1f2937;
    --bg-card:          #1f2937;
    --bg-input:         #374151;
    --bg-hover:         #374151;
    --bg-table-head:    #243044;
    --bg-table-row-alt: #243044;

    --text-primary:     #f9fafb;
    --text-secondary:   #d1d5db;
    --text-muted:       #9ca3af;
    --text-sidebar:     #e5e7eb;

    --border:           #374151;
    --border-input:     #4b5563;
    --border-focus:     #818cf8;

    --sidebar-active-bg:     #451a03;
    --sidebar-active-text:   #fb923c;
    --sidebar-active-border: #fb923c;
    --sidebar-hover-bg:      #2d3748;

    --card-shadow:      0 1px 3px rgba(0,0,0,.3);
    --card-shadow-hover:0 4px 12px rgba(0,0,0,.4);
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-app);
    height: 100%;
    display: flex;
    transition: background var(--transition), color var(--transition);
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }

/* ── Layout ────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: background var(--transition), border-color var(--transition);
}

.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    flex: 1;
    padding: 2rem 2.5rem;
    max-width: calc(100vw - var(--sidebar-w));
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.logo-icon {
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.logo-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -.3px;
}

.theme-toggle {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
}
.theme-toggle:hover { background: var(--sidebar-hover-bg); color: var(--text-primary); }

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

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

.nav-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem .75rem;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-size: 13.5px;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    position: relative;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--sidebar-hover-bg);
}

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border-left-color: var(--sidebar-active-border);
    font-weight: 600;
}

.nav-item.disabled {
    opacity: .5;
    cursor: not-allowed;
}
.nav-item.disabled:hover { background: transparent; }

.nav-icon { display: flex; align-items: center; flex-shrink: 0; }
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-footer {
    padding: .75rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.logout-btn {
    display: flex; align-items: center;
    color: var(--text-secondary);
    padding: .35rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
}
.logout-btn:hover { background: #fee2e2; color: #ef4444; }

/* ── Page Header ───────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -.4px;
}

.page-header .subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.header-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}
.btn-primary:hover { background: #4f46e5; border-color: #4f46e5; }

.btn-green {
    background: var(--color-green);
    color: #fff;
    border-color: var(--color-green);
}
.btn-green:hover { background: #059669; border-color: #059669; }

.btn-red {
    background: var(--color-red);
    color: #fff;
    border-color: var(--color-red);
}
.btn-red:hover { background: #dc2626; border-color: #dc2626; }

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-input);
}
.btn-outline:hover { background: var(--bg-hover); }

.btn-sm {
    padding: .3rem .65rem;
    font-size: 12.5px;
}

.btn svg { flex-shrink: 0; }

/* ── Stats Cards ───────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width:  700px) { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--border);
    transition: box-shadow var(--transition), background var(--transition);
}
.stat-card:hover { box-shadow: var(--card-shadow-hover); }

.stat-card-info { flex: 1; min-width: 0; }
.stat-card-label { font-size: 13px; color: var(--text-secondary); margin-bottom: .25rem; }
.stat-card-value { font-size: 30px; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.stat-card-sub   { font-size: 12px; color: var(--text-muted); margin-top: .25rem; }

.stat-card-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon-blue   { background: #eff6ff; color: #3b82f6; }
.stat-icon-green  { background: #f0fdf4; color: #10b981; }
.stat-icon-yellow { background: #fffbeb; color: #f59e0b; }
.stat-icon-red    { background: #fef2f2; color: #ef4444; }

[data-theme="dark"] .stat-icon-blue   { background: #1e3a5f; color: #60a5fa; }
[data-theme="dark"] .stat-icon-green  { background: #064e3b; color: #34d399; }
[data-theme="dark"] .stat-icon-yellow { background: #451a03; color: #fbbf24; }
[data-theme="dark"] .stat-icon-red    { background: #450a0a; color: #f87171; }

/* ── Schnellzugriff ────────────────────────────────────────── */
.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-link {
    font-size: 13px;
    color: var(--color-blue);
    font-weight: 500;
}
.section-link:hover { text-decoration: underline; }

.quick-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: .75rem;
    margin-bottom: 2rem;
}
@media (max-width: 1100px) { .quick-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width:  600px) { .quick-grid { grid-template-columns: repeat(2,1fr); } }

.quick-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem .75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    box-shadow: var(--card-shadow);
}
.quick-btn:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-1px);
    color: var(--text-primary);
}
.quick-btn-icon { font-size: 22px; line-height: 1; }

.quick-btn .quick-icon { width: 28px; height: 28px; }
.quick-btn.green  .quick-icon { color: var(--color-green); }
.quick-btn.red    .quick-icon { color: var(--color-red); }
.quick-btn.blue   .quick-icon { color: var(--color-blue); }
.quick-btn.purple .quick-icon { color: var(--color-purple); }
.quick-btn.orange .quick-icon { color: var(--color-orange); }

/* ── Activity List ─────────────────────────────────────────── */
.activity-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--bg-hover); }

.activity-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--bg-table-head);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.activity-avatar.icon-avatar {
    background: #eff6ff;
    color: #3b82f6;
}
[data-theme="dark"] .activity-avatar.icon-avatar {
    background: #1e3a5f;
    color: #60a5fa;
}

.activity-info { flex: 1; min-width: 0; }
.activity-name { font-size: 13.5px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-meta { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.activity-right {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

.activity-qty {
    font-size: 13px;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}
.activity-qty.positive { color: var(--color-green); }
.activity-qty.negative { color: var(--color-red); }
.activity-qty.neutral  { color: var(--text-secondary); }

/* ── Card ──────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    transition: background var(--transition), border-color var(--transition);
}

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

.card-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body { padding: 1.5rem; }

/* ── Table ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

thead th {
    background: var(--bg-table-head);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .7rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
tbody tr:nth-child(even) { background: var(--bg-table-row-alt); }
tbody tr:nth-child(even):hover { background: var(--bg-hover); }

.td-name { font-weight: 500; }
.td-muted { color: var(--text-secondary); font-size: 12.5px; }

.table-actions { display: flex; gap: .3rem; align-items: center; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .55rem;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-green  { background: #d1fae5; color: #065f46; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-gray   { background: #f3f4f6; color: #374151; }

[data-theme="dark"] .badge-green  { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .badge-red    { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .badge-blue   { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .badge-purple { background: #2e1065; color: #c4b5fd; }
[data-theme="dark"] .badge-orange { background: #431407; color: #fdba74; }
[data-theme="dark"] .badge-gray   { background: #374151; color: #d1d5db; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
.form-grid.cols-1 { grid-template-columns: 1fr; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group.col-span-2 { grid-column: span 2; }
@media (max-width: 700px) { .form-group.col-span-2 { grid-column: span 1; } }

label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--bg-input);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

textarea { resize: vertical; min-height: 80px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .6rem center; padding-right: 2rem; }

/* Browser überschreibt manche Input-Typen mit eigenen Styles – hart erzwingen */
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"] {
    background-color: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-input) !important;
    -webkit-appearance: none;
    appearance: none;
}
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus {
    border-color: var(--border-focus) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15) !important;
}

/* Kalender-Icon im Dark Mode anpassen */
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: .6;
    cursor: pointer;
}

input[type="url"]:focus {
    border-color: var(--border-focus) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15) !important;
}
/* Autofill-Hintergrund ebenfalls überschreiben */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--text-primary);
}

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.form-actions { display: flex; gap: .5rem; padding-top: .5rem; flex-wrap: wrap; }

/* ── Search / Filter Bar ───────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: .75rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}
.search-wrap svg {
    position: absolute;
    left: .65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.search-wrap input { padding-left: 2.2rem; }

.filter-select { min-width: 150px; max-width: 200px; }

/* ── Flash Messages ────────────────────────────────────────── */
.flash {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}
.flash-success { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.flash-error   { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.flash-info    { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }

[data-theme="dark"] .flash-success { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
[data-theme="dark"] .flash-error   { background: #450a0a; color: #fca5a5; border-color: #991b1b; }
[data-theme="dark"] .flash-info    { background: #1e3a5f; color: #93c5fd; border-color: #1e40af; }

.flash-icon {
    width: 20px; height: 20px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    background: currentColor;
    color: #fff;
}
.flash-success .flash-icon { background: #10b981; }
.flash-error   .flash-icon { background: #ef4444; }
.flash-info    .flash-icon { background: #3b82f6; }

/* ── Bestand Indicator ─────────────────────────────────────── */
.bestand-bar-wrap {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.bestand-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    min-width: 60px;
}
.bestand-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width .3s ease;
}
.bestand-bar-fill.fill-green  { background: var(--color-green); }
.bestand-bar-fill.fill-orange { background: var(--color-yellow); }
.bestand-bar-fill.fill-red    { background: var(--color-red); }

/* ── Color Dot ─────────────────────────────────────────────── */
.color-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ── Login Page ────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-app);
    padding: 2rem;
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,.08);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.login-logo .logo-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
}

.login-logo .logo-text {
    font-size: 20px;
}

.login-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: .25rem;
}

.login-sub {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-form { display: flex; flex-direction: column; gap: 1rem; }

.login-btn {
    width: 100%;
    padding: .7rem;
    font-size: 14.5px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: #6366f1;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background var(--transition);
    margin-top: .5rem;
}
.login-btn:hover { background: #4f46e5; }

.login-theme-toggle {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}
.login-theme-toggle:hover { background: var(--bg-hover); }
.login-page-wrap { position: relative; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-backdrop.hidden { display: none; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    width: 100%;
    max-width: 480px;
    padding: 1.75rem;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: .5rem;
}

.modal-body {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; }

/* ── Bestandsübersicht specifics ───────────────────────────── */
.bestand-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.bestand-unit {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 2px;
}

/* ── Korrektur Form ────────────────────────────────────────── */
.korrektur-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.korrektur-current {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-table-head);
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}
.empty-state svg { opacity: .3; margin-bottom: 1rem; }
.empty-state p { font-size: 13.5px; }

/* ── Einlagern / Auslagern ─────────────────────────────────── */
.lager-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    max-width: 640px;
}

.artikel-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1rem;
    background: var(--bg-table-head);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}
.artikel-preview-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: #eff6ff;
    color: #3b82f6;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
[data-theme="dark"] .artikel-preview-icon { background: #1e3a5f; }
.artikel-preview-info { flex: 1; }
.artikel-preview-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.artikel-preview-meta { font-size: 12px; color: var(--text-muted); }

/* ── Artikel Live-Search ───────────────────────────────────── */
.artikel-live-search { position: relative; }

.artikel-search-row {
    display: flex;
    gap: .4rem;
    align-items: center;
}
.artikel-search-row input { flex: 1; }

.scan-btn {
    flex-shrink: 0;
    width: 42px; height: 42px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-input);
    background: var(--bg-input);
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
}
.scan-btn:hover { background: var(--bg-hover); color: #6366f1; border-color: #6366f1; }

.artikel-dropdown {
    position: absolute;
    top: calc(100% + 3px);
    left: 0; right: 0;
    z-index: 200;
    background: var(--bg-card);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    box-shadow: var(--card-shadow-hover);
    max-height: 300px;
    overflow-y: auto;
}
.artikel-dropdown.hidden { display: none; }

.artikel-option {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .85rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.artikel-option:last-child { border-bottom: none; }
.artikel-option:hover, .artikel-option.focused { background: var(--bg-hover); }
.artikel-option-body { flex: 1; min-width: 0; }
.artikel-option-name {
    font-size: 13.5px; font-weight: 500; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.artikel-option-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.artikel-option-bestand { flex-shrink: 0; font-size: 12px; font-weight: 600; text-align: right; white-space: nowrap; }
.artikel-option-bestand.ok   { color: var(--color-green); }
.artikel-option-bestand.low  { color: var(--color-orange); }
.artikel-option-bestand.leer { color: var(--color-red); }
.artikel-search-hint { font-size: 12px; color: var(--text-muted); padding: .65rem; text-align: center; }

/* ── Scanner-Modal ─────────────────────────────────────────── */
.scanner-modal-inner {
    width: 100%; max-width: 430px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
    overflow: hidden;
}
.scanner-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-table-head);
}
.scanner-modal-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.scanner-close-btn {
    width: 28px; height: 28px; border-radius: 50%;
    background: none; border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px;
    transition: all var(--transition);
}
.scanner-close-btn:hover { background: var(--bg-hover); color: var(--color-red); }
.scanner-modal-body { padding: 1rem 1.1rem 1.25rem; }
#qr-reader { width: 100%; border-radius: var(--radius-sm); overflow: hidden; }
#qr-reader video { border-radius: var(--radius-sm); }
.scanner-hint { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: .5rem; }
.scanner-manual-row { display: flex; gap: .4rem; margin-top: .85rem; }
.scanner-manual-row input { flex: 1; }

/* ── Responsive tweaks ─────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; max-width: 100vw; padding: 1.5rem; }
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-input); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
