/* Aba Cadastro. Referência: frontend-referencia/telas/04 a 08 */

.topo-cadastro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.topo-cadastro h1 { margin: 0; font-family: var(--fonte-titulo); font-size: 32px; font-weight: 800; color: var(--texto-forte); }
.topo-cadastro p { margin: 4px 0 0; font-size: 15px; color: var(--texto-suave); }
.admin { display: flex; align-items: center; gap: 12px; }
.selo-admin {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px;
  border: 1.5px solid #9FD06E; background: linear-gradient(180deg, #F3FAEC, #E2F2D2);
  color: #256118; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.selo-admin svg { stroke: #2F7A1F; }
.selo-admin small { font-weight: 500; color: #3F6B2E; }

/* Abas em forma de pílula */
.pilulas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.pilula {
  min-height: 46px; padding: 0 26px; border-radius: 999px; cursor: pointer; font-size: 16px; font-weight: 600;
  color: var(--texto-forte); border: 1px solid #7E838A;
  background: linear-gradient(180deg, #FFFFFF, #D3D6DA 55%, #BABEC3); box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0,0,0,.25);
}
.pilula[aria-selected="true"] {
  color: #fff; border-color: #255F18; text-shadow: 0 1px 2px rgba(0,0,0,.45);
  background: linear-gradient(180deg, #A2E85C 0%, #62BD34 46%, #3F9A24 54%, #2F7A1F 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 0 0 2px #DADDE0, 0 0 0 3px #858A91;
}

/* Painel com busca + tabela */
.base { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.barra { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.barra .busca { flex: 0 1 460px; }
.barra label.inativos { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--texto-suave); cursor: pointer; }
.tabela-rolagem { overflow-x: auto; border-radius: 10px; border: 1px solid #D5D8DC; }
table.lista { width: 100%; border-collapse: collapse; font-size: 15px; }
table.lista th {
  text-align: left; padding: 14px 18px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #4A4E55;
  background: linear-gradient(180deg, #E4E6E9, #D7DADE); white-space: nowrap;
}
table.lista td { padding: 14px 18px; border-top: 1px solid #E3E6EA; background: rgba(255,255,255,.55); vertical-align: middle; }
table.lista td.nome { font-weight: 700; color: var(--texto-forte); }
table.lista td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.lista td.acao { width: 1%; text-align: right; }
table.lista tr.inativo td { color: #8F949B; }
table.lista tr.inativo td.nome::after { content: " · inativo"; font-weight: 500; font-size: 13px; color: #B04E0A; }
table.lista .vazio { text-align: center; color: var(--texto-suave); padding: 28px; }
.lapis-btn {
  width: 44px; height: 44px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #7E838A; background: linear-gradient(180deg, #FFFFFF, #D3D6DA 55%, #BABEC3);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0,0,0,.25);
}
.lapis-btn svg { stroke: #2A2D31; }
.rodape-nota { margin: 0; font-size: 14px; color: var(--texto-suave); }

/* Pop-ups do cadastro */
.janela .sub { margin: 0; padding: 0 24px; font-size: 14px; color: var(--texto-suave); }
.janela .fechar-x { position: absolute; right: 16px; top: 18px; width: 40px; height: 40px; border: none; background: none; cursor: pointer; border-radius: 8px; }
.janela .fechar-x svg { stroke: #4A4E55; }
.janela { position: relative; }
.ativo-linha { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.ativo-linha input { width: 20px; height: 20px; accent-color: #3F9A24; }
.aviso-verde { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 10px;
  border: 1.5px solid #CFE8B5; background: #F1F9E8; font-size: 14px; color: #2A2D31; line-height: 1.45; }
.aviso-verde svg { flex: none; stroke: #2F7A1F; }
.vk-f.travado { opacity: .65; }

/* Senha do cadastro */
.janela.senha { max-width: 440px; }
.janela.senha .topo-senha { padding: 28px 28px 4px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.janela.senha h2 { padding: 0; }
.janela.senha .topo-senha p { margin: 0; font-size: 14px; color: var(--texto-suave); line-height: 1.5; }

@media (max-width: 760px) {
  .topo-cadastro h1 { font-size: 26px; }
  .barra .busca { flex: 1 1 100%; }
  .pilula { padding: 0 18px; }
  .admin { width: 100%; justify-content: space-between; }
  .selo-admin { padding: 8px 12px; font-size: 13px; }
}

/* =====================================================================
   ABA MASTER (visual grafite)
   ===================================================================== */
.pilula-master { display: inline-flex; align-items: center; gap: 8px; }
.selo-admin.master { border-color: #1C1E21; color: #fff; background: linear-gradient(180deg, #4A4D53, #2B2E33); }
.selo-admin.master svg { stroke: #A6E35F; }
.selo-admin.master small { color: #C9CDD2; }

.area-master { display: flex; gap: 22px; align-items: flex-start; }
.tabelas-master { flex: 0 0 250px; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 16px; }
.tabelas-master h3 { margin: 0 8px 6px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #4A4E55; }
.item-tabela { text-align: left; padding: 10px 14px; border-radius: 10px; border: 1.5px solid transparent; background: none; cursor: pointer; }
.item-tabela strong { display: block; font-size: 15px; color: var(--texto-forte); }
.item-tabela small { display: block; font-size: 12px; color: var(--texto-suave); margin-top: 2px; }
.item-tabela:hover { background: rgba(255,255,255,.6); }
.item-tabela[aria-current="true"] { border-color: #9FD06E; background: linear-gradient(180deg, #F3FAEC, #E2F2D2); }
.item-tabela[aria-current="true"] strong { color: #256118; }
.painel-master { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }

.secao-master { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.cab-master { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.cab-master h2 { margin: 0; font-family: var(--fonte-titulo); font-size: 22px; font-weight: 800; color: var(--texto-forte); }
.cab-master p { margin: 4px 0 0; font-size: 13px; color: var(--texto-suave); max-width: 560px; line-height: 1.45; }
.filtro-uf { display: flex; align-items: flex-end; gap: 10px; }
.filtro-uf > span { padding-bottom: 12px; color: #4A4E55; }
.filtro-uf .vk-f { min-height: 42px; }
.filtro-uf select { background: transparent; border: none; color: #fff; font-size: 15px; font-weight: 700; padding: 8px 4px; outline: none; cursor: pointer; }
.filtro-uf select option { color: #14161A; }

/* grade 27 x 27 */
.grade-rolagem { overflow: auto; max-height: 68vh; border: 1px solid #D5D8DC; border-radius: 10px; background: #fff; }
table.grade { border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
table.grade th { position: sticky; top: 0; z-index: 2; background: #E4E6E9; color: #4A4E55; font-weight: 700;
  padding: 8px 4px; min-width: 64px; border-bottom: 1px solid #C9CDD2; }
table.grade th.canto { left: 0; z-index: 3; background: #2B2E33; color: #fff; }
table.grade tbody th { left: 0; z-index: 1; position: sticky; border-right: 1px solid #C9CDD2; border-bottom: 1px solid #ECEEF0; }
table.grade td { padding: 0; border-bottom: 1px solid #ECEEF0; border-right: 1px solid #F1F2F4; }
table.grade input {
  width: 64px; border: none; background: transparent; text-align: center; padding: 8px 2px; font-size: 13px;
  font-variant-numeric: tabular-nums; color: #2A2D31; outline: none;
}
table.grade input:focus { background: #F3FAEC; box-shadow: inset 0 0 0 2px #7DC242; }
table.grade td.diag input { font-weight: 800; background: #E9EBEE; }
table.grade td.alterada input { background: #FFF1E3; color: #8A3A05; font-weight: 700; }
table.grade .linha-sel, table.grade .col-sel { background: #F3FAEC; }
table.grade th.linha-sel, table.grade th.col-sel { background: #7DC242; color: #fff; }
table.grade td.cel-sel input { box-shadow: inset 0 0 0 2px #2F7A1F; background: #E2F2D2; font-weight: 800; }

.rodape-master { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.rodape-master span { font-size: 13px; color: var(--texto-suave); }
.rodape-master .botoes { display: flex; gap: 12px; }

/* coeficientes */
.coef-campo { display: inline-flex; width: 140px; }
.coef-campo input { text-align: left; font-family: var(--fonte-titulo); font-size: 16px; font-weight: 800; }
tr.alterada .coef-campo .vk-f { border-color: #E8711A; }

/* senha master (grafite) */
.icone-grafite { background: linear-gradient(180deg, #5A5E64, #2B2E33) !important; }
.icone-grafite svg { stroke: #A6E35F !important; }
.janela.grafite .faixa div:first-child { background: #2B2E33; }

@media (max-width: 900px) {
  .area-master { flex-direction: column; }
  .tabelas-master { position: static; flex-basis: auto; width: 100%; flex-direction: row; flex-wrap: wrap; }
  .tabelas-master h3 { width: 100%; }
  .item-tabela { flex: 1 1 45%; }
}
