/* Layout Principal SPA */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ==== SIDEBAR ==== */
.sidebar {
  width: 260px;
  background-color: var(--bg-dark);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal);
  z-index: var(--z-sidebar);  /* see style.css z-index hierarchy */
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--primary-color);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-bright);
}

.nav-links {
  list-style: none;
  padding: 1rem 0;
  flex: 1;
  overflow-y: auto;
}

.nav-link {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--text-muted);
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-bright);
  background-color: var(--bg-card-hover);
}

.nav-link.active {
  color: var(--primary-color);
  background-color: rgba(46, 160, 67, 0.1);
  border-left-color: var(--primary-color);
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* ==== CONTEUDO PRINCIPAL ==== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
}

.topbar {
  box-sizing: border-box;
  min-height: 60px;
  background-color: var(--bg-darker);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 2rem;
  backdrop-filter: blur(10px);
  flex-wrap: nowrap;
  overflow: visible;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);  /* see style.css z-index hierarchy */
}

.page-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-title h1 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
}
.page-title svg {
  width: 48px !important;
  height: 48px !important;
  flex-shrink: 0;
}

.view-container {
  flex: 1;
  min-width: 0;
  padding: 2rem;
  animation: fadeIn 0.3s ease;
}

/* ==== RESPONSIVE LAYOUT ==== */

/* Tablet: 768px - 1199px */
@media (min-width: 768px) and (max-width: 1199px) {
  .sidebar {
    width: 240px;
  }

  .topbar {
    padding: 0 1.5rem;
  }

  .view-container {
    padding: 1.5rem;
  }
}

/* Mobile: max-width 767px */
@media (max-width: 767px) {
  .app-container {
    flex-direction: column;
  }

  .main-content {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .view-container {
    padding: 1rem;
  }
}

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* overflow-x moved from .view-container to body — clip on ancestor breaks position:sticky */
