/*
 * Sistema visual do hub — escuro, inspirado no rails-tools-frontend.
 *
 * Escrito à mão de propósito: a interface tem uma dúzia de telas e nenhuma dependência
 * de node. Trazer um build de CSS para isso custaria mais manutenção do que economiza.
 *
 * Ordem: tokens → reset → tipografia → layout → componentes → telas.
 */

/* ---------------------------------------------------------------- tokens -- */
:root {
  --bg:            #0a0a0b;
  --bg-elevated:   #111113;
  --bg-panel:      #161616;

  --surface:       rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.05);
  --surface-solid: rgba(255, 255, 255, 0.06);

  --line:          rgba(255, 255, 255, 0.07);
  --line-strong:   rgba(255, 255, 255, 0.12);

  --text:          #ffffff;
  --text-soft:     rgba(255, 255, 255, 0.72);
  --text-muted:    rgba(255, 255, 255, 0.45);
  --text-faint:    rgba(255, 255, 255, 0.28);

  --accent:        #e44545;
  --accent-deep:   #b91c1c;
  --accent-soft:   rgba(228, 69, 69, 0.12);
  --accent-line:   rgba(228, 69, 69, 0.35);

  --success:       #4ade80;
  --success-soft:  rgba(74, 222, 128, 0.12);
  --warning:       #fbbf24;
  --warning-soft:  rgba(251, 191, 36, 0.12);
  --info:          #60a5fa;
  --info-soft:     rgba(96, 165, 250, 0.12);
  --danger:        #f87171;
  --danger-soft:   rgba(248, 113, 113, 0.12);

  --radius-sm:  8px;
  --radius:     12px;
  --radius-lg:  16px;
  --radius-xl:  20px;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "Roboto Mono", Menlo, Consolas, monospace;

  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
  --ease: 0.15s ease;
}

/* ----------------------------------------------------------------- reset -- */
*, *::before, *::after { box-sizing: border-box; }

/* Avisa o navegador que a página é escura.
 *
 * Sem isto, tudo que quem desenha é ele — o menu que abre no `select`, as barras de
 * rolagem, o preenchimento automático, os seletores de data — sai no claro, e um campo
 * escuro abre um popup branco. Não é CSS que a página aplica nesses pedaços: é o sistema
 * desenhando, e `color-scheme` é o único jeito de dizer a ele qual lado usar. */
html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
  accent-color: var(--accent);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }

img, svg { display: block; max-width: 100%; }

table { border-collapse: collapse; width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ------------------------------------------------------------ tipografia -- */
.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-muted);
}

.section-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.muted  { color: var(--text-muted); }
.faint  { color: var(--text-faint); }
.mono   { font-family: var(--font-mono); font-size: 12.5px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.nowrap { white-space: nowrap; }

.stack     { display: flex; flex-direction: column; gap: 20px; }
.stack-sm  { display: flex; flex-direction: column; gap: 10px; }
.row       { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.row-wrap  { flex-wrap: wrap; }
.grow      { flex: 1; min-width: 0; }
.truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- layout -- */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
  padding: 0 24px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 0 20px rgba(228, 69, 69, 0.28);
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-name span { color: var(--accent); }

.topnav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.topnav::-webkit-scrollbar { display: none; }

/* inline-flex porque o reset deixa `svg` como `display: block`, e sem isso o ícone
   quebraria para a linha de cima do rótulo. */
.topnav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: background var(--ease), color var(--ease);
}

.topnav a:hover { background: var(--surface-hover); color: var(--text-soft); }

.topnav a[aria-current="page"] {
  background: var(--surface-solid);
  color: var(--text);
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

/* ------------------------------------------------------------ user menu -- */
.usermenu { position: relative; flex-shrink: 0; }

.usermenu > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  list-style: none;
  transition: background var(--ease), border-color var(--ease);
}

.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover { background: var(--surface-hover); border-color: var(--line-strong); }

.avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.avatar-lg { width: 36px; height: 36px; font-size: 13px; }

.usermenu-name {
  font-size: 13px;
  font-weight: 550;
  max-width: 140px;
}

.usermenu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  padding: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--bg-panel);
  box-shadow: var(--shadow-lg);
  z-index: 120;
}

.usermenu-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.usermenu-panel a,
.usermenu-panel button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font-size: 13px;
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}

