* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --sidebar-width: 260px;
  /* --sidebar-bg: linear-gradient(
    180deg,
    rgba(18, 24, 40, 0.75),
    rgba(10, 14, 25, 0.7)
  ); */
  --sidebar-bg: linear-gradient(180deg, #111827 0%, #1f2937 100%);
  --glass-overlay: rgba(255, 255, 255, 0.03);
  --muted: rgba(255, 255, 255, 0.7);
  --muted-2: rgba(255, 255, 255, 0.55);
  --accent: #2563eb; /* blue accent */
  --radius-lg: 12px;
  --radius-md: 8px;
  --transition: 200ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

html,
body {
  width: 100%;
  height: 100%;
}

#wrapper {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100%;
  /* gap: 10px; */
  /* background-color: lightgray; */
  /* perspective is required for 3D transforms on children */
  perspective: 1000px;
  -webkit-perspective: 1000px;
}

#sidebar {
  width: var(--sidebar-width);
  height: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  box-shadow: 0 8px 28px rgba(2, 6, 23, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(8px) saturate(110%);
  -webkit-backdrop-filter: blur(8px) saturate(110%);
  position: relative;
  z-index: 1;
  padding: 16px;
}

/* Sidebar header */
#header {
  height: 140px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

#wappen {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.01)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--muted);
  flex: 0 0 80px;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.45);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
#wappen:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.5);
}

#userData {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#userName {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 6px;
}

#userUnit {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 8px;
}

#userRole {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.roleIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 16px;
  color: var(--muted);
}

/* Menu area */
#menu {
  margin-top: 8px;
  flex: 1 1 auto;
  overflow-y: auto;
}

#menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 4px;
}

#menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  background: transparent;
  transition: background var(--transition), transform var(--transition),
    color var(--transition);
}

#menu li a svg {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex: 0 0 20px;
  fill: currentColor;
  color: var(--muted-2);
  transition: color var(--transition), transform var(--transition);
}

/* per-icon colors */
svg.icon-dashboard {
  color: #2563eb;
} /* blue */
svg.icon-ueberblick {
  color: #10b981;
} /* green */
svg.icon-auswertung {
  color: #f59e0b;
} /* amber */
svg.icon-antraege {
  color: #7c3aed;
} /* violet */
svg.icon-einstellungen {
  color: #ef4444; /* red-ish */
}
svg.icon-hilfe {
  color: #06b6d4; /* teal */
}
svg.icon-admin {
  color: #0ea5e9; /* sky/blue */
}

/* slightly emphasize icon color on hover */
#menu li a:hover svg,
#menu li a:focus svg {
  transform: translateX(4px) scale(1.02);
  filter: brightness(1.05);
}

#menu li a:hover,
#menu li a:focus {
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  transform: translateX(4px);
}

/* active indicator - slim accent bar */
#menu li a.active {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.01)
  );
  color: var(--accent);
  position: relative;
}

#menu li a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 8px;
  background: var(--accent);
}

/* make SVG shapes use currentColor if possible */
#menu li a svg [fill="none"] {
  fill: none;
}

#menu::-webkit-scrollbar {
  width: 10px;
}
#menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Footer */
#footer {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.06);
}

#lastUpdate {
  font-size: 0.85rem;
  color: var(--muted);
}

/* OrgID display in sidebar footer */
#orgIdDisplay {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  gap: 6px;
  align-items: center;
}
#orgIdDisplay span#orgIdValue {
  font-weight: 700;
  color: var(--accent);
}

/* OrgID modal */
.orgid-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.orgid-modal.active {
  opacity: 1;
  pointer-events: auto;
}
.orgid-panel {
  width: 420px;
  max-width: calc(100% - 40px);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}
.orgid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.orgid-body {
  padding: 12px 16px;
}
.orgid-body p {
  color: rgba(0, 0, 0, 0.7);
  margin-bottom: 8px;
}
.orgid-body input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.orgid-footer {
  padding: 10px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  text-align: right;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.orgid-panel .close {
  background: transparent;
  border: 0;
  font-size: 18px;
  cursor: pointer;
}

#content {
  flex: 1;
  height: 100%;
  /* allow the flex item to shrink below its content's intrinsic min-width
     so horizontal scrolling works reliably inside it */
  min-width: 0;
  overflow-x: auto;
  padding: 12px;
  border: 5px solid #000;
  background: lightgray;
}

/* App panels inside content - milky glass look matching the sidebar */
.app {
  width: 100%;
  height: 100%;
  /* box-sizing: border-box; */
  /* padding: 18px; */
  /* margin-right: 18px; */

  /* box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12); */
  /* allow scrolling when inner content is larger than available space
     `hidden` clips the table; use `auto` so horizontal scrollbars appear */
  /* overflow: auto; */
}

.app.hidden {
  display: none;
}

/* active menu link styling */
#menu li a.active {
  background: rgba(37, 99, 235, 0.08);
  color: rgba(37, 99, 235, 0.95);
}

#menu li a.active svg {
  transform: translateX(2px);
  filter: none;
}

/* User switcher modal (Wappen -> Mitarbeiterliste) */
.user-switcher-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.user-switcher-modal.active {
  opacity: 1;
  pointer-events: auto;
}
.user-switcher-panel {
  width: 480px;
  max-width: calc(100% - 40px);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.user-switcher-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.user-switcher-body {
  padding: 12px;
  max-height: 56vh;
  overflow: auto;
}
.user-switcher-footer {
  padding: 10px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  text-align: right;
}
.user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-radius: 8px;
  background: #f8f9fb;
}
.user-main {
  display: flex;
  flex-direction: column;
}
.user-name {
  font-weight: 700;
}
.user-meta {
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.6);
}
.user-actions button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  cursor: pointer;
}
.user-item:hover {
  background: #eef2ff;
}
.loading-state,
.empty-state {
  color: rgba(0, 0, 0, 0.6);
  padding: 8px;
}
