html, body {
  height: 100%;
  margin: 0;
}

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
}

/* --- Sidebar --- */
.sidebar {
  width: 240px;
  min-width: 240px;
  height: 100vh;
  overflow-y: auto;
  background: #1f2933;
  color: white;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.2s ease, width 0.2s ease, min-width 0.2s ease;
}

.sidebar.colapsado {
  margin-left: -240px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  white-space: nowrap;
}

.sidebar-logo img {
  width: 32px;
  height: 32px;
}

.sidebar-logo span {
  font-weight: bold;
  font-size: 1.1rem;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.25rem;
  color: #cbd2d9;
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
}

.sidebar nav a:hover {
  background: rgba(255,255,255,0.06);
  color: white;
}

.sidebar nav a.activo {
  background: #2563eb;
  color: white;
}

/* --- Main area --- */
.main-area {
  flex: 1;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: #1f2933;
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.topbar h1 {
  margin: 0;
  font-size: 1.3rem;
  flex: 1;
}

.btn-hamburger {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.btn-hamburger:hover {
  background: rgba(255,255,255,0.1);
}

.header-derecha {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

#btn-logout {
  background: #dc2626;
  color: white;
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
}

#btn-logout:hover {
  background: #b91c1c;
}

.contenido {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background: #f4f5f7;
}

/* --- Responsive: pantallas chicas empieza colapsado --- */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    z-index: 20;
    height: 100vh;
  }
  .sidebar.colapsado {
    margin-left: -240px;
  }
}