.usermenu-panel a:hover,
.usermenu-panel button:hover { background: var(--surface-hover); color: var(--text); }
.usermenu-panel .is-danger:hover { color: var(--danger); }

/* ----------------------------------------------------------------- card -- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-lg { padding: 32px; }
.card-sm { padding: 16px; border-radius: var(--radius); }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-head { padding: 20px 24px; margin: 0; border-bottom: 1px solid var(--line); }
.card-flush .card-foot { padding: 14px 24px; border-top: 1px solid var(--line); }

/* Esconder é o que o `reveal_controller` liga e desliga. A classe é o padrão dele —
   sem esta regra, o controlador alterna um nome que não faz nada e o trecho nasce
   aberto. */
.is-hidden { display: none; }

/* Cartão que abre e fecha. É `<details>`/`<summary>` de verdade, sem JavaScript: nasce
   fechado, o teclado já o alcança e o leitor de tela já anuncia o estado — coisas que um
   controlador nosso teria de reimplementar.
 *
 * O `<summary>` leva `card-head` no HTML e herda dali o espaçamento e a linha de baixo;
 * aqui fica só o que é de ser clicável. Redesenhar o espaçamento neste bloco foi
 * exatamente o que deixou o cabeçalho colado na borda. */
.card-collapsible > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

/* O triângulo que o navegador desenha sozinho; a seta ao lado faz esse papel, alinhada ao
   resto da interface. */
.card-collapsible > summary::-webkit-details-marker { display: none; }
.card-collapsible > summary::marker { content: ""; }

/* Fechado não há nada embaixo: a linha do cabeçalho viraria um risco solto no pé do
   cartão, e a margem, um vão. */
.card-collapsible:not([open]) > summary {
  border-bottom: none;
  margin-bottom: 0;
}

.card-collapsible > summary:hover { background: var(--surface-hover); }

.card-collapsible > summary:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: -3px;
}

.collapsible-mark {
  flex: none;
  margin-top: 2px;
  color: var(--text-muted);
  transform: rotate(90deg);
  transition: transform var(--ease);
}

.card-collapsible[open] > summary .collapsible-mark { transform: rotate(-90deg); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ------------------------------------------------------------- stat tile -- */
.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-hint { font-size: 12px; color: var(--text-faint); }

/* --------------------------------------------------------------- botões -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--ease), border-color var(--ease), color var(--ease), opacity var(--ease);
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: #d13c3c; }

.btn-secondary {
  background: var(--surface-solid);
  border-color: var(--line-strong);
  color: var(--text-soft);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }

.btn-ghost {
  background: none;
  color: var(--text-muted);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }

.btn-danger {
  background: var(--danger-soft);
  border-color: rgba(248, 113, 113, 0.25);
  color: var(--danger);
}
.btn-danger:hover:not(:disabled) { background: rgba(248, 113, 113, 0.18); }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-lg { padding: 12px 20px; font-size: 14.5px; }

.btn.is-copied { background: var(--success-soft); border-color: rgba(74, 222, 128, 0.3); color: var(--success); }

/* -------------------------------------------------------------- formulário -- */
.field { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.field-hint { font-size: 12px; color: var(--text-faint); }

.field-error { font-size: 12.5px; color: var(--danger); }

.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color var(--ease), background var(--ease);
}

.input::placeholder, .textarea::placeholder { color: var(--text-faint); }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent-line);
  background: rgba(255, 255, 255, 0.06);
}

.input.is-invalid, .select.is-invalid { border-color: rgba(248, 113, 113, 0.5); }

.select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23ffffff' stroke-opacity='0.4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* Quem escurece o menu do `select` é o `color-scheme` lá em cima — o popup é do sistema.
 * Isto aqui é o reforço para os navegadores que deixam a página pintar as opções; onde
 * não deixam, é ignorado sem prejuízo. */
.select option {
  background: var(--bg-panel);
  color: var(--text);
}

/* Seletor de cor em amostras (`shared/_color_picker`).
 *
 * Botões de opção com o círculo no lugar do controle. O input fica escondido mas presente
 * e focável — é ele que dá navegação por teclado e o nome da cor no leitor de tela. */
