/* ============================================================
   iData NCM Insights — Paleta visual baseada na iData Software
   - Laranja primário:   #ED7D2B
   - Laranja claro:      #F8A75B
   - Navy/teal escuro:   #1F4F5E
   - Cinza grafite:      #3A4654
   - Cinza claro:        #F4F4F4
   - Fundo:              #FFFFFF
   ============================================================ */

:root {
  --orange: #ED7D2B;
  --orange-light: #F8A75B;
  --orange-dark: #C76418;
  --navy: #1F4F5E;
  --navy-dark: #133542;
  --graphite: #3A4654;
  --gray-soft: #F4F4F4;
  --gray-line: #E1E4E8;
  --gray-text: #5C6773;
  --white: #FFFFFF;
  --success: #2BAA66;
  --shadow: 0 4px 20px rgba(31, 79, 94, 0.08);
  --shadow-hover: 0 8px 30px rgba(31, 79, 94, 0.15);
  --radius: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--white);
  color: var(--graphite);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-dark); }

/* ====== HEADER / NAV ====== */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-line);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--orange);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.logo small {
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--graphite);
  font-weight: 600;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  color: var(--graphite);
  font-weight: 500;
  font-size: 15px;
}
.btn-cta {
  background: var(--orange);
  color: var(--white) !important;
  padding: 12px 22px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: transform 0.2s, background 0.2s;
  display: inline-block;
  border: none;
  cursor: pointer;
}
.btn-cta:hover { background: var(--orange-dark); transform: translateY(-1px); }
.btn-cta-outline {
  background: var(--navy);
  color: var(--white) !important;
  padding: 12px 22px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  display: inline-block;
  transition: background 0.2s, transform 0.2s;
}
.btn-cta-outline:hover { background: var(--navy-dark); transform: translateY(-1px); color: var(--white) !important; }

/* ====== HERO ====== */
.hero {
  background: linear-gradient(135deg, #FAFAFA 0%, #F0F4F6 100%);
  padding: 64px 0 56px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  right: -100px;
  top: -100px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(237, 125, 43, 0.12), transparent 70%);
  border-radius: 50%;
}
.hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}
.hero h1 {
  color: var(--orange);
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 8px;
  letter-spacing: -1.5px;
}
.hero h1 .second-line {
  color: var(--graphite);
}
.hero p.lead {
  font-size: 19px;
  color: var(--gray-text);
  margin: 16px 0 32px;
  max-width: 720px;
}
.hero-tag {
  display: inline-block;
  background: rgba(237, 125, 43, 0.12);
  color: var(--orange-dark);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

/* ====== SEARCH ====== */
.search-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-top: 32px;
  max-width: 820px;
}
.search-card label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.search-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.search-row input {
  flex: 1;
  border: 2px solid var(--gray-line);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 17px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.search-row input:focus { border-color: var(--orange); }
.search-row select {
  border: 2px solid var(--gray-line);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  background: var(--white);
  cursor: pointer;
}
.search-row button {
  background: var(--orange);
  color: var(--white);
  border: none;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.search-row button:hover { background: var(--orange-dark); }
.search-row button:disabled { background: var(--gray-line); cursor: not-allowed; }
.search-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--gray-text);
}
.search-hint .chip {
  display: inline-block;
  background: var(--gray-soft);
  color: var(--navy);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 12px;
  cursor: pointer;
  margin: 0 4px;
  border: 1px solid var(--gray-line);
  transition: all 0.15s;
}
.search-hint .chip:hover { background: var(--orange); color: var(--white); border-color: var(--orange); }

