/* Casca do app: sidebar, topo, conteúdo. Depende de base.css. */
/* ---------- Layout do app ---------- */
.app {
  display: flex;
  min-height: 100vh;
}
body.booting .app {
  visibility: hidden;
}
.sidebar {
  width: 248px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    160deg,
    var(--graphite),
    var(--graphite-950) 55%,
    var(--graphite-800)
  );
  color: #cbd5e1;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 64px;
  padding: 0 20px;
  color: #fff;
  font-weight: 800;
  border-bottom: 1px solid rgb(255 255 255 / 8%);
}
.sidebar-brand .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  margin: 0;
  box-shadow: none;
}
.nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
a.nav-item:hover {
  background: rgb(255 255 255 / 6%);
  color: #fff;
}
.nav-item.active {
  background: rgb(245 158 11 / 14%);
  color: var(--primary);
}
.nav-item.disabled {
  opacity: 0.45;
  cursor: default;
}
.nav-item .tag {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgb(255 255 255 / 8%);
}
.nav-section {
  margin: 14px 12px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar h1 {
  margin: 0;
  font-size: 20px;
  flex: 1;
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text);
}
.menu-toggle svg {
  display: block;
  width: 24px;
  height: 24px;
}
.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.user-box .role {
  font-size: 12px;
  color: var(--text-muted);
}
.content {
  padding: 24px;
  max-width: 1200px;
  width: 100%;
}

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar.open {
    transform: none;
    box-shadow: 0 0 0 100vmax rgb(15 23 42 / 45%);
  }
  .menu-toggle {
    display: block;
  }
  .content {
    padding: 16px;
  }
  .user-box .name {
    display: none;
  }
}
