/**
 * Sistema Líder - CSS Principal
 * ETAPA 12 - UX/CSS/MOBILE
 * 
 * Identidade visual corporativa Benel
 * Design mobile-first e responsivo
 */

/* ============================================
   VARIÁVEIS CSS (Cores Oficiais Benel)
   ============================================ */
:root {
  /* Cores principais */
  --blue-benel: #0d0133;
  --gray-benel: #2d2d2d;
  --white: #ffffff;
  
  /* Cores auxiliares */
  --gray-light: #f5f5f5;
  --gray-border: #e0e0e0;
  --gray-text: #666;
  --gray-text-light: #999;
  
  /* Cores de estado */
  --success: #28a745;
  --error: #dc3545;
  --warning: #ffc107;
  --info: #1768b8;
  
  /* Espaçamento (compactado) */
  --spacing-xs: 2px;
  --spacing-sm: 6px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;
  
  /* Tipografia */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-size-base: 15px;
  --font-size-sm: 13px;
  --font-size-lg: 17px;
  --line-height: 1.4;
  
  /* Bordas */
  --border-radius: 8px;
  --border-radius-sm: 4px;
  --border-width: 1px;
  
  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
  
  /* Transições */
  --transition: 0.2s ease;
  
  /* Layout */
  --topbar-height: 56px;
  --sidebar-width: 240px;
  
  /* ============================================
     TOKENS DE DESIGN SYSTEM (REFINO AVANÇADO)
     ============================================ */
  
  /* Cards */
  --card-height: 180px;
  --card-padding: 16px;
  --card-border-radius: 8px;
  --card-gap: 16px;
  
  /* Tipografia padronizada */
  --font-title: 14px;      /* Título do card */
  --font-value: 22px;      /* Número/valor */
  --font-text: 12px;       /* Texto auxiliar */
  --font-status: 11px;     /* Status (uppercase) */
  
  /* Grid */
  --grid-columns-desktop: 4;
  --grid-gap: 16px;
  
  /* Trilha */
  --trail-max-height: 420px;
}

/* ============================================
   RESET BÁSICO
   ============================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--gray-benel);
  background-color: var(--white);
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--blue-benel);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: #0d0033;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ============================================
   TIPOGRAFIA
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--gray-benel);
  margin-bottom: var(--spacing-sm);
  margin-top: 0;
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1.15rem;
}

p {
  margin-bottom: var(--spacing-sm);
  line-height: var(--line-height);
}

/* ============================================
   TOPBAR FIXA COM NAVEGAÇÃO
   ============================================ */
.topbar {
  background-color: var(--white);
  border-bottom: var(--border-width) solid var(--gray-border);
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.topbar-content {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  overflow: hidden;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-shrink: 0;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  color: inherit;
}

.logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.system-name {
  font-weight: 600;
  color: var(--gray-benel);
  font-size: var(--font-size-base);
  white-space: nowrap;
}

/* Mobile: ajustar topbar para não quebrar linha */
@media (max-width: 767px) {
  .topbar-content {
    padding: 0 var(--spacing-xs);
    gap: var(--spacing-xs);
    overflow-x: hidden;
  }
  
  .topbar-left {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
  }
  
  .topbar-logo {
    flex-shrink: 1;
    min-width: 0;
  }
  
  .logo {
    height: 28px;
    flex-shrink: 0;
  }
  
  .system-name {
    font-size: var(--font-size-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
  }
  
  .topbar-right {
    flex-shrink: 0;
    gap: var(--spacing-xs);
  }
  
  .user-name {
    display: none;
  }
  
  .btn-logout {
    padding: var(--spacing-xs);
    font-size: var(--font-size-sm);
    white-space: nowrap;
  }
  
  /* Garantir que o avatar não quebre */
  .user-avatar,
  .user-avatar-default {
    flex-shrink: 0;
  }
  
  /* Avatar no topbar mobile */
  .topbar-right .user-avatar,
  .topbar-right .user-avatar-default {
    width: 28px !important;
    height: 28px !important;
  }
}

/* Avatar no topbar desktop */
.topbar-right .user-avatar,
.topbar-right .user-avatar-default {
  flex-shrink: 0;
  display: inline-block;
}

/* Menu de navegação */
.topbar-nav {
  display: none; /* Oculto em mobile, visível em desktop */
  align-items: center;
  gap: var(--spacing-xs);
  flex: 1;
  justify-content: center;
}

.nav-link {
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--gray-text);
  font-size: var(--font-size-sm);
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  background-color: var(--gray-light);
  color: var(--gray-benel);
}

.nav-link.active {
  background-color: var(--blue-benel);
  color: var(--white);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-shrink: 0;
}

.user-name {
  display: none; /* Oculto em mobile */
  color: var(--gray-benel);
  font-size: var(--font-size-sm);
}

.btn-logout {
  padding: var(--spacing-xs) var(--spacing-sm);
  color: var(--gray-benel);
  font-size: var(--font-size-sm);
  border: var(--border-width) solid var(--gray-border);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
  background: none;
  cursor: pointer;
}

.btn-logout:hover {
  background-color: var(--gray-light);
  border-color: var(--gray-benel);
  text-decoration: none;
}

/* Botão hambúrguer para mobile */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  gap: 4px;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--gray-benel);
  transition: var(--transition);
  border-radius: 1px;
}

.menu-toggle:hover span {
  background-color: var(--blue-benel);
}

