/* ===================================================================
   VARIÁVEIS
=================================================================== */
:root {
  --prim:       #2563eb;
  --prim-hover: #1d4ed8;
  --sucesso:    #16a34a;
  --aviso:      #d97706;
  --perigo:     #dc2626;
  --roxo:       #7c3aed;
  --txt:        #1e293b;
  --txt-sub:    #64748b;
  --borda:      #e2e8f0;
  --fundo:      #f8fafc;
  --branco:     #ffffff;
  --raio:       8px;
  --sombra:     0 1px 3px 0 rgb(0 0 0/.1), 0 1px 2px -1px rgb(0 0 0/.1);
  --sombra-md:  0 4px 6px -1px rgb(0 0 0/.1), 0 2px 4px -2px rgb(0 0 0/.1);
}

/* ===================================================================
   RESET
=================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--fundo);
  color: var(--txt);
  line-height: 1.6;
}
a { color: var(--prim); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
[hidden] { display: none !important; }

/* ===================================================================
   UTILITÁRIOS
=================================================================== */
.mt-8        { margin-top: .5rem; }
.texto-sub   { color: var(--txt-sub); }
.texto-pequeno { font-size: .85rem; color: var(--txt-sub); line-height: 1.5; }
.texto-centro  { text-align: center; margin-top: 1.5rem; }

