/* =========================================================
   BMW V8 Ersatzteile – Verwaltung (Bootstrap 5.3)
   ========================================================= */

:root {
    --ink: #1d2125;
    --muted: #5f666d;
    --line: #e6e2dc;
    --soft: #f6f4f0;
    --accent: #b4182f;
    --accent-dark: #8e1225;
    --topbar-h: 60px;
    --sidebar-w: 260px;
    --content-max: 1440px;

    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-font-size: .9375rem;
    --bs-body-color: var(--ink);
    --bs-body-bg: #f7f7f5;
    --bs-border-color: var(--line);
    --bs-link-color: var(--accent);
    --bs-link-color-rgb: 180, 24, 47;
    --bs-link-hover-color: var(--accent-dark);
    --bs-link-hover-color-rgb: 142, 18, 37;
    --bs-primary: var(--accent);
    --bs-primary-rgb: 180, 24, 47;
    --bs-focus-ring-color: rgba(180, 24, 47, .25);
}

/* ---------- Grundelemente ---------- */
.icon { width: 1.1em; height: 1.1em; vertical-align: -.15em; flex-shrink: 0; }
.icon-spin { animation: icon-spin 1s linear infinite; }
@keyframes icon-spin { to { transform: rotate(360deg); } }

.btn { --bs-btn-font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: .375rem; }
.btn-primary {
    --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-dark); --bs-btn-hover-border-color: var(--accent-dark);
    --bs-btn-active-bg: #7a0f20; --bs-btn-active-border-color: #7a0f20;
    --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent);
    --bs-btn-focus-shadow-rgb: 180, 24, 47;
}
.btn-outline-secondary, .btn-default {
    --bs-btn-color: var(--ink); --bs-btn-bg: #fff; --bs-btn-border-color: #cfc9c0;
    --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--soft); --bs-btn-hover-border-color: #b9b2a7;
    --bs-btn-active-color: var(--ink); --bs-btn-active-bg: #ece8e1; --bs-btn-active-border-color: #b9b2a7;
    --bs-btn-disabled-color: var(--muted); --bs-btn-disabled-bg: #fff; --bs-btn-disabled-border-color: var(--line);
}
.form-control:focus, .form-select:focus { border-color: #d9808d; box-shadow: 0 0 0 .25rem rgba(180, 24, 47, .15); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-label { font-weight: 500; margin-bottom: .375rem; }
.badge:not([class*="text-bg-"]):not([class*="bg-"]) { background: #6c757d; }
.table { --bs-table-bg: #fff; }

/* ---------- Layout ---------- */
body.admin { padding-top: var(--topbar-h); }
.admin-topbar { height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 1px 6px rgba(0, 0, 0, .04); }
.admin-topbar .navbar-brand { display: flex; align-items: center; gap: .75rem; padding: 0; }
.admin-brand-label { font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--line); padding-left: .75rem; }

/* Jede Admin-Seite: <div class="row"> Sidebar + <div class="… main"> */
body.admin > .row { display: flex; flex-wrap: nowrap; margin: 0; min-height: calc(100vh - var(--topbar-h)); }
body.admin > .row > .main { flex: 1 1 auto !important; width: auto !important; max-width: var(--content-max) !important; min-width: 0; margin: 0 !important; padding: 1.5rem 2rem 3rem; }

.admin-sidebar { width: var(--sidebar-w); flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); }
@media (min-width: 992px) {
    .admin-sidebar { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
}
.admin-sidebar .offcanvas-body { padding: 1rem .75rem; }
.admin-sidebar .nav-link { display: flex; align-items: center; gap: .625rem; padding: .5rem .75rem; margin-bottom: .125rem; border-radius: .5rem; color: var(--ink); font-weight: 500; }
.admin-sidebar .nav-link .icon { width: 1.15rem; height: 1.15rem; color: var(--muted); }
.admin-sidebar .nav-link:hover { background: var(--soft); color: var(--ink); }
.admin-sidebar .nav-link.active { background: rgba(180, 24, 47, .08); color: var(--accent); }
.admin-sidebar .nav-link.active .icon { color: var(--accent); }
.admin-sidebar .badge { background: var(--accent) !important; }
.admin-sidebar .nav-section { margin: 1rem .75rem .25rem; font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 991.98px) {
    body.admin > .row > .main { padding: 1rem 1rem 2rem; }
    .admin-brand-label { display: none; }
}

/* ---------- Seitenkopf ---------- */
.page-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; margin: 0 0 1.5rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); font-size: 1.5rem; font-weight: 700; }
.page-header small { font-size: .9375rem; font-weight: 400; color: var(--muted); }
.page-header small br { display: none; }
.sub-header { font-size: 1.125rem; font-weight: 600; margin: 1.5rem 0 .75rem; }