/* ============================================
   SIDEBAR
   ============================================ */
.app-sidebar {
  background-color: var(--white);
  border-right: var(--border-width) solid var(--gray-border);
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  position: fixed;
  left: 0;
  top: var(--topbar-height);
  width: var(--sidebar-width);
  transform: translateX(-100%);
  transition: transform var(--transition);
  z-index: 999;
  box-shadow: var(--shadow-md);
  padding: var(--spacing-md);
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.app-sidebar.active {
  transform: translateX(0);
}

/* No mobile, sidebar do feed deve aparecer no drawer */
@media (max-width: 767px) {
  .feed-sidebar.app-sidebar {
    display: block; /* Permitir que apareça quando ativo */
  }
}

/* Overlay para mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity var(--transition);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.sidebar-content {
  padding: var(--spacing-sm);
}

/* ============================================
   CONTAINER E LAYOUT
   ============================================ */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-md);
}

.app-content {
  padding: var(--spacing-md);
  min-height: calc(100vh - var(--topbar-height));
  padding-top: calc(var(--topbar-height) + var(--spacing-md));
}

/* Mobile: Garantir que containers não limitem scroll */
@media (max-width: 767px) {
  .app-container {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
  
  .app-content {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
  }
  
  .app-layout {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
  }
}

/* Layout com sidebar (desktop) */
.app-layout {
  display: flex;
  min-height: calc(100vh - var(--topbar-height));
}

.app-layout .app-sidebar {
  position: relative;
  transform: none;
  height: auto;
  box-shadow: none;
}

.app-layout .app-content {
  flex: 1;
  margin-left: 0;
}

/* ============================================
   CARDS - COMPONENTE PADRONIZADO
   ============================================ */
/* Card genérico (sem altura fixa por padrão) */
.card {
  background-color: var(--white);
  border-radius: var(--card-border-radius);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  border: var(--border-width) solid var(--gray-border);
  transition: box-shadow var(--transition);
  margin-bottom: var(--spacing-md);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* Card header e body genéricos (para admin e outras páginas) */
.card-header {
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: var(--border-width) solid var(--gray-border);
}

.card-header h1,
.card-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gray-benel);
}

/* Card body genérico - estilos específicos aplicados via .dashboard-grid */

/* ============================================
   CARDS DO DASHBOARD (estilos específicos)
   ============================================ */
/* Cards do dashboard com altura fixa */
.dashboard-grid .card {
  display: flex;
  flex-direction: column;
  height: var(--card-height);
  padding: var(--card-padding);
}

/* Estrutura do card (apenas para dashboard) */
.dashboard-grid .card-header {
  flex-shrink: 0;
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-xs);
  border-bottom: 2px solid var(--blue-benel);
}

.dashboard-grid .card-header h2 {
  margin: 0;
  font-size: var(--font-title);
  font-weight: 700;
  color: var(--gray-benel);
  line-height: 1.2;
  text-transform: none;
}

.dashboard-grid .card-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.dashboard-grid .card-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: var(--spacing-sm);
  border-top: var(--border-width) solid var(--gray-border);
}

/* Variantes de card */
.card--primary {
  border-left: 4px solid var(--blue-benel);
}

.card--neutral {
  border-left: 4px solid var(--gray-border);
}

/* Cards sem altura fixa (para trilha e conteúdo expansível) */
.card--flexible {
  height: auto;
  min-height: var(--card-height);
}

.dashboard-grid .card--flexible {
  height: auto;
  min-height: var(--card-height);
}

/* Cards full-width */
.card--full {
  grid-column: 1 / -1;
}

/* ============================================
   BOTÕES
   ============================================ */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: var(--font-size-base);
  font-weight: 500;
  text-align: center;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition);
  cursor: pointer;
  border: var(--border-width) solid transparent;
  min-height: 44px; /* Touch-friendly */
  line-height: 1.2;
}

.btn-primary {
  background-color: var(--blue-benel);
  color: var(--white);
  border-color: var(--blue-benel);
}

.btn-primary:hover {
  background-color: #0d0033;
  border-color: #0d0033;
}

.btn-primary:disabled {
  background-color: var(--gray-text-light);
  border-color: var(--gray-text-light);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-secondary {
  background-color: var(--white);
  color: var(--gray-benel);
  border-color: var(--gray-border);
}

.btn-secondary:hover {
  background-color: var(--gray-light);
  border-color: var(--gray-benel);
}

.btn-danger {
  background-color: var(--error);
  color: var(--white);
  border-color: var(--error);
}

.btn-danger:hover {
  background-color: #c82333;
  border-color: #c82333;
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--font-size-sm);
  min-height: 36px;
}

.btn-block {
  width: 100%;
  display: block;
}

/* ============================================
   FORMULÁRIOS
   ============================================ */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  color: var(--gray-benel);
}

.form-control {
  width: 100%;
  padding: 12px;
  font-size: var(--font-size-base); /* Evita zoom no iOS */
  border: var(--border-width) solid var(--gray-border);
  border-radius: var(--border-radius-sm);
  background-color: var(--white);
  color: var(--gray-benel);
  transition: border-color var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--blue-benel);
  box-shadow: 0 0 0 3px rgba(18, 0, 76, 0.1);
}