/* ===================================================================
   BOTÕES
=================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--raio);
  font-size: .875rem; font-weight: 500; line-height: 1.4;
  cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primario         { background: var(--prim); color: #fff; }
.btn-primario:hover   { background: var(--prim-hover); color: #fff; }
.btn-primario:disabled { background: #93c5fd; cursor: not-allowed; opacity: .75; }
.btn-secundario       { background: #dbeafe; color: #1e40af; }
.btn-secundario:hover { background: #bfdbfe; color: #1e40af; }
.btn-outline          { background: transparent; border-color: var(--borda); color: var(--txt); }
.btn-outline:hover    { background: var(--fundo); }
.btn-ghost            { background: transparent; color: var(--txt-sub); }
.btn-ghost:hover      { background: var(--borda); color: var(--txt); }
.btn-perigo           { background: var(--perigo); color: #fff; }
.btn-perigo:hover     { background: #b91c1c; color: #fff; }
.btn-arquivar         { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.btn-arquivar:hover   { background: #e2e8f0; color: #334155; }
.btn-sm               { padding: .3rem .75rem; font-size: .8rem; }
.btn-bloco            { width: 100%; justify-content: center; padding: .65rem 1rem; }

/* ===================================================================
   ALERTAS
=================================================================== */
.alerta {
  padding: .875rem 1.1rem; border-radius: var(--raio);
  margin-bottom: 1.25rem; font-size: .9rem; line-height: 1.55;
}
.alerta-sucesso { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.alerta-erro    { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }

/* ===================================================================
   CAMPOS DE FORMULÁRIO
=================================================================== */
.campo { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.1rem; }
.campo label { font-size: .875rem; font-weight: 500; color: var(--txt); }
.campo input,
.campo select,
.campo textarea,
.campo-sel {
  padding: .6rem .85rem;
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  font-size: .9rem; color: var(--txt); background: var(--branco); width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.campo input:focus,
.campo select:focus,
.campo textarea:focus,
.campo-sel:focus {
  outline: none; border-color: var(--prim);
  box-shadow: 0 0 0 3px rgb(37 99 235 / .15);
}
.campo textarea { resize: vertical; min-height: 110px; }

.input-grupo-url {
  display: flex; align-items: stretch; border: 1px solid var(--borda); border-radius: var(--raio);
  overflow: hidden; background: var(--branco); transition: border-color .15s, box-shadow .15s;
}
.input-grupo-url:focus-within { border-color: var(--prim); box-shadow: 0 0 0 3px rgb(37 99 235 / .15); }
.input-grupo-prefixo {
  display: flex; align-items: center; padding: 0 .7rem; background: var(--fundo); color: var(--txt-sub);
  font-size: .8rem; white-space: nowrap; border-right: 1px solid var(--borda); flex-shrink: 0;
}
.input-grupo-url input {
  border: none !important; border-radius: 0 !important; box-shadow: none !important; flex: 1; min-width: 0;
}

/* ===================================================================
   RADIO BUTTONS (disponibilidade)
=================================================================== */
.radio-grupo {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
  border: 1px solid var(--borda); border-radius: var(--raio);
  background: var(--branco); padding: .4rem;
}
.radio-opcao {
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .45rem .75rem;
  border: 1px solid transparent; border-radius: calc(var(--raio) - 2px);
  cursor: pointer; font-size: .9rem; background: transparent;
  transition: border-color .15s, background .15s;
}
.radio-opcao:hover { border-color: var(--prim); background: #eff6ff; }
.radio-opcao input[type="radio"],
.radio-opcao input[type="checkbox"] { accent-color: var(--prim); width: 15px; height: 15px; flex-shrink: 0; }
.radio-opcao:has(input:checked) { border-color: var(--prim); background: #eff6ff; }
.radio-opcao:has(input:checked) span { color: var(--prim); font-weight: 600; }

.campo-fixo {
  padding: .6rem .85rem; border: 1px solid var(--borda); border-radius: var(--raio);
  background: var(--fundo); color: var(--txt); font-size: .9rem; font-weight: 600;
}

.radio-grupo-vertical { display: flex; flex-direction: column; grid-template-columns: none; }
.radio-opcao-desc { justify-content: flex-start; align-items: flex-start; text-align: left; }
.radio-opcao-desc input { margin-top: .2rem; }
.radio-opcao-legenda { display: block; font-weight: 400 !important; color: var(--txt-sub) !important; font-size: .78rem; margin-top: .1rem; }

/* ===================================================================
   GRADE 2 COLUNAS
=================================================================== */
.grade-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: end; }
@media (max-width: 580px) { .grade-2 { grid-template-columns: 1fr; align-items: stretch; } }

/* ===================================================================
   ÁREA DE UPLOAD
=================================================================== */
.upload-area {
  position: relative; border: 2px dashed var(--borda); border-radius: var(--raio);
  padding: 2rem 1.25rem; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s; background: var(--branco);
}
.upload-area:hover, .upload-area.drag-over { border-color: var(--prim); background: #eff6ff; }
.upload-area svg  { margin: 0 auto .6rem; color: var(--txt-sub); }
.upload-area p    { color: var(--txt-sub); font-size: .9rem; }
.upload-area .link-texto { color: var(--prim); font-weight: 500; }
.upload-dica      { font-size: .78rem !important; margin-top: .3rem; }
.upload-area input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-nome {
  margin-top: .5rem; padding: .45rem .85rem;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--raio);
  font-size: .85rem; color: var(--prim);
}

/* ===================================================================
   CONSENTIMENTO RGPD
=================================================================== */
.campo-consentimento {
  margin-bottom: 1.1rem; padding: 1rem;
  background: #f8fafc; border: 1px solid var(--borda); border-radius: var(--raio);
  transition: border-color .2s, background .2s;
}
.campo-consentimento.erro {
  border-color: #dc2626; background: #fef2f2;
}
.aviso-termos {
  margin: .6rem 0 0; font-size: .85rem; color: #dc2626; font-weight: 500;
}
.consentimento-label {
  display: flex; align-items: flex-start; gap: .65rem;
  cursor: pointer; font-size: .875rem; line-height: 1.6; color: var(--txt-sub);
}
.consentimento-label input[type="checkbox"] {
  width: 18px; height: 18px; min-width: 18px;
  margin-top: .18rem; accent-color: var(--prim); cursor: pointer;
}
.consentimento-label a { color: var(--prim); text-decoration: underline; }

/* ===================================================================
   FORMULÁRIO PÚBLICO — LAYOUT
=================================================================== */
.site-header { background: hsl(222, 18%, 62%); width: 100%; }
.site-header-inner { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; height: 5rem; display: flex; align-items: center; }
.site-logo { display: flex; align-items: center; text-decoration: none; }
.site-logo svg { height: 2.2rem; width: auto; }

.pag-form { background: var(--fundo); min-height: 100vh; }
.form-wrap { max-width: 700px; margin: 0 auto; padding: 2.5rem 1rem 4rem; }
.form-header { text-align: center; margin-bottom: 2rem; }
.form-header svg { margin: 0 auto .75rem; color: var(--prim); }
.form-header h1  { font-size: 1.75rem; margin-bottom: .5rem; }
.form-header p   { color: var(--txt-sub); font-size: .95rem; }
.form-wrap > form {
  background: var(--branco); padding: 2rem; border-radius: 12px; box-shadow: var(--sombra);
}

.form-secao { margin-bottom: 1.85rem; }
.form-secao:last-of-type { margin-bottom: 0; }
.form-secao-titulo {
  display: flex; align-items: center; gap: .5rem;
  font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--prim); margin-bottom: 1.1rem; padding-bottom: .65rem; border-bottom: 1px solid var(--borda);
}
.form-secao-titulo .icone { font-size: 1rem; }

/* ===================================================================
   PÁGINA DE LOGIN
=================================================================== */
.pag-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%); padding: 1.5rem;
}
.login-caixa {
  background: var(--branco); border-radius: 12px; box-shadow: var(--sombra-md);
  padding: 2.5rem 2rem; width: 100%; max-width: 400px;
}
.login-logo { display: flex; justify-content: center; margin-bottom: .85rem; color: var(--prim); }
.login-caixa h1 { text-align: center; font-size: 1.35rem; margin-bottom: 1.75rem; }

