/* AF CRM — Esteira Jurídica (25/09/2026) — visual igual ao Funil */
:root {
  --afs-col: #f8f6f3; --afs-col-borda: #e4ded5; --afs-card: #fff; --afs-card-borda: #e8e2d9;
  --afs-tx: hsl(var(--foreground)); --afs-sub: hsl(var(--muted-foreground)); --afs-laranja: #ea580c;
}
:is(.dark *) { --afs-col: hsl(var(--muted) / .45); --afs-col-borda: hsl(var(--border)); --afs-card: hsl(var(--card)); --afs-card-borda: hsl(var(--border)); }
.dark { --afs-col: hsl(var(--muted) / .45); --afs-col-borda: hsl(var(--border)); --afs-card: hsl(var(--card)); --afs-card-borda: hsl(var(--border)); }

.afs-oculto-rota { display: none !important; }
.afs-sair-oculto { display: none !important; }
.afs-pagina { display: flex; flex-direction: column; min-width: 0; min-height: 0; flex: 1 1 auto; height: calc(100vh - 4rem); background: hsl(var(--background)); color: var(--afs-tx); }
.afs-topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem .5rem; flex-wrap: wrap; }
.afs-titulo h1 { font-size: 1.6rem; font-weight: 800; margin: 0; line-height: 1.1; letter-spacing: -.01em; }
.afs-titulo p { margin: .2rem 0 0; font-size: .85rem; color: var(--afs-sub); }
.afs-topo-acoes { display: flex; gap: .5rem; }
.afs-filtros { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .5rem 1.25rem .75rem; border-bottom: 1px solid hsl(var(--border)); }
.afs-busca { flex: 1 1 260px; max-width: 420px; }
.afs-sel { flex: 0 1 190px; }
.afs-chk { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--afs-tx); cursor: pointer; white-space: nowrap; }
.afs-chk input { accent-color: var(--afs-laranja); width: 15px; height: 15px; }

