/* AF — Check-list de possíveis direitos (aba na ficha) — 13/08/2026
   rev. c — menu de impressão não escapa mais da tela no celular */

.afc-wrap { display: flex; flex-direction: column; gap: 1rem; }

.afc-cabecalho {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.afc-titulo { font-size: 1.125rem; font-weight: 600; color: hsl(var(--foreground)); margin: 0; }
.afc-sub { font-size: .8125rem; color: hsl(var(--muted-foreground)); margin: .25rem 0 0; }
.afc-acoes-topo { display: flex; gap: .5rem; flex-wrap: wrap; }

.afc-btn, .afc-btn-sec {
  border-radius: 9999px; font-size: .875rem; font-weight: 500;
  padding: .5rem 1rem; cursor: pointer; border: 1px solid transparent;
  transition: opacity .15s, background-color .15s; white-space: nowrap;
}
.afc-btn { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.afc-btn:hover:not(:disabled) { opacity: .9; }
.afc-btn:disabled { opacity: .45; cursor: default; }
.afc-btn-sec {
  background: hsl(var(--background)); color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.afc-btn-sec:hover { background: hsl(var(--muted)); }

.afc-erro {
  border: 1px solid hsl(var(--destructive) / .35);
  background: hsl(var(--destructive) / .08);
  color: hsl(var(--destructive));
  border-radius: .5rem; padding: .75rem 1rem; font-size: .875rem;
}

/* ---------- resumo ---------- */
.afc-resumo {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding-bottom: .25rem;
}
.afc-pill {
  font-size: .75rem; padding: .1875rem .625rem; border-radius: 9999px;
  border: 1px solid hsl(var(--border)); background: hsl(var(--muted));
  color: hsl(var(--muted-foreground)); white-space: nowrap;
}
.afc-pill-sim {
  background: hsl(142 70% 45% / .12); color: hsl(142 70% 30%);
  border-color: hsl(142 70% 45% / .35);
}
.dark .afc-pill-sim { color: hsl(142 70% 62%); }
.afc-pill-nao { background: transparent; }

.afc-filtro {
  display: flex; align-items: center; gap: .375rem; cursor: pointer;
  font-size: .75rem; color: hsl(var(--muted-foreground)); margin-left: auto;
}
.afc-filtro input { width: .875rem; height: .875rem; cursor: pointer; }

.afc-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: .75rem; color: hsl(var(--muted-foreground));
}
.afc-link:hover { color: hsl(var(--destructive)); text-decoration: underline; }

/* ---------- grupos ---------- */
.afc-grupos { display: flex; flex-direction: column; gap: 1.25rem; }
.afc-grupo-titulo {
  font-size: .6875rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: hsl(var(--muted-foreground));
  margin: 0 0 .5rem; padding-bottom: .3125rem;
  border-bottom: 1px solid hsl(var(--border));
}
.afc-itens { display: flex; flex-direction: column; }

.afc-item {
  border-bottom: 1px solid hsl(var(--border) / .6);
  padding: .4375rem 0 .4375rem .5rem;
  border-left: 3px solid transparent;
  transition: background-color .12s, border-color .12s;
}
.afc-item:hover { background: hsl(var(--muted) / .45); }
.afc-sim { border-left-color: hsl(142 70% 45%); background: hsl(142 70% 45% / .06); }
.afc-nao { opacity: .58; }

.afc-linha { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.afc-rotulo { font-size: .875rem; color: hsl(var(--foreground)); line-height: 1.35; }
.afc-controles { display: flex; align-items: center; gap: .25rem; flex: 0 0 auto; }

.afc-op {
  min-width: 3rem; border-radius: .375rem; cursor: pointer;
  font-size: .75rem; font-weight: 500; padding: .25rem .5rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background)); color: hsl(var(--muted-foreground));
  transition: all .12s;
}
.afc-op:hover { border-color: hsl(var(--foreground) / .35); color: hsl(var(--foreground)); }
.afc-op-sim {
  background: hsl(142 70% 45%); border-color: hsl(142 70% 45%); color: #fff;
}
.afc-op-sim:hover { color: #fff; }
.afc-op-nao {
  background: hsl(var(--muted-foreground) / .8);
  border-color: hsl(var(--muted-foreground) / .8); color: hsl(var(--background));
}
.afc-op-nao:hover { color: hsl(var(--background)); }

.afc-nota {
  border-radius: .375rem; cursor: pointer; font-size: .6875rem;
  padding: .25rem .5rem; border: 1px dashed hsl(var(--border));
  background: transparent; color: hsl(var(--muted-foreground));
}
.afc-nota:hover { border-color: hsl(var(--foreground) / .35); color: hsl(var(--foreground)); }
.afc-nota-cheia {
  border-style: solid; border-color: hsl(38 92% 50% / .5);
  background: hsl(38 92% 50% / .12); color: hsl(var(--foreground));
}

.afc-obs {
  width: 100%; margin-top: .375rem; border-radius: .375rem;
  padding: .375rem .5rem; font-size: .8125rem; font-family: inherit;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background)); color: hsl(var(--foreground));
}
.afc-obs:focus { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 2px hsl(var(--ring) / .2); }

