/**
 * nav.css — Sidebar, Navigation, Gruppen-Tabbar, Breadcrumb
 * Modul: public/assets/js/modules/nav.js
 * v6.3 CSS-MODULARISIERUNG
 */

/* ─── Sidebar (#sidebar) ─────────────────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--side-w);
  background: var(--bg1);
  color: var(--t1);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform .25s ease;
  border-right: 1px solid var(--line);
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  gap: 8px;
}

.sidebar-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-logo-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(100, 220, 120, .4));
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.sidebar-logo-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--t1);
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logo-sub {
  font-size: 10px;
  color: var(--t4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-version {
  font-size: 10px;
  background: var(--accent-subtle);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid var(--accent-border, var(--line));
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--t3);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 4px;
  display: none;
  transition: color .15s, background .15s;
}

.sidebar-close:hover {
  color: var(--t1);
  background: var(--bg3);
}

/* ─── Sidebar-Suche ──────────────────────────────────────────────────────── */
.sidebar-search-wrap {
  padding: 10px 12px;
  position: relative;
  flex-shrink: 0;
}

.sidebar-search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--t4);
  pointer-events: none;
  line-height: 1;
}

.sidebar-search-wrap input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--t1);
  padding: 7px 10px 7px 28px;
  font-size: 12px;
  font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}

.sidebar-search-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

.sidebar-search-wrap input::placeholder {
  color: var(--t4);
}

.search-dropdown {
  position: absolute;
  left: 12px;
  right: 12px;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  top: calc(100% - 4px);
}

.search-dropdown a {
  display: block;
  padding: 8px 12px;
  color: var(--t2);
  font-size: 12px;
  cursor: pointer;
  transition: background .1s;
}

.search-dropdown a:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

/* ─── Nav ────────────────────────────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 6px 0 12px;
  overflow-y: auto;
}

/* Sektion-Labels */
.nav-section-label {
  padding: 14px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--t4);
  user-select: none;
}

.nav-section-admin {
  color: var(--warn);
  opacity: .7;
}

/* Nav-Items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  padding: 0;
  color: var(--t2);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  position: relative;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  flex-shrink: 0;
  font-size: 15px;
  padding: 9px 0;
}

.nav-label {
  flex: 1;
  padding: 9px 8px 9px 0;
  line-height: 1.3;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .05);
  color: var(--t1);
  border-left-color: var(--line);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--accent-subtle) 0%, transparent 100%);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.nav-item.active .nav-icon {
  filter: drop-shadow(0 0 4px currentColor);
}

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge-red,
.badge-blue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  font-size: 10px;
  padding: 0 5px;
  margin-right: 8px;
  font-weight: 700;
  flex-shrink: 0;
}

.badge-red  { background: var(--error);  color: #fff; }
.badge-blue { background: var(--accent); color: #fff; }

/* ─── Utility-Nav ────────────────────────────────────────────────────────── */
.nav-divider {
  height: 1px;
  background: var(--line2);
  margin: 6px 12px;
}

.nav-item-util {
  font-size: 12px;
  opacity: .8;
}

.nav-item-util:hover {
  opacity: 1;
}

/* ─── Gruppen-Tab-Bar ────────────────────────────────────────────────────── */
.group-tabbar {
  display: flex;
  gap: 4px;
  padding: 8px 16px 0;
  border-bottom: 1px solid var(--line2);
  flex-wrap: wrap;
  background: var(--bg1);
}

.group-tabbar .tab-btn {
  padding: 6px 14px;
  border: 1px solid var(--line2);
  background: var(--bg2);
  border-radius: 6px 6px 0 0;
  font-size: 13px;
  cursor: pointer;
  color: var(--t2);
  border-bottom: none;
  margin-bottom: -1px;
  transition: color .15s, background .15s;
}

.group-tabbar .tab-btn.active {
  background: var(--bg1);
  color: var(--accent);
  border-color: var(--line2);
  border-bottom-color: var(--bg1);
  font-weight: 600;
}

.group-tabbar .tab-btn:hover:not(.active) {
  color: var(--t1);
  background: var(--bg3);
}

/* ─── Sidebar-Footer ─────────────────────────────────────────────────────── */
.sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sidebar-footer .btn-xs {
  flex: 1 1 calc(50% - 6px);
  justify-content: center;
  padding: 6px 4px;
}

.sidebar-info {
  font-size: 11px;
  color: var(--t4);
  flex-basis: 100%;
  margin-bottom: 2px;
}
