/* ============================================================
   Nexus Prospector Pro — Layout: Sidebar, Header, Grid
   ============================================================ */

/* ── App shell ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 200;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
}

.logo-sub {
  font-size: 0.62rem;
  color: var(--gold);
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.nav-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 8px 10px 4px;
  margin-top: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.nav-link svg { flex-shrink: 0; }

.nav-link:hover {
  background: var(--bg3);
  color: var(--text);
}

.nav-link.active {
  background: rgba(212, 168, 67, 0.1);
  color: var(--gold);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: #0C0C0F;
  font-size: 0.65rem;
  font-weight: 800;
  font-family: 'DM Mono', monospace;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* ── Sidebar footer ── */
.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-footer-info {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  font-family: 'DM Mono', monospace;
}

/* ── Main content area ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top header ── */
.top-header {
  height: var(--header-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

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

.header-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

.header-subtitle {
  font-size: 0.78rem;
  color: var(--muted);
  display: none;
}

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

/* ── Hamburger (mobile) ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ── Page content ── */
.page-content {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* ── Dashboard grid ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
}

/* ── Sidebar overlay (mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 150;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger {
    display: flex;
  }

  .page-content {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header-actions {
    justify-content: flex-end;
  }

  .top-header {
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