/* ====== RESULTS ====== */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 32px;
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--gray-line);
  padding-bottom: 12px;
}
.section-title h2 {
  color: var(--navy);
  font-size: 24px;
  font-weight: 800;
}
.ncm-desc {
  font-size: 14px;
  color: var(--gray-text);
  margin-top: 4px;
  font-weight: 400;
  max-width: 700px;
}
.section-title .source {
  color: var(--gray-text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 36px;
}
.kpi-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--gray-line);
  border-left: 4px solid var(--orange);
  transition: transform 0.2s, box-shadow 0.2s;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kpi-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-text);
  font-weight: 700;
  margin-bottom: 8px;
}
.kpi-card .value {
  color: var(--navy);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
}
.kpi-card .sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--gray-text);
}

.dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 36px;
}
@media (max-width: 900px) { .dual-grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.panel h3 {
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel h3::before {
  content: '';
  display: block;
  width: 4px;
  height: 20px;
  background: var(--orange);
  border-radius: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
}
table th, table td {
  text-align: left;
  padding: 12px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-line);
}
table th {
  background: var(--gray-soft);
  font-weight: 700;
  color: var(--navy);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
table tr:last-child td { border-bottom: none; }
table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--navy); }

.bar {
  position: relative;
  background: var(--gray-soft);
  height: 28px;
  border-radius: 6px;
  margin: 8px 0;
  overflow: hidden;
}
.bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--orange-light), var(--orange));
  border-radius: 6px;
  transition: width 0.6s ease;
}
.bar-label {
  position: relative;
  z-index: 1;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.chart-bars {
  display: grid;
  gap: 12px;
}
.year-bar {
  display: grid;
  grid-template-columns: 60px 1fr 120px;
  align-items: center;
  gap: 12px;
}
.year-bar .year {
  font-weight: 700;
  color: var(--navy);
  font-size: 14px;
}
.year-bar .value {
  font-weight: 700;
  color: var(--navy);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.year-bar .bar { height: 22px; margin: 0; }

/* ====== LEAD CAPTURE / iData section ====== */
.idata-pitch {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: var(--white);
  padding: 80px 0;
  margin-top: 60px;
  position: relative;
  overflow: hidden;
}
.idata-pitch::before {
  content: '';
  position: absolute;
  right: -150px;
  bottom: -150px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  border: 60px solid rgba(237, 125, 43, 0.15);
}
.pitch-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
}
@media (max-width: 900px) { .pitch-inner { grid-template-columns: 1fr; } }
.pitch-inner h2 {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -1px;
}
.pitch-inner h2 span { color: var(--orange-light); }
.pitch-inner p { font-size: 17px; opacity: 0.92; margin-bottom: 28px; }
.pitch-features {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
  margin-bottom: 32px;
}
.pitch-features li {
  position: relative;
  padding-left: 28px;
  font-size: 14px;
  opacity: 0.95;
}
.pitch-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: -1px;
  color: var(--orange-light);
  font-weight: 800;
  font-size: 16px;
}
.pitch-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.pitch-actions .btn-cta { font-size: 14px; padding: 14px 28px; }
.pitch-actions .btn-ghost {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.4);
  padding: 12px 26px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.2s;
}
.pitch-actions .btn-ghost:hover { border-color: var(--white); color: var(--white); }

.products-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 32px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.products-card h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--orange-light);
  margin-bottom: 20px;
  font-weight: 700;
}
.products-card ul {
  list-style: none;
  display: grid;
  gap: 12px;
}
.products-card a {
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}
.products-card a:hover { background: rgba(255, 255, 255, 0.14); transform: translateX(4px); color: var(--orange-light); }
.products-card a::after { content: '→'; opacity: 0.6; }

/* ====== FOOTER ====== */
.footer {
  background: var(--graphite);
  color: rgba(255, 255, 255, 0.7);
  padding: 32px 0;
  font-size: 13px;
}
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer a { color: var(--orange-light); }

/* ====== STATES ====== */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(237, 125, 43, 0.2);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state, .error-state, .empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-text);
}
.loading-state p { margin-top: 16px; font-weight: 600; color: var(--navy); }
.error-state { background: rgba(237, 125, 43, 0.05); border-radius: var(--radius); }
.error-state strong { color: var(--orange-dark); }

