
:root {
  /* ---------- Tokens canônicos do DESIGN_SYSTEM.md §14 ---------- */

  /* Marca — ramp copper §3.2. Preenchimento total de copper só no CTA primário. */
  --brand-core: #c8601a;
  --brand-mid: #e87d3e;
  --brand-light: #f5a05a;
  --brand-dim: #7a3510;

  /* Superfícies — elevação por luminância, não por sombra §3.3 */
  --bg-base: #0a0a0b;
  --bg-elevated: #131315;
  --bg-overlay: #1c1c1f;
  --bg-input: #222226;

  /* Texto — branco quente §3.4 */
  --ink-primary: #f0ede8;
  --ink-secondary: #a09890;
  /* AA como PISO, não como meta (DESIGN_SYSTEM §2). O valor anterior (#5c5650) dava 2.5:1 --
     que o próprio DS marca como "reprovado, uso decorativo apenas". Só que o produto inteiro
     usa este token como cor de TEXTO informativo: rótulo de tile, nome do dia na fita da
     grade, "Seu status", "até a próxima virada", legenda de requisito. Uma varredura de
     contraste na grade acusou 125 elementos reprovando, todos por aqui.
     #8a837b passa AA em todas as superfícies do sistema (4.96:1 sobre bg-elevated, 4.78:1
     sobre o card mais claro) e continua sendo o degrau mais apagado da escala -- abaixo de
     ink-secondary (6.5:1) e de ink-primary (15:1), então a hierarquia não muda. */
  --ink-muted: #8a837b;

  /* Bordas §3.6 */
  --edge: #3a3a3e;
  --edge-subtle: #252528;

  /* Semânticos — só feedback de sistema §3.5 */
  --ok: #3dab6b;
  --warn: #d4a017;
  --danger: #c0392b;
  --danger-ink: #e2685c;
  --info: #2e86ab;

  /* Verde Kick — exclusivo para referência direta à plataforma §3.7 */
  --kick: #53fc18;

  /* ---------- Alias dos nomes curtos herdados (mesmo papel, mesmo valor) ---------- */
  --bg: var(--bg-base);
  --surface: var(--bg-elevated);
  --surface-2: var(--bg-overlay);
  --surface-3: var(--bg-input);
  --border: var(--edge-subtle);
  --border-strong: var(--edge);

  --text: var(--ink-primary);
  --text-muted: var(--ink-secondary);
  --text-faint: var(--ink-muted);

  --accent: var(--brand-core);
  --accent-hover: var(--brand-mid);
  --accent-light: var(--brand-light);
  --accent-press: var(--brand-dim);
  --accent-soft: rgba(200, 96, 26, 0.14);
  --accent-line: rgba(200, 96, 26, 0.38);

  --ok-soft: rgba(61, 171, 107, 0.13);
  --danger-soft: rgba(192, 57, 43, 0.14);
  --warn-soft: rgba(212, 160, 23, 0.13);

  /* Forma §7. Duas medidas de raio, não uma redonda em tudo. */
  --radius: 8px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* Grid de 4pt §5 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* Tipografia §4. Inter para tudo, JetBrains Mono para número.
     A mesma declaração vale no app desktop, onde o CSP proíbe fonte remota e a Inter cai no
     fallback do sistema -- por isso a pilha de fallback é idêntica nos dois lugares. */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;

  /* Movimento §10. --ease-out para o que entra, --ease-spring para confirmação (o leve
     ultrapassar do alvo é o que faz a ação parecer "respondida", não só "feita"). */
  --dur-fast: 130ms;
  --dur: 200ms;
  --dur-slow: 320ms;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.28);
}

/* View Transitions entre páginas DESLIGADO. A regra @view-transition (navigation: auto,
   Chrome 126+) travava a aba ao trocar de seção rápido (Painel/Grade/Sorteios/Conta) --
   navegação nova disparada antes da transição anterior acabar deixa o Chromium numa corrida
   que nunca se resolve. Cosmético e sem custo pra quem tira: outro navegador já ignorava. */