.afs-campo {
  width: 100%; box-sizing: border-box; min-height: 2.35rem; padding: .45rem .7rem; border-radius: .6rem;
  border: 1px solid hsl(var(--border)); background: hsl(var(--background)); color: hsl(var(--foreground)); font: inherit; font-size: .875rem;
}
.afs-campo:focus { outline: none; border-color: var(--afs-laranja); box-shadow: 0 0 0 3px rgba(234, 88, 12, .16); }
.afs-area { resize: vertical; min-height: 4.5rem; line-height: 1.4; }
.afs-bt {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; height: 2.35rem; padding: 0 .95rem;
  border-radius: .6rem; border: 1px solid hsl(var(--border)); font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.afs-bt:disabled { opacity: .55; cursor: default; }
.afs-bt-pri { background: var(--afs-laranja); border-color: var(--afs-laranja); color: #fff; }
.afs-bt-pri:hover:not(:disabled) { background: #c2410c; border-color: #c2410c; }
.afs-bt-sec { background: hsl(var(--background)); color: hsl(var(--foreground)); }
.afs-bt-sec:hover { background: hsl(var(--muted)); }
.afs-bt-perigo { background: #dc2626; border-color: #dc2626; color: #fff; }
.afs-bt-mini { height: 2rem; padding: 0 .6rem; font-size: .78rem; }
.afs-link { border: 0; background: none; padding: .2rem .3rem; font: inherit; font-size: .8rem; cursor: pointer; color: hsl(var(--primary)); border-radius: .35rem; text-decoration: none; }
.afs-link:hover { background: hsl(var(--muted)); }
.afs-link-ruim { color: #b91c1c; }
:is(.dark *) .afs-link-ruim { color: #fca5a5; }
.afs-ic { width: 1.9rem; height: 1.9rem; border-radius: .5rem; border: 1px solid hsl(var(--border)); background: transparent; color: hsl(var(--foreground)); cursor: pointer; flex: 0 0 auto; }
.afs-ic:disabled { opacity: .3; cursor: default; }

/* quadro */
.afs-quadro { flex: 1 1 auto; min-height: 0; overflow-x: auto; overflow-y: hidden; padding: 1rem 1rem 1.25rem; }
.afs-trilho { display: flex; align-items: flex-start; gap: 12px; height: 100%; width: max-content; }
.afs-col {
  display: flex; flex-direction: column; width: 300px; min-width: 300px; max-height: 100%; overflow: hidden;
  background: var(--afs-col); border: 1px solid var(--afs-col-borda); border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05);
  transition: border-color .2s, box-shadow .2s;
}
.afs-col:hover { border-color: #d4cbbf; }
.afs-col-alvo { border-color: var(--afs-laranja); box-shadow: 0 0 0 3px rgba(234, 88, 12, .18); }
.afs-col-cab { display: flex; align-items: center; gap: .5rem; height: 56px; padding: 12px; box-sizing: border-box; flex: 0 0 auto; }
.afs-col-nome { flex: 1 1 auto; min-width: 0; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afs-col-cont { flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 8px; box-sizing: border-box; border-radius: 999px; background: rgba(255,255,255,.22); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.afs-col-bt { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px; border: 0; background: rgba(255,255,255,.18); color: inherit; font-size: 15px; line-height: 1; cursor: pointer; }
.afs-col-bt:hover { background: rgba(255,255,255,.32); }
.afs-col-corpo { flex: 1 1 auto; min-height: 60px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.afs-col-vazia { border: 2px dashed var(--afs-col-borda); border-radius: 12px; padding: 2rem .75rem; text-align: center; font-size: .85rem; color: var(--afs-sub); }
.afs-col-rec { width: 56px; min-width: 56px; cursor: pointer; }
.afs-col-rec .afs-col-cab { flex-direction: column; height: auto; min-height: 220px; padding: 10px 6px; }
.afs-col-rec .afs-col-nome { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.afs-col-rec .afs-col-corpo, .afs-col-rec .afs-col-cab .afs-col-bt:not(:last-child) { display: none; }
.afs-col-finais { align-self: stretch; width: 44px; min-width: 44px; border-radius: 12px; border: 1px dashed var(--afs-col-borda); background: transparent; color: var(--afs-sub); font: inherit; font-size: .75rem; font-weight: 700; writing-mode: vertical-rl; cursor: pointer; }
.afs-col-finais:hover { background: var(--afs-col); color: var(--afs-tx); }

.afs-card {
  position: relative; background: var(--afs-card); border: 1px solid var(--afs-card-borda); border-radius: 12px; padding: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05); cursor: grab; transition: box-shadow .2s, transform .2s; user-select: none;
}
.afs-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-1px); }
.afs-card-arrasto { opacity: .45; }
.afs-card-topo { display: flex; gap: .5rem; align-items: flex-start; }
.afs-card-tit { flex: 1 1 auto; margin: 0; font-size: .92rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.afs-card-num { flex: 0 0 auto; font-size: .7rem; color: var(--afs-sub); }
.afs-card-cli { margin-top: .3rem; font-size: .78rem; color: var(--afs-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afs-card-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .5rem; }
.afs-chip { display: inline-flex; align-items: center; max-width: 100%; padding: .05rem .45rem; border-radius: 999px; border: 1px solid hsl(var(--border)); font-size: .68rem; font-weight: 600; line-height: 1.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.afs-chip-mat { background: transparent; }
.afs-chip-prazo { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.afs-alerta { background: #fff7ed !important; color: #c2410c !important; border-color: #fdba74 !important; }
.afs-ruim { background: #fef2f2 !important; color: #b91c1c !important; border-color: #fca5a5 !important; }
:is(.dark *) .afs-chip-prazo { background: rgba(59,130,246,.15); color: #93c5fd; border-color: rgba(59,130,246,.35); }
:is(.dark *) .afs-alerta { background: rgba(234,88,12,.15) !important; color: #fdba74 !important; }
:is(.dark *) .afs-ruim { background: rgba(220,38,38,.15) !important; color: #fca5a5 !important; }
.afs-card-pe { display: flex; align-items: center; justify-content: space-between; margin-top: .6rem; gap: .5rem; }
.afs-card-tempo { font-size: .7rem; color: var(--afs-sub); }
.afs-card-pessoas { display: inline-flex; }
.afs-av { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 999px; background: #1e3a8a; color: #fff; font-size: .62rem; font-weight: 700; border: 2px solid var(--afs-card); margin-left: -6px; flex: 0 0 auto; }
.afs-card-pessoas .afs-av:first-child { margin-left: 0; }
.afs-vazio-grande { padding: 3rem 1rem; text-align: center; color: var(--afs-sub); }
.afs-vazio { padding: .75rem 0; font-size: .85rem; color: var(--afs-sub); }

/* gaveta */
.afs-gaveta-fundo { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.35); display: flex; justify-content: flex-end; pointer-events: auto; }
.afs-gaveta {
  width: min(720px, 100vw); height: 100%; box-sizing: border-box; background: hsl(var(--background)); color: hsl(var(--foreground));
  display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(0,0,0,.2); animation: afs-entra .2s ease-out;
}
@keyframes afs-entra { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.afs-g-topo { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.25rem .25rem; }
.afs-g-fase { padding: .2rem .7rem; border-radius: 999px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
.afs-g-num { font-size: .78rem; color: var(--afs-sub); }
.afs-g-x { margin-left: auto; width: 2rem; height: 2rem; border-radius: .5rem; border: 0; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--afs-sub); }
.afs-g-x:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.afs-g-titulo { margin: .25rem 1.25rem 0; padding: .2rem .35rem; border: 1px solid transparent; border-radius: .5rem; background: transparent; color: inherit; font: inherit; font-size: 1.45rem; font-weight: 800; }
.afs-g-titulo:hover { border-color: hsl(var(--border)); }
.afs-g-titulo:focus { outline: none; border-color: var(--afs-laranja); }
.afs-g-sub { display: flex; flex-wrap: wrap; gap: .35rem .9rem; padding: .35rem 1.6rem .5rem; font-size: .8rem; color: var(--afs-sub); align-items: center; }
.afs-g-sub .afs-ruim { padding: 0 .4rem; border-radius: 999px; }
.afs-g-mover { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .5rem 1.25rem .75rem; border-bottom: 1px solid hsl(var(--border)); }
.afs-g-mover .afs-campo { flex: 1 1 200px; width: auto; }
.afs-rot-mini { font-size: .72rem; font-weight: 700; color: var(--afs-sub); text-transform: uppercase; letter-spacing: .03em; }
.afs-abas { display: flex; gap: .25rem; padding: .6rem 1.25rem 0; border-bottom: 1px solid hsl(var(--border)); overflow-x: auto; }
.afs-aba { border: 0; background: none; padding: .55rem .8rem; font: inherit; font-size: .85rem; font-weight: 600; color: var(--afs-sub); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.afs-aba:hover { color: hsl(var(--foreground)); }
.afs-aba.afs-on { color: var(--afs-laranja); border-bottom-color: var(--afs-laranja); }
.afs-g-corpo { flex: 1 1 auto; overflow-y: auto; padding: 1rem 1.25rem 1.5rem; }
.afs-g-pe { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .7rem 1.25rem; border-top: 1px solid hsl(var(--border)); font-size: .8rem; }
.afs-g-meta { margin-left: auto; color: var(--afs-sub); font-size: .75rem; }
.afs-sec-cab { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.afs-sec-cab h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.afs-desc { margin: 0 0 .75rem; font-size: .82rem; color: var(--afs-sub); white-space: pre-line; }
.afs-status { font-size: .75rem; color: var(--afs-sub); }
.afs-status.afs-ok { color: #15803d; }
.afs-status.afs-ruim { color: #b91c1c; background: none !important; }
:is(.dark *) .afs-status.afs-ok { color: #86efac; }

/* formulário */
.afs-form { display: flex; flex-direction: column; gap: .85rem; }
.afs-linha { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.afs-rot { font-size: .8rem; font-weight: 600; color: hsl(var(--foreground)); }
.afs-obrig { color: #dc2626; }
.afs-auto { font-weight: 500; font-size: .72rem; color: #7c3aed; }
.afs-pilulas { display: flex; flex-wrap: wrap; gap: .35rem; }
.afs-pilula { border: 1px solid hsl(var(--border)); background: hsl(var(--background)); color: hsl(var(--foreground)); border-radius: 999px; padding: .35rem .85rem; font: inherit; font-size: .82rem; cursor: pointer; }
.afs-pilula:hover { background: hsl(var(--muted)); }
.afs-pilula.afs-on { background: var(--afs-laranja); border-color: var(--afs-laranja); color: #fff; font-weight: 600; }
.afs-checks { display: flex; flex-direction: column; gap: .3rem; }
.afs-check { display: flex; align-items: center; gap: .5rem; padding: .35rem .55rem; border-radius: .5rem; border: 1px solid transparent; font-size: .85rem; cursor: pointer; }
.afs-check:hover { background: hsl(var(--muted) / .6); }
.afs-check.afs-on { border-color: rgba(234, 88, 12, .35); background: rgba(234, 88, 12, .06); }
.afs-check input { accent-color: var(--afs-laranja); width: 16px; height: 16px; flex: 0 0 auto; }
.afs-com-link { display: flex; gap: .4rem; align-items: center; }
.afs-pessoas { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.afs-pessoa { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .3rem .15rem .15rem; border-radius: 999px; background: hsl(var(--muted)); font-size: .8rem; }
.afs-pessoa .afs-av { margin: 0; border: 0; }
.afs-add-pessoa { width: auto; min-width: 180px; flex: 0 1 220px; }
.afs-x-mini { border: 0; background: none; cursor: pointer; font-size: 1rem; line-height: 1; color: var(--afs-sub); padding: 0 .2rem; }
.afs-busca-box { position: relative; }
.afs-busca-atual { display: flex; align-items: center; gap: .4rem; padding: .4rem .6rem; border: 1px solid hsl(var(--border)); border-radius: .6rem; background: hsl(var(--muted) / .5); }
.afs-busca-nome { flex: 1 1 auto; font-size: .85rem; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afs-clicavel { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.afs-busca-lista { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; max-height: 260px; overflow-y: auto; background: hsl(var(--popover)); color: hsl(var(--popover-foreground)); border: 1px solid hsl(var(--border)); border-radius: .6rem; box-shadow: 0 12px 30px rgba(0,0,0,.15); padding: .25rem; }
.afs-busca-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .45rem .6rem; border-radius: .4rem; font: inherit; font-size: .84rem; cursor: pointer; color: inherit; }
.afs-busca-item:hover { background: hsl(var(--muted)); }
.afs-busca-nada { padding: .5rem .6rem; font-size: .8rem; color: var(--afs-sub); }
.afs-anexos { display: flex; flex-direction: column; gap: .3rem; }
.afs-anexo { display: flex; align-items: center; gap: .4rem; padding: .3rem .5rem; border-radius: .5rem; background: hsl(var(--muted) / .6); }
.afs-anexo-nome { flex: 1 1 auto; min-width: 0; text-align: left; border: 0; background: none; font: inherit; font-size: .83rem; color: hsl(var(--primary)); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afs-anexo-tam { font-size: .7rem; color: var(--afs-sub); }
.afs-anexo-up { display: inline-flex; align-items: center; gap: .3rem; align-self: flex-start; padding: .4rem .8rem; border-radius: .6rem; border: 1px dashed hsl(var(--border)); font-size: .82rem; font-weight: 600; cursor: pointer; color: hsl(var(--foreground)); }
.afs-anexo-up:hover { background: hsl(var(--muted)); }
.afs-anexo-up input { display: none; }
.afs-enviando { opacity: .6; pointer-events: none; }
.afs-etqs { display: flex; flex-wrap: wrap; gap: .3rem; }
.afs-etq { border: 1px solid var(--etq); background: transparent; color: hsl(var(--foreground)); border-radius: 999px; padding: .2rem .6rem; font: inherit; font-size: .75rem; font-weight: 600; cursor: pointer; }
.afs-etq.afs-on { background: var(--etq); color: var(--etq-tx); }
.afs-acord { border: 1px solid hsl(var(--border)); border-radius: .75rem; margin-bottom: .5rem; padding: 0 .9rem; }
.afs-acord[open] { padding-bottom: .9rem; }
.afs-acord-atual { border-color: rgba(234, 88, 12, .5); }
.afs-acord summary { display: flex; align-items: center; gap: .5rem; padding: .7rem 0; cursor: pointer; font-weight: 700; font-size: .88rem; list-style: none; }
.afs-acord summary::-webkit-details-marker { display: none; }
.afs-acord-n { margin-left: auto; font-weight: 500; font-size: .75rem; color: var(--afs-sub); }
.afs-bola { display: inline-block; width: 10px; height: 10px; border-radius: 999px; flex: 0 0 auto; }
.afs-hist { display: flex; flex-direction: column; gap: .6rem; }
.afs-dir { display: flex; justify-content: flex-end; }
.afs-hist-lista { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.afs-hist-item { padding: .65rem .8rem; border-radius: .7rem; border: 1px solid hsl(var(--border)); }
.afs-hist-fase, .afs-hist-criacao { background: hsl(var(--muted) / .5); border-style: dashed; }
.afs-hist-tx { font-size: .87rem; white-space: pre-line; overflow-wrap: anywhere; }
.afs-hist-meta { margin-top: .3rem; font-size: .72rem; color: var(--afs-sub); }

/* modais */
.afs-modal-fundo { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; padding: 16px; pointer-events: auto; }
.afs-modal { width: min(620px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: hsl(var(--background)); color: hsl(var(--foreground)); border-radius: 1rem; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.afs-modal-larga { width: min(980px, 100%); }
.afs-modal-cab { display: flex; align-items: center; padding: 1rem 1.25rem .5rem; }
.afs-modal-cab h2 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.afs-modal-corpo { flex: 1 1 auto; overflow-y: auto; padding: .5rem 1.25rem 1rem; display: flex; flex-direction: column; gap: .85rem; }
.afs-modal-pe { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; padding: .8rem 1.25rem; border-top: 1px solid hsl(var(--border)); }
.afs-modal-pe .afs-status { margin-right: auto; }
.afs-cfg-area { display: flex; flex-direction: column; gap: .5rem; padding-top: .75rem; }
.afs-cfg-fase { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem .6rem; border: 1px solid hsl(var(--border)); border-radius: .7rem; }
.afs-inativa { opacity: .55; }
.afs-cfg-ord { width: 1.4rem; text-align: center; font-size: .75rem; font-weight: 700; color: var(--afs-sub); }
.afs-cor { width: 28px; height: 28px; border-radius: 8px; border: 2px solid hsl(var(--background)); box-shadow: 0 0 0 1px hsl(var(--border)); cursor: pointer; flex: 0 0 auto; }
.afs-paleta { display: flex; flex-wrap: wrap; gap: .3rem; padding: .5rem; margin: -.25rem 0 .25rem 2rem; border: 1px solid hsl(var(--border)); border-radius: .6rem; }
.afs-cor-op { width: 22px; height: 22px; border-radius: 6px; border: 0; cursor: pointer; }
.afs-paleta input[type=color] { width: 30px; height: 24px; border: 0; padding: 0; background: none; cursor: pointer; }
.afs-cfg-nome { flex: 1 1 200px; width: auto; }
.afs-cfg-num { width: 4.5rem; }
.afs-cfg-al { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; color: var(--afs-sub); }
.afs-cfg-uso { font-size: .72rem; color: var(--afs-sub); }
.afs-cfg-h { display: flex; align-items: center; gap: .5rem; margin: .25rem 0; font-size: 1rem; }
.afs-cfg-campo { display: flex; flex-direction: column; gap: .4rem; padding: .6rem; border: 1px solid hsl(var(--border)); border-radius: .7rem; }
.afs-cfg-l1 { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.afs-cfg-l1 > .afs-campo:first-child { flex: 1 1 220px; width: auto; }
.afs-cfg-tipo { width: auto; flex: 0 1 200px; }
.afs-cfg-l2 { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding-left: .25rem; }
.afs-cfg-l2 .afs-area { flex: 1 1 100%; }
.afs-cfg-cond .afs-campo { width: auto; flex: 1 1 160px; }
.afs-cfg-modo { flex: 0 0 auto !important; }
input[type=color] { cursor: pointer; }

/* menu e avisos */
.afs-li a.afs-ativo { background: hsl(var(--sidebar-accent, var(--muted))); color: hsl(var(--sidebar-accent-foreground, var(--foreground))); font-weight: 600; }
.afs-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 90; max-width: min(560px, calc(100vw - 32px)); padding: .7rem 1rem; border-radius: .75rem; background: #111827; color: #fff; font-size: .85rem; box-shadow: 0 12px 30px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.afs-toast-on { opacity: 1; transform: translate(-50%, 0); }
.afs-toast-ruim { background: #991b1b; }

@media (max-width: 760px) {
  .afs-topo { padding: .9rem 1rem .4rem; }
  .afs-topo-acoes { width: 100%; }
  .afs-topo-acoes .afs-bt { flex: 1 1 auto; }
  .afs-filtros { padding: .5rem 1rem .7rem; }
  .afs-busca, .afs-sel { flex: 1 1 100%; max-width: none; }
  .afs-col { width: 84vw; min-width: 84vw; }
  .afs-gaveta { width: 100vw; }
  .afs-g-titulo { font-size: 1.2rem; }
}
@media (pointer: coarse) { .afs-bt { height: 2.6rem; } .afs-pilula { padding: .5rem 1rem; } .afs-campo { font-size: 16px; } }
/* configurar › nova demanda */
.afs-cfg-fixo { padding: .55rem .75rem; border: 1px dashed hsl(var(--border)); border-radius: .7rem; font-size: .82rem; font-weight: 600; color: var(--afs-sub); }
.afs-cfg-selo { font-size: .7rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: hsl(var(--muted)); color: var(--afs-sub); white-space: nowrap; }
/* abas: não encolhem dentro de colunas flex (modal e gaveta); no modal viram controle segmentado */
.afs-abas { flex: 0 0 auto; align-items: center; scrollbar-width: none; }
.afs-abas::-webkit-scrollbar { display: none; }
.afs-modal .afs-abas { gap: .25rem; width: max-content; max-width: 100%; box-sizing: border-box; margin-top: .25rem; padding: .25rem; border: 1px solid hsl(var(--border)); border-radius: .8rem; background: hsl(var(--muted) / .6); }
.afs-modal .afs-aba { border: 0; border-radius: .6rem; padding: .5rem 1rem; line-height: 1.2; color: var(--afs-sub); transition: background .15s, color .15s, box-shadow .15s; }
.afs-modal .afs-aba:hover { color: hsl(var(--foreground)); background: hsl(var(--background) / .6); }
.afs-modal .afs-aba.afs-on { background: hsl(var(--background)); color: var(--afs-laranja); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 1px hsl(var(--border)); }
.afs-modal .afs-cfg-area { padding-top: .5rem; }
/* seletor de visualização (quadro | lista) */
.afs-visao { display: inline-flex; gap: .2rem; padding: .2rem; border: 1px solid hsl(var(--border)); border-radius: .75rem; background: hsl(var(--muted) / .6); }
.afs-visao-bt { border: 0; background: none; border-radius: .55rem; padding: 0 .8rem; height: 1.95rem; font: inherit; font-size: .82rem; font-weight: 600; color: var(--afs-sub); cursor: pointer; white-space: nowrap; }
.afs-visao-bt:hover { color: hsl(var(--foreground)); }
.afs-visao-bt.afs-on { background: hsl(var(--background)); color: hsl(var(--foreground)); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 1px hsl(var(--border)); }

/* visão em lista: fases empilhadas, como no app do Pipefy */
.afs-quadro.afs-quadro-lista { overflow-x: hidden; overflow-y: auto; }
.afs-lista { display: flex; flex-direction: column; gap: .6rem; max-width: 980px; margin: 0 auto; padding-bottom: 2rem; }
.afs-lf { border-radius: 14px; background: color-mix(in srgb, var(--fase) 9%, hsl(var(--background))); border: 1px solid color-mix(in srgb, var(--fase) 18%, transparent); overflow: hidden; }
.afs-lf-cab { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 3.4rem; padding: .7rem 1rem; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; color: color-mix(in srgb, var(--fase) 78%, #000); }
:is(.dark *) .afs-lf-cab { color: color-mix(in srgb, var(--fase) 70%, #fff); }
.afs-lf-cab:hover { background: color-mix(in srgb, var(--fase) 7%, transparent); }
.afs-lf-nome { flex: 1 1 auto; min-width: 0; font-size: 1.02rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afs-lf-n { flex: 0 0 auto; font-size: .95rem; font-weight: 600; opacity: .75; }
.afs-lf-seta { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 999px; border: 1.5px solid currentColor; font-size: .95rem; line-height: 1; padding-bottom: .15rem; box-sizing: border-box; transition: transform .15s; }
.afs-lf-aberta .afs-lf-seta { transform: rotate(180deg); padding-bottom: 0; padding-top: .15rem; }
.afs-lf-final .afs-lf-nome { font-weight: 600; }
.afs-lf-corpo { display: flex; flex-direction: column; gap: .5rem; padding: 0 .75rem .8rem; }
.afs-lf-corpo .afs-card { cursor: pointer; }
.afs-lf-vazia { padding: .6rem .25rem; font-size: .85rem; color: var(--afs-sub); }
.afs-lf-mais { align-self: flex-start; font-weight: 600; }
@media (max-width: 760px) {
  .afs-visao { width: 100%; }
  .afs-visao-bt { flex: 1 1 0; height: 2.3rem; }
  .afs-topo-acoes { flex-wrap: wrap; }
  .afs-lista { padding: 0 0 2rem; }
}
/* filtros recolhíveis no celular (no computador continuam todos à vista) */
.afs-filtros-mais { display: contents; }
.afs-filtros-bt { display: none; }
.afs-filtros-n { display: inline-flex; align-items: center; justify-content: center; min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem; box-sizing: border-box; border-radius: 999px; background: var(--afs-laranja); color: #fff; font-size: .7rem; font-weight: 700; }
.afs-filtros-seta { font-size: .8rem; transition: transform .15s; }
@media (max-width: 760px) {
  .afs-titulo p { display: none; }
  .afs-topo { gap: .6rem; padding-bottom: .3rem; }
  .afs-filtros { flex-wrap: wrap; gap: .5rem; }
  .afs-filtros .afs-busca { flex: 1 1 0; min-width: 0; }
  .afs-filtros-bt { display: inline-flex; flex: 0 0 auto; }
  .afs-filtros-mais { display: flex; flex-direction: column; gap: .5rem; flex: 1 1 100%; }
  .afs-filtros-mais .afs-chk { padding: .1rem 0; }
  .afs-filtros-fechado .afs-filtros-mais { display: none; }
  .afs-filtros:not(.afs-filtros-fechado) .afs-filtros-seta { transform: rotate(180deg); }
}
/* seletor de fluxo: Judiciais | Extrajudiciais */
.afs-pipes { display: flex; gap: .4rem; padding: .15rem 1.25rem .6rem; overflow-x: auto; scrollbar-width: none; }
.afs-pipes::-webkit-scrollbar { display: none; }
.afs-pipe { display: inline-flex; align-items: center; gap: .45rem; flex: 0 0 auto; height: 2.3rem; padding: 0 1rem; border-radius: 999px; border: 1px solid hsl(var(--border)); background: hsl(var(--background)); color: var(--afs-sub); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.afs-pipe:hover { color: hsl(var(--foreground)); background: hsl(var(--muted) / .6); }
.afs-pipe.afs-on { background: hsl(var(--foreground)); border-color: hsl(var(--foreground)); color: hsl(var(--background)); }
.afs-pipe-n { display: inline-flex; align-items: center; justify-content: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; box-sizing: border-box; border-radius: 999px; background: hsl(var(--muted)); color: hsl(var(--foreground)); font-size: .72rem; font-weight: 700; }
.afs-pipe.afs-on .afs-pipe-n { background: var(--afs-laranja); color: #fff; }
@media (max-width: 760px) {
  .afs-pipes { padding: 0 1rem .5rem; }
  .afs-pipe { flex: 1 1 0; justify-content: center; }
}
/* a linha dos fluxos não pode encolher dentro da coluna flex da página */
.afs-pipes { flex: 0 0 auto; align-items: center; min-height: 2.9rem; box-sizing: border-box; }
/* rev. i: finalizar prazo */
.afs-venc { display: inline-flex; align-items: center; gap: .45rem; padding: .1rem .15rem .1rem .45rem; border-radius: 999px; border: 1px solid transparent; }
.afs-venc-ok { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
:is(.dark *) .afs-venc-ok { background: rgba(22,163,74,.14); color: #86efac; border-color: rgba(22,163,74,.35); }
.afs-prazo-fim { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .4rem; }
.afs-prazo-feito { font-size: .78rem; font-weight: 600; color: #15803d; }
:is(.dark *) .afs-prazo-feito { color: #86efac; }
.afs-prazo-bt { display: inline-flex; align-items: center; height: 1.85rem; padding: 0 .8rem; border-radius: 999px; border: 1px solid #86efac; background: #f0fdf4; color: #15803d; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.afs-prazo-bt:hover { background: #dcfce7; }
.afs-prazo-bt.afs-on { border-color: hsl(var(--border)); background: hsl(var(--background)); color: var(--afs-sub); font-weight: 600; }
.afs-prazo-bt.afs-on:hover { color: hsl(var(--foreground)); background: hsl(var(--muted) / .6); }
.afs-prazo-bt:disabled { opacity: .55; cursor: default; }
.afs-prazo-mini { height: 1.5rem; padding: 0 .6rem; font-size: .72rem; }
:is(.dark *) .afs-prazo-bt:not(.afs-on) { background: rgba(22,163,74,.14); color: #86efac; border-color: rgba(22,163,74,.4); }
/* rev. j: no celular a coluna recolhida continua estreita (a regra de 84vw vencia a da coluna recolhida) */
@media (max-width: 760px) {
  .afs-col.afs-col-rec { width: 56px; min-width: 56px; max-width: 56px; flex: 0 0 56px; }
  .afs-col.afs-col-rec .afs-col-cab { min-height: 200px; }
}

/* ---- 25/09/2026 (k): visual mais enxuto, no estilo do Pipefy ---- */
/* topo numa linha só: título · fluxos · ações; filtros logo abaixo, compactos */
.afs-topo { align-items: center; padding: .7rem 1.25rem .35rem; gap: .75rem 1rem; flex-wrap: nowrap; }
.afs-titulo { flex: 0 0 auto; }
.afs-titulo h1 { font-size: 1.3rem; }
.afs-topo .afs-pipes { flex: 1 1 auto; min-width: 0; min-height: 0; padding: 0; }
.afs-topo .afs-pipe { height: 2rem; padding: 0 .85rem; font-size: .84rem; }
.afs-topo-acoes { flex: 0 0 auto; }
.afs-filtros { padding: .3rem 1.25rem .55rem; }
.afs-quadro { padding: .75rem 1rem 1rem; }

/* colunas: cabeçalho claro com faixa colorida em cima (como no Pipefy) */
.afs-col { --afs-cor: #94a3b8; }
.afs-col-cab { height: 44px; padding: 0 8px 0 12px; gap: .35rem; background: transparent; color: var(--afs-tx);
  border-top: 4px solid var(--afs-cor); border-radius: 12px 12px 0 0; }
.afs-col-nome { font-size: 14px; font-weight: 700; text-transform: none; letter-spacing: 0; flex: 0 1 auto;
  color: color-mix(in srgb, var(--afs-cor) 78%, #000); }
:is(.dark *) .afs-col-nome, .dark .afs-col-nome { color: color-mix(in srgb, var(--afs-cor) 70%, #fff); }
.afs-col-cont { margin-right: auto; min-width: 18px; height: 18px; padding: 0 6px; line-height: 18px; font-size: 11px;
  background: hsl(var(--muted)); color: var(--afs-sub); }
.afs-col-bt { width: 24px; height: 24px; border-radius: 6px; background: transparent; color: var(--afs-sub); font-size: 16px; }
.afs-col-bt:hover { background: hsl(var(--muted)); color: var(--afs-tx); }
@media (hover: none) { .afs-col-bt:hover { background: transparent; color: var(--afs-sub); } }
.afs-col-corpo { padding: 4px 10px 12px; }

/* coluna recolhida continua estreita, com a faixa colorida */
.afs-col-rec .afs-col-cab { height: auto; padding: 10px 6px; }
.afs-col-rec .afs-col-cont { margin-right: 0; }

@media (max-width: 760px) {
  .afs-topo { flex-wrap: wrap; padding: .7rem 1rem .3rem; }
  .afs-titulo { flex: 1 1 auto; }
  .afs-topo .afs-pipes { order: 3; flex: 1 1 100%; }
  .afs-topo-acoes { order: 2; }
  .afs-topo .afs-pipe { height: 2.2rem; }
  .afs-filtros { padding: .3rem 1rem .5rem; }
  .afs-quadro { padding: .6rem .75rem .9rem; }
}

/* ---- 25/09/2026 (l): seta dos selects com respiro da borda ---- */
select.afs-campo { -webkit-appearance: none; -moz-appearance: none; appearance: none; padding-right: 2.4rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .85rem center; background-size: 12px 12px;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
select.afs-campo::-ms-expand { display: none; }
