#inv-input { display: none; }

.iv-rot {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-1);
}
.iv-doc-meta { font-size: 0.78rem; color: var(--text-1); line-height: 1.5; }
.iv-docnum { font-family: ui-monospace, Consolas, monospace; font-size: 0.8em; color: var(--text-1); }

.iv-cab-tit {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.iv-cab-tit h2 { font-size: 1.25rem; line-height: 1.3; margin: 0.15rem 0; }
.iv-novidades {
  margin: 0 0 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--match);
  background: var(--pos-bg);
  font-size: 0.85rem;
}

:root {
  --abas-bg: #1d3f66;
  --abas-borda: #15314f;
  --abas-texto: rgba(255,255,255,0.82);
  --sub-bg: #131f2e;
  --sub-borda: #1d3f66;
  --sub-hover: rgba(88,166,255,0.14);
  --sub-texto: #9fb8d6;
  --sub-texto-forte: #e6edf3;
}
html.theme-light {
  --abas-bg: var(--light-header);
  --abas-borda: var(--light-header-border);
  --abas-texto: rgba(255,255,255,0.88);
  --sub-bg: linear-gradient(to bottom, var(--light-control-2), var(--light-surface-2));
  --sub-borda: #b9cbe6;
  --sub-hover: rgba(77,124,169,0.16);
  --sub-texto: var(--light-control-text);
  --sub-texto-forte: var(--light-ink);
}

.iv-abas {
  display: flex;
  align-items: flex-end;
  gap: 0.2rem;
  flex-wrap: wrap;
  margin: 1.25rem 0 1rem;
  padding: 0.45rem 0.5rem 0;
  position: sticky;
  top: 44px;
  z-index: 20;
  background: linear-gradient(to bottom, var(--abas-bg), var(--abas-borda));
  border: 1px solid var(--abas-borda);
  border-bottom: 3px solid var(--accent);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 3px 10px rgba(2,33,93,0.18);
}
.iv-abas button {
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 0.5rem 0.95rem;
  color: var(--abas-texto);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.iv-abas button:hover { background: rgba(255,255,255,0.18); color: #fff; }
.iv-abas button:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.iv-abas button[aria-selected="true"] {
  position: relative;
  color: var(--accent);
  font-weight: 700;
  background: var(--bg-0);
  border-color: var(--bg-0);
  box-shadow: inset 0 3px 0 var(--accent), 0 -2px 8px rgba(0,0,0,0.14);
}
.iv-abas button[aria-selected="true"]::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 3px;
  background: var(--bg-0);
}

.tb-barra { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.tb-barra .filter-input { flex: 1 1 260px; max-width: 460px; }
.tb-info { font-size: 0.78rem; color: var(--text-1); }
.tb-pag { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-top: 0.6rem; }
.tb-num { text-align: right; white-space: nowrap; }
.tb-vazio { text-align: center; color: var(--text-1); font-style: italic; padding: 1rem; }
.tb-clicavel { cursor: pointer; }
.tb-abre { width: 1.5rem; color: var(--text-1); text-align: center; }
.tb-detalhe td { background: var(--bg-2); }

.iv-contrato {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  margin-bottom: 1rem;
  overflow: hidden;
}
.iv-contrato > *:not(.iv-contrato-cab) { margin-left: 1.1rem; margin-right: 1.1rem; }
.iv-contrato > :last-child { margin-bottom: 1rem; }
.iv-contrato-cab {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center;
  padding: 0.9rem 1.1rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--accent);
}
.iv-contrato-id { min-width: 0; }
.iv-selo {
  display: inline-block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--bg-1); background: var(--accent); border-radius: 4px; padding: 0.1rem 0.45rem; margin-right: 0.4rem;
}
.iv-contrato-ref { font-size: 0.78rem; color: var(--text-1); }
.iv-contrato-cab h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-0); margin: 0.35rem 0 0.15rem; word-break: break-word; }
.iv-contratada { font-weight: 600; color: var(--text-0); font-size: 0.9rem; }
.iv-contrato-cab .iv-abrir { text-decoration: none; border-bottom: 0; white-space: nowrap; }
.iv-contrato-num {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.6rem;
  margin-top: 1rem; margin-bottom: 1rem;
}
.iv-contrato-num > div { background: var(--bg-0); border: 1px solid var(--border); border-radius: 8px; padding: 0.55rem 0.75rem; }
.iv-contrato-num b { display: block; font-size: 1.05rem; color: var(--text-0); margin-top: 0.15rem; }
.iv-contrato-num i { font-style: normal; font-size: 0.78rem; color: var(--text-1); }
.iv-objeto { font-size: 0.88rem; line-height: 1.55; color: var(--text-0); margin-bottom: 0.9rem; }
.iv-objeto .iv-rot { margin-bottom: 0.2rem; }
.iv-exec {
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-0);
  padding: 0.55rem 0.8rem; margin-bottom: 0.9rem; font-size: 0.88rem; color: var(--text-0);
}
.iv-exec-num { display: flex; gap: 1.2rem; flex-wrap: wrap; margin: 0.25rem 0; }

