/* ==========================================
   GROVE CUSTOMS PALETO BAY — SIDEBAR & NAVIGATION STYLES
   High-End Tuning-Tablet Dock, Status-Telemetrie & Partner-Submenü
   ========================================== */

/* Left Sidebar Navigation */
.app-sidebar {
  width: 288px;
  min-width: 288px;
  max-width: 288px;
  background: linear-gradient(180deg, rgba(12, 16, 23, 0.96) 0%, rgba(7, 10, 15, 0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.075);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 100;
  box-shadow: 6px 0 35px rgba(0, 0, 0, 0.5);
}

.sidebar-header {
  padding: 1.3rem 1.2rem 1.15rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  background: radial-gradient(circle at 20% 0%, rgba(16, 185, 129, 0.08), transparent 70%);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  border: 1.5px solid rgba(52, 211, 153, 0.55);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.22);
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #f8fafc;
  text-transform: uppercase;
  line-height: 1.12;
}

.brand-title span {
  color: var(--primary-green-bright);
  text-shadow: 0 0 14px rgba(16, 185, 129, 0.3);
}

.brand-subtitle {
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 0.22rem;
  letter-spacing: 0.01em;
}

.sidebar-status-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.95rem;
  padding: 0.45rem 0.7rem;
  background: rgba(5, 7, 11, 0.65);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--primary-green-bright);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--primary-green-bright);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary-green-bright);
  animation: statusPulse 2.4s infinite ease-in-out;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.88); }
}

.sidebar-clock {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #cbd5e1;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Sidebar Nav List */
.sidebar-nav {
  flex: 1;
  padding: 0.85rem 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  scrollbar-width: thin;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.nav-section-title {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.9rem 0.7rem 0.3rem 0.7rem;
}

.nav-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  color: #94a3b8;
  padding: 0.66rem 0.85rem;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  width: 100%;
  transition: var(--transition);
}

.nav-icon {
  font-size: 1.05rem;
  width: 22px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.nav-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-tab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn:hover .nav-icon {
  transform: scale(1.08);
}

.nav-tab-btn.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.02) 100%);
  border-color: rgba(16, 185, 129, 0.22);
  border-left: 3px solid var(--primary-green-bright);
  font-weight: 700;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active .nav-title {
  color: var(--primary-green-bright);
}

/* Sidebar Dropdown Group & Submenu */
.sidebar-dropdown-group {
  display: flex;
  flex-direction: column;
}

.nav-tab-has-sub {
  position: relative;
  display: flex;
  align-items: center;
}

.sub-indicator {
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: transform 0.22s ease;
  margin-left: auto;
}

.sidebar-dropdown-group.open .sub-indicator {
  transform: rotate(180deg);
  color: var(--primary-green-bright);
}

.sidebar-sub-menu {
  display: none;
  flex-direction: column;
  padding: 0.4rem 0.35rem 0.45rem 0.55rem;
  margin: 0.2rem 0 0.4rem 0.55rem;
  border-left: 1.5px solid rgba(16, 185, 129, 0.3);
  background: rgba(5, 8, 12, 0.45);
  border-radius: 0 8px 8px 0;
}

.sidebar-dropdown-group.open .sidebar-sub-menu,
.sidebar-sub-menu.show {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.sub-menu-filter-wrap {
  padding: 0.2rem 0.25rem 0.35rem 0.1rem;
}

.sub-menu-search {
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: rgba(7, 10, 15, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.76rem;
  outline: none;
  transition: var(--transition);
}

.sub-menu-search:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.sidebar-sub-items {
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
  padding-right: 0.25rem;
  scrollbar-width: thin;
}

.sidebar-sub-items::-webkit-scrollbar {
  width: 3px;
}
.sidebar-sub-items::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.sidebar-sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.42rem 0.55rem;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  width: 100%;
  transition: var(--transition);
}

.sidebar-sub-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.045);
}

.sidebar-sub-item.active {
  color: #fff;
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.32);
  font-weight: 600;
}

.sidebar-sub-item-text {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-sub-item-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.1rem 0.38rem;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.18);
  color: var(--primary-green-bright);
  border: 1px solid rgba(16, 185, 129, 0.32);
  white-space: nowrap;
}

.sub-group-header {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.48rem 0.3rem 0.15rem 0.3rem;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 0.95rem 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
  background: rgba(5, 7, 11, 0.45);
  font-size: 0.77rem;
}

.sidebar-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.32rem;
  color: var(--text-muted);
}

.sidebar-info-row strong {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--primary-green-bright);
  font-weight: 600;
}

.sidebar-quote {
  margin-top: 0.55rem;
  font-size: 0.71rem;
  color: #64748b;
  text-align: center;
  font-style: italic;
}

/* Responsive Breakpoints */
@media (max-width: 980px) {
  .app-layout {
    flex-direction: column;
  }
  .app-sidebar {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .sidebar-nav {
    max-height: 280px;
  }
  .main-wrapper {
    height: auto;
  }
  .main-content {
    padding: 1.2rem;
  }
}

/* Active Logged-In User Box in Sidebar */
.sidebar-user-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding: 0.5rem 0.65rem;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 8, 12, 0.65) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 9px;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.sidebar-user-avatar.admin {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
}

.sidebar-logout-btn {
  padding: 0.3rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}