.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
  .hero h1 { font-size: 36px; }
  .search-row { flex-direction: column; }
  .nav-links { display: none; }
  .topbar-inner { padding: 0 14px; gap: 10px; }
  .logo { font-size: 22px; }
  .topbar-inner > .btn-cta { font-size: 11px; padding: 9px 12px; letter-spacing: 0.2px; white-space: nowrap; }
  .container { padding: 32px 18px; }
}

/* ============================================================
   YEAR TABS — Abas de ano + Atributos
   ============================================================ */
.year-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 22px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #FAFAFA 0%, #F0F4F6 100%);
  border-radius: 12px;
  border: 1px solid var(--gray-line);
}
.year-tabs::before {
  content: 'Relatórios de';
  font-size: 12px;
  color: var(--gray-text);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-right: 4px;
}
.year-tab {
  background: var(--white);
  border: 2px solid var(--gray-line);
  color: var(--navy);
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.year-tab:hover { border-color: var(--orange); color: var(--orange); }
.year-tab.active { background: var(--orange); border-color: var(--orange); color: var(--white); }
.year-tab.atrib-tab { margin-left: auto; }
.year-tab.atrib-tab.active { background: var(--navy); border-color: var(--navy); }

.panel-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-text);
  margin-left: 8px;
  text-transform: none;
  letter-spacing: 0;
}
.year-bar.year-bar-sel .year { color: var(--orange); }
.year-bar:hover .bar-fill { filter: brightness(0.95); }
.month-bar .year { font-size: 12px; color: var(--gray-text); }

/* ============================================================
   ATRIBUTOS — Accordion expansível (estilo Logcomex / iData)
   Atributos de produto — catálogo oficial
   ============================================================ */
.attr-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--gray-text);
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--gray-soft);
  border-radius: 8px;
}
.attr-summary strong { color: var(--navy); font-weight: 800; }
.attr-summary .dot { opacity: 0.5; }

.attr-source {
  margin-top: 14px;
  font-size: 12px;
  color: var(--gray-text);
}
.attr-source a { color: var(--orange-dark); text-decoration: underline; }

.attr-list-v2 { display: grid; gap: 10px; }

.attr-item-v2 {
  border: 1px solid var(--gray-line);
  border-radius: 10px;
  background: var(--white);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.attr-item-v2:hover { border-color: var(--orange); }
.attr-item-v2.open {
  border-color: var(--orange);
  box-shadow: 0 6px 20px rgba(237, 125, 43, 0.10);
}

.attr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s;
}
.attr-item-v2.open .attr-header {
  background: linear-gradient(90deg, rgba(237, 125, 43, 0.10), rgba(237, 125, 43, 0.02));
}
.attr-header:hover { background: rgba(237, 125, 43, 0.04); }

.attr-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.attr-item-v2 .code {
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 12px;
  background: var(--navy);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.attr-item-v2.open .code { background: var(--orange); }
.attr-item-v2 .attr-name {
  font-weight: 700;
  color: var(--navy);
  font-size: 15px;
}

.attr-tags {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.attr-item-v2 .tag {
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.attr-item-v2 .tag-req { background: rgba(237, 125, 43, 0.15); color: var(--orange-dark); }
.attr-item-v2 .tag-opt { background: var(--gray-soft); color: var(--gray-text); }
.attr-item-v2 .tag-org { background: rgba(31, 79, 94, 0.10); color: var(--navy); }

.attr-chevron {
  color: var(--gray-text);
  font-size: 16px;
  transition: transform 0.25s ease, color 0.2s;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.attr-item-v2.open .attr-chevron {
  transform: rotate(180deg);
  color: var(--orange);
}

/* Accordion body — oculto por padrão, expande com .open */
.attr-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s ease, padding 0.25s ease;
  padding: 0 18px;
  border-top: 1px solid transparent;
}
.attr-item-v2.open .attr-body {
  max-height: 1000px;
  padding: 18px;
  border-top: 1px solid var(--gray-line);
}

.attr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 4px;
}
@media (max-width: 700px) { .attr-grid { grid-template-columns: 1fr; } }

.att-meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-text);
  font-weight: 700;
  margin-bottom: 6px;
}
.att-tipo {
  color: var(--navy);
  font-weight: 600;
  font-size: 14px;
}