.form-control:disabled {
  background-color: var(--gray-light);
  cursor: not-allowed;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

select.form-control {
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  margin-right: var(--spacing-sm);
  cursor: pointer;
}

/* ============================================
   MENSAGENS
   ============================================ */
.alert {
  padding: var(--spacing-md);
  border-radius: var(--border-radius-sm);
  margin-bottom: var(--spacing-md);
  border: var(--border-width) solid transparent;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
  border-color: #ffeaa7;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border-color: #bee5eb;
}

/* ============================================
   TABELAS
   ============================================ */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--white);
}

th, td {
  padding: var(--spacing-md);
  text-align: left;
  border-bottom: var(--border-width) solid var(--gray-border);
}

th {
  background-color: var(--gray-light);
  font-weight: 600;
  color: var(--gray-benel);
}

tr:hover {
  background-color: var(--gray-light);
}

/* ============================================
   AVATAR
   ============================================ */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-sm {
  width: 32px;
  height: 32px;
}

.avatar-md {
  width: 40px;
  height: 40px;
}

.avatar-lg {
  width: 80px;
  height: 80px;
}

.avatar-default {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--gray-light);
  color: var(--gray-benel);
  font-weight: 600;
  text-transform: uppercase;
}

/* ============================================
   PROGRESSO
   ============================================ */
/* Progress bar apenas para dashboard */
.dashboard-grid .progress-bar-container {
  width: 100%;
  height: 28px;
  background-color: var(--gray-light);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  margin-top: var(--spacing-sm);
}

.dashboard-grid .progress-bar {
  height: 100%;
  background-color: var(--blue-benel);
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: var(--font-size-sm);
  font-weight: 600;
  min-width: 40px; /* Garantir espaço mínimo para o texto */
}

/* ============================================
   UTILITÁRIOS
   ============================================ */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

/* ============================================
   MEDIA QUERIES (MOBILE-FIRST)
   ============================================ */

/* Tablet (768px+) */
@media (min-width: 768px) {
  .topbar-nav {
    display: flex;
  }
  
  .user-name {
    display: inline-block;
  }
  
  .menu-toggle {
    display: none;
  }
  
  .app-sidebar {
    top: var(--topbar-height);
    height: calc(100vh - var(--topbar-height));
  }
  
  .app-content {
    min-height: calc(100vh - var(--topbar-height));
    padding-top: var(--topbar-height);
  }
  
  .app-layout {
    min-height: calc(100vh - var(--topbar-height));
  }
  
  .app-container {
    padding: var(--spacing-lg);
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .topbar-content {
    max-width: 1400px;
  }
  
  .app-sidebar {
    position: relative;
    transform: none;
    box-shadow: none;
    top: 0;
    height: calc(100vh - var(--topbar-height));
  }
  
  .sidebar-overlay {
    display: none !important;
  }
  
  .app-layout .app-content {
    margin-left: 0;
  }
  
  .app-container {
    max-width: 1400px;
  }
  
  .logo {
    height: 36px;
  }
  
  .system-name {
    font-size: var(--font-size-lg);
  }
}

/* ============================================
   FEED - ESTILO INSTAGRAM
   ============================================ */
.feed-content {
  flex: 1;
  background-color: var(--white);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  min-height: calc(100vh - var(--topbar-height) - var(--spacing-md) * 2);
  max-height: calc(100vh - var(--topbar-height) - var(--spacing-md) * 2);
  overflow-y: auto;
}

/* Mobile: Permitir scroll natural da página */
@media (max-width: 768px) {
  /* Garantir que body e html permitam scroll */
  html, body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    max-height: none !important;
    position: relative !important;
  }
  
  /* Remover qualquer limitação de altura em containers */
  .app-container,
  .app-content,
  .feed-container,
  .feed-content,
  main {
    overflow: visible !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    position: relative !important;
  }
  
  /* Garantir que o main não limite scroll */
  main.app-content,
  main.feed-content {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    padding-bottom: calc(var(--spacing-xl) * 3) !important; /* Espaço extra para o footer */
    margin-bottom: calc(var(--spacing-xl) * 2) !important; /* Margem extra no final */
  }
}

.feed-content h2 {
  margin-bottom: var(--spacing-md);
  color: var(--gray-benel);
  border-bottom: 2px solid var(--blue-benel);
  padding-bottom: var(--spacing-xs);
  font-size: 1.25rem;
}

.content-block {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--gray-border);
}

.content-block:last-child {
  border-bottom: none;
}

.content-block h3 {
  margin-bottom: var(--spacing-sm);
  color: var(--gray-benel);
  font-size: 1.1rem;
}

.content-block p {
  line-height: var(--line-height);
  color: var(--gray-text);
  white-space: pre-wrap;
  margin-bottom: var(--spacing-sm);
}

/* Imagens estilo Instagram */
.content-block img {
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
  object-fit: cover;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  margin: var(--spacing-sm) auto;
  display: block;
}

/* Carrossel */
.carousel-container {
  position: relative;
  max-width: 100%;
  margin: var(--spacing-sm) auto;
  width: 100%;
  box-sizing: border-box;
}

.carousel-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  height: 420px; /* Altura fixa no desktop */
  width: 100%;
  background-color: var(--gray-light); /* Fundo neutro para absorver diferenças de proporção */
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  /* Garantir que o layout nunca seja quebrado */
  min-height: 420px;
  max-height: 420px;
}

/* Mobile: altura flexível para se ajustar ao conteúdo */
@media (max-width: 767px) {
  .carousel-wrapper {
    height: auto !important;
    min-height: 200px;
    max-height: 350px;
  }
}

