
/* Estrutura Geral */
#app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* Sidebar Estilo Premium CODΞX ONΞ */
#sidebar {
  width: var(--sidebar-width);
  background-color: var(--brown-dark);
  color: var(--white);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  transition: width var(--transition-slow);
  z-index: 100;
  box-shadow: var(--shadow-xl);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  border-bottom: 1px solid rgba(214, 193, 166, 0.15); /* Borda bege suave */
}

.sidebar-logo {
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-logo span.accent {
  color: var(--beige); /* Destaque no logo da empresa */
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--gray-medium);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.sidebar-toggle:hover {
  color: var(--beige);
}

.sidebar-nav-container {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) 0;
}

/* Ocultar scrollbar da navegação */
.sidebar-nav-container::-webkit-scrollbar {
  display: none;
}

.sidebar-section {
  margin-bottom: var(--space-lg);
}

.sidebar-section-title {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  color: var(--gray-medium);
  letter-spacing: 1.5px;
  font-weight: 700;
  padding: 0 var(--space-lg) var(--space-xs);
}

.sidebar-menu {
  list-style: none;
}

.sidebar-item {
  margin: 2px var(--space-sm);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  color: var(--gray-light);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: var(--fs-sm);
  transition: all var(--transition-fast);
}

.sidebar-link:hover {
  color: var(--white);
  background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
  background-color: var(--brown-medium);
  color: var(--white);
  font-weight: 600;
}

.sidebar-link i {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Rodapé do Associado (Perfil rápido) */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(214, 193, 166, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: rgba(0, 0, 0, 0.15);
  min-height: 72px;
  box-sizing: border-box;
}

.sidebar-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--brown-medium);
  color: var(--white);
  font-weight: 700;
  font-size: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  box-sizing: border-box;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.sidebar-user-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--white);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  line-height: 1.2;
}

.sidebar-user-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.1;
  width: fit-content;
  text-align: center;
  display: inline-block;
}

.sidebar-user-category {
  font-size: 11px;
  color: var(--beige);
  font-weight: 600;
  line-height: 1;
  opacity: 0.85;
}

/* Área Principal com Margin da Sidebar */
#main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
}

/* Top Header */
#top-header {
  height: var(--header-height);
  background-color: var(--white);
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 100%;
}

.header-left {
  display: flex;
  flex-direction: column;
}

.header-breadcrumb {
  font-size: var(--fs-xs);
  color: var(--gray-medium);
  font-weight: 500;
}

.header-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--brown-dark);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

/* Sino de Notificação */
.notification-bell {
  position: relative;
  cursor: pointer;
  color: var(--brown-dark);
  padding: var(--space-xs);
  border-radius: var(--radius-full);
  transition: background-color var(--transition-fast);
}

.notification-bell:hover {
  background-color: var(--off-white);
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: var(--danger);
  color: var(--white);
  font-size: 9px;
  font-weight: 700;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Perfil Dropdown */
.header-profile {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

/* Responsividade de Colapso da Sidebar */
body.sidebar-collapsed #sidebar {
  width: var(--sidebar-collapsed);
}

body.sidebar-collapsed #main-wrapper {
  margin-left: var(--sidebar-collapsed);
}

body.sidebar-collapsed .sidebar-logo span.text,
body.sidebar-collapsed .sidebar-link span,
body.sidebar-collapsed .sidebar-section-title,
body.sidebar-collapsed .sidebar-user-info {
  display: none;
}

body.sidebar-collapsed .sidebar-link {
  justify-content: center;
}

body.sidebar-collapsed .sidebar-footer {
  justify-content: center;
}

/* Responsividade Mobile e Tablet */
@media (max-width: 992px) {
  .hide-on-mobile {
    display: none !important;
  }

  #sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }
  
  #main-wrapper {
    margin-left: 0 !important;
  }

  body.sidebar-open #sidebar {
    transform: translateX(0);
  }

  .mobile-nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #333 !important;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
  }

  #top-header {
    height: 60px; /* Reduz altura no mobile */
    padding: 0 20px !important;
    background-color: #FAFAFA !important;
    border-bottom: none !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .header-left {
    flex-direction: row;
    align-items: center;
  }

  .header-brand-breadcrumb {
    display: none !important;
  }

  .header-mobile-logo {
    display: flex !important;
    align-items: center;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 1px;
    color: #111;
  }

  .header-right {
    gap: 12px !important;
    display: flex;
    align-items: center;
  }

  .notification-bell {
    position: relative;
    color: #333;
    cursor: pointer;
  }

  .notification-badge, .notification-badge-dot {
    position: absolute;
    top: 0;
    right: 2px;
    width: 8px;
    height: 8px;
    background-color: #e53e3e;
    border-radius: 50%;
    border: 2px solid #FAFAFA;
    padding: 0 !important;
    display: block !important;
    font-size: 0 !important;
    min-width: 0 !important;
  }

  .header-profile {
    cursor: pointer;
  }

  .header-profile .avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px !important;
    background-color: #eee !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    border: none !important;
  }

  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: 65px;
    background: #ffffff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    z-index: 1000;
  }

  .mobile-bottom-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #999;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    transition: color var(--transition-fast);
  }

  .mobile-bottom-link.active {
    color: #D4AF37;
  }

  .mobile-bottom-link i {
    width: 22px;
    height: 22px;
  }

  #main-content {
    padding: var(--space-md) !important;
    padding-bottom: 85px !important; /* Evitar sobreposição do bottom nav */
  }

}

/* Área de Conteúdo */
#main-content {
  flex: 1;
  padding: var(--space-xl);
}

/* Dropdown Menu do Avatar */
.dropdown-menu {
  position: absolute;
  top: 60px;
  right: 24px;
  background-color: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 200px;
  z-index: 1000;
  display: none;
  flex-direction: column;
  padding: var(--space-xs) 0;
  animation: fadeIn var(--transition-fast) forwards;
}

.dropdown-menu.active {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--brown-dark);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.dropdown-item:hover {
  background-color: var(--off-white);
  color: var(--brown-medium);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--gray-light);
  margin: var(--space-xs) 0;
}

.mobile-bottom-nav {
  display: none;
}

