/* =========================================================
   BBO Logistik – Internes Verwaltungsportal
   Design: "Corporate Modern" – übersichtlich, funktional, professionell
   CI: #B51615 Rot / Montserrat / Token-basiertes Design-System
   =========================================================
   Farben sind überschreibbar via CSS Custom Properties aus DB (base.html).
   Token-System: siehe tokens.css | Komponenten: siehe components.css
   ========================================================= */

:root {
  --bbo-braun:        #1e1e2e;
  --bbo-braun-hell:   #2a2a3c;
  --bbo-braun-rand:   #3a3a4e;
  --bbo-braun-stumm:  #6b6b80;
  --bbo-rot:          #B51615;
  --bbo-rot-hover:    #9a1211;
  --db-rot:           #ec0016;
  --db-rot-hover:     #cc0013;
  --db-dunkel:        #131821;

  --primary:          var(--bbo-braun);
  --primary-light:    var(--bbo-braun-hell);
  --accent:           var(--bbo-rot);
  --accent-hover:     var(--bbo-rot-hover);

  --bg:               #f8f9fb;
  --card:             #ffffff;
  --sidebar-w:        272px;
  --header-h:         64px;
  --text:             #1a1b1e;
  --text-muted:       #64748b;
  --border:           #e5e7eb;
  --radius:           8px;
  --radius-lg:        12px;
  --shadow-sm:        0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:        0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg:        0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-xl:        0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);
  --transition:       all 0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-fast:  all 0.15s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

/* =========================================================
   HEADER – Clean, Modern, Solid
   ========================================================= */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--theme-header-bg, var(--bbo-braun));
  display: flex;
  align-items: center;
  padding: 0 var(--space-6, 24px);
  z-index: 200;
  box-shadow: 0 1px 0 rgba(0,0,0,.1);
  gap: var(--space-4, 16px);
}

/* Red accent stripe at bottom of header */
.header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--bbo-rot);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--theme-header-text, #ffffff);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.2px;
  white-space: nowrap;
}

.header-brand-icon {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-brand-icon:has(svg) {
  width: 38px; height: 38px;
  background: var(--bbo-rot);
  border-radius: 6px;
}

.header-brand-icon svg { width: 20px; height: 20px; }

.header-brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.header-brand-main {
  font-size: 15px;
  font-weight: 800;
  color: var(--theme-header-text, #ffffff);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.header-brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--theme-header-text, #ffffff);
  opacity: .7;
  letter-spacing: .3px;
}

.header-sep {
  width: 1px; height: 24px;
  background: var(--theme-header-text, #ffffff);
  opacity: .15;
  flex-shrink: 0;
}

.header-subtitle {
  font-size: 11px;
  color: var(--theme-header-text, #ffffff);
  opacity: .65;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.header-spacer { flex: 1; }

.header-user { display: flex; align-items: center; gap: 12px; }

.header-username {
  font-size: 13px;
  color: var(--theme-header-text, #ffffff);
  opacity: .65;
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-username svg { width: 14px; height: 14px; }

.btn-logout {
  padding: 7px 18px;
  background: var(--theme-primary, var(--bbo-rot));
  border: 1px solid color-mix(in srgb, var(--theme-primary, var(--bbo-rot)) 85%, black);
  color: #ffffff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: .2px;
}

.btn-logout:hover {
  background: color-mix(in srgb, var(--theme-primary, var(--bbo-rot)) 80%, black);
  border-color: color-mix(in srgb, var(--theme-primary, var(--bbo-rot)) 70%, black);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(181,22,21,.3);
}

.btn-logout svg { width: 13px; height: 13px; }

/* Hamburger Menu (Mobile) */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--theme-header-text, #fff);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background .15s;
}
.hamburger-btn:hover { background: rgba(255,255,255,.1); }
.hamburger-btn svg { width: 22px; height: 22px; display: block; }

/* =========================================================
   LAYOUT
   ========================================================= */
.layout {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

.main-content {
  flex: 1;
  padding: 36px 40px;
  margin-left: var(--sidebar-w);
  max-width: calc(100% - var(--sidebar-w));
  min-width: 0;
  position: relative;
  z-index: 1;
}

/* =========================================================
   SIDEBAR – Modern Dark Navigation
   ========================================================= */
.sidebar {
  position: fixed;
  left: 0;
  top: var(--header-h);
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  background: var(--theme-sidebar-bg, var(--bbo-braun));
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.05);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  z-index: 150;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.25); }

.sidebar-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-header-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,.3);
}

.sidebar-nav { padding: 8px 0; flex: 1; }

/* Sidebar links – shared base */
.sidebar-home-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin: 2px 8px;
  color: rgba(255,255,255,.6);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius);
  transition: var(--transition-fast);
  position: relative;
}
.sidebar-home-link svg { flex-shrink: 0; color: inherit; width: 16px; height: 16px; }
.sidebar-home-link:hover {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
}
.sidebar-home-link.active {
  color: #ffffff;
  background: rgba(181,22,21,.15);
}
/* Red accent stripe for active sidebar link */
.sidebar-home-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--bbo-rot);
  border-radius: 2px;
}

.sidebar-group { margin-bottom: 1px; }

.sidebar-group-btn {
  display: flex;
  align-items: center;
  width: calc(100% - 16px);
  margin: 1px 8px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,.6);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition-fast);
  gap: 12px;
  text-align: left;
  position: relative;
  font-family: inherit;
  border-radius: var(--radius);
}

.sidebar-group-btn:hover {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
}
.sidebar-group-btn.active {
  color: #ffffff;
  background: rgba(181,22,21,.15);
}
.sidebar-group-btn.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--bbo-rot);
  border-radius: 2px;
}

/* Sidebar icon styles */
.sidebar-icon {
  width: 20px; height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
  line-height: 1;
}

.sidebar-group-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: .85;
}

.sidebar-group-text { flex: 1; line-height: 1.3; }

