/* ==========================================================================
   Telas 11/12 — chrome do app (shell com sidebar + topbar) + Modal Bem-vindo.
   Não é split: o painel escuro e o DotGrid não participam daqui.
   O conteúdo do dashboard do projeto (header, hero, insights, rankings) vive
   em styles/dash.css, carregado depois deste.
   ========================================================================== */
.app { display: flex; height: 100dvh; background: var(--background); }

/* --- rail (sidebar) --- */
.rail {
  display: flex; width: 248px; flex: none; flex-direction: column;
  border-right: 1px solid var(--sidebar-border); background: var(--sidebar);
}
@media (max-width: 1023px) { .rail { display: none; } }
.rail-head { padding: 12px 12px 8px; }
.switcher {
  display: flex; width: 100%; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--card); padding: 9px 11px; cursor: pointer; text-align: left;
  transition: background-color 0.15s;
}
.switcher:hover { background: var(--accent); }
.switcher-mark {
  display: flex; width: 27px; height: 27px; flex: none;
  align-items: center; justify-content: center; border-radius: 7px;
  background: var(--foreground); color: var(--background);
  font-size: 13px; font-weight: 700;
}
.switcher b { display: block; font-size: 0.875rem; font-weight: 600; line-height: 1.25; }
.switcher small { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--muted-foreground); }
.switcher > svg { width: 15px; height: 15px; flex: none; margin-left: auto; color: var(--muted-foreground); }

.rail-nav { flex: 1; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.rail-group-label {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.08em; color: color-mix(in oklch, var(--muted-foreground) 60%, transparent);
  padding: 6px 8px 2px;
}
.rail-nav ul { display: flex; flex-direction: column; gap: 2px; }
.rail-item {
  display: flex; align-items: center; gap: 8px; border-radius: var(--radius-md);
  padding: 7px 8px; font-size: 0.875rem; color: var(--foreground);
  transition: background-color 0.15s;
}
.rail-item:hover { background: var(--accent); }
.rail-item[aria-current='page'] {
  background: color-mix(in oklch, var(--primary) 10%, transparent);
  color: var(--primary); font-weight: 500;
}
/* Spotlight do Modal Bem-vindo: o item citado pela etapa fura o scrim
   (z-index acima do .welcome-scrim, que é 60) e ganha fundo SÓLIDO — o resto
   do rail segue sob o escurecimento. Ligada/desligada por js/welcome.js. */
.rail-item.is-spotlit {
  position: relative; z-index: 61;
  background: var(--sidebar);
  box-shadow: 0 0 0 1px var(--ring), 0 4px 16px rgba(0, 0, 0, 0.18);
}
/* O item ativo mantém o realce primário — misturado com a superfície (opaco),
   senão o scrim atravessa o tint translúcido. */
.rail-item.is-spotlit[aria-current='page'] {
  background: color-mix(in oklch, var(--primary) 10%, var(--sidebar));
}
.rail-item svg { width: 18px; height: 18px; flex: none; }

.rail-foot { padding: 0 12px 12px; }
.upgrade-card {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--card); padding: 12px;
}
.upgrade-card p { font-size: 0.75rem; color: var(--muted-foreground); }

/* --- coluna principal --- */
.app-main { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.app-topbar {
  display: flex; height: 60px; flex: none; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border); background: var(--background); padding: 0 24px;
}
@media (max-width: 1023px) { .app-topbar { padding: 0 16px; } }
.icon-btn {
  display: flex; width: 36px; height: 36px; flex: none; cursor: pointer;
  align-items: center; justify-content: center; border-radius: var(--radius-md);
  color: var(--muted-foreground); transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--accent); color: var(--foreground); }
.icon-btn svg { width: 18px; height: 18px; }
.search-pill {
  display: flex; height: 36px; width: 230px; flex: none; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card); padding: 0 12px;
}
@media (max-width: 639px) { .search-pill { display: none; } }
.search-pill svg { width: 15px; height: 15px; flex: none; color: var(--muted-foreground); }
.search-pill input { width: 100%; border: 0; background: transparent; font-size: 0.875rem; outline: none; }
.search-pill input::placeholder { color: var(--muted-foreground); }
.avatar {
  display: flex; width: 36px; height: 36px; flex: none; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 999px; background: var(--muted);
  font-size: 0.75rem; font-weight: 600; color: var(--foreground); cursor: pointer;
}

