/* AF — Publicações (DJEN) — 15/08/2026 */

.afu-pagina {
  padding: 1.5rem;
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ---------- topo ---------- */
.afu-topo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.afu-titulo {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0;
  color: hsl(var(--foreground));
}
.afu-sub {
  margin: .25rem 0 0;
  font-size: .875rem;
  color: hsl(var(--muted-foreground));
  max-width: 60rem;
  line-height: 1.5;
}
.afu-topo-acoes {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.afu-ultima { font-size: .75rem; color: hsl(var(--muted-foreground)); }

/* ---------- botões ---------- */
.afu-btn, .afu-btn-sec {
  border-radius: 9999px;
  font-size: .8125rem;
  font-weight: 500;
  font-family: inherit;
  padding: .5rem 1rem;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: opacity .15s, background-color .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.afu-btn { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.afu-btn:hover:not(:disabled) { opacity: .9; }
.afu-btn:disabled, .afu-btn-sec:disabled { opacity: .45; cursor: default; }
.afu-btn-sec {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
  padding: .4375rem .875rem;
  font-size: .75rem;
}
.afu-btn-sec:hover:not(:disabled) { background: hsl(var(--muted)); }
.afu-perigo { color: hsl(var(--destructive)); }
.afu-perigo:hover:not(:disabled) { background: hsl(var(--destructive) / .1); }

/* ---------- filtros ---------- */
.afu-filtros {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border: 1px solid hsl(var(--border));
  border-radius: .75rem;
  background: hsl(var(--card));
  padding: .875rem 1rem;
}
.afu-chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.afu-chip {
  display: inline-flex;
  align-items: center;
  gap: .4375rem;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--muted-foreground));
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 500;
  padding: .375rem .875rem;
  cursor: pointer;
  transition: all .15s;
}
.afu-chip:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.afu-chip-ativo {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.afu-conta {
  font-size: .6875rem;
  font-weight: 700;
  border-radius: 9999px;
  padding: .0625rem .375rem;
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}
.afu-chip-ativo .afu-conta {
  background: hsl(var(--primary-foreground) / .2);
  color: hsl(var(--primary-foreground));
}

/* ---------- campos ---------- */
.afu-input {
  width: 100%;
  border-radius: .5rem;
  padding: .5rem .75rem;
  font-size: .875rem;
  font-family: inherit;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}
.afu-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / .25);
}
.afu-textarea { resize: vertical; line-height: 1.5; }
.afu-busca { max-width: 26rem; min-width: 14rem; flex: 1; }
.afu-campo { display: flex; flex-direction: column; gap: .3125rem; min-width: 0; }
.afu-label { font-size: .8125rem; font-weight: 500; color: hsl(var(--foreground)); }
.afu-linha2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* ---------- lista ---------- */
.afu-lista { display: flex; flex-direction: column; gap: 1rem; }
.afu-vazio {
  color: hsl(var(--muted-foreground));
  font-size: .875rem;
  padding: 2rem 0;
  text-align: center;
}

/* ---------- cartão ---------- */
.afu-cartao {
  border: 1px solid hsl(var(--border));
  border-left: 4px solid hsl(var(--primary));
  border-radius: .75rem;
  background: hsl(var(--card));
  padding: 1rem 1.125rem 1.125rem;
}
.afu-cartao.afu-lida { border-left-color: hsl(var(--border)); }
.afu-cartao.afu-descartada { opacity: .55; }

.afu-cabeca {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .625rem;
}
.afu-cabeca-texto h3 {
  margin: 0;
  font-size: .9375rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  line-height: 1.35;
}
.afu-orgao {
  margin: .125rem 0 0;
  font-size: .75rem;
  color: hsl(var(--muted-foreground));
}
.afu-cabeca-tags { display: flex; gap: .375rem; flex-wrap: wrap; align-items: center; }

.afu-etiqueta {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  padding: .125rem .625rem;
  white-space: nowrap;
}
.afu-link { cursor: pointer; font-family: inherit; }
.afu-link:hover { filter: brightness(.95); }

.afu-s-nova { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.afu-s-analise { background: #fefce8; color: #a16207; border-color: #fef08a; }
.afu-s-tratada { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.afu-s-descartada { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.afu-s-lida { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.afu-s-nao-lida { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.afu-s-vinc { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.afu-s-sem-vinc { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.dark .afu-s-nova { background: rgba(29,78,216,.16); color: #93c5fd; border-color: rgba(29,78,216,.4); }
.dark .afu-s-analise { background: rgba(161,98,7,.16); color: #fde68a; border-color: rgba(161,98,7,.4); }
.dark .afu-s-tratada { background: rgba(4,120,87,.16); color: #6ee7b7; border-color: rgba(4,120,87,.4); }
.dark .afu-s-descartada,
.dark .afu-s-lida { background: rgba(100,116,139,.16); color: #cbd5e1; border-color: rgba(100,116,139,.4); }
.dark .afu-s-nao-lida { background: rgba(194,65,12,.16); color: #fdba74; border-color: rgba(194,65,12,.4); }
.dark .afu-s-vinc { background: rgba(4,120,87,.16); color: #6ee7b7; border-color: rgba(4,120,87,.4); }
.dark .afu-s-sem-vinc { background: rgba(185,28,28,.16); color: #fca5a5; border-color: rgba(185,28,28,.4); }

.afu-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.5rem;
  margin: 0 0 .625rem;
}
.afu-meta > div { display: flex; gap: .375rem; align-items: baseline; }
.afu-meta dt {
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: hsl(var(--muted-foreground));
  margin: 0;
}
.afu-meta dd {
  margin: 0;
  font-size: .8125rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.afu-texto {
  font-size: .8125rem;
  line-height: 1.6;
  color: hsl(var(--foreground));
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.afu-texto-curto {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.afu-ver-mais {
  background: none;
  border: 0;
  padding: .25rem 0 0;
  font-family: inherit;
  font-size: .75rem;
  font-weight: 500;
  color: hsl(var(--primary));
  cursor: pointer;
}
.afu-ver-mais:hover { text-decoration: underline; }

.afu-partes { margin-top: .625rem; }
.afu-partes summary {
  cursor: pointer;
  font-size: .75rem;
  color: hsl(var(--muted-foreground));
}
.afu-partes summary:hover { color: hsl(var(--foreground)); }
.afu-partes-corpo p {
  margin: .375rem 0 0;
  font-size: .75rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
  overflow-wrap: anywhere;
}

.afu-assinatura {
  margin: .625rem 0 0;
  font-size: .6875rem;
  color: hsl(var(--muted-foreground));
}

.afu-obs {
  margin: .625rem 0 0;
  padding: .5rem .75rem;
  border-radius: .5rem;
  background: hsl(var(--muted) / .5);
  font-size: .8125rem;
  line-height: 1.5;
  color: hsl(var(--foreground));
  cursor: pointer;
}
.afu-obs-editor { margin-top: .625rem; display: flex; flex-direction: column; gap: .5rem; }

.afu-acoes {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: .875rem;
  padding-top: .875rem;
  border-top: 1px solid hsl(var(--border));
}
.afu-espaco { flex: 1 1 auto; }

/* ---------- modal ---------- */
.afu-modal-fundo {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 60;
}
.afu-modal {
  width: 100%;
  max-width: 34rem;
  max-height: 85vh;
  overflow: auto;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: .875rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  box-shadow: 0 20px 45px rgba(0,0,0,.25);
}
.afu-modal-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.afu-modal-topo h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.afu-modal-sub {
  margin: 0;
  font-size: .8125rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}
.afu-x {
  background: none;
  border: 0;
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  padding: 0 .25rem;
}
.afu-x:hover { color: hsl(var(--foreground)); }

.afu-modal-lista {
  display: flex;
  flex-direction: column;
  gap: .375rem;
  max-height: 22rem;
  overflow: auto;
}
.afu-opcao {
  display: flex;
  flex-direction: column;
  gap: .125rem;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  border: 1px solid hsl(var(--border));
  border-radius: .5rem;
  background: hsl(var(--background));
  padding: .5rem .75rem;
  cursor: pointer;
  font-family: inherit;
}
.afu-opcao:hover:not(:disabled) { background: hsl(var(--muted)); }
.afu-opcao strong { font-size: .8125rem; color: hsl(var(--foreground)); }
.afu-opcao span { font-size: .75rem; color: hsl(var(--muted-foreground)); }
.afu-desvincular { align-self: flex-start; }

.afu-modal-acoes { display: flex; gap: .5rem; justify-content: flex-end; }

/* ---------- cartão do dashboard ---------- */
.afu-dash {
  display: flex;
  flex-direction: column;
  gap: .375rem;
  align-items: stretch;
  text-align: left;
  width: 100%;
  border: 1px solid hsl(var(--border));
  border-radius: .75rem;
  background: hsl(var(--card));
  padding: 1rem 1.125rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.afu-dash:hover {
  border-color: hsl(var(--primary) / .5);
  box-shadow: 0 2px 12px hsl(var(--primary) / .1);
}
.afu-dash-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.afu-dash-rotulo {
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: hsl(var(--muted-foreground));
}
.afu-dash-seta { color: hsl(var(--muted-foreground)); font-size: 1.125rem; line-height: 1; }
.afu-dash-numero { display: flex; align-items: baseline; gap: .4375rem; }
.afu-dash-numero strong {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1;
  color: hsl(var(--foreground));
}
.afu-dash-numero strong.afu-dash-alerta { color: hsl(var(--primary)); }
.afu-dash-numero span { font-size: .8125rem; color: hsl(var(--muted-foreground)); }
.afu-dash-extra { margin: 0; font-size: .75rem; color: hsl(var(--muted-foreground)); }

/* ---------- configurações ---------- */
.afu-config {
  border: 1px solid hsl(var(--border));
  border-radius: .75rem;
  background: hsl(var(--card));
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.afu-config-cabeca h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.afu-config-cabeca p {
  margin: .25rem 0 0;
  font-size: .8125rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.55;
  max-width: 52rem;
}
.afu-config-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: .875rem;
}
.afu-check {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .8125rem;
  color: hsl(var(--foreground));
  line-height: 1.5;
  cursor: pointer;
}
.afu-check input { margin-top: .1875rem; }
.afu-config-nota {
  margin: 0;
  font-size: .75rem;
  color: hsl(var(--muted-foreground));
}
.afu-config .afu-btn { align-self: flex-start; }

@media (max-width: 860px) {
  .afu-config-grid { grid-template-columns: 1fr; }
  .afu-linha2 { grid-template-columns: 1fr; }
  .afu-pagina { padding: 1rem; }
  .afu-busca { max-width: none; }
  .afu-acoes .afu-espaco { display: none; }
}

/* ---------- feedback de clique nos botões ---------- */
.afu-btn:active:not(:disabled),
.afu-btn-sec:active:not(:disabled),
.afu-chip:active,
.afu-mini:active {
  transform: translateY(1px) scale(.985);
  filter: brightness(.94);
}
.afu-btn:focus-visible,
.afu-btn-sec:focus-visible,
.afu-chip:focus-visible,
.afu-mini:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring) / .45);
}

.afu-btn-ok {
  background: #059669;
  color: #ffffff;
}
.dark .afu-btn-ok { background: #10b981; color: #052e21; }

.afu-concluir {
  color: #047857;
  border-color: #a7f3d0;
  font-weight: 600;
}
.afu-concluir:hover:not(:disabled) { background: #ecfdf5; }
.dark .afu-concluir { color: #6ee7b7; border-color: rgba(4,120,87,.5); }
.dark .afu-concluir:hover:not(:disabled) { background: rgba(4,120,87,.18); }

/* ---------- período ---------- */
.afu-periodo {
  display: flex;
  align-items: center;
  gap: .4375rem;
  flex-wrap: wrap;
  width: 100%;
  padding-top: .75rem;
  margin-top: .125rem;
  border-top: 1px solid hsl(var(--border));
}
.afu-periodo-rotulo {
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin-right: .125rem;
}
.afu-periodo-ate { font-size: .75rem; color: hsl(var(--muted-foreground)); }
.afu-data {
  width: auto;
  min-width: 9.5rem;
  padding: .3125rem .5rem;
  font-size: .8125rem;
}
.afu-mini {
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--muted-foreground));
  font-family: inherit;
  font-size: .6875rem;
  font-weight: 500;
  padding: .25rem .625rem;
  cursor: pointer;
  transition: all .15s;
}
.afu-mini:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.afu-mini-ativo {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.afu-mini-limpar { margin-left: auto; }

.afu-resultado {
  margin: -.375rem 0 0;
  font-size: .75rem;
  color: hsl(var(--muted-foreground));
}

/* ---------- menu lateral arrastável ---------- */
[data-sidebar="menu"] > li[draggable="true"] { cursor: grab; }
[data-sidebar="menu"] > li[draggable="true"]:active { cursor: grabbing; }
[data-sidebar="menu"] > li.afm-arrastando { opacity: .4; }
[data-sidebar="menu"] > li.afm-alvo {
  box-shadow: inset 0 2px 0 0 hsl(var(--primary));
  border-radius: .375rem;
}

/* ---------- benefícios da execução ---------- */
.afb-painel { display: flex; flex-direction: column; gap: 1rem; }

.afb-resumo {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}
.afb-resumo-item {
  display: flex;
  flex-direction: column;
  gap: .125rem;
  border: 1px solid hsl(var(--border));
  border-radius: .625rem;
  background: hsl(var(--muted) / .35);
  padding: .625rem .75rem;
}
.afb-resumo-item span {
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: hsl(var(--muted-foreground));
}
.afb-resumo-item strong {
  font-size: 1rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  font-variant-numeric: tabular-nums;
}

.afb-datas { margin: 0; font-size: .75rem; color: hsl(var(--muted-foreground)); }
.afb-aviso {
  margin: 0;
  font-size: .8125rem;
  line-height: 1.5;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: .5rem;
  padding: .5rem .75rem;
}
.dark .afb-aviso { color: #fcd34d; background: rgba(180,83,9,.12); border-color: rgba(180,83,9,.4); }

.afb-cartoes { display: flex; flex-direction: column; gap: .75rem; }

.afb-cartao {
  border: 1px solid hsl(var(--border));
  border-left: 4px solid hsl(var(--primary));
  border-radius: .75rem;
  background: hsl(var(--card));
  padding: .875rem 1rem 1rem;
}
.afb-cartao.afb-atingido { border-left-color: #059669; }

.afb-cartao-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.afb-cartao-topo h4 {
  margin: 0;
  font-size: .9375rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.afb-portal {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .6875rem;
  font-weight: 500;
  border: 1px solid hsl(var(--border));
  border-radius: 9999px;
  padding: .1875rem .5rem .1875rem .375rem;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  user-select: none;
}
.afb-portal:hover { background: hsl(var(--muted)); }
.afb-portal input { margin: 0; cursor: pointer; }
.afb-portal-on { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.dark .afb-portal-on { color: #6ee7b7; border-color: rgba(4,120,87,.5); background: rgba(4,120,87,.15); }

.afb-data {
  margin: .375rem 0 .25rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: hsl(var(--foreground));
  font-variant-numeric: tabular-nums;
}

.afb-selo {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  padding: .1875rem .625rem;
  background: #fef3c7;
  color: #92400e;
}
.afb-selo-ok { background: #d1fae5; color: #065f46; }
.dark .afb-selo { background: rgba(146,64,14,.2); color: #fcd34d; }
.dark .afb-selo-ok { background: rgba(6,95,70,.25); color: #6ee7b7; }

.afb-conta {
  margin: .5rem 0 0;
  font-size: .75rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
}
.afb-conta-fraca { opacity: .8; font-size: .6875rem; }

@media (max-width: 900px) {
  .afb-resumo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .afb-resumo { grid-template-columns: 1fr; }
  .afb-data { font-size: 1.5rem; }
}

.afu-modal-motivo {
  margin: 0;
  font-size: .8125rem;
  line-height: 1.5;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: .5rem;
  padding: .5rem .75rem;
}
.dark .afu-modal-motivo { color: #fcd34d; background: rgba(146,64,14,.15); border-color: rgba(146,64,14,.45); }
