/* Correção de responsividade da lista de afiliados: remove barra horizontal e troca a tabela larga por cards fluidos. */
.tb-aff-list-shell,
.tb-aff-list-shell * {
  box-sizing: border-box;
}
.tb-aff-list-shell {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.tb-aff-list-shell .tb-aff-card {
  overflow: hidden;
}
.tb-aff-list-shell #tbAffListTable {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}
.tb-aff-list-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: 100%;
  max-width: 100%;
}
.tb-aff-list-card {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(226, 232, 240, .96);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  padding: 16px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .045);
}
.tb-aff-list-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(226, 232, 240, .86);
}
.tb-aff-list-card-head h3 {
  margin: 5px 0 3px;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}
.tb-aff-list-card-head p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.tb-aff-list-id {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 8px;
}
.tb-aff-list-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.tb-aff-list-fields > div {
  min-width: 0;
  border: 1px solid rgba(226, 232, 240, .72);
  border-radius: 14px;
  background: rgba(248, 250, 252, .84);
  padding: 10px 12px;
}
.tb-aff-list-fields span {
  display: block;
  margin-bottom: 5px;
  color: #64748b;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .08em;
  font-weight: 900;
}
.tb-aff-list-fields strong,
.tb-aff-list-fields a,
.tb-aff-list-fields small {
  display: block;
  min-width: 0;
  max-width: 100%;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.28;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.tb-aff-list-fields small {
  color: #64748b;
  margin-top: 3px;
}
.tb-aff-field-wide,
.tb-aff-field-secret {
  grid-column: span 2;
}
.tb-aff-field-secret {
  grid-column: span 4;
}
.tb-aff-secret-mini {
  display: block;
  width: 100%;
  max-width: 100% !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  background: #eef4ff;
  border: 1px solid #c7d7fe;
  border-radius: 10px;
  padding: 8px 10px;
  color: #1e3a8a;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.tb-aff-list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.tb-aff-list-actions .tb-aff-btn {
  box-shadow: none;
}
/* Neutraliza regras antigas da tabela caso algum cache mantenha HTML anterior */
.tb-aff-list-shell .tb-aff-table-wrap {
  overflow-x: hidden !important;
  max-width: 100%;
}
.tb-aff-list-shell .tb-aff-table {
  min-width: 0 !important;
  width: 100% !important;
  table-layout: fixed;
}
.tb-aff-list-shell .tb-aff-table th,
.tb-aff-list-shell .tb-aff-table td {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 1180px) {
  .tb-aff-list-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-aff-field-wide,
  .tb-aff-field-secret { grid-column: span 2; }
}
@media (max-width: 760px) {
  .tb-aff-list-filters { grid-template-columns: 1fr; }
  .tb-aff-list-card { padding: 14px; }
  .tb-aff-list-card-head { display: grid; }
  .tb-aff-list-fields { grid-template-columns: 1fr; }
  .tb-aff-field-wide,
  .tb-aff-field-secret { grid-column: span 1; }
  .tb-aff-list-actions { justify-content: stretch; }
  .tb-aff-list-actions .tb-aff-btn { width: 100%; }
}

/* Correção defensiva v5: evita quebra visual dos filtros/KPIs quando scripts antigos ou React remontam a página */
.tb-aff-list-shell .tb-aff-list-filters{
  display:grid !important;
  grid-template-columns:minmax(260px,1fr) minmax(160px,220px) !important;
  gap:14px !important;
  align-items:end !important;
  width:100% !important;
  margin:22px 0 20px !important;
}
.tb-aff-list-shell .tb-aff-list-filters label{
  display:flex !important;
  flex-direction:column !important;
  gap:8px !important;
  font-weight:800 !important;
  text-transform:uppercase !important;
  letter-spacing:.05em !important;
  font-size:12px !important;
  color:#334155 !important;
}
.tb-aff-list-shell .tb-aff-list-filters input,
.tb-aff-list-shell .tb-aff-list-filters select{
  width:100% !important;
  min-height:46px !important;
  border:1px solid #d8e1ef !important;
  border-radius:14px !important;
  padding:0 14px !important;
  color:#06142c !important;
  background:#fff !important;
  font-size:15px !important;
  font-weight:700 !important;
  box-sizing:border-box !important;
}
.tb-aff-list-shell .tb-aff-head .tb-aff-actions a#tbAffListCadastrar + a#tbAffListCadastrar,
.tb-aff-list-shell .tb-aff-actions .tb-aff-btn[data-duplicate="true"]{
  display:none !important;
}
@media(max-width:760px){
  .tb-aff-list-shell .tb-aff-list-filters{grid-template-columns:1fr !important;}
}

/* v8 definitivo: mantém lista de afiliados no padrão claro do dashboard. */
.tb-aff-list-shell{
  width:100%;
  max-width:1480px;
  margin:0 auto;
  padding:28px;
  background:transparent!important;
  color:#0f172a!important;
}
.tb-aff-list-shell .tb-aff-head{
  margin:0 0 22px!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.tb-aff-list-shell .tb-aff-head h1{
  color:#0f172a!important;
  font-size:clamp(32px,3.5vw,44px)!important;
  line-height:1.05!important;
  letter-spacing:-.045em!important;
}
.tb-aff-list-shell .tb-aff-head p{color:#64748b!important;font-size:16px!important;line-height:1.58!important;}
.tb-aff-list-shell .tb-aff-card,
.tb-aff-list-shell .tb-aff-list-filters,
.tb-aff-list-shell .tb-aff-list-card{
  background:#fff!important;
  border-color:#e2e8f0!important;
  color:#0f172a!important;
  box-shadow:0 18px 42px rgba(15,23,42,.06)!important;
}
.tb-aff-list-shell input,
.tb-aff-list-shell select{background:#f8fafc!important;color:#0f172a!important;border-color:#dbe3ef!important;}
@media(max-width:760px){.tb-aff-list-shell{padding:18px}.tb-aff-list-shell .tb-aff-head{display:grid!important}.tb-aff-list-shell .tb-aff-actions{justify-content:flex-start}.tb-aff-list-shell .tb-aff-actions .tb-aff-btn{width:100%;}}
