/* ═════════════════════════════════════════════════════════════════════
   ESTILOS EXCLUSIVOS DO CONTROLE DE PREGÕES — 63º BI
   Design Militar Executivo • Sem Emojis • Tabela em Estilo Oficial
   ═════════════════════════════════════════════════════════════════════ */

.pregoes-dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

/* ── KPIS NO PADRÃO EXECUTIVO MILITAR (SEM EMOJIS) ── */
.pregoes-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.pregoes-kpi-card {
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-top: 3px solid var(--olive-dark);
}

.pregoes-kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-600);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.pregoes-kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--black);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.pregoes-kpi-sub {
  font-size: 11px;
  color: var(--olive-mid);
  margin-top: 3px;
  font-weight: 600;
}

/* ── BARRA DE CONTROLES E FILTROS MILITAR ── */
.pregoes-control-bar {
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.pregoes-filter-group-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pregoes-filter-group-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Pílulas de filtro padrão do sistema */
.pregoes-pill-btn {
  background: var(--cream);
  border: 1px solid var(--border-default);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--olive-dark);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pregoes-pill-btn:hover {
  background: var(--cream-dark);
  border-color: var(--olive-light);
}

.pregoes-pill-btn.active {
  background: var(--olive);
  color: var(--white);
  border-color: var(--olive-dark);
  box-shadow: 0 2px 6px rgba(61, 80, 22, 0.25);
}

.pregoes-pill-btn .count-badge {
  background: rgba(0, 0, 0, 0.1);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
}

.pregoes-pill-btn.active .count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: var(--white);
}

/* Botões de Alternância das Fases */
.btn-toggle-phase-header {
  background: var(--white);
  border: 1.5px solid var(--border-default);
  color: var(--olive-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-toggle-phase-header:hover {
  background: var(--cream);
  border-color: var(--olive);
}

.btn-toggle-phase-header.expanded {
  background: var(--olive-dark);
  color: var(--gold-light);
  border-color: var(--gold);
}

/* Inputs de Busca e Seletores */
.pregoes-search-field {
  padding: 7px 12px;
  border: 1.5px solid var(--border-default);
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  outline: none;
  width: 220px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pregoes-search-field:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.pregoes-select-field {
  padding: 7px 10px;
  border: 1.5px solid var(--border-default);
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--black);
  background: var(--white);
  outline: none;
  cursor: pointer;
}

.pregoes-select-field:focus {
  border-color: var(--gold);
}

.btn-militar-action {
  background: var(--olive);
  color: var(--white);
  border: 1px solid var(--olive-dark);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}

.btn-militar-action:hover {
  background: var(--olive-dark);
}

/* ── TABELA NO ESTILO EXATO DA GESTÃO ORÇAMENTÁRIA / EMPENHOS ── */
.pregoes-table-container {
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--border-default);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  width: 100%;
}

.pregoes-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.pregoes-data-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
}

.pregoes-data-table th {
  background: var(--olive-dark);
  color: var(--gold-light);
  padding: 8px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 2px solid var(--gold);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center !important;
  vertical-align: middle;
  user-select: none;
  white-space: nowrap;
}

.pregoes-data-table th.th-fase-sub {
  background: #334316;
  font-size: 10px;
  color: #f5f2e8;
  padding: 6px 3px;
  width: 40px;
  min-width: 40px;
}

.pregoes-data-table td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--border-default);
  border-right: 1px solid #f1f5f9;
  vertical-align: middle;
  text-align: center !important;
  font-variant-numeric: tabular-nums;
  color: #1a1a1a;
}

.pregoes-data-table tr.main-row {
  transition: background 0.15s;
  cursor: default !important;
}

.pregoes-data-table tr.main-row:hover {
  background: rgba(201, 162, 39, 0.08);
}

.pregoes-data-table tr.main-row.active-subrow {
  background: #fbf9f2;
}

/* Drag and Drop visual feedback - APENAS no pontilhado */
.pregoes-data-table tr.main-row[draggable="true"] {
  cursor: default !important;
}