/* ===================================================================
   BARRA DE NAVEGAÇÃO (admin)
=================================================================== */
.barra-nav {
  background: var(--branco); border-bottom: 1px solid var(--borda);
  padding: .7rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 2px rgb(0 0 0/.06);
  flex-wrap: wrap; row-gap: .5rem;
}
.nav-marca { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--txt); }
.nav-acoes { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.nav-voltar { color: var(--txt-sub); font-size: .875rem; font-weight: 500; }
.nav-voltar:hover { color: var(--txt); text-decoration: none; }

/* ---- Dropdown Formulários ---- */
.dropdown-forms { position: relative; }
.dropdown-toggle { cursor: pointer; }
.dropdown-menu {
  display: none; position: absolute; right: 0; top: calc(100% + .35rem);
  background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio);
  box-shadow: var(--sombra-md); min-width: 220px; z-index: 200; padding: .4rem 0;
  max-height: 60vh; overflow-y: auto;
}
.dropdown-forms.aberto .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block; padding: .45rem 1rem; font-size: .82rem; color: var(--txt);
  text-decoration: none; transition: background .1s;
}
.dropdown-menu a:hover { background: #eff6ff; color: var(--prim); }
.dropdown-label {
  display: block; padding: .3rem 1rem .15rem; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--txt-sub);
}
.dropdown-sep { display: block; height: 1px; background: var(--borda); margin: .35rem 0; }

/* ===================================================================
   CONTEÚDO PRINCIPAL (admin)
=================================================================== */
.conteudo { max-width: 1200px; margin: 0 auto; padding: 1.75rem 1.5rem 3rem; }
.pagina-titulo { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; }

