.app { display: flex; min-height: 100vh; }

/* --- sidebar --- */
.sidebar {
  width: 210px;
  min-width: 210px;
  background: var(--bg1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4);
  color: var(--accent);
  font-weight: 700;
  font-size: var(--fs-md);
  line-height: 1.15;
  border-bottom: 1px solid var(--border);
}
.logo small { color: var(--text-3); font-weight: 500; font-size: var(--fs-xs); }

#nav { display: flex; flex-direction: column; padding: var(--sp-3); gap: 2px; flex: 1; }
#nav a {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: var(--fs-md);
  transition: background 0.15s, color 0.15s;
}
#nav a:hover { background: var(--bg2); color: var(--text-1); }
#nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.sidebar-footer {
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.health-row { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--text-3); }

/* --- main --- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  background: var(--bg1);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h2 { font-size: var(--fs-lg); font-weight: 600; }
.topbar-actions { display: flex; gap: var(--sp-2); }

.content { padding: var(--sp-5); overflow-x: auto; }

/* --- grids --- */
.grid { display: grid; gap: var(--sp-4); }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { width: 160px; min-width: 160px; }
}