.carousel-images {
  display: flex;
  transition: transform 0.3s ease;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.carousel-images:active {
  cursor: grabbing;
}

.carousel-images img {
  min-width: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain !important; /* Imagens aparecem inteiras, sem corte - sobrescrever estilos gerais */
  display: block;
  flex-shrink: 0;
  box-sizing: border-box;
  /* Garantir que imagens grandes não quebrem o layout */
  max-width: 100%;
  max-height: 100%;
  /* Prevenir drag padrão de imagens */
  user-select: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -ms-user-drag: none;
  pointer-events: auto; /* Permitir interação, mas não drag */
  /* Remover estilos que podem ser aplicados por .content-block img */
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.carousel-nav {
  display: flex;
  justify-content: center;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--gray-border);
  border: none;
  cursor: pointer;
  transition: background-color var(--transition);
  padding: 0;
}

.carousel-dot.active {
  background-color: var(--blue-benel);
}

.carousel-arrows {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: var(--white);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition);
  z-index: 10;
}

.carousel-arrows:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.carousel-arrow-prev {
  left: var(--spacing-sm);
}

.carousel-arrow-next {
  right: var(--spacing-sm);
}

/* Vídeo */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: var(--border-radius);
  margin: var(--spacing-sm) 0;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Botões de ação compactos */
.like-button {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  background-color: var(--gray-light);
  color: var(--gray-benel);
  border: 1px solid var(--gray-border);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.like-button:hover {
  background-color: var(--gray-border);
}

.like-button.liked {
  background-color: var(--blue-benel);
  color: var(--white);
  border-color: var(--blue-benel);
}

/* Comentários compactos */
.comments-section {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--gray-border);
}

.comments-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--gray-text);
  margin-bottom: var(--spacing-sm);
}

.comment-item {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--gray-light);
}

.comment-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.comment-content {
  flex: 1;
}

.comment-author {
  font-weight: 600;
  color: var(--gray-benel);
  margin-bottom: var(--spacing-xs);
  font-size: var(--font-size-sm);
}

.comment-text {
  color: var(--gray-text);
  line-height: var(--line-height);
  margin-bottom: var(--spacing-xs);
  word-wrap: break-word;
  font-size: var(--font-size-sm);
}

.comment-date {
  font-size: var(--font-size-sm);
  color: var(--gray-text-light);
}

.comment-form {
  margin-top: var(--spacing-sm);
}

.comment-form textarea {
  width: 100%;
  min-height: 60px;
  padding: var(--spacing-sm);
  border: 1px solid var(--gray-border);
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: var(--font-size-sm);
  resize: vertical;
  box-sizing: border-box;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--blue-benel);
}

.comment-form button {
  margin-top: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-md);
  background-color: var(--blue-benel);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition);
}

.comment-form button:hover {
  background-color: #0d0033;
}

.comment-form button:disabled {
  background-color: var(--gray-border);
  cursor: not-allowed;
}

.complete-button,
.complete-macro-button {
  margin-top: var(--spacing-lg);
  text-align: center;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--gray-border);
}

.complete-button button,
.complete-macro-button button {
  padding: var(--spacing-sm) var(--spacing-lg);
  background-color: var(--success);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition);
}

.complete-button button:hover,
.complete-macro-button button:hover {
  background-color: #218838;
}

.complete-macro-button button {
  background-color: var(--warning);
  color: var(--gray-benel);
}

.complete-macro-button button:hover {
  background-color: #e0a800;
}

/* Cards de tópicos */
.topics-grid {
  padding: var(--spacing-md);
}

.topics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.topic-card {
  display: flex;
  flex-direction: column;
  background-color: var(--white);
  border: 2px solid var(--gray-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  min-height: 160px;
}

.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue-benel);
}

.topic-card--completed {
  border-color: var(--success);
  background-color: #f0f9f4;
}

.topic-card--available {
  border-color: var(--info);
  background-color: #f0f8ff;
}

.topic-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
}

.topic-card-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: var(--blue-benel);
  color: var(--white);
  border-radius: 50%;
  font-weight: bold;
  font-size: var(--font-size-sm);
}

.topic-card--completed .topic-card-number {
  background-color: var(--success);
}

.topic-card-badge {
  font-size: var(--font-size-xs);
  color: var(--success);
  font-weight: 600;
}

.topic-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-benel);
  margin: var(--spacing-sm) 0;
  flex: 1;
  line-height: 1.4;
}

.topic-card-footer {
  margin-top: auto;
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--gray-border);
}