/* ===================================================================
   STATS
=================================================================== */
.stats-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--branco); border: 2px solid var(--borda); border-radius: var(--raio);
  padding: 1rem; text-align: center; text-decoration: none;
  transition: box-shadow .15s, border-color .15s, transform .1s; display: block;
}
.stat-card:hover       { box-shadow: var(--sombra); transform: translateY(-1px); text-decoration: none; }
.stat-card.ativo       { border-color: var(--prim); box-shadow: 0 0 0 3px rgb(37 99 235/.15); }
.stat-num              { display: block; font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat-leg              { display: block; font-size: .72rem; color: var(--txt-sub); margin-top: .25rem; }
.stat-azul     .stat-num { color: var(--prim); }
.stat-amarelo  .stat-num { color: var(--aviso); }
.stat-roxo     .stat-num { color: var(--roxo); }
.stat-verde    .stat-num { color: var(--sucesso); }
.stat-cinza    .stat-num { color: #64748b; }
.stat-vermelho .stat-num { color: var(--perigo); }

/* ===================================================================
   UNIDADES (botões)
=================================================================== */
.unidade-tabs        { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .85rem; }
.unidade-tabs-rotulo { font-size: .8rem; color: var(--txt-sub); font-weight: 600; }
.unidade-btn {
  padding: .4rem 1.1rem; border: 2px solid var(--borda); border-radius: 999px;
  font-size: .8rem; font-weight: 600; color: var(--txt-sub); background: var(--branco);
  text-decoration: none; transition: border-color .15s, color .15s, background .15s;
}
.unidade-btn:hover  { border-color: var(--prim); color: var(--prim); text-decoration: none; }
.unidade-btn.ativo  { border-color: var(--prim); background: var(--prim); color: var(--branco); }
.unidade-tabs-sep   { width: 1px; height: 1.4rem; background: var(--borda); margin: 0 .15rem; }

/* ===================================================================
   FILTROS
=================================================================== */
.filtros-form { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1.1rem; align-items: center; }
.filtro-busca {
  flex: 1 1 220px; padding: .5rem .85rem;
  border: 1px solid var(--borda); border-radius: var(--raio);
  font-size: .875rem; background: var(--branco); color: var(--txt);
  transition: border-color .15s;
}
.filtro-busca:focus { outline: none; border-color: var(--prim); }
.filtro-sel { padding: .5rem .75rem; border: 1px solid var(--borda); border-radius: var(--raio); font-size: .875rem; background: var(--branco); color: var(--txt); cursor: pointer; }

/* ===================================================================
   TABELA
=================================================================== */
.tabela-wrap { background: var(--branco); border: 1px solid #cbd5e1; border-radius: var(--raio); overflow-x: auto; box-shadow: var(--sombra); }
.tabela { width: 100%; border-collapse: collapse; font-size: .82rem; table-layout: fixed; }
.tabela thead tr { background: #1e3a5f; }
.tabela th {
  text-align: left; padding: .55rem .7rem;
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #e2e8f0; white-space: nowrap;
  border-right: 1px solid #2d5282;
}
.tabela th:last-child { border-right: none; }
.tabela td {
  padding: .5rem .7rem; border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0; vertical-align: middle;
}
.tabela td:last-child { border-right: none; }
.tabela tbody tr:nth-child(even) td { background: #f8fafc; }
.tabela tbody tr:nth-child(odd)  td { background: #ffffff; }
.tabela tbody tr:hover td { background: #eff6ff !important; }
.tabela tr:last-child td { border-bottom: none; }

.col-id     { width: 44px; }
.col-nome   { width: 160px; }
.col-email  { width: 190px; }
.col-area   { width: 160px; }
.col-estado { width: 110px; }
.col-data   { width: 115px; }
.col-notas  { width: auto; }
.col-acao   { width: 60px; }

.td-id    { color: var(--txt-sub); font-size: .75rem; text-align: center; }
.td-nome  { font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.td-email { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.td-email a { color: var(--prim); }
.td-area  { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.td-data  { color: var(--txt-sub); white-space: nowrap; font-size: .78rem; }
.td-notas { color: var(--txt-sub); font-size: .78rem; font-style: italic; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nota-preview { display: block; }
.td-acao  { text-align: center; }
.campo-notas { width: 100%; padding: .55rem .75rem; border: 1px solid var(--borda); border-radius: var(--raio); font-size: .875rem; color: var(--txt); background: var(--branco); resize: vertical; min-height: 100px; font-family: inherit; line-height: 1.5; transition: border-color .15s, box-shadow .15s; }
.campo-notas:focus { outline: none; border-color: var(--prim); box-shadow: 0 0 0 3px rgb(37 99 235/.15); }

/* ===================================================================
   BADGES
=================================================================== */
.badge { display: inline-block; padding: .22em .65em; border-radius: 999px; font-size: .73rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.badge-novo       { background: #dbeafe; color: #1d4ed8; }
.badge-analise    { background: #fef3c7; color: #92400e; }
.badge-entrevista { background: #ede9fe; color: #5b21b6; }
.badge-aprovado   { background: #dcfce7; color: #15803d; }
.badge-arquivado  { background: #f1f5f9; color: #475569; }
.badge-rejeitado  { background: #fee2e2; color: #b91c1c; }
.badge-admin      { background: #ede9fe; color: #5b21b6; }
.badge-gestor     { background: #dbeafe; color: #1d4ed8; }
.badge-editor     { background: #dcfce7; color: #15803d; }
.badge-leitor     { background: #f1f5f9; color: #475569; }

/* ===================================================================
   VAZIO
=================================================================== */
.vazio { display: flex; flex-direction: column; align-items: center; padding: 3.5rem 2rem; color: var(--txt-sub); gap: .75rem; }
.vazio p { font-size: .95rem; }

/* ===================================================================
   PAGINAÇÃO
=================================================================== */
.paginacao { display: flex; align-items: center; justify-content: center; gap: .85rem; margin-top: 1.25rem; font-size: .875rem; }
.pag-btn { padding: .4rem .95rem; border: 1px solid var(--borda); border-radius: var(--raio); background: var(--branco); color: var(--txt); transition: background .15s; }
.pag-btn:hover { background: var(--fundo); text-decoration: none; }
.pag-info { color: var(--txt-sub); }

/* ===================================================================
   VER CANDIDATURA
=================================================================== */
.conteudo-ver { max-width: 960px; }
.ver-grade { display: grid; grid-template-columns: 1fr 280px; gap: 1.25rem; align-items: start; }
@media (max-width: 700px) { .ver-grade { grid-template-columns: 1fr; } }

.card { background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); padding: 1.5rem; box-shadow: var(--sombra); }
.card + .card { margin-top: 1rem; }
.card-header { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.card-header h2 { font-size: 1.25rem; flex: 1; min-width: 0; }
.card-titulo { font-size: .9rem; font-weight: 600; margin-bottom: .85rem; }
.card-perigo { border-color: #fca5a5; }

.detalhe-lista { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.1rem; font-size: .9rem; }
.detalhe-lista dt { color: var(--txt-sub); font-weight: 500; white-space: nowrap; font-size: .8rem; }
.detalhe-lista dd { color: var(--txt); min-width: 0; word-break: break-word; }

.campo-sel { padding: .65rem .85rem; border: 1px solid var(--borda); border-radius: var(--raio); width: 100%; background: var(--branco); color: var(--txt); cursor: pointer; }
.campo-sel:focus { outline: none; border-color: var(--prim); box-shadow: 0 0 0 3px rgb(37 99 235/.15); }

.cv-acoes { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cv-nome  { font-size: .82rem; color: var(--txt-sub); }

.mensagem-bloco { margin-top: 1.35rem; padding-top: 1.25rem; border-top: 1px solid var(--borda); }
.mensagem-bloco h3 { font-size: .85rem; font-weight: 600; color: var(--txt-sub); margin-bottom: .6rem; }
.mensagem-bloco p  { font-size: .9rem; line-height: 1.75; }
.historico-lista { display: flex; flex-direction: column; gap: .5rem; list-style: none; }
.historico-item  { font-size: .85rem; line-height: 1.5; padding-left: .85rem; border-left: 2px solid var(--borda); color: var(--txt-sub); }

/* ===================================================================
   INSERIR MANUALMENTE
=================================================================== */
.conteudo-inserir { max-width: 720px; }
.conteudo-inserir .card + .card { margin-top: 1rem; }
.inserir-acoes { display: flex; gap: .75rem; margin-top: 1.25rem; }

/* ===================================================================
   DATA DE ENTREVISTA
=================================================================== */
.entrevista-data { display: block; font-size: .7rem; color: var(--roxo); font-weight: 600; margin-top: .22rem; white-space: nowrap; }
.label-entrevista { display: block; font-size: .8rem; font-weight: 500; color: var(--txt); margin-bottom: .3rem; }

/* ===================================================================
   DUPLICADOS
=================================================================== */
.badge-dup {
  display: inline-flex; align-items: center; gap: .2rem;
  margin-left: .35rem; padding: .1em .5em; border-radius: 999px;
  font-size: .68rem; font-weight: 700; background: #fef3c7; color: #92400e;
  vertical-align: middle; text-decoration: none;
}
.badge-dup:hover { background: #fde68a; text-decoration: none; }

.aviso-duplicados {
  display: flex; flex-direction: column; gap: .6rem;
  padding: 1rem 1.25rem; margin-bottom: 1rem;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--raio);
}
.aviso-duplicados h3 { font-size: .85rem; font-weight: 700; color: #92400e; }
.aviso-duplicados-lista { display: flex; flex-direction: column; gap: .4rem; }
.aviso-duplicados-item {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .55rem .75rem; background: var(--branco); border: 1px solid #fde68a; border-radius: calc(var(--raio) - 2px);
  text-decoration: none; color: var(--txt); font-size: .84rem;
  transition: border-color .15s, background .15s;
}
.aviso-duplicados-item:hover { border-color: var(--aviso); background: #fffdf5; text-decoration: none; }
.aviso-duplicados-item .adi-info { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.aviso-duplicados-item .adi-cat { color: var(--txt-sub); font-size: .76rem; display: flex; align-items: center; gap: .35rem; }
.aviso-duplicados-item .adi-data { color: var(--txt-sub); font-size: .76rem; white-space: nowrap; }

/* ===================================================================
   MÉTRICAS
=================================================================== */
.metr-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.1rem; margin-top: 1.1rem; }
.metr-card { background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); padding: 1.35rem; box-shadow: var(--sombra); }
.metr-card-titulo { font-size: .95rem; font-weight: 700; margin-bottom: .3rem; }
.metr-card-sub { font-size: .78rem; color: var(--txt-sub); margin-bottom: 1.15rem; }
.metr-card-larga { grid-column: 1 / -1; }

.metr-barra-linha { display: grid; grid-template-columns: 150px 1fr 46px; align-items: center; gap: .65rem; margin-bottom: .6rem; }
.metr-barra-linha:last-child { margin-bottom: 0; }
.metr-barra-label { font-size: .8rem; color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metr-barra-trilho { position: relative; height: 20px; background: var(--fundo); border-radius: 999px; overflow: hidden; }
.metr-barra-fill { position: absolute; inset: 0 auto 0 0; height: 100%; border-radius: 999px 4px 4px 999px; transition: filter .15s; }
.metr-barra-linha:hover .metr-barra-fill { filter: brightness(1.08); }
.metr-barra-valor { font-size: .8rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.metr-funil { display: flex; flex-direction: column; gap: .1rem; }
.metr-funil-saidas { display: flex; gap: 1.5rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--borda); }
.metr-funil-saida { display: flex; align-items: center; gap: .45rem; font-size: .8rem; color: var(--txt-sub); }
.metr-funil-saida .ponto { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.metr-funil-saida strong { color: var(--txt); font-variant-numeric: tabular-nums; }

.metr-colunas { display: flex; align-items: flex-end; gap: .9rem; height: 160px; padding-top: 1.5rem; }
.metr-coluna { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.metr-coluna-valor { font-size: .78rem; font-weight: 700; color: var(--txt); margin-bottom: .3rem; font-variant-numeric: tabular-nums; }
.metr-coluna-barra { width: 100%; max-width: 42px; background: var(--prim); border-radius: 4px 4px 0 0; transition: filter .15s; }
.metr-coluna:hover .metr-coluna-barra { filter: brightness(1.1); }
.metr-coluna-label { margin-top: .55rem; font-size: .74rem; color: var(--txt-sub); text-transform: capitalize; }

.metr-kpi-delta { display: block; font-size: .72rem; font-weight: 700; margin-top: .3rem; }
.metr-kpi-delta.subida  { color: var(--sucesso); }
.metr-kpi-delta.descida { color: var(--perigo); }
.metr-kpi-delta.igual   { color: var(--txt-sub); }

/* ===================================================================
   EXPORTAR
=================================================================== */
.exportar-intro { margin: -.75rem 0 1.35rem; max-width: 46rem; }

.secao-cabecalho { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .85rem; }
.secao-cabecalho .card-titulo { margin-bottom: 0; }
.link-limpar {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--prim); font-size: .78rem; font-weight: 500;
}
.link-limpar:hover { text-decoration: underline; }

.chip-grupo { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .95rem; border: 1px solid var(--borda); border-radius: 999px;
  background: var(--branco); font-size: .85rem; color: var(--txt); cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.chip:hover { border-color: var(--prim); background: #eff6ff; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip:has(input:checked) { border-color: var(--prim); background: var(--prim); color: #fff; }
.chip:has(input:focus-visible) { outline: 2px solid var(--prim); outline-offset: 2px; }

.rodape-fixo {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: 1.5rem; padding: 1rem 1.25rem;
  background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio);
  box-shadow: var(--sombra); position: sticky; bottom: 1rem;
}
.rodape-fixo-info { font-size: .82rem; color: var(--txt-sub); }
.rodape-fixo-acoes { display: flex; gap: .6rem; }

/* ===================================================================
   RESPONSIVO / MOBILE
=================================================================== */
@media (max-width: 768px) {
  .barra-nav      { padding: .6rem .85rem; }
  .nav-marca      { font-size: .92rem; }
  .conteudo       { padding: 1.25rem .85rem 2.5rem; }
  .pagina-titulo  { font-size: 1.3rem; margin-bottom: 1.1rem; }

  .stats-grade    { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
  .stat-card      { padding: .75rem .5rem; }
  .stat-num       { font-size: 1.5rem; }

  .metr-grade     { grid-template-columns: 1fr; }
  .card           { padding: 1.15rem; }

  .filtros-form   { flex-direction: column; align-items: stretch; }
  .filtro-busca,
  .filtro-sel     { flex: none; width: 100%; }
  .filtros-form .btn { width: 100%; }

  .form-wrap        { padding: 1.5rem .75rem 3rem; }
  .form-wrap > form { padding: 1.35rem; }
  .login-caixa      { padding: 2rem 1.35rem; }

  .rodape-fixo        { flex-direction: column; align-items: stretch; bottom: .5rem; }
  .rodape-fixo-acoes  { flex-direction: column; }
  .rodape-fixo-acoes .btn { width: 100%; }

  .input-grupo-url      { flex-direction: column; }
  .input-grupo-prefixo  { white-space: normal; word-break: break-all; border-right: none; border-bottom: 1px solid var(--borda); }
}

/* ---- Tabelas: layout de cartões em vez de scroll horizontal ---- */
@media (max-width: 700px) {
  .tabela-wrap { overflow-x: visible; border: none; box-shadow: none; background: transparent; }
  .tabela, .tabela tbody, .tabela tr, .tabela td { display: block; width: 100%; }
  .tabela thead { display: none; }
  .tabela tr {
    margin-bottom: .75rem; border: 1px solid #cbd5e1; border-radius: var(--raio);
    overflow: hidden; box-shadow: var(--sombra); background: var(--branco);
  }
  .tabela tbody tr:nth-child(even) td,
  .tabela tbody tr:nth-child(odd)  td { background: transparent; }
  .tabela td {
    width: 100% !important; white-space: normal; text-align: left;
    padding: .45rem .85rem; border-right: none; border-bottom: 1px solid var(--borda);
    overflow: visible; text-overflow: clip;
  }
  .tabela tr td:last-child { border-bottom: none; }
  .tabela td::before {
    content: attr(data-label); display: block; margin-bottom: .15rem;
    font-weight: 700; font-size: .68rem; text-transform: uppercase;
    letter-spacing: .03em; color: var(--txt-sub);
  }
  .tabela td.td-acao {
    text-align: center; background: var(--fundo); padding: .6rem .85rem;
  }
  .tabela td.td-acao::before { display: none; }
}

@media (max-width: 480px) {
  .detalhe-lista        { grid-template-columns: 1fr; gap: .1rem 0; }
  .detalhe-lista dt      { margin-top: .65rem; }
  .detalhe-lista dt:first-child { margin-top: 0; }

  .radio-grupo:not(.radio-grupo-vertical) { grid-template-columns: 1fr; }

  .metr-barra-linha  { grid-template-columns: 82px 1fr 32px; gap: .4rem; }
  .metr-barra-label  { font-size: .74rem; }

  .dropdown-menu     { min-width: 190px; }
}
