*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg4);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.brand-icon { font-size: 24px; }
.brand-name { display: block; font-size: 13px; font-weight: 700; color: var(--text); }
.brand-sub { display: block; font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--bg2); color: var(--accent); }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text3);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.status-dot.offline { background: var(--red); }

/* Main content */
.main-content {
  flex: 1;
  /* min-width:0 — sem isso, flex child nao encolhe abaixo do conteudo
     (min-width:auto) e qualquer tabela/mono largo EXPANDE o main alem da
     viewport: o "overflow bugado" que aparecia conforme dados/zoom. */
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100vh;
  padding: 24px 32px;
}

.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
}

/* overflow-x:auto — tabela mais larga que a coluna ganha scroll proprio
   dentro da section em vez de vazar a pagina. */
.section { margin-top: 24px; overflow-x: auto; }
.section h2 { font-size: 14px; font-weight: 600; color: var(--text2); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

.text-muted { color: var(--text3); font-size: 13px; }

.hidden { display: none; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { padding: 16px; }
}