/* Quem pediu menos movimento recebe menos movimento. Não é opcional: animação de entrada
   em lista longa dispara enxaqueca e náusea em quem tem sensibilidade vestibular. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 20px; }
h2 { font-size: 15px; color: var(--text); }
h3 { font-size: 13px; color: var(--text-muted); font-weight: 500; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }

/* ---------- Superficie ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

/* ---------- Controles ---------- */

button, .btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 9px 14px;
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

button:hover, .btn:hover { background: var(--surface-3); border-color: var(--accent-line); }

/* O botão afunda no clique. É o feedback mais barato que existe e o que mais separa uma
   interface que "responde" de uma que parece travada -- acontece ANTES da rede. */
button:active:not(:disabled), .btn:active:not(:disabled) { transform: scale(0.98); }

/* Focus ring do DS §11.2: 2px em brand-light com offset de 2px. Vale para TODO elemento
   interativo e nunca é removido sem substituição. */
button:focus-visible, .btn:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: 2px;
}

button:disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* CTA primário: o ÚNICO preenchimento total de copper da tela (DS §2.2). Duas variantes de
   botão copper na mesma tela quebram a hierarquia -- se precisar de um segundo, ele é o
   secundário abaixo. */
/* Texto QUASE-PRETO quente sobre o copper, não branco.
   Branco sobre #c8601a dá 4.08:1 -- reprova o AA de texto normal, e o DS pede AA como piso,
   não como meta (§3.9). O preto quente sobe para 4.56:1 sem tirar o copper do botão, que é a
   assinatura da marca. Escurecer o fundo resolveria o contraste também, mas às custas da cor. */
button.primary, .btn.primary {
  background: var(--brand-core);
  border-color: var(--brand-core);
  color: #1a1108;
  font-weight: 600;
}
button.primary:hover, .btn.primary:hover { background: var(--brand-mid); border-color: var(--brand-mid); }
button.primary:active:not(:disabled), .btn.primary:active:not(:disabled) { background: var(--brand-dim); border-color: var(--brand-dim); }

/* Secundário copper: contorno e wash, sem preenchimento. */
button.secondary, .btn.secondary {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--brand-light);
  font-weight: 600;
}
button.secondary:hover, .btn.secondary:hover { background: rgba(200, 96, 26, 0.22); }

/* O vermelho de PREENCHIMENTO (#c0392b) não serve como cor de TEXTO sobre superfície
   elevada: 3.41:1. "--danger-ink" é o mesmo vermelho clareado até passar o AA,
   usado só onde ele vira letra: 5.11:1 sobre o próprio fundo do botão (danger-soft). */
button.danger, .btn.danger { color: var(--danger-ink); border-color: rgba(192, 57, 43, 0.45); background: var(--danger-soft); }
button.danger:hover, .btn.danger:hover { background: rgba(192, 57, 43, 0.24); }

/* Link DENTRO de texto: brand-core (#c8601a) dá 4.16:1 sobre a superfície do banner --
   reprova o AA de texto normal. brand-mid sobe para 6.02:1 e continua na rampa copper. O
   sublinhado é o segundo canal que o DS exige: cor nunca sozinha como portadora de sentido. */
