/* =========================================================
   AUDITOR SPED FISCAL
========================================================= */

.af-sped-tool {
  padding-bottom: 90px;
  background: #ffffff;
}

.af-sped-tool-hero {
  padding: 78px 0 34px;
  text-align: center;
  background:
    radial-gradient(circle at top center, rgba(0, 113, 227, .10), transparent 42%),
    linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
}

.af-sped-tool-hero h1 {
  max-width: 760px;
  margin: 18px auto 16px;
  font-size: clamp(38px, 4.8vw, 58px);
  line-height: 1;
  letter-spacing: -.055em;
  color: #06142b;
}

.af-sped-tool-hero p {
  max-width: 700px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.55;
  color: #536176;
}

.af-sped-upload-card {
  max-width: 660px;
  margin: 30px auto 0;
  padding: 20px 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(0, 44, 75, .08);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .08);

  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

#spedFile {
  flex: 1 1 330px;
  min-width: 260px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px dashed rgba(0, 113, 227, .32);
  background: #f7fbff;
  font-size: 14px;
  color: #536176;
}

.af-sped-upload-card .af-btn-primary {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 800;
}

/* =========================================================
   CARDS RESUMO
========================================================= */

.af-sped-results {
  padding-top: 38px;
}

.af-sped-summary-cards {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.af-sped-card {
  min-height: 104px;
  padding: 22px 26px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid rgba(0, 44, 75, .08);
  box-shadow: 0 20px 50px rgba(15, 23, 42, .06);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.af-sped-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 70px rgba(15, 23, 42, .09);
  border-color: rgba(0, 113, 227, .16);
}

.af-sped-card span {
  display: block;
  color: #536176;
  font-size: 13px;
}

.af-sped-card strong {
  display: block;
  margin-top: 10px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.04em;
  color: #06142b;
}

.af-sped-card-alert {
  background: linear-gradient(145deg, #002c4b 0%, #006aff 100%);
}

.af-sped-card-alert span,
.af-sped-card-alert strong {
  color: #ffffff;
}

/* =========================================================
   TOPBAR / ABAS / EXPORTAÇÃO
========================================================= */

.af-sped-topbar {
  max-width: 980px;
  margin: 22px auto 30px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;

  position: sticky;
  top: 64px;
  z-index: 20;

  padding: 10px 0;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.af-sped-tabs {
  display: flex;
  gap: 10px;
  margin: 0;
  flex-wrap: wrap;
}

.af-sped-tab,
.af-sped-filter button {
  border: 0;
  background: #eef5ff;
  color: #006aff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.af-sped-tab:hover,
.af-sped-filter button:hover {
  transform: translateY(-1px);
  background: #e2efff;
}

.af-sped-tab.active,
.af-sped-filter button.active {
  background: #006aff;
  color: #ffffff;
}

.af-sped-export-btn {
  min-height: 42px;
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: #06142b;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(6, 20, 43, .12);
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.af-sped-export-btn:hover {
  background: #006aff;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 106, 255, .18);
}

/* =========================================================
   PAINÉIS
========================================================= */

.af-sped-panel {
  display: none;
  max-width: 980px;
  margin: 0 auto;
}

.af-sped-panel.active {
  display: block;
}

.af-sped-panel h2 {
  margin-bottom: 12px;
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1.05;
  letter-spacing: -.04em;
  color: #06142b;
}

.af-sped-panel p {
  color: #536176;
  font-size: 16px;
  line-height: 1.6;
}

.af-sped-insights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 30px;
}

.af-sped-insight {
  padding: 22px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(0, 44, 75, .08);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .05);
}

.af-sped-insight strong {
  display: block;
  margin-bottom: 8px;
  color: #06142b;
  font-size: 17px;
}

.af-sped-insight span {
  color: #536176;
  line-height: 1.6;
}

/* =========================================================
   FILTROS
========================================================= */

.af-sped-filter {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

/* =========================================================
   TABELA EM CARDS
========================================================= */

.af-sped-table-wrap {
  overflow: hidden;
  border-radius: 26px;
  background: #ffffff;
  border: 1px solid rgba(0, 44, 75, .08);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .06);
}

.af-sped-table-wrap table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.af-sped-table-wrap thead {
  display: none;
}

.af-sped-table-wrap tbody tr {
  display: grid;
  grid-template-columns: 90px 90px 90px 120px 150px 1fr;
  gap: 0;
  padding: 16px 18px;
  border-bottom: 1px solid #edf2f7;
  transition: background .2s ease, box-shadow .2s ease;
}

.af-sped-table-wrap tbody tr:nth-child(even) {
  background: #f8fafc;
}

.af-sped-table-wrap tbody tr:hover {
  background: #eef4ff;
  box-shadow: inset 4px 0 0 #006aff;
}

.af-sped-table-wrap td {
  border-bottom: 0;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
  word-break: break-word;
}

.af-sped-table-wrap td::before {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #64748b;
}

.af-sped-table-wrap td:nth-child(1)::before {
  content: "Risco";
}

.af-sped-table-wrap td:nth-child(2)::before {
  content: "Regra";
}

.af-sped-table-wrap td:nth-child(3)::before {
  content: "Registro";
}

.af-sped-table-wrap td:nth-child(4)::before {
  content: "Documento";
}

.af-sped-table-wrap td:nth-child(5)::before {
  content: "Produto";
}

.af-sped-table-wrap td:nth-child(6)::before {
  content: "Diagnóstico";
}

.af-sped-table-wrap td:nth-child(7)::before {
  content: "Como corrigir";
}

.af-sped-table-wrap td:nth-child(6) {
  line-height: 1.7;
  font-weight: 500;
}

.af-sped-table-wrap td:nth-child(7) {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f7fbff;
  border: 1px solid #dbeafe;
  color: #334155;
  line-height: 1.65;
}

/* Prioridades */
#resultadoPrioridades tr {
  grid-template-columns: 100px 140px 1fr;
}

#resultadoPrioridades td:nth-child(4) {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f7fbff;
  border: 1px solid #dbeafe;
}

/* =========================================================
   LINKS E RISCOS
========================================================= */

.link-nota {
  color: #006aff;
  font-weight: 800;
  text-decoration: none;
}

.link-nota:hover {
  text-decoration: underline;
}

.risco-alto,
.risco-medio,
.risco-baixo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.risco-alto {
  color: #991b1b;
  background: #fee2e2;
}

.risco-medio {
  color: #92400e;
  background: #ffedd5;
}

.risco-baixo {
  color: #1d4ed8;
  background: #dbeafe;
}

/* =========================================================
   RESPONSIVO
========================================================= */

@media (max-width: 980px) {

  .af-sped-summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .af-sped-insights {
    grid-template-columns: 1fr;
  }

  .af-sped-upload-card {
    align-items: stretch;
  }

  #spedFile,
  .af-sped-upload-card .af-btn-primary {
    width: 100%;
  }

  .af-sped-topbar {
    flex-direction: column;
    align-items: stretch;
    top: 56px;
  }

  .af-sped-tabs {
    justify-content: center;
  }

  .af-sped-export-btn {
    width: 100%;
  }

  .af-sped-table-wrap tbody tr {
    grid-template-columns: repeat(2, 1fr);
  }

  .af-sped-table-wrap td:nth-child(7),
  #resultadoPrioridades td:nth-child(4) {
    grid-column: 1 / -1;
  }

}

