.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

/* ===== SIDEBAR 260px ===== */
.sidebar {
  width: 260px;
  background:
    linear-gradient(180deg, rgba(15,20,26,.98), rgba(20,27,35,.98) 62%, rgba(12,17,23,.99));
  border-right: 1px solid rgba(230,232,235,.10);
  color: white;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 30;
  transition: transform 0.25s ease;
}

/* Bloco de marca */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(230,232,235,.10);
}

.brand-mark {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(245,247,248,.06), rgba(95,116,135,.10));
  border: 1px solid rgba(230,232,235,.14);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 6px;
}

.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand h1 { font-size: 0.92rem; margin: 0; letter-spacing: 0.12em; text-transform: uppercase; }
.brand p { margin: 2px 0 0; color: #a0a4ad; font-size: 0.75rem; }

/* Bloco do usuário logado */
.sidebar-user {
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(230,232,235,.08);
  display: grid;
  gap: 2px;
}
.sidebar-user-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ff6863;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.sidebar-user-academy {
  margin-top: 4px;
  font-size: 0.72rem;
  color: #8a8f9a;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nav menu */
.nav-menu,
.premium-nav {
  display: grid;
  gap: 4px;
  padding: 10px 8px;
  flex: 1;
  align-content: start; /* não estica as seções para preencher o espaço */
}

.nav-section {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.018);
}

.nav-section-toggle {
  width: 100%;
  min-height: 52px;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,.055), rgba(255,255,255,.015));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease;
}

.nav-section-toggle:hover {
  background: linear-gradient(135deg, rgba(225,6,0,.20), rgba(255,255,255,.03));
}

.nav-section.open .nav-section-toggle {
  background:
    linear-gradient(90deg, rgba(225,6,0,.22), rgba(255,255,255,.035)),
    linear-gradient(135deg, rgba(255,255,255,.045), transparent);
  box-shadow: inset 3px 0 0 rgba(225,6,0,.85);
}

.group-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.16), transparent 30%),
    linear-gradient(145deg, #202328, #0d0e11);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25), 0 6px 14px rgba(0,0,0,.18);
}

.nav-section.open .group-icon {
  border-color: rgba(225,6,0,.58);
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.20), transparent 30%),
    linear-gradient(145deg, #e10600, #5d0705 70%);
}

.group-svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.group-title { display: grid; min-width: 0; gap: 1px; flex: 1; }
.group-title strong {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: #fff;
}
.group-title small {
  color: #8e939e;
  font-size: 0.67rem;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.group-caret {
  margin-left: auto;
  color: #ff6863;
  font-weight: 900;
  transition: transform .18s ease;
  flex: 0 0 auto;
}
.nav-section.open .group-caret { transform: rotate(180deg); }

/* Painel inline da seção */
.nav-section-panel {
  display: grid;
  gap: 5px;
  padding: 0 8px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .25s ease, opacity .2s ease, padding .2s ease;
}

.nav-section.open .nav-section-panel {
  padding: 6px 8px 8px;
  max-height: 600px;
  opacity: 1;
}

/* Botões de nav */
.nav-link {
  min-height: 52px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.018);
  border: 1px solid transparent;
  color: #e7e9ee;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.nav-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(225,6,0,.16), transparent 55%);
  opacity: 0;
  transition: opacity .18s ease;
}

.nav-link:hover::before,
.nav-link.active::before { opacity: 1; }

.nav-link:hover,
.nav-link.active {
  color: #fff;
  border-color: rgba(225,6,0,.22);
  background: rgba(255,255,255,.035);
}

.nav-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.16), transparent 30%),
    linear-gradient(145deg, #202328, #0d0e11);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25), 0 6px 14px rgba(0,0,0,.18);
}

.nav-link.active .nav-icon {
  border-color: rgba(225,6,0,.58);
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.20), transparent 30%),
    linear-gradient(145deg, #e10600, #5d0705 70%);
}

.nav-svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label { display: grid; position: relative; z-index: 1; min-width: 0; gap: 1px; }
.nav-label strong {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.15;
  color: #fff;
}
.nav-label small {
  margin-top: 1px;
  font-size: 0.67rem;
  color: #8c929c;
  letter-spacing: 0.02em;
  font-weight: 700;
}
.nav-link.active .nav-label small { color: #ffc4c1; }

/* Rodapé da sidebar */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(230,232,235,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sidebar-footer small { color: #555b68; font-size: 0.72rem; }
.sidebar-logout-btn {
  background: rgba(225,6,0,.12);
  border: 1px solid rgba(225,6,0,.22);
  color: #ff7875;
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease;
}
.sidebar-logout-btn:hover {
  background: rgba(225,6,0,.24);
  color: #fff;
}

/* ===== CONTEÚDO PRINCIPAL ===== */
.main-content {
  min-width: 0;
  background:
    radial-gradient(circle at top left, rgba(95,116,135,.15), transparent 36%),
    radial-gradient(circle at 84% 0%, rgba(200,30,45,.08), transparent 28%),
    linear-gradient(135deg, #0f141a 0%, #151b22 100%);
}

/* ===== TOPBAR ===== */
.topbar {
  min-height: 64px;
  background: rgba(20,27,35,.88);
  border-bottom: 1px solid rgba(230,232,235,.10);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 6px 24px rgba(0,0,0,.16);
}

.topbar h2 { margin: 0; font-size: 1.28rem; color: #fff; letter-spacing: -.01em; }
.topbar p { margin: 2px 0 0; color: var(--muted, #7a8290); font-size: 0.82rem; }

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Pill e badge do topbar: ocultos (mantidos no HTML para compatibilidade JS) */
.topbar .status-pill,
.topbar .academy-pill,
.topbar .user-pill,
#currentUserBadge,
#academyBadge,
#logoutButton { display: none !important; }

/* ===== ELEMENTOS OCULTADOS NO TOPBAR (compat. JS) ===== */

.view-container {
  padding: 22px;
  max-width: 1500px;
  margin: 0 auto;
}

/* ===== MOBILE OVERLAY ===== */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 40;          /* abaixo da sidebar (50) no mobile */
}

.sidebar-backdrop.open {
  display: block;
}

/* Botão hamburger: oculto no desktop */
.menu-button { display: none !important; }