.iv-partes { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.9rem; font-size: 0.88rem; color: var(--text-0); }
.iv-papel {
  display: inline-block; min-width: 92px; font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-1);
}
.iv-invalido { margin-left: 0.4rem; font-size: 0.7rem; color: var(--danger); border: 1px solid var(--danger); border-radius: 3px; padding: 0 4px; }

.iv-alertas { margin-bottom: 0.75rem; }
.iv-alerta { border-left: 3px solid var(--warn); padding: 0.4rem 0.75rem; margin-top: 0.35rem; font-size: 0.84rem; background: var(--bg-2); border-radius: 0 6px 6px 0; }
.iv-alerta.iv-grav-alta { border-left-color: var(--danger); }
.iv-alerta i { font-style: normal; color: var(--text-1); }
.iv-alerta p { margin-top: 0.2rem; color: var(--text-1); }
.iv-alerta blockquote { margin-top: 0.3rem; padding-left: 0.6rem; border-left: 2px solid var(--border); font-style: italic; color: var(--text-1); }

.iv-grupo { border-top: 1px solid var(--border); padding: 0.4rem 0; }
.iv-grupo > summary, .iv-sub > summary { cursor: pointer; font-weight: 600; font-size: 0.88rem; padding: 0.25rem 0; }
.iv-grupo summary i, .iv-sub summary i { font-style: normal; font-weight: 400; color: var(--text-1); }
.iv-sub { margin-left: 1rem; }
.iv-sub > summary { font-weight: 500; font-size: 0.84rem; }
.iv-grupo > summary, .iv-sub > summary { list-style: none; display: flex; align-items: center; gap: 0.4rem; }
.iv-grupo > summary::-webkit-details-marker, .iv-sub > summary::-webkit-details-marker { display: none; }
.iv-ico { flex: none; }
.iv-pasta { width: 18px; height: 15px; }
.iv-pasta-fundo { fill: #d9a21b; }
.iv-pasta-frente { fill: #f4c542; }
.iv-pasta-aberta { display: none; }
details[open] > summary > .iv-pasta .iv-pasta-fechada { display: none; }
details[open] > summary > .iv-pasta .iv-pasta-aberta { display: inline; }
.iv-ico-pdf { width: 16px; height: 20px; margin-top: 0.05rem; }
.iv-pdf-folha { fill: #fff; stroke: #9aa3ad; stroke-width: 1; }
.iv-pdf-dobra { fill: #e6e9ed; stroke: #9aa3ad; stroke-width: 1; stroke-linejoin: round; }
.iv-pdf-faixa { fill: #d93a32; }
.iv-ico-pdf text { fill: #fff; font: 700 4.6px/1 Arial, Helvetica, sans-serif; }
.iv-docs { list-style: none; display: flex; flex-direction: column; gap: 0.25rem; margin: 0.3rem 0 0.5rem; }
.iv-doc {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.35rem 0.6rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-1);
}
.iv-doc.iv-novo { border-color: var(--match); }
.iv-n { font-family: ui-monospace, Consolas, monospace; font-size: 0.72rem; color: var(--text-1); white-space: nowrap; padding-top: 0.15rem; }
.iv-doc-corpo { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.iv-doc-nome { font-size: 0.85rem; overflow-wrap: anywhere; }
.iv-doc-obs { font-size: 0.78rem; font-style: italic; }
.iv-doc-alerta { font-size: 0.72rem; color: var(--warn); font-weight: 600; }
.iv-pdf {
  white-space: nowrap; font-size: 0.75rem; font-weight: 600; color: var(--accent);
  text-decoration: none; border: 1px solid var(--border); border-radius: 4px; padding: 0.1rem 0.5rem;
}
.iv-pdf:hover { border-color: var(--accent); }
.iv-tag-novo {
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: #fff; background: var(--match); border-radius: 3px; padding: 0.05rem 0.4rem; white-space: nowrap;
}

.iv-secao { margin-bottom: 1.5rem; }
.iv-secao h3 { font-size: 0.98rem; margin-bottom: 0.1rem; }
.iv-secao .table-wrapper { margin-top: 0.5rem; }
.iv-env-lista + .iv-bases { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 2px solid var(--border); }
.iv-bases .tb-detalhe .iv-base + .iv-base { margin-top: 0.9rem; }
.iv-bases .tb-detalhe .dd-h4 { margin-bottom: 0.3rem; }
.iv-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  padding: 0.25rem;
  background: var(--sub-bg);
  border: 1px solid var(--sub-borda);
  border-radius: 8px;
  overflow: visible;
}
.iv-seg button {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.42rem 0.9rem;
  color: var(--sub-texto);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.iv-seg button:hover { background: var(--sub-hover); color: var(--sub-texto-forte); }
.iv-seg button:focus-visible { outline: 2px solid var(--abas-bg); outline-offset: 1px; }
.iv-seg button[aria-pressed="true"] {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(to bottom, var(--abas-bg), var(--abas-borda));
  border-color: var(--abas-borda);
  box-shadow: 0 2px 6px rgba(2,33,93,0.22);
}
.iv-chip {
  display: inline-block; font-size: 0.7rem; margin: 0.1rem 0.25rem 0.1rem 0; padding: 0.05rem 0.45rem;
  border-radius: 10px; background: var(--bg-2); color: var(--text-1); border: 1px solid var(--border); white-space: nowrap;
}
.iv-ocorr { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.82rem; }
.iv-ocorr a { color: var(--accent); }
.iv-trecho { color: var(--text-1); font-family: ui-monospace, Consolas, monospace; font-size: 0.76rem; overflow-wrap: anywhere; }

.iv-analise { background: var(--bg-1); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.2rem; font-size: 0.88rem; line-height: 1.65; }
.iv-analise h4 { margin: 0.9rem 0 0.3rem; color: var(--accent); }
.iv-analise p { margin-bottom: 0.45rem; }
.iv-analise li { margin-left: 1.2rem; }

.gr-area { position: relative; display: flex; gap: 0.75rem; }
.gr-svg {
  flex: 1; height: 70vh; min-height: 420px; background: var(--bg-1);
  border: 1px solid var(--border); border-radius: 8px; cursor: grab; touch-action: none;
}
.gr-svg:active { cursor: grabbing; }
.gr-aresta { stroke: var(--border); stroke-width: 1.2; }
.gr-aresta.apagado { opacity: 0.12; }
.gr-no { cursor: pointer; }
.gr-no circle { stroke: var(--bg-0); stroke-width: 2; }
.gr-no text { font-size: 10px; fill: var(--text-0); pointer-events: none; paint-order: stroke; stroke: var(--bg-1); stroke-width: 3px; }
.gr-no.sel circle { stroke: var(--accent); stroke-width: 4; }
.gr-no.achado circle { stroke: var(--warn); stroke-width: 5; }
.gr-no.apagado { opacity: 0.2; }
.gr-ficha {
  width: 330px; max-height: 70vh; overflow-y: auto; background: var(--bg-1);
  border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem 0.9rem; font-size: 0.8rem;
}
.gr-ficha-tit { font-size: 0.92rem; margin-bottom: 0.1rem; }
.gr-ficha-doc { font-family: ui-monospace, Consolas, monospace; color: var(--text-1); margin-bottom: 0.5rem; }
.gr-ficha-dl { display: grid; grid-template-columns: minmax(90px, 38%) 1fr; gap: 0.2rem 0.6rem; font-size: 0.78rem; }
.gr-ficha-dl dt { color: var(--text-1); overflow-wrap: anywhere; }
.gr-ficha-dl dd { overflow-wrap: anywhere; }

@media (max-width: 820px) {
  .gr-area { flex-direction: column; }
  .gr-ficha { width: auto; }
  .iv-abas { top: 44px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .iv-abas button { flex: 0 0 auto; white-space: nowrap; }
}

.iv-cliente {
  display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
  margin: -0.4rem 0 1rem; padding: 0.5rem 0.8rem;
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 6px; background: var(--bg-1); font-size: 0.9rem;
}

.dd-mudo { color: var(--text-1); }
.dd-mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; }
.dd-ruim { color: var(--danger); font-weight: 600; }
.dd-nota { font-size: 0.76rem; color: var(--text-1); margin-top: 1rem; line-height: 1.5; }
.dd-dica { font-size: 0.78rem; margin-top: 0.4rem; }
.dd-tot { font-size: 0.82rem; margin: 0.2rem 0 0.6rem; }
.dd-h4, .dd-quadro h4 { font-size: 0.86rem; margin: 0.9rem 0 0.4rem; }

.dd-creds { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.dd-cred {
  display: flex; flex-direction: column; gap: 0.1rem; text-align: left; min-width: 0; max-width: 340px;
  font: inherit; font-size: 0.8rem; padding: 0.45rem 0.7rem; cursor: pointer;
  background: var(--bg-1); color: var(--text-0); border: 1px solid var(--border); border-radius: 6px;
}
.dd-cred span, .dd-cred em { font-size: 0.72rem; color: var(--text-1); font-style: normal; }
.dd-cred[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.dd-local { margin-bottom: 0.8rem; }
.dd-filtros { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 0.5rem; }
.dd-f { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.72rem; color: var(--text-1); min-width: 0; }
.dd-f select { max-width: 340px; }
.dd-f-busca { flex: 1 1 220px; }
.dd-f-busca .filter-input { width: 100%; max-width: 360px; }
.dd-aviso {
  font-size: 0.8rem; padding: 0.4rem 0.7rem; border-radius: 6px; margin-bottom: 0.5rem;
  border: 1px solid var(--warn); background: var(--bg-2);
}
.dd-dist > summary { cursor: pointer; font-weight: 600; font-size: 0.84rem; padding: 0.3rem 0; }
.dd-dist .table-wrapper { margin-top: 0.4rem; }
.dd-dist-l.on td { background: var(--pos-bg); }
.dd-cartoes { margin-bottom: 0.9rem; }

.dd-barra-abas { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.dd-barra-abas .iv-seg { margin-bottom: 0; }

.dd-tab td { padding: 0.4rem 0.6rem; border-top: 1px solid var(--border); vertical-align: top; }
.dd-tab thead th { padding: 0.45rem 0.6rem; cursor: default; }
.dd-tab tfoot td { font-weight: 600; background: var(--bg-2); }
.dd-clicavel { cursor: pointer; }
.dd-clicavel:hover td { background: var(--bg-2); }
.dd-seta { display: inline-block; color: var(--text-1); transition: transform 0.15s; }
.aberto > td .dd-seta { transform: rotate(90deg); }
.dd-rolo { max-height: 60vh; overflow-y: auto; }
.dd-objeto { max-width: 360px; }
.dd-barra {
  display: inline-block; width: 60px; height: 6px; border-radius: 3px; vertical-align: middle;
  background: var(--bg-2); overflow: hidden; margin-right: 0.3rem;
}
.dd-barra i { display: block; height: 100%; background: var(--accent); }
.dd-barra.passou i { background: var(--danger); }

.dd-tag {
  display: inline-block; font-size: 0.66rem; line-height: 1.4; padding: 0 0.35rem; margin-left: 0.2rem;
  border-radius: 3px; border: 1px solid var(--border); color: var(--text-1); white-space: nowrap; vertical-align: middle;
}
.dd-tag.fora { color: var(--danger); border-color: var(--danger); }
.dd-tag.mudou { color: var(--warn); border-color: var(--warn); }
.dd-tag.difere { color: var(--accent); border-color: var(--accent); }
.dd-emen { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 400; color: var(--text-1); cursor: pointer; white-space: nowrap; }
.dd-emen.on { color: var(--accent); }
.dd-orig { display: block; font-size: 0.7rem; color: var(--text-1); }

.dd-contratos > tbody > .dd-c-l > td:first-child { white-space: nowrap; }
.dd-c-det > td { background: var(--bg-2); padding: 0.2rem 0.8rem 0.8rem; }
.dd-c-det .dd-h4:first-child { margin-top: 0.5rem; }
.dd-c-det .table-wrapper { background: var(--bg-1); }
.dd-chave-valor th { width: 200px; text-align: left; font-weight: 600; color: var(--text-1); padding: 0.4rem 0.6rem; border-top: 1px solid var(--border); vertical-align: top; }
.dd-chave-valor tr:first-child th, .dd-chave-valor tr:first-child td { border-top: 0; }
.dd-ver-pag { margin-top: 0.7rem; }
.dd-h4-emen { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.dd-saiba { font-size: 0.74rem; padding: 0.1rem 0.55rem; }

.dd-saiba-modal { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.dd-saiba-modal h4 { font-size: 0.88rem; margin: 0.9rem 0 0.35rem; color: var(--accent); }
.dd-saiba-modal ul { padding-left: 1.1rem; font-size: 0.86rem; line-height: 1.55; }
.dd-saiba-modal li { margin-bottom: 0.3rem; }
.dd-saiba-tipos { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 0.8rem; font-size: 0.86rem; line-height: 1.5; }
.dd-saiba-tipos dt { font-weight: 600; }
.dd-saiba-tipos dd { margin: 0; }

.dd-ficha-tr > td { background: var(--bg-2); padding: 0.6rem; }
.dd-ficha { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.6rem; }
.dd-ficha section { background: var(--bg-1); border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 0.65rem; font-size: 0.78rem; }
.dd-ficha section > div { display: grid; grid-template-columns: minmax(90px, 40%) 1fr; gap: 0.5rem; padding: 0.15rem 0; overflow-wrap: anywhere; }
.dd-ficha section > div > span:first-child { color: var(--text-1); }
.dd-ficha h5 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 0.3rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.dd-ficha .dd-larga { grid-column: 1 / -1; }

.dd-agrupar { display: flex; gap: 0.4rem 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 0.5rem; padding: 0.5rem 0.7rem; border: 1px solid var(--border); border-left: 3px solid var(--warn); border-radius: 6px; background: var(--bg-1); }
.dd-agrupar p { flex: 1 1 320px; font-size: 0.78rem; line-height: 1.5; margin: 0; }
.dd-quadros { display: flex; flex-direction: column; gap: 0.2rem; }
.dd-quadro { min-width: 0; }
.dd-quadro h4 { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.dd-pct { white-space: nowrap; }
.dd-q-det > td { background: var(--bg-2); }
.dd-q-cab { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.8rem; margin-bottom: 0.4rem; }

@media (max-width: 820px) {
  .dd-chave-valor th { width: auto; }
  .dd-f select { max-width: 100%; }
}
.dd-linha > td:first-child { white-space: nowrap; }
.dd-ficha h5 .dd-emen { text-transform: none; letter-spacing: 0; }
.iv-sem-nome { color: var(--text-1); }

.doc-link { color: var(--accent); text-decoration: none; border-bottom: 1px dotted currentColor; }
.doc-link:hover { color: var(--accent-h); border-bottom-style: solid; }
.doc-partes { display: inline-flex; gap: 0.2rem; margin-left: 0.35rem; vertical-align: middle; }
.doc-link.doc-parte {
  font-size: 0.7rem; font-weight: 600; line-height: 1.3; border: 1px solid var(--border); border-radius: 4px;
  padding: 0 0.3rem; background: var(--bg-2);
}
.doc-link.doc-parte:hover { border-color: var(--accent); }
.doc-link.doc-parte-conferir { border-color: var(--warn); color: var(--warn); }
.doc-link.doc-parte-texto { border-style: dashed; }
.doc-selo { display: inline-flex; vertical-align: -0.12em; margin-left: 0.25rem; cursor: help; }
.doc-selo svg { width: 0.8rem; height: 0.8rem; fill: currentColor; }
.doc-selo .doc-selo-traco { fill: none; stroke: var(--bg-1); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.doc-selo .doc-selo-aro { fill: none; stroke: currentColor; stroke-width: 1.4; }
.doc-selo-confirmado { color: var(--match); }
.doc-selo-localizado { color: var(--accent); }
.doc-selo-conferir { color: var(--warn); }
.doc-pp-falta { color: var(--danger); cursor: help; }
.doc-legenda { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.8rem; }
.doc-legenda-item { display: inline-flex; align-items: center; gap: 0.15rem; white-space: nowrap; }
.doc-legenda-item .doc-selo { margin-left: 0; }

.doc-painel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 200;
  width: min(760px, 92vw);
  display: flex; flex-direction: column;
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 28px rgba(0,0,0,0.3);
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.doc-painel[hidden] { display: none; }
.doc-painel.aberto { transform: translateX(0); }
.doc-painel-alca { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.doc-painel-alca:hover { background: rgba(88,166,255,0.3); }
.doc-painel-cab {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); background: var(--bg-2);
}
.doc-painel-titulo { flex: 1; min-width: 0; font-size: 0.85rem; font-weight: 600; color: var(--text-0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-painel-cab .btn-ghost { text-decoration: none; font-size: 0.78rem; padding: 0.25rem 0.6rem; }
.doc-painel-fechar { font: inherit; font-size: 1rem; line-height: 1; padding: 0.3rem 0.5rem; cursor: pointer;
  background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--text-0); }
.doc-painel-fechar:hover { border-color: var(--accent); color: var(--accent); }
.doc-painel-corpo { position: relative; flex: 1; }
.doc-painel-quadro { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.doc-painel-aviso {
  display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap;
  padding: 0.35rem 0.75rem; font-size: 0.8rem; color: var(--text-1);
  background: var(--bg-0); border-bottom: 1px solid var(--border);
}
.doc-painel-aviso[hidden] { display: none; }
.doc-painel-aviso a { color: var(--accent); font-weight: 600; }
.doc-painel-partes { display: flex; gap: 0.3rem; flex-wrap: wrap; padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--border); }
.doc-painel-partes[hidden] { display: none; }
.doc-painel-partes button {
  font: inherit; font-size: 0.78rem; cursor: pointer; padding: 0.2rem 0.6rem; border-radius: 5px;
  background: var(--bg-2); color: var(--text-0); border: 1px solid var(--border);
}
.doc-painel-partes button:hover { border-color: var(--accent); }
.doc-painel-partes button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg-1); font-weight: 600; }
@media (max-width: 700px) { .doc-painel { width: 100vw; } .doc-painel-alca { display: none; } }
.iv-pdf.doc-link, .btn-ghost.doc-link { border-bottom: 1px solid var(--border); }
.iv-pdf.doc-link:hover, .btn-ghost.doc-link:hover { border-color: var(--accent); }

.iv-classif { max-width: 420px; }
.iv-filtro-local {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  margin: 0.6rem 0 0.9rem; padding: 0.45rem 0.75rem; font-size: 0.85rem; color: var(--text-0);
  background: var(--bg-2); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 6px;
}
.iv-filtro-txt { flex: 1; min-width: 0; }
.iv-filtro-local .btn-ghost { font-size: 0.78rem; padding: 0.2rem 0.6rem; }
.iv-filtro-tag {
  display: inline-block; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--bg-1); background: var(--accent); border-radius: 4px; padding: 0.1rem 0.4rem; white-space: nowrap;
}
.iv-aba-filtro {
  display: inline-block; margin-left: 0.3rem; font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--abas-bg); background: #fff; border-radius: 3px; padding: 0 0.3rem;
  vertical-align: middle;
}
.iv-abas button[aria-selected="true"] .iv-aba-filtro { color: #fff; background: var(--accent); }
.dd-filtro { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-1); margin: 0.2rem 0 0.6rem; }
.dd-filtro b { color: var(--text-0); }

.iv-cab-botoes { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.iv-res-link { text-decoration: none; display: inline-flex; align-items: center; }
.iv-bolhas { position: fixed; left: 16px; bottom: 16px; z-index: 150; max-width: min(380px, calc(100vw - 32px)); display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.iv-bolhas-linha { display: flex; gap: 0.5rem; }
.iv-bolha {
  display: inline-flex; align-items: center; height: 40px; min-width: 40px; max-width: 40px; overflow: hidden;
  padding: 0 0.75rem 0 0; border-radius: 999px; cursor: pointer; white-space: nowrap;
  font: inherit; font-size: 0.8rem; font-weight: 600;
  border: 1px solid var(--accent); background: var(--bg-1); color: var(--accent);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18); transition: max-width 0.2s ease;
}
.iv-bolha > span { flex: 0 0 38px; text-align: center; font-size: 1rem; }
.iv-bolha > em { font-style: normal; color: var(--text-0); }
.iv-bolha:hover, .iv-bolha:focus-visible, .iv-bolha.aberta { max-width: 200px; }
.iv-bolha-aviso { border-color: var(--warn); color: var(--warn); }
.iv-bolha.aberta { background: var(--bg-2); }
.iv-modal.iv-ajuda { width: min(860px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.iv-ajuda h4 { font-size: 0.95rem; margin: 1rem 0 0.35rem; color: var(--accent); }
.iv-ajuda h5 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-1); margin: 0.9rem 0 0.35rem; }
.iv-atencao { font-size: 0.82rem; }
.iv-atencao td:first-child { white-space: nowrap; }
.iv-ajuda-nota { font-size: 0.78rem; color: var(--text-1); margin-top: 0.5rem; }
.iv-ajuda-contato { margin-top: 1rem; padding: 0.6rem 0.8rem; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 6px; background: var(--bg-2); font-size: 0.88rem; line-height: 1.6; }
.iv-ajuda-contato b { display: block; }
.iv-ajuda-contato a { color: var(--accent); font-weight: 600; }
.iv-lembrete-caixa {
  background: var(--bg-1); color: var(--text-0); border: 1px solid var(--border); border-left: 4px solid var(--warn);
  border-radius: 8px; padding: 0.7rem 0.9rem; box-shadow: 0 10px 30px rgba(0,0,0,0.25); font-size: 0.84rem; line-height: 1.5;
}
.iv-lembrete-caixa > b { color: var(--warn); }
.iv-lembrete-caixa p { margin: 0.35rem 0; }
.iv-lembrete-acoes { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; margin-top: 0.5rem; flex-wrap: wrap; }
.iv-lembrete-acoes a { color: var(--accent); font-weight: 600; }
.iv-modal-fundo {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0,0,0,0.5);
}
.iv-modal {
  width: min(520px, 100%); background: var(--bg-1); color: var(--text-0);
  border: 1px solid var(--border); border-top: 4px solid var(--accent); border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35); padding: 1.1rem 1.25rem;
}
.iv-modal h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.iv-modal-classif { font-weight: 600; color: var(--accent); font-size: 0.9rem; margin-bottom: 0.7rem; }
.iv-modal p { font-size: 0.88rem; line-height: 1.55; margin-bottom: 0.5rem; }
.iv-modal-acoes { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.9rem; }
.iv-modal-sim {
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  padding: 0.4rem 1.1rem; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--bg-1);
}
.iv-modal-sim:hover { background: var(--accent-h); border-color: var(--accent-h); }
