/* RecrutaWeb Admin — Override do visual do Portal do Gestor (branco, responsivo, centralizado)
   IMPORTANTE: carregar este CSS por último no header.php
*/
:root{
  --rw-sidebar-w: 200px;   /* largura da sidebar igual ao admin antigo */
  --rw-sidebar-w-collapsed: 64px; /* largura quando recolhida */
  --rw-topbar-h: 64px;
}

.theme-gestor *{ box-sizing: border-box; }

body.theme-gestor {
  background: #fff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* ===== HEADER / TOPBAR ===== */
.theme-gestor .topbar{
  position: sticky; top:0; height: var(--rw-topbar-h);
  display:flex; align-items:center; gap:16px;
  background:#fff !important;
  color:#1c2430 !important;
  border-bottom:1px solid #e6e9ef !important;
  z-index:1000;
  background-image:none !important;
}
.theme-gestor .topbar, .theme-gestor .topbar * { color:#1c2430 !important; }
.theme-gestor .topbar a,
.theme-gestor .topbar a:visited { color:#1c2430 !important; text-decoration:none; }
.theme-gestor .topbar a:hover { color:#1e88e5 !important; text-decoration:underline; }

.theme-gestor .topbar-left{ display:flex; align-items:center; gap:12px; }
.theme-gestor .topbar-right{ margin-left:auto; display:flex; align-items:center; gap:12px; }
.theme-gestor .topbar .relogio{ font-variant-numeric: tabular-nums; opacity:.85; }

/* Botão hamburguer da topbar (toggle do sidebar) */
.theme-gestor .sb-toggle{
  border:0; background:transparent; width:40px; height:40px;
  border-radius:10px; display:inline-flex; align-items:center; justify-content:center;
  cursor:pointer; color: inherit;
}
.theme-gestor .sb-toggle:hover{ background: rgba(16,24,40,.08); }
.theme-gestor .sb-toggle .bar{
  width:18px; height:2px; background: currentColor; display:block; margin:3px 0; border-radius:2px;
}

/* ===== SIDEBAR ===== */
.theme-gestor .sidebar{
  position: fixed; left:0; top: var(--rw-topbar-h); bottom:0;
  width: var(--rw-sidebar-w) !important;
  background: #fff !important;
  border-right: 1px solid #e6e9ef !important;
  box-shadow: 0 6px 24px rgba(16,24,40,.06) !important;
  background-image:none !important;
  overflow-y:auto;
  transition: width .2s ease, transform .2s ease;
}
.theme-gestor .sidebar nav a {
  color: #1c2430; display:flex; align-items:center; gap:10px;
  padding:10px 14px; border-left:3px solid transparent; text-decoration:none;
}
.theme-gestor .sidebar nav a .label{ display:inline-block; }
.theme-gestor .sidebar nav a.active {
  background:#f1f5ff; color:#1e5bd6; border-left-color:#1e88e5;
}

/* ===== CONTEÚDO CENTRAL - ocupa toda a largura útil ===== */
.theme-gestor main, .theme-gestor .rw-container{
  max-width: none;                                  /* <— remove limite de 1280px  */
  width: calc(100% - var(--rw-sidebar-w));          /* ocupa tudo até a borda direita */
  margin-left: var(--rw-sidebar-w) !important;
  margin-right: 0;
  margin-top: var(--rw-topbar-h);
  padding: 24px min(32px, 3vw) 40px;
  transition: margin-left .2s ease, width .2s ease;
}

/* ===== FOOTER ===== */
.theme-gestor .rw-footer.footer {
  margin-left: var(--rw-sidebar-w) !important;
  background: #fff !important;
  border-top: 1px solid #e6e9ef !important;
  color: #667085;
  padding: 14px 20px;
  transition: margin-left .2s ease;
}

/* ====== ESTADO RECOLHIDO (desktop) ====== */
.theme-gestor.sb-collapsed .sidebar{
  width: var(--rw-sidebar-w-collapsed) !important;
}
.theme-gestor.sb-collapsed main,
.theme-gestor.sb-collapsed .rw-container{
  margin-left: var(--rw-sidebar-w-collapsed) !important;
  width: calc(100% - var(--rw-sidebar-w-collapsed));
}
.theme-gestor.sb-collapsed .rw-footer.footer{
  margin-left: var(--rw-sidebar-w-collapsed) !important;
}
/* Esconde rótulos e centraliza ícones quando recolhido */
.theme-gestor.sb-collapsed .sidebar nav a{ justify-content:center; }
.theme-gestor.sb-collapsed .sidebar nav a .label{ display:none; }
.theme-gestor.sb-collapsed .sidebar nav a i,
.theme-gestor.sb-collapsed .sidebar nav a svg{ margin:0 !important; }

/* ===== CARDS / KPIS ===== */
.theme-gestor .cards { display: grid; grid-template-columns: repeat(6,1fr); gap: 12px; }
@media (max-width:1200px){ .theme-gestor .cards { grid-template-columns: repeat(3,1fr); } }
@media (max-width:768px){ .theme-gestor .cards { grid-template-columns: 1fr; } }

.theme-gestor .card{
  background:#fff; border:1px solid #e6e9ef; border-radius:14px;
  box-shadow:0 6px 24px rgba(16,24,40,.06); padding:16px;
}
.theme-gestor .card h3{ font-size:14px; color:#667085; margin:0 0 8px; }
.theme-gestor .card .val{ font-size:28px; font-weight:700; color:#1c2430; }
.theme-gestor .card .muted{ font-size:12px; color:#98a2b3; }

/* ===== BARRA DE FILTROS — 1 linha no desktop ===== */
.theme-gestor .filters-grid{
  display:grid; gap:8px; align-items:center;
  /* 7 colunas: busca | empresa | vaga | status | dt ini | dt fim | botão */
  grid-template-columns: minmax(240px,1.2fr) 150px 160px 160px 130px 130px auto;
}
.theme-gestor .filters-grid input[type="text"],
.theme-gestor .filters-grid select,
.theme-gestor .filters-grid input[type="date"]{
  width:100% !important; height:38px; padding:6px 10px; font-size:14px;
}
.theme-gestor .filters-grid .btn{ height:38px; padding:8px 14px; }

/* quebra elegante em telas menores */
@media (max-width: 1180px){
  .theme-gestor .filters-grid{ grid-template-columns: 1fr 1fr 1fr 1fr; }
}

/* ===== BOTÕES ===== */
.theme-gestor .btn, .theme-gestor .btn-primary{
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 14px; border-radius:12px; border:1px solid #e6e9ef;
  background:#fff; cursor:pointer; font-weight:600;
}
.theme-gestor .btn-primary{ background:#1e88e5; color:#fff; border-color:#1e88e5; }
.theme-gestor .btn:hover{ filter:brightness(.98); }

/* ===== TABELAS — colunas fixas e ellipsis ===== */
.theme-gestor .candidates-table{
  width:100%; table-layout: fixed;
  border-collapse:separate; border-spacing:0; background:#fff;
  border:1px solid #e6e9ef; border-radius:14px; overflow:hidden;
  box-shadow:0 6px 24px rgba(16,24,40,.06);
}
.theme-gestor .candidates-table thead th{
  background:#f9fbff; color:#1c2430; font-size:13px; white-space:nowrap;
  text-align:left; padding:10px 12px; border-bottom:1px solid #e6e9ef;
}
.theme-gestor .candidates-table td{
  padding:10px 12px; border-bottom:1px solid #eef2f6; vertical-align:middle;
}
.theme-gestor .candidates-table tbody tr:hover{ background:#f9fbff; }

/* larguras por coluna (desktop) */
.theme-gestor .candidates-table th:nth-child(1),
.theme-gestor .candidates-table td:nth-child(1){ width:64px; }      /* ID */
.theme-gestor .candidates-table th:nth-child(3),
.theme-gestor .candidates-table td:nth-child(3){ width:180px; }     /* Empresa */
.theme-gestor .candidates-table th:nth-child(4),
.theme-gestor .candidates-table td:nth-child(4){ width:220px; }     /* Vagas */
.theme-gestor .candidates-table th:nth-child(5),
.theme-gestor .candidates-table td:nth-child(5){ width:120px; }     /* Cadastro */
.theme-gestor .candidates-table th:nth-child(6),
.theme-gestor .candidates-table td:nth-child(6){ width:160px; }     /* Status */
.theme-gestor .candidates-table th:nth-child(7),
.theme-gestor .candidates-table td:nth-child(7){ width:44px; text-align:center; } /* 👁 */
.theme-gestor .candidates-table th:nth-child(8),
.theme-gestor .candidates-table td:nth-child(8){ width:170px; }     /* Ações */

/* ellipsis nas colunas longas */
.theme-gestor .ellip{ display:block; max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* em telas menores, relaxa larguras para evitar overflow e permite scroll horizontal se precisar */
@media (max-width: 1100px){
  .theme-gestor .candidates-table{ table-layout:auto; }
  .theme-gestor .card > .candidates-table{ display:block; overflow-x:auto; }
}

/* ===== BADGES ===== */
.theme-gestor .badge{ font-size:12px; padding:6px 10px; border-radius:999px; display:inline-block; }
.theme-gestor .badge--entrevista{ background:#e6f0ff; color:#1e5bd6; }
.theme-gestor .badge--teste{      background:#fff6e7; color:#a65a00; }
.theme-gestor .badge--docs{       background:#e9f8f1; color:#0f8f55; }
.theme-gestor .badge--reprovado{  background:#ffe9ea; color:#b3272f; }
.theme-gestor .badge--contratado{ background:#eafaf5; color:#127a5b; }

/* ===== CALENDÁRIO (outras telas) ===== */
.theme-gestor table.calendar{
  width:100%; border-collapse:separate; border-spacing:0; background:#fff;
  border:1px solid #e6e9ef; border-radius:14px; overflow:hidden;
  box-shadow:0 6px 24px rgba(16,24,40,.06);
}
.theme-gestor .calendar thead th{
  background:#f1f5ff !important; color:#1c2430; font-size:13px;
  text-align:left; padding:12px 14px; border-bottom:1px solid #e6e9ef;
}
.theme-gestor .calendar tbody td{
  height:110px; vertical-align:top; padding:8px 8px 12px;
  border-bottom:1px solid #eef2f6; background:#fff; position:relative;
}
.theme-gestor .calendar tbody tr:last-child td{ border-bottom:none; }
.theme-gestor .calendar td .day-number{ font-weight:700; color:#667085; margin-bottom:8px; display:block; }
.theme-gestor .calendar td.today{ background:#fffbea !important; }
.theme-gestor .calendar td.today .day-number{ color:#9a5b00; }
.theme-gestor .calendar .event{
  display:block; background:#e6f0ff; color:#1e5bd6;
  border:1px solid #cddcfb; border-radius:999px;
  padding:6px 10px; font-size:12px; margin:6px 0 0;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.theme-gestor .calendar .event:hover{ background:#dfeaff; }

/* ===== NEUTRALIZAÇÕES EXTRAS ===== */
.theme-gestor .calendar thead th,
.theme-gestor .calendar tbody td{ color:#1c2430 !important; }
.theme-gestor .calendar thead tr{ background:transparent !important; }

/* ===== RESPONSIVO ===== */
/* Mobile: sidebar como overlay; conteúdo/rodapé sempre full width */
@media (max-width: 768px){
  .theme-gestor .sidebar{
    position: fixed; left:0; top: var(--rw-topbar-h); bottom:0;
    transform: translateX(-100%); width: var(--rw-sidebar-w) !important; z-index:1200;
  }
  .theme-gestor.sb-open .sidebar{ transform: translateX(0); }

  .theme-gestor main, .theme-gestor .rw-container, .theme-gestor .rw-footer.footer{
    margin-left:0 !important; width:100% !important;
  }
}

/* === Alinhamento e estabilidade da tabela === */
.theme-gestor .candidates-table{ table-layout: fixed; }
.theme-gestor .candidates-table th,
.theme-gestor .candidates-table td{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* Centraliza colunas numéricas/ícones */
.theme-gestor .candidates-table th:nth-child(1),
.theme-gestor .candidates-table td:nth-child(1),
.theme-gestor .candidates-table th:nth-child(5),
.theme-gestor .candidates-table td:nth-child(5),
.theme-gestor .candidates-table th:nth-child(7),
.theme-gestor .candidates-table td:nth-child(7){
  text-align: center;
}

/* Bloco extra do status (link de docs) fica compacto */
.theme-gestor .status-extra{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:6px;
}
.theme-gestor .status-extra small{ color:#98a2b3; font-size:12px; }
.theme-gestor .btn.btn-outline{
  background:#fff; border:1px solid #e6e9ef; color:#1c2430;
  padding:.35rem .6rem; border-radius:10px;
}