.fx-banner-msg a,
.fx-state a,
p a:not(.btn) {
  color: var(--brand-mid);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.fx-banner-msg a:hover,
.fx-state a:hover,
p a:not(.btn):hover { color: var(--brand-light); }

button.gold, .btn.gold { color: var(--warn); border-color: rgba(212, 160, 23, 0.42); background: var(--warn-soft); }
button.gold:hover, .btn.gold:hover { background: rgba(212, 160, 23, 0.22); }

label {
  display: grid;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input, textarea, select {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
input:hover, textarea:hover, select:hover { border-color: var(--border-strong); }
input:focus, textarea:focus, select:focus { border-color: var(--accent-line); background: var(--surface); outline: none; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }

/* ---------- Tabela ---------- */

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
}
tbody tr { transition: background var(--dur-fast) var(--ease-out); }
tbody tr:hover { background: var(--surface-2); }

/* ---------- Selo de estado ---------- */

.pill {
  /* inline-flex + align-self: em pai flex com stretch (default), pill curta
     herda a altura da irmã longa e vira oval com radius 999px. */
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  line-height: 1.25;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
  max-width: 100%;
  box-sizing: border-box;
}
.pill.ok   { color: var(--ok);     background: var(--ok-soft);     border-color: rgba(61, 171, 107, 0.32); }
.pill.bad  { color: var(--danger); background: var(--danger-soft); border-color: rgba(192, 57, 43, 0.34); }
.pill.warn { color: var(--warn);   background: var(--warn-soft);   border-color: rgba(212, 160, 23, 0.32); }

/* Número é dado, não texto corrido: mono com largura de dígito fixa, para que um contador
   que sobe não empurre o que está ao lado (DS §4). */
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ---------- Estados: carregando, vazio, erro ---------- */

/* Skeleton em vez de "Carregando...". O texto solto faz a pagina saltar quando o conteudo
   chega; o skeleton ja ocupa o espaco certo. */
.fx-skeleton {
  height: 14px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: fx-shimmer 1.4s linear infinite;
}
@keyframes fx-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.fx-state {
  display: grid;
  gap: var(--space-2);
  justify-items: center;
  text-align: center;
  padding: var(--space-6) var(--space-4);
  color: var(--text-muted);
  font-size: 13px;
}
.fx-state strong { color: var(--text); font-weight: 600; font-size: 14px; }
.fx-state.error strong { color: var(--danger); }

/* ---------- Confirmacao ---------- */

/* Pulso de sucesso: usado no elemento que ACABOU de mudar (linha salva, vaga sorteada).
   Duracao curta e um unico ciclo -- confirmacao, nao chamariz. */
@keyframes fx-confirm {
  0%   { background-color: var(--ok-soft); }
  100% { background-color: transparent; }
}
.fx-confirm { animation: fx-confirm 900ms var(--ease-out) 1; }

@keyframes fx-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}
.fx-error { animation: fx-shake 260ms var(--ease-out) 1; }

/* Torrada de confirmacao. Entra de baixo, some sozinha. */
.fx-toast-host {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: grid;
  gap: var(--space-2);
  z-index: 10000;
  pointer-events: none;
}
.fx-toast {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: fx-toast-in var(--dur-slow) var(--ease-spring) 1;
}
.fx-toast.ok    { border-left-color: var(--ok); }
.fx-toast.error { border-left-color: var(--danger); }
.fx-toast.saindo { animation: fx-toast-out var(--dur) var(--ease-out) forwards; }

@keyframes fx-toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fx-toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}

/* Entrada escalonada de lista. O atraso por linha faz a tabela "assentar" em vez de piscar
   inteira de uma vez -- e o unico lugar onde vale animar em volume. */
@keyframes fx-row-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fx-stagger > * { animation: fx-row-in var(--dur) var(--ease-out) both; }
.fx-stagger > *:nth-child(1)  { animation-delay: 0ms; }
.fx-stagger > *:nth-child(2)  { animation-delay: 20ms; }
.fx-stagger > *:nth-child(3)  { animation-delay: 40ms; }
.fx-stagger > *:nth-child(4)  { animation-delay: 60ms; }
.fx-stagger > *:nth-child(5)  { animation-delay: 80ms; }
.fx-stagger > *:nth-child(n+6) { animation-delay: 100ms; }

