/* RESET */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* BASE */
body {
  font-family: "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e2e8f0;

  overflow: hidden; /* 🔥 sem scroll global */
}

/* APP LAYOUT */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh; /* 🔥 ocupa viewport inteira */
}

/* HEADER */
.header {
  height: 50px;
  background: #111827;
  border-bottom: 1px solid #1f2937;

  display: flex;
  align-items: center;
  padding: 0 16px;
}

/* FOOTER */
.footer {
  height: 40px;
  background: #111827;
  border-top: 1px solid #1f2937;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* MAIN AREA */
.main {
  flex: 1;
  display: flex;

  overflow: hidden; /* 🔥 impede overflow externo */
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  min-width: 220px;
  max-width: 320px;

  background: #020617;
  border-right: 1px solid #1e293b;

  display: flex;
  flex-direction: column;

  overflow: hidden; /* 🔥 importante */
}

/* TOP CONTROLS */
.sidebar-top {
  padding: 10px;
  border-bottom: 1px solid #1e293b;

  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* BOTÕES */
button {
  background: #1e293b;
  color: #e2e8f0;
  border: none;
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;

  transition: 0.2s;
}

button:hover {
  background: #334155;
}

/* TREE CONTAINER (SCROLL AQUI) */
.tree {
  list-style: none;
  padding: 10px;
  margin: 0;

  flex: 1;
  overflow-y: auto; /* 🔥 scroll sidebar */

  font-size: 13px;
}

/* SUB LEVELS */
.tree ul {
  list-style: none;
  padding-left: 14px;
  margin-left: 6px;

  border-left: 1px solid #334155;
}

/* NODE */
.node {
  display: flex;
  align-items: center;

  padding: 3px 6px;
  border-radius: 4px;

  transition: 0.15s;
}

.node:hover {
  background: #1e293b;
}

/* TOGGLE */
.toggle {
  width: 14px;
  cursor: pointer;
  margin-right: 4px;
  color: #94a3b8;
  font-size: 11px;
}

/* TITLE */
.title {
  cursor: pointer;
  flex: 1;
}

/* HIDDEN CHILDREN */
.hidden {
  display: none;
}

/* CONTENT AREA */
.content {
  flex: 1;
  padding: 20px;

  overflow-y: auto; /* 🔥 scroll conteúdo */

  background: #0f172a;
}

/* CONTENT STYLE */
.content h3 {
  margin-top: 0;
}

/* SCROLLBAR (BONUS 🔥) */
.sidebar::-webkit-scrollbar,
.content::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb,
.content::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.content::-webkit-scrollbar-thumb:hover {
  background: #475569;
}
