/* =====================================================================
   ZenCode — Folha de estilos global
   Tema escuro com acento "esmeralda" (zen).
   O acento fica centralizado em :root — mude --accent e o app inteiro
   muda de cor.
   ===================================================================== */

/* 1. Fontes ---------------------------------------------------------- */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");

/* 2. Tokens ---------------------------------------------------------- */
:root {
  --bg: #0d0d10;
  --accent: #10b981; /* esmeralda */
  --accent-2: #2dd4bf; /* teal */
  --accent-ring: rgba(16, 185, 129, 0.5);
  --accent-glow: rgba(16, 185, 129, 0.12);
}

/* 3. Base ------------------------------------------------------------ */
body {
  font-family: "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
}

textarea {
  resize: none;
}

::selection {
  background: rgba(16, 185, 129, 0.25);
}

/* O foco visual fica por conta do tema, não do contorno padrão */
input:focus,
textarea:focus,
select:focus {
  outline: none;
}

/* 4. Scrollbar minimalista ------------------------------------------- */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 10px;
}
*:hover::-webkit-scrollbar-thumb {
  background: #3f3f46;
}

/* 5. Tela de login --------------------------------------------------- */

/* Fundo único cobrindo a tela inteira (com cor de fallback) */
#auth-screen {
  background-color: var(--bg);
  background-image: url("./assets/zencode-fundo.svg");
  background-size: cover;
  background-position: center;
}

/* Camada de escurecimento + brilho da marca, por cima da imagem */
#auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
      160deg,
      rgba(9, 9, 11, 0.45) 0%,
      rgba(9, 9, 11, 0.3) 40%,
      rgba(9, 9, 11, 0.8) 100%
    ),
    radial-gradient(at 18% 80%, rgba(16, 185, 129, 0.18) 0px, transparent 55%),
    radial-gradient(at 85% 12%, rgba(45, 212, 191, 0.12) 0px, transparent 50%);
}

