/* Modo claro "Papel & Marinho" (05/07/2026): tons quentes de papel timbrado, azul-marinho
   da marca e dourado de apoio — em lugar do cinza-frio original. O escuro permanece igual. */
:root {
  --bg: #f2efe8; --card: #fffdf8; --soft: #ebe7db; --ink: #17191f; --muted: #524f45; --line: #d9d2bd;
  --azul: #17527e; --azul-solid: #1b5e91; --azul-bg: #e3edf6; --vermelho: #a32d2d; --vermelho-bg: #f9e9e4;
  --ambar: #8a5a0b; --ambar-bg: #f6edd7; --verde: #33641c; --verde-bg: #e9f1db;
  --roxo: #6b46c1; --roxo-bg: #ece6f8;
  --ouro: #a8842c;
}
/* Tema escuro alinhado ao painel de atividades do Projuris (azul-marinho).
   --azul = acento claro (texto/links/chips); --azul-solid = azul cheio p/ botões (texto branco). */
html[data-theme="dark"] {
  --bg: #0f1117; --card: #1a2035; --soft: #232c40; --ink: #e2e8f0; --muted: #8a94a6; --line: #2d3748;
  --azul: #63b3ed; --azul-solid: #3182ce; --azul-bg: #1a3a5c; --vermelho: #fc8181; --vermelho-bg: #3a1d1d;
  --ambar: #f6ad55; --ambar-bg: #3a2c12; --verde: #68d391; --verde-bg: #1c3a2a;
  --roxo: #c4b5fd; --roxo-bg: #2e2a52;
  --ouro: #d3b055;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--ink); display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.app-layout { display: flex; flex: 1; min-height: 0; overflow: hidden; }
header { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 26px; }
.t1 { font-weight: 600; font-size: 17px; }
.t2 { font-size: 12px; color: var(--muted); }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 8px 14px; }
button:hover { background: var(--soft); }
/* Padrão visual do sistema: TODO campo (texto, busca, seleção, data, área de texto)
   tem cantos arredondados, como os cards e botões. Regras específicas podem refinar. */
input, select, textarea { border-radius: 8px; }
button.primary { background: var(--azul-solid); color: #fff; border-color: var(--azul-solid); }
button.primary:hover { filter: brightness(1.07); }
/* Foco de teclado visível e consistente (acessibilidade — WCAG 2.4.7). */
:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; border-radius: 6px; }