/* Ponto de status vivo. Respira devagar; nada de piscar. */
.fx-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: var(--text-faint);
}
.fx-dot.on { background: var(--ok); animation: fx-breathe 2.4s var(--ease-out) infinite; }
.fx-dot.off { background: var(--danger); }
@keyframes fx-breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

/* ==========================================================================
   Primitives admin + grade (Fase 1 UX)
   Classes reutilizáveis — páginas montam a marcação; este arquivo só entrega CSS.
   Tokens/aliases acima permanecem a fonte de verdade; nada aqui redefine pigmento.
   ========================================================================== */

/* ---------- Shell admin (header sticky + nav de seções + conteúdo) ---------- */

.fx-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  color: var(--ink-primary);
}

.fx-shell-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  min-height: 56px;
  padding: var(--space-3) var(--space-5);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--edge-subtle);
  transition:
    background var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out),
    backdrop-filter var(--dur) var(--ease-out);
}

/* Estado scrolled: fundo translúcido + blur (DS §8.11), sem glow. */
.fx-shell-header.is-scrolled {
  background: rgba(19, 19, 21, 0.86);
  border-bottom-color: var(--edge);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.fx-shell-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-right: auto;
  min-width: 0;
}

.fx-shell-brand-mark {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--edge-subtle);
  border-radius: 12px;
  background: var(--bg-overlay);
  text-decoration: none;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}
.fx-shell-brand-mark:hover,
.fx-shell-brand-mark:focus-visible {
  text-decoration: none;
  border-color: var(--accent-line);
  background: var(--accent-soft);
  outline: none;
}
.fx-shell-brand-logo {
  display: block;
  height: 26px;
  width: auto;
  object-fit: contain;
}

.fx-shell-brand-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.fx-shell-brand h1,
.fx-shell-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fx-shell-brand-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink-primary);
  white-space: nowrap;
}
.fx-shell-brand-title .brand-accent {
  color: var(--brand-light);
  font-weight: 800;
}

.fx-shell-brand-sub {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.fx-shell-brand-sub .brand-context {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-secondary);
  line-height: 1;
}
.fx-shell-brand-sub .brand-context::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 10px;
  margin-left: 8px;
  background: var(--edge);
  vertical-align: -1px;
}

.fx-shell-brand-credit {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid transparent;
  transition:
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}
.fx-shell-brand-credit:hover,
.fx-shell-brand-credit:focus-visible {
  color: var(--ink-secondary);
  text-decoration: none;
  border-bottom-color: var(--accent-line);
  outline: none;
}
.fx-shell-brand-credit .credit-name {
  color: var(--brand-light);
  font-weight: 600;
}
.fx-shell-brand-credit:hover .credit-name,
.fx-shell-brand-credit:focus-visible .credit-name {
  color: var(--brand-mid);
}

.fx-shell-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  font-size: 12px;
  color: var(--ink-secondary);
}

.fx-shell-meta-week {
  display: grid;
  gap: 1px;
  text-align: right;
  line-height: 1.25;
}
.fx-shell-meta-week-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.fx-shell-meta-week-range {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-primary);
}

.fx-shell-user {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--edge-subtle);
  border-radius: var(--radius-pill);
  background: var(--bg-overlay);
  color: inherit;
  text-decoration: none;
  transform-origin: center;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}
/* O hover era um pulso INFINITO (scale 1 -> 1.06, para sempre, enquanto o ponteiro estivesse
   em cima) e um box-shadow com var(--brand) -- token que não existe neste arquivo, então o
   color-mix era inválido e o navegador descartava a declaração inteira. Ou seja: a única
   coisa que se via era o chip pulsando sem parar.
   Agora: um degrau, não um laço. Sobe 1px e assenta. É o que um alvo clicável faz. */