.topic-card-action {
  font-size: var(--font-size-sm);
  color: var(--blue-benel);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.topic-card:hover .topic-card-action {
  color: var(--blue-benel);
}

@media (max-width: 767px) {
  .topics-cards {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
  
  .topic-card {
    min-height: 140px;
    padding: var(--spacing-sm);
  }
}

.no-content,
.no-macro {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--gray-text);
}

/* Sidebar do Feed */
.feed-sidebar {
  width: var(--sidebar-width);
  background-color: var(--white);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  height: calc(100vh - var(--topbar-height) - var(--spacing-md) * 2);
  max-height: calc(100vh - var(--topbar-height) - var(--spacing-md) * 2);
  position: sticky;
  top: calc(var(--topbar-height) + var(--spacing-md));
  overflow-y: auto;
  overflow-x: hidden;
}

.feed-sidebar h2 {
  font-size: 1.1rem;
  margin-bottom: var(--spacing-sm);
  color: var(--gray-benel);
  border-bottom: 2px solid var(--blue-benel);
  padding-bottom: var(--spacing-xs);
}

.progress-indicator {
  background-color: var(--gray-light);
  padding: var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  margin: var(--spacing-sm) 0;
  font-size: var(--font-size-sm);
  color: var(--gray-benel);
  text-align: center;
}

.macro-title-section {
  margin-bottom: var(--spacing-md);
}

.macro-item {
  margin-bottom: var(--spacing-xs);
}

.macro-header {
  display: flex;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius-sm);
  transition: background-color var(--transition);
  word-break: break-word;
  overflow-wrap: break-word;
}

.macro-header.macro-locked {
  background-color: var(--gray-light);
  color: var(--gray-text);
  opacity: 0.6;
  cursor: not-allowed;
}

.macro-header.macro-active {
  background-color: var(--blue-benel);
  color: var(--white);
}

.macro-header:not(.macro-locked):not(.macro-active):hover {
  background-color: var(--gray-light);
}

.macro-header a {
  display: flex;
  align-items: center;
  flex: 1;
  color: inherit;
  text-decoration: none;
  word-break: break-word;
}

.macro-status-icon {
  margin-right: var(--spacing-xs);
  font-size: 0.9em;
  flex-shrink: 0;
}

.topics-sublist {
  list-style: none;
  margin-left: var(--spacing-md);
  margin-top: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
  padding-left: var(--spacing-sm);
  border-left: 2px solid var(--gray-border);
}

.topics-sublist li {
  margin-bottom: var(--spacing-xs);
}

.topics-sublist a {
  display: block;
  padding: var(--spacing-xs) var(--spacing-sm);
  color: var(--gray-text);
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  transition: background-color var(--transition);
  font-size: var(--font-size-sm);
  word-break: break-word;
}

.topics-sublist a:hover {
  background-color: var(--gray-light);
}

.topics-sublist a.active {
  background-color: var(--blue-benel);
  color: var(--white);
}

/* Layout do Feed */
.feed-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-md);
  display: flex;
  gap: var(--spacing-md);
  padding-top: calc(var(--topbar-height) + var(--spacing-md));
}

/* Mobile: Feed em coluna única, sidebar no drawer */
@media (max-width: 767px) {
  /* Garantir scroll natural da página no mobile */
  html, body {
    overflow-x: hidden;
    overflow-y: auto !important;
    height: auto !important;
    max-height: none !important;
    position: relative;
  }
  
  .feed-container {
    flex-direction: column;
    padding: var(--spacing-sm);
    padding-top: calc(var(--topbar-height) + var(--spacing-sm));
    padding-bottom: calc(var(--spacing-xl) * 2) !important; /* Espaço extra para o footer */
    gap: 0;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    margin-bottom: var(--spacing-xl) !important; /* Margem extra no final */
  }
  
  /* Sidebar sempre oculta no mobile - aparece apenas no drawer quando ativo */
  .feed-sidebar.app-sidebar:not(.active) {
    display: none !important;
  }
  
  /* Quando sidebar está ativa (drawer aberto), mostrar */
  .feed-sidebar.app-sidebar.active {
    display: block !important;
    position: fixed;
    left: 0;
    top: var(--topbar-height);
    width: 280px;
    max-width: 85vw;
    height: calc(100vh - var(--topbar-height));
    max-height: calc(100vh - var(--topbar-height));
    z-index: 999;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-md);
    transform: translateX(0);
  }
  
  /* Trilha no drawer mobile com scroll interno */
  .feed-sidebar .trail-container {
    max-height: calc(100vh - var(--topbar-height) - 120px);
  }
  
  .feed-content {
    width: 100%;
    padding: var(--spacing-sm);
    padding-bottom: calc(var(--spacing-xl) * 3) !important; /* Espaço extra para o footer */
    border-radius: var(--border-radius-sm);
    overflow-y: visible !important;
    overflow-x: hidden;
    max-height: none !important;
    min-height: auto !important;
    height: auto !important;
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-xl) !important; /* Margem extra no final */
    position: relative;
  }
  
  .feed-content h2 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-xs);
  }
  
  .content-block {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
  }
  
  .content-block:last-child {
    margin-bottom: 0;
  }
  
  .content-block h3 {
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
    line-height: 1.3;
  }
  
  .content-block p {
    font-size: var(--font-size-sm);
    line-height: 1.5;
    margin-bottom: var(--spacing-xs);
  }
  
  /* Imagens menores no mobile */
  .content-block img {
    max-height: 280px;
    width: 100%;
    margin: var(--spacing-xs) 0;
    border-radius: var(--border-radius-sm);
  }
  
  /* Carrossel menor no mobile */
  .carousel-container {
    margin: var(--spacing-xs) 0;
  }
  
  .carousel-wrapper {
    height: auto !important; /* Altura automática no mobile */
    min-height: 200px; /* Altura mínima para manter usabilidade */
    max-height: 350px; /* Altura máxima para não ocupar muito espaço */
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .carousel-images {
    height: auto !important; /* Altura automática para se ajustar à imagem */
    min-height: 200px;
    max-height: 350px;
  }
  
  .carousel-images img {
    height: auto !important; /* Altura automática para se ajustar ao conteúdo */
    max-height: 350px; /* Limitar altura máxima */
    width: 100%;
    object-fit: contain; /* Manter contain no mobile também */
    display: block;
  }
  
  /* PDF iframe no mobile */
  .file-download-container iframe {
    height: 350px !important; /* Altura menor no mobile */
  }
  
  /* Container de arquivo mais compacto no mobile */
  .file-download-container {
    padding: var(--spacing-xs) !important;
  }
  
  .file-download-container h4 {
    font-size: 0.9rem !important;
  }
  
  /* Navegação entre tópicos */
  .topic-navigation {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid #e0e0e0;
  }
  
  .btn-topic-nav {
    white-space: nowrap;
    font-weight: 500;
  }
  
  .btn-topic-nav:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .btn-topic-prev:hover {
    background-color: #e9ecef !important;
  }
  
  .btn-topic-next:hover {
    background-color: #0f0038 !important;
    opacity: 0.9;
  }
  
  @media (max-width: 768px) {
    .topic-navigation {
      flex-direction: column;
      gap: var(--spacing-xs) !important;
    }
    
    .btn-topic-nav {
      width: 100%;
      justify-content: center !important;
    }
    
    .btn-topic-next {
      margin-left: 0 !important;
    }
  }
  
  .carousel-arrows {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  
  .carousel-dot {
    width: 6px;
    height: 6px;
  }
  
  /* Botões touch-friendly */
  .like-button {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-sm);
    min-height: 44px;
    width: auto;
    display: inline-flex;
  }
  
  /* Comentários mais compactos */
  .comments-section {
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
  }
  
  .comment-item {
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
    padding-bottom: var(--spacing-xs);
  }
  
  .comment-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.9em;
  }
  
  .comment-author {
    font-size: var(--font-size-sm);
  }
  
  .comment-text {
    font-size: var(--font-size-sm);
  }
  
  .comment-date {
    font-size: 0.8em;
  }
  
  .comment-form textarea {
    min-height: 70px;
    font-size: var(--font-size-sm);
    padding: var(--spacing-xs);
  }
  
  .comment-form button {
    width: 100%;
    padding: var(--spacing-sm);
    min-height: 44px;
    font-size: var(--font-size-sm);
  }
  
  /* Botões de ação full-width no mobile */
  .complete-button,
  .complete-macro-button {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
  }
  
  .complete-button button,
  .complete-macro-button button {
    width: 100%;
    padding: var(--spacing-md);
    min-height: 44px;
    font-size: var(--font-size-base);
  }
  
  /* Vídeo responsivo */
  .video-container {
    margin: var(--spacing-xs) 0;
  }
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-md);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns-desktop), 1fr);
  gap: var(--grid-gap);
  margin-bottom: var(--spacing-lg);
  align-items: start;
}

