/* =====================================================================
   Sistema de RH da SHE — Estilos globais
   Arquivo: assets/css/estilos.css
   ===================================================================== */

:root {
  /* Paleta oficial SHE */
  --she-magenta-escuro: #AF1F6D;
  --she-magenta: #FF008A;
  --she-preto: #000000;
  --she-branco: #FFFFFF;

  /* Tons de apoio (derivados para estados e neutros) */
  --she-magenta-escuro-hover: #8F1959;
  --she-magenta-claro: #FCE8F2;
  --cinza-fundo: #F5F5F7;
  --cinza-borda: #E2E2E6;
  --cinza-texto: #5B5B66;
  --cinza-claro: #9A9AA5;
  --texto: #111114;

  /* Cores de alerta (sempre acompanhadas de texto) */
  --sucesso: #1B7F3B;   --sucesso-fundo: #E7F5EC;
  --erro: #B00020;      --erro-fundo: #FDECEE;
  --aviso: #8A5A00;     --aviso-fundo: #FFF4D6;
  --info: #1F4E8C;      --info-fundo: #E8F0FB;

  --raio: 10px;
  --sombra: 0 2px 10px rgba(0, 0, 0, 0.06);
  --lateral: 248px;
  --fonte: 'Montserrat', Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--fonte);
  font-size: 15px;
  line-height: 1.5;
  color: var(--texto);
  background: var(--cinza-fundo);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0 0 8px; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 12px; }
a { color: var(--she-magenta-escuro); }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

:focus-visible {
  outline: 3px solid var(--she-magenta);
  outline-offset: 2px;
}

.oculto-visualmente {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Carregamento ---------- */
.carregando-tela {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  color: var(--cinza-texto); gap: 12px;
}
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--cinza-borda); border-top-color: var(--she-magenta-escuro);
  animation: girar 0.8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Botões ---------- */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border-radius: 8px; border: 1px solid transparent;
  font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}
.botao:disabled { opacity: 0.55; cursor: not-allowed; }
.botao-primario { background: var(--she-magenta-escuro); color: var(--she-branco); }
.botao-primario:hover:not(:disabled) { background: var(--she-magenta-escuro-hover); }
.botao-secundario { background: var(--she-branco); color: var(--texto); border-color: var(--cinza-borda); }
.botao-secundario:hover:not(:disabled) { border-color: var(--cinza-texto); }
.botao-texto { background: transparent; color: var(--she-magenta-escuro); padding: 0 8px; min-height: 36px; }
.botao-texto:hover:not(:disabled) { background: var(--she-magenta-claro); }
.botao-bloco { width: 100%; }

/* ---------- Formulários ---------- */
.campo { margin-bottom: 16px; }
.campo label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.campo input[type="text"], .campo input[type="email"], .campo input[type="password"],
.campo input[type="search"], .campo select {
  width: 100%; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--cinza-borda); border-radius: 8px; background: var(--she-branco); color: var(--texto);
}
.campo input:focus, .campo select:focus { border-color: var(--she-magenta-escuro); outline: none; box-shadow: 0 0 0 3px var(--she-magenta-claro); }
.campo-ajuda { font-size: 13px; color: var(--cinza-texto); margin-top: 4px; }
.campo-check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.campo-check input { width: 18px; height: 18px; accent-color: var(--she-magenta-escuro); }
.secao-form { border: 1px solid var(--cinza-borda); border-radius: var(--raio); padding: 16px; margin-bottom: 16px; }
.secao-form > legend { font-weight: 700; padding: 0 6px; }

/* ---------- Alertas ---------- */
.alerta {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 8px; border-left: 4px solid; margin-bottom: 16px; font-size: 14px;
}
.alerta strong { white-space: nowrap; }
.alerta-sucesso { background: var(--sucesso-fundo); border-color: var(--sucesso); color: var(--sucesso); }
.alerta-erro    { background: var(--erro-fundo);    border-color: var(--erro);    color: var(--erro); }
.alerta-aviso   { background: var(--aviso-fundo);   border-color: var(--aviso);   color: var(--aviso); }
.alerta-info    { background: var(--info-fundo);    border-color: var(--info);    color: var(--info); }
.alerta p { margin: 0; color: var(--texto); }

/* ---------- Telas de acesso (login, recuperar senha, nova senha) ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-marca {
  position: relative; overflow: hidden; color: var(--she-branco);
  background: linear-gradient(90deg, #1A0510 0%, #3A0A22 25%, #61113C 50%, #851752 70%, #991B5F 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 40px 96px;
}
/* Faixas diagonais suaves, como no layout aprovado */
.login-marca::before {
  content: ""; position: absolute; inset: -20% -10%; pointer-events: none;
  background:
    linear-gradient(100deg, transparent 18%, rgba(255, 255, 255, 0.035) 18%, rgba(255, 255, 255, 0.035) 30%, transparent 30%),
    linear-gradient(100deg, transparent 38%, rgba(0, 0, 0, 0.10) 38%, rgba(0, 0, 0, 0.10) 47%, transparent 47%);
}
.login-marca-centro { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 560px; }
.login-marca img { width: 100%; max-width: 480px; height: auto; }
.login-slogan {
  margin: 20px 0 0; font-size: 13px; font-weight: 700; letter-spacing: 0.38em;
  text-transform: uppercase; text-align: center; line-height: 1.8;
}
.login-empresa { position: absolute; left: 40px; bottom: 36px; margin: 0; font-size: 20px; font-weight: 300; letter-spacing: 0.01em; }

