/* ════════════════════════════════════════════════════════════════════════════
   PUI — Layout: App shell, Sidebar, Topbar, Contenido principal
   ════════════════════════════════════════════════════════════════════════════ */

/* ── App shell ───────────────────────────────────────────── */
#app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--pui-verde-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1050;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.sidebar-brand {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: rgba(255, 255, 255, .18);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-brand-text small {
  display: block;
  font-size: .68rem;
  font-weight: 400;
  opacity: .7;
  line-height: 1.1;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem 0; }

.nav-section-title {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .45);
  padding: .9rem 1.25rem .3rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.25rem;
  color: rgba(255, 255, 255, .78);
  text-decoration: none;
  font-size: .9rem;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.sidebar-link.active {
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-weight: 600;
  border-left: 3px solid #fff;
}

.sidebar-link i { font-size: 1.05rem; flex-shrink: 0; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .8rem;
}

.user-chip {
  display: flex; align-items: center; gap: .6rem;
  color: rgba(255, 255, 255, .85);
}

.user-avatar {
  width: 34px; height: 34px;
  background: rgba(255, 255, 255, .2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 700;
  flex-shrink: 0;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  z-index: 1040;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.topbar-title {
  font-weight: 600;
  font-size: 1rem;
  color: #1a202c;
  flex: 1;
}

.topbar-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #ecfdf5;
  color: var(--pui-verde);
  font-size: .75rem;
  font-weight: 600;
  padding: .25rem .65rem;
  border-radius: 99px;
  border: 1px solid #a7f3d0;
}

/* ── Contenido principal ─────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 1.75rem 2rem;
  flex: 1;
  min-width: 0;
}

/* ── Sidebar overlay (mobile) ────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 1045;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .topbar { left: 0; }
  .main-content { margin-left: 0; }
}

@media (max-width: 575.98px) {
  .main-content { padding: 1.25rem 1rem; }
}
