:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 16px;
}

h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

/* Linhas de formulário com respiro */
.row,
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.row input,
.row select,
.controls input,
.controls select {
  flex: 1 1 200px;
  min-width: 180px;
  width: auto;
}

.row button,
.controls button {
  width: auto;
}

/* Espaçamento interno de elementos em cards */
.card input,
.card select,
.card button {
  margin-bottom: 8px;
}

/* Inputs/select base */
input,
select {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
  background: #fff;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Botões */
button {
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  background: #e5e7eb;
  color: #111;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  background: #c2c8d0;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#rankingCard .row input,
#rankingCard .row select {
  flex: 1 1 160px;
  min-width: 140px;
}

#rankTable th,
#rankTable td {
  padding: 8px 10px;
  font-size: 12px;
}

#rankTable td {
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.rank-samples {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

/* Botões principais */
#btnLogin,
#btnSearch,
#btnLoad {
  background: var(--primary);
  color: #fff;
}

#btnLogin:hover,
#btnSearch:hover,
#btnLoad:hover {
  background: var(--primary-hover);
}

/* Tabela */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
}

td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
}

tbody td {
  font-size: 14px;
}

/* Destaques */
.row-soon {
  background: #fff7ed;
  border-left: 5px solid #fb923c;
}

.row-quoting {
  background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
  border-left: 5px solid #f59e0b;
  box-shadow: 0 2px 12px rgba(245,158,11,0.15);
}

.badge-soon {
  background: #ffedd5;
  color: #9a3412;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}

/* Botão salvar/remover */
.btn-save,
.btn-remove {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.btn-save:hover {
  background: #f6f8fa;
}

.btn-remove:hover {
  background: #fff1f2;
  border-color: #fecdd3;
}

.btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Status/labels */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #eef2ff;
  color: #1e3a8a;
  margin-left: 6px;
}

.pill-soft {
  background: #f1f5f9;
  color: #334155;
}

.status-red {
  color: #d00;
}

.status-orange {
  color: #d87900;
}

.status-green {
  color: #0a0;
}

.status-gray {
  color: #666;
}

.small {
  font-size: 12px;
}

.status-inline,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* Top nav */
.top-nav {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

/* Mobile */
@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 18px;
  }

  .row,
  .controls {
    gap: 8px;
  }

  .row input,
  .controls input,
  .row select,
  .controls select {
    flex: 1 1 100%;
    min-width: 0;
  }

  .row button,
  .controls button {
    width: 100%;
  }

  /* Tabela vira cards */
  table {
    border: none;
  }

  thead {
    display: none;
  }

  tbody tr {
    display: block;
    background: #fff;
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
  }

  tbody tr.row-soon {
    background: #fff7ed;
    border-left: 5px solid #fb923c;
  }
  
  tbody tr.row-quoting {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
    border-left: 5px solid #f59e0b;
    box-shadow: 0 2px 12px rgba(245,158,11,0.15);
  }

  tbody td {
    display: block;
    border: none;
    padding: 6px 0;
    font-size: 14px;
  }

  tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    color: #374151;
    font-weight: 700;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  button {
    width: 100%;
  }
}
/* Estilos para resumo de preços */
.price-summary {
  padding: 12px 16px;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-left: 4px solid #10b981;
  border-radius: 8px;
  margin: 8px 0;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.price-summary strong {
  color: #065f46;
}

.price-min {
  color: #10b981;
  font-weight: 600;
}

.price-avg {
  color: #3b82f6;
  font-weight: 600;
}

.price-max {
  color: #f59e0b;
  font-weight: 600;
}

#priceInfo .muted {
  font-size: 13px;
  padding: 8px;
  display: inline-block;
}
