/* ================================================================
   LICITAÇÕES MANAGER — FRONTEND CSS
   Modern, accessible, responsive
================================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ==================== FILTRO ==================== */
.lm-filtro {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.lm-filtro__form {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr auto;
  gap: 16px;
  align-items: end;
}

.lm-filtro__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lm-filtro__field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
}

.lm-filtro__field input,
.lm-filtro__field select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.lm-filtro__field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.lm-filtro__field input:focus,
.lm-filtro__field select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: #fff;
}

.lm-filtro__actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

/* ==================== BOTÕES ==================== */
.lm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
  line-height: 1;
}

.lm-btn--primary {
  background: #2563eb;
  color: #ffffff !important;
}

.lm-btn--primary:hover {
  background: #1d4ed8;
  color: #ffffff !important;
}

.lm-btn--outline {
  background: transparent;
  color: #64748b !important;
  border: 1.5px solid #cbd5e1;
}

.lm-btn--outline:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.lm-btn--sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 6px;
}

/* ==================== TABELA ==================== */
.lm-tabela-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.lm-tabela {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.lm-tabela thead {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.lm-tabela thead th {
  padding: 13px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
  white-space: nowrap;
}

.lm-tabela thead th:last-child {
  text-align: center;
}

.lm-tabela tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}

.lm-tabela tbody tr:last-child {
  border-bottom: none;
}

.lm-tabela tbody tr:hover {
  background: #f8fafc;
}

.lm-tabela tbody td {
  padding: 14px 18px;
  font-size: 14px;
  color: #334155;
  vertical-align: middle;
}

.lm-tabela tbody td:last-child {
  text-align: center;
}

/* Título clicável na tabela */
.lm-titulo-link {
  font-weight: 600;
  color: #1e293b;
  text-decoration: none;
  transition: color 0.2s;
}

.lm-titulo-link:hover {
  color: #2563eb;
}

/* Tags de modalidade */
.lm-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

/* ==================== RESULTADO DA BUSCA ==================== */

.lm-resultado__titulo {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f1f5f9;
}

.lm-resultado__titulo strong {
  color: #2563eb;
}

.lm-resultado__total {
  display: inline-block;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: 10px;
  vertical-align: middle;
}

/* Estado vazio */
.lm-empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  font-size: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

/* ==================== DETALHE ==================== */
.lm-detalhe {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 60px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Hero */
.lm-detalhe__hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: #fff;
  padding: 40px 0 36px;
  margin: 0 -20px 36px;
}

.lm-detalhe__hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
}

.lm-detalhe__breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 14px;
}

.lm-detalhe__breadcrumb a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.2s;
}

.lm-detalhe__breadcrumb a:hover {
  color: #fff;
}

.lm-detalhe__breadcrumb span:last-child {
  color: rgba(255, 255, 255, 0.5);
}

.lm-detalhe__titulo {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 16px;
  color: #fff;
}

.lm-detalhe__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.lm-tag--modalidade {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  font-size: 12px;
}

/* Badge de status */
.lm-badge--status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Grid de resumo */
.lm-detalhe__resumo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

.lm-detalhe__resumo-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.lm-detalhe__resumo-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.lm-detalhe__resumo-card small {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 4px;
}

.lm-detalhe__resumo-card strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}

/* Layout principal com sidebar */
.lm-detalhe__cols {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}

.lm-detalhe__body {
  padding: 0 0 40px;
}

/* Seções */
.lm-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.lm-section__title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f1f5f9;
}

.lm-section__content {
  font-size: 14px;
  line-height: 1.7;
  color: #475569;
}

/* Info grid (dados institucionais) */
.lm-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.lm-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lm-info-item__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #94a3b8;
}

.lm-info-item__value {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

/* Arquivos */
.lm-arquivos-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lm-arquivo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}

.lm-arquivo-item:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.lm-arquivo-item__icon {
  font-size: 18px;
  flex-shrink: 0;
}

.lm-arquivo-item__nome {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
}

.lm-arquivo-item:hover .lm-arquivo-item__nome {
  color: #2563eb;
}

.lm-arquivo-item__baixar {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  background: #eff6ff;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #bfdbfe;
}

/* ==================== SIDEBAR CARDS ==================== */
.lm-sidebar-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.lm-sidebar-card__title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #94a3b8;
  margin: 0 0 14px;
}

.lm-status-atual {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 14px;
  color: #15803d;
}

/* ==================== TIMELINE ==================== */
.lm-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.lm-timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 7px;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.lm-timeline__item {
  position: relative;
  padding: 0 0 18px 26px;
}

.lm-timeline__item::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #2563eb;
  z-index: 1;
}

.lm-timeline__item:last-child {
  padding-bottom: 0;
}

.lm-timeline__date {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  margin-bottom: 3px;
}

.lm-timeline__status {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.lm-timeline__obs {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

/* ==================== RESPONSIVO ==================== */
@media (max-width: 768px) {
  .lm-filtro__form {
    grid-template-columns: 1fr;
  }

  .lm-filtro__actions {
    flex-direction: column;
  }

  .lm-filtro__actions .lm-btn {
    width: 100%;
  }

  .lm-detalhe__resumo-grid {
    grid-template-columns: 1fr 1fr;
  }

  .lm-detalhe__cols {
    grid-template-columns: 1fr;
  }

  .lm-detalhe__hero-inner {
    padding: 0 20px;
  }

  .lm-detalhe__titulo {
    font-size: 20px;
  }

  .lm-info-grid {
    grid-template-columns: 1fr;
  }

  .lm-tabela thead th:nth-child(3),
  .lm-tabela tbody td:nth-child(3) {
    display: none;
  }
}

@media (max-width: 480px) {
  .lm-detalhe__resumo-grid {
    grid-template-columns: 1fr;
  }

  .lm-tabela thead th:nth-child(4),
  .lm-tabela tbody td:nth-child(4) {
    display: none;
  }
}