.sidebar-chevron {
  width: 14px; height: 14px;
  flex-shrink: 0;
  opacity: .4;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.sidebar-group.open .sidebar-chevron { transform: rotate(90deg); opacity: .8; }

.sidebar-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1);
  background: rgba(0,0,0,.12);
  margin: 0 8px;
  border-radius: 0 0 var(--radius) var(--radius);
}

.sidebar-group.open .sidebar-submenu { max-height: 200px; }

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 9px 12px 9px 40px;
  color: rgba(255,255,255,.5);
  font-size: 12.5px;
  font-weight: 500;
  transition: var(--transition-fast);
  gap: 8px;
  position: relative;
  border-radius: var(--radius-sm);
  margin: 1px 4px;
}

.sidebar-link::before {
  content: '';
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .4;
}

.sidebar-link:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
}
.sidebar-link.active {
  color: #ffffff;
  background: rgba(181,22,21,.1);
}
.sidebar-link.active::before { opacity: 1; background: var(--bbo-rot); }

/* Sidebar admin section */
.sidebar-admin-section {
  margin-top: auto;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,.06);
}

.sidebar-admin-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin: 1px 8px;
  color: rgba(255,255,255,.45);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-fast);
  position: relative;
  border-radius: var(--radius);
}
.sidebar-admin-link svg { flex-shrink: 0; width: 15px; height: 15px; }
.sidebar-admin-link:hover {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.85);
}
.sidebar-admin-link.active {
  color: #ffffff;
  background: rgba(181,22,21,.12);
}
.sidebar-admin-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--bbo-rot);
  border-radius: 2px;
}

/* Sidebar Badge (Handlungsbedarf) */
.sidebar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(220, 38, 38, .9);
  color: #ffffff;
  border-radius: 10px;
  margin-left: auto;
  line-height: 1;
}

.sidebar-badge--red {
  background: var(--bbo-rot);
}

/* =========================================================
   DASHBOARD – PAGE HEADER & GREETING
   ========================================================= */
.page-header {
  margin-bottom: 28px;
  position: relative;
  z-index: 50;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -.4px;
}

.page-subtitle { font-size: 13px; color: var(--text-muted); font-weight: 400; }

.dashboard-greeting {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.5px;
  margin-bottom: 4px;
}

.dashboard-greeting-sub {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

.dashboard-greeting-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* =========================================================
   DASHBOARD – CSS GRID + SORTABLEJS
   ========================================================= */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(200px, auto);
  gap: 16px;
  min-height: 200px;
}

.dashboard-card {
  position: relative;
  border-radius: var(--radius-lg);
  container-type: inline-size;
  min-height: 200px;
  transition: opacity 0.2s ease, transform .2s ease, box-shadow .2s ease;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,.1);
}

/* SortableJS drag states */
.dashboard-card.sortable-ghost {
  opacity: 0.3;
  border: 2px dashed var(--bbo-rot);
  border-radius: var(--radius-lg);
  background: rgba(181,22,21,.04);
}
.dashboard-card.sortable-ghost > * { visibility: hidden; }
.dashboard-card.sortable-drag {
  opacity: 0.9;
  z-index: 100;
  transform: rotate(1deg);
  box-shadow: var(--shadow-xl);
}

/* Lift card when tile submenu is open */
.dashboard-card:has(.tile.open) {
  z-index: 50;
}

/* Resize handle */
.resize-handle {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  cursor: se-resize;
  opacity: 0;
  transition: opacity .15s;
  z-index: 5;
}
.dashboard-card:hover .resize-handle { opacity: 0.35; }
.resize-handle::after {
  content: '';
  position: absolute;
  bottom: 2px; right: 2px;
  width: 10px; height: 10px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  border-radius: 0 0 2px 0;
}

/* Container Query – responsive tile font sizing */
@container (max-width: 300px) {
  .tile-title { font-size: 13px; }
  .tile-desc  { font-size: 11px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tile-icon-wrap { width: 36px; height: 36px; margin-bottom: 12px; }
  .tile-icon-wrap svg { width: 18px; height: 18px; }
  .tile-submenu-btn { font-size: 11.5px; padding: 8px 10px; }
}
@container (min-width: 440px) {
  .tile-title { font-size: 17px; }
  .tile-desc  { font-size: 13px; }
  .tile-icon-wrap { width: 52px; height: 52px; }
  .tile-icon-wrap svg { width: 26px; height: 26px; }
}

/* Mobile: 1 column */
@media (max-width: 768px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-card { grid-column: span 1 !important; }
}

/* Layout-Reset-Button (small, inline) */
.layout-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}
.layout-reset-btn:hover {
  background: var(--card);
  border-color: var(--bbo-rot);
  color: var(--bbo-rot);
}
.layout-reset-btn svg { width: 11px; height: 11px; }

/* =========================================================
   CUSTOMIZE POPOVER – Dashboard anpassen
   ========================================================= */
.customize-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bbo-rot);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  margin-left: 4px;
}

#customize-wrapper {
  position: relative;
  z-index: 9999;
}

.customize-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 9999;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  padding: 16px;
  min-width: 280px;
  animation: popoverFadeIn .15s ease-out;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.customize-popover-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text, #1f2937);
}

.customize-popover-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.customize-popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text, #1f2937);
  transition: background .1s;
  user-select: none;
}
.customize-popover-item:hover {
  background: var(--bg-hover, rgba(0,0,0,.04));
}

.customize-popover-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--bbo-rot, #c0392b);
  cursor: pointer;
  flex-shrink: 0;
}

.customize-popover-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border, #e5e7eb);
}

.customize-popover-btn {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  background: var(--card, #fff);
  color: var(--text, #1f2937);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}
.customize-popover-btn:hover {
  background: var(--bg-hover, rgba(0,0,0,.04));
  border-color: var(--bbo-rot);
  color: var(--bbo-rot);
}

.customize-popover-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted, #6b7280);
  margin-bottom: 4px;
}

.customize-popover-divider {
  height: 1px;
  background: var(--border, #e5e7eb);
  margin: 10px 0;
}

/* =========================================================
   TILES / CARDS – Modernized
   ========================================================= */
.tile {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.2s cubic-bezier(0.4,0,0.2,1),
              border-color 0.2s cubic-bezier(0.4,0,0.2,1);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: visible;
  user-select: none;
  height: 100%;
}

/* Colored accent stripe at top of tile (per module) */
.tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--tile-color, var(--bbo-rot));
  border-radius: 12px 12px 0 0;
  z-index: 2;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--tile-color, var(--bbo-rot)) 40%, transparent);
}
.tile.open {
  border-color: var(--tile-color, var(--bbo-rot));
  box-shadow: var(--shadow-md);
  z-index: 10;
}

