/* TRAVA GLOBAL ANTI-SCROLL HORIZONTAL E BOX SIZING */
*, *::before, *::after { box-sizing: border-box; }

/* TEMA CLEAN E MINIMALISTA (Base e Variáveis) */
:root {
  --bg: #fbfbfd;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #86868b;
  --blue: #1d1d1f; /* Preto absoluto assume o papel principal */
  --purple: #5e5e5e; 
  --green: #008009;
  --gold: #b38200;
  --danger: #d93025;
  --shadow: 0 4px 24px rgba(0,0,0,0.04);
  --radius: 16px;
  --line-color: #e5e5ea;
}    

/* CONFIGURAÇÃO BASE DO CORPO DA PÁGINA */
body {
  background: var(--bg);
  font-family: 'Inter', sans-serif;
  color: var(--text);
  margin: 0;
  overflow-x: hidden;
}

/* LAYOUT PRINCIPAL (Com menu lateral 'invisível') */
.app-layout {
  display: flex;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* SIDEBAR E NAVEGAÇÃO */
.sidebar {
  width: 260px;
  background: transparent;
  padding: 30px 10px 30px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.logo-sidebar {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #1d1d1f, #5e5e5e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
  text-align: center;
}
.nav-item {
  padding: 8px 16px;
  border-radius: 30px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  white-space: nowrap;
}
.nav-item.active {
  background: var(--blue);
  color: white;
}
.nav-item:hover:not(.active) {
  background: #eef2f7;
  color: var(--blue);
}

/* NAVEGAÇÃO SUPERIOR NO PAINEL E OUTRAS TELAS */
.app-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 20px;
  gap: 10px;
}
.btn-nav {
  background: #fff;
  border: 1px solid #dfe6e9;
  padding: 8px 15px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s;
  color: var(--text);
}
.btn-nav:hover {
  background: #f8f9fa;
  border-color: #b2bec3;
}

/* ÁREA DE CONTEÚDO PRINCIPAL (Permite que encorpe e não estoure tela) */
.main-content {
  flex: 1;
  padding: 30px;
  max-width: 1100px;
  min-width: 0;
} 

/* MODALS E SOBREPOSIÇÕES GLOBAIS */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 7000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-box {
  background: var(--card); /* Era background: #fff; mas usar a variável é melhor */
  padding: 25px;
  border-radius: var(--radius);
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  max-height: 90vh; /* Permite uso em modais grandes */
  overflow-y: auto;
}
.modal-input {
  padding: 10px;
  border: 1px solid #dfe6e9;
  border-radius: 6px;
  font-family: inherit;
  width: 100%;
  font-size: 0.9rem;
  outline: none;
}
.modal-input:focus {
  border-color: var(--blue);
}

/* BOTÕES GLOBAIS DE AÇÃO */
.btn-primary {
  background: var(--blue);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: 0.2s;
  width: 100%;
  font-size: 0.95rem;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
}
.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: 0.2s;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 5px;
}
.btn-danger:hover {
  opacity: 0.9;
}
.btn-cancel-modal {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  display: block;
  width: auto;
  padding: 6px 15px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  transition: 0.2s;
}
.btn-cancel-modal:hover {
  color: var(--text);
  text-decoration: underline;
}

/* LOADERS E ONBOARDING */
#onboardingOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: 8000;
  align-items: center;
  justify-content: center;
}
#globalLoader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* RESPONSIVIDADE GENÉRICA (Da Layout base) */
@media (max-width: 850px) { 
  .app-layout {
    flex-direction: column;
  } 
  .sidebar {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    padding: 15px;
    flex-wrap: wrap;
  } 
  .logo-sidebar {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    margin-right: 20px;
  }
}

/* TOUR GUIADO (GLOBAL) */
.tour-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 8000; display: none; }
.tour-tooltip { position: absolute; background: white; padding: 20px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); z-index: 8001; min-width: 250px; max-width: 300px; display: none; margin: 15px; border-top: 4px solid var(--blue); opacity: 0; transition: opacity 0.3s;}
.tour-tooltip.active { opacity: 1; }
.tour-title { font-size: 0.85rem; font-weight: 800; color: var(--blue); text-transform: uppercase; margin-bottom: 8px; display: flex; justify-content: space-between;}
.tour-text { font-size: 0.9rem; color: #444; margin-bottom: 15px; line-height: 1.4; }
.tour-footer { display: flex; justify-content: space-between; align-items: center; }
.tour-counter { font-size: 0.75rem; font-weight: 700; color: #888; }
.btn-tour-next { background: var(--text); color: white; border: none; padding: 6px 15px; border-radius: 6px; font-weight: 800; cursor: pointer; font-size: 0.8rem; transition: 0.2s;}
.btn-tour-next:hover { opacity: 0.9; transform: scale(1.05); }
.btn-tour-skip { background: transparent; color: var(--muted); border: none; font-size: 0.75rem; font-weight: 700; cursor: pointer; text-decoration: underline;}

/* Destaque do elemento atual no Tour */
.tour-highlight { position: relative; z-index: 8002 !important; box-shadow: 0 0 0 4px #fff, 0 0 0 8px var(--blue) !important; background: white; border-radius: 8px; transition: 0.3s;}
.relative-high { position: relative !important; }

/* REPORTER DE BUGS */
.nav-item-bug { display: flex; align-items: center; padding: 12px 15px; margin-top: auto; color: var(--danger); text-decoration: none; font-weight: 700; border-radius: 8px; transition: 0.2s; border: 1px solid transparent; background: #fff0f0; }
.nav-item-bug:hover { background: var(--danger); color: white; }

.bug-textarea { width: 100%; border: 1px solid #dfe6e9; border-radius: 8px; padding: 12px; font-family: inherit; font-size: 0.95rem; resize: vertical; min-height: 100px; margin-bottom: 5px; outline: none;}
.bug-textarea:focus { border-color: var(--danger); }
