/* Orçamentos e recibos (17/10/2026). */
#page-documentos .doc-barra { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
#page-documentos .doc-abas { display: inline-flex; gap: 4px; background: var(--surface2, #f1f4f8); padding: 4px; border-radius: 12px; }
#page-documentos .doc-aba { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 8px 14px; border-radius: 9px; font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1; color: var(--navy); cursor: pointer; }
#page-documentos .doc-aba svg { width: 15px; height: 15px; }
#page-documentos .doc-aba.ativa { background: #fff; box-shadow: 0 1px 3px rgba(0, 31, 63, .12); color: var(--orange2, #e67e22); }
#page-documentos .doc-busca { position: relative; flex: 1 1 260px; min-width: 0; }
#page-documentos .doc-busca svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
#page-documentos .doc-busca input { padding-left: 34px; width: 100%; box-sizing: border-box; }
#page-documentos .doc-novo { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#page-documentos .doc-lista { display: flex; flex-direction: column; gap: 8px; }
#page-documentos .doc-linha { display: grid; grid-template-columns: 138px 118px minmax(0, 1fr) 112px auto; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
#page-documentos .doc-marca { font-size: 11px; font-weight: 700; text-align: center; border-radius: 8px; padding: 6px 4px; line-height: 1.2; }
/* Cada marca com a sua cor, sem confundir: Casa do Certificado em laranja; AgilizaID em grafite e dourado, como no site. */
#page-documentos .doc-marca-cdc { background: #fff1de; color: #9a4f00; box-shadow: inset 0 0 0 1px #f4c78d; }
#page-documentos .doc-marca-agz { background: #12151a; color: #e6c463; }
#page-documentos .doc-sub .doc-doc { display: inline-block; min-width: 132px; }
#page-documentos .doc-sub > span:not(.doc-chip) { margin-right: 10px; }
#page-documentos .doc-tit { font-size: 14px; color: var(--navy); overflow-wrap: anywhere; }
#page-documentos .doc-sub { font-size: 12px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
#page-documentos .doc-chip { display: inline-block; font-size: 11px; font-weight: 600; background: var(--surface2, #f1f4f8); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
#page-documentos .doc-valor { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
#page-documentos .doc-acoes { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
#page-documentos .doc-acoes .btn { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
#page-documentos .doc-acoes svg { width: 14px; height: 14px; }
#page-documentos .doc-perigo { color: var(--red, #dc2626); }
#page-documentos .doc-vazio { padding: 28px 12px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--border); border-radius: 14px; }
#page-documentos .doc-erro { color: var(--red, #dc2626); }
#page-documentos .doc-pag { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
@media (max-width: 760px) {
  #page-documentos .doc-linha { grid-template-columns: minmax(0, 1fr) auto; }
  #page-documentos .doc-info { grid-column: 1 / -1; grid-row: 3; }
  #page-documentos .doc-sub .doc-doc { min-width: 0; }
  #page-documentos .doc-marca { grid-column: 1 / -1; justify-self: start; padding: 3px 8px; }
  #page-documentos .doc-acoes { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Formulário */
#modal-documento .doc-modal { max-width: 900px; display: flex; flex-direction: column; overflow: hidden; max-height: calc(92vh / var(--uiz, 1)); }
#modal-documento .modal-header { padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
#modal-documento .doc-form { overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 16px 20px; }
#modal-documento section { display: flex; flex-direction: column; gap: 10px; }
#modal-documento .doc-param { background: var(--surface2, #f6f8fb); border-radius: 14px; padding: 12px 14px; }
#modal-documento .doc-grade { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
#modal-documento .doc-largo { grid-column: span 2; }
#modal-documento .doc-campo { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
#modal-documento .doc-campo > span { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
#modal-documento .doc-campo input, #modal-documento .doc-campo textarea { width: 100%; box-sizing: border-box; }
#modal-documento .doc-combo { position: relative; min-width: 0; }
#modal-documento .doc-combo input { padding-right: 34px; }
#modal-documento .doc-combo-seta { position: absolute; top: 0; right: 0; bottom: 0; width: 34px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 0 10px 10px 0; }
#modal-documento .doc-combo-seta:hover { color: var(--navy); }
#modal-documento .doc-combo-seta svg { width: 16px; height: 16px; }
#modal-documento .doc-combo-painel { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: min(420px, 82vw); max-height: 232px; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 31, 63, .16); padding: 4px; }
#modal-documento .doc-combo-op { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 8px; font: inherit; font-size: 13.5px; color: var(--navy); text-align: left; cursor: pointer; }
#modal-documento .doc-combo-op:hover, #modal-documento .doc-combo-op.luz { background: #fff4e6; }
#modal-documento .doc-combo-op.marcado { font-weight: 700; background: var(--surface2, #f6f8fb); }
#modal-documento .doc-combo-op.marcado.luz, #modal-documento .doc-combo-op.marcado:hover { background: #fff4e6; }
#modal-documento .doc-combo-op small { color: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
#modal-documento .doc-fixo { font-weight: 600; color: var(--navy); font-size: 14px; }
#modal-documento .doc-fixo small { font-weight: 400; color: var(--muted); }
#modal-documento .doc-assina-linha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#modal-documento .doc-assinante { max-width: 340px; }
#modal-documento .doc-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: #fff; border: 1px solid var(--border); border-radius: 11px; padding: 3px; align-self: flex-start; }
#modal-documento .doc-seg button { border: 0; background: none; padding: 7px 12px; border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.1; color: var(--navy); cursor: pointer; }
#modal-documento .doc-seg button.on { background: var(--navy); color: #fff; }
#modal-documento .doc-vinc { gap: 6px; }
#modal-documento .doc-vinc-res { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
#modal-documento .doc-vinc-op { text-align: left; border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 8px 10px; cursor: pointer; font: inherit; font-size: 13px; color: var(--navy); display: flex; flex-wrap: wrap; gap: 2px 8px; }
#modal-documento .doc-vinc-op:hover { border-color: rgba(230, 126, 34, .5); background: #fffaf3; }
#modal-documento .doc-vinc-op small { flex-basis: 100%; color: var(--muted); font-size: 12px; }
#modal-documento .doc-vinc-op span { color: var(--muted); }
#modal-documento .doc-vinc-dica { font-size: 12.5px; color: var(--muted); padding: 4px 2px; }
#modal-documento .doc-vinc-escolhido { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff; border: 1px solid rgba(15, 118, 110, .35); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; color: #0f5d56; }
#modal-documento .doc-vinc-escolhido svg { width: 16px; height: 16px; }
#modal-documento .doc-vinc-escolhido span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
#modal-documento .doc-sec-tit { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
#modal-documento .doc-itens { display: flex; flex-direction: column; gap: 6px; }
#modal-documento .doc-item { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.6fr) 64px 104px 96px 34px; gap: 6px; align-items: center; }
#modal-documento .doc-item input { width: 100%; box-sizing: border-box; min-width: 0; }
#modal-documento .doc-qtde, #modal-documento .doc-vu { text-align: right; font-variant-numeric: tabular-nums; }
#modal-documento .doc-it-total { text-align: right; font-size: 13px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
#modal-documento .doc-tirar svg { width: 15px; height: 15px; }
#modal-documento .doc-erro { color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 9px 12px; font-size: 13px; }
#modal-documento .doc-rodape { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: #fff; flex-wrap: wrap; }
#modal-documento .doc-total { margin-right: auto; display: flex; align-items: baseline; gap: 8px; }
#modal-documento .doc-total span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
#modal-documento .doc-total strong { font-size: 20px; color: var(--navy); font-variant-numeric: tabular-nums; }
#modal-documento .doc-rodape .btn { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 760px) {
  #modal-documento.overlay { padding: 0; }
  #modal-documento .doc-modal { max-width: none; height: 100%; max-height: none; border-radius: 0; }
  #modal-documento .doc-form { padding: 12px; }
  #modal-documento .doc-grade { grid-template-columns: minmax(0, 1fr); }
  #modal-documento .doc-largo { grid-column: auto; }
  #modal-documento .doc-item { grid-template-columns: minmax(0, 1fr) 64px 96px 34px; border: 1px solid var(--border); border-radius: 12px; padding: 8px; }
  #modal-documento .doc-item .doc-combo { grid-column: 1 / -1; }
  #modal-documento .doc-item [data-campo="detalhe"] { grid-column: 1 / -1; }
  #modal-documento .doc-it-total { grid-column: 1; text-align: left; grid-row: 3; }
  #modal-documento .doc-rodape { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
  #modal-documento .doc-total { flex-basis: 100%; }
  #modal-documento .doc-rodape .btn { flex: 1 1 0; justify-content: center; }
}