/* Drag handle */
.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.drag-handle:hover {
  opacity: 1 !important;
  background: rgba(0, 0, 0, 0.06);
}
.drag-handle:active { cursor: grabbing; }

.tile .drag-handle {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
}
.tile:hover .drag-handle { opacity: 0.45; }

/* Touch devices: always show drag handle */
@media (hover: none) and (pointer: coarse) {
  .tile .drag-handle { opacity: 0.35; }
  .kalender-widget .drag-handle { opacity: 0.45; }
}

.kalender-widget .drag-handle {
  position: static;
  opacity: 0.35;
  margin-right: 4px;
}
.kalender-widget:hover .drag-handle { opacity: 0.65; }

.tile-icon-wrap {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  background: var(--tile-color);
  opacity: .9;
}

.tile-icon-wrap svg { width: 24px; height: 24px; color: #fff; }

.tile-chevron {
  position: absolute;
  top: 18px; right: 18px;
  width: 20px; height: 20px;
  color: #cbd5e1;
  transition: transform 0.22s ease, color 0.22s ease;
}

.tile.open .tile-chevron { transform: rotate(180deg); color: var(--tile-color); }

.tile-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
  padding-right: 24px;
}

.tile-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-submenu {
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1),
              margin-top 0.22s cubic-bezier(0.4,0,0.2,1),
              opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
}

.tile.open .tile-submenu {
  max-height: 200px;
  margin-top: 16px;
  opacity: 1;
}

.tile-submenu-btn {
  transform: translateY(6px);
  transition: var(--transition),
              transform 0.22s cubic-bezier(0.4,0,0.2,1);
}
.tile.open .tile-submenu-btn {
  transform: translateY(0);
}

.tile-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin-bottom: 4px;
}

.tile-submenu-btn {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  gap: 9px;
}

.tile-submenu-btn:hover {
  background: var(--tile-color);
  color: #ffffff;
  border-color: transparent;
  transform: translateX(3px);
}

.tile-submenu-btn svg { width: 15px; height: 15px; opacity: .65; flex-shrink: 0; }
.tile-submenu-btn:hover svg { opacity: .9; }

/* =========================================================
   TEAM-TILE FILTER-BUTTONS (Aktiv / Extern / Archiv)
   ========================================================= */
.team-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 14px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}
.team-filter-btn:hover {
  border-color: #c4b5fd;
  background: #faf5ff;
  color: #4c1d95;
}
.team-filter-btn.active {
  border-color: #7c3aed;
  background: #7c3aed;
  color: #fff;
  box-shadow: 0 1px 3px rgba(124, 58, 237, .25);
}
.team-filter-btn.active:hover {
  background: #6d28d9;
  border-color: #6d28d9;
}
.team-filter-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.team-filter-btn.active .team-filter-dot {
  box-shadow: 0 0 0 2px rgba(255,255,255,.4);
}

/* Add-Button rechts neben den Filter-Tabs */
.team-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1.5px solid #10b981;
  background: #10b981;
  color: #fff;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}
.team-add-btn:hover {
  background: #059669;
  border-color: #059669;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(16, 185, 129, .35);
}
.team-add-btn svg { flex-shrink: 0; }

/* Rollen-Verwaltung Button (rechts neben "+ Neu") */
.team-rollen-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1.5px solid #6366f1;
  background: #fff;
  color: #6366f1;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}
.team-rollen-btn:hover {
  background: #6366f1;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(99, 102, 241, .35);
}
.team-rollen-btn svg { flex-shrink: 0; }

/* Touch devices: always show resize handle */
@media (hover: none) and (pointer: coarse) {
  .resize-handle { opacity: 0.3; }
}

/* =========================================================
   MODULE-BASED TILE COLORS – Tinted Backgrounds + Accent
   ========================================================= */