a.fx-shell-user:hover,
a.fx-shell-user:focus-visible {
  text-decoration: none;
  color: inherit;
  border-color: var(--accent-line);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(200, 96, 26, 0.28);
  transform: translateY(-1px);
}
a.fx-shell-user:active {
  transform: translateY(0) scale(0.985);
}
.fx-shell-user-avatar,
.fx-shell-user-avatar-fallback {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--brand-light);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}
.fx-shell-user-avatar {
  object-fit: cover;
  display: block;
}
.fx-shell-user-name {
  max-width: 120px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 720px) {
  .fx-shell-meta-week { display: none; }
  .fx-shell-user-name { max-width: 72px; }
}

.fx-shell-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  width: 100%;
  padding: 0 var(--space-5) var(--space-3);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--edge-subtle);
}

/* Nav colada ao header sticky: sobe junto na rolagem.
   O deslocamento é a ALTURA REAL do header, medida em JS (ver --fx-header-h no bloco de
   script). O valor fixo de 56px que estava aqui era o min-height do header, não a altura
   dele: com o padding e a faixa da semana ele mede 65px, então ao rolar a nav enfiava 9px
   por baixo do header e o primeiro item ficava cortado. O 56px continua de reserva para o
   instante antes de o script medir. */
.fx-shell-header + .fx-shell-nav {
  position: sticky;
  top: var(--fx-header-h, 56px);
  z-index: 99;
}

.fx-shell-nav a,
.fx-shell-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-secondary);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color var(--dur-fast) var(--ease-out);
}

.fx-shell-nav a:hover,
.fx-shell-nav-link:hover {
  color: var(--ink-primary);
  text-decoration: none;
}

/* Sublinhado copper que cresce da esquerda — affordance de seção corrente (DS §8.11). */
.fx-shell-nav a::after,
.fx-shell-nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  border-radius: 1px;
  background: var(--brand-core);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur) var(--ease-out);
}

.fx-shell-nav a:hover::after,
.fx-shell-nav-link:hover::after,
.fx-shell-nav a.is-active::after,
.fx-shell-nav-link.is-active::after,
.fx-shell-nav a[aria-current="page"]::after,
.fx-shell-nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.fx-shell-nav a.is-active,
.fx-shell-nav-link.is-active,
.fx-shell-nav a[aria-current="page"],
.fx-shell-nav-link[aria-current="page"] {
  color: var(--ink-primary);
  font-weight: 600;
}

.fx-shell-body,
.fx-shell-content {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-5);
  align-content: start;
}

.fx-shell-content.wide {
  max-width: none;
}

@media (max-width: 720px) {
  .fx-shell-header { padding: var(--space-3) var(--space-4); }
  .fx-shell-nav { padding: 0 var(--space-4) var(--space-2); }
  .fx-shell-body,
  .fx-shell-content { padding: var(--space-4); }
}

/* ---------- Toolbar de grade (busca + filtros + ações) ---------- */

.fx-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--edge-subtle);
  border-radius: var(--radius-lg);
}

.fx-toolbar-search {
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 320px;
  position: relative;
}

.fx-toolbar-search input {
  width: 100%;
  padding-left: 36px;
  background: var(--bg-input);
}

/* Ícone de lupa via CSS puro — páginas não precisam de SVG só pra isso. */
.fx-toolbar-search::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 1.5px solid var(--ink-muted);
  border-radius: 50%;
  pointer-events: none;
  box-sizing: border-box;
}
.fx-toolbar-search::after {
  content: "";
  position: absolute;
  left: 24px;
  top: 50%;
  width: 6px;
  height: 1.5px;
  margin-top: 4px;
  background: var(--ink-muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.fx-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.fx-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:
    color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}
.fx-filter:hover {
  color: var(--ink-primary);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.fx-filter.is-active {
  color: var(--brand-light);
  background: var(--accent-soft);
  border-color: var(--accent-line);
  font-weight: 600;
}

.fx-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

@media (max-width: 720px) {
  .fx-toolbar-search { max-width: none; flex-basis: 100%; }
  .fx-toolbar-actions { margin-left: 0; width: 100%; }
  .fx-toolbar-actions .btn,
  .fx-toolbar-actions button { flex: 1 1 auto; }
}

/* ---------- Célula / slot editável ---------- */

.fx-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 52px;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--edge-subtle);
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-primary);
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}
.fx-slot:hover {
  border-color: var(--edge);
  background: var(--bg-overlay);
}

