/* ============================================================
   portal-v2-detail.css — Detalhe do processo, impugnações,
                           habilitados, vencedores, documentos
   Template 4 — Área pública WBC7
   ============================================================ */

/* --- Botão voltar ------------------------------------------ */
.wbc-v2 .back-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 14px;
  font-weight: 600;
}

/* --- Layout do detalhe ------------------------------------- */
.wbc-v2 .det-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.wbc-v2 .det-main { flex: 1; min-width: 0; }

.wbc-v2 .det-side {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 102px;
}

/* --- Det card ---------------------------------------------- */
.wbc-v2 .det-card {
  background: #fff;
  border: 0.5px solid var(--gray-mid);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 12px;
}

.wbc-v2 .det-num-lbl { font-size: 13px; color: var(--gray-txt); }
.wbc-v2 .det-num { font-size: 20px; font-weight: 700; color: var(--blue); margin-bottom: 6px; }
.wbc-v2 .det-obj { font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.4; margin: 8px 0; }
.wbc-v2 .det-badges-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; align-items: center; }

.wbc-v2 .det-info-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.wbc-v2 .det-info-row .det-card { margin-bottom: 0; }

.wbc-v2 .df-lbl { font-size: 12px; color: #9aa2be; font-weight: 500; margin-bottom: 4px; }
.wbc-v2 .df-val { font-size: 15px; color: var(--text); font-weight: 500; }

/* --- Botões de ação no detalhe ----------------------------- */
.wbc-v2 .btn-acao {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  margin-bottom: 8px;
}

.wbc-v2 .btn-impug { background: #1a3fa8; color: #fff; }
.wbc-v2 .btn-impug:hover { background: #0d2a7a; }
.wbc-v2 .btn-escl { background: #1a3fa8; color: #fff; }
.wbc-v2 .btn-escl:hover { background: #0d2a7a; }

/* --- Datas compactas (dc-*) -------------------------------- */
.wbc-v2 .dc-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.wbc-v2 .dc-item { display: flex; flex-direction: column; }
.wbc-v2 .dc-lbl { font-size: 12px; color: #9aa2be; margin-bottom: 2px; }
.wbc-v2 .dc-val { font-size: 14px; font-weight: 600; color: var(--text); }
.wbc-v2 .dc-val.na { color: #c0c8e0; font-weight: 400; }

/* --- Anexos ------------------------------------------------ */
.wbc-v2 .anx-title { font-size: 13px; font-weight: 700; color: var(--gray-txt); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.wbc-v2 .anx-item { padding: 8px 0; border-bottom: 0.5px solid #f0f2f8; display: flex; flex-direction: column; gap: 5px; }
.wbc-v2 .anx-item:last-child { border-bottom: none; }
.wbc-v2 .anx-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.wbc-v2 .anx-nome { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); font-weight: 500; word-break: break-word; }
.wbc-v2 .anx-icon { flex-shrink: 0; color: var(--blue); }
.wbc-v2 .anx-empty { font-size: 14px; color: var(--gray-txt); }

/* --- Relatórios -------------------------------------------- */
.wbc-v2 .relat-item { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 0.5px solid #f0f2f8; cursor: pointer; border-radius: 4px; transition: background 0.12s; }
.wbc-v2 .relat-item:last-child { border-bottom: none; }
.wbc-v2 .relat-item:hover { background: #f5f7ff; }
.wbc-v2 .relat-icon { width: 28px; height: 28px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: #f0f2f8; border-radius: 5px; color: #6b7899; }
.wbc-v2 .relat-nome { font-size: 13px; color: var(--blue); font-weight: 500; flex: 1; }
.wbc-v2 .relat-arrow { font-size: 16px; color: #9aa2be; }
.wbc-v2 .relat-full-card { background: #fff; border: 0.5px solid var(--gray-mid); border-radius: var(--radius-lg); padding: 20px 24px; }
.wbc-v2 .relat-full-titulo { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #f0f2f8; }
.wbc-v2 .relat-section { font-size: 12px; font-weight: 700; color: var(--gray-txt); text-transform: uppercase; letter-spacing: 0.06em; margin: 16px 0 8px; }
.wbc-v2 .relat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wbc-v2 .relat-table th { background: #f5f7ff; color: var(--gray-txt); font-weight: 600; padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--gray-mid); }
.wbc-v2 .relat-table td { padding: 8px 10px; border-bottom: 0.5px solid #f0f2f8; color: var(--text); }
.wbc-v2 .relat-table tr:last-child td { border-bottom: none; }
.wbc-v2 .relat-table tr:hover td { background: #fafbff; }

/* --- Itens e Lotes ----------------------------------------- */
.wbc-v2 .itens-sec { margin-top: 18px; }
.wbc-v2 .itens-ttl { font-size: 14px; font-weight: 700; color: var(--gray-txt); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.wbc-v2 .itens-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.wbc-v2 .itens-table th { background: #f0f2f8; color: var(--gray-txt); font-weight: 600; padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--gray-mid); }
.wbc-v2 .itens-table td { padding: 6px 8px; border-bottom: 0.5px solid #f0f2f8; color: var(--text); vertical-align: top; }
.wbc-v2 .itens-table tr:last-child td { border-bottom: none; }
.wbc-v2 .itens-table .num-col { width: 50px; color: var(--gray-txt); }
.wbc-v2 .itens-table .val-col { text-align: right; white-space: nowrap; }

.wbc-v2 .lote-row { background: #eef1fb; cursor: pointer; user-select: none; }
.wbc-v2 .lote-row td { font-weight: 600; color: var(--blue); padding: 7px 8px; }
.wbc-v2 .lote-row:hover { background: #dde4f7; }
.wbc-v2 .lote-toggle { font-size: 12px; margin-right: 6px; display: inline-block; transition: transform 0.15s; }
.wbc-v2 .lote-toggle.open { transform: rotate(90deg); }
.wbc-v2 .item-sub td { background: #fafbff; }

/* --- Impugnações ------------------------------------------- */
.wbc-v2 .impug-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.wbc-v2 .impug-table th { background: #f5f7ff; color: var(--gray-txt); font-weight: 600; padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--gray-mid); }
.wbc-v2 .impug-table td { padding: 7px 10px; border-bottom: 0.5px solid #f0f2f8; color: var(--text); vertical-align: middle; }
.wbc-v2 .impug-table tr:last-child td { border-bottom: none; }
.wbc-v2 .impug-table tr:hover td { background: #fafbff; }
.wbc-v2 .impug-proto { color: var(--blue); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.wbc-v2 .impug-proto:hover { color: var(--blue-dk); }
.wbc-v2 .sit-def { background: #dff0ea; color: #0e7c3a; border-radius: 4px; padding: 2px 8px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.wbc-v2 .sit-ind { background: #fde8e8; color: #c0392b; border-radius: 4px; padding: 2px 8px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.wbc-v2 .sit-pend { background: #fff3dc; color: #7d5a00; border-radius: 4px; padding: 2px 8px; font-size: 11px; font-weight: 600; white-space: nowrap; }

.wbc-v2 .impug-detalhe-card { background: #fff; border: 0.5px solid var(--gray-mid); border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 14px; }
.wbc-v2 .impug-detalhe-titulo { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #f0f2f8; }
.wbc-v2 .impug-detalhe-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 20px; margin-bottom: 16px; }
.wbc-v2 .impug-detalhe-field { display: flex; flex-direction: column; gap: 3px; }
.wbc-v2 .impug-detalhe-lbl { font-size: 11px; color: #9aa2be; font-weight: 500; }
.wbc-v2 .impug-detalhe-val { font-size: 13px; color: var(--text); font-weight: 500; }
.wbc-v2 .impug-secao { font-size: 12px; font-weight: 700; color: var(--gray-txt); text-transform: uppercase; letter-spacing: 0.05em; margin: 16px 0 8px; padding-bottom: 5px; border-bottom: 1px solid #f0f2f8; }
.wbc-v2 .impug-texto { font-size: 13px; color: var(--text); line-height: 1.7; white-space: pre-wrap; background: #f8f9fc; border-radius: 6px; padding: 12px 14px; }

/* --- Habilitados ------------------------------------------- */
.wbc-v2 .hab-section { margin-bottom: 16px; }
.wbc-v2 .hab-section-titulo { font-size: 12px; font-weight: 700; color: var(--gray-txt); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #f0f2f8; }
.wbc-v2 .hab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.wbc-v2 .hab-empresa { background: #f8f9fc; border: 0.5px solid #e8eaf2; border-radius: 8px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; }
.wbc-v2 .hab-empresa-nome { font-size: 13px; font-weight: 600; color: var(--text); }
.wbc-v2 .hab-empresa-doc { font-size: 11px; color: #6b7899; }

/* --- Vencedores -------------------------------------------- */
.wbc-v2 .venc-item { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 0.5px solid #f0f2f8; }
.wbc-v2 .venc-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.wbc-v2 .venc-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.wbc-v2 .venc-nome { font-size: 13px; font-weight: 700; color: var(--text); }
.wbc-v2 .venc-doc { font-size: 11px; background: #f0f2f8; color: #6b7899; border-radius: 4px; padding: 2px 7px; white-space: nowrap; }
.wbc-v2 .venc-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.wbc-v2 .venc-table th { background: #f5f7ff; color: var(--gray-txt); font-weight: 600; padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--gray-mid); }
.wbc-v2 .venc-table th.r { text-align: right; }
.wbc-v2 .venc-table td { padding: 6px 10px; border-bottom: 0.5px solid #f0f2f8; color: var(--text); }
.wbc-v2 .venc-table td.r { text-align: right; font-variant-numeric: tabular-nums; }
.wbc-v2 .venc-table td.total { text-align: right; font-weight: 700; color: var(--blue); }
.wbc-v2 .venc-table tr:last-child td { border-bottom: none; }
.wbc-v2 .venc-table tr:hover td { background: #fafbff; }

/* --- Documentos do Processo -------------------------------- */
.wbc-v2 .doc-tabs { display: flex; gap: 0; border-bottom: 2px solid #e8eeff; margin-bottom: 14px; }
.wbc-v2 .doc-tab { padding: 8px 16px; font-size: 13px; font-weight: 500; color: var(--gray-txt); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color 0.15s, border-color 0.15s; white-space: nowrap; }
.wbc-v2 .doc-tab:hover { color: var(--blue); }
.wbc-v2 .doc-tab.active { color: var(--blue); font-weight: 700; border-bottom-color: var(--blue); }

.wbc-v2 .doc-fornec { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 0.5px solid #f0f2f8; }
.wbc-v2 .doc-fornec:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.wbc-v2 .doc-fornec-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wbc-v2 .doc-fornec-nome { font-size: 13px; font-weight: 600; color: var(--text); }
.wbc-v2 .doc-fornec-doc { font-size: 11px; background: #f0f2f8; color: #6b7899; border-radius: 4px; padding: 2px 7px; white-space: nowrap; }
.wbc-v2 .doc-anexo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 6px; }
.wbc-v2 .doc-anexo-item { display: flex; align-items: center; gap: 7px; background: #f8f9fc; border: 0.5px solid #e8eaf2; border-radius: 6px; padding: 7px 10px; font-size: 12px; color: var(--blue); cursor: pointer; transition: background 0.12s; word-break: break-word; }
.wbc-v2 .doc-anexo-item:hover { background: #e8eeff; }
.wbc-v2 .doc-anexo-item svg { flex-shrink: 0; color: #9aa2be; }
.wbc-v2 .doc-empty { font-size: 13px; color: #9aa2be; padding: 8px 0; }

/* --- Responsivo detalhe ------------------------------------ */
@media (max-width: 900px) {
  .wbc-v2 .det-layout { flex-direction: column; }
  .wbc-v2 .det-side { width: 100%; position: static; }
}

@media (max-width: 760px) {
  .wbc-v2 .det-layout { flex-direction: column; }
  .wbc-v2 .impug-detalhe-info { grid-template-columns: repeat(2, 1fr); }
}
