/**
 * ESTRUCTURA Y LAYOUT - ALCALDÍA DE GIRARDOTA
 */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 1. BARRA BLANCA FLOTANTE SUPERIOR (Pág. 15 y 52 del Manual) */
.brand-top-bar {
  background-color: #FFFFFF;
  height: 76px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--girardota-gold);
}

.brand-logos-container {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand-logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.brand-divider {
  height: 32px;
  width: 1px;
  background-color: var(--border-light);
}

.brand-title-badge {
  display: flex;
  flex-direction: column;
}

.brand-title-main {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--girardota-green-primary);
  letter-spacing: -0.01em;
}

.brand-subtitle-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* User Avatar & Session Info */
.user-menu-box {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--girardota-green-light);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 104, 55, 0.15);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--girardota-green-primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--girardota-green-dark);
}

.user-role-tag {
  font-size: 0.7rem;
  color: var(--girardota-green-primary);
  font-weight: 700;
  text-transform: uppercase;
}

/* 2. ESTRUCTURA PRINCIPAL APP */
.app-container {
  display: flex;
  flex: 1;
}

/* Sidebar Navegación Modular */
.app-sidebar {
  width: 260px;
  background-color: #FFFFFF;
  border-right: 1px solid var(--border-light);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.92rem;
  transition: var(--transition-fast);
}

.nav-link:hover {
  background-color: var(--girardota-green-light);
  color: var(--girardota-green-primary);
}

.nav-link.active {
  background: var(--girardota-gradient-brand);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 104, 55, 0.25);
}

.nav-icon {
  font-size: 1.15rem;
}

/* Main Content Area */
.app-main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Header de Sección */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-family: var(--font-title);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--girardota-green-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

/* Footer Institucional */
.brand-footer {
  background-color: var(--girardota-green-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 1.25rem 2rem;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 4px solid var(--girardota-gold);
}

/* Responsive Breakpoints & Mobile Touch Optimization */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--girardota-green-primary);
  cursor: pointer;
  padding: 0.4rem;
}

@media (max-width: 992px) {
  .brand-top-bar {
    padding: 0.75rem 1rem;
    height: auto;
  }
  .brand-logo-img {
    height: 42px;
  }
  .brand-title-main {
    font-size: 0.95rem;
  }
  .brand-subtitle-sub {
    font-size: 0.72rem;
  }
  .mobile-nav-toggle {
    display: block;
  }
  .app-container {
    flex-direction: column;
  }
  .app-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    display: none; /* Se alterna con el menú hamburguesa */
  }
  .app-sidebar.mobile-open {
    display: flex;
  }
  .app-main-content {
    padding: 1rem;
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .user-badge {
    padding: 0.3rem 0.6rem;
  }
  .user-info {
    display: none; /* Ocultar texto largo en móviles muy pequeños */
  }
}

@media (max-width: 576px) {
  .brand-divider, .brand-subtitle-sub {
    display: none;
  }
}