.fx-slot-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fx-slot-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

/* Vazio: traço + wash fraco — convida preenchimento sem gritar. */
.fx-slot.is-empty,
.fx-slot.empty {
  background: transparent;
  border-style: dashed;
  border-color: var(--edge);
  color: var(--ink-muted);
}
.fx-slot.is-empty:hover,
.fx-slot.empty:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--ink-secondary);
}

/* Preenchido: superfície sólida, nick legível. */
.fx-slot.is-filled,
.fx-slot.filled {
  background: var(--bg-overlay);
  border-style: solid;
  border-color: var(--edge);
  color: var(--ink-primary);
}
.fx-slot.is-filled .fx-slot-label,
.fx-slot.filled .fx-slot-label {
  color: var(--ink-primary);
}

/* Manutenção: warn semântico — segundo canal além da cor (rótulo/meta). */
.fx-slot.is-maintenance,
.fx-slot.maintenance {
  background: var(--warn-soft);
  border-style: solid;
  border-color: rgba(212, 160, 23, 0.42);
  color: var(--warn);
}
.fx-slot.is-maintenance .fx-slot-label,
.fx-slot.maintenance .fx-slot-label {
  color: var(--warn);
}

/* Foco / edição ativa: anel brand-light, sem glow neon. */
.fx-slot.is-focus,
.fx-slot.focus,
.fx-slot:focus-visible {
  border-style: solid;
  border-color: var(--brand-light);
  outline: 2px solid var(--brand-light);
  outline-offset: 2px;
  background: var(--bg-input);
  box-shadow: none;
}

.fx-slot.is-disabled,
.fx-slot:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- Banner inline de confirmação (sucesso / erro) ---------- */
/* Complementa .fx-toast (flutuante). Banner fica ancorado no fluxo da página. */

.fx-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 12px 16px;
  margin-bottom: var(--space-4);
  background: var(--bg-overlay);
  border: 1px solid var(--edge);
  border-left: 3px solid var(--brand-core);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--ink-primary);
  animation: fx-banner-in var(--dur-slow) var(--ease-spring) 1;
}
.fx-banner.ok {
  border-left-color: var(--ok);
  background: var(--ok-soft);
  border-color: rgba(61, 171, 107, 0.28);
}
.fx-banner.error {
  border-left-color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(192, 57, 43, 0.3);
}
.fx-banner.warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
  border-color: rgba(212, 160, 23, 0.28);
}

.fx-banner-body { flex: 1; min-width: 0; }
.fx-banner-title {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}
.fx-banner-msg { color: var(--ink-secondary); }
.fx-banner.ok .fx-banner-msg,
.fx-banner.error .fx-banner-msg,
.fx-banner.warn .fx-banner-msg { color: inherit; opacity: 0.9; }

.fx-banner-close {
  flex-shrink: 0;
  margin: -4px -6px -4px 0;
  padding: 6px 8px;
  font-size: 14px;
  line-height: 1;
  color: var(--ink-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}
.fx-banner-close:hover { color: var(--ink-primary); background: transparent; }

@keyframes fx-banner-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Toast (.fx-toast / .fx-toast-host) já usa --ease-spring na entrada.
   Reforço local sob reduced-motion (o bloco global no topo também zera animações). */
@media (prefers-reduced-motion: reduce) {
  .fx-banner { animation: none; }
  .fx-toast { animation: none; }
  .fx-toast.saindo { animation: none; opacity: 0; }
}


/* ---- Canal de suporte (P2-2) -------------------------------------------------------- */
:root {
  --discord: #5865F2;
  --discord-hover: #4752C4;
  --discord-soft: rgba(88, 101, 242, 0.16);
}

@keyframes fx-support-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fx-support-shine {
  0%   { transform: translateX(-120%) skewX(-18deg); opacity: 0; }
  35%  { opacity: 0.55; }
  100% { transform: translateX(220%) skewX(-18deg); opacity: 0; }
}
@keyframes fx-support-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.0); }
  50%      { box-shadow: 0 0 0 6px rgba(88, 101, 242, 0.12); }
}

