/* === APP LAYOUT === */
body {
  display: flex;
  min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar__logo-icon {
  font-size: 1.2rem;
  color: var(--color-neutral);
}

.sidebar__logo-text {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
}

/* === NAV === */
.sidebar__nav {
  flex: 1;
  padding: 0.75rem 0;
}

.nav-group {
  margin-bottom: 0.25rem;
}

.nav-group__label {
  padding: 1rem 1.25rem 0.4rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-secondary);
  transition: all var(--transition);
  border-left: 3px solid transparent;
  cursor: pointer;
}

.nav-item__icon {
  width: 1.2rem;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

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

.nav-item.active {
  color: var(--text-primary);
  background: rgba(122, 156, 196, 0.06);
  border-left-color: var(--color-neutral);
}

.nav-item.active .nav-item__icon {
  opacity: 1;
  color: var(--color-neutral);
}

/* === MAIN === */
.main {
  flex: 1;
  margin-left: 250px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === HEADER === */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 15, 17, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
}

.header__title-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.header__title {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.header__meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.header__separator {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.header__divider {
  color: var(--border-accent);
}

.header__stat {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* === CONTENT === */
.content {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  width: 100%;
}

/* === SECTION === */
.section-header {
  margin-bottom: 1.75rem;
}

.section-header__title {
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
}

.section-header__subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* === GRID UTILITIES === */
.grid {
  display: grid;
  gap: 1rem;
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.grid--auto {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* === SECTION FADE TRANSITION === */
.content > .section {
  animation: sectionIn 300ms ease forwards;
}

@keyframes sectionIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === MOBILE NAV === */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 0.4rem 0;
  justify-content: space-around;
}

.mobile-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.75rem;
  font-size: 1rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.mobile-nav__item span {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.mobile-nav__item.active {
  color: var(--color-neutral);
}

/* === RESPONSIVE: TABLET (collapse sidebar) === */
@media (max-width: 1024px) {
  .sidebar {
    width: 60px;
    overflow: visible;
  }

  .sidebar__logo-text,
  .nav-group__label,
  .nav-item span:not(.nav-item__icon) {
    display: none;
  }

  .sidebar__logo {
    justify-content: center;
    padding: 1rem 0.5rem 1.25rem;
  }

  .nav-item {
    justify-content: center;
    padding: 0.7rem 0;
    border-left: none;
    border-right: 3px solid transparent;
  }

  .nav-item.active {
    border-left-color: transparent;
    border-right-color: var(--color-neutral);
  }

  .nav-item__icon {
    width: auto;
    font-size: 1.05rem;
  }

  .main {
    margin-left: 60px;
  }

  .content {
    padding: 1.5rem;
  }

  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

/* === RESPONSIVE: MOBILE (bottom nav) === */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: flex;
  }

  .main {
    margin-left: 0;
    padding-bottom: 4rem;
  }

  .header {
    padding: 0.75rem 1rem;
  }

  .content {
    padding: 1rem;
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  .grid--auto {
    grid-template-columns: 1fr;
  }
}