.att-dom-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.att-dom-list li {
  position: relative;
  padding: 7px 12px 7px 30px;
  background: var(--gray-soft);
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--navy);
}
.att-dom-list li::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--orange);
  border-radius: 50%;
}

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-org, .chip-obj {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.chip-org {
  background: rgba(31, 79, 94, 0.10);
  color: var(--navy);
  border: 1px solid rgba(31, 79, 94, 0.20);
}
.chip-obj {
  background: rgba(237, 125, 43, 0.10);
  color: var(--orange-dark);
  border: 1px solid rgba(237, 125, 43, 0.25);
}

/* ============================================================
   CTA inline
   ============================================================ */
.cta-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin-top: 36px;
  padding: 28px 32px;
  background: linear-gradient(135deg, rgba(237, 125, 43, 0.08), rgba(31, 79, 94, 0.06));
  border: 1px solid rgba(237, 125, 43, 0.30);
  border-radius: 16px;
}
.cta-inline h3 {
  color: var(--navy);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}
.cta-inline p { color: var(--gray-text); font-size: 14px; }
@media (max-width: 700px) {
  .cta-inline { grid-template-columns: 1fr; text-align: center; }
}

/* ============================================================
   PILAR 2 — Reenquadramento por subposição vizinha
   ============================================================ */
.year-tab.reenq-tab {
  background: var(--white);
  border-color: var(--orange);
  color: var(--orange-dark);
}
.year-tab.reenq-tab:hover { background: var(--orange); color: var(--white); }
.year-tab.reenq-tab.active {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
  color: var(--white);
}

/* Disclaimer legal */
.reenq-disclaimer {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 20px;
  background: linear-gradient(135deg, #FFF7EE 0%, #FFEED9 100%);
  border: 1px solid var(--orange);
  border-left: 4px solid var(--orange);
  border-radius: 10px;
  margin: 4px 0 22px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--navy-dark);
}
.reenq-disclaimer strong { color: var(--orange-dark); }
.reenq-disclaimer-icon {
  font-size: 24px;
  line-height: 1;
  color: var(--orange);
  flex-shrink: 0;
}