@media (max-width: 640px) {

  .af-sped-tool-hero {
    padding: 72px 0 30px;
  }

  .af-sped-tool-hero h1 {
    font-size: 38px;
  }

  .af-sped-tool-hero p {
    font-size: 16px;
  }

  .af-sped-upload-card {
    padding: 20px;
    border-radius: 22px;
  }

  .af-sped-summary-cards {
    grid-template-columns: 1fr;
  }

  .af-sped-card strong {
    font-size: 32px;
  }

  .af-sped-table-wrap tbody tr {
    grid-template-columns: 1fr;
  }

  .af-sped-table-wrap td:nth-child(7),
  #resultadoPrioridades td:nth-child(4) {
    grid-column: 1;
  }

}
/* =========================================================
   BADGES PREMIUM DE RISCO
========================================================= */

.af-sped-table-wrap tbody tr {
  grid-template-columns:
    120px
    90px
    90px
    140px
    160px
    1fr;

  padding: 12px 16px;
}

.af-sped-table-wrap td:nth-child(1) {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

/* =========================================================
   BADGES
========================================================= */

.risco-alto,
.risco-medio,
.risco-baixo {
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;

  min-width: 88px;
  min-height: 72px;

  padding: 12px 14px;

  border-radius: 22px;

  box-sizing: border-box;

  overflow: hidden;
}

/* LABEL SUPERIOR */

.risco-alto::before,
.risco-medio::before,
.risco-baixo::before {
  content: "RISCO";

  display: block;

  margin-bottom: 6px;

  font-size: 10px;
  font-weight: 900;

  letter-spacing: .12em;
  text-transform: uppercase;

  opacity: .65;

  line-height: 1;
}

/* TEXTO */

.risco-alto,
.risco-medio,
.risco-baixo {
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

/* ALTO */

.risco-alto {
  background: #fee2e2;
  color: #991b1b;
}

/* MÉDIO */

.risco-medio {
  background: #ffedd5;
  color: #92400e;
}

/* BAIXO */

.risco-baixo {
  background: #dbeafe;
  color: #1d4ed8;
}

/* =========================================================
   MELHORIAS DE LEITURA
========================================================= */

.af-sped-table-wrap td {
  word-break: normal;
  overflow-wrap: anywhere;
}

.af-sped-table-wrap td:nth-child(6) {
  min-width: 260px;
  line-height: 1.7;
}

.af-sped-table-wrap td:nth-child(7) {
  margin-top: 8px;
}
/* =========================================================
   CENTRAL DE AJUDA
========================================================= */

.af-help-floating {
  position: fixed;

  right: 26px;
  bottom: 26px;

  width: 58px;
  height: 58px;

  border-radius: 50%;

  background:
    linear-gradient(
      145deg,
      #006aff 0%,
      #0050d8 100%
    );

  color: #ffffff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 28px;
  font-weight: 900;

  cursor: pointer;

  z-index: 999;

  box-shadow:
    0 20px 40px rgba(0,106,255,.28);

  transition:
    transform .2s ease,
    box-shadow .2s ease;
}

.af-help-floating:hover {
  transform: translateY(-2px);

  box-shadow:
    0 28px 50px rgba(0,106,255,.36);
}

/* OVERLAY */

.af-help-overlay {
  position: fixed;
  inset: 0;

  background: rgba(15,23,42,.35);

  opacity: 0;
  visibility: hidden;

  transition: .25s ease;

  z-index: 998;
}

.af-help-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* DRAWER */

.af-help-drawer {
  position: fixed;

  top: 0;
  right: -420px;

  width: 420px;
  max-width: 100%;
  
  height: 100vh;

  background: #ffffff;

  z-index: 9999;

  transition: .3s ease;

  display: flex;
  flex-direction: column;

  border-left:
    1px solid rgba(0,44,75,.08);

  box-shadow:
    -20px 0 60px rgba(15,23,42,.08);
  overflow-y: auto;
padding-bottom: 120px;
}

.af-help-drawer.active {
  right: 0;
}

/* HEADER */

.af-help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 24px 24px 18px;

  border-bottom:
    1px solid #edf2f7;
}

.af-help-header h3 {
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.04em;

  color: #06142b;
}

.af-help-header button {
  border: 0;
  background: transparent;

  font-size: 28px;

  cursor: pointer;

  color: #64748b;
}

/* SEARCH */

.af-help-search {
  padding: 18px 24px;
}

.af-help-search input {
  width: 100%;

  height: 48px;

  border-radius: 14px;

  border:
    1px solid rgba(0,44,75,.08);

  padding: 0 16px;

  font-size: 14px;
}

/* SECTIONS */

.af-help-section {
  padding: 12px 24px 24px;
}

.af-help-title {
  display: block;

  margin-bottom: 14px;

  font-size: 13px;
  font-weight: 900;

  letter-spacing: .08em;
  text-transform: uppercase;

  color: #64748b;
}

.af-help-item {
  width: 100%;

  border: 0;
  background: #ffffff;

  text-align: left;

  padding: 16px 18px;

  border-radius: 16px;

  margin-bottom: 10px;

  cursor: pointer;

  font-size: 15px;
  font-weight: 700;

  color: #06142b;

  transition:
    background .2s ease,
    transform .2s ease;
}

.af-help-item:hover {
  background: #f7fbff;
  transform: translateX(2px);
}

/* FOOTER */

.af-help-footer {
  margin-top: auto;

  padding: 24px;

  border-top:
    1px solid #edf2f7;
}

.af-help-footer strong {
  display: block;

  margin-bottom: 8px;

  font-size: 18px;
  color: #06142b;
}

.af-help-footer p {
  color: #64748b;

  margin-bottom: 18px;
}

.af-help-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 48px;

  border-radius: 14px;

  background: #006aff;
  color: #ffffff;

  text-decoration: none;
  font-weight: 800;
}

