.licitacoes-page {
  padding: 24px;
  color: #172033;
}

.licitacoes-page * {
  box-sizing: border-box;
}

/* Cabeçalho */

.licitacoes-header,
.licitacoes-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.licitacoes-header {
  margin-bottom: 24px;
}

.licitacoes-header h2 {
  margin: 4px 0 8px;
  font-size: 28px;
}

.licitacoes-header p,
.licitacoes-card-head p {
  margin: 0;
  color: #64748b;
}

.licitacoes-eyebrow {
  color: #4f46e5 !important;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.licitacoes-header-actions,
.licitacoes-card-actions,
.licitacoes-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Botões */

.licitacoes-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.licitacoes-btn svg,
.licitacoes-tab svg {
  width: 17px;
  height: 17px;
}

.licitacoes-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.licitacoes-btn-primary {
  background: #4f46e5;
  color: #fff;
}

.licitacoes-btn-primary:hover:not(:disabled) {
  background: #4338ca;
}

.licitacoes-btn-light {
  border-color: #dbe2ea;
  background: #fff;
  color: #334155;
}

.licitacoes-btn-light:hover:not(:disabled) {
  border-color: #a5b4fc;
  background: #f8fafc;
  color: #4338ca;
}

/* Indicadores */

.licitacoes-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.licitacoes-kpi,
.licitacoes-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.licitacoes-kpi {
  padding: 18px;
}

.licitacoes-kpi span,
.licitacoes-kpi small {
  display: block;
  color: #64748b;
}

.licitacoes-kpi span {
  font-size: 13px;
}

.licitacoes-kpi strong {
  display: block;
  margin: 7px 0 4px;
  font-size: 28px;
}

.licitacoes-kpi small {
  font-size: 12px;
}

/* Abas */

.licitacoes-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  overflow-x: auto;
  border-bottom: 1px solid #e2e8f0;
}

.licitacoes-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.licitacoes-tab:hover {
  background: #f8fafc;
  color: #4338ca;
}

.licitacoes-tab.active {
  background: #eef2ff;
  color: #4338ca;
}

/* Painéis */

.licitacoes-panel {
  display: none;
}

.licitacoes-panel.active {
  display: block;
}

.licitacoes-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.licitacoes-card {
  padding: 20px;
  margin-bottom: 18px;
}

.licitacoes-card-head {
  margin-bottom: 18px;
}

.licitacoes-card-head h3 {
  margin: 0 0 5px;
  font-size: 17px;
}

.licitacoes-card-head > svg {
  color: #4f46e5;
}

/* Estados vazios */

.licitacoes-empty {
  display: flex;
  min-height: 210px;
  padding: 30px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  text-align: center;
}

.licitacoes-empty.compact {
  min-height: 150px;
  border: 0;
  background: transparent;
}

.licitacoes-empty svg {
  width: 34px;
  height: 34px;
  color: #6366f1;
}

.licitacoes-empty strong {
  color: #1e293b;
}

.licitacoes-empty span {
  max-width: 480px;
  color: #64748b;
  font-size: 13px;
}

/* Atalhos */

.licitacoes-atalhos-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.licitacoes-atalhos-grid a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: #1e293b;
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease;
}

.licitacoes-atalhos-grid a:hover {
  border-color: #a5b4fc;
  background: #f8fafc;
  transform: translateY(-1px);
}

.licitacoes-atalhos-grid a > svg:first-child {
  color: #4f46e5;
}

.licitacoes-atalhos-grid a > svg:last-child {
  width: 16px;
  margin-left: auto;
}

.licitacoes-atalhos-grid span,
.licitacoes-atalhos-grid small {
  display: block;
}

.licitacoes-atalhos-grid small {
  margin-top: 3px;
  color: #64748b;
}

/* Formulário de busca */

.licitacoes-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.licitacoes-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.licitacoes-form label > span {
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.licitacoes-form input,
.licitacoes-form select,
.licitacoes-busca-lista {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: #172033;
  font: inherit;
}

.licitacoes-form input:focus,
.licitacoes-form select:focus,
.licitacoes-busca-lista:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.licitacoes-form .span-2 {
  grid-column: span 2;
}

.licitacoes-form .licitacoes-check {
  grid-column: span 2;
  flex-direction: row;
  align-items: center;
  padding-top: 25px;
}

.licitacoes-check input {
  width: 17px;
  min-height: auto;
}

.licitacoes-form-actions {
  grid-column: span 2;
  align-items: flex-end;
  justify-content: flex-end;
}

/* Tabelas */

.licitacoes-table-wrap {
  width: 100%;
  overflow: auto;
}

.licitacoes-table {
  width: 100%;
  border-collapse: collapse;
}

.licitacoes-table th,
.licitacoes-table td {
  padding: 13px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

.licitacoes-table th {
  color: #64748b;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.licitacoes-table tbody tr:last-child td {
  border-bottom: 0;
}

.licitacoes-table tbody tr:not(:has(.licitacoes-empty)):hover {
  background: #f8fafc;
}

.licitacoes-busca-lista {
  max-width: 260px;
}

/* Mensagens */

.licitacoes-status {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
}

.licitacoes-status[data-tipo="erro"] {
  background: #fef2f2;
  color: #b91c1c;
}

.licitacoes-status[data-tipo="ok"] {
  background: #ecfdf5;
  color: #047857;
}

/* Etiquetas */

.licitacoes-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.licitacoes-badge.neutro {
  background: #f1f5f9;
  color: #475569;
}

.licitacoes-badge.sucesso {
  background: #ecfdf5;
  color: #047857;
}

.licitacoes-badge.alerta {
  background: #fff7ed;
  color: #c2410c;
}

.licitacoes-badge.erro {
  background: #fef2f2;
  color: #b91c1c;
}

/* SICAF */

.licitacoes-detalhes {
  margin: 0 0 20px;
}

.licitacoes-detalhes div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f7;
}

.licitacoes-detalhes dt {
  color: #64748b;
}

.licitacoes-detalhes dd {
  margin: 0;
  font-weight: 600;
}

/* Checklist */

.licitacoes-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.licitacoes-checklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.licitacoes-checklist input {
  width: 17px;
  height: 17px;
}

/* Responsividade */

@media (max-width: 1000px) {
  .licitacoes-kpis,
  .licitacoes-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .licitacoes-atalhos-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .licitacoes-page {
    padding: 16px;
  }

  .licitacoes-header,
  .licitacoes-card-head {
    flex-direction: column;
  }

  .licitacoes-grid-2,
  .licitacoes-kpis,
  .licitacoes-form,
  .licitacoes-checklist {
    grid-template-columns: 1fr;
  }

  .licitacoes-form .span-2,
  .licitacoes-form .licitacoes-check,
  .licitacoes-form-actions {
    grid-column: span 1;
  }

  .licitacoes-form-actions {
    justify-content: stretch;
  }

  .licitacoes-form-actions .licitacoes-btn {
    flex: 1;
  }

  .licitacoes-busca-lista {
    max-width: none;
  }

  .licitacoes-card-actions {
    width: 100%;
  }

  .licitacoes-card-actions .licitacoes-btn {
    flex: 1;
  }
}

.licitacoes-empty .lucide-loader-circle,
#btnExecutarBuscaLicitacoes .lucide-loader-circle {
  animation: licitacoes-girar 0.8s linear infinite;
}

.licitacoes-table td strong,
.licitacoes-table td small {
  display: block;
}

.licitacoes-table td small {
  margin-top: 5px;
  color: #64748b;
  line-height: 1.4;
}

@keyframes licitacoes-girar {
  to {
    transform: rotate(360deg);
  }
}