:root {
  --app-brown: #6b3e1f;
  --app-brown-dark: #4a2a14;
  --app-amber: #e0952f;
  --app-cream: #fbf7f0;
  --bs-primary: #a0561f;
  --bs-primary-rgb: 160, 86, 31;
  --bs-link-color: #a0561f;
  --bs-link-hover-color: #6b3e1f;
  --bs-body-bg: #f7f4ef;
}
body { background: var(--bs-body-bg); }
.btn-primary { --bs-btn-bg: #a0561f; --bs-btn-border-color: #a0561f; --bs-btn-hover-bg: #84461a; --bs-btn-hover-border-color: #84461a; --bs-btn-active-bg: #6b3e1f; }
.btn-outline-secondary.active { background: var(--app-brown); border-color: var(--app-brown); }
.card { border: 0; box-shadow: 0 1px 3px rgba(60,40,20,.08), 0 1px 2px rgba(60,40,20,.04); border-radius: .75rem; }
.card-header { background: transparent; border-bottom: 1px solid rgba(0,0,0,.06); font-weight: 600; }
.kpi .kpi-label { color: #7a6a5a; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.kpi .kpi-value { font-size: 1.45rem; font-weight: 700; color: #2e1f12; margin: .15rem 0; white-space: nowrap; }
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 220px; }
.chart-box.lg { height: 360px; }
.heatmap { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: .78rem; }
.heatmap th { font-weight: 600; color: #6b5a4a; text-align: center; padding: 2px 4px; }
.heatmap td { text-align: center; border-radius: 5px; padding: 8px 2px; min-width: 38px; font-variant-numeric: tabular-nums; }
.heatmap td.dark { color: #fff; }
.table-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table thead th { font-size: .8rem; color: #6b5a4a; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]::after { content: " ⇅"; opacity: .35; }
.bar-inline { height: 6px; background: #f0e3cf; border-radius: 3px; overflow: hidden; min-width: 60px; }
.bar-inline > span { display: block; height: 100%; background: var(--app-amber); }
.badge-art-ware { background: #e9f3e6; color: #2f6b23; }
.badge-art-pfand { background: #e6eef7; color: #2a5585; }
.badge-art-gutschein { background: #f6e8f3; color: #84306f; }
.badge-art-sonstiges { background: #eee; color: #555; }
.login-wrap { max-width: 380px; margin: 8vh auto; }
.insight { border-left: 4px solid var(--app-amber); }
a { color: #a0561f; }
a:hover { color: #6b3e1f; }
.dropdown-item { color: #212529; }
.nav-pills .nav-link { color: #6b3e1f; }
.nav-pills .nav-link.active { background: #a0561f; color: #fff; }
.table a { text-decoration: none; }
.table a:hover { text-decoration: underline; }

/* ---------- Layout Backpilot: Kopfleiste + Seitennavigation ---------- */
:root { --topbar-h: 58px; --sidebar-w: 236px; }
.topbar { position: sticky; top: 0; z-index: 1030; height: var(--topbar-h); display: flex; align-items: center; gap: .75rem;
  padding: 0 1rem; background: linear-gradient(90deg, var(--app-brown-dark), var(--app-brown)); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.topbar .brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; }
.topbar .brand-name { display: block; font-weight: 700; font-size: 1.15rem; letter-spacing: .01em; line-height: 1.1; }
.topbar .brand-sub { display: block; font-size: .72rem; opacity: .75; line-height: 1.1; }
.topbar-btn { color: #fff; border: 0; }
.topbar-btn:hover, .topbar-btn:focus, .topbar-btn.show { color: #fff; background: rgba(255,255,255,.14); }
.daten-stand { color: rgba(255,255,255,.88); text-decoration: none; font-size: .82rem; background: rgba(255,255,255,.1); border-radius: 999px; padding: .25rem .7rem; white-space: nowrap; }
.daten-stand:hover { color: #fff; background: rgba(255,255,255,.18); }
.daten-stand .punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .4rem; vertical-align: middle; }
.app-shell { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.app-main { flex: 1; min-width: 0; padding: 1.5rem 1.75rem 2rem; max-width: 1500px; }
body:not(.mit-navi) .app-main { margin: 0 auto; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: #fffdf9; border-right: 1px solid rgba(107,62,31,.1); }
@media (min-width: 992px) {
  .sidebar { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); display: flex; flex-direction: column; overflow-y: auto; }
}
.sidebar-nav { padding: .9rem .7rem; flex: 1; }
.sidebar-gruppe { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #a08a74; margin: .9rem .1rem .25rem; padding: .3rem .55rem; border-radius: .4rem; list-style: none; cursor: pointer; display: flex; align-items: center; user-select: none; }
.sidebar-gruppe::-webkit-details-marker { display: none; }
.sidebar-gruppe i { margin-left: auto; font-size: .75rem; transition: transform .15s; }
.sidebar-gruppe:hover { background: #f6ecdf; color: #6b3e1f; }
.sidebar-box:not([open]) > .sidebar-gruppe i { transform: rotate(-90deg); }
.sidebar-box:not([open]) > .sidebar-gruppe { margin-bottom: 0; }
.sidebar-link { display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; border-radius: .55rem; color: #4a3626; text-decoration: none; font-size: .93rem; margin-bottom: 2px; }
.sidebar-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; color: #a0561f; }
.sidebar-link:hover { background: #f6ecdf; color: #2e1f12; }
.sidebar-link.active { background: var(--app-brown); color: #fff; }
.sidebar-link.active i { color: #ffd9a8; }
.sidebar-link.highlight:not(.active) { background: #fdf0dc; font-weight: 600; }
.sidebar-fuss { padding: .8rem 1.4rem; font-size: .72rem; color: #a08a74; border-top: 1px solid rgba(107,62,31,.08); }
@media (max-width: 991.98px) { .app-main { padding: 1rem; } }
@media print { .topbar, .sidebar { display: none !important; } .app-main { padding: 0; max-width: none; } }

.kpi .kpi-sub { line-height: 1.3; }
.kpi .kpi-delta { font-size: .8rem; margin-top: .2rem; }
body:not(.mit-navi) footer { text-align: center; }