/* Mobile: grid vira 1 coluna */
@media (max-width: 767px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    position: relative;
    z-index: 1;
  }
  
  .card {
    height: auto;
    min-height: 140px;
    padding: var(--spacing-sm);
    position: relative;
    z-index: 2;
  }
  
  /* Garantir que o card de quizzes não fique atrás da trilha */
  .dashboard-grid .card--full {
    position: relative;
    z-index: 3;
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-md);
  }
  
  .dashboard-grid .card-header h2 {
    font-size: var(--font-title);
  }
  
  .dashboard-grid .progress-stats {
    font-size: 20px;
  }
  
  .dashboard-grid .engagement-stat-number {
    font-size: 20px;
  }
  
  .trail-container {
    max-height: 300px;
  }
  
  .dashboard-container {
    padding: var(--spacing-sm);
    padding-top: calc(var(--topbar-height) + var(--spacing-sm));
    position: relative;
    display: flex;
    flex-direction: column;
  }
  
  /* No mobile, usar order para controlar a ordem dos elementos */
  .dashboard-grid {
    order: 1;
  }
  
  /* Trilha vem depois do grid */
  .card--flexible {
    position: relative;
    z-index: 1;
    margin-top: var(--spacing-md);
    order: 2;
    clear: both;
  }
  
  /* Status dos Quizzes vem por último, depois da trilha */
  .card--full:not(.card--flexible) {
    position: relative;
    z-index: 1;
    margin-top: var(--spacing-md);
    order: 3;
    clear: both;
  }
}