/* Enviar por e-mail (18/10/2026) */
#modal-documento .doc-aviso { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; border-radius: 10px; padding: 9px 12px; font-size: 13px; line-height: 1.45; }
#modal-documento .doc-env-anexo { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--navy); background: var(--surface2, #f6f8fb); border-radius: 10px; padding: 9px 12px; overflow-wrap: anywhere; }
#modal-documento .doc-env-anexo svg { width: 15px; height: 15px; flex: 0 0 15px; }
#modal-documento .doc-env-anexo small { color: var(--muted); }
#modal-documento #doc-env-status { font-size: 13px; font-weight: 600; color: var(--muted); }

/* Envio por e-mail: caixinha do papel timbrado junto do texto (antes esticava e ficava solta) */
#modal-documento .doc-env-chk { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 500; color: var(--navy); cursor: pointer; }
#modal-documento .doc-env-chk input { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; accent-color: var(--navy); }

/* Assinar com certificado (01/11/2026) */
#page-documentos .doc-chip-assinado { background: #dcfce7; color: #166534; }
#modal-documento .doc-ass-status { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--navy); line-height: 1.45; }
#modal-documento .doc-ass-ok { color: #166534; }
#modal-documento .doc-ass-fraco { font-size: 13px; font-weight: 500; color: var(--muted); }
#modal-documento .doc-ass-texto { margin: 10px 0 0; font-size: 14px; color: var(--navy); line-height: 1.5; }
#modal-documento .doc-ass-passos { margin: 12px 0; padding-left: 20px; font-size: 14px; color: var(--navy); line-height: 1.5; display: grid; gap: 8px; }
#modal-documento .doc-ass-passos a { color: var(--navy); font-weight: 600; text-decoration: underline; }
#modal-documento #doc-ass-corpo .doc-erro { margin-top: 12px; }
#modal-documento .doc-modal:has(#doc-ass-corpo) { max-width: 620px; }
#modal-documento #doc-ass-rodape { justify-content: flex-end; }