/* A altura acompanha a de um `.input` para que, numa linha de formulário alinhada pela
   base, o campo de cor e o campo de texto terminem no mesmo lugar — as bolinhas têm 22px
   e, sem isto, o campo de cor fica bem mais baixo que o vizinho. */
.swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-height: 44px;
}

.swatch { display: inline-flex; cursor: pointer; }

/* `opacity: 0` em vez de `display: none`: escondido assim o input continua recebendo
   foco, que é o que faz as setas do teclado andarem pelo grupo. */
.swatch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.swatch-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  transition: transform var(--ease), box-shadow var(--ease);
}

.swatch:hover .swatch-dot { transform: scale(1.12); }

/* Anel duplo: o primeiro é do fundo, e abre a folga que faz o segundo ler como anel em
   vez de borda grossa — necessário porque a bolinha já tem borda própria. */
.swatch input:checked + .swatch-dot {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.swatch input:focus-visible + .swatch-dot {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-line);
}

/* "sem cor" / "manter": a barra diagonal do símbolo de proibido, que é como um seletor de
   cor costuma dizer "nenhuma". */
.swatch-dot-none {
  background:
    linear-gradient(
      to top right,
      transparent calc(50% - 1px),
      var(--text-muted) calc(50% - 1px),
      var(--text-muted) calc(50% + 1px),
      transparent calc(50% + 1px)
    ),
    var(--surface-solid);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

/* Linha de formulário: campos lado a lado, botão no fim, tudo alinhado pela base.
 *
 * É classe, e não `style:` no `form_with`. Aquele ajudante aceita `class:` mas **descarta
 * `style:` em silêncio** — atributo solto tem de ir em `html: {}`. Foi assim que o
 * alinhamento sumiu sem erro nenhum: o CSS estava escrito, só nunca chegava ao HTML. */
.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.form-errors {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #fca5a5;
  font-size: 13px;
}

.form-errors ul { display: flex; flex-direction: column; gap: 3px; }

/* ---------------------------------------------------------------- toggle -- */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  user-select: none;
}

.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line-strong);
  transition: background var(--ease), border-color var(--ease);
  flex-shrink: 0;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  transition: transform var(--ease), background var(--ease);
}

.switch input:checked + .switch-track {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked + .switch-track::after {
  transform: translateX(18px);
  background: #fff;
}

.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent-line); outline-offset: 2px; }

.switch-label { font-size: 13.5px; font-weight: 550; }

/* ------------------------------------------------------- lista de marcar -- */
/*
  Caixas de seleção múltipla — os boards em que a atribuição age. Quebram em linha
  sozinhas, porque a quantidade vem dos boards da conta e não dá para prever.
*/
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13.5px;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------- badges -- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-on      { background: var(--success-soft); border-color: rgba(74, 222, 128, 0.25); color: var(--success); }
.badge-off     { background: rgba(255,255,255,0.05); border-color: var(--line-strong); color: var(--text-muted); }
.badge-warning { background: var(--warning-soft); border-color: rgba(251, 191, 36, 0.25); color: var(--warning); }
.badge-info    { background: var(--info-soft); border-color: rgba(96, 165, 250, 0.25); color: var(--info); }
.badge-accent  { background: var(--accent-soft); border-color: var(--accent-line); color: #f18a8a; }
.badge-danger  { background: var(--danger-soft); border-color: rgba(248, 113, 113, 0.25); color: var(--danger); }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.dot-pulse { animation: pulse 2s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ------------------------------------------------------------ app icons -- */
.appicon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.appicon-sm { width: 30px; height: 30px; border-radius: 9px; }
.appicon-fizzy  { background: var(--accent-soft); color: var(--accent); }
.appicon-github { background: rgba(255, 255, 255, 0.07); color: var(--text-soft); }

/* ----------------------------------------------------------------- lista -- */
.list { display: flex; flex-direction: column; }

.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  transition: background var(--ease);
}

.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-hover); }

.list-title { font-size: 13.5px; font-weight: 550; }
.list-meta  { font-size: 12px; color: var(--text-faint); margin-top: 1px; }

/* ---------------------------------------------------------------- tabela -- */
.table th {
  padding: 11px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: left;
}

.table td {
  padding: 13px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-hover); }
.table .col-right { text-align: right; }

.table-scroll { overflow-x: auto; }

