/* ============================================================
   Fórum SBTVD — Tabelas :: folha de estilo (skin)
   Todo o CSS é "escopado" sob .forum-tabela-wrap para não
   conflitar com o tema do WordPress.
   ============================================================ */

.forum-tabela-wrap {
  --ft-blue:     #0395F0;
  --ft-blue-dk:  #0279cc;
  --ft-gradient: linear-gradient(to right, #01AAE9, #5FBF88);
  --ft-line:     #e2e8f0;
  --ft-muted:    #64748b;
  --ft-black:    #0d1117;
  --ft-text:     #334155;

  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ft-black);
  margin: 28px 0;
  line-height: 1.6;
}
.forum-tabela-wrap *,
.forum-tabela-wrap *::before,
.forum-tabela-wrap *::after { box-sizing: border-box; }

/* ── Toolbar (injetada por JS quando data-busca="true") ── */
.forum-tabela-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.forum-tabela-count { font-size: 13px; color: var(--ft-muted); }
.forum-tabela-count strong { color: var(--ft-black); font-weight: 600; }

.forum-tabela-search { position: relative; }
.forum-tabela-search::before {
  content: "";
  position: absolute;
  left: 12px; top: 50%;
  width: 16px; height: 16px;
  transform: translateY(-50%);
  pointer-events: none;
  background: var(--ft-muted);
  opacity: .55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center/contain no-repeat;
}
.forum-tabela-search input {
  padding: 9px 14px 9px 38px;
  font: 500 13.5px/1 'Inter', system-ui, sans-serif;
  border: 1px solid var(--ft-line);
  border-radius: 8px;
  width: 280px; max-width: 100%;
  outline: none;
  background: #fff;
  color: var(--ft-black);
  transition: border-color .15s, box-shadow .15s;
}
.forum-tabela-search input:focus {
  border-color: var(--ft-blue);
  box-shadow: 0 0 0 3px rgba(3,149,240,.12);
}
.forum-tabela-search input::placeholder { color: #94a3b8; }

/* ── Caixa da tabela (borda + cantos arredondados) ── */
.forum-tabela-box {
  border: 1px solid var(--ft-line);
  border-radius: 12px;
  overflow: auto;                 /* clipa os cantos e permite scroll horizontal no mobile */
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  background: #fff;
}

/* ── Tabela ── */
table.forum-tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 0;
}
table.forum-tabela thead tr { background: var(--ft-gradient); }
table.forum-tabela thead th {
  padding: 14px 18px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  border: none;
}
table.forum-tabela tbody tr {
  border-bottom: 1px solid var(--ft-line);
  transition: background .12s;
}
table.forum-tabela tbody tr:last-child { border-bottom: none; }
table.forum-tabela tbody tr:nth-child(even) { background: #f9fafb; }
table.forum-tabela tbody tr:hover { background: #eff6ff; }
table.forum-tabela tbody tr.ft-hidden { display: none; }

table.forum-tabela td {
  padding: 15px 18px;
  vertical-align: middle;
  color: var(--ft-text);
  line-height: 1.5;
  border: none;
}
table.forum-tabela td strong { color: var(--ft-black); font-weight: 600; }

/* ── Helpers de célula (use como classe no <td>) ── */
.forum-tabela td.num {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ft-blue);
  white-space: nowrap;
}
.forum-tabela td.center { text-align: center; }
.forum-tabela td.muted  { color: var(--ft-muted); font-weight: 500; }
.forum-tabela td.nowrap { white-space: nowrap; }
.forum-tabela .sub {                 /* subtítulo dentro de uma célula */
  display: block;
  font-size: 12px;
  color: var(--ft-muted);
  margin-top: 2px;
  font-weight: 400;
}

/* ── Badge (rótulo colorido) ── */
.forum-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.forum-badge.abnt   { background: #dbeafe; color: #1d4ed8; }
.forum-badge.anatel { background: #dcfce7; color: #15803d; }
.forum-badge.mc     { background: #fef9c3; color: #854d0e; }
.forum-badge.gray   { background: #e2e8f0; color: #475569; }

/* ── Botão / CTA dentro de uma célula ── */
a.forum-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--ft-blue);
  color: #fff !important;
  padding: 6px 13px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, transform .15s;
}
a.forum-cta:hover { background: var(--ft-blue-dk); transform: translateY(-1px); color: #fff !important; }
a.forum-cta::before {
  content: "";
  width: 13px; height: 13px;
  flex-shrink: 0;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E") center/contain no-repeat;
}
/* variante sem ícone (ex.: "Ver", "Acessar") */
a.forum-cta.no-icon::before { display: none; }
/* variante secundária (contorno) */
a.forum-cta.ghost {
  background: transparent;
  color: var(--ft-blue) !important;
  border: 1px solid var(--ft-blue);
}
a.forum-cta.ghost:hover { background: #eff6ff; color: var(--ft-blue) !important; }
a.forum-cta.ghost::before { background: var(--ft-blue); }

/* ── "Nenhum resultado" (injetado por JS) ── */
.forum-tabela-noresults {
  display: none;
  padding: 44px 24px;
  text-align: center;
  color: var(--ft-muted);
  font-size: 14px;
  background: #fff;
}
.forum-tabela-noresults strong {
  display: block;
  font-size: 16px;
  color: var(--ft-black);
  margin-bottom: 6px;
}

/* ── Nota opcional abaixo da tabela ── */
.forum-tabela-nota {
  margin-top: 18px;
  padding: 14px 18px;
  background: #f0f9ff;
  border-left: 3px solid var(--ft-blue);
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.65;
}
.forum-tabela-nota strong { color: var(--ft-black); }

/* ── Responsivo ── */
@media (max-width: 640px) {
  table.forum-tabela { font-size: 12.5px; }
  table.forum-tabela th,
  table.forum-tabela td { padding: 11px 12px; }
  .forum-tabela-search input { width: 100%; }
  .forum-tabela-search { width: 100%; }
}