/* Tablet: 2 colunas */
@media (min-width: 768px) and (max-width: 1023px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.user-profile-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.user-avatar-large {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-info h1 {
  margin-bottom: var(--spacing-xs);
  font-size: 1.5rem;
}

.user-job-title {
  color: var(--gray-text);
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-xs);
}

.user-email {
  color: var(--gray-text-light);
  font-size: var(--font-size-sm);
}

/* Cards de progresso - sem gradientes */
.progress-card {
  background-color: var(--white);
  border-left: 4px solid var(--blue-benel);
}

.progress-card h2 {
  color: var(--gray-benel);
  border-bottom-color: var(--blue-benel);
}

/* Progress stats apenas para dashboard */
.dashboard-grid .progress-stats {
  font-size: var(--font-value);
  font-weight: 700;
  margin: var(--spacing-sm) 0;
  color: var(--gray-benel);
  line-height: 1.2;
}

.dashboard-grid .progress-text {
  font-size: var(--font-text);
  margin: var(--spacing-xs) 0;
  color: var(--gray-text);
  line-height: 1.4;
}

/* Card do macrotópico atual - apenas para dashboard */
.dashboard-grid .current-macro-card {
  background-color: var(--white);
  border-left: 4px solid var(--blue-benel);
  height: auto; /* Altura automática para acomodar todo o conteúdo */
  min-height: var(--card-height); /* Mínimo igual aos outros cards */
  max-height: none; /* Sem limite máximo */
}

.dashboard-grid .current-macro-card .card-body {
  overflow-y: visible; /* Remover scroll interno */
}

.dashboard-grid .current-macro-card h2 {
  color: var(--gray-benel);
  border-bottom-color: var(--blue-benel);
}

.dashboard-grid .current-macro-title {
  font-size: var(--font-title);
  font-weight: 700;
  margin: var(--spacing-sm) 0;
  color: var(--gray-benel);
  line-height: 1.3;
}

.dashboard-grid .current-macro-order {
  font-size: var(--font-text);
  margin: var(--spacing-xs) 0;
  color: var(--gray-text);
  line-height: 1.4;
}

.btn-continue {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  background-color: var(--blue-benel);
  color: var(--white);
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  margin-top: var(--spacing-sm);
  transition: background-color var(--transition);
}

.btn-continue:hover {
  background-color: #0d0033;
  text-decoration: none;
}

/* Container da trilha com scroll interno - apenas para dashboard */
.dashboard-grid .trail-container {
  max-height: var(--trail-max-height);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: var(--spacing-xs);
  margin-top: var(--spacing-sm);
}

/* Scrollbar discreta - apenas para dashboard */
.dashboard-grid .trail-container::-webkit-scrollbar {
  width: 6px;
}

.dashboard-grid .trail-container::-webkit-scrollbar-track {
  background: var(--gray-light);
  border-radius: 3px;
}

.dashboard-grid .trail-container::-webkit-scrollbar-thumb {
  background: var(--gray-border);
  border-radius: 3px;
}

.dashboard-grid .trail-container::-webkit-scrollbar-thumb:hover {
  background: var(--gray-text);
}

/* Lista de trilha compacta */
.trail-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.trail-item {
  margin-bottom: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  transition: background-color var(--transition);
}

.trail-item a {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--gray-benel);
  text-decoration: none;
  font-size: var(--font-size-sm);
}

.trail-item.completed {
  background-color: var(--gray-light);
}

.trail-item.completed a {
  color: var(--success);
}

.trail-item.in-progress {
  background-color: var(--gray-light);
}

.trail-item.in-progress a {
  color: var(--blue-benel);
}

.trail-item.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.trail-item.locked a {
  color: var(--gray-text);
  pointer-events: none;
}

.trail-status {
  font-size: var(--font-status);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.trail-order {
  font-weight: 700;
  font-size: var(--font-text);
  flex-shrink: 0;
}

.trail-status-text {
  color: var(--gray-text);
  font-size: var(--font-text);
  margin-left: auto;
}

/* Engagement Stats - apenas para dashboard */
.dashboard-grid .engagement-stats {
  display: flex;
  gap: var(--spacing-lg);
  margin: var(--spacing-sm) 0;
  align-items: center;
  justify-content: center;
}

.dashboard-grid .engagement-stat {
  text-align: center;
  flex: 1;
}

.dashboard-grid .engagement-stat-number {
  font-size: var(--font-value);
  font-weight: 700;
  color: var(--gray-benel);
  line-height: 1.2;
  margin-bottom: var(--spacing-xs);
}

.dashboard-grid .engagement-stat-label {
  font-size: var(--font-text);
  color: var(--gray-text);
  line-height: 1.4;
}

/* Last Activity - apenas para dashboard */
.dashboard-grid .last-activity {
  margin-top: var(--spacing-sm);
}

.dashboard-grid .last-activity-type {
  font-size: var(--font-title);
  font-weight: 600;
  color: var(--gray-benel);
  margin-bottom: var(--spacing-xs);
  line-height: 1.3;
}

.dashboard-grid .last-activity-date {
  font-size: var(--font-text);
  color: var(--gray-text);
  line-height: 1.4;
}

/* ============================================
   FOOTER
   ============================================ */
.app-footer {
  background-color: var(--white);
  border-top: var(--border-width) solid var(--gray-border);
  padding: var(--spacing-md) 0;
  margin-top: var(--spacing-xl);
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.footer-content p {
  margin: 0;
  color: var(--gray-text-light);
  font-size: var(--font-size-sm);
}

/* ============================================
   ESTADOS ESPECIAIS
   ============================================ */

/* Macrotópico ativo na sidebar */
.macro-active {
  background-color: var(--blue-benel);
  color: var(--white);
}

.macro-active a {
  color: var(--white);
}

/* Macrotópico bloqueado */
.macro-locked {
  opacity: 0.6;
}

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--gray-border);
  border-top-color: var(--blue-benel);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   ADMIN PANEL - ESTILOS PROFISSIONAIS
   ============================================ */

/* Container principal do admin */
.admin-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-lg);
  padding-top: calc(var(--topbar-height) + var(--spacing-lg));
}

/* Badge de área restrita */
.admin-badge {
  background-color: #fff3cd;
  color: #856404;
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-lg);
  border: 1px solid #ffc107;
}

.admin-badge strong {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-size: var(--font-size-base);
}

.admin-badge p {
  margin: 0;
  font-size: var(--font-size-sm);
}

