:root {
  --primary: #4361ee;
  --primary-700: #3346c8;
  --secondary: #3a0ca3;
  --accent: #f72585;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #172033;
  --muted: #718096;
  --border: #e7eaf0;
  --sidebar-width: 248px;
  --transition: .18s ease;
}

/* Layout base */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #e5e7eb;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 50;
}

.brand {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  text-decoration: none;
}

.brand-logo {
  height: 65px;
  width: auto;
  object-fit: contain;
  display: block;
  transition: .25s ease;
}

.brand-logo:hover {
  transform: scale(1.03);
}

.nav-group-label {
  padding: 0 10px;
  margin: 10px 0 6px;
  color: #98a2b3;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.nav-link {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #d0d5dd;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
}


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

.nav-link.active {
  background: rgba(255, 255, 255, 0.39);
  color: #fff;
  font-weight: 800;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: #fff;
}

.nav-link i {
  width: 18px;
  text-align: center;
}

.nav-link .badge {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: #d0d5dd;
  font-size: 12px;
}

.sidebar-footer a {
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 62px;
  background: rgba(244, 246, 251, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
}

.page-title h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -.03em;
}

.page-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-menu-btn {
  display: none;
}

/* Responsivo */
@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 72px 1fr;
  }

  .sidebar {
    padding: 14px 10px;
  }

  .brand-logo,
  .nav-group-label,
  .nav-link span,
  .sidebar-footer {
    display: none;
  }

  .nav-link {
    justify-content: center;
  }

  .nav-link.active::before {
    left: -10px;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
    position: fixed;
    width: var(--sidebar-width);
    box-shadow: 0 20px 60px rgba(15, 23, 42, .28);
  }

  body.sidebar-open .sidebar {
    display: flex;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .topbar {
    padding: 10px 14px;
  }
}