.login-formulario { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--she-branco); }
.login-caixa { width: 100%; max-width: 460px; }
.login-caixa h1 { font-size: 20px; font-weight: 700; margin: 0; }
.login-caixa .subtitulo { font-size: 17px; color: var(--texto); margin: 2px 0 28px; }
.login-caixa .campo { margin-bottom: 22px; }
.login-caixa .campo label { font-size: 17px; font-weight: 400; text-transform: uppercase; margin-bottom: 8px; }
.login-caixa .campo input[type="email"],
.login-caixa .campo input[type="password"],
.login-caixa .campo input[type="text"] {
  min-height: 60px; padding: 0 18px; font-size: 16px;
  border: 2px solid var(--she-magenta-escuro); border-radius: 14px;
}
.login-caixa .campo input:focus { border-color: var(--she-magenta); box-shadow: 0 0 0 3px var(--she-magenta-claro); }
.login-caixa .campo input:disabled { background: #F7F7F8; border-color: var(--cinza-borda); }
.login-caixa .botao-primario { min-height: 56px; border-radius: 14px; font-size: 16px; margin-top: 6px; }
.login-link {
  display: block; width: fit-content; margin: 36px auto 0; padding: 6px 10px;
  font-size: 17px; font-weight: 700; color: var(--she-magenta-escuro); text-decoration: none; border-radius: 6px;
}
.login-link:hover { text-decoration: underline; }
.login-requisitos { font-size: 13px; color: var(--cinza-texto); margin: -10px 0 18px; padding-left: 18px; }
.login-requisitos li.ok { color: var(--sucesso); }

/* Campo de senha com botão "mostrar/ocultar" */
.campo-senha { position: relative; }
.campo-senha input { padding-right: 60px !important; }
.botao-olho {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: 10px; cursor: pointer; color: var(--she-magenta-escuro);
}
.botao-olho:hover { background: var(--she-magenta-claro); }
.botao-olho svg { width: 28px; height: 28px; }

/* ---------- Estrutura principal ---------- */
.estrutura { min-height: 100vh; display: flex; }
.lateral {
  width: var(--lateral); flex-shrink: 0; background: var(--she-preto); color: var(--she-branco);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.lateral-marca { padding: 24px 20px 20px; border-bottom: 1px solid #222; }
.lateral-marca img { width: 130px; height: auto; display: block; }
.lateral nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.menu-grupo { margin: 14px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cinza-claro); }
.menu-grupo:first-child { margin-top: 4px; }
.lateral nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; margin-bottom: 4px; border-radius: 8px;
  color: #D6D6DC; text-decoration: none; font-weight: 600; font-size: 14px;
  border-left: 3px solid transparent;
}
.lateral nav a:hover { background: #1A1A1E; color: var(--she-branco); }
.lateral nav a[aria-current="page"] { background: #1A1A1E; color: var(--she-branco); border-left-color: var(--she-magenta); }
.lateral-rodape { padding: 14px 20px; font-size: 12px; color: var(--cinza-claro); border-top: 1px solid #222; }

.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cabecalho {
  height: 64px; background: var(--she-branco); border-bottom: 1px solid var(--cinza-borda);
  display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.cabecalho-titulo { flex: 1; font-weight: 700; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cabecalho-usuario { text-align: right; line-height: 1.2; }
.cabecalho-usuario .nome { font-weight: 600; font-size: 14px; }
.cabecalho-usuario .perfil { font-size: 12px; color: var(--cinza-texto); }
.botao-menu { display: none; background: none; border: 0; padding: 8px; cursor: pointer; border-radius: 8px; }
.botao-menu span { display: block; width: 22px; height: 2px; background: var(--texto); margin: 5px 0; }
.conteudo { padding: 24px; flex: 1; }
.fundo-menu { display: none; }

/* ---------- Cards ---------- */
.grade-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: var(--she-branco); border: 1px solid var(--cinza-borda); border-radius: var(--raio); padding: 20px; box-shadow: var(--sombra); }
.card-rotulo { font-size: 13px; color: var(--cinza-texto); font-weight: 600; }
.card-valor { font-size: 30px; font-weight: 700; margin: 4px 0; }
.card-destaque { border-top: 4px solid var(--she-magenta-escuro); }
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--she-magenta-escuro); }

/* ---------- Tabelas ---------- */
.painel { background: var(--she-branco); border: 1px solid var(--cinza-borda); border-radius: var(--raio); box-shadow: var(--sombra); }
.painel-topo { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px; border-bottom: 1px solid var(--cinza-borda); }
.painel-topo .campo { margin: 0; flex: 1 1 180px; }
.tabela-rolagem { overflow-x: auto; position: relative; }
table.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th, .tabela td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--cinza-borda); vertical-align: middle; }
.tabela th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--cinza-texto); background: #FAFAFB; white-space: nowrap; }
.tabela th button { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.tabela th[aria-sort="ascending"] button::after { content: "▲"; font-size: 9px; }
.tabela th[aria-sort="descending"] button::after { content: "▼"; font-size: 9px; }
.tabela tbody tr:hover { background: #FBFBFC; }
.tabela-vazia { padding: 32px 16px; text-align: center; color: var(--cinza-texto); }
.paginacao { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: 14px; color: var(--cinza-texto); flex-wrap: wrap; }
.paginacao-botoes { display: flex; gap: 8px; }

/* ---------- Etiquetas ---------- */
.etiqueta { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.etiqueta-ativo { background: var(--sucesso-fundo); color: var(--sucesso); }
.etiqueta-inativo { background: #EEEEF1; color: var(--cinza-texto); }
.etiqueta-pendente { background: var(--aviso-fundo); color: var(--aviso); }
.etiqueta-perfil { background: var(--she-magenta-claro); color: var(--she-magenta-escuro); }

/* ---------- Modal ---------- */
.modal-fundo {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal { background: var(--she-branco); border-radius: 12px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2); }
.modal-topo { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--cinza-borda); }
.modal-topo h2 { margin: 0; }
.modal-corpo { padding: 20px; }
.modal-rodape { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--cinza-borda); }
.botao-fechar { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--cinza-texto); padding: 4px 8px; border-radius: 6px; }

/* ---------- Página de mensagem (sem acesso etc.) ---------- */
.pagina-mensagem { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.pagina-mensagem .card { max-width: 480px; width: 100%; text-align: center; }
.pagina-mensagem .faixa { background: var(--she-magenta-escuro); margin: -20px -20px 20px; padding: 24px; border-radius: var(--raio) var(--raio) 0 0; }
.pagina-mensagem .faixa img { width: 150px; height: auto; }

.cabecalho-pagina { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.cabecalho-pagina p { color: var(--cinza-texto); margin: 0; }
.texto-secundario { color: var(--cinza-texto); font-size: 13px; }

/* ---------- Complementos (Etapa 3) ---------- */
.campo input[type="date"] {
  width: 100%; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--cinza-borda); border-radius: 8px; background: var(--she-branco); color: var(--texto);
}
.painel-topo > .botao { flex: 0 0 auto; }
.grade-duas { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.lista-dados { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 12px 0 16px; }
.lista-dados dt { font-weight: 600; color: var(--cinza-texto); font-size: 14px; }
.lista-dados dd { margin: 0; word-break: break-word; }
.linha-campo { display: flex; gap: 8px; }
.linha-campo input { flex: 1; min-width: 0; }
.texto-mono { font-family: 'Courier New', Courier, monospace; letter-spacing: 0.04em; }
.senha-destaque { background: var(--she-branco); color: var(--texto); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--cinza-borda); font-size: 15px; }
.lista-alteracoes { margin: 0; padding-left: 16px; }
.lista-alteracoes li { margin-bottom: 2px; }
.etiqueta + .etiqueta { margin-left: 4px; }
.cabecalho-usuario:hover .nome { text-decoration: underline; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-marca { padding: 32px 16px 28px; }
  .login-marca img { max-width: 240px; }
  .login-slogan { font-size: 10px; letter-spacing: 0.25em; margin-top: 12px; }
  .login-empresa { position: static; margin-top: 16px; font-size: 15px; }
  .login-formulario { align-items: flex-start; padding: 32px 16px; }
  .login-link { margin-top: 24px; }

  .lateral { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform 0.2s; }
  .estrutura.menu-aberto .lateral { transform: translateX(0); }
  .estrutura.menu-aberto .fundo-menu { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 40; }
  .botao-menu { display: block; }
  .cabecalho { padding: 0 12px; }
  .conteudo { padding: 16px; }
  .cabecalho-usuario .perfil { display: none; }
}
@media (max-width: 560px) {
  .linha-campo { flex-wrap: wrap; }
  .linha-campo input { flex-basis: 100%; }
  .lista-dados { grid-template-columns: 1fr; gap: 2px; }
  .lista-dados dd { margin-bottom: 10px; }
  .cabecalho-usuario { display: none; }
  .tabela th, .tabela td { padding: 10px 12px; }
  .modal-rodape { flex-direction: column-reverse; }
  .modal-rodape .botao { width: 100%; }
}