/* ─── Login ─────────────────────────────────────────────────────────────── */
.login-overlay { position: fixed; inset: 0; z-index: 2000; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px 26px; box-shadow: 0 16px 50px rgba(0,0,0,.4); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.login-brand .logo { font-size: 30px; }
.login-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 8px; }
.login-box select, .login-box input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); }
.login-hint { font-size: 12px; color: var(--azul); margin: 4px 0 0; }
.login-erro { font-size: 13px; color: var(--vermelho); margin: 4px 0 0; }
.login-box .primary { margin-top: 12px; padding: 11px; font-size: 15px; }
.usuario-chip { font-size: 12px; color: var(--muted); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.usuario-chip:empty { display: none; }
#btn-logout { font-size: 12px; padding: 7px 12px; }

/* ─── Busca global ──────────────────────────────────────────────────────── */
.busca-secao { margin-top: 18px; }
.busca-secao-tit { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.busca-count { background: var(--soft); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; padding: 1px 8px; color: var(--muted); }
.busca-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 8px; font-size: 13px; border-bottom: 1px solid var(--edge-soft, var(--line)); }
.busca-item:last-child { border-bottom: none; }
.busca-item:hover { background: var(--soft); }
.busca-sub { color: var(--muted); font-size: 12.5px; }
nav#tabs { width: 190px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; padding: 12px 8px; background: var(--card); border-right: 1px solid var(--line); overflow-y: auto; }
nav#tabs button { width: 100%; text-align: left; border: none; border-radius: 7px; padding: 9px 14px; color: var(--muted); background: none; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
nav#tabs button:hover { background: var(--soft); color: var(--ink); }
nav#tabs button.active { background: var(--azul-bg); color: var(--azul); font-weight: 600; }
.nav-badge { display:inline-block; min-width:16px; margin-left:7px; padding:0 5px; border-radius:999px; background:#dc2626; color:#fff; font-size:11px; font-weight:700; text-align:center; vertical-align:middle; }
main { flex: 1; overflow-y: auto; padding: 22px 28px; min-width: 0; }
.tab { display: none; }
.tab.active { display: block; }
h2 { font-size: 18px; margin: 0 0 14px; }
.hint { color: var(--muted); font-size: 13px; background: var(--azul-bg); padding: 10px 14px; border-radius: 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
/* Cards que filtram a lista ao clicar (aba Processos): parecem e agem como botões. */
.card.card-clique { cursor: pointer; transition: border-color .15s, transform .1s; }
.card.card-clique:hover { border-color: var(--azul); }
/* Métricas da aba Processos: colunas = nº REAL de cards (4, ou 5 com Taxa de êxito),
   preenchido pelo render em --nproc. Evita card sozinho "esticado" na última fileira.
   Escopado a #cards-proc para NÃO afetar o .cards global (Início/Clientes). */
#cards-proc { grid-template-columns: repeat(var(--nproc, 4), 1fr); align-items: stretch; }
@media (max-width: 900px) { #cards-proc { grid-template-columns: repeat(2, 1fr); } }
.card.card-clique.ativo { border-color: var(--azul-solid); box-shadow: 0 0 0 1px var(--azul-solid) inset; }
.card .lbl { font-size: 13px; color: var(--muted); }
.card .val { font-size: 30px; font-weight: 600; margin-top: 4px; }
.card.clickable { cursor: pointer; transition: border-color .15s, transform .05s; }
.card.clickable:hover { border-color: var(--azul); }
.card.clickable:active { transform: scale(0.99); }
.card .card-link { font-size: 12px; color: var(--azul); margin-top: 8px; }
.filtro-banner { font-size: 13px; color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.filtro-banner a { color: var(--azul); }
.lista { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.item .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.item .titulo { font-size: 14px; font-weight: 500; }
.item .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.item .teor { font-size: 13px; margin-top: 8px; color: var(--muted); }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 8px; white-space: nowrap; }
.tag.urgente { background: var(--vermelho-bg); color: var(--vermelho); }
.tag.prazo { background: var(--ambar-bg); color: var(--ambar); }
.tag.informativo { background: var(--azul-bg); color: var(--azul); }
.prazo-box { margin-top: 8px; font-size: 13px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.prazo-box .venc { font-weight: 600; }
.danger-text { color: var(--vermelho); font-weight: 600; }
details summary { cursor: pointer; color: var(--azul); font-size: 12px; margin-top: 6px; }
.editor .form-inline { margin: 8px 0 0; padding: 10px; }
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 14px; align-items: start; }
@media (max-width: 720px) { .doc-layout { grid-template-columns: 1fr; } }
.doc-col { min-width: 0; }
.filtro-int { padding: 6px 12px; }
.filtro-int.active { background: var(--azul-solid); color: #fff; border-color: var(--azul-solid); }
.tag.concluida { background: var(--soft); color: var(--muted); }
.filtro-arq { padding: 6px 12px; }
.filtro-arq.active { background: var(--azul-solid); color: #fff; border-color: var(--azul-solid); }
.doc-item { cursor: pointer; }
.doc-item:hover { border-color: var(--azul); }
.doc-viewer { background: var(--card); border: 1px solid var(--line); border-radius: var(--border-radius-lg, 12px); border-radius: 12px; padding: 16px 18px; min-height: 200px; }
.doc-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.doc-title { font-size: 16px; font-weight: 600; }
.doc-head .acoes { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.doc-head select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.doc-body { font-size: 14px; line-height: 1.6; }
.doc-body h1 { font-size: 20px; } .doc-body h2 { font-size: 17px; } .doc-body h3 { font-size: 15px; }
.doc-body table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13px; }
.doc-body th, .doc-body td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.doc-body th { background: var(--soft); }
.doc-body blockquote { border-left: 3px solid var(--azul); margin: 8px 0; padding: 4px 12px; color: var(--muted); }
.doc-body code { background: var(--soft); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.doc-body hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
.cliente-input { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); min-width: 200px; flex: 1; max-width: 340px; }
.solic-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.mini { font-size: 12px; padding: 5px 10px; }
.btn-link { font-size: 13px; color: var(--azul); border: 1px solid var(--line); padding: 6px 10px; border-radius: 8px; text-decoration: none; }
.btn-link:hover { border-color: var(--azul); }
.novo-doc { margin-top: 16px; }
.novo-doc textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
details ul { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--muted); }
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; background: var(--card); padding: 14px; border-radius: 10px; border: 1px solid var(--line); }
.form-inline input, .form-inline select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.form-inline label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.row-adv { display: flex; align-items: center; justify-content: space-between; }
.row-adv .meta { font-size: 13px; }
.row-adv .acoes { display: flex; gap: 8px; align-items: center; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.pill.on { background: var(--verde-bg); color: var(--verde); }
.pill.off { background: var(--line); color: var(--ink); }
.link-danger { color: var(--vermelho); border-color: #ecc; }
.header-actions { display: flex; gap: 8px; align-items: center; }
#btn-tema { font-size: 16px; line-height: 1; padding: 8px 10px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.regime-tag { font-size: 11px; padding: 2px 8px; border-radius: 8px; background: var(--azul-bg); color: var(--azul); }
/* Toast acima de qualquer modal (2000/2100) e clicável quando visível (botão ✕). */
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .25s; pointer-events: none; max-width: 80%; box-shadow: 0 6px 24px rgba(0,0,0,.35); z-index: 3000; display: flex; align-items: center; gap: 14px; }
#toast.show { opacity: 1; pointer-events: auto; }
#toast button { background: none; border: none; color: inherit; opacity: .65; cursor: pointer; font-size: 14px; padding: 0; line-height: 1; flex-shrink: 0; }
#toast button:hover { opacity: 1; }
/* Visão Semana do Calendário: 7 cartões COMPACTOS (segunda a domingo), todos
   visíveis de uma vez, só com os contadores — a lista completa abre no clique.
   min-width: 0 impede que o conteúdo alargue as colunas do grid. */
.calsem-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.calsem-dia { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); min-height: 96px; padding: 10px; cursor: pointer; transition: border-color .15s; }
.calsem-dia:hover { border-color: var(--azul-solid); }
.calsem-dia.cal-hoje { outline: 2px solid var(--azul-solid); }
.calsem-head { display: flex; flex-direction: column; gap: 1px; margin-bottom: 8px; }
.calsem-dow { font-weight: 600; font-size: 13px; color: var(--azul); }
.calsem-data { font-size: 12px; color: var(--muted); }
.calsem-dia .cal-badges { display: flex; flex-wrap: wrap; gap: 3px; }
.calsem-vazio { color: var(--muted); font-size: 12px; }
@media (max-width: 860px) { .calsem-grid { grid-template-columns: 1fr 1fr; } }

/* Histórico expansível nas fichas (processo/cliente): resumo discreto que abre o restante. */
details.pd-hist { margin-top: 2px; }
details.pd-hist > summary { cursor: pointer; color: var(--azul); font-size: 13px; padding: 4px 0; list-style: none; user-select: none; }
details.pd-hist > summary::-webkit-details-marker { display: none; }
details.pd-hist > summary::before { content: "▸ "; }
details.pd-hist[open] > summary::before { content: "▾ "; }
.proc-dash { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 600px) { .proc-dash { grid-template-columns: 1fr; } }

/* ─── Responsivo: telas estreitas (tablet/celular) ──────────────────────────
   A barra lateral vira uma faixa de abas rolável no topo e o conteúdo ocupa
   toda a largura, liberando espaço onde ele mais falta. */
@media (max-width: 860px) {
  header { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .header-actions { flex-wrap: wrap; }
  .app-layout { flex-direction: column; overflow: hidden; }
  nav#tabs {
    width: 100%; flex-direction: row; gap: 4px; padding: 8px 10px; flex-shrink: 0;
    overflow-x: auto; overflow-y: hidden; border-right: none; border-bottom: 1px solid var(--line);
    scrollbar-width: thin;
  }
  nav#tabs button { width: auto; flex-shrink: 0; }
  nav#tabs .nav-badge { margin-left: 5px; }
  main { padding: 16px 14px; }
  .sec-head { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 520px) {
  .t2 { display: none; }                 /* subtítulo do escritório some no celular */
  main { padding: 12px 10px; }
  .wf-stats { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr 1fr; }
}
/* Tabelas largas nunca empurram a página: rolam no próprio contêiner. */
.doc-body { overflow-x: auto; }
.proc-block { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.proc-block-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px; }
.adv-prod { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.adv-prod:last-child { border: none; }
.adv-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; background: var(--azul-bg); color: var(--azul); }
.adv-stat { text-align: center; min-width: 38px; }
.adv-stat .n { font-size: 14px; font-weight: 600; }
.adv-stat .s { font-size: 10px; color: var(--muted); }
.alert-row { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.alert-row:last-child { border: none; }
.alert-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.q-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.q-label { width: 110px; color: var(--muted); }
.q-bar { flex: 1; height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.q-fill { height: 100%; border-radius: 3px; }
.q-pct { width: 32px; text-align: right; font-size: 11px; font-weight: 600; }
.ptag { font-size: 11px; padding: 2px 7px; border-radius: 7px; background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.conf-summary { font-size: 15px; font-weight: 600; cursor: pointer; padding: 6px 0; }
.adv-edit-form { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.cli-cancel, .adv-cancel { background: none; border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px; cursor: pointer; font-size: 12px; color: var(--muted); }
.cli-cancel:hover, .adv-cancel:hover { border-color: var(--muted); }

/* ─── Intimações agrupadas por dia ──────────────────────────────────────── */
.data-group { margin-bottom:14px; }
.data-group-head { display:flex; align-items:center; gap:8px; font-size:12px; font-weight:700; color:var(--muted,#6b7280); text-transform:uppercase; letter-spacing:.03em; padding:6px 0; margin-bottom:4px; border-bottom:1px solid var(--line,#e5e7eb); position:sticky; top:0; background:var(--bg,#fff); z-index:1; }
.data-group-count { background:var(--soft,#f1f5f9); color:var(--ink,#111); border-radius:999px; font-size:11px; font-weight:700; padding:1px 8px; }

/* ─── Supervisão de captação (cross-check DJEN ↔ Projuris) ──────────────── */
#supervisao-wrap { border:1px solid #d97706; border-radius:8px; overflow:hidden; }
.supervisao-header { display:flex; align-items:center; gap:8px; padding:10px 14px; background:rgba(217,119,6,.10); cursor:pointer; font-weight:600; font-size:13px; user-select:none; }
.supervisao-header:hover { background:rgba(217,119,6,.17); }
.badge-sup { background:#d97706; color:#fff; border-radius:999px; font-size:11px; font-weight:700; padding:1px 8px; }
#supervisao-lista { padding:10px 14px; display:flex; flex-direction:column; gap:6px; border-top:1px solid rgba(217,119,6,.25); }
.supervisao-item { padding:5px 0; border-bottom:1px solid var(--line,#e5e7eb); }
.supervisao-item:last-of-type { border-bottom:none; }
.sup-check { display:flex; align-items:center; gap:8px; cursor:pointer; font-size:13px; flex-wrap:wrap; }
.sup-tipo { font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px; white-space:nowrap; }
.so-djen { background:var(--azul-bg); color:var(--azul); }
.so-projuris { background:var(--roxo-bg); color:var(--roxo); }
.sup-proc { font-weight:600; }
.sup-trib, .sup-data, .sup-desc { color:var(--muted,#6b7280); font-size:12px; }
.sup-desc { font-style:italic; }
.btn-sup-todos { font-size:12px; padding:5px 12px; }

/* ─── Workflow (atividades Projuris) ─────────────────────────────────────── */
/* Barra de filtros de Tarefas: busca + seletores na MESMA linha (a busca cresce). */
.wf-controls .filtros > input, .wf-controls .filtros > select { padding: 8px 10px; font: inherit; box-sizing: border-box; }
.wf-controls .filtros .wf-busca { flex: 1 1 240px; min-width: 220px; }
.wf-controls .filtros > select { min-width: 128px; }
.wf-stats { display: grid; grid-template-columns: repeat(6, 1fr); align-items: stretch; gap: 10px; margin-bottom: 16px; }
@media (min-width: 521px) and (max-width: 860px) { .wf-stats { grid-template-columns: repeat(3, 1fr); } }
.wf-stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; text-align: center; cursor: pointer; transition: border-color .15s; }
.wf-stat:hover { border-color: var(--azul); }
.wf-n { font-size: 28px; font-weight: 700; }
.wf-l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.wf-stat.venc .wf-n { color: var(--vermelho); }
.wf-stat.ativo .wf-n { color: var(--azul); }
.wf-stat.ok .wf-n { color: var(--verde); }
#lista-workflow { overflow-x: auto; }
.wf-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13.5px; margin-top: 8px; }
.wf-table th { text-align: left; padding: 9px 10px; border-bottom: 2px solid var(--line); font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; white-space: normal; overflow: hidden; text-overflow: ellipsis; }
.wf-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow: hidden; }
/* Com table-layout fixo, todo texto longo trunca com reticências (o valor completo fica no title). */
.wf-cnj, .wf-mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-table tr:hover td { background: var(--soft); }
.wf-table tr.wf-vencida > td { background: var(--vermelho-bg); }
.wf-table tr.wf-vencida:hover > td { filter: brightness(0.97); }
.wf-table tr.wf-concluida { opacity: 0.55; }
.wf-stag { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.wf-stag.wf-vencida { background: var(--vermelho-bg); color: var(--vermelho); }
.wf-stag.wf-pendente { background: var(--ambar-bg); color: var(--ambar); }
.wf-stag.wf-execucao { background: var(--azul-bg); color: var(--azul); }
.wf-stag.wf-ok { background: var(--verde-bg); color: var(--verde); }
.wf-stag.wf-neutro { background: var(--line); color: var(--muted); }
.wf-resp { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; background: var(--azul-bg); color: var(--azul); margin-right: 2px; }
.wf-sync-pend { font-size: 11px; color: var(--muted); font-style: italic; }
.wf-mono { font-family: monospace; font-size: 12.5px; color: var(--azul); }

/* Workflow — filtros em chips + colunas ricas (réplica do painel de atividades) */
.wf-controls { margin-bottom:12px; }
.wf-count { font-size:12px; color:var(--muted); margin-left:auto; }
.wf-stat.active { border-color:var(--azul); background:var(--azul-bg); }
.wf-cnj { font-family:monospace; font-size:12px; color:var(--verde); white-space:nowrap; }

/* ─── Modal de vinculação ao Workflow ───────────────────────────────────── */
.arq-grupo { font-size: 13px; font-weight: 600; color: var(--muted); margin: 20px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.arq-count { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 700; color: var(--muted); }
.arq-item { opacity: 0.85; }
.arq-item:hover { opacity: 1; }

/* ─── Calendário ────────────────────────────────────────────────────────── */
.cal-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cal-titulo { font-size: 17px; font-weight: 700; flex: 1; text-align: center; }
.cal-nav { background: none; border: 1px solid var(--line); border-radius: 8px; width: 34px; height: 34px; padding: 0; font-size: 20px; line-height: 1; cursor: pointer; }
.cal-nav:hover { background: var(--soft); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 16px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); padding: 6px 0; text-transform: uppercase; letter-spacing: .5px; }
.cal-dia { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-height: 60px; cursor: pointer; transition: border-color .12s; }
.cal-dia:hover { border-color: var(--azul); }
.cal-vazio { min-height: 60px; }
.cal-num { font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; }
.cal-hoje .cal-num { background: var(--azul-solid); color: #fff; border-radius: 50%; font-size: 12px; }
.cal-com-prazo { background: var(--ambar-bg); }
.cal-com-fatal { background: var(--vermelho-bg); }
.cal-feriado-dia { opacity: 0.75; }
.cal-badges { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 4px; }
.cal-badge { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 10px; }
.cal-b-prazo { background: var(--ambar-bg); color: var(--ambar); }
.cal-b-fatal { background: var(--vermelho-bg); color: var(--vermelho); }
.cal-b-prev { background: var(--azul-bg); color: var(--azul); }
.cal-b-fer { display: inline-block; width: 6px; height: 6px; background: var(--muted); border-radius: 50%; vertical-align: middle; }
.cal-lista-dia { margin-top: 4px; }
.cal-evt { display: flex; align-items: flex-start; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; font-size: 13px; }
.cal-evt-tipo { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; white-space: nowrap; flex-shrink: 0; margin-top: 1px; }
.cal-evt-label { flex: 1; min-width: 0; }
.cal-evt .cal-baixa, .cal-evt .pill { flex-shrink: 0; align-self: center; margin-left: auto; }
.cal-evt-prazo { background: var(--ambar-bg); color: var(--ambar); }
.cal-evt-fatal { background: var(--vermelho-bg); color: var(--vermelho); }
.cal-evt-prev { background: var(--azul-bg); color: var(--azul); }
.cal-evt-fer { background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.cal-b-comp { background: var(--roxo-bg, #ece6f8); color: var(--roxo, #6b46c1); }
.cal-evt-comp { border: 1px solid rgba(0,0,0,.12); }
/* Cumpridas: permanecem no histórico do dia, com selo e visual atenuado. */
.cal-badge.cal-b-ok { background: rgba(99,209,154,.16); color: var(--ok, #63d19a); }
.cal-evt-ok { opacity: .75; }
.cal-evt-ok .cal-evt-label { text-decoration: line-through; }
#modal-dia .modal-box { max-height: 85vh; overflow-y: auto; }
.marc-auto-mini { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--ambar); background: var(--ambar-bg); padding: 1px 5px; border-radius: 6px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.modal-box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px 32px; min-width: 680px; max-width: 920px; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
.modal-box h3 { margin: 0 0 4px; font-size: 15px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.wf-modal-radio { display: flex; flex-direction: column; gap: 8px; }
.wf-radio-opt { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 13px; line-height: 1.4; }
.wf-radio-opt input { margin-top: 3px; flex-shrink: 0; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

.btn-copy-cnj { font-size: 10px; padding: 1px 5px; background: var(--azul-bg); border: 1px solid var(--azul-solid); border-radius: 4px; cursor: pointer; color: var(--azul-solid); vertical-align: middle; margin-left: 4px; }
.btn-copy-cnj:hover { background: var(--azul-solid); color: #fff; border-color: var(--azul-solid); }
.wf-cnj { font-size: 12.5px; font-family: monospace; color: var(--ink); white-space: nowrap; }

/* ===== Aba Atendimento / Intake ===== */
.at-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }
.at-step { font-size: 12.5px; font-weight: 600; padding: 8px 14px; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 8px; cursor: pointer; }
.at-step.active { background: var(--azul-solid); color: #fff; border-color: var(--azul-solid); }
.card-sec { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; background: var(--card); }
.card-sec h3 { font-size: 13px; margin: 0 0 10px; color: var(--azul); text-transform: uppercase; letter-spacing: .04em; }
.at-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; }
.at-grid > .full { grid-column: 1 / -1; }
.at-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.at-grid input, .at-grid select, .at-grid textarea { font: inherit; font-size: 14px; text-transform: none; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); width: 100%; box-sizing: border-box; }
.at-grid textarea { resize: vertical; }
.at-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.slbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--azul); margin: 12px 0 6px; }
.at-mck { display: flex; flex-wrap: wrap; gap: 6px; }
.at-mck label { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; font-size: 12.5px; cursor: pointer; user-select: none; }
.at-mck label:hover { border-color: var(--azul); }
.at-mck input { accent-color: var(--azul-solid); }
.at-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.at-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: var(--card); cursor: pointer; }
.at-item:hover { border-color: var(--azul); }
.at-item .ai-t { font-weight: 600; }
.at-item .ai-s { font-size: 12px; color: var(--muted); }
.at-doc-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; }
.at-doc-row .dt { font-size: 12.5px; }
button.ghost { background: none; border: 1px solid var(--line); color: var(--muted); }
button.ghost:hover { color: var(--ink); border-color: var(--azul); }
@media (max-width: 700px) { .at-grid { grid-template-columns: 1fr; } }

/* Fila de Solicitações (IA nativa + Cowork) */
.solic-ia { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; }
.mini-lbl { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.solic-ia select, .solic-ia input[type="text"], .solic-ia input:not([type]), .solic-instr, .solic-ia input[type="file"] { font: inherit; font-size: 13px; text-transform: none; font-weight: 400; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
.solic-anexos-lista { font-size: 12px; }
.solic-anexo-del { color: var(--erro, #e06666); font-weight: 700; }

/* ===== Aba Financeiro ===== */
#fin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fin-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.fin-card .fc-rot { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.fin-card .fc-val { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fin-tab { width: 100%; border-collapse: collapse; font-size: 13px; }
.fin-tab th, .fin-tab td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-tab th:first-child, .fin-tab td:first-child { text-align: left; }
.fin-tab th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* ===== Financeiro v2 (réplica multi-telas) ===== */
.fin-topo { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: space-between; margin-bottom: 12px; }
.fin-h3 { font-size: 17px; margin: 6px 0 10px; }
.fin-badge { background: #e05d5d; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; margin-left: 4px; }
.fin-alerta { display: flex; align-items: center; gap: 8px; background: rgba(246,173,85,.12); border: 1px solid rgba(246,173,85,.45); color: var(--ink); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }
.fin-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .fin-2col { grid-template-columns: 1fr; } }
.fin-donut-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.fin-leg { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.fin-leg-item { display: flex; align-items: center; gap: 7px; }
.fin-leg-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.fin-cli-card { border: 1px solid var(--line); border-radius: 10px; background: var(--card); margin-bottom: 10px; overflow: hidden; }
.fin-cli-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; }
.fin-cli-head:hover { background: var(--soft); }
.fin-cli-nome { font-weight: 700; }
.fin-cli-sub { font-size: 12px; color: var(--muted); }
.fin-cli-parts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fin-cli-body { padding: 4px 14px 12px; border-top: 1px solid var(--line); background: var(--bg); }
.fin-seta { color: var(--muted); font-size: 11px; width: 14px; }
.fin-part { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 12px; background: rgba(99,209,154,.14); color: var(--ok, #63d19a); }
.fin-tag { display: inline-block; font-size: 10px; padding: 1px 7px; border-radius: 10px; background: var(--line); color: var(--muted); }
.fin-warn { color: #f6ad55; font-size: 12px; }
.fin-mini { font-size: 12px; padding: 4px 11px; border-radius: 7px; }
.fin-link { background: none; border: none; color: var(--azul); cursor: pointer; font-size: 12.5px; padding: 2px 5px; }
.fin-link:hover { text-decoration: underline; background: none; }
.fin-link.ok { color: var(--ok, #63d19a); }
.fin-link.warn { color: #f6ad55; }
.fin-pill { font-size: 11px; padding: 2px 9px; border-radius: 12px; }
.fin-pill.ok { background: rgba(99,209,154,.15); color: var(--ok, #63d19a); }
.fin-pill.bad { background: rgba(224,93,93,.15); color: #e05d5d; }
.fin-pill.warn { background: rgba(246,173,85,.15); color: #f6ad55; }
.fin-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); cursor: pointer; }
.fin-tab-sm th, .fin-tab-sm td { padding: 8px 10px; font-size: 13.5px; }
.fin-tab tbody tr:hover td { background: var(--soft); }
.fin-tab tfoot td { background: var(--azul-bg); border-top: 2px solid var(--azul-solid); font-weight: 700; }
.fin-dl div { display: flex; gap: 10px; padding: 4px 0; font-size: 13.5px; border-bottom: 1px dashed var(--line-soft, var(--line)); }
.fin-dl div:last-child { border-bottom: none; }
.fin-dl span { width: 150px; color: var(--muted); font-size: 12px; flex-shrink: 0; }
.fin-part-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13.5px; border-bottom: 1px dashed var(--line); }
.fin-part-row:last-child { border-bottom: none; }
.fin-modal-box { max-width: 640px; width: 94vw; max-height: 88vh; overflow-y: auto; }
.fin-modal-box h3 { margin-top: 0; }
.fin-modal-box .at-grid input, .fin-modal-box .at-grid select, .fin-modal-box .at-grid textarea { background: var(--bg); }
.fin-progress { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.fin-progress > div { height: 100%; background: var(--ok, #63d19a); border-radius: 6px; transition: width .3s; }
.fin-passo { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 8px; }
.fin-passo-ic { font-size: 18px; flex-shrink: 0; }

/* Aprofundar caso (questionário complementar do Atendimento) */
.qhelp { display: none; width: 18px; height: 18px; border-radius: 50%; background: var(--azul-solid); color: #fff; font-size: 11px; font-weight: 700; align-items: center; justify-content: center; cursor: pointer; margin-left: 6px; line-height: 1; border: none; padding: 0; }
.at-mck label:has(input:checked) .qhelp { display: inline-flex; }
.qhelp:hover { background: var(--azul); }
.atp-campo { margin-bottom: 12px; }
.atp-campo > label { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }
.atp-campo input, .atp-campo select, .atp-campo textarea { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); width: 100%; box-sizing: border-box; }
.perg-radio { display: flex; gap: 16px; padding: 4px 0; }
.perg-radio label { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; color: var(--ink); text-transform: none; font-weight: 400; cursor: pointer; }
.perg-radio input { width: auto; accent-color: var(--azul-solid); }

/* ===== Editor de Modelos (3 colunas) ===== */
.edm-box { max-width: 960px; width: 96vw; max-height: 92vh; overflow-y: auto; }
.edm-box #edm-texto { width: 100%; box-sizing: border-box; min-height: 400px; resize: vertical; font-family: Consolas, monospace; font-size: 12.5px; line-height: 1.55; padding: 10px 12px; }
@media (max-width: 980px) { }
#edm-texto { flex: 1; min-height: 340px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-family: Consolas, monospace; font-size: 12px; line-height: 1.55; background: var(--bg); color: var(--ink); resize: vertical; }
.edm-prev { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; max-height: 260px; overflow-y: auto; font-size: 12px; line-height: 1.6; white-space: pre-wrap; margin-top: 8px; color: var(--ink); font-family: inherit; }

/* ===== Editor de documento estilo Word ===== */
.pjdoc-box { max-width: 960px; width: 97vw; max-height: 94vh; display: flex; flex-direction: column; overflow: hidden; }
.pjdoc-toolbar { display: flex; flex-wrap: wrap; gap: 3px; padding: 6px 8px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; margin: 8px 0 0; position: relative; z-index: 2; }
.pjdoc-toolbar button, .pjdoc-toolbar select { font-size: 12px; padding: 4px 9px; min-width: 30px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); color: var(--ink); cursor: pointer; }
.pjdoc-toolbar button:hover { background: var(--azul-solid); color: #fff; }
.pjdoc-sep { width: 1px; background: var(--line); margin: 0 4px; }
.pjdoc-rulerwrap { display: flex; background: var(--soft); border: 1px solid var(--line); border-bottom: none; margin-top: 8px; border-radius: 8px 8px 0 0; overflow-x: auto; }
.pjdoc-vspacer { width: 26px; flex-shrink: 0; border-right: 1px solid var(--line); }
.pjdoc-hruler { flex: 1; height: 26px; position: relative; overflow: hidden; }
.pjdoc-hruler-in { width: 21cm; height: 26px; margin: 0 auto; position: relative; font-size: 9px; color: var(--muted); }
.pjtick { position: absolute; top: 6px; border-left: 1px solid var(--muted); height: 14px; }
.pjtick-h { position: absolute; top: 13px; border-left: 1px solid var(--line); height: 7px; }
.pjnum { position: absolute; top: 8px; transform: translateX(-50%); line-height: 1; }
.pjdoc-bgL, .pjdoc-bgR { position: absolute; top: 0; height: 26px; background: repeating-linear-gradient(45deg, var(--line) 0, var(--line) 2px, transparent 2px, transparent 4px); }
.pjdoc-bgL { left: 0; } .pjdoc-bgR { right: 0; }
.pjdoc-scroll { overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 0 0 8px 8px; flex: 1; min-height: 300px; }
.pjdoc-flex { display: flex; align-items: flex-start; }
.pjdoc-vruler { width: 26px; flex-shrink: 0; background: var(--soft); border-right: 1px solid var(--line); position: sticky; left: 0; z-index: 1; }
.pjdoc-vruler-in { width: 26px; position: relative; font-size: 9px; color: var(--muted); }
.pjtick-v { position: absolute; left: 11px; border-top: 1px solid var(--muted); width: 14px; }
.pjtick-vh { position: absolute; left: 18px; border-top: 1px solid var(--line); width: 7px; }
.pjnum-v { position: absolute; left: 3px; transform: translateY(-50%); line-height: 1; }
.pjdoc-bgT, .pjdoc-bgB { position: absolute; left: 0; width: 26px; background: repeating-linear-gradient(135deg, var(--line) 0, var(--line) 2px, transparent 2px, transparent 4px); }
.pjdoc-bgT { top: 0; } .pjdoc-bgB { bottom: 0; }
.pjdoc-page { width: 21cm; min-height: 29.7cm; box-sizing: border-box; background: #f7f5ef; color: #111; box-shadow: 0 2px 10px rgba(0,0,0,.35); margin: 12px auto; }
.pjdoc-txt { min-height: 24cm; outline: none; font-family: Arial, sans-serif; font-size: 12pt; line-height: 1.5; text-align: justify; }
.pjdoc-txt p { margin: 0 0 6pt; }
.pjdoc-txt p.doc-titulo { font-weight: 700; text-align: center; margin-bottom: 12pt; }
.pjmk-pg { position: absolute; top: 0; height: 26px; width: 9px; cursor: ew-resize; z-index: 4; }
.pjmk-pgL { transform: translateX(-50%); } .pjmk-pgL::before { content: ""; position: absolute; top: 7px; left: 0; border-left: 8px solid #e07a7a; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.pjmk-pgR { transform: translateX(50%); } .pjmk-pgR::before { content: ""; position: absolute; top: 7px; right: 0; border-right: 8px solid #e07a7a; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.pjmk-vpg { position: absolute; left: 0; width: 26px; height: 9px; cursor: ns-resize; z-index: 4; }
.pjmk-vpgT { transform: translateY(-50%); } .pjmk-vpgT::before { content: ""; position: absolute; left: 7px; top: 0; border-top: 8px solid #e07a7a; border-left: 6px solid transparent; border-right: 6px solid transparent; }
.pjmk-vpgB { transform: translateY(50%); } .pjmk-vpgB::before { content: ""; position: absolute; left: 7px; bottom: 0; border-bottom: 8px solid #e07a7a; border-left: 6px solid transparent; border-right: 6px solid transparent; }
.pjmk { position: absolute; cursor: ew-resize; z-index: 5; width: 14px; height: 10px; }
.pjmk:hover { filter: brightness(1.25); }
.pjmk-fl { top: -1px; transform: translateX(-50%); } .pjmk-fl::before { content: ""; display: block; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid var(--azul); }
.pjmk-l { bottom: -1px; transform: translateX(-50%); } .pjmk-l::before { content: ""; display: block; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 9px solid var(--azul); }
.pjmk-r { bottom: -1px; transform: translateX(50%); } .pjmk-r::before { content: ""; display: block; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 9px solid var(--azul); }

/* Integração cruzada */
.cal-badge.cal-b-parcela { background: rgba(99,209,154,.16); color: var(--ok, #63d19a); }
.busca-link { cursor: pointer; }
.busca-link:hover { background: var(--soft); }

/* ===== Marcadores/tags (modelo Projuris) ===== */
.marc-linha { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.tag-marcador { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px; color: #fff; white-space: nowrap; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: filter .15s; border: 1px solid rgba(0,0,0,.12); }
.tag-marcador:hover { filter: brightness(1.12); }
.tag-marcador.marc-auto { border-style: dashed; border-color: rgba(0,0,0,.35); }
.marc-campos { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 4px 4px 12px 14px; border-bottom: 1px solid var(--line); }
.marc-campos label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.marc-campos input { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }
.marc-campos .mc-salvar { align-self: flex-end; }
.marc-auto-aviso { flex-basis: 100%; font-size: 11.5px; color: var(--ambar); background: var(--ambar-bg); border-radius: 6px; padding: 4px 8px; }
.marc-add { font-size: 11px; padding: 1px 7px; border: 1px dashed var(--line); border-radius: 6px; background: none; color: var(--muted); cursor: pointer; line-height: 1.5; }
.marc-add:hover { border-color: var(--azul); color: var(--azul); }
.marc-item { display: flex; gap: 8px; align-items: center; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.marc-item:last-child { border-bottom: none; }
/* ===== Agenda (central de marcadores) ===== */
.ag-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 9px 6px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ag-row:last-child { border-bottom: none; }
.ag-quando { min-width: 130px; }
.ag-proc { font-variant-numeric: tabular-nums; color: var(--muted); }
.ag-cli { font-weight: 600; }
.ag-grupo { margin-bottom: 14px; }
.ag-grupo-head { display: flex; gap: 8px; align-items: center; margin: 0 0 4px; }
/* Compromissos em COLUNAS alinhadas: Processo | Cliente | Polo ativo | Polo passivo | Data | Evento | Ciência | ação */
.agx-wrap { overflow-x: auto; }
.agx-head, .agx-row { display: grid; grid-template-columns: 172px minmax(110px,.9fr) minmax(115px,1fr) minmax(115px,1fr) 112px minmax(92px,.75fr) 172px 60px; gap: 10px; align-items: center; min-width: 1150px; }
.agx-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 6px 4px; border-bottom: 1px solid var(--line); }
.agx-row { padding: 9px 6px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.agx-row:last-child { border-bottom: none; }
.agx-row > span { min-width: 0; overflow-wrap: anywhere; }
.ag-cien { font-size: 11px; }
.ag-cien-btn { white-space: nowrap; }
/* ===== Kanban do Workflow ===== */
.kb-board { display: flex; gap: 10px; align-items: flex-start; overflow-x: auto; padding: 4px 0 12px; }
.kb-col { flex: 1 1 0; min-width: 210px; background: var(--soft, rgba(0,0,0,.04)); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.kb-col.kb-over { border-color: var(--azul-solid); background: var(--azul-bg); }
.kb-col-head { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 2px 4px 8px; }
.kb-n { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; font-size: 11.5px; }
.kb-col-corpo { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.kb-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: grab; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.kb-card:hover { border-color: var(--azul-solid); }
.kb-card.kb-dragging { opacity: .45; }
.kb-tit { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.kb-cnj { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kb-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.kb-resp { font-size: 11.5px; color: var(--azul); margin-top: 3px; font-weight: 600; }
.kb-vazia { color: var(--muted); text-align: center; font-size: 12px; margin: 8px 0; }
.marc-toggle { display: inline-flex; gap: 8px; align-items: center; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 12px; color: var(--muted); }
.marc-toggle.on { border-color: var(--azul-solid); color: var(--azul); background: var(--azul-bg); font-weight: 600; }
#marc-lista { max-height: 300px; overflow-y: auto; }

/* ===== WhatsApp contextual (logo em SVG — não depende da fonte do sistema) ===== */
.wa-btn { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; border-radius: 50%; background: #25d366; color: #fff !important; text-decoration: none; vertical-align: middle; margin-left: 3px; line-height: 1; flex-shrink: 0; }
.wa-btn svg { display: block; }
.wa-btn:hover { filter: brightness(1.1); text-decoration: none; }

/* ===== Cor v2 (pedido do usuário): cards coloridos, campos vivos, letras escuras ===== */
/* Campos de formulário: texto quase-preto, fundo branco e borda viva no claro. */
input, select, textarea { color: var(--ink); }
html:not([data-theme="dark"]) input,
html:not([data-theme="dark"]) select,
html:not([data-theme="dark"]) textarea {
  background: #ffffff; border-color: #bfb69d;
}
html:not([data-theme="dark"]) input:focus,
html:not([data-theme="dark"]) select:focus,
html:not([data-theme="dark"]) textarea:focus { border-color: var(--azul-solid); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--azul-solid); width: 15px; height: 15px; }
/* Cards de métricas VIVOS: fundo em degradê colorido + faixa + número na cor do card
   (ciclo da paleta, sem o vermelho — que fica reservado para alertas). */
html:not([data-theme="dark"]) :is(.cards, #fin-cards) > :is(.card, .fin-card) {
  border-top: 3px solid var(--azul-solid);
  background: linear-gradient(160deg, #d8e7f5 0%, #fbfcfe 78%);
  border-color: #b9d0e6; border-top-color: var(--azul-solid);
}
html:not([data-theme="dark"]) :is(.cards, #fin-cards) > :is(.card, .fin-card) :is(.val, .fc-val) { color: var(--azul-solid); }
html:not([data-theme="dark"]) :is(.cards, #fin-cards) > :is(.card, .fin-card):nth-child(5n+2) {
  background: linear-gradient(160deg, #dcedcd 0%, #fbfdf8 78%); border-color: #bcd8a4; border-top-color: var(--verde);
}
html:not([data-theme="dark"]) :is(.cards, #fin-cards) > :is(.card, .fin-card):nth-child(5n+2) :is(.val, .fc-val) { color: var(--verde); }
html:not([data-theme="dark"]) :is(.cards, #fin-cards) > :is(.card, .fin-card):nth-child(5n+3) {
  background: linear-gradient(160deg, #f5e7c0 0%, #fefcf5 78%); border-color: #e0c98d; border-top-color: var(--ambar);
}
html:not([data-theme="dark"]) :is(.cards, #fin-cards) > :is(.card, .fin-card):nth-child(5n+3) :is(.val, .fc-val) { color: var(--ambar); }
html:not([data-theme="dark"]) :is(.cards, #fin-cards) > :is(.card, .fin-card):nth-child(5n+4) {
  background: linear-gradient(160deg, #e5dcf7 0%, #fdfcfe 78%); border-color: #cbbcea; border-top-color: var(--roxo);
}
html:not([data-theme="dark"]) :is(.cards, #fin-cards) > :is(.card, .fin-card):nth-child(5n+4) :is(.val, .fc-val) { color: var(--roxo); }
html:not([data-theme="dark"]) :is(.cards, #fin-cards) > :is(.card, .fin-card):nth-child(5n) {
  background: linear-gradient(160deg, #cfeaea 0%, #f9fdfd 78%); border-color: #a4d2d2; border-top-color: #0f6b6b;
}
html:not([data-theme="dark"]) :is(.cards, #fin-cards) > :is(.card, .fin-card):nth-child(5n) :is(.val, .fc-val) { color: #0f6b6b; }
/* Cards de status do Workflow no mesmo espírito (Vencidas mantém o vermelho semântico). */
html:not([data-theme="dark"]) #wf-stats .wf-stat:nth-child(1) { background: linear-gradient(160deg,#d8e7f5,#fbfcfe 78%); border-color:#b9d0e6; }
html:not([data-theme="dark"]) #wf-stats .wf-stat:nth-child(1) .wf-n { color: var(--azul-solid); }
html:not([data-theme="dark"]) #wf-stats .wf-stat:nth-child(2) { background: linear-gradient(160deg,#f7ded6,#fefaf8 78%); border-color:#e4b8a9; }
html:not([data-theme="dark"]) #wf-stats .wf-stat:nth-child(3) { background: linear-gradient(160deg,#f5e7c0,#fefcf5 78%); border-color:#e0c98d; }
html:not([data-theme="dark"]) #wf-stats .wf-stat:nth-child(3) .wf-n { color: var(--ambar); }
html:not([data-theme="dark"]) #wf-stats .wf-stat:nth-child(4) { background: linear-gradient(160deg,#e5dcf7,#fdfcfe 78%); border-color:#cbbcea; }
html:not([data-theme="dark"]) #wf-stats .wf-stat:nth-child(4) .wf-n { color: var(--roxo); }
html:not([data-theme="dark"]) #wf-stats .wf-stat:nth-child(5) { background: linear-gradient(160deg,#cfeaea,#f9fdfd 78%); border-color:#a4d2d2; }
html:not([data-theme="dark"]) #wf-stats .wf-stat:nth-child(5) .wf-n { color: #0f6b6b; }
html:not([data-theme="dark"]) #wf-stats .wf-stat:nth-child(6) { background: linear-gradient(160deg,#dcedcd,#fbfdf8 78%); border-color:#bcd8a4; }
html:not([data-theme="dark"]) #wf-stats .wf-stat:nth-child(6) .wf-n { color: var(--verde); }
/* Título de cada aba com o fio dourado da marca. */
.tab > h2 { padding-left: 10px; border-left: 4px solid var(--ouro); }

/* Filtros do Workflow com BALÃO DE SELEÇÃO (rádio) e cor por grupo (sem vermelho):
   Status=azul · Responsável=verde · Tribunal=roxo · Ordenar por=âmbar. Vale nos 2 temas. */

/* ===== Modo claro "Papel & Marinho": profundidade e identidade (o escuro fica intacto) ===== */
/* Cabeçalho marinho com fio dourado — a marca do timbrado presente também no claro. */
html:not([data-theme="dark"]) header {
  background: linear-gradient(180deg, #1c2c48, #16233c);
  border-bottom: 2px solid var(--ouro);
}
html:not([data-theme="dark"]) header .t1 { color: #f2f5fa; }
html:not([data-theme="dark"]) header .t2 { color: #9fb0c8; }
html:not([data-theme="dark"]) header button {
  background: rgba(255,255,255,.07); color: #e8edf5; border-color: rgba(255,255,255,.18);
}
html:not([data-theme="dark"]) header button:hover { background: rgba(255,255,255,.14); }
html:not([data-theme="dark"]) header button.primary { background: var(--azul-solid); border-color: var(--azul-solid); color: #fff; }
html:not([data-theme="dark"]) header .usuario-chip { color: #cdd8e6; border-color: rgba(255,255,255,.2); }
/* Cartões e itens com sombra de papel (suave, dupla camada). */
html:not([data-theme="dark"]) .card,
html:not([data-theme="dark"]) .item,
html:not([data-theme="dark"]) .card-sec,
html:not([data-theme="dark"]) .fin-card {
  box-shadow: 0 1px 2px rgba(72,60,32,.05), 0 5px 16px rgba(72,60,32,.06);
}
/* Menu lateral: item ativo ganha o fio dourado da marca. */
html:not([data-theme="dark"]) nav#tabs button.active { box-shadow: inset 3px 0 0 var(--ouro); }
/* Tabelas e modais também respiram no claro. */
html:not([data-theme="dark"]) .modal-box { box-shadow: 0 8px 40px rgba(40,32,12,.18); }

/* ===== Harmonização visual (item 3): abas antigas no padrão das novas ===== */
/* Títulos de seção no mesmo porte do Financeiro/Atendimento (.fin-h3) */
h2 { font-size: 17px; margin: 0 0 12px; }
/* Cards de métricas (Início/Processos/Clientes) na densidade dos cards do Financeiro */
.card { padding: 13px 15px; border-radius: 10px; }
.card .val { font-size: 21px; }
.card .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
/* Filtros/sub-abas de todas as abas antigas com o visual das pílulas novas (.at-step) */
.filtro-int, .filtro-prazo, .filtro-arq, .filtro-trib {
  font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 8px;
  transition: background .15s, border-color .15s, color .15s;
}
.filtro-int.active, .filtro-prazo.active, .filtro-arq.active, .filtro-trib.active {
  background: var(--azul-solid); color: #fff; border-color: var(--azul-solid);
}
.filtro-int:hover, .filtro-prazo:hover, .filtro-arq:hover, .filtro-trib:hover { border-color: var(--azul); }

/* Varredura de cor nas LISTAS: borda lateral por significado (os 2 temas) */
.item.it-urgente { border-left: 4px solid var(--vermelho); }
.item.it-prazo { border-left: 4px solid var(--ambar); }
.item.it-informativo { border-left: 4px solid var(--azul); }
.doc-item.dt-estudo { border-left: 4px solid #0f6b6b; }
.doc-item.dt-peticao { border-left: 4px solid var(--roxo); }
.doc-item:not(.dt-estudo):not(.dt-peticao) { border-left: 4px solid var(--azul); }
.solic-card.sa-trabalhista { border-left: 4px solid var(--verde); }
.solic-card.sa-civel { border-left: 4px solid var(--azul); }
.solic-card.sa-previdenciario { border-left: 4px solid var(--ambar); }
.solic-card.sa-consumidor { border-left: 4px solid var(--roxo); }
.solic-card.sa-geral { border-left: 4px solid var(--ouro); }

/* Sugestão de peça no card da intimação */
.sug-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin:6px 0 2px; padding:6px 10px; border-radius:8px; background: var(--azul-bg); font-size: 12.5px; border-left: 3px solid var(--azul-solid); }

/* ─── Uniformização: barra de ações do documento e filtros da aba Documentos ─── */
.doc-head .acoes { gap: 8px; row-gap: 8px; }
.doc-head .acoes > button, .doc-head .acoes > select, .doc-head .acoes > .btn-link { height: 34px; box-sizing: border-box; display: inline-flex; align-items: center; padding: 0 12px; font-size: 13px; border-radius: 8px; margin: 0; white-space: nowrap; }
#documentos .doc-col > .form-inline { gap: 8px; align-items: center; }
#documentos .doc-col > .form-inline > select, #documentos .doc-col > .form-inline > input { height: 36px; box-sizing: border-box; font-size: 14px; padding-top: 0; padding-bottom: 0; }

/* ─── Janela de detalhes da tarefa (Workflow clean) ─── */
.wf-det-box { max-width: 880px; width: 94vw; max-height: 90vh; overflow-y: auto; }
.wf-det-box h3 { font-size: 17px; }
.wf-det-box .hint { background: none; padding: 0; }
.wf-det-box .teor { font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; }
.wf-det-box details > summary { cursor: pointer; color: var(--azul); font-size: 13.5px; }
.wf-det-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin-top: 14px; }
@media (max-width: 700px) { .wf-det-grid { grid-template-columns: 1fr; } }
.wf-det-campo .slbl { display: block; margin-bottom: 3px; font-size: 11.5px; }
.wf-det-campo > div { font-size: 15px; color: var(--ink); }
.wf-table tr.wf-click { cursor: pointer; }
.wf-table tr.wf-click:hover td { background: var(--soft); }

/* ─── Intimações: card consolidado + janela de detalhes ─── */
.teor-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.int-consol { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.int-consol .pill { font-size: 12px; }
.int-sug-mini { font-size: 12.5px; color: var(--muted); }
.int-det-form .form-linha { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 7px 0; }
.int-det-form .lbl-inline { min-width: 96px; font-weight: 600; font-size: 13px; }

/* Modais de 2º nível (abrem POR CIMA das janelas de detalhes) */
#finmodal, #modal-workflow, #cadcli-modal, #edit-modal, #wf-adm-modal { z-index: 2100; }
/* O cadastro rápido de cliente pode abrir A PARTIR de um modal de 2º nível
   (ex.: Delegar tarefa com cliente novo) — fica um degrau acima. */
#cadcli-modal { z-index: 2150; }

/* ─── Permissões: oculta ações destrutivas para quem não tem a capacidade excluir ───
   (conforto visual — a proteção real é a do servidor, que responde 403) ─── */
.cap-sem-excluir .link-danger:not([data-cancsolic]),
.cap-sem-excluir [data-estorno], .cap-sem-excluir [data-delav], .cap-sem-excluir [data-deldesp],
.cap-sem-excluir [data-delpl], .cap-sem-excluir #wf-det-excluir, .cap-sem-excluir #edm-restaurar,
.cap-sem-excluir #edm-excluir, .cap-sem-excluir .btn-restaurar, .cap-sem-excluir [data-delm],
.cap-sem-excluir [data-tpl-del], .cap-sem-excluir [data-del-end], .cap-sem-excluir [data-inativcli] { display: none !important; }

/* Timesheet / Produtividade (#46) — indicador do cronômetro */
.ts-cron { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); padding: 4px 12px; border: 1px solid var(--linha, #2a2f3a); border-radius: 20px; }
.ts-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.ts-dot.ativo { background: #42c98a; box-shadow: 0 0 0 3px rgba(66, 201, 138, .18); animation: tsPulse 1.6s ease-in-out infinite; }
.ts-dot.pausa { background: #d9a441; }
@keyframes tsPulse { 0%, 100% { opacity: 1 } 50% { opacity: .4 } }
@media (prefers-reduced-motion: reduce) { .ts-dot.ativo { animation: none } }

/* Configurações em grade de cartões coloridos: cada seção tem seu acento (--acc).
   Fechados formam a grade proporcional; o aberto ocupa a linha inteira. Preserva
   todo o conteúdo das seções. */
/* ─── Painel Gerencial (Início): KPIs 4×1 + gráficos lado a lado ─── */
#dash-gerencial { margin-bottom: 16px; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dash-head select { padding: 7px 10px; border-radius: 8px; max-width: 320px; }
.dash-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: stretch; margin-bottom: 14px; }
@media (max-width: 900px) { .dash-kpis { grid-template-columns: repeat(2, 1fr); } }
.dash-2col { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; align-items: stretch; margin-bottom: 14px; }
.dash-2col-b { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .dash-2col { grid-template-columns: 1fr; } }

.conf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: stretch; margin-top: 8px; }
@media (max-width: 900px) { .conf-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .conf-grid { grid-template-columns: 1fr; } }
.conf-card { --acc: var(--azul); border: 1px solid var(--line); border-left: 4px solid var(--acc); border-radius: 12px; background: var(--card); padding: 0 16px; transition: box-shadow .15s, transform .06s; }
.conf-card:hover { box-shadow: 0 3px 14px rgba(0, 0, 0, .12); }
.conf-card:hover .conf-tit { color: var(--acc); }
.conf-card > summary.conf-summary { list-style: none; cursor: pointer; padding: 15px 0; display: flex; align-items: center; gap: 12px; }
.conf-card > summary.conf-summary::-webkit-details-marker { display: none; }
.conf-card .conf-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--acc); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; opacity: .92; }
.conf-card .conf-txt { flex: 1; min-width: 0; }
.conf-card .conf-tit { font-weight: 600; font-size: 15px; transition: color .15s; }
.conf-card .conf-desc { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.conf-card > summary.conf-summary::after { content: "\25B8"; color: var(--muted); font-size: 12px; transition: transform .15s; flex-shrink: 0; }
.conf-card[open] > summary.conf-summary::after { transform: rotate(90deg); }
.conf-card[open] { grid-column: 1 / -1; box-shadow: 0 3px 18px rgba(0, 0, 0, .14); }
.conf-card[open] .conf-tit { color: var(--acc); }
.conf-card[open] .conf-desc { display: none; }
