/* Layout Mobile-First y Escritorio */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-4);
  background: radial-gradient(circle at top right, #1e3a8a 0%, #0f172a 75%);
}

.auth-card {
  width: 100%;
  max-width: 980px;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 860px) {
  .auth-card {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }
}

.auth-brand-panel {
  background: linear-gradient(150deg, #0f172a 0%, #1e3a8a 100%);
  color: var(--text-inverse);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.auth-form-panel {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

/* Shell de Panel (Superadmin y Asociación) — Diseño 100% Ancho Completo */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* NIVEL 1: Header Institucional Principal */
.app-topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem var(--space-5);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
  width: 100%;
}

.topbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.brand-logo img {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

/* NIVEL 2: Barra Horizontal de Navegación Secundaria (debajo del Header) */
.second-level-navbar,
.sidebar-nav {
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  width: 100%;
  padding: 0.45rem var(--space-5);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.25);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
  position: sticky;
  top: 0;
  z-index: 95;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 0.9rem;
  border-radius: var(--radius-md);
  color: #e2e8f0;
  font-size: 0.86rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  width: auto;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  text-decoration: none;
}

.nav-item.active {
  background-color: var(--color-accent);
  color: #ffffff;
  font-weight: 600;
}

/* Grupos desplegables en la barra de navegación de segundo nivel */
.nav-dropdown {
  position: relative;
  display: inline-flex;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.9rem;
  border-radius: var(--radius-md);
  color: #f1f5f9;
  font-size: 0.86rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nav-dropdown-trigger:hover,
.nav-dropdown.open .nav-dropdown-trigger {
  background-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.32);
}

.nav-dropdown-trigger.has-active {
  background-color: var(--color-accent);
  color: #ffffff;
  border-color: transparent;
}

.nav-dropdown-caret {
  font-size: 0.72rem;
  opacity: 0.85;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  min-width: 255px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  padding: 0.4rem;
  z-index: 250;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu {
  display: flex;
}

.nav-dropdown-menu .nav-item {
  width: 100%;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.app-content {
  padding: var(--space-5);
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}

.ws-panel,
.tab-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
  width: 100%;
}