/* ------------------------------------------------------------- URL box -- */
.urlbox {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.urlbox input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-soft);
}

.urlbox input:focus { outline: none; color: var(--text); }

/* ---------------------------------------------------------------- passos -- */
.steps { display: flex; flex-direction: column; gap: 0; }

.step {
  position: relative;
  display: flex;
  gap: 16px;
  padding-bottom: 24px;
}

.step:last-child { padding-bottom: 0; }

/* A linha que liga um passo ao seguinte. Fica atrás do círculo, que tem fundo sólido. */
.step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 28px;
  left: 13px;
  bottom: 4px;
  width: 1px;
  background: var(--line-strong);
}

.step-number {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-line);
  background: var(--bg);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-body { flex: 1; min-width: 0; padding-top: 2px; }
.step-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.step-text { font-size: 13.5px; color: var(--text-muted); line-height: 1.65; }
.step-text code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-soft);
}
.step-extra { margin-top: 12px; }

/* ----------------------------------------------------------- empty state -- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 56px 24px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-faint);
  margin-bottom: 4px;
}

.empty-title { font-size: 14.5px; font-weight: 600; }
.empty-text { font-size: 13px; color: var(--text-muted); max-width: 380px; }

/* --------------------------------------------------------------- alertas -- */
.flashes {
  position: fixed;
  top: 68px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(420px, calc(100vw - 48px));
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--bg-panel);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  animation: flash-in 0.2s ease;
}

.flash.is-leaving { opacity: 0; transform: translateX(8px); transition: opacity 0.2s, transform 0.2s; }

.flash-notice { border-color: rgba(74, 222, 128, 0.3); }
.flash-notice .flash-icon { color: var(--success); }
.flash-alert { border-color: rgba(248, 113, 113, 0.3); }
.flash-alert .flash-icon { color: var(--danger); }

.flash-icon { flex-shrink: 0; margin-top: 1px; }

.flash-close {
  border: 0;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.flash-close:hover { color: var(--text); }

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------- payload -- */
.payload {
  margin: 0;
  padding: 16px 20px;
  max-height: 460px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-soft);
  white-space: pre;
}

/* --------------------------------------------------- definições (chave/valor) -- */
.deflist { display: grid; grid-template-columns: minmax(140px, auto) 1fr; gap: 10px 20px; }
.deflist dt { font-size: 12.5px; color: var(--text-faint); }
.deflist dd { font-size: 13.5px; }

/* ------------------------------------------------------------- paginação -- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ----------------------------------------------------------- abas (tabs) -- */
.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.tabs a {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-muted);
  transition: background var(--ease), color var(--ease);
}

.tabs a:hover { color: var(--text-soft); }
.tabs a[aria-current="page"] { background: var(--surface-solid); color: var(--text); }

/* -------------------------------------------------------- telas de acesso -- */
.auth-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 48px 0;
}

/* Brilho e grade de fundo: decoração pura, fora do fluxo e sem captura de clique. */
.auth-glow,
.auth-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-glow {
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(228, 69, 69, 0.1) 0%, transparent 70%);
}

.auth-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
}

.auth-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
}

.auth-brand .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
.auth-brand .brand-name { font-size: 20px; }

.auth-heading { text-align: center; margin-bottom: 26px; }
.auth-heading h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.auth-heading p { margin-top: 4px; font-size: 14px; color: var(--text-muted); }

.auth-card {
  width: 100%;
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(12px);
}

.auth-footer {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-faint);
}

.auth-footer a {
  margin-left: 4px;
  color: var(--text-soft);
  text-decoration: underline;
}

.auth-footer a:hover { color: var(--text); }

/* ------------------------------------------------------------ responsivo -- */
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .topbar { gap: 14px; padding: 0 16px; }
  .brand-name { display: none; }
  .usermenu-name { display: none; }
  .app-main { padding: 26px 16px 60px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .list-item, .table th, .table td { padding-left: 16px; padding-right: 16px; }
  .card-flush .card-head, .card-flush .card-foot { padding-left: 16px; padding-right: 16px; }
  .card { padding: 20px; }
  .card-lg { padding: 22px; }
  .flashes { top: auto; bottom: 16px; right: 16px; left: 16px; max-width: none; }
  .deflist { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .deflist dd { margin-bottom: 12px; }
}

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