* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #F5F7FB;
  color: #1F2937;
  margin: 0; padding: 46px 0 0;   /* offset do cabeçalho fixo */
  line-height: 1.55;
}
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: linear-gradient(135deg, #1F3A68 0%, #2C5396 100%);
  color: white;
  padding: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.16);
}
.header-inner {
  margin: 0; padding: 5px 28px;
  min-height: 46px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 9px; justify-self: start; }
.brand-mark { width: 32px; height: 32px; display: block; border-radius: 9px; flex: 0 0 auto; }
header h1 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.agent-monitor-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  margin: 0;
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 8px;
  background: rgba(255,255,255,0.12);
  color: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.agent-monitor-btn:hover { background: rgba(255,255,255,0.20); }
.agent-monitor-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94A3B8;
  box-shadow: 0 0 0 3px rgba(148,163,184,0.16);
}
.agent-monitor-dot.active {
  background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.24);
}
.agent-monitor-count {
  min-width: 22px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.20);
}

main { max-width: 1100px; margin: 32px auto; padding: 0 24px; }

.card {
  background: white;
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.04);
  margin-bottom: 24px;
}
.card h2 { margin: 0 0 6px; color: #1F3A68; font-size: 20px; }
.muted { color: #5B6470; font-size: 14px; margin: 0 0 18px; }
.hidden { display: none; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

.dropzone {
  border: 2px dashed #B8C4D6;
  border-radius: 12px;
  padding: 22px;
  background: #FAFBFD;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dropzone:hover { border-color: #1F3A68; background: #EAF1FB; }
.dropzone-header { display: flex; align-items: center; gap: 10px; }
.dropzone-icon { font-size: 26px; }
.dropzone-title { font-weight: 700; color: #1F3A68; font-size: 16px; }
.dropzone-hint { font-size: 12px; color: #5B6470; }
.dropzone-hint.subtle { font-style: italic; }

.tabs {
  display: inline-flex;
  background: #EAF1FB;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  width: fit-content;
}
.tab {
  background: transparent;
  color: #5B6470;
  border: none;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
  transition: all 0.15s;
}
.tab.active {
  background: #1F3A68;
  color: white;
}
.tab:hover:not(.active) { background: rgba(31, 58, 104, 0.08); }

.tab-pane { display: none; }
.tab-pane.active { display: flex; flex-direction: column; gap: 6px; }

.task-options-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  margin: 8px 0 18px;
}
.task-option {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.task-option-note {
  justify-content: flex-start;
}
.task-executor-static {
  padding: 10px 12px;
  border: 1px solid #B8C4D6;
  border-radius: 8px;
  background: white;
  color: #1F3A68;
  font-weight: 700;
  font-size: 13px;
}
.task-option label,
.task-copy-label {
  font-size: 12px;
  font-weight: 700;
  color: #1F3A68;
  text-transform: uppercase;
}
.task-key-panel {
  margin-top: 22px;
  border: 1px solid #B8C4D6;
  border-radius: 12px;
  padding: 18px;
  background: #F8FAFC;
}
.task-key-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.task-key-header h3 { margin: 0 0 4px; color: #1F3A68; font-size: 16px; }
.task-key-header .muted { margin-bottom: 0; }
.task-key-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 8px;
  background: #DBEAFE;
  color: #1E3A8A;
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}
.task-copy-box {
  width: 100%;
  box-sizing: border-box;
  margin: 6px 0 10px;
  padding: 12px;
  border: 1px solid #B8C4D6;
  border-radius: 8px;
  resize: vertical;
  background: white;
  color: #1F2937;
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}
.task-copy-btn { margin: 0 0 16px; }
.task-advanced {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed #c9d5e6;
}
.task-advanced summary {
  cursor: pointer;
  color: #51606e;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.task-advanced[open] summary {
  margin-bottom: 10px;
}
.task-result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 820px) {
  .task-options-grid { grid-template-columns: 1fr; }
  .task-key-header { flex-direction: column; }
}

.url-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #B8C4D6;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s;
}
.url-input:focus {
  outline: none;
  border-color: #1F3A68;
  box-shadow: 0 0 0 3px rgba(31, 58, 104, 0.12);
}

input[type=file] { font-size: 13px; }
.filename { font-size: 12px; color: #1F3A68; word-break: break-all; }

button {
  background: #1F3A68;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
  margin-top: 8px;
}
button:hover { background: #2C5396; }
button:active { transform: translateY(1px); }
button:disabled { background: #9CA3AF; cursor: not-allowed; }
button.secondary { background: #EAF1FB; color: #1F3A68; }
button.secondary:hover { background: #D4E0F2; }

.phase-bar { background: #EAF1FB; border-radius: 8px; height: 10px; overflow: hidden; margin: 8px 0; }
.phase-text { font-weight: 600; color: #1F3A68; margin: 8px 0 16px; }

.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.agent-card {
  background: #FAFBFD;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s;
}
.agent-card.done {
  background: #ECFDF5;
  border-color: #6EE7B7;
}
.agent-card.working {
  background: #FEF3C7;
  border-color: #FBBF24;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.7; } }
.agent-name { font-weight: 600; font-size: 13px; }
.agent-status { font-size: 18px; }

.agent-card { cursor: pointer; }
.agent-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(31, 58, 104, 0.10); }

.metrics { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0; }
.metric {
  background: #EAF1FB;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  color: #1F3A68;
  font-weight: 600;
}

.logs { margin-top: 16px; }
.logs summary { cursor: pointer; color: #5B6470; font-size: 13px; }
.logs pre {
  background: #1F2937;
  color: #D1D5DB;
  padding: 14px;
  border-radius: 10px;
  font-size: 12px;
  max-height: 280px;
  overflow: auto;
  margin-top: 8px;
  font-family: "SF Mono", Monaco, Consolas, monospace;
}

.downloads { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.download-card {
  background: #FAFBFD;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 18px;
  text-decoration: none;
  color: #1F3A68;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.15s;
}
.download-card:hover { background: #EAF1FB; border-color: #1F3A68; }
.download-icon { font-size: 28px; }

footer { text-align: center; padding: 32px 0 48px; color: #9CA3AF; font-size: 13px; }


/* Lista de arquivos acumulados (OSC) */
.files-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.file-name {
  color: #1F3A68;
  word-break: break-all;
  flex: 1;
  font-weight: 500;
}
.file-name small { color: #5B6470; font-weight: 400; margin-left: 6px; }
.file-remove {
  background: transparent;
  color: #C0392B;
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: bold;
  padding: 0 8px;
  cursor: pointer;
  margin: 0;
  line-height: 1.6;
  border-radius: 6px;
  min-width: 24px;
}
.file-remove:hover {
  background: rgba(192, 57, 43, 0.1);
  border-color: rgba(192, 57, 43, 0.2);
}
.file-counter {
  font-size: 12px;
  color: #1F3A68;
  font-weight: 600;
  padding: 4px 0;
}
.link-btn {
  background: transparent;
  color: #C0392B;
  border: none;
  font-size: 12px;
  text-decoration: underline;
  padding: 4px 0;
  margin: 0;
  cursor: pointer;
  align-self: flex-start;
  font-weight: 500;
}
.link-btn:hover { color: #922B21; background: transparent; }


/* === Tela de Aprovação Humana === */
.strategy-summary {
  background: #FAFBFD;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
}
.strategy-row {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  align-items: flex-start;
}
.strategy-row strong { color: #1F3A68; min-width: 130px; }

.match-score-bar {
  display: inline-block;
  background: #EAF1FB;
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 700;
  color: #1F3A68;
}
.match-score-bar.low { background: #FEE2E2; color: #991B1B; }
.match-score-bar.mid { background: #FEF3C7; color: #92400E; }
.match-score-bar.high { background: #D1FAE5; color: #065F46; }

.recomendacao-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
}
.recomendacao-badge.GO { background: #D1FAE5; color: #065F46; }
.recomendacao-badge.GO_COM_RESSALVAS { background: #FEF3C7; color: #92400E; }
.recomendacao-badge.NO_GO { background: #FEE2E2; color: #991B1B; }

.strategy-list {
  margin: 0;
  padding-left: 20px;
}
.strategy-list li { margin-bottom: 4px; font-size: 14px; }

.estrategia-lacunas-list {
  width: 100%;
  display: grid;
  gap: 10px;
}

.estrategia-lacuna-item {
  background: #fff;
}

.lacuna-ok {
  color: #047857;
  font-size: 12px;
  font-weight: 600;
}

.justificativa-box {
  background: white;
  border-left: 4px solid #1F3A68;
  padding: 12px 16px;
  border-radius: 4px;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.orientation-block {
  margin: 20px 0;
}
.orientation-label {
  display: block;
  font-weight: 600;
  color: #1F3A68;
  margin-bottom: 8px;
  font-size: 14px;
}
.orientation-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #B8C4D6;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 100px;
}
.orientation-input:focus {
  outline: none;
  border-color: #1F3A68;
  box-shadow: 0 0 0 3px rgba(31, 58, 104, 0.12);
}

.decision-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  justify-content: flex-end;
}
.btn-success { background: #047857; color: white; }
.btn-success:hover { background: #065F46; }
.btn-warning { background: #B45309; color: white; }
.btn-warning:hover { background: #92400E; }
.btn-danger { background: white; color: #991B1B; border: 1px solid #FCA5A5; }
.btn-danger:hover { background: #FEE2E2; }


/* === Histórico e Retomada === */
.resume-info {
  background: #FAFBFD;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 13px;
  color: #1F3A68;
}
.resume-info strong { color: #1F3A68; }
.resume-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #FAFBFD;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
}
.history-item-info { flex: 1; min-width: 0; }
.history-item-title {
  font-weight: 600;
  color: #1F3A68;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item-meta {
  font-size: 12px;
  color: #5B6470;
  margin-top: 2px;
}
.history-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}
.history-status.concluido { background: #D1FAE5; color: #065F46; }
.history-status.em_execucao { background: #FEF3C7; color: #92400E; }
.history-status.aguardando_decisao_humana { background: #DBEAFE; color: #1E40AF; }
.history-status.erro { background: #FEE2E2; color: #991B1B; }
.history-status.abortado { background: #FEE2E2; color: #991B1B; }
.history-status.pendente { background: #F3F4F6; color: #4B5563; }

.history-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.btn-mini {
  font-size: 12px;
  padding: 6px 12px;
  margin: 0;
  border-radius: 6px;
}

/* === Modal de Inspeção de Agente === */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  background: white;
  border-radius: 16px;
  width: min(900px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: linear-gradient(135deg, #1F3A68 0%, #2C5396 100%);
  color: white;
}
.modal-header h3 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-close {
  background: rgba(255,255,255,0.15); color: white;
  border: none; width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer; font-size: 16px;
  margin: 0; padding: 0;
}
.modal-close:hover { background: rgba(255,255,255,0.30); }
.modal-body {
  padding: 22px 26px;
  overflow-y: auto;
  flex: 1;
}

.agent-section { margin-bottom: 22px; }
.agent-section h4 {
  margin: 0 0 8px;
  color: #1F3A68;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.agent-section p, .agent-section li { font-size: 14px; line-height: 1.55; }
.agent-section .field-row {
  display: flex; gap: 10px; padding: 6px 0;
  border-bottom: 1px solid #F1F5F9;
}
.agent-section .field-row strong { min-width: 180px; color: #1F3A68; font-size: 13px; }
.agent-section .field-row span { font-size: 14px; flex: 1; }

.kv-table {
  width: 100%; border-collapse: collapse; margin-top: 4px;
}
.kv-table th, .kv-table td {
  text-align: left; padding: 6px 10px; border-bottom: 1px solid #F1F5F9;
  font-size: 13px;
}
.kv-table th { background: #F8FAFC; color: #1F3A68; font-weight: 600; font-size: 12px; }

.agent-logs-box {
  background: #1F2937; color: #D1D5DB;
  padding: 12px; border-radius: 8px;
  font-size: 12px; font-family: "SF Mono", Monaco, Consolas, monospace;
  max-height: 280px; overflow: auto; white-space: pre-wrap;
}
.agent-monitor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.agent-monitor-metric {
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px;
  background: #F8FAFC;
}
.agent-monitor-metric strong { display: block; font-size: 24px; color: #1F3A68; line-height: 1; }
.agent-monitor-metric span { display: block; color: #5B6470; font-size: 12px; margin-top: 6px; }
.agent-monitor-list {
  display: grid;
  gap: 8px;
}
.agent-monitor-row {
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
}
.agent-monitor-row-title {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  font-weight: 700;
  color: #1F3A68;
}
.agent-monitor-row-meta {
  color: #5B6470;
  font-size: 12px;
  margin-top: 3px;
}
.agent-monitor-log {
  margin-top: 6px;
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: 11px;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 820px) {
  .agent-monitor-grid { grid-template-columns: 1fr 1fr; }
  .agent-monitor-btn span:nth-child(2) { display: none; }
}

.empty-state {
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  color: #5B6470;
}

.narrative-section {
  background: #FAFBFD;
  border-left: 3px solid #1F3A68;
  padding: 10px 14px;
  margin-bottom: 10px;
  border-radius: 4px;
}
.narrative-section h5 {
  margin: 0 0 6px;
  color: #1F3A68;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.narrative-section p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.score-badge.good { background: #D1FAE5; color: #065F46; }
.score-badge.mid { background: #FEF3C7; color: #92400E; }
.score-badge.bad { background: #FEE2E2; color: #991B1B; }

/* === Pendências Formais === */
.pendencias-summary {
  display: flex; gap: 8px; flex-wrap: wrap;
  background: #FAFBFD;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}
.pendencias-summary .metric { background: #EAF1FB; }
.pendencias-summary .metric.danger { background: #FEE2E2; color: #991B1B; }
.pendencias-summary .metric.success { background: #D1FAE5; color: #065F46; }
.pendencias-summary .metric.warn { background: #FEF3C7; color: #92400E; }

.pendencias-list {
  display: flex; flex-direction: column; gap: 10px;
  margin: 12px 0;
}
.pendencia-item {
  background: #FAFBFD;
  border: 1px solid #E5E7EB;
  border-left: 4px solid #5B6470;
  border-radius: 10px;
  padding: 14px 18px;
  transition: all 0.2s;
}
.pendencia-item.status-pendente { border-left-color: #DC2626; }
.pendencia-item.status-verificando { border-left-color: #F59E0B; background: #FEF9E7; }
.pendencia-item.status-resolvido { border-left-color: #047857; background: #ECFDF5; }
.pendencia-item.status-rejeitado { border-left-color: #DC2626; background: #FEF2F2; }
.pendencia-item.status-ignorado { border-left-color: #9CA3AF; opacity: 0.7; }

.pendencia-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.pendencia-titulo { font-weight: 600; color: #1F3A68; font-size: 14px; flex: 1; }
.pendencia-titulo.resolvido { text-decoration: line-through; color: #5B6470; }
.pendencia-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.pendencia-badge.pendente { background: #FEE2E2; color: #991B1B; }
.pendencia-badge.verificando { background: #FEF3C7; color: #92400E; }
.pendencia-badge.resolvido { background: #D1FAE5; color: #065F46; }
.pendencia-badge.rejeitado { background: #FEE2E2; color: #991B1B; }
.pendencia-badge.ignorado { background: #F3F4F6; color: #4B5563; }

.pendencia-origem {
  font-size: 11px; color: #5B6470; font-style: italic;
  margin-bottom: 8px;
}
.pendencia-arquivo {
  font-size: 12px; color: #1F3A68;
  padding: 6px 10px;
  background: white;
  border-radius: 6px;
  margin: 6px 0;
}
.pendencia-parecer {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 8px;
  white-space: pre-wrap;
  line-height: 1.5;
}
.pendencia-parecer.ok { background: #D1FAE5; color: #065F46; }
.pendencia-parecer.fail { background: #FEE2E2; color: #991B1B; }

.pendencia-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 10px;
  align-items: center;
}
.pendencia-actions input[type=file] { font-size: 12px; }
.pendencia-actions .btn-mini { font-size: 12px; padding: 6px 12px; margin: 0; }
.pendencia-actions .btn-ignore {
  background: white; color: #5B6470; border: 1px solid #CBD5E1;
  font-size: 12px; padding: 6px 10px; margin: 0;
}
.pendencia-actions .btn-ignore:hover { background: #F8FAFC; }

.pendencias-actions {
  margin-top: 18px; display: flex; gap: 10px; justify-content: flex-end;
}

.spinner-inline {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid #FBBF24;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Cabeçalho de projeto === */
.project-header {
  background: linear-gradient(135deg, #1F3A68 0%, #2C5396 100%);
  color: white;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.project-header-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.project-header-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.project-header-info { flex: 1; min-width: 0; }
.project-header-osc {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
}
.project-header-edital {
  opacity: 0.9;
  font-size: 13px;
  margin-top: 2px;
  font-style: italic;
}
.project-header-meta {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.85;
}
.project-header-meta span:not(:empty) {
  background: rgba(255,255,255,0.13);
  padding: 2px 8px;
  border-radius: 999px;
}
.project-header .phase-bar {
  background: rgba(255,255,255,0.2);
  margin-top: 12px;
}
.project-header #btn-abortar {
  flex-shrink: 0;
}

/* === Painel de documentos === */
.docs-panel {
  background: #FAFBFD;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
}
.docs-panel summary {
  cursor: pointer;
  color: #1F3A68;
  font-size: 14px;
  list-style: none;
}
.docs-panel summary::-webkit-details-marker { display: none; }
.docs-panel[open] summary { margin-bottom: 10px; }
.docs-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 720px) { .docs-content { grid-template-columns: 1fr; } }
.docs-section h4 {
  margin: 4px 0 8px;
  color: #1F3A68;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.doc-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  margin-bottom: 5px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.doc-link:hover { border-color: #1F3A68; background: #EAF1FB; }
.doc-link .doc-name { color: #1F3A68; flex: 1; word-break: break-all; }
.doc-link .doc-chars { color: #5B6470; font-size: 11px; margin-left: 8px; }
.doc-link .doc-error { color: #C0392B; }

/* === Feed de atividade promovido === */
.activity-feed {
  background: #1F2937;
  color: #E5E7EB;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.activity-feed-label {
  background: #DC2626;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}
.activity-feed-items {
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: 12px;
  flex: 1;
  min-width: 0;
  max-height: 90px;
  overflow: hidden;
  line-height: 1.6;
}
.activity-feed-items .act-row {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-feed-items .act-tool { color: #FBBF24; }
.activity-feed-items .act-thought { color: #93C5FD; }
.activity-feed-items .act-system { color: #6EE7B7; }

.cadastrador-live-panel {
  margin: 0 0 16px;
  border-radius: 8px;
  border: 1px solid #c7d7ec;
  background: #f8fbff;
  overflow: hidden;
}
.cadastrador-live-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #1f3f70;
  color: #fff;
}
.cadastrador-live-header h3 {
  margin: 0;
  font-size: 1.05em;
}
.cadastrador-live-header p {
  margin: 4px 0 0;
  color: #dbeafe;
  font-size: 0.9em;
}
.cadastrador-live-status {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.74em;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}
.cadastrador-live-status.running { background: #fee2e2; color: #9f1239; }
.cadastrador-live-status.queued { background: #fef3c7; color: #92400e; }
.cadastrador-live-status.done { background: #d4f0db; color: #1d6b3a; }
.cadastrador-live-status.error { background: #ffd1d1; color: #a02020; }
.cadastrador-live-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
}
.cadastrador-live-metrics div {
  border: 1px solid #dbe4f0;
  border-radius: 6px;
  background: #fff;
  padding: 8px;
}
.cadastrador-live-metrics strong {
  display: block;
  color: #1f3f70;
  font-size: 1.15em;
  line-height: 1;
}
.cadastrador-live-metrics span {
  display: block;
  margin-top: 3px;
  color: #607080;
  font-size: 0.76em;
}
.cadastrador-live-current {
  margin: 0 12px 10px;
  border-left: 3px solid #1f3f70;
  background: #eef6ff;
  padding: 7px 9px;
  color: #1a3a52;
  font-size: 0.86em;
}
.cadastrador-live-events {
  margin: 0 12px 12px;
  max-height: 280px;
  overflow: auto;
  border-radius: 6px;
  background: #172233;
  padding: 8px;
  font-family: Consolas, "Courier New", monospace;
}
.cadastrador-live-event {
  display: grid;
  grid-template-columns: 72px 120px minmax(0, 1fr);
  gap: 6px;
  padding: 3px 0;
  color: #dbeafe;
  font-size: 0.78em;
}
.cadastrador-live-event.ferramenta .cadastrador-live-msg { color: #fbbf24; }
.cadastrador-live-event.texto .cadastrador-live-msg { color: #93c5fd; }
.cadastrador-live-event.documento .cadastrador-live-msg { color: #6ee7b7; }
.cadastrador-live-event.erro .cadastrador-live-msg { color: #fca5a5; }
.cadastrador-live-event.alerta .cadastrador-live-msg { color: #fde68a; }
.cadastrador-live-time,
.cadastrador-live-agent {
  color: #94a3b8;
}
.cadastrador-live-msg {
  min-width: 0;
  overflow-wrap: anywhere;
}
.cadastrador-live-footer {
  padding: 0 12px 12px;
  color: #607080;
  font-size: 0.78em;
}

/* === Timeline de fases === */
.phases-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0;
}
.phase-block {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 10px;
  background: #F8FAFC;
  border-left: 4px solid #CBD5E1;
}
.phase-block.active { border-left-color: #FBBF24; background: #FFFBEB; }
.phase-block.done { border-left-color: #047857; background: #ECFDF5; }
.phase-label {
  font-weight: 700;
  color: #1F3A68;
  font-size: 13px;
  min-width: 170px;
  flex-shrink: 0;
  padding-top: 6px;
}
.phase-agents {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}
.phase-agents .agent-card {
  flex: 1 1 180px;
  min-width: 160px;
  padding: 10px 12px;
  background: white;
}
.agent-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 11px;
}
.agent-time { color: #5B6470; font-weight: normal; }
.agent-card.stalled {
  background: #FEE2E2;
  border-color: #FCA5A5;
}
.agent-card.stalled .agent-time { color: #991B1B; font-weight: 600; }

/* === Quick actions (preview buttons) === */
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.quick-actions button {
  background: #EAF1FB;
  color: #1F3A68;
  border: 1px solid #B8C4D6;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 8px;
  margin: 0;
}
.quick-actions button:hover { background: #D4E0F2; }

/* === Modal wide (resumo executivo) === */
.modal-card-wide {
  width: min(1100px, 95vw);
  max-height: 90vh;
}

/* === Preview de documento === */
.doc-preview-text {
  background: #1F2937;
  color: #D1D5DB;
  padding: 14px;
  border-radius: 8px;
  font-size: 12px;
  font-family: "SF Mono", Monaco, Consolas, monospace;
  max-height: 60vh;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}
.doc-preview-meta {
  background: #EAF1FB;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #1F3A68;
}

/* === Resumo Executivo (modal grande) === */
.exec-block {
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 14px;
  background: white;
}
.exec-block h4 {
  margin: 0 0 8px;
  color: #1F3A68;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #F1F5F9;
  padding-bottom: 6px;
}
.exec-block p { font-size: 13px; line-height: 1.55; margin: 6px 0; }

/* === Chat com Estrategista no checkpoint === */
.chat-panel {
  background: #FAFBFD;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-panel-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  color: #1F3A68;
  font-size: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #E5E7EB;
}
.chat-panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.btn-agent-notifications {
  background: #EAF1FB;
  color: #1F3A68;
  border: 1px solid #B8C4D6;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  margin: 0;
  white-space: nowrap;
}
.btn-agent-notifications:hover:not(:disabled) { background: #DCE8F8; }
.btn-agent-notifications.enabled {
  background: #D4F0DB;
  border-color: #7EC693;
  color: #1D6B3A;
}
.btn-agent-notifications.blocked {
  background: #FFD1D1;
  border-color: #F59B9B;
  color: #A02020;
}
.agent-notification-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(380px, calc(100vw - 36px));
  background: #1F3A68;
  color: white;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(31, 58, 104, 0.28);
  padding: 12px 14px;
  z-index: 2500;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.agent-notification-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.agent-notification-toast strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}
.agent-notification-toast span {
  display: block;
  font-size: 12px;
  line-height: 1.4;
}
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 0;
}
.chat-empty {
  color: #9CA3AF;
  font-style: italic;
  font-size: 13px;
  text-align: center;
  padding: 16px;
}
.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.chat-bubble.user {
  background: #1F3A68;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-bubble.estrategista {
  background: white;
  color: #1F2937;
  align-self: flex-start;
  border: 1px solid #E5E7EB;
  border-bottom-left-radius: 4px;
}
.chat-bubble-meta {
  font-size: 11px;
  opacity: 0.7;
  margin-bottom: 4px;
  font-weight: 600;
}
.chat-bubble.user .chat-bubble-meta { color: #B8C4D6; }
.chat-bubble.estrategista .chat-bubble-meta { color: #5B6470; }

.chat-attachments-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-chat-attach {
  background: #EAF1FB;
  color: #1F3A68;
  border: 1px solid #B8C4D6;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  margin: 0;
}
.btn-chat-attach:hover:not(:disabled) { background: #DCE8F8; }
.btn-chat-attach:disabled { opacity: 0.65; cursor: not-allowed; }
.chat-files-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.chat-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  background: #F1F5F9;
  border: 1px solid #D8E0EA;
  border-radius: 999px;
  color: #1F3A68;
  font-size: 12px;
  padding: 5px 8px;
}
.chat-file-chip button {
  border: none;
  background: transparent;
  color: #607080;
  cursor: pointer;
  font-weight: 700;
  padding: 0;
  line-height: 1;
}
.chat-attachments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  white-space: normal;
}
.chat-attachment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.chat-bubble.estrategista .chat-attachment {
  background: #F8FAFC;
  border-color: #E1E7EF;
}
.chat-attachment-name {
  overflow-wrap: anywhere;
  font-weight: 600;
  font-size: 12px;
}
.chat-attachment small {
  grid-column: 1 / -1;
  opacity: 0.8;
  font-size: 11px;
}
.chat-attachment-badge {
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.chat-attachment-badge.lido { background: #d4f0db; color: #1d6b3a; }
.chat-attachment-badge.lido_ocr { background: #dbeafe; color: #1d4f91; }
.chat-attachment-badge.vazio { background: #fef3c7; color: #9a6f00; }
.chat-attachment-badge.erro { background: #ffd1d1; color: #a02020; }
.chat-attachment-badge.enviando { background: #EAF1FB; color: #1F3A68; }

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.chat-textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #B8C4D6;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 60px;
}
.chat-textarea:focus {
  outline: none;
  border-color: #1F3A68;
  box-shadow: 0 0 0 3px rgba(31, 58, 104, 0.12);
}
.btn-chat-send {
  background: #1F3A68;
  color: white;
  border: none;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}
.btn-chat-send:hover:not(:disabled) { background: #2C5396; }
.btn-chat-send:disabled { background: #9CA3AF; cursor: not-allowed; }
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  align-self: flex-start;
  width: fit-content;
}
.chat-typing span {
  width: 8px; height: 8px; background: #9CA3AF; border-radius: 50%;
  animation: bounce 1.4s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* === Print stylesheet (para exportar como PDF) === */
@media print {
  /* Esconde tudo exceto a approval-section */
  body * { visibility: hidden; }
  #approval-section, #approval-section * { visibility: visible; }
  #approval-section {
    position: absolute;
    left: 0; top: 0; right: 0;
    margin: 0;
    padding: 24px;
    box-shadow: none;
    border-radius: 0;
    background: white;
    max-width: 100%;
  }

  /* Esconde elementos interativos */
  .chat-input-row,
  .decision-buttons,
  #btn-export-pdf,
  .modal,
  header,
  footer { display: none !important; }

  /* Ajusta cores para impressão */
  .chat-bubble.user {
    background: #E5E7EB !important;
    color: #1F2937 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .chat-bubble.estrategista {
    background: white !important;
    border: 1px solid #999 !important;
    color: #1F2937 !important;
  }
  .strategy-summary, .chat-panel {
    border: 1px solid #999 !important;
    background: white !important;
    page-break-inside: avoid;
  }
  .chat-messages {
    max-height: none !important;
    overflow: visible !important;
  }
  .chat-bubble { page-break-inside: avoid; }
  .strategy-row { page-break-inside: avoid; }

  /* Título do print */
  #approval-section h2 {
    color: #1F3A68 !important;
    border-bottom: 2px solid #1F3A68;
    padding-bottom: 8px;
    margin-bottom: 12px;
  }

  /* Adiciona data/hora no print */
  #approval-section h2::after {
    content: " — Exportado em " attr(data-print-date);
    font-size: 12px;
    font-weight: normal;
    color: #5B6470;
  }

  @page {
    size: A4;
    margin: 15mm 12mm;
  }
}

/* ============================================================
   Navegação por tabs (Projetos / OSCs)
   ============================================================ */
.main-nav {
  display: flex;
  gap: 4px;
  margin: 0;
  border-bottom: none;
  flex-wrap: wrap;
  justify-self: center;
}
.nav-tab {
  background: transparent;
  color: #fff;
  border: none;
  padding: 7px 12px;
  font-size: 0.86em;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  border-radius: 6px 6px 0 0;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s;
}
.nav-tab:hover {
  background: rgba(255, 255, 255, 0.08);
}
.nav-tab.active {
  border-bottom-color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.section-header-row h2 { margin: 0; }
.form-actions-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
  justify-content: flex-end;
}

/* ============================================================
   Lista de OSCs cadastradas
   ============================================================ */
.projetos-wide,
.osc-list-wide,
.editais-list-wide {
  width: min(calc(100vw - 20px), 1560px);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}
.osc-dashboard {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}
.osc-filter-card {
  min-height: 68px;
  min-width: 0;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fbff;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  color: #1F3A68;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.osc-filter-card:hover {
  border-color: #4a90e2;
  background: #eef6ff;
}
.osc-filter-card.active {
  border-color: #1F3A68;
  background: #e8f0fb;
  box-shadow: inset 0 0 0 1px #1F3A68;
}
.osc-filter-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.osc-filter-label {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.osc-filter-hint {
  font-size: 10.5px;
  color: #607080;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.osc-card-call-cadastrador {
  color: #1f3f70;
  font-weight: 700;
}
.edital-filter-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 14px;
}
.edital-filter-tab {
  min-width: 0;
  min-height: 46px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fbff;
  color: #1F3A68;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  font-weight: 700;
  text-align: left;
}
.edital-filter-tab:hover {
  border-color: #8fb2dc;
  background: #f1f7ff;
}
.edital-filter-tab.active {
  border-color: #1F3A68;
  background: #e8f0fb;
  box-shadow: inset 0 0 0 1px #1F3A68;
}
.edital-filter-tab span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.edital-filter-tab strong {
  border-radius: 999px;
  background: #fff;
  color: #1F3A68;
  min-width: 28px;
  padding: 2px 8px;
  text-align: center;
}
.editais-list-wide .edital-list-card {
  min-height: 76px;
}
.editais-list-wide .osc-card-info {
  min-width: 0;
}
.edital-ready-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  white-space: nowrap;
}
.edital-ready-pronto_para_producao {
  background: #d7f7df;
  color: #075c2a;
}
.edital-ready-revisar {
  background: #fff3c4;
  color: #7a4b00;
}
.edital-ready-bloqueado {
  background: #ffd7d7;
  color: #8a1111;
}
.edital-ready-nao_avaliado {
  background: #e8edf5;
  color: #526274;
}
.edital-aptidao-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
  white-space: nowrap;
}
.edital-aptidao-apto {
  background: #d7f7df;
  color: #075c2a;
}
.edital-aptidao-inapto {
  background: #ffd7d7;
  color: #8a1111;
}
.edital-aptidao-nao_validado {
  background: #e8edf5;
  color: #526274;
}
.edital-aptidao-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.edital-formulario-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
  white-space: nowrap;
  background: #e8eef7;
  color: #1d3b66;
}
.edital-formulario-simulado,
.edital-formulario-nao_aplicavel {
  background: #d1fae5;
  color: #047857;
}
.edital-formulario-pendente_simulacao,
.edital-formulario-nao_avaliado {
  background: #fef3c7;
  color: #92400e;
}
.edital-formulario-bloqueado {
  background: #fee2e2;
  color: #991b1b;
}
.edital-orcamento-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
  white-space: nowrap;
  background: #e8eef7;
  color: #1d3b66;
}
.edital-orcamento-mapeado,
.edital-orcamento-nao_exige_detalhamento {
  background: #d1fae5;
  color: #047857;
}
.edital-orcamento-pendente_modelo,
.edital-orcamento-nao_avaliado {
  background: #fef3c7;
  color: #92400e;
}
.edital-orcamento-bloqueado {
  background: #fee2e2;
  color: #991b1b;
}
.edital-aptidao-panel {
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fbff;
  margin: 0 0 14px;
  padding: 14px;
}
.edital-aptidao-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.edital-aptidao-header h3 {
  margin: 0 0 4px;
  color: #1f3f70;
}
.edital-aptidao-reasons {
  border-left: 4px solid #1f3f70;
  background: #fff;
  border-radius: 6px;
  color: #334a68;
  font-size: 13px;
  margin: 8px 0 0;
  padding: 10px 12px;
}
.edital-aptidao-reasons p {
  margin: 0 0 8px;
}
.edital-aptidao-reasons ul {
  margin: 0;
  padding-left: 18px;
}
.edital-aptidao-result {
  margin-top: 12px;
}
.edital-formulario-summary {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  color: #334a68;
  font-size: 13px;
}
.edital-readiness-reasons {
  border: 1px solid #dbe4f0;
  border-left: 4px solid #1f3f70;
  border-radius: 8px;
  background: #f8fbff;
  color: #334a68;
  font-size: 13px;
  margin: 0 0 14px;
  padding: 10px 14px;
}
.edital-readiness-reasons ul {
  margin: 0;
  padding-left: 18px;
}
.osc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e4e7ea;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.osc-card:hover {
  border-color: #4a90e2;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
}
.osc-card-icon {
  font-size: 1.55em;
  flex-shrink: 0;
}
.osc-card-info {
  flex: 1;
  min-width: 0;
}
.osc-card-name {
  font-weight: 600;
  font-size: 1em;
  color: #1a3a52;
  margin-bottom: 2px;
}
.osc-card-mainline {
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
}
.osc-card-cnpj {
  font-size: 0.85em;
  color: #607080;
  font-family: 'Consolas', monospace;
}
.osc-card-meta {
  font-size: 0.82em;
  color: #607080;
  margin-top: 4px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.osc-card-areas {
  max-width: 540px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.osc-card-meta .badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.osc-card-status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.78em;
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
}
.osc-card-status.ativo,
.osc-card-status.saneada { background: #d4f0db; color: #1d6b3a; }
.osc-card-status.documentos_recebidos,
.osc-card-status.na_fila_cadastrador { background: #e5edff; color: #23457a; }
.osc-card-status.em_cadastro,
.osc-card-status.saneamento_solicitado,
.osc-card-status.saneamento_em_execucao { background: #fef3c7; color: #8a5c00; }
.osc-card-status.cadastro_desatualizado,
.osc-card-status.pronto_para_saneamento,
.osc-card-status.saneamento_desatualizado,
.osc-card-status.saneamento_pendente { background: #fff1d6; color: #9a5d00; }
.osc-card-status.incompleto,
.osc-card-status.cadastro_incompleto,
.osc-card-status.saneada_com_bloqueio { background: #ffe1d0; color: #aa4d00; }
.osc-card-status.erro,
.osc-card-status.cadastro_com_erro { background: #ffd1d1; color: #a02020; }
.osc-stage-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef6ef;
  color: #24663a;
  font-weight: 700;
}
.osc-stage-tag.warn { background: #fff1d6; color: #9a5d00; }
.osc-stage-tag.danger { background: #ffe1d0; color: #aa4d00; }

@media (max-width: 1100px) {
  .projetos-wide,
  .osc-list-wide,
  .editais-list-wide {
    width: auto;
    margin-left: 0;
    transform: none;
  }
  .osc-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .edital-filter-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cert-vencidas { color: #c93030; font-weight: 600; }
.cert-vencendo { color: #c97500; font-weight: 600; }

/* ============================================================
   Tela de detalhe da OSC
   ============================================================ */
.osc-det-actions {
  display: flex;
  gap: 8px;
}
.osc-det-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #f5f7fa;
  border-radius: 6px;
  margin: 16px 0;
  font-size: 0.9em;
}
.osc-det-bar .field {
  display: flex;
  flex-direction: column;
}
.osc-det-bar .field-label {
  font-size: 0.75em;
  text-transform: uppercase;
  color: #607080;
  letter-spacing: 0.05em;
}
.osc-det-bar .field-value {
  font-weight: 600;
  color: #1a3a52;
}
.osc-det-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.osc-det-block {
  background: #fff;
  border: 1px solid #e4e7ea;
  border-radius: 6px;
  padding: 14px 16px;
}
.osc-det-block h3 {
  margin: 0 0 10px 0;
  font-size: 0.95em;
  color: #1a3a52;
}
.osc-det-block .row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #f0f2f5;
  font-size: 0.88em;
}
.osc-det-block .row:last-child { border-bottom: none; }
.osc-det-block .row .label { color: #607080; }
.osc-det-block .row .value { font-weight: 500; color: #1a3a52; text-align: right; }

.cert-list .cert-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f2f5;
  font-size: 0.88em;
  align-items: center;
}
.cert-item .cert-tipo { font-weight: 500; }
.cert-item .cert-venc { font-family: 'Consolas', monospace; color: #607080; font-size: 0.85em; }
.cert-item .cert-status {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.78em;
  font-weight: 600;
  text-transform: uppercase;
}
.cert-status.vigente       { background: #d4f0db; color: #1d6b3a; }
.cert-status.vencendo      { background: #fef3c7; color: #9a6f00; }
.cert-status.vencida       { background: #ffd1d1; color: #a02020; }
.cert-status.indeterminado { background: #e4e7ea; color: #607080; }

.doc-list-osc {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.osc-det-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.osc-det-block-header h3 {
  margin: 0;
}
.doc-list-osc a {
  padding: 6px 8px;
  border-radius: 4px;
  text-decoration: none;
  color: #1a3a52;
  font-size: 0.88em;
}
.doc-list-osc a:hover { background: #f0f2f5; }
.doc-list-osc .doc-read-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  color: #1a3a52;
  font-size: 0.88em;
}
.doc-list-osc .doc-read-name {
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 0;
  font-size: 1em;
  line-height: 1.35;
}
.doc-read-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.doc-list-osc .doc-read-item small,
.doc-list-osc .doc-read-item .doc-cadastro-error {
  color: #607080;
  font-size: 0.78em;
}
.doc-list-osc .doc-read-item .doc-cadastro-error {
  color: #a02020;
}
.doc-read-badge {
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}
.doc-read-badge.lido { background: #d4f0db; color: #1d6b3a; }
.doc-read-badge.lido_ocr { background: #dbeafe; color: #1d4f91; }
.doc-read-badge.vazio { background: #fef3c7; color: #9a6f00; }
.doc-read-badge.arquivo_ausente { background: #fee2e2; color: #991b1b; }
.doc-read-badge.erro { background: #ffd1d1; color: #a02020; }
.doc-read-badge.sem_registro { background: #e4e7ea; color: #607080; }
.doc-read-item.status-erro { border-color: #ffd1d1; background: #fff8f8; }
.doc-read-item.status-vazio { border-color: #fef3c7; background: #fffaf0; }
.doc-read-item.status-arquivo_ausente { border-color: #fee2e2; background: #fff8f8; }
.doc-cadastro-badge {
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}
.doc-cadastro-badge.usado { background: #d4f0db; color: #1d6b3a; }
.doc-cadastro-badge.em_cadastro { background: #dbeafe; color: #1d4f91; }
.doc-cadastro-badge.nao_usado { background: #f1f3f5; color: #51606e; }
.doc-saneamento-badge {
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}
.doc-saneamento-badge.aprovado { background: #d4f0db; color: #1d6b3a; }
.doc-saneamento-badge.revisar { background: #fef3c7; color: #9a6f00; }
.doc-saneamento-badge.reprovado { background: #ffd1d1; color: #a02020; }
.doc-saneamento-badge.nao_saneado { background: #e4e7ea; color: #607080; }
.doc-saneamento-note { color: #51606e; }
.doc-read-item.saneamento-aprovado { border-color: #d4f0db; }
.doc-read-item.saneamento-revisar { border-color: #fef3c7; }
.doc-read-item.saneamento-reprovado { border-color: #ffd1d1; background: #fff8f8; }
.doc-cadastrar-btn {
  border: 1px solid #1f3f70;
  background: #fff;
  color: #1f3f70;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.78em;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.doc-cadastrar-btn:hover { background: #edf3fb; }
.doc-cadastrar-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}
.doc-batch-cadastrar-btn {
  border: 1px solid #1f3f70;
  background: #1f3f70;
  color: #fff;
  border-radius: 4px;
  padding: 5px 9px;
  font-size: 0.78em;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.doc-batch-cadastrar-btn:hover { background: #17325c; }
.doc-batch-cadastrar-btn:disabled {
  background: #e4e7ea;
  border-color: #d0d7de;
  color: #607080;
  cursor: not-allowed;
}

.osc-saneamento-panel {
  border: 1px solid #dbe5f2;
  background: #f8fbff;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 16px 0;
}
.osc-saneamento-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.osc-saneamento-header h3 {
  margin: 0 0 4px;
  color: #1a3a52;
  font-size: 1em;
}
.osc-saneamento-header .muted { margin: 0; }
.osc-saneamento-btn {
  border: 0;
  border-radius: 7px;
  background: #1f3f70;
  color: #fff;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.osc-saneamento-btn:hover { background: #18345d; }
.osc-saneamento-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}
.osc-saneamento-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.osc-saneamento-metrics span {
  border: 1px solid #dbe5f2;
  border-radius: 7px;
  background: #fff;
  padding: 8px 10px;
  color: #1f3a68;
  font-size: 0.86em;
}
.osc-saneamento-metrics strong {
  display: block;
  font-size: 1.25em;
  line-height: 1;
}
.osc-saneamento-summary {
  margin: 10px 0 0;
  color: #425466;
  font-size: 0.9em;
}
.osc-saneamento-result { margin-top: 12px; }
.saneamento-task-panel {
  border-top: 1px solid #dbe5f2;
  padding-top: 12px;
  margin-top: 12px;
}

@media (max-width: 760px) {
  .osc-saneamento-header { flex-direction: column; }
  .osc-saneamento-btn { width: 100%; }
  .osc-saneamento-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Anexar pasta + arquivos avulsos lado a lado no cadastro de OSC */
.osc-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.osc-input-or {
  color: #607080;
  font-size: 0.85em;
  font-weight: 500;
}

/* Aba Configurações & Contratos */
.config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.config-grid label {
  display: flex;
  flex-direction: column;
  font-size: 0.85em;
  font-weight: 600;
  gap: 4px;
}
.config-grid input {
  padding: 6px 8px;
  border: 1px solid #c8d2de;
  border-radius: 4px;
  font-weight: 400;
}
.config-grid .config-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.config-grid .config-check input {
  width: auto;
  margin: 0;
}
.config-wide-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #324457;
  font-size: 0.85em;
  font-weight: 600;
  margin: 10px 0;
}
.config-wide-label textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #c8d2de;
  border-radius: 4px;
  padding: 8px;
  font: inherit;
  font-weight: 400;
  color: #142033;
  background: #fff;
}
.config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.relatorio-preview-box {
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  margin-top: 10px;
  color: #1e293b;
}
.relatorio-preview-box h4 {
  margin: 0 0 8px;
  font-size: 15px;
}
.relatorio-preview-box ul {
  margin: 8px 0 0 18px;
  padding: 0;
}
.config-fee-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 0.88em;
}
.config-fee-table th,
.config-fee-table td {
  border-bottom: 1px solid #e1e7ee;
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}
.config-fee-table th {
  color: #1F3A68;
  background: #F8FAFC;
  font-weight: 700;
}
.config-fee-table input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #c8d2de;
  border-radius: 4px;
}
.config-fee-table span {
  color: #1a3a52;
  font-weight: 600;
}
.config-hidden-legacy {
  display: none;
}
@media (max-width: 640px) {
  .config-grid { grid-template-columns: 1fr; }
  .config-fee-table,
  .config-fee-table thead,
  .config-fee-table tbody,
  .config-fee-table tr,
  .config-fee-table th,
  .config-fee-table td {
    display: block;
  }
  .config-fee-table thead {
    display: none;
  }
  .config-fee-table tr {
    border: 1px solid #e1e7ee;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 6px;
  }
  .config-fee-table td {
    border-bottom: none;
    padding: 5px 2px;
  }
}