.pregoes-data-table tr.main-row.dragging {
  opacity: 0.35;
  background: rgba(201, 162, 39, 0.18) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

/* ── BADGES DO PRAZO DA COMISSÃO (STATUS DE DATA) ── */
.prazo-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.prazo-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* Data futura (a vencer) -> Amarelo */
.prazo-badge.prazo-futuro {
  background: #fef08a;
  color: #854d0e;
  border: 1px solid #facc15;
}

/* Hoje ou data passada (vencido) -> Vermelho */
.prazo-badge.prazo-vencido {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
}

/* Texto não data -> Neutro */
.prazo-badge.prazo-texto {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* ── PONTILHADO DE ARRASTAR PRIORIDADE (DRAG & DROP EXCLUSIVO NO CANTO ESQUERDO) ── */
.prio-cell-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.drag-handle-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  color: #94a3b8;
  cursor: grab !important;
  user-select: none;
  padding: 3px 2px;
  letter-spacing: -1.5px;
  transition: color 0.15s, transform 0.15s;
}

.drag-handle-dots:hover {
  color: var(--gold);
  transform: scale(1.25);
}

.drag-handle-dots:active {
  cursor: grabbing !important;
}

/* ── BADGES DE PRIORIDADE (FONTE PRETA + GRADIENTE DOURADO P1 A P14) ── */
.prio-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800 !important;
  color: #000000 !important;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ── TAG DE PREGÃO OU DISPENSA EM ELABORAÇÃO ── */
.tag-elaboracao {
  display: inline-block;
  font-size: 11px;
  font-style: italic;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  text-align: center;
}

.tag-elaboracao.pregao {
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.tag-elaboracao.dispensa {
  color: #0369a1;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}

/* ── BADGES DE SITUAÇÃO / FASE (PALETA NEUTRA PADRÃO) ── */
.sit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
}

.sit-badge-fi {
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #cbd5e1;
}

.sit-badge-fe {
  background: #e2e8f0;
  color: #1e293b;
  border: 1px solid #94a3b8;
}

.sit-badge-espera {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.sit-badge-concluido {
  background: #e2e8f0;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.sit-badge-arquivado {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* ── BOTÃO PÍLULA DE OBSERVAÇÃO SUPRIMIDA ── */
.btn-obs-pill {
  background: #f1f5f9;
  border: 1px solid var(--border-default);
  color: #334155;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-obs-pill:hover {
  background: var(--cream);
  border-color: var(--gold);
  transform: scale(1.1);
}

/* ── PÍLULAS DE FASE AMPLAS COM BARRA DE PROGRESSO PROEMINENTE ── */
.phase-pill-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #f8faf6;
  border: 1.5px solid var(--border-default);
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.15s ease;
  user-select: none;
}

.phase-pill-card:hover {
  background: #ffffff;
  border-color: var(--olive);
  box-shadow: 0 2px 8px rgba(61, 80, 22, 0.14);
  transform: translateY(-1px);
}

.phase-pill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  color: var(--olive-dark);
  margin-bottom: 5px;
}

.phase-pill-percent {
  font-weight: 800;
  font-size: 12px;
  color: var(--olive);
}

.phase-pill-bar {
  width: 100%;
  height: 9px;
  background: #e2e8de;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.phase-pill-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #4a5e1e, #6b7c3a);
  transition: width 0.35s ease;
}

.phase-pill-fill.externa {
  background: linear-gradient(90deg, #1d4ed8, #3b82f6);
}

/* ── CÉLULAS DE CHECKLIST QUANDO EXPANDIDO ── */
.check-btn-militar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  user-select: none;
  transition: all 0.15s;
}

/* Tooltip flutuante de data ao passar o mouse sobre o check */
.check-btn-militar .check-date-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--olive-dark, #2a3810);
  color: #ffffff;
  border: 1px solid var(--gold, #c9a227);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 200;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.check-btn-militar .check-date-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: var(--olive-dark, #2a3810) transparent transparent transparent;
}

.check-btn-militar:hover .check-date-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Container vertical de check + input de data no modo de edição da linha */
.step-edit-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.stage-date-input {
  width: 58px;
  padding: 2px 2px;
  font-size: 9.5px;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--gold, #c9a227);
  border-radius: 3px;
  background: #ffffff;
  color: #1e293b;
  outline: none;
  font-family: 'Inter', monospace;
}

.stage-date-input:focus {
  border-color: var(--olive, #3d5016);
  box-shadow: 0 0 0 2px rgba(61, 80, 22, 0.18);
  background: #fffef7;
}

.check-btn-militar.checked {
  background: #15803d;
  color: #ffffff;
}

.check-btn-militar.pending {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px dashed #cbd5e1;
}

.check-btn-militar.pending:hover {
  background: #e2e8f0;
  color: #334155;
}

.check-btn-militar.na {
  background: #f8fafc;
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
  border: 1px solid #e2e8f0;
}

/* ── EDIÇÃO INLINE NA PRÓPRIA TABELA & BOTÕES DE AÇÃO ── */
.pregoes-data-table tr.main-row.editing-row {
  background: #fffdf2 !important;
  box-shadow: inset 3px 0 0 var(--gold);
}

.inline-edit-input {
  width: 100%;
  padding: 5px 8px;
  border: 1.5px solid var(--gold);
  border-radius: 4px;
  background: #ffffff;
  font-family: inherit;
  font-size: 12px;
  color: #1a1a1a;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.inline-edit-input:focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 2px rgba(61, 80, 22, 0.2);
}

textarea.inline-edit-input {
  resize: vertical;
  min-height: 48px;
  line-height: 1.35;
}

.btn-edit-row {
  background: var(--cream);
  border: 1px solid var(--border-default);
  color: var(--olive-dark);
  font-size: 13px;
  padding: 5px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-edit-row:hover {
  background: var(--olive);
  color: #ffffff;
  border-color: var(--olive-dark);
  transform: translateY(-1px);
}

.btn-save-inline {
  background: #15803d;
  color: #ffffff;
  border: 1px solid #166534;
  font-size: 13px;
  font-weight: 800;
  padding: 5px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-save-inline:hover {
  background: #166534;
  box-shadow: 0 2px 6px rgba(22, 101, 52, 0.3);
}

.btn-cancel-inline {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-cancel-inline:hover {
  background: #fecaca;
}

.btn-del-inline {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid var(--border-default);
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-del-inline:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.col-obs-text {
  font-size: 11px;
  color: #334155;
  white-space: normal;
  line-height: 1.35;
  text-align: center;
  max-width: 240px;
  margin: 0 auto;
  word-break: break-word;
}

.inline-edit-input {
  text-align: center;
}

/* ── SEÇÃO COLAPSADA NO RODAPÉ: CONCLUÍDOS E ARQUIVADOS ── */
.concluidos-bar-card, .arquivados-bar-card {
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 10px;
}

.concluidos-bar-header, .arquivados-bar-header {
  padding: 11px 16px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.concluidos-bar-header:hover, .arquivados-bar-header:hover {
  background: #f1f5f9;
}

.concluidos-bar-title, .arquivados-bar-title {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.concluidos-bar-content, .arquivados-bar-content {
  display: none;
  padding: 0;
  border-top: 1px solid var(--border-default);
}

.concluidos-bar-content.open, .arquivados-bar-content.open {
  display: block;
}

/* ── LARGURAS BALANCEADAS E PROPORCIONAIS DA TABELA ── */
.pregoes-data-table th.col-prio,
.pregoes-data-table td.col-prio {
  width: 50px;
  min-width: 50px;
  max-width: 50px;
}

.pregoes-data-table th.col-objeto,
.pregoes-data-table td.col-objeto {
  width: 220px;
  min-width: 210px;
  max-width: 230px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

.pregoes-data-table th.col-numero,
.pregoes-data-table td.col-numero {
  width: 135px;
  min-width: 130px;
  max-width: 140px;
  white-space: normal;
}

.pregoes-data-table th.col-comissao,
.pregoes-data-table td.col-comissao {
  width: 210px;
  min-width: 200px;
  max-width: 220px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

.pregoes-data-table th.col-reelab,
.pregoes-data-table td.col-reelab {
  width: 120px;
  min-width: 110px;
  max-width: 135px;
  white-space: normal;
}

.pregoes-data-table th.col-obs,
.pregoes-data-table td.col-obs {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
}

.pregoes-data-table th.col-obs-exp,
.pregoes-data-table td.col-obs-exp {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  white-space: normal;
  word-break: break-word;
}

/* FASE INTERNA E FASE EXTERNA EXPANDEM ABSORVENDO TODO O ESPAÇO DISPONÍVEL */
.pregoes-data-table th.col-fase-pill,
.pregoes-data-table td.col-fase-pill {
  min-width: 180px;
  padding: 6px 10px !important;
}

.pregoes-data-table th.col-step,
.pregoes-data-table td.col-step {
  width: 58px;
  min-width: 54px;
  max-width: 64px;
  padding: 4px 2px !important;
  overflow: visible !important;
}

.pregoes-data-table th.col-prazo,
.pregoes-data-table td.col-prazo {
  width: 105px;
  min-width: 95px;
  max-width: 120px;
  white-space: normal;
}

.pregoes-data-table th.col-acoes,
.pregoes-data-table td.col-acoes {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
}

/* ── POPUP MODAL DE CONFIRMAÇÃO (ESTILO NC / GESTÃO ORÇAMENTÁRIA) ── */
.confirm-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeInModal 0.15s ease-out;
}

.confirm-modal-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 24px;
  width: 420px;
  max-width: 92vw;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-default);
  text-align: center;
  animation: scaleInCard 0.15s ease-out;
}

.confirm-modal-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--olive-dark);
}

.confirm-modal-card p {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
}

.confirm-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-btn-confirm {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.modal-btn-confirm.discard {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.modal-btn-confirm.discard:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.modal-btn-confirm.save {
  background: #15803d;
  color: #ffffff;
  border: 1px solid #166534;
}

.modal-btn-confirm.save:hover {
  background: #166534;
  box-shadow: 0 2px 8px rgba(22, 101, 52, 0.35);
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleInCard {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