.tile[data-module="mobilfunk"]        { background: #fef2f2; --tile-color: #e60000; border-color: rgba(230,0,0,.12); }
.tile[data-module="fahrzeuge"]        { background: #f0f9ff; --tile-color: #0369a1; border-color: rgba(3,105,161,.12); }
.tile[data-module="rfu"]              { background: #fffbeb; --tile-color: #b45309; border-color: rgba(180,83,9,.12); }
.tile[data-module="inventar"]         { background: #f0fdf4; --tile-color: #16a34a; border-color: rgba(22,163,74,.12); }
.tile[data-module="unbedenklichkeit"] { background: #ecfdf5; --tile-color: #059669; border-color: rgba(5,150,105,.12); }
.tile[data-module="zertifikate"]      { background: #eff6ff; --tile-color: #2563eb; border-color: rgba(37,99,235,.12); }
.tile[data-module="auftraege"]        { background: #fffbeb; --tile-color: #d97706; border-color: rgba(217,119,6,.12); }
.tile[data-module="team"]             { background: #f5f3ff; --tile-color: #7c3aed; border-color: rgba(124,58,237,.12); }
.tile[data-module="woche"]            { background: #eff6ff; --tile-color: #3b82f6; border-color: rgba(59,130,246,.12); }

/* Per-module accent color for stat numbers */
.tile[data-module="mobilfunk"] .card-stat-number        { color: #e60000; }
.tile[data-module="fahrzeuge"] .card-stat-number        { color: #0369a1; }
.tile[data-module="rfu"] .card-stat-number              { color: #b45309; }
.tile[data-module="inventar"] .card-stat-number         { color: #16a34a; }
.tile[data-module="unbedenklichkeit"] .card-stat-number { color: #059669; }
.tile[data-module="zertifikate"] .card-stat-number      { color: #2563eb; }
.tile[data-module="auftraege"] .card-stat-number        { color: #d97706; }
.tile[data-module="team"] .card-stat-number             { color: #7c3aed; }

/* =========================================================
   CARD STATS – Unified Stat-Boxes for Dashboard Tiles
   ========================================================= */
.card-stats {
  display: flex;
  gap: 6px;
  margin: 10px 0 4px;
}

.card-stat {
  text-align: center;
  flex: 1 1 0;
  padding: 8px 4px;
  background: rgba(255,255,255,.65);
  border-radius: 8px;
  min-width: 50px;
}

.card-stat-number {
  font-size: 1.35rem;
  font-weight: 700;
  display: block;
  line-height: 1.2;
}

.card-stat-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6b7280;
  margin-top: 2px;
  display: block;
  white-space: normal;
  text-align: center;
}

/* Status color overrides (take priority over accent) */
.card-stat-number.status-ok       { color: #22c55e !important; }
.card-stat-number.status-warning  { color: #eab308 !important; }
.card-stat-number.status-critical { color: #ef4444 !important; }

/* Separator between stats */
.card-stat + .card-stat {
  border-left: 1px solid rgba(0,0,0,.06);
}

/* =========================================================
   CARD ALERT – Warning/Info Banner in Tiles (collapsible)
   ========================================================= */
.card-alert {
  font-size: 0.78rem;
  font-weight: 500;
  color: #92400e;
  background: rgba(251, 191, 36, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: auto;
  line-height: 1.4;
  border-top: 1px solid rgba(0,0,0,.06);
}
.card-alert:empty,
.card-alert[data-visible="false"] { display: none; }

.card-alert.alert-critical {
  color: #991b1b;
  background: rgba(239, 68, 68, 0.1);
}
.card-alert.alert-critical .card-alert-summary { color: #991b1b; }

.card-alert-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  cursor: pointer;
  user-select: none;
  gap: 8px;
}
.card-alert-summary:hover { opacity: .85; }

.card-alert-summary-text {
  flex: 1;
  min-width: 0;
}

.card-alert-toggle {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 2px;
  font-size: 12px;
  line-height: 1;
  opacity: .6;
  transition: transform .2s, opacity .15s;
  flex-shrink: 0;
}
.card-alert-toggle:hover { opacity: 1; }
.card-alert.open .card-alert-toggle { transform: rotate(180deg); }

.card-alert-details {
  display: none;
  padding: 0 10px 8px;
  font-size: 0.75rem;
  line-height: 1.5;
}
.card-alert.open .card-alert-details {
  display: block;
}
.card-alert-details-item {
  padding: 2px 0;
}
.card-alert-details-item::before {
  content: '•';
  margin-right: 6px;
  opacity: .5;
}

/* Container Query: compact stat-boxes for small tiles */
@container (max-width: 300px) {
  .card-stat-number { font-size: 1.1rem; }
  .card-stat-label { font-size: 0.55rem; letter-spacing: 0; }
  .card-stat { padding: 6px 2px; }
  .card-alert { font-size: 0.7rem; padding: 4px 8px; }
}

/* =========================================================
   VODAFONE TILE (Light – Vodafone-inspired)
   ========================================================= */
/* Vodafone tile now uses light design via data-module="mobilfunk" colors above.
   Keeping .tile-vodafone class for badge styling only. */
.tile.tile-vodafone:hover { border-color: #e60000; box-shadow: 0 8px 24px rgba(230,0,0,.15); }
.tile.tile-vodafone.open  { border-color: #e60000; box-shadow: 0 6px 18px rgba(230,0,0,.12); }

.vf-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(230,0,0,.1);
  border: 1px solid rgba(230,0,0,.25);
  color: #e60000;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  margin-top: 6px;
  width: fit-content;
}

/* =========================================================
   DB AG TILE
   ========================================================= */
/* DB tile now uses light design via data-module="rfu" colors above.
   Keeping .tile-db class for badge styling only. */
.tile.tile-db:hover { border-color: #b45309; box-shadow: 0 8px 24px rgba(180,83,9,.15); }
.tile.tile-db.open  { border-color: #b45309; box-shadow: 0 6px 18px rgba(180,83,9,.12); }

.db-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  width: fit-content;
}

.db-badge-logo {
  background: #ec0016;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: -.5px;
  padding: 2px 7px;
  border-radius: 2px;
  font-style: italic;
  line-height: 1.5;
}

.db-badge-text {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #92400e;
}

/* =========================================================
   MODULE PAGE
   ========================================================= */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.breadcrumb a { color: var(--accent); transition: var(--transition); }
.breadcrumb a:hover { color: var(--accent-hover); text-decoration: underline; }
.breadcrumb-sep { opacity: .4; }

.module-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.module-header-icon {
  width: 52px; height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.module-header-icon svg { width: 26px; height: 26px; color: #fff; }
.module-header-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.module-header-desc { font-size: 13px; color: var(--text-muted); }

.module-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.module-tabs::-webkit-scrollbar { display: none; }

.module-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.module-tab:hover { color: var(--text); background: var(--color-surface-hover, rgba(0,0,0,.02)); border-radius: var(--radius) var(--radius) 0 0; }
.module-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.module-tab svg { width: 14px; height: 14px; }

.module-content {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 40px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.module-content-icon {
  width: 56px; height: 56px;
  background: var(--bg);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-content-icon svg { width: 28px; height: 28px; color: #94a3b8; }
.module-content-title { font-size: 16px; font-weight: 600; color: var(--text); }
.module-content-desc { font-size: 13px; color: var(--text-muted); max-width: 400px; line-height: 1.6; }

.module-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* =========================================================
   LOGIN PAGE
   ========================================================= */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bbo-braun);
  padding: 24px;
  position: relative;
}

.login-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 40%, rgba(181,22,21,.06) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(181,22,21,.04) 0%, transparent 50%);
}

.login-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 44px 44px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 30px 60px rgba(0,0,0,.45);
  position: relative;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--bbo-rot);
  border-radius: 10px 10px 0 0;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-icon {
  width: 60px; height: 60px;
  background: var(--bbo-braun);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(56,48,43,.4);
}

.login-logo-icon svg { width: 28px; height: 28px; color: var(--bbo-rot); }

.login-brand {
  font-size: 11px;
  font-weight: 700;
  color: var(--bbo-rot);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 2px;
}

.login-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--bbo-braun);
  letter-spacing: -.2px;
}

.login-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* =========================================================
   FORMS
   ========================================================= */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: #ffffff;
  transition: var(--transition);
  outline: none;
  font-family: inherit;
}

.form-input:focus {
  border-color: var(--bbo-rot);
  box-shadow: 0 0 0 3px rgba(181,22,21,.1);
}

.form-input::placeholder { color: #94a3b8; }

.btn-login {
  width: 100%;
  padding: 12px;
  background: var(--bbo-rot);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.btn-login:hover {
  background: var(--bbo-rot-hover);
  box-shadow: 0 4px 16px rgba(181,22,21,.35);
  transform: translateY(-1px);
}

.btn-login:active { transform: translateY(0); }

/* =========================================================
   ALERTS
   ========================================================= */
.alert-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--color-danger-bg, #fef2f2);
  border: 1px solid var(--color-danger-border, #fecaca);
  color: var(--color-danger-text, #991b1b);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.alert-error svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

.alert-success {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-success-bg, #f0fdf4);
  border: 1px solid var(--color-success-border, #bbf7d0);
  color: var(--color-success-text, #15803d);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
}

.login-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.7;
}

/* =========================================================
   404 PAGE
   ========================================================= */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 24px;
}

.error-code { font-size: 80px; font-weight: 800; color: #e2e8f0; letter-spacing: -4px; line-height: 1; }
.error-title { font-size: 20px; font-weight: 600; color: var(--text); }
.error-desc { font-size: 14px; color: var(--text-muted); }

.error-link {
  padding: 10px 24px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.error-link:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* =========================================================
   ADMIN – BENUTZERVERWALTUNG
   ========================================================= */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.admin-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--color-bg-sunken, #f8f9fb);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-subtle, #f0f1f3);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--color-primary-subtle, rgba(181,22,21,.03)); }

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.role-badge.admin { background: rgba(181,22,21,.1); color: #9a1212; border: 1px solid rgba(181,22,21,.25); }
.role-badge.user  { background: rgba(16,185,129,.1); color: #059669; border: 1px solid rgba(16,185,129,.25); }

.header-username .role-badge.admin {
  background: var(--bbo-rot);
  color: #ffffff;
  border-color: var(--bbo-rot-hover);
}

.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #10b981; }

.btn-danger {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-danger:hover { background: #fef2f2; border-color: #ef4444; }

.btn-sm {
  padding: 5px 12px;
  background: var(--accent);
  border: none;
  color: white;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-sm:hover { background: var(--accent-hover); transform: translateY(-1px); }

.admin-form-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 28px;
  max-width: 480px;
  margin-top: 28px;
  box-shadow: var(--shadow-sm);
}

.admin-form-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 20px; color: var(--text); }

.form-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: #ffffff;
  transition: var(--transition);
  outline: none;
  font-family: inherit;
  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='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-select:focus { border-color: var(--bbo-rot); box-shadow: 0 0 0 3px rgba(181,22,21,.1); }

/* =========================================================
   PROFIL-SEITE
   ========================================================= */
.profil-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.profil-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.profil-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.profil-card-title svg { color: var(--text-muted); flex-shrink: 0; }

.btn-danger-outline {
  background: transparent;
  border: 1px solid #ef4444;
  color: #ef4444;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-danger-outline:hover { background: rgba(239,68,68,.08); }

/* =========================================================
   KALENDER-WIDGET
   ========================================================= */
.kalender-widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  height: 100%;
}

.kalender-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}

.kalender-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kalender-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.kalender-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.kalender-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kal-nav-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.kal-nav-btn:hover { background: var(--border); color: var(--text); }

.kal-view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.kal-view-btn {
  background: transparent;
  border: none;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.kal-view-btn.active {
  background: var(--bbo-braun);
  color: #fff;
}

/* ============================================
   KALENDER – SAUBERES GRID MIT ZELLGRENZEN
   ============================================ */

.kal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border, #e5e7eb);
  border-bottom: 2px solid var(--border, #e5e7eb);
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  margin: 0 14px;
}
.kal-weekdays div {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 6px 3px;
  background: var(--bg, #f9fafb);
  border-right: 1px solid var(--border, #e5e7eb);
}
.kal-weekdays div:last-child { border-right: none; }
.kal-weekend { color: #94a3b8 !important; }

.kal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 0 14px 14px;
  border-left: 1px solid var(--border, #e5e7eb);
  border-right: 1px solid var(--border, #e5e7eb);
  border-bottom: 1px solid var(--border, #e5e7eb);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.kal-day {
  min-height: 70px;
  padding: 2px 4px;
  font-size: 10px;
  cursor: default;
  transition: background .15s;
  position: relative;
  background: var(--color-surface, #fff);
  border-right: 1px solid var(--border, #e5e7eb);
  border-bottom: 1px solid var(--border, #e5e7eb);
  vertical-align: top;
}
/* Letzte Spalte (SO) */
.kal-day:nth-child(7n) { border-right: none; }
/* Letzte Zeile */
.kal-grid .kal-day:nth-last-child(-n+7) { border-bottom: none; }
.kal-day:hover { background: var(--bg, #f8f9fb); }

/* Tageszahl – groesser und deutlicher */
.kal-day-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1f2937);
  display: block;
  line-height: 1.2;
  padding: 1px 3px;
  margin-bottom: 1px;
}
.kal-day.today {
  background: #fef3c7;
}
.kal-day.today .kal-day-num {
  background: var(--bbo-rot);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
/* Vor-/Folgemonat – grau aber noch lesbar */
.kal-day.other-month {
  background: var(--bg, #f9fafb);
}
.kal-day.other-month .kal-day-num {
  color: #9ca3af;
  font-weight: 400;
  font-size: 12px;
}
/* Wochenende – leicht getoent */
.kal-day.weekend {
  background: #fafafa;
}
.kal-day.weekend .kal-day-num { color: #94a3b8; }

/* Events – farbig mit border-left Akzent */
.kal-event-dot {
  display: block;
  width: 100%;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
  line-height: 1.3;
  cursor: pointer;
  /* Default-Farbe */
  background: #fecaca;
  color: #991b1b;
  border-left: 3px solid #ef4444;
}
.kal-event-dot.more {
  background: var(--bg, #f3f4f6);
  color: var(--text-muted, #6b7280);
  border-left: none;
  cursor: default;
  font-size: 10px;
}
.kal-event-dot.more:hover {
  color: var(--bbo-rot);
}

.kal-list { padding: 14px 18px; }

.kal-list-item {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.kal-list-item:last-child { border-bottom: none; }

.kal-list-date {
  flex-shrink: 0;
  width: 44px;
  text-align: center;
}
.kal-list-date-day {
  font-size: 20px;
  font-weight: 700;
  color: var(--bbo-rot);
  line-height: 1;
}
.kal-list-date-mon {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.kal-list-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.kal-list-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.kal-empty-state {
  padding: 40px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.kal-empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.kal-empty-state a {
  font-size: 12px;
  color: var(--bbo-rot);
  text-decoration: none;
}
.kal-empty-state a:hover { text-decoration: underline; }

.kal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Skeleton loader for calendar */
.kal-skeleton {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px;
}
.kal-skeleton-pulse {
  width: 100%;
  height: 120px;
  background: linear-gradient(90deg, var(--bg) 25%, #e8e9ec 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 8px;
  margin: 14px;
}

.kal-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--bbo-rot);
  border-radius: 50%;
  animation: kal-spin .7s linear infinite;
}

@keyframes kal-spin { to { transform: rotate(360deg); } }
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =========================================================
   WATERMARK
   ========================================================= */
.bg-watermark {
  position: fixed;
  top: var(--header-h);
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bg-watermark img {
  max-width: 55%;
  max-height: 55%;
  object-fit: contain;
  filter: grayscale(100%);
  user-select: none;
}

/* =========================================================
   TOAST NOTIFICATION
   ========================================================= */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bbo-braun);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.visible {
  opacity: 1;
  transform: translateY(0);
}
.toast svg { width: 14px; height: 14px; flex-shrink: 0; }

/* =========================================================
   ANIMATIONS – Staggered fade-in
   ========================================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.anim-fade-in {
  opacity: 0;
  animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.anim-delay-1 { animation-delay: 0ms; }
.anim-delay-2 { animation-delay: 80ms; }
.anim-delay-3 { animation-delay: 160ms; }
.anim-delay-4 { animation-delay: 240ms; }
.anim-delay-5 { animation-delay: 320ms; }

/* Button hover micro-interaction */
.btn-sm:active,
.btn-login:active,
.btn-logout:active {
  transform: scale(0.98);
}

/* Sidebar link slide-in indicator */
@keyframes slideInLeft {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.sidebar-home-link.active::before,
.sidebar-group-btn.active::before,
.sidebar-admin-link.active::before {
  animation: slideInLeft 0.2s ease-out;
  transform-origin: left;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  :root { --sidebar-w: 240px; }
  .main-content { padding: 28px 24px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 272px; }

  .hamburger-btn { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 24px rgba(0,0,0,.3);
  }

  /* Overlay when sidebar is open */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--header-h);
    background: rgba(0,0,0,.4);
    z-index: 140;
  }
  .sidebar-overlay.visible { display: block; }

  .main-content {
    margin-left: 0;
    max-width: 100%;
    padding: 24px 16px;
  }

  .header-subtitle, .header-brand-sub { display: none; }
  .header-sep { display: none; }

  .bg-watermark { left: 0; }
}

@media (max-width: 480px) {
  .header { padding: 0 16px; gap: 10px; }
  .header-brand-main { font-size: 13px; }
  .btn-logout span { display: none; }
  .main-content { padding: 20px 14px; }
}

/* ===== Handlungsbedarf (innerhalb Kalender) ===== */
.hb-section {
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(220,38,38,.03) 0%, transparent 100%);
}
.hb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  cursor: pointer;
  user-select: none;
}
.hb-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dc2626;
  font-weight: 700;
  font-size: 13px;
}
.hb-title { color: var(--text); }
.hb-count {
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.hb-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  transition: transform .2s;
}
.hb-toggle svg { width: 14px; height: 14px; }
.hb-section.collapsed .hb-toggle { transform: rotate(-90deg); }
.hb-section.collapsed .hb-body { display: none; }
.hb-body { border-top: 1px solid var(--border); }
.hb-list { padding: 4px 0; }
.hb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  font-size: 13px;
  transition: background .15s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}
.hb-item:hover { background: rgba(0,0,0,.04); }
.hb-item-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hb-item-content { flex: 1; min-width: 0; }
.hb-item-title { font-weight: 600; }
.hb-item-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hb-item-modul {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  flex-shrink: 0;
}
.hb-group { margin-bottom: 4px; }
.hb-group:last-child { margin-bottom: 0; }
.hb-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 4px;
  border-bottom: 1px solid var(--border);
}
.hb-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hb-group-count {
  font-size: 10px;
  font-weight: 700;
  background: var(--accent, var(--bbo-rot));
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 18px;
  text-align: center;
}
.hb-group-more {
  display: block;
  text-align: center;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--accent, var(--bbo-rot));
  cursor: pointer;
  font-weight: 600;
}
.hb-group-more:hover { text-decoration: underline; }
.hb-more {
  display: block;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  color: var(--accent, var(--bbo-rot));
  border-top: 1px solid var(--border);
  cursor: pointer;
  font-weight: 600;
}
.hb-more:hover { background: rgba(0,0,0,.04); }
.hb-empty {
  padding: 16px 18px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* =========================================================
   THEME OVERRIDES: Clean Minimal (helle Sidebar/Header)
   ========================================================= */
[data-theme="minimal"] .sidebar {
  background: var(--color-sidebar-bg, #ffffff);
  border-right: 1px solid var(--color-border, #ebebeb);
}

[data-theme="minimal"] .sidebar-header {
  border-bottom-color: var(--color-border, #ebebeb);
}

[data-theme="minimal"] .sidebar-header-title {
  color: var(--color-text-muted, #6b7280);
}

[data-theme="minimal"] .sidebar-home-link,
[data-theme="minimal"] .sidebar-group-btn {
  color: var(--color-text-muted, #6b7280);
}

[data-theme="minimal"] .sidebar-home-link:hover,
[data-theme="minimal"] .sidebar-group-btn:hover {
  background: rgba(0,0,0,.04);
  color: var(--color-text, #111827);
}

[data-theme="minimal"] .sidebar-home-link.active,
[data-theme="minimal"] .sidebar-group-btn.active {
  color: var(--color-primary, #B51615);
  background: rgba(181,22,21,.06);
}

[data-theme="minimal"] .sidebar-submenu {
  background: rgba(0,0,0,.02);
}

[data-theme="minimal"] .sidebar-link {
  color: var(--color-text-muted, #9ca3af);
}

[data-theme="minimal"] .sidebar-link:hover {
  background: rgba(0,0,0,.03);
  color: var(--color-text, #111827);
}

[data-theme="minimal"] .sidebar-link.active {
  color: var(--color-primary, #B51615);
  background: rgba(181,22,21,.05);
}

[data-theme="minimal"] .sidebar-chevron {
  opacity: .25;
}

[data-theme="minimal"] .sidebar-admin-section {
  border-top-color: var(--color-border, #ebebeb);
}

[data-theme="minimal"] .sidebar-admin-link {
  color: var(--color-text-muted, #9ca3af);
}

[data-theme="minimal"] .sidebar-admin-link:hover {
  background: rgba(0,0,0,.04);
  color: var(--color-text, #111827);
}

[data-theme="minimal"] .sidebar-badge {
  background: rgba(220, 38, 38, .1);
  color: #dc2626;
}

[data-theme="minimal"] .sidebar-badge--red {
  background: #dc2626;
  color: #ffffff;
}

[data-theme="minimal"] .header {
  border-bottom: 1px solid var(--color-border, #ebebeb);
  box-shadow: none;
}

[data-theme="minimal"] .header::after {
  height: 2px;
}

/* =========================================================
   THEME OVERRIDES: Dark Mode
   ========================================================= */
[data-theme="dark"] .tile {
  background: var(--color-surface, #1e1e28);
  border-color: var(--color-border, #2e2e3a);
}
[data-theme="dark"] .tile[data-module] {
  background: var(--color-surface, #1e1e28);
  border-color: var(--color-border, #2e2e3a);
}

[data-theme="dark"] .tile-title { color: var(--color-text, #e4e4e7); }
[data-theme="dark"] .tile-desc { color: var(--color-text-muted, #71717a); }

[data-theme="dark"] .tile-submenu-btn {
  background: var(--color-surface-hover, #252530);
  border-color: var(--color-border, #2e2e3a);
  color: var(--color-text, #e4e4e7);
}

[data-theme="dark"] .card-stat {
  background: rgba(255,255,255,.05);
}
[data-theme="dark"] .card-stat-label {
  color: var(--color-text-muted, #71717a);
}
[data-theme="dark"] .card-stat + .card-stat {
  border-left-color: rgba(255,255,255,.08);
}
[data-theme="dark"] .card-alert {
  background: rgba(251, 191, 36, 0.08);
  color: #fbbf24;
}
[data-theme="dark"] .card-alert.alert-critical {
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
}
[data-theme="dark"] .customize-popover {
  background: var(--color-surface, #1e1e28);
  border-color: var(--color-border, #2e2e3a);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
[data-theme="dark"] .customize-popover-btn {
  background: var(--color-surface, #1e1e28);
  border-color: var(--color-border, #2e2e3a);
  color: var(--color-text, #e4e4e7);
}
[data-theme="dark"] .customize-popover-item:hover {
  background: rgba(255,255,255,.06);
}

[data-theme="dark"] .admin-table tr:hover td {
  background: var(--color-surface-hover, #252530);
}

[data-theme="dark"] .kalender-widget {
  background: var(--color-surface, #1e1e28);
  border-color: var(--color-border, #2e2e3a);
}

[data-theme="dark"] .profil-card {
  background: var(--color-surface, #1e1e28);
  border-color: var(--color-border, #2e2e3a);
}

[data-theme="dark"] .login-wrapper {
  background: #0d0d12;
}

[data-theme="dark"] .login-card {
  background: var(--color-surface, #1e1e28);
  border: 1px solid var(--color-border, #2e2e3a);
  box-shadow: 0 30px 60px rgba(0,0,0,.6);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select {
  background: var(--color-bg, #111118);
  border-color: var(--color-border, #2e2e3a);
  color: var(--color-text, #e4e4e7);
}

[data-theme="dark"] .module-content {
  background: var(--color-surface, #1e1e28);
  border-color: var(--color-border, #2e2e3a);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  font-size: 11px;
  color: var(--text-muted, #64748b);
  border-top: 1px solid var(--border, #e5e7eb);
  background: var(--color-surface, #fff);
  margin-top: auto;
}
[data-theme="dark"] .app-footer {
  background: var(--color-surface, #1e1e28);
  border-color: var(--color-border, #2e2e3a);
  color: var(--color-text-muted, #71717a);
}

/* ==========================================================================
   System-Administration Page
   ========================================================================== */
.sys-section {
  background: var(--color-surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}
.sys-section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

/* Info-Grid */
.sys-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.sys-info-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--color-bg, #f8f9fb);
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
}
.sys-info-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #64748b);
}
.sys-info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #1a1b1e);
}
.sys-version-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-primary, #B51615);
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

/* Upload-Form */
.sys-upload-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.sys-file-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px dashed var(--border, #e5e7eb);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted, #64748b);
  transition: border-color .2s, color .2s;
}
.sys-file-label:hover {
  border-color: var(--color-primary, #B51615);
  color: var(--color-primary, #B51615);
}

/* Result messages */
.sys-result {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 12px;
}
.sys-result-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.sys-result-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Auto-Backup */
.sys-auto-backup {
  padding: 16px;
  background: var(--color-bg, #f8f9fb);
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  margin-top: 16px;
}
.sys-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.sys-toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary, #B51615);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: #ecfdf5; color: #065f46; }
.badge-danger  { background: #fef2f2; color: #991b1b; }
.badge-info    { background: #eff6ff; color: #1e40af; }
.badge-default { background: #f3f4f6; color: #374151; }

/* Small buttons */
.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1;
}
.btn-danger-outline {
  color: #dc2626;
  border-color: #fecaca;
}
.btn-danger-outline:hover {
  background: #fef2f2;
}

/* Dark mode overrides */
[data-theme="dark"] .sys-section {
  background: var(--color-surface, #1e1e28);
  border-color: var(--color-border, #2e2e3a);
}
[data-theme="dark"] .sys-section-title {
  border-color: var(--color-border, #2e2e3a);
}
[data-theme="dark"] .sys-info-card {
  background: var(--color-bg, #111118);
  border-color: var(--color-border, #2e2e3a);
}
[data-theme="dark"] .sys-info-value {
  color: var(--color-text, #e4e4e7);
}
[data-theme="dark"] .sys-auto-backup {
  background: var(--color-bg, #111118);
  border-color: var(--color-border, #2e2e3a);
}
[data-theme="dark"] .sys-file-label {
  border-color: var(--color-border, #2e2e3a);
  color: var(--color-text-muted, #71717a);
}
[data-theme="dark"] .sys-result-success {
  background: #064e3b; color: #a7f3d0; border-color: #065f46;
}
[data-theme="dark"] .sys-result-error {
  background: #450a0a; color: #fecaca; border-color: #991b1b;
}
[data-theme="dark"] .badge-success { background: #064e3b; color: #a7f3d0; }
[data-theme="dark"] .badge-danger  { background: #450a0a; color: #fecaca; }
[data-theme="dark"] .badge-info    { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .badge-default { background: #27272a; color: #a1a1aa; }

/* Dark mode – Kalender */
[data-theme="dark"] .kal-weekdays {
  border-color: var(--color-border, #2e2e3a);
}
[data-theme="dark"] .kal-weekdays div {
  background: var(--color-bg, #111118);
  border-color: var(--color-border, #2e2e3a);
  color: var(--color-text-muted, #71717a);
}
[data-theme="dark"] .kal-grid {
  border-color: var(--color-border, #2e2e3a);
}
[data-theme="dark"] .kal-day {
  background: var(--color-surface, #1e1e28);
  border-color: var(--color-border, #2e2e3a);
}
[data-theme="dark"] .kal-day:hover {
  background: var(--color-bg, #111118);
}
[data-theme="dark"] .kal-day-num {
  color: var(--color-text, #e4e4e7);
}
[data-theme="dark"] .kal-day.today {
  background: #422006;
}
[data-theme="dark"] .kal-day.other-month {
  background: var(--color-bg, #111118);
}
[data-theme="dark"] .kal-day.other-month .kal-day-num {
  color: #52525b;
}
[data-theme="dark"] .kal-day.weekend {
  background: rgba(255,255,255,.02);
}
[data-theme="dark"] .kal-day.weekend .kal-day-num {
  color: #71717a;
}
[data-theme="dark"] .kal-event-dot.more {
  background: var(--color-bg, #111118);
  color: var(--color-text-muted, #71717a);
}

/* =========================================================
   THEME: Neon Cyberpunk – Glassmorphism Effekte
   Aktiviert wenn Sidebar-BG #0e0c1a (Neon-Theme Marker)
   ========================================================= */
[data-theme="dark"] .tile,
[data-theme="dark"] .tile[data-module] {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.3s ease;
}
[data-theme="dark"] .tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,.3);
}

[data-theme="dark"] .card-stat {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
  transition: all 0.3s ease;
}
[data-theme="dark"] .card-stat:hover {
  background: rgba(255,255,255,.08);
}

[data-theme="dark"] .sidebar-nav a.active {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--theme-primary) 20%, transparent),
    color-mix(in srgb, var(--theme-accent, var(--theme-primary)) 12%, transparent)
  );
  border: 1px solid color-mix(in srgb, var(--theme-primary) 25%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--theme-primary) 10%, transparent);
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn[style*="background"] {
  box-shadow: 0 4px 15px color-mix(in srgb, var(--theme-primary) 25%, transparent);
  transition: all 0.2s ease;
}
[data-theme="dark"] .btn-primary:hover {
  box-shadow: 0 6px 20px color-mix(in srgb, var(--theme-primary) 35%, transparent);
  transform: translateY(-1px);
}

[data-theme="dark"] .module-content,
[data-theme="dark"] .sys-section,
[data-theme="dark"] .profil-card,
[data-theme="dark"] .kalender-widget {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

[data-theme="dark"] .login-card {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(30, 30, 40, 0.8);
}

[data-theme="dark"] .badge-success {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.15);
}
[data-theme="dark"] .badge-danger {
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.15);
}
[data-theme="dark"] .badge-info {
  background: rgba(34, 211, 238, 0.1);
  color: #67e8f9;
  border: 1px solid rgba(34, 211, 238, 0.12);
}

[data-theme="dark"] .card-alert {
  border-radius: 12px;
  backdrop-filter: blur(8px);
}
[data-theme="dark"] .card-alert.alert-critical {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.15);
  color: #fda4af;
}

/* Neon-Glow bei Notifications-Bell */
[data-theme="dark"] .notification-badge {
  box-shadow: 0 0 8px rgba(236, 72, 153, 0.5);
}

/* Smooth scrollbar für Dark Mode */
[data-theme="dark"] ::-webkit-scrollbar {
  width: 8px;
}
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}
