/* af-custodia-20260927.css — aba "Cadeia de Custódia" da ficha do assistido (add-on af-custodia-20260927.js) */
.afcc-oculto { display: none !important; }
[data-af-custodia][data-afcc-n]:not([data-afcc-n=""])::after { content: attr(data-afcc-n); margin-left: .4rem; min-width: 1.15rem; height: 1.15rem;
  padding: 0 .3rem; border-radius: 999px; font-size: .68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }

.afcc-painel *, .afcc-painel *::before { box-sizing: border-box; }
.afcc-painel { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; color: hsl(var(--foreground)); }
.afcc-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.afcc-h3 { font-size: 1.125rem; font-weight: 600; margin: 0; }
.afcc-h4 { font-size: .95rem; font-weight: 600; margin: 0 0 .25rem; }
.afcc-sub { font-size: .82rem; color: hsl(var(--muted-foreground)); margin: .25rem 0 0; max-width: 46rem; }
.afcc-dica { font-size: .78rem; color: hsl(var(--muted-foreground)); margin: 0 0 .5rem; }
.afcc-carregando { font-size: .85rem; color: hsl(var(--muted-foreground)); padding: .5rem 0; }
.afcc-erro { color: #b91c1c !important; }
:is(.dark *) .afcc-erro { color: #fca5a5 !important; }

.afcc-btn { padding: .45rem .9rem; border-radius: .6rem; border: 1px solid hsl(var(--border)); background: hsl(var(--background));
  font-size: .82rem; font-weight: 500; cursor: pointer; color: hsl(var(--foreground)); white-space: nowrap; }
.afcc-btn:hover { background: hsl(var(--muted)); }
.afcc-btn:disabled { opacity: .6; cursor: default; }
.afcc-btn-pri { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
.afcc-btn-pri:hover { background: hsl(var(--primary)); opacity: .9; }
.afcc-btn-perigo { color: #b91c1c; border-color: #fca5a5; }
:is(.dark *) .afcc-btn-perigo { color: #fca5a5; border-color: rgba(248, 113, 113, .45); }
.afcc-acoes { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.afcc-fim { justify-content: flex-end; }
.afcc-salvo { font-size: .75rem; color: hsl(var(--muted-foreground)); align-self: center; }
.afcc-salvando { font-style: italic; }

.afcc-bloco { border: 1px solid hsl(var(--border)); border-radius: 1rem; background: hsl(var(--card)); padding: 1rem 1.1rem; }
.afcc-det { padding: 0; }
.afcc-det > summary { cursor: pointer; padding: .85rem 1.1rem; font-weight: 600; font-size: .92rem; list-style: none; }
.afcc-det > summary::-webkit-details-marker { display: none; }
.afcc-det > summary::before, .afcc-etapa > summary::before { content: "▸"; display: inline-block; width: 1.1rem; color: hsl(var(--muted-foreground)); transition: transform .15s; }
.afcc-det[open] > summary::before, .afcc-etapa[open] > summary::before { transform: rotate(90deg); }
.afcc-det > :not(summary) { margin-left: 1.1rem; margin-right: 1.1rem; }
.afcc-det > :last-child { margin-bottom: 1rem; }

.afcc-novabox:empty { display: none; }
.afcc-nova { border: 1px dashed hsl(var(--border)); border-radius: 1rem; padding: 1rem; display: grid; gap: .75rem; background: hsl(var(--card)); }
.afcc-campo { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.afcc-campo > span { font-size: .75rem; font-weight: 600; color: hsl(var(--muted-foreground)); }
.afcc-inp { box-sizing: border-box; width: 100%; min-width: 0; padding: .45rem .65rem; border-radius: .45rem; border: 1px solid hsl(var(--input, var(--border)));
  background: hsl(var(--background)); color: hsl(var(--foreground)); font-size: .85rem; font-family: inherit; }
select.afcc-inp { height: 2.3rem; }
textarea.afcc-inp { resize: vertical; line-height: 1.4; }
.afcc-grade { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.afcc-grade-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.afcc-larg2 { grid-column: span 2; }
.afcc-larg3 { grid-column: 1 / -1; }
@media (max-width: 900px) { .afcc-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .afcc-grade, .afcc-grade-3 { grid-template-columns: minmax(0, 1fr); } .afcc-larg2, .afcc-larg3 { grid-column: auto; } }

.afcc-vazio { border: 1px dashed hsl(var(--border)); border-radius: 1rem; padding: 1.25rem; text-align: center; }
.afcc-vazio p { margin: 0 0 .35rem; }
.afcc-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: .75rem; }
.afcc-cartao { display: flex; flex-direction: column; gap: .4rem; text-align: left; padding: .9rem 1rem; border-radius: 1rem;
  border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--foreground)); cursor: pointer; }
.afcc-cartao:hover { border-color: hsl(var(--primary)); }
.afcc-cartao-topo { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.afcc-cartao-tit { font-weight: 600; font-size: .92rem; margin-right: auto; overflow-wrap: anywhere; }
.afcc-cartao-sub, .afcc-cartao-pe { font-size: .75rem; color: hsl(var(--muted-foreground)); overflow-wrap: anywhere; }

.afcc-pill { font-size: .7rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; white-space: nowrap; }
.afcc-pill-falha { background: #fee2e2; color: #991b1b; }
.afcc-pill-duv { background: #fef3c7; color: #92400e; }
:is(.dark *) .afcc-pill-falha { background: rgba(239, 68, 68, .18); color: #fca5a5; }
:is(.dark *) .afcc-pill-duv { background: rgba(245, 158, 11, .18); color: #fcd34d; }
.afcc-apagado { opacity: .4; }
.afcc-barra { height: .35rem; border-radius: 999px; background: hsl(var(--muted)); overflow: hidden; width: 100%; }
.afcc-barra > span { display: block; height: 100%; background: hsl(var(--primary)); border-radius: 999px; transition: width .2s; }

.afcc-resumo { display: flex; flex-direction: column; gap: .75rem; }
.afcc-resumo-txt { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .88rem; }
.afcc-resumo-txt .afcc-barra { flex-basis: 100%; }

.afcc-alertas { display: flex; flex-direction: column; gap: .4rem; margin-top: .75rem; }
.afcc-alertas:empty { display: none; }
.afcc-alerta { font-size: .8rem; padding: .45rem .7rem; border-radius: .5rem; background: hsl(var(--muted)); }
.afcc-alerta-forte { background: #fef3c7; color: #92400e; }
:is(.dark *) .afcc-alerta-forte { background: rgba(245, 158, 11, .15); color: #fcd34d; }

.afcc-etapas { display: flex; flex-direction: column; gap: .6rem; }
.afcc-etapa { border: 1px solid hsl(var(--border)); border-radius: 1rem; background: hsl(var(--card)); overflow: hidden; }
.afcc-etapa > summary { cursor: pointer; display: flex; align-items: baseline; gap: .5rem; padding: .8rem 1.1rem; font-weight: 600; font-size: .9rem; list-style: none; }
.afcc-etapa > summary::-webkit-details-marker { display: none; }
.afcc-etapa > summary > span:first-of-type { flex: 1; }
.afcc-cont { font-size: .72rem; font-weight: 600; color: hsl(var(--muted-foreground)); white-space: nowrap; }
.afcc-cont-falha { color: #b91c1c; }
.afcc-cont-ok { color: #15803d; }
:is(.dark *) .afcc-cont-falha { color: #fca5a5; }
:is(.dark *) .afcc-cont-ok { color: #86efac; }
.afcc-etapa-sub { font-size: .78rem; color: hsl(var(--muted-foreground)); margin: -.3rem 1.1rem .5rem 2.2rem; }
.afcc-item { border-top: 1px solid hsl(var(--border)); padding: .75rem 1.1rem .75rem 2.2rem; display: flex; flex-direction: column; gap: .4rem;
  border-left: 3px solid transparent; }
.afcc-s-ok { border-left-color: #22c55e; }
.afcc-s-falha { border-left-color: #ef4444; background: rgba(239, 68, 68, .05); }
.afcc-s-duvida { border-left-color: #f59e0b; }
.afcc-s-na { opacity: .6; }
.afcc-q { font-size: .87rem; line-height: 1.4; }
.afcc-f { font-size: .74rem; color: hsl(var(--muted-foreground)); }
.afcc-d { font-size: .78rem; line-height: 1.4; padding: .5rem .7rem; border-radius: .5rem; background: hsl(var(--muted)); }
.afcc-ops { display: flex; flex-wrap: wrap; gap: .35rem; }
.afcc-op { font-size: .74rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; border: 1px solid hsl(var(--border));
  background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; }
.afcc-op:hover { background: hsl(var(--muted)); }
.afcc-op-ok.afcc-op-on { background: #dcfce7; color: #166534; border-color: #86efac; }
.afcc-op-falha.afcc-op-on { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.afcc-op-duvida.afcc-op-on { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.afcc-op-na.afcc-op-on { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
:is(.dark *) .afcc-op-ok.afcc-op-on { background: rgba(34, 197, 94, .18); color: #86efac; border-color: rgba(34, 197, 94, .45); }
:is(.dark *) .afcc-op-falha.afcc-op-on { background: rgba(239, 68, 68, .18); color: #fca5a5; border-color: rgba(239, 68, 68, .45); }
:is(.dark *) .afcc-op-duvida.afcc-op-on { background: rgba(245, 158, 11, .18); color: #fcd34d; border-color: rgba(245, 158, 11, .45); }
.afcc-op-dica { border-style: dashed; font-weight: 500; }
.afcc-anot { display: flex; gap: .5rem; align-items: flex-start; }
.afcc-fls { width: 5.5rem !important; flex: 0 0 auto; font-size: .78rem; padding: .3rem .5rem; }
.afcc-nota { flex: 1; font-size: .8rem; padding: .3rem .55rem; min-height: 1.9rem; }
.afcc-item:not(.afcc-s-ok):not(.afcc-s-falha):not(.afcc-s-duvida):not(.afcc-s-na) .afcc-anot { opacity: .75; }
.afcc-obs { min-height: 5rem; }

.afcc-ref { display: flex; flex-direction: column; gap: .6rem; }
.afcc-ref-g { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: hsl(var(--muted-foreground)); margin-top: .6rem; }
.afcc-ul { margin: .3rem 0 .4rem 1.1rem; padding: 0; font-size: .82rem; line-height: 1.45; list-style: disc; }
.afcc-ul li { margin: .15rem 0; }
.afcc-aviso { font-size: .76rem; padding: .45rem .7rem; border-radius: .5rem; background: #fef3c7; color: #92400e; margin: 0 1.1rem .4rem; }
:is(.dark *) .afcc-aviso { background: rgba(245, 158, 11, .15); color: #fcd34d; }