.app-content { flex: 1; min-height: 0; overflow: auto; background: var(--muted); padding: 24px; }
@media (max-width: 639px) { .app-content { padding: 16px; } }
.app-content > .inner { margin-inline: auto; max-width: 1180px; display: flex; flex-direction: column; gap: 22px; }

/* --- cartão base + delta --- */
.card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); }

.delta { font-family: var(--font-mono); font-size: 0.75rem; white-space: nowrap; }
.delta.up { color: var(--success-strong); }
.delta.down { color: var(--destructive-strong); }
.delta .note { color: var(--muted-foreground); }

/* --- banner de trial --- */
.trial-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--card); padding: 14px 18px; font-size: 0.875rem;
}
.trial-card b { font-family: var(--font-mono); font-weight: 600; }
.btn-sm-solid {
  display: inline-flex; height: 32px; align-items: center; gap: 6px; padding: 0 12px;
  border-radius: var(--radius-md); background: var(--primary); color: var(--primary-foreground);
  font-size: 0.8125rem; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn-sm-solid:hover { background: color-mix(in oklch, var(--primary) 90%, transparent); }

/* Badge de status — o ponto é indicador FUNCIONAL de estado (permitido).
   Recipe: tinta 10% + texto -strong. */
.status-badge {
  display: inline-flex; height: 20px; flex: none; align-items: center; gap: 5px;
  border-radius: 999px; padding: 0 8px; border: 1px solid transparent;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
/* "Em andamento" (coleta rodando) — estado in-flight: tinta info 10% + texto
   -strong. Cor codifica ESTADO, nunca enfeite. */
.status-info {
  border-color: color-mix(in oklch, var(--info) 40%, transparent);
  background: color-mix(in oklch, var(--info) 10%, transparent);
  color: var(--info-strong);
}

/* --- Status da Coleta (telas 10/11: primeira coleta em andamento) --- */
.collect-card { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.collect-icon {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--muted); color: var(--muted-foreground);
}
.collect-icon svg { width: 18px; height: 18px; }
.collect-body { flex: 1; min-width: 0; }
.collect-body b { display: block; font-size: 0.875rem; font-weight: 600; }
.collect-meta {
  display: block; margin-top: 2px;
  font-size: 0.75rem; color: var(--muted-foreground);
}

/* ==========================================================================
   Modal Bem-vindo — primeiro acesso (tela 11). Carousel de 3 etapas; as
   barras do indicador reusam o skin do Stepper (shell.css).
   ========================================================================== */
.welcome-scrim {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0, 0, 0, 0.55);
}
.welcome-scrim[hidden] { display: none; }
.welcome-modal {
  width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--background); box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
  outline: none;
}
.welcome-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px 0;
}
.welcome-title { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.015em; }
.welcome-stepper { padding: 2px 20px 0; }
.welcome-stage { padding: 14px 20px 4px; }
.welcome-stage[hidden] { display: none; }
.welcome-stage h3 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 2px; }
.welcome-stage > .note { margin-bottom: 10px; }
.welcome-items { display: flex; flex-direction: column; }
.welcome-items li { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.witem-icon {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--muted); color: var(--foreground);
}
.witem-icon svg { width: 15px; height: 15px; }
.welcome-items b { display: block; font-size: 0.8125rem; font-weight: 600; line-height: 1.3; }
.welcome-items small { display: block; font-size: 0.75rem; line-height: 1.45; color: var(--muted-foreground); }
.welcome-foot {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; padding: 10px 20px 16px;
}

/* Movimento das ilustrações — sutil; o bloco prefers-reduced-motion no fim
   do arquivo desliga tudo isso. */

/* --- controle de estado do MOCKUP (fora do chrome do produto) --- */
.mock-switch {
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  display: flex; align-items: center; gap: 8px;
  border: 1px dashed var(--border); border-radius: 999px;
  background: var(--card); padding: 6px 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.mock-switch > span {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted-foreground);
}
.mock-switch button {
  border-radius: 999px; padding: 4px 10px; font-size: 0.75rem; font-weight: 500;
  color: var(--muted-foreground); cursor: pointer; transition: background-color 0.15s, color 0.15s;
}
.mock-switch button:hover { background: var(--accent); color: var(--foreground); }
.mock-switch button[aria-pressed='true'] { background: var(--secondary); color: var(--secondary-foreground); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