/* Card central da NCM consultada */
.reenq-current {
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 16px;
  padding: 24px 26px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.reenq-current::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--orange), var(--navy));
}
.reenq-current-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-line);
}
@media (max-width: 700px) {
  .reenq-current-head { grid-template-columns: 1fr; }
}
.reenq-current-tag {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.reenq-current-ncm {
  font-size: 32px;
  font-weight: 800;
  color: var(--navy);
  font-family: 'SF Mono', Consolas, monospace;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.reenq-current-desc {
  font-size: 14px;
  color: var(--graphite);
  max-width: 560px;
  line-height: 1.5;
}
.reenq-current-family {
  text-align: right;
  min-width: 180px;
}
.reenq-family-code {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 20px;
  font-weight: 800;
  color: var(--orange-dark);
  margin: 4px 0 6px;
}
.reenq-family-desc {
  font-size: 12px;
  color: var(--gray-text);
  font-weight: 600;
  line-height: 1.4;
}
@media (max-width: 700px) {
  .reenq-current-family { text-align: left; }
}

.reenq-current-aliquotas {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
@media (max-width: 700px) {
  .reenq-current-aliquotas { grid-template-columns: repeat(2, 1fr); }
}
.aliq-item {
  background: var(--gray-soft);
  padding: 14px 16px;
  border-radius: 8px;
  text-align: center;
}
.aliq-item.aliq-total {
  background: var(--navy);
  color: var(--white);
}
.aliq-item.aliq-total .aliq-label { color: rgba(255,255,255,0.7); }
.aliq-item.aliq-total .aliq-value { color: var(--white); }
.aliq-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-text);
  font-weight: 700;
  margin-bottom: 4px;
}
.aliq-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.reenq-current-extra {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Título da seção de vizinhas */
.reenq-vizinhas-title {
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
  margin: 6px 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.reenq-vizinhas-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 20px;
  background: var(--orange);
  border-radius: 2px;
}

/* Cards de vizinhas */
.reenq-vizinhas {
  display: grid;
  gap: 16px;
  margin-bottom: 28px;
}

.vizinha-card {
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-left: 5px solid var(--gray-line);
  border-radius: 12px;
  padding: 22px 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.vizinha-card:hover { box-shadow: 0 6px 24px rgba(31, 79, 94, 0.10); }
.vizinha-up    { border-left-color: #D43F3F; }
.vizinha-down  { border-left-color: var(--success); }
.vizinha-eq    { border-left-color: var(--gray-text); }

.vizinha-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
  margin-bottom: 16px;
}
.vizinha-ncm {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.vizinha-desc {
  font-size: 13.5px;
  color: var(--graphite);
  line-height: 1.5;
  max-width: 520px;
}
.vizinha-delta {
  text-align: center;
  min-width: 130px;
  padding: 10px 12px;
  background: var(--gray-soft);
  border-radius: 10px;
}
.vizinha-up    .vizinha-delta { background: #FCEAEA; }
.vizinha-down  .vizinha-delta { background: #E8F7EE; }
.vizinha-delta-arrow {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}
.vizinha-up    .vizinha-delta-arrow { color: #D43F3F; }
.vizinha-down  .vizinha-delta-arrow { color: var(--success); }
.vizinha-eq    .vizinha-delta-arrow { color: var(--gray-text); }
.vizinha-delta-pp {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.vizinha-up    .vizinha-delta-pp { color: #D43F3F; }
.vizinha-down  .vizinha-delta-pp { color: var(--success); }
.vizinha-delta-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-text);
  font-weight: 700;
  margin-top: 2px;
}

/* Discriminante */
.vizinha-discrim {
  background: linear-gradient(135deg, #FAFAFA, #F0F4F6);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 16px;
  border: 1px dashed var(--orange);
}
.vizinha-discrim-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--orange-dark);
  font-weight: 800;
}
.vizinha-discrim-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin: 4px 0 12px;
}
.vizinha-discrim-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: stretch;
}
@media (max-width: 700px) {
  .vizinha-discrim-compare { grid-template-columns: 1fr; }
}
.vizinha-side {
  background: var(--white);
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid var(--gray-line);
}
.vizinha-side-current { border-color: var(--navy); }
.vizinha-side-other   { border-color: var(--orange); }
.vizinha-side-tag {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-text);
  margin-bottom: 4px;
}
.vizinha-side-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
}
.vizinha-side-sep {
  align-self: center;
  color: var(--orange);
  font-size: 22px;
  font-weight: 700;
}

/* Comparativo de alíquotas */
.vizinha-aliquotas {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
@media (max-width: 700px) {
  .vizinha-aliquotas { grid-template-columns: repeat(2, 1fr); }
}
.aliq-compare {
  background: var(--gray-soft);
  border-radius: 8px;
  padding: 10px 12px;
  border-left: 3px solid var(--gray-line);
}
.aliq-compare.aliq-up   { border-left-color: #D43F3F; background: #FFF7F7; }
.aliq-compare.aliq-down { border-left-color: var(--success); background: #F4FBF7; }
.aliq-compare.aliq-eq   { border-left-color: var(--gray-line); }
.aliq-compare-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-text);
  font-weight: 700;
  margin-bottom: 4px;
}
.aliq-compare-values {
  display: flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.aliq-from {
  font-size: 13px;
  color: var(--gray-text);
  text-decoration: line-through;
}
.aliq-compare.aliq-eq .aliq-from { text-decoration: none; }
.aliq-arrow { color: var(--orange); font-weight: 700; }
.aliq-to {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
}
.aliq-compare.aliq-up .aliq-to   { color: #D43F3F; }
.aliq-compare.aliq-down .aliq-to { color: var(--success); }

/* Badges */
.vizinha-badge {
  background: linear-gradient(90deg, rgba(237, 125, 43, 0.12), rgba(237, 125, 43, 0.04));
  border: 1px solid rgba(237, 125, 43, 0.30);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--navy-dark);
  margin-bottom: 10px;
}
.vizinha-badge strong { color: var(--orange-dark); }

.vizinha-obs {
  font-size: 13px;
  color: var(--graphite);
  line-height: 1.5;
  background: var(--gray-soft);
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 3px solid var(--navy);
}
.vizinha-obs strong { color: var(--navy); }

/* Soluções de Consulta */
.reenq-cosit {
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: 12px;
  padding: 24px;
  margin-top: 8px;
}
.reenq-cosit h3 {
  color: var(--navy);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.reenq-cosit h3::before {
  content: '⚖';
  font-size: 20px;
  color: var(--orange);
}
.reenq-cosit-intro {
  font-size: 13px;
  color: var(--gray-text);
  margin-bottom: 16px;
}
.reenq-cosit-list {
  display: grid;
  gap: 10px;
}
.reenq-cosit-item {
  background: var(--gray-soft);
  border-radius: 8px;
  padding: 14px 16px;
  border-left: 3px solid var(--orange);
}
.reenq-cosit-num {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  color: var(--orange-dark);
  margin-bottom: 6px;
}
.reenq-cosit-ementa {
  font-size: 13.5px;
  color: var(--navy-dark);
  line-height: 1.5;
  margin-bottom: 8px;
}
.reenq-cosit-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--orange-dark);
  text-decoration: none;
}
.reenq-cosit-link:hover { text-decoration: underline; }

/* ============================================================
   TABS DE ANO — Mobile-friendly + estado "vazio"
   ============================================================ */

/* Container externo permite scroll-x sem cortar conteudo abaixo */
.year-tabs {
  position: relative;
}
.year-tabs::after {
  /* Sombra sutil indicando "tem mais conteudo a direita" no mobile */
  content: none;
}

/* Scroll horizontal interno em mobile */
.year-tabs-scroll {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Em telas pequenas (mobile), quebra em múltiplas linhas */
@media (max-width: 720px) {
  .year-tabs {
    padding: 10px 12px;
  }
  .year-tabs::before {
    display: none;
  }
  .year-tabs-scroll {
    flex-wrap: wrap;
    gap: 8px;
  }
  .year-tab {
    min-height: 40px;
    padding: 7px 14px;
    font-size: 13px;
    flex-shrink: 0;
  }
  .year-tab.atrib-tab,
  .year-tab.reenq-tab {
    margin-left: 0;
  }
}

/* Tab de ano sem dados — visualmente "fraco" mas ainda clicavel */
.year-tab-empty {
  position: relative;
  opacity: 0.55;
  border-style: dashed !important;
}
.year-tab-empty:hover {
  opacity: 0.85;
}
.year-tab-empty.active {
  opacity: 1;
}
.year-tab-empty .year-tab-dot {
  display: inline-block;
  width: 5px; height: 5px;
  background: var(--gray-text);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}
.year-tab-empty.active .year-tab-dot {
  background: var(--white);
}

/* Aviso de carregamento parcial */
.partial-warn {
  background: linear-gradient(135deg, #FFF7EE 0%, #FFEED9 100%);
  border: 1px solid rgba(237, 125, 43, 0.40);
  border-left: 4px solid var(--orange);
  color: var(--navy-dark);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin: 0 0 18px;
  line-height: 1.5;
}

/* Garantir que o botao "Tentar novamente" funcione bem dentro do error-state */
.error-state .btn-cta {
  margin-top: 4px;
}