.fx-discord-glyph { width: 1.1em; height: 1.1em; display: block; flex-shrink: 0; }

.fx-support {
  position: relative;
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 0% 0%, var(--discord-soft), transparent 55%),
    linear-gradient(180deg, rgba(28, 28, 31, 0.92), var(--bg-overlay));
  overflow: hidden;
  animation: fx-support-in 420ms var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)) both;
}
.fx-support::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--discord), var(--brand-core));
  border-radius: 3px 0 0 3px;
}
.fx-support-kicker {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-light);
}
.fx-support-note {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-secondary);
}
.fx-support-note strong { color: var(--ink-primary); font-weight: 600; }

.fx-support-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius);
  background: var(--discord);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition:
    background var(--dur-fast, 150ms) var(--ease-out, ease),
    transform var(--dur-fast, 150ms) var(--ease-out, ease),
    box-shadow var(--dur-fast, 150ms) var(--ease-out, ease);
  box-shadow: 0 10px 28px rgba(88, 101, 242, 0.28);
  animation: fx-support-pulse 2.8s ease-in-out 800ms 2;
}
.fx-support-cta:hover {
  background: var(--discord-hover);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(88, 101, 242, 0.38);
}
.fx-support-cta:active { transform: translateY(0) scale(0.985); }
.fx-support-cta:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: 3px;
}
.fx-support-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.28) 50%, transparent 65%);
  transform: translateX(-120%) skewX(-18deg);
  pointer-events: none;
  z-index: 0;
}
.fx-support-cta:hover::after { animation: fx-support-shine 700ms var(--ease-out, ease) both; }
.fx-support-cta > * { position: relative; z-index: 1; }

.fx-support.is-compact {
  padding: var(--space-3);
  gap: var(--space-2);
}
.fx-support.is-compact .fx-support-cta { min-height: 40px; width: 100%; }
.fx-support.is-danger {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(192, 57, 43, 0.14), transparent 50%),
    radial-gradient(100% 80% at 100% 0%, var(--discord-soft), transparent 45%),
    var(--bg-overlay);
}
.fx-support.is-danger::before {
  background: linear-gradient(180deg, var(--danger), var(--discord));
}

.fx-support-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  color: var(--ink-primary);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition:
    border-color var(--dur-fast, 150ms) ease,
    color var(--dur-fast, 150ms) ease,
    background var(--dur-fast, 150ms) ease,
    transform var(--dur-fast, 150ms) ease;
}
.fx-support-inline:hover {
  border-color: var(--discord);
  color: #c9ceff;
  background: var(--discord-soft);
  text-decoration: none;
  transform: translateY(-1px);
}
.fx-support-inline .fx-discord-glyph { width: 15px; height: 15px; color: var(--discord); }

.fx-support-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--dur-fast, 150ms) ease;
}
.fx-support-footer-link:hover { color: #c9ceff; text-decoration: none; }
.fx-support-footer-link .fx-discord-glyph {
  width: 14px; height: 14px; color: var(--discord);
}

.fx-support-slot[hidden] { display: none !important; }
.fx-support-slot { margin-top: var(--space-3); }

@media (prefers-reduced-motion: reduce) {
  .fx-support,
  .fx-support-cta,
  .fx-support-cta::after { animation: none !important; }
  .fx-support-cta:hover,
  .fx-support-inline:hover { transform: none; }
}
