/* Layout Structure */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: 220px;
  min-width: 220px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  transition: transform var(--transition-normal), width var(--transition-normal);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 24px 20px 16px 20px;
  display: flex;
  align-items: center;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo-icon {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 170px;
  height: 42px;
}

.sidebar-logo-img {
  max-height: 40px;
  width: 100%;
  max-width: 170px;
  object-fit: contain;
  display: block;
}

.sidebar-section-title {
  padding: 16px 20px 8px 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0 10px;
  gap: 2px;
  list-style: none;
}

.sidebar-nav-item {
  position: relative;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: all var(--transition-fast);
  width: 100%;
  box-sizing: border-box;
}

.sidebar-nav-link:hover {
  background-color: #f1f5f9;
  color: var(--text-main);
}

.sidebar-nav-link.active {
  background-color: #f8fafc;
  color: var(--text-main);
  font-weight: 600;
}

.sidebar-nav-link i,
.sidebar-nav-link svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
  color: #64748b;
  flex-shrink: 0;
}

.sidebar-nav-link.active i,
.sidebar-nav-link.active svg {
  color: var(--text-main);
}

.sidebar-nav-link .nav-arrow {
  margin-left: auto;
  font-size: 14px;
  color: #94a3b8;
}

/* Main Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg-main);
}

/* Header */
.top-header {
  height: 56px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: #334155;
  transition: background-color var(--transition-fast);
}

.header-toggle-btn:hover {
  background-color: #f1f5f9;
}

.header-toggle-btn svg {
  width: 18px;
  height: 18px;
}

.header-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Sininho de Notificação Semanal de Comissões */
.header-commission-bell-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm, 8px);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  cursor: pointer;
  transition: all var(--transition-fast, 0.2s);
}

.header-commission-bell-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.header-commission-bell-btn svg {
  width: 18px;
  height: 18px;
}

.header-commission-bell-btn.has-alert {
  background: #fffbeb;
  border-color: #fde68a;
  color: #d97706;
}

.header-commission-bell-btn.is-tuesday-urgent {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
  animation: bellNotificationPulse 2s infinite ease-in-out;
}

.header-commission-bell-btn .bell-alert-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

@keyframes bellNotificationPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.header-user:hover {
  background-color: #f1f5f9;
}

.header-user svg {
  width: 16px;
  height: 16px;
  color: #475569;
}

.header-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: #334155;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.header-logout:hover {
  background-color: #fef2f2;
  color: var(--primary-red);
}

.header-logout svg {
  width: 16px;
  height: 16px;
}

/* Page Content Container */
.page-content {
  padding: 24px 28px 40px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }

  .page-content {
    padding: 16px;
  }
  
  .top-header {
    padding: 0 16px;
  }
}