/* Card de vidro fosco (aparece no celular, sobre a imagem) */
.auth-card {
  background: rgba(24, 24, 27, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* Campos com anel de foco esmeralda */
.auth-input {
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.auth-input:focus {
  border-color: var(--accent-ring);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* 6. Animações ------------------------------------------------------- */

/* Cursor piscando do wordmark */
.blink {
  animation: blink 1.1s step-end infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Entrada suave do formulário */
.auth-enter {
  animation: authIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes authIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-enter,
  .blink,
  .toast,
  .overlay-base,
  .overlay-panel {
    animation: none;
    transition: none;
  }
}

/* 7. Editor de código com destaque de sintaxe ----------------------- */
/* Técnica de camadas: um <pre> colorido atrás de um <textarea>
   transparente. O texto que você vê vem da camada de baixo (highlight);
   o cursor e a digitação vêm do textarea por cima. As duas camadas
   precisam ter exatamente a mesma tipografia/espaçamento. */
.code-wrap {
  position: relative;
  height: 16rem;
  border-radius: 1rem;
  border: 1px solid rgba(63, 63, 70, 0.5);
  background: #18181b;
  overflow: hidden;
}
.code-layer {
  margin: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 1.25rem 1.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  border: 0;
}
.code-input {
  z-index: 1;
  color: transparent;
  background: transparent;
  caret-color: #34d399;
  resize: none;
  outline: none;
}
.code-input::placeholder {
  color: #52525b;
}
#code-highlight {
  z-index: 0;
  pointer-events: none;
}
#code-highlight code.hljs {
  background: transparent;
  padding: 0;
  font: inherit;
  white-space: inherit;
  word-break: inherit;
}

/* 8. Toasts (notificações) ------------------------------------------ */
#toast-host {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 340px;
  padding: 0.7rem 1rem;
  border-radius: 0.8rem;
  font-size: 0.85rem;
  color: #e4e4e7;
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid #71717a;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  transform: translateX(130%);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s;
}
.toast.toast-show {
  transform: none;
  opacity: 1;
}
.toast i {
  font-size: 1.15rem;
  flex-shrink: 0;
}
.toast-success {
  border-left-color: #10b981;
}
.toast-success i {
  color: #34d399;
}
.toast-error {
  border-left-color: #ef4444;
}
.toast-error i {
  color: #f87171;
}
.toast-warn {
  border-left-color: #f59e0b;
}
.toast-warn i {
  color: #fbbf24;
}
.toast-info i {
  color: #a1a1aa;
}

/* 9. Overlays (modal de confirmação + command palette) -------------- */
.overlay-base {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.overlay-base.modal-show {
  opacity: 1;
}
.overlay-top {
  align-items: flex-start;
  padding-top: 12vh;
}
.overlay-panel {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  transform: translateY(10px) scale(0.985);
  transition: transform 0.18s ease;
}
.dark .overlay-panel {
  background: #18181b;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.modal-show .overlay-panel {
  transform: none;
}

/* Itens do command palette */
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.6rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #3f3f46;
}
.dark .cmdk-item {
  color: #d4d4d8;
}
.cmdk-item.cmdk-active {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}
.dark .cmdk-item.cmdk-active {
  color: #6ee7b7;
}
.cmdk-item i {
  font-size: 1.05rem;
  opacity: 0.8;
}

/* 10. Dropdown de linguagem (custom) --------------------------------- */
.lang-dd {
  position: relative;
  display: inline-block;
}
.lang-hidden {
  display: none;
}
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 9rem;
  z-index: 30;
  padding: 0.35rem;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}
.dark .lang-menu {
  background: #18181b;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.lang-option {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  color: #3f3f46;
  transition: background 0.15s, color 0.15s;
}
.dark .lang-option {
  color: #d4d4d8;
}
.lang-option:hover {
  background: rgba(0, 0, 0, 0.04);
}
.dark .lang-option:hover {
  background: rgba(255, 255, 255, 0.05);
}
.lang-option-active {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}
.dark .lang-option-active {
  color: #6ee7b7;
}
/* =====================================================================
   DASHBOARD (novo layout estilo SaaS) — sidebar + stats + painéis
   ===================================================================== */

.dash-root { background: transparent; }

/* ---------- SIDEBAR ---------- */
.dash-sidebar {
  width: 256px;
  transition: width 0.25s ease;
}
.dash-sidebar.collapsed { width: 72px; }
.dash-sidebar.collapsed .dash-nav-text,
.dash-sidebar.collapsed .dash-nav-label,
.dash-sidebar.collapsed .dash-logo-text,
.dash-sidebar.collapsed .dash-soon-badge { display: none; }
.dash-sidebar.collapsed .dash-nav-item { justify-content: center; padding-left: 0; padding-right: 0; }

.dash-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 0.6rem;
  font-size: 0.875rem;
  color: #52525b;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.dark .dash-nav-item { color: #a1a1aa; }
.dash-nav-item i { font-size: 1.15rem; flex-shrink: 0; }
.dash-nav-item:hover { background: rgba(16,185,129,0.07); color: #059669; }
.dark .dash-nav-item:hover { color: #6ee7b7; }
.dash-nav-active {
  background: rgba(16,185,129,0.10) !important;
  color: #059669 !important;
}
.dark .dash-nav-active { color: #6ee7b7 !important; }
.dash-nav-active::before {
  content: ""; position: absolute; left: 0; top: 20%; height: 60%;
  width: 3px; border-radius: 0 3px 3px 0; background: #10b981;
}
.dash-soon-badge {
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: #10b981;
  background: rgba(16,185,129,0.12); padding: 2px 6px; border-radius: 5px;
  white-space: nowrap;
}
.dash-nav-soon { opacity: 0.65; }
.dash-nav-soon .dash-soon-badge { margin-left: auto; }

/* ---------- STAT CARDS ---------- */
.dash-stat {
  position: relative;
  padding: 1.1rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.6);
  overflow: hidden;
}
.dark .dash-stat {
  border-color: rgba(255,255,255,0.09);
  background: #17171c;
}
.dash-stat::after {
  content: ""; position: absolute; top: 0; right: 0; width: 90px; height: 90px;
  background: radial-gradient(circle at top right, var(--s, #10b981), transparent 70%);
  opacity: 0.10; pointer-events: none;
}
.dash-stat-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: #71717a; margin-bottom: 0.6rem;
}
.dash-stat-ico {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--s) 14%, transparent);
  color: var(--s);
}
.dash-stat-ico i { font-size: 1rem; }
.dash-stat-val {
  font-size: 1.6rem; font-weight: 600; line-height: 1;
  color: #18181b; margin-bottom: 0.35rem;
}
.dark .dash-stat-val { color: #fafafa; }
.dash-stat-sub { font-size: 0.75rem; color: #a1a1aa; }

/* ---------- MODULE CARDS ---------- */
.dash-mod {
  position: relative;
  text-align: left;
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.6);
  display: flex; flex-direction: column; gap: 0.85rem;
  min-height: 168px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.dark .dash-mod {
  border-color: rgba(255,255,255,0.09);
  background: #17171c;
}
.dash-mod:hover {
  transform: translateY(-3px);
  border-color: var(--card-accent, rgba(16,185,129,0.4));
  box-shadow: 0 14px 32px -12px var(--card-glow, rgba(16,185,129,0.25));
}
.dash-mod-ico {
  width: 46px; height: 46px; border-radius: 0.7rem;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.25s ease;
}
.dash-mod-ico i { font-size: 1.5rem; }
.dash-mod:hover .dash-mod-ico { transform: scale(1.06); }
.dash-mod-body { flex: 1; }
.dash-mod-body h3 {
  font-size: 1.05rem; font-weight: 600; color: #18181b;
  margin-bottom: 0.35rem; display: flex; align-items: center; gap: 8px;
}
.dark .dash-mod-body h3 { color: #fafafa; }
.dash-mod-body p { font-size: 0.83rem; color: #71717a; line-height: 1.5; }
.dash-mod-link {
  font-size: 0.83rem; font-weight: 500; color: var(--card-accent, #10b981);
  display: inline-flex; align-items: center; gap: 5px;
  filter: saturate(1.4) brightness(1.1);
}
.dash-mod-link i { transition: transform 0.2s ease; }
.dash-mod:hover .dash-mod-link i { transform: translateX(3px); }
.dash-mod-deco {
  position: absolute; bottom: -8px; right: -8px;
  font-size: 4.5rem; opacity: 0.04; pointer-events: none;
  color: var(--card-accent, #10b981);
}
.dash-mod-soon { opacity: 0.72; }
.dash-mod-soon .dash-mod-body h3 { color: #52525b; }
.dark .dash-mod-soon .dash-mod-body h3 { color: #d4d4d8; }

/* ---------- RIGHT COLUMN PANELS ---------- */
.dash-right { width: 300px; }
.dash-panel {
  padding: 1.1rem 1.2rem;
  border-radius: 1rem;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.6);
}
.dark .dash-panel {
  border-color: rgba(255,255,255,0.09);
  background: #17171c;
}
.dash-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.9rem;
}
.dash-panel-head h4 { font-size: 0.92rem; font-weight: 600; color: #18181b; }
.dark .dash-panel-head h4 { color: #fafafa; }

.dash-task { display: flex; align-items: center; gap: 9px; }
.dash-task-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dash-task-txt { font-size: 0.8rem; color: #52525b; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dark .dash-task-txt { color: #d4d4d8; }
.dash-task-when { font-size: 0.72rem; color: #a1a1aa; flex-shrink: 0; }

.dash-goal-top { display: flex; justify-content: space-between; font-size: 0.78rem; color: #71717a; margin-bottom: 0.4rem; }
.dash-bar { height: 6px; border-radius: 3px; background: rgba(113,113,122,0.15); overflow: hidden; }
.dash-bar > div { height: 100%; border-radius: 3px; transition: width 0.6s ease; }

.dash-act { display: flex; align-items: flex-start; gap: 9px; }
.dash-act-ico { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.85rem; }
.dash-act-body { flex: 1; min-width: 0; }
.dash-act-txt { font-size: 0.8rem; color: #3f3f46; line-height: 1.35; }
.dark .dash-act-txt { color: #d4d4d8; }
.dash-act-when { font-size: 0.7rem; color: #a1a1aa; margin-top: 1px; }

.dash-quote { background: linear-gradient(160deg, rgba(16,185,129,0.06), transparent); }
.dash-quote-txt { font-size: 0.92rem; font-weight: 500; color: #27272a; line-height: 1.5; margin: 0.4rem 0; }
.dark .dash-quote-txt { color: #e4e4e7; }
.dash-quote-author { font-size: 0.78rem; color: #10b981; }

/* ---------- RESPONSIVO ---------- */
@media (max-width: 1100px) {
  .dash-right { display: none; }
}
@media (max-width: 768px) {
  .dash-sidebar { position: absolute; z-index: 40; height: 100%; box-shadow: 0 0 40px rgba(0,0,0,0.3); }
  .dash-sidebar.collapsed { width: 0; border: none; overflow: hidden; }
}

/* Força o alinhamento do texto na sidebar recolhida */
.dash-sidebar.collapsed .dash-nav-item {
    justify-content: center !important;
}

/* Corrige o alinhamento específico do texto longo */
.dash-sidebar .dash-nav-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Garante que o container do texto não "empurre" o layout */
.dash-sidebar.collapsed .dash-nav-text {
    display: none !important;
}
/* =====================================================================
   SIDEBAR FIXA GLOBAL — visível em todos os módulos
   ===================================================================== */

/* Container que envolve todas as views, ao lado da sidebar */
#views-container {
  position: relative;
}
#views-container > [id^="view-"] {
  height: 100%;
}

/* Cada view rola internamente (a sidebar fica parada) */
#views-container > [id^="view-"]:not(.hidden) {
  display: flex;
}

/* O view-hub agora não tem mais a sidebar dentro; o dash-root vira só o conteúdo */
#view-hub .dash-root { width: 100%; }

/* Em telas pequenas, a sidebar recolhida não empurra o conteúdo */
@media (max-width: 768px) {
  #views-container { width: 100%; }
}

/* Quando recolhida: esconde o botão de recolher e centraliza o logo */
.dash-sidebar.collapsed .dash-collapse-btn { display: none; }
.dash-sidebar.collapsed .flex.items-center.justify-between.px-5 { justify-content: center; padding-left: 0; padding-right: 0; }

/* =====================================================================
   TELA DE LOGIN — painel duplo estilo SaaS
   ===================================================================== */

/* Painel esquerdo */
.auth-left {
  background: #060a08;
}

/* Imagem de montanhas no fundo do painel esquerdo */
.auth-left-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("assets/login-bg.jpg");
  background-size: cover;
  background-position: center;
}
/* Escurece levemente o topo pra leitura do texto */
.auth-left-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(6,10,8,0.75) 0%, rgba(6,10,8,0.35) 45%, rgba(6,10,8,0.15) 100%);
}

/* (montanhas e estrelas em CSS removidas — agora é a imagem real) */
.auth-mountains { display: none; }
.auth-left::after { content: none; }

/* Cada "feature" do painel esquerdo */
.auth-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.auth-feature-ico {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  display: flex; align-items: center; justify-content: center;
}
.auth-feature-ico i { font-size: 1.5rem; color: #34d399; }
.auth-feature > span {
  font-size: 0.8rem;
  color: #d4d4d8;
  line-height: 1.35;
}

/* Card direito com borda neon verde girando ao redor */
.auth-card {
  position: relative;
  background: rgba(10, 14, 12, 0.85);
  border: 1px solid rgba(16,185,129,0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* A borda neon: um gradiente cônico que gira atrás do card */
.auth-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--neon-angle, 0deg),
    transparent 0deg,
    transparent 200deg,
    #34d399 280deg,
    #10b981 320deg,
    #6ee7b7 340deg,
    transparent 360deg
  );
  /* mostra só a "moldura" (recorta o miolo) */
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: neonSpin 4s linear infinite;
  pointer-events: none;
  z-index: 2;
}

/* brilho/halo suave acompanhando a borda */
.auth-card::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--neon-angle, 0deg),
    transparent 0deg,
    transparent 230deg,
    rgba(16,185,129,0.5) 320deg,
    transparent 360deg
  );
  filter: blur(14px);
  opacity: 0.7;
  animation: neonSpin 4s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* Propriedade animável do ângulo (precisa de @property pra animar conic-gradient) */
@property --neon-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes neonSpin {
  to { --neon-angle: 360deg; }
}

/* Fallback: navegadores sem @property mostram um glow estático suave */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
  .auth-card::before, .auth-card::after { display: none; }
  .auth-card { box-shadow: 0 0 30px rgba(16,185,129,0.25); }
}

/* O conteúdo do card fica acima da borda */
.auth-card > * { position: relative; z-index: 3; }

/* glow lateral antigo desativado (agora a borda gira em volta) */
.auth-card-glow { display: none; }

/* =====================================================================
   CONSULTAS SQL — visual do mockup
   ===================================================================== */
.sql-header-card {
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.6);
}
.dark .sql-header-card {
  border-color: rgba(255,255,255,0.09);
  background: #17171c;
}

/* Card "Gerar com IA" com glow esmeralda */
.sql-ai-card {
  border: 1px solid rgba(16,185,129,0.2);
  background: linear-gradient(135deg, rgba(16,185,129,0.07), rgba(16,185,129,0.01));
}

/* Ilustração de banco de dados (imagem real) */
.sql-db-img {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 175px;
  height: auto;
  pointer-events: none;
  /* "lighten" descarta o fundo escuro da imagem, fundindo-a com o card */
  mix-blend-mode: lighten;
}

/* Switch de favorito no painel de metadados */
.meta-switch {
  width: 40px; height: 22px;
  border-radius: 999px;
  background: rgba(113,113,122,0.3);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.meta-switch.on { background: #10b981; }
.meta-switch-dot {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.meta-switch.on .meta-switch-dot { transform: translateX(18px); }

/* =====================================================================
   DEGRADÊ ESMERALDA — quebra o "black" em pontos estratégicos
   (inspirado no card "Gerar com IA")
   ===================================================================== */

/* Degradê sutil reutilizável (use em cards/headers que merecem destaque) */
.grad-emerald {
  background: linear-gradient(135deg, rgba(16,185,129,0.07), rgba(16,185,129,0.01)) !important;
  border-color: rgba(16,185,129,0.18) !important;
}

/* Degradê um pouco mais forte (pra headers principais) */
.grad-emerald-strong {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(16,185,129,0.12), transparent 55%),
    linear-gradient(135deg, rgba(16,185,129,0.06), rgba(16,185,129,0)) !important;
  border-color: rgba(16,185,129,0.2) !important;
}

/* Aplica o degradê nos cards do dashboard (stats, módulos, painéis) */
.dark .dash-stat {
  background:
    radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--s, #10b981) 8%, transparent), transparent 60%),
    #17171c !important;
}
.dark .dash-mod {
  background: linear-gradient(150deg, rgba(16,185,129,0.04), rgba(255,255,255,0.015)) !important;
}
.dark .dash-mod:hover {
  background: linear-gradient(150deg, rgba(16,185,129,0.08), rgba(255,255,255,0.02)) !important;
}
.dark .dash-panel {
  background: linear-gradient(160deg, rgba(16,185,129,0.035), rgba(255,255,255,0.012)) !important;
}

/* Header de saudação do dashboard ganha um glow no canto */
#view-hub .dash-main-wrap { position: relative; }

/* Header cards dos módulos (breadcrumb + título) */
.dark .sql-header-card {
  background:
    radial-gradient(130% 130% at 0% 0%, rgba(16,185,129,0.10), transparent 55%),
    #17171c !important;
  border-color: rgba(16,185,129,0.15) !important;
}

/* Toque sutil de degradê em TODOS os cards principais dos módulos */
.dark .mod-card {
  background:
    radial-gradient(140% 120% at 0% 0%, rgba(16,185,129,0.05), transparent 50%),
    #16161a !important;
}

/* =====================================================================
   SISTEMA DE TEMAS — troca a cor de destaque (accent)
   Sobrescreve as classes emerald do Tailwind via variáveis
   ===================================================================== */
:root {
  --accent-300: #6ee7b7;
  --accent-400: #34d399;
  --accent-500: #10b981;
  --accent-600: #059669;
  --accent-rgb: 16,185,129;
}

/* Paletas selecionáveis */
[data-accent="emerald"] { --accent-300:#6ee7b7; --accent-400:#34d399; --accent-500:#10b981; --accent-600:#059669; --accent-rgb:16,185,129; }
[data-accent="blue"]    { --accent-300:#93c5fd; --accent-400:#60a5fa; --accent-500:#3b82f6; --accent-600:#2563eb; --accent-rgb:59,130,246; }
[data-accent="violet"]  { --accent-300:#c4b5fd; --accent-400:#a78bfa; --accent-500:#8b5cf6; --accent-600:#7c3aed; --accent-rgb:139,92,246; }
[data-accent="rose"]    { --accent-300:#fda4af; --accent-400:#fb7185; --accent-500:#f43f5e; --accent-600:#e11d48; --accent-rgb:244,63,94; }
[data-accent="amber"]   { --accent-300:#fcd34d; --accent-400:#fbbf24; --accent-500:#f59e0b; --accent-600:#d97706; --accent-rgb:245,158,11; }
[data-accent="cyan"]    { --accent-300:#67e8f9; --accent-400:#22d3ee; --accent-500:#06b6d4; --accent-600:#0891b2; --accent-rgb:6,182,212; }

/* Sobrescreve as classes emerald do Tailwind com a cor do tema.
   Só aplica quando um accent diferente do emerald está ativo. */
body:not([data-accent="emerald"]) .text-emerald-300 { color: var(--accent-300) !important; }
body:not([data-accent="emerald"]) .text-emerald-400 { color: var(--accent-400) !important; }
body:not([data-accent="emerald"]) .text-emerald-500 { color: var(--accent-500) !important; }
body:not([data-accent="emerald"]) .text-emerald-600 { color: var(--accent-600) !important; }
body:not([data-accent="emerald"]) .bg-emerald-400 { background-color: var(--accent-400) !important; }
body:not([data-accent="emerald"]) .bg-emerald-500 { background-color: var(--accent-500) !important; }
body:not([data-accent="emerald"]) .bg-emerald-600 { background-color: var(--accent-600) !important; }
body:not([data-accent="emerald"]) .border-emerald-200 { border-color: rgba(var(--accent-rgb),0.3) !important; }
body:not([data-accent="emerald"]) .border-emerald-500 { border-color: var(--accent-500) !important; }
body:not([data-accent="emerald"]) .hover\:bg-emerald-400:hover { background-color: var(--accent-400) !important; }
body:not([data-accent="emerald"]) .hover\:bg-emerald-500:hover { background-color: var(--accent-500) !important; }
body:not([data-accent="emerald"]) .from-emerald-400 { --tw-gradient-from: var(--accent-400) !important; }
body:not([data-accent="emerald"]) .to-emerald-600 { --tw-gradient-to: var(--accent-600) !important; }
body:not([data-accent="emerald"]) .ring-emerald-500 { --tw-ring-color: var(--accent-500) !important; }

/* opacidades comuns (bg-emerald-500/10 etc.) */
body:not([data-accent="emerald"]) [class*="bg-emerald-500/"] { background-color: rgba(var(--accent-rgb),0.1) !important; }
body:not([data-accent="emerald"]) [class*="text-emerald-500/"] { color: rgba(var(--accent-rgb),0.8) !important; }
body:not([data-accent="emerald"]) [class*="border-emerald-500/"] { border-color: rgba(var(--accent-rgb),0.2) !important; }

/* Bolinha de notificação na sidebar (com número) */
.nav-notif-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #10b981;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 8px rgba(16,185,129,0.5);
  animation: navBadgePulse 2s ease-in-out infinite;
}
@keyframes navBadgePulse {
  0%, 100% { box-shadow: 0 0 8px rgba(16,185,129,0.5); }
  50% { box-shadow: 0 0 14px rgba(16,185,129,0.8); }
}
/* Quando a sidebar está recolhida, a bolinha vira um ponto no canto */
.dash-sidebar.collapsed .nav-notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  margin: 0;
  min-width: 8px;
  height: 8px;
  padding: 0;
  font-size: 0;
  border-radius: 50%;
}

/* =====================================================================
   HEADER CARD DA TELA DE QUALIDADE (com ícone 3D)
   ===================================================================== */
.qual-header-card {
  position: relative;
  background:
    radial-gradient(130% 130% at 0% 0%, rgba(16,185,129,0.10), transparent 55%),
    #17171c;
  border: 1px solid rgba(16,185,129,0.15);
}
.dark .qual-header-card {
  background:
    radial-gradient(130% 130% at 100% 50%, rgba(16,185,129,0.14), transparent 60%),
    #17171c;
}
/* glow verde atrás da imagem */
.qual-header-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(16,185,129,0.18), transparent 65%);
  pointer-events: none;
}
.qual-icon-img {
  position: relative;
  z-index: 1;
  height: 160px;
  width: auto;
  object-fit: contain;
  margin: -30px -10px -30px 0;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.4));
}

/* =====================================================================
   TIMELINE / GANTT — Planejamento de atividades
   ===================================================================== */
.timeline-wrap {
  min-width: 800px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 1rem;
  overflow: hidden;
  background: #121216;
}
.light .timeline-wrap, :root:not(.dark) .timeline-wrap { background: #fff; border-color: #e4e4e7; }

/* largura fixa da coluna de label (cliente) */
.timeline-header, .timeline-row { display: flex; }
.timeline-header-label, .timeline-row-label {
  width: 180px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.dark .timeline-header-label, .dark .timeline-row-label { border-color: rgba(255,255,255,0.06); }

/* cabeçalho de dias */
.timeline-header {
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.015);
}
.timeline-header-days { flex: 1; display: flex; }
.timeline-day-col {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 0; font-size: 11px;
  border-right: 1px solid rgba(255,255,255,0.03);
}
.timeline-dow { color: #71717a; text-transform: capitalize; }
.timeline-dom { color: #a1a1aa; font-weight: 600; font-size: 13px; }
.timeline-day-col.is-today { background: rgba(16,185,129,0.08); }
.timeline-day-col.is-today .timeline-dom { color: #10b981; }
.timeline-day-col.is-weekend { background: rgba(255,255,255,0.015); }

/* linha de cliente */
.timeline-row {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  min-height: 84px;
}
.timeline-row:last-child { border-bottom: none; }
.timeline-row-label {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
}
.timeline-cli-ico {
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(16,185,129,0.12); color: #34d399;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.timeline-cli-nome {
  font-size: 13px; font-weight: 600; color: #e4e4e7;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
:root:not(.dark) .timeline-cli-nome { color: #18181b; }
.timeline-cli-count { font-size: 11px; color: #71717a; }

/* track onde as barras ficam */
.timeline-row-track {
  flex: 1; position: relative;
  background-image: repeating-linear-gradient(
    to right,
    transparent, transparent calc(7.142% - 1px),
    rgba(255,255,255,0.03) calc(7.142% - 1px), rgba(255,255,255,0.03) 7.142%
  );
}

/* barra de atividade */
.timeline-bar {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  height: 52px;
  border: 1px solid;
  border-radius: 9px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
  transition: all 0.15s;
  overflow: hidden;
  backdrop-filter: blur(2px);
}
.timeline-bar:hover { transform: translateY(-50%) scale(1.02); z-index: 5; }
.timeline-bar-title {
  font-size: 12px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
:root:not(.dark) .timeline-bar-title { color: #18181b; }
.timeline-bar-meta {
  font-size: 10px; color: #a1a1aa;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}