/* ---------- Karten / Kennzahlen ---------- */
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: .75rem; }
.admin-card-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .875rem 1.25rem; border-bottom: 1px solid var(--line); font-weight: 600; }
.admin-card-body { padding: 1rem 1.25rem; }
.kpi { display: flex; flex-direction: column; gap: .25rem; height: 100%; padding: 1.125rem 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: .75rem; color: var(--ink); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease; }
a.kpi:hover { border-color: #cfc9c0; box-shadow: 0 4px 14px rgba(0, 0, 0, .06); color: var(--ink); }
.kpi-label { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .875rem; font-weight: 500; }
.kpi-value { font-size: 1.875rem; font-weight: 700; line-height: 1.1; }
.kpi-hint { color: var(--muted); font-size: .8125rem; }
.kpi-warn .kpi-value { color: var(--accent); }

.status-badge { display: inline-block; padding: .25em .6em; border-radius: 999px; font-size: .75rem; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.status-new { background: #fde8eb; color: #a3162b; }
.status-work { background: #fff3cd; color: #7a5b00; }
.status-done { background: #e3f3e5; color: #2f7d32; }
.status-neutral { background: #eceae6; color: var(--muted); }

/* ---------- Tabellen (bootstrap-table) ---------- */
.bootstrap-table .fixed-table-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.bootstrap-table .fixed-table-toolbar .bs-bars { flex: 1 1 auto; margin: 0 !important; }
.bootstrap-table .fixed-table-toolbar .search { margin: 0 !important; }
.bootstrap-table .fixed-table-container { background: #fff; border: 1px solid var(--line) !important; border-radius: .75rem; overflow: hidden; }
.bootstrap-table .table { margin-bottom: 0; }
.bootstrap-table .table thead th { background: #faf9f7; font-size: .8125rem; color: var(--muted); font-weight: 600; border-bottom-width: 1px; }
.bootstrap-table .table > :not(caption) > * > * { padding: .5rem .75rem; vertical-align: middle; }
.bootstrap-table .fixed-table-pagination { padding: .5rem 0; }
.table-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.table-toolbar .form-select { width: auto; }

/* ---------- Bootstrap-3-Reste in den Admin-Seiten ---------- */
.hidden { display: none !important; }
.form-group { margin-bottom: 1rem; }
.control-label { display: inline-block; margin-bottom: .375rem; font-weight: 500; }
.help-block { display: block; margin-top: .25rem; font-size: .875em; color: var(--muted); }
.has-error .form-control, .has-error .form-select { border-color: #dc3545; }
.has-error .help-block, .has-error .control-label { color: #dc3545; }
.has-success .form-control { border-color: #198754; }
.input-sm { padding: .25rem .5rem; font-size: .875rem; border-radius: .375rem; }
select.input-sm { padding-right: 1.75rem; }
.input-group-addon { display: flex; align-items: center; padding: .375rem .75rem; font-size: .875rem; color: var(--muted); background: #f1efeb; border: 1px solid #dee2e6; border-radius: .375rem; white-space: nowrap; }
.input-group > .input-group-addon:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .input-group-addon:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.input-group-btn { display: flex; }
.checkbox, .radio { display: block; margin: .25rem 0 .5rem; }
.checkbox label, .radio label { font-weight: 400; }
.checkbox input[type=checkbox], .radio input[type=radio] { margin-right: .375rem; }
.checkbox-inline, .radio-inline { display: inline-flex; align-items: center; gap: .375rem; margin-right: 1rem; font-weight: 400; }
.form-inline { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.form-inline .form-control, .form-inline .form-select { display: inline-block; width: auto; }
.form-horizontal .form-group { display: flex; flex-wrap: wrap; margin-left: -.75rem; margin-right: -.75rem; }
.form-horizontal .form-group > [class*="col-"] { padding-left: .75rem; padding-right: .75rem; }
@media (min-width: 576px) { .form-horizontal .control-label { padding-top: .375rem; text-align: right; } }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }
.pull-right { float: right !important; }
.pull-left { float: left !important; }
.center-block { display: block; margin-left: auto; margin-right: auto; }
.img-responsive { max-width: 100%; height: auto; }
.img-rounded { border-radius: .375rem; }
.table-condensed > :not(caption) > * > * { padding: .25rem .375rem; }
.btn-xs { --bs-btn-padding-y: .125rem; --bs-btn-padding-x: .375rem; --bs-btn-font-size: .75rem; --bs-btn-border-radius: .25rem; }
.btn-block { display: flex; width: 100%; }
.label { display: inline-block; padding: .25em .55em; font-size: .75em; font-weight: 600; line-height: 1; color: #fff; text-align: center; white-space: nowrap; border-radius: .375rem; }
.label-default { background: #8c8f93; }
.label-primary { background: var(--ink); }
.label-success { background: #2f7d32; }
.label-info { background: #0b7285; }
.label-warning { background: #e0a100; color: #1d2125; }
.label-danger { background: var(--accent); }
.well { background: var(--soft); border: 1px solid var(--line); border-radius: .5rem; padding: 1rem; margin-bottom: 1rem; }
.caret { display: inline-block; width: 0; height: 0; margin-left: .25rem; vertical-align: middle; border-top: .3em solid; border-right: .3em solid transparent; border-left: .3em solid transparent; }
.alert .close { float: right; margin-left: 1rem; font-size: 1.25rem; line-height: 1; color: inherit; opacity: .5; text-decoration: none; }
.alert .close:hover { opacity: .8; }
.nav-tabs > li > a { display: block; padding: .5rem 1rem; }
i.fa-eur { font-style: normal; }
i.fa-eur::before { content: '€'; }

/* ---------- Angebot ---------- */
.offer-edit .admin-card { padding: 1.125rem 1.25rem; }
.item-edit-grid.offer-grid { grid-template-columns: minmax(0, 1fr) 340px; }
.offer-steps { display: flex; gap: .25rem; list-style: none; margin: 0 0 1.25rem; padding: 0; counter-reset: step; }
.offer-steps li { flex: 1; position: relative; padding: .5rem 1.25rem .5rem 2.75rem; font-size: .8125rem; font-weight: 600; color: var(--muted); background: #ece8e2; counter-increment: step; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%); white-space: nowrap; }
.offer-steps li:first-child { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); border-radius: .5rem 0 0 .5rem; padding-left: 2.25rem; }
.offer-steps li:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 14px 50%); border-radius: 0 .5rem .5rem 0; }
.offer-steps li::before { content: counter(step); position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%); width: 1.25rem; height: 1.25rem; border-radius: 50%; display: grid; place-items: center; font-size: .6875rem; background: #fff; color: var(--muted); }
.offer-steps li:first-child::before { left: .625rem; }
.offer-steps li.is-done { color: #1f5e3a; background: #dcefe3; }
.offer-steps li.is-done::before { content: '✓'; background: #2e7d4f; color: #fff; }
.offer-steps li.is-current { color: #fff; background: var(--accent); }
.offer-steps li.is-current::before { background: #fff; color: var(--accent); }
.btn-send { display: flex; flex-direction: column; align-items: center; line-height: 1.25; min-width: 0; }
.btn-send-to { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; opacity: .85; }
.item-picker { position: relative; }
.item-picker-menu { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + .25rem); max-height: 420px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: .625rem; box-shadow: 0 12px 32px rgba(0, 0, 0, .12); padding: .25rem; }
.item-picker-option { display: flex; align-items: center; gap: .75rem; padding: .5rem .625rem; border-radius: .5rem; cursor: pointer; }
.item-picker-option.active { background: var(--soft); }
.item-picker-option img, .item-picker-noimg { width: 44px; height: 44px; flex-shrink: 0; object-fit: contain; border-radius: .375rem; background: var(--soft); display: grid; place-items: center; color: var(--muted); }
.item-picker-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-picker-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-picker-meta { font-size: .8125rem; color: var(--muted); }
.item-picker-hint { padding: .5rem .75rem; font-size: .875rem; color: var(--muted); }
.offer-item.flash { box-shadow: 0 0 0 2px var(--accent); transition: box-shadow .2s; }
.offer-items { display: flex; flex-direction: column; gap: .75rem; }
.offer-items:empty::before { content: 'Noch keine Artikel im Angebot.'; color: var(--muted); font-size: .875rem; }
.offer-item { display: flex; gap: .875rem; padding: .75rem; border: 1px solid var(--line); border-radius: .625rem; }
.offer-item-media img, .offer-item-noimg { width: 64px; height: 64px; object-fit: contain; border-radius: .375rem; background: var(--soft); display: grid; place-items: center; color: var(--muted); }
.offer-item-body { flex: 1; min-width: 0; }
.offer-item-title { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; margin-bottom: .375rem; }
.offer-item-table th { font-size: .75rem; font-weight: 600; color: var(--muted); border-bottom-width: 1px; }
.offer-item-table td, .offer-item-table th { padding: .25rem .375rem; white-space: nowrap; }
.offer-item-table .form-control { width: 6.5rem; text-align: right; }
.offer-totals { display: grid; grid-template-columns: 1fr auto; gap: .375rem 1.25rem; align-items: center; margin: 1rem 0 0 auto; padding-top: .875rem; border-top: 1px solid var(--line); max-width: 420px; font-size: .9375rem; }
.offer-totals dt { font-weight: 400; color: var(--muted); text-align: right; margin: 0; }
.offer-totals dd { margin: 0; text-align: right; min-width: 8rem; }
.offer-totals .input-group { width: 8rem; margin-left: auto; }
.offer-totals .offer-total { padding-top: .5rem; border-top: 1px solid var(--line); font-size: 1.0625rem; font-weight: 700; color: var(--ink); }
.offer-address address { font-style: normal; line-height: 1.5; }
.timeline-compose { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: .5rem; bottom: .5rem; width: 2px; background: var(--line); }
.timeline-day { position: relative; padding: .75rem 0 .375rem 2.75rem; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.timeline-day:first-child { padding-top: 0; }
.timeline-item { position: relative; display: flex; align-items: flex-start; gap: .75rem; padding: .375rem 0; font-size: .875rem; }
.timeline-dot { position: relative; z-index: 1; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--line); color: var(--muted); }
.timeline-dot .icon { width: 15px; height: 15px; }
.timeline-body { flex: 1; min-width: 0; padding-top: .3rem; }
.timeline-time { flex-shrink: 0; padding-top: .3rem; font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tone-mail .timeline-dot { border-color: #9cc3e6; color: #2563a8; background: #eef5fc; }
.tone-status .timeline-dot { border-color: #9fd0b2; color: #2e7d4f; background: #ecf7f0; }
.tone-note .timeline-dot { border-color: #ecd593; color: #8a6a12; background: #fff8e6; }
.timeline-note { margin-top: .25rem; padding: .5rem .75rem; white-space: pre-wrap; background: #fff8e6; border: 1px solid #f1e2b8; border-radius: .5rem; }
#view_rechnungsadresse address:empty::before { content: 'Noch keine Adresse'; color: var(--muted); }
@media (max-width: 991.98px) {
    .item-edit-grid.offer-grid { grid-template-columns: minmax(0, 1fr); }
    .offer-item-media { display: none; }
    .offer-item-table .form-control { width: 5rem; }
    .offer-steps { overflow-x: auto; }
    .offer-steps li { flex: 0 0 auto; }
}

/* ---------- Blättern (vorheriger/nächster Datensatz) ---------- */
.page-header-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.page-header-bar .page-header { flex: 1; margin-bottom: 0; border-bottom: 0; }
.record-nav { flex-shrink: 0; }
.record-nav .btn { padding: .25rem .5rem; }

/* ---------- Artikel bearbeiten ---------- */
.item-edit-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.item-edit-head .page-header { border: 0; padding: 0; }
.item-edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.item-edit-main, .item-edit-side { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.item-edit .admin-card { padding: 1.125rem 1.25rem; }
.admin-card-title { font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 .875rem; }
.admin-card-title label { margin: 0; }
.item-edit-side { position: sticky; top: calc(var(--topbar-h) + 1rem); }
.stock-table th, .stock-table td { padding: .375rem .375rem; white-space: nowrap; }
.stock-table thead th { font-size: .75rem; font-weight: 600; color: var(--muted); line-height: 1.2; vertical-align: bottom; }
.stock-table tbody th { font-weight: 600; padding-right: .75rem; }
.stock-table .form-control { min-width: 4.5rem; text-align: right; }
.stock-table .is-low { border-color: var(--accent); background: rgba(180, 24, 47, .06); color: var(--accent); font-weight: 600; }
.chip-group { display: flex; flex-wrap: wrap; gap: .375rem; }
.chip-group .btn { border-radius: 999px; }
.chip-group .btn-check:checked + .btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.ez-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: .5rem; align-items: center; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.ez-row .ez-feedback { grid-column: 1 / -1; margin-top: -.25rem; }
.ez-row .ez-feedback:empty { display: none; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.image-grid:empty { display: none; }
.image-card { position: relative; display: flex; flex-direction: column; gap: .375rem; padding: .5rem; background: #fff; border: 1px solid var(--line); border-radius: .5rem; cursor: grab; }
.image-card img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--soft); border-radius: .375rem; pointer-events: none; }
.image-card.is-main { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.image-card.dragging { opacity: .4; }
.image-badge { display: none; position: absolute; top: .875rem; left: .875rem; padding: .125rem .5rem; font-size: .6875rem; font-weight: 600; color: #fff; background: var(--accent); border-radius: 999px; }
.image-card.is-main .image-badge { display: inline-block; }
.image-actions { display: flex; justify-content: space-between; }
.image-actions .btn { padding: .125rem .5rem; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1.25rem; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: .75rem; background: var(--soft); transition: border-color .15s, background .15s; }
.dropzone > .icon { width: 1.75rem; height: 1.75rem; }
.dropzone.is-over { border-color: var(--accent); background: rgba(180, 24, 47, .05); }
.main-image { display: flex; align-items: center; justify-content: center; min-height: 140px; background: var(--soft); border-radius: .5rem; overflow: hidden; }
.main-image img { width: 100%; max-height: 220px; object-fit: contain; }
.item-savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; padding: .625rem 1rem; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .06); }
@media (max-width: 991.98px) {
    .item-edit-grid { grid-template-columns: minmax(0, 1fr); }
    .item-edit-side { position: static; }
    .item-edit { padding-bottom: 4.5rem; }
    .ez-row { grid-template-columns: minmax(0, 1fr) auto; }
    .ez-row .js-points { grid-column: 1; }
}

/* ---------- Auswertungen ---------- */
.section-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; margin: 2.25rem 0 1rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 1.125rem; font-weight: 700; }
.section-title small { font-size: .8125rem; font-weight: 400; color: var(--muted); }
.delta-up { color: #2e7d4f; font-weight: 600; }
.delta-down { color: var(--accent); font-weight: 600; }
.bar-chart { display: flex; align-items: flex-end; gap: .5rem; height: 220px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .25rem; min-width: 0; }
.bar { width: 100%; max-width: 44px; background: var(--accent); border-radius: .375rem .375rem 0 0; opacity: .85; }
.bar-col:last-child .bar { opacity: 1; }
.bar-col:hover .bar { opacity: 1; }
.bar-value { font-size: .6875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-label { font-size: .6875rem; color: var(--muted); white-space: nowrap; }
.stat-list .list-group-item { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.stat-list .list-group-item > a { min-width: 0; color: var(--ink); text-decoration: none; }
.stat-list .list-group-item > a:hover { color: var(--accent); }

/* ---------- Benutzer & Rollen ---------- */
.role-matrix th { font-size: .8125rem; white-space: nowrap; }
.perm-yes { color: var(--bs-success); }
.perm-no { color: var(--muted); }
.perm-option { padding: .375rem 0 .375rem 1.75em; border-bottom: 1px solid var(--line); }
.perm-option:last-child { border-bottom: 0; }

/* ---------- Kategorien ---------- */
.category-thumb { width: 94px; height: 35px; object-fit: cover; border-radius: .25rem; border: 1px solid var(--line); }
.category-preview { width: 280px; aspect-ratio: 8 / 3; display: flex; align-items: center; justify-content: center; background: var(--soft); border: 1px dashed var(--line); border-radius: .375rem; overflow: hidden; }
.category-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Inventur ---------- */
.print-only { display: none; }
.inv-table th, .inv-table td { padding-top: .3rem; padding-bottom: .3rem; }
.inv-table thead th { position: sticky; top: 0; background: #fff; z-index: 1; font-size: .8125rem; }
.inv-table .inv-group th { background: var(--soft); font-size: .8125rem; letter-spacing: .02em; padding-top: .5rem; }
.inv-name { min-width: 14rem; }
.inv-input { width: 4.25rem; height: 1.9rem; text-align: center; border: 1px solid var(--line); border-radius: .25rem; font-variant-numeric: tabular-nums; }
.inv-input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.inv-input.inv-ok { background: #ecf8f0; border-color: #9fd8b2; }
.inv-input.inv-changed { background: #fff6e5; border-color: #f0c36b; }
.inv-input.is-invalid { background: #fdecec; border-color: #e08a8a; }
.inv-diff { display: inline-block; min-width: 2.25rem; margin-left: .25rem; font-size: .75rem; font-weight: 600; text-align: left; }
.inv-diff.up { color: #1a7f45; }
.inv-diff.down { color: #b3261e; }
.inv-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 1rem; margin-top: .75rem; padding: .75rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: .5rem; box-shadow: 0 -4px 16px rgba(0, 0, 0, .06); }

/* ---------- Explosionszeichnung (Modal) ---------- */
.ez-viewer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem 1rem; border-bottom: 1px solid var(--line); }
.ez-viewer-tabs { gap: .25rem; }
.ez-viewer-tabs .nav-link { padding: .25rem .625rem; font-size: .8125rem; }
.ez-viewer-tabs .nav-link.active { background: var(--accent); }
.ez-viewer-vp { position: relative; height: min(72vh, 760px); overflow: hidden; background: #fff; touch-action: none; cursor: zoom-in; }
.ez-viewer-vp.is-zoomed { cursor: grab; }
.ez-viewer-vp.is-zoomed:active { cursor: grabbing; }
.ez-viewer-canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; -webkit-user-select: none; user-select: none; }
.ez-viewer-canvas.is-animated { transition: transform .3s ease; }
.ez-viewer-canvas img { display: block; width: 100%; height: 100%; max-width: none; pointer-events: none; -webkit-user-drag: none; }
.ez-viewer-pt { position: absolute; z-index: 1; min-width: 1.25rem; padding: .15rem .35rem; border-radius: 999px; background: rgba(108, 117, 125, .5); color: #fff; font-size: .6875rem; font-weight: 700; line-height: 1; text-align: center; pointer-events: none; transform: translate(-50%, -50%) scale(var(--pz-inv, 1)); }
.ez-viewer-pt.is-mine { z-index: 2; padding: .3rem .55rem; background: var(--accent); font-size: .875rem; box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(0, 0, 0, .35); }
.ez-viewer-pt.is-mine::after { content: ''; position: absolute; inset: -3px; border: 3px solid var(--accent); border-radius: inherit; animation: ez-pulse 1.4s ease-out infinite; }
@keyframes ez-pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(2.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .ez-viewer-pt.is-mine::after { animation: none; }
    .ez-viewer-canvas.is-animated { transition: none; }
}
.ez-viewer-msg { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; gap: .5rem; background: #fff; color: var(--muted); }
.ez-viewer-msg[hidden] { display: none; }

@media print {
    @page { size: A4 portrait; margin: 10mm; }
    .admin-topbar, .admin-sidebar, .no-print, #debug, #codeigniter_profiler { display: none !important; }
    .print-only { display: block !important; }
    body.admin { padding-top: 0; background: #fff; }
    body.admin > .row > .main { padding: 0 !important; max-width: none !important; }
    .admin-card { border: 0; box-shadow: none; }
    .table-responsive { overflow: visible; }
    .inv-print-head { display: flex !important; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1.5rem; margin-bottom: 3mm; font-size: 9pt; }
    .inv-print-head strong { flex-basis: 100%; font-size: 12pt; }
    .inv-table { font-size: 8.5pt; }
    .inv-table thead th { position: static; }
    .inv-table thead { display: table-header-group; }
    .inv-table tr { break-inside: avoid; }
    .inv-table th, .inv-table td { padding: 1.2mm 1.5mm; border-color: #bbb; }
    .inv-table .inv-group th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .inv-table a { color: #000; text-decoration: none; }
    .inv-input { width: 16mm; height: 6mm; border: 1px solid #555; background: #fff !important; }
    .inv-diff { display: none; }
}

/* ---------- Anmeldung ---------- */
body.admin-guest { padding-top: 0; min-height: 100vh; display: flex; align-items: center; background: var(--soft); }
.login-card { max-width: 380px; margin: 3rem auto; padding: 2rem; background: #fff; border: 1px solid var(--line); border-radius: .75rem; box-shadow: 0 8px 30px rgba(0, 0, 0, .06); }
