/* ==========================================================================
   Consulta de Alíquotas — estilos específicos da ferramenta
   (usa os tokens definidos em style.css: --navy-*, --gold-*, --font-*)
   ========================================================================== */

.main-nav a.active { color: var(--gold); }
.main-nav a.active::after { width: 100%; }

/* ---------- Hero da ferramenta (menor que o da home) ---------- */
.tool-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy-deep) 55%, var(--navy-royal) 100%);
  padding-top: calc(var(--header-h) + 64px);
  padding-bottom: 72px;
}
.tool-hero-inner { position: relative; z-index: 1; max-width: 760px; }
.tool-hero-inner .eyebrow { color: var(--gold); }
.tool-hero-inner h1 {
  color: var(--text-light);
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  margin-bottom: .5em;
}
.tool-hero-sub { color: rgba(234,240,251,.8); font-size: 1.05rem; max-width: 640px; }

/* ---------- Campo de busca ---------- */
.aliq-search-wrap {
  position: relative;
  margin-top: 32px;
  max-width: 640px;
}
.aliq-search-icon {
  position: absolute;
  left: 20px; top: 50%;
  transform: translateY(-50%);
  color: rgba(234,240,251,.5);
  pointer-events: none;
}
.aliq-search-wrap input {
  width: 100%;
  padding: 18px 20px 18px 52px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color .25s ease, background .25s ease;
}
.aliq-search-wrap input::placeholder { color: rgba(234,240,251,.45); }
.aliq-search-wrap input:focus { border-color: var(--gold); background: rgba(255,255,255,.1); }

.aliq-search-results {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 10px);
  background: var(--bg-light);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
  overflow: hidden;
  z-index: 20;
  max-height: 340px;
  overflow-y: auto;
}
.aliq-result-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 20px;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--text);
  border-bottom: 1px solid rgba(11,44,92,.06);
}
.aliq-result-item:last-child { border-bottom: none; }
.aliq-result-item:hover,
.aliq-result-item.active {
  background: var(--bg-soft);
}
.aliq-result-name { font-weight: 500; }
.aliq-result-uf {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .04em;
  color: var(--navy-royal);
  background: rgba(30,78,156,.08);
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.aliq-result-empty {
  padding: 18px 20px;
  color: #888;
  font-size: .92rem;
}

.aliq-meta-note {
  margin: 18px 0 0;
  font-size: .85rem;
  color: rgba(234,240,251,.55);
}

/* ---------- App / resultados ---------- */
.tool-app { background: var(--bg-soft); padding: 56px 0 72px; }

.aliq-toolbar { margin-bottom: 28px; }
.aliq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.aliq-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-light);
  border: 1.5px solid rgba(11,44,92,.12);
  border-radius: 999px;
  padding: 9px 10px 9px 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .88rem;
  color: var(--navy-deep);
  box-shadow: var(--shadow-soft);
}
.aliq-chip .aliq-chip-uf { color: var(--gold-deep); font-weight: 700; }
.aliq-chip button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(11,44,92,.08);
  color: var(--navy-deep);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background .2s ease, color .2s ease;
}
.aliq-chip button:hover { background: var(--navy-deep); color: #fff; }
.aliq-chip-hint {
  align-self: center;
  font-size: .85rem;
  color: #7a7a75;
}

/* ---------- KPI cards ---------- */
.aliq-kpi-row {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 32px;
}
.aliq-kpi-card {
  flex: 0 0 auto;
  min-width: 240px;
  background: linear-gradient(160deg, var(--navy-deep), var(--navy-royal));
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-soft);
  color: var(--text-light);
}
.aliq-kpi-card h3 {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--gold);
  margin: 0 0 14px;
}
.aliq-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.aliq-kpi-nota {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(234,240,251,.16);
  font-size: .78rem;
  line-height: 1.5;
  color: rgba(234,240,251,.75);
  max-width: 46ch;
}
.aliq-kpi-stat .aliq-kpi-label {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(234,240,251,.6);
  margin-bottom: 3px;
}
.aliq-kpi-stat .aliq-kpi-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
}
.aliq-kpi-stat.is-predominante .aliq-kpi-value { color: var(--gold); }

/* ---------- Filtros ---------- */
.aliq-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
.aliq-filters input,
.aliq-filters select {
  max-width: 100%;
  min-width: 0;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1.5px solid rgba(11,44,92,.15);
  background: var(--bg-light);
  font-family: var(--font-body);
  font-size: .92rem;
  color: var(--text);
  outline: none;
}
.aliq-filters input { flex: 1 1 320px; }
.aliq-filters select {
  flex: 1 1 260px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.aliq-filters input:focus,
.aliq-filters select:focus { border-color: var(--navy-royal); }
.aliq-result-count {
  font-family: var(--font-display);
  font-size: .82rem;
  color: #7a7a75;
  white-space: nowrap;
}

/* ---------- Tabela ---------- */
.aliq-table-wrap {
  background: var(--bg-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: auto;
  max-height: 640px;
}
.aliq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.aliq-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--navy-deep);
  color: var(--text-light);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: left;
  padding: 14px 18px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.aliq-table thead th.is-rate { text-align: right; }
.aliq-table thead th .aliq-sort-arrow { margin-left: 4px; opacity: .6; font-size: .75em; }
.aliq-table thead th:hover { background: var(--navy-royal); }

.aliq-table tbody td {
  padding: 11px 18px;
  border-bottom: 1px solid rgba(11,44,92,.06);
  color: var(--text);
  white-space: nowrap;
}
.aliq-table tbody tr:last-child td { border-bottom: none; }
.aliq-table tbody tr:hover td { background: var(--bg-soft); }
.aliq-table td.aliq-col-codigo {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy-deep);
}
.aliq-table td.aliq-col-grupo {
  color: #666;
  white-space: normal;
  min-width: 220px;
}
.aliq-table td.aliq-col-rate {
  text-align: right;
  font-family: var(--font-display);
  font-weight: 700;
}
.aliq-table td.aliq-col-rate .aliq-na { color: #b8b8b3; font-weight: 500; }
.aliq-table td.aliq-col-rate.is-min { color: #1a8f4c; }
.aliq-table td.aliq-col-rate.is-max { color: #c23b3b; }
.aliq-table td.aliq-col-rate .aliq-rate-alt {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .74em;
  color: var(--gold-deep);
  margin-top: 1px;
}

.aliq-empty { padding: 40px 20px; text-align: center; color: #888; }

.aliq-legend {
  margin: 14px 0 0;
  font-size: .8rem;
  color: var(--gold-deep);
  font-weight: 500;
}

.aliq-disclaimer {
  margin: 10px 0 0;
  font-size: .8rem;
  color: #8a8a85;
  max-width: 900px;
}

/* ---------- Responsivo ---------- */
@media (max-width: 720px) {
  .tool-hero { padding-top: calc(var(--header-h) + 40px); padding-bottom: 48px; }
  .aliq-filters input,
  .aliq-filters select { flex-basis: 100%; }
  .aliq-kpi-card { min-width: 220px; }
  .aliq-table-wrap { max-height: 520px; }
}