/* Grid de menu admin */
.admin-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

@media (max-width: 767px) {
  .admin-menu-grid {
    grid-template-columns: 1fr;
  }
}

/* Cards do menu admin */
.admin-card {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  background-color: var(--white);
  border: var(--border-width) solid var(--gray-border);
  border-left: 4px solid var(--warning);
  border-radius: var(--border-radius);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.admin-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--blue-benel);
  text-decoration: none;
  color: inherit;
}

.admin-card-icon {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
}

.admin-card-content {
  flex: 1;
}

.admin-card-content strong {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-size: var(--font-size-base);
  color: var(--gray-benel);
  font-weight: 600;
}

.admin-card-content small {
  display: block;
  color: var(--gray-text);
  font-size: var(--font-size-sm);
  line-height: 1.4;
}

/* Seções de formulário admin */
.form-section {
  background-color: var(--gray-light);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-lg);
}

.form-section h2 {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  color: var(--gray-benel);
  font-size: 1.25rem;
  border-bottom: 2px solid var(--blue-benel);
  padding-bottom: var(--spacing-xs);
}

/* Mensagens admin */
.message {
  padding: var(--spacing-md);
  border-radius: var(--border-radius-sm);
  margin-bottom: var(--spacing-md);
  border: var(--border-width) solid transparent;
}

.message.success {
  background-color: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.message.error {
  background-color: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.message.warning {
  background-color: #fff3cd;
  color: #856404;
  border-color: #ffc107;
}

.message.info {
  background-color: #d1ecf1;
  color: #0c5460;
  border-color: #bee5eb;
}

/* Tabelas admin melhoradas */
.admin-container table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--white);
  margin-top: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.admin-container th,
.admin-container td {
  padding: var(--spacing-md);
  text-align: left;
  border-bottom: var(--border-width) solid var(--gray-border);
}

.admin-container th {
  background-color: var(--gray-light);
  font-weight: 600;
  color: var(--gray-benel);
  text-transform: uppercase;
  font-size: var(--font-size-sm);
  letter-spacing: 0.5px;
}

.admin-container tbody tr {
  transition: background-color var(--transition);
}

.admin-container tbody tr:hover {
  background-color: var(--gray-light);
}

.admin-container tbody tr:nth-child(even) {
  background-color: #fafafa;
}

.admin-container tbody tr:nth-child(even):hover {
  background-color: var(--gray-light);
}

/* Badges admin */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-active {
  background-color: #d4edda;
  color: #155724;
}

.badge-inactive {
  background-color: #f8d7da;
  color: #721c24;
}

/* Ações em tabelas */
.admin-container .actions {
  white-space: nowrap;
}

.admin-container .actions a {
  color: var(--blue-benel);
  text-decoration: none;
  margin-right: var(--spacing-md);
  font-size: var(--font-size-sm);
  transition: color var(--transition);
}

.admin-container .actions a:hover {
  color: #0d0033;
  text-decoration: underline;
}

.admin-container .actions a.delete {
  color: var(--error);
}

.admin-container .actions a.delete:hover {
  color: #c82333;
}

/* Navegação por abas */
.nav-tabs {
  display: flex;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-lg);
  border-bottom: 2px solid var(--gray-border);
}

.nav-tab {
  padding: var(--spacing-sm) var(--spacing-lg);
  background-color: transparent;
  color: var(--gray-text);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  font-weight: 500;
}

.nav-tab:hover {
  color: var(--blue-benel);
  background-color: var(--gray-light);
}

.nav-tab.active {
  color: var(--blue-benel);
  border-bottom-color: var(--blue-benel);
  font-weight: 600;
}

/* Info box */
.info-box {
  background-color: #fff3cd;
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-md);
  border: 1px solid #ffc107;
}

.info-box strong {
  display: block;
  margin-bottom: var(--spacing-xs);
}

/* Macro selector */
.macro-selector {
  background-color: #e7f3ff;
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-lg);
}

.macro-selector label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
  color: var(--gray-benel);
}

.macro-selector select {
  width: 100%;
  max-width: 500px;
  padding: var(--spacing-sm);
  border: var(--border-width) solid var(--gray-border);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-base);
}

/* Checkbox group */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.checkbox-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
}

.checkbox-group label {
  margin: 0;
  font-weight: normal;
  cursor: pointer;
}

/* Botões admin */
.admin-container button[type="submit"],
.admin-container .btn {
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: var(--font-size-base);
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  border: var(--border-width) solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 44px;
}

.admin-container button[type="submit"] {
  background-color: var(--success);
  color: var(--white);
  border-color: var(--success);
}

.admin-container button[type="submit"]:hover {
  background-color: #218838;
  border-color: #218838;
}

.admin-container button[type="submit"]:disabled {
  background-color: var(--gray-text-light);
  border-color: var(--gray-text-light);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Responsividade admin */
@media (max-width: 767px) {
  .admin-container {
    padding: var(--spacing-sm);
    padding-top: calc(var(--topbar-height) + var(--spacing-sm));
  }
  
  .form-section {
    padding: var(--spacing-md);
  }
  
  .admin-container table {
    font-size: var(--font-size-sm);
  }
  
  .admin-container th,
  .admin-container td {
    padding: var(--spacing-sm);
  }
  
  .nav-tabs {
    flex-wrap: wrap;
  }
  
  .nav-tab {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-sm);
  }
}