@media(max-width:640px){

  .af-help-drawer {
    width: 100%;
  }

}
/* =========================================================
   GUIAS DINÂMICOS
========================================================= */

.af-help-guide {
  display: none;
  padding: 24px;
}

.af-help-guide.active {
  display: block;
}

.af-help-back {
  border: 0;
  background: #eef5ff;
  color: #006aff;

  height: 42px;

  padding: 0 16px;

  border-radius: 999px;

  font-size: 14px;
  font-weight: 800;

  cursor: pointer;

  margin-bottom: 24px;
}

.af-help-guide h4 {
  margin-bottom: 16px;

  font-size: 32px;
  line-height: 1.05;

  letter-spacing: -.04em;

  color: #06142b;
}

.af-help-guide p {
  margin-bottom: 18px;

  font-size: 15px;
  line-height: 1.75;

  color: #475569;
}

.af-help-guide ul {
  margin: 0 0 24px 18px;
}

.af-help-guide li {
  margin-bottom: 12px;

  line-height: 1.6;

  color: #334155;
}

.af-help-guide strong {
  color: #06142b;
}
/* =========================================================
   CONTEÚDO DA AJUDA
========================================================= */

.af-help-content{
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.af-help-content h4{
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 16px;
}

.af-help-content p{
  font-size: 15px;
  line-height: 1.8;
  color: #475569;
  margin-bottom: 18px;
}

.af-help-content ul{
  padding-left: 18px;
}

.af-help-content li{
  margin-bottom: 10px;
  color: #475569;
  line-height: 1.7;
}
.af-help-content{
  margin: 24px 0;
  padding: 24px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
}

.af-help-content h4{
  font-size: 20px;
  line-height: 1.3;
  margin: 0 0 14px;
  color: #0f172a;
}

.af-help-content p{
  font-size: 15px;
  line-height: 1.7;
  color: #475569;
}

.af-help-content ul{
  margin: 16px 0 0;
  padding-left: 18px;
}

.af-help-content li{
  margin-bottom: 10px;
  line-height: 1.6;
  color: #475569;
}

.af-help-item.active{
  background: #eaf3ff;
  color: #0057c2;
  font-weight: 800;
}
/* =========================================================
   MELHORIAS CENTRAL DE AJUDA
========================================================= */

.af-help-content{
  background:#f8fafc;
  border-radius:20px;
  padding:24px;

  animation: fadeHelp .25s ease;
}

@keyframes fadeHelp{

  from{
    opacity:0;
    transform:translateY(8px);
  }

  to{
    opacity:1;
    transform:translateY(0);
  }

}

@media (max-width:768px){

  .af-help-drawer{
    width:100%;
  }

}