/* ---------- observações gerais ---------- */
.afc-geral { display: flex; flex-direction: column; gap: .375rem; margin-top: .5rem; }
.afc-label { font-size: .8125rem; font-weight: 500; color: hsl(var(--foreground)); }
.afc-textarea {
  width: 100%; border-radius: .5rem; padding: .5rem .625rem;
  font-size: .875rem; font-family: inherit; line-height: 1.5; resize: vertical;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background)); color: hsl(var(--foreground));
}
.afc-textarea:focus { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 2px hsl(var(--ring) / .2); }

.afc-vazio { font-size: .875rem; color: hsl(var(--muted-foreground)); margin: 0; }

/* ---------- barra de alterações não salvas ---------- */
.afc-barra {
  position: sticky; bottom: 1rem; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border: 1px solid hsl(var(--border)); border-radius: 9999px;
  background: hsl(var(--background)); padding: .5rem .5rem .5rem 1.125rem;
  box-shadow: 0 10px 30px hsl(0 0% 0% / .18);
  font-size: .8125rem; color: hsl(var(--muted-foreground));
  margin-top: .5rem;
}

@media (max-width: 640px) {
  .afc-linha { flex-direction: column; align-items: flex-start; gap: .375rem; }
  .afc-controles { align-self: stretch; }
  .afc-op { flex: 1; }
  .afc-filtro { margin-left: 0; }
}

/* ---------- menu de impressão ---------- */
.afc-menu-wrap { position: relative; }
/* O menu nasce alinhado ao botão "Imprimir". No celular o botão fica junto da
   borda esquerda, então o menu é ancorado à esquerda e limitado à largura da
   tela — antes ele abria ancorado à direita e escapava para fora do visor. */
.afc-menu {
  position: absolute; top: calc(100% + .375rem); left: 0; right: auto; z-index: 40;
  display: flex; flex-direction: column;
  min-width: min(17rem, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  border: 1px solid hsl(var(--border)); border-radius: .625rem;
  background: hsl(var(--background));
  box-shadow: 0 12px 32px hsl(0 0% 0% / .22); overflow: hidden;
}

/* em tela grande o botão fica no canto direito do cartão, então o menu
   continua abrindo para a esquerda, como antes */
@media (min-width: 641px) {
  .afc-menu { left: auto; right: 0; }
}
.afc-menu button {
  display: flex; flex-direction: column; gap: .125rem; align-items: flex-start;
  text-align: left; background: none; border: 0; cursor: pointer;
  padding: .625rem .875rem; font-family: inherit; color: hsl(var(--foreground));
}
.afc-menu button + button { border-top: 1px solid hsl(var(--border)); }
.afc-menu button:hover { background: hsl(var(--muted)); }
.afc-menu-t { font-size: .875rem; font-weight: 500; }
.afc-menu-d { font-size: .75rem; color: hsl(var(--muted-foreground)); }
