/* ── Variáveis de cores ────────────────────────────────────────── */
:root {
  --verde-pm: #1a6b3a;
  --verde-escuro: #134f2c;
  --verde-claro: #2d9a57;
  --verde-bg: #f0f9f4;
  --azul-destaque: #0ea5e9;
  --texto: #1e293b;
  --texto-suave: #64748b;
  --borda: #e2e8f0;
  --branco: #ffffff;
  --sombra: 0 4px 24px rgba(0,0,0,0.08);
  --radius: 14px;
}

/* ── Reset e base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--texto);
  background: var(--verde-bg);
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ══════════════════════════════════════════════════════════════ */
/*  PÁGINA DE LOGIN                                               */
/* ══════════════════════════════════════════════════════════════ */
.login-page {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  background: var(--verde-bg);
}

.login-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Banner lateral */
.login-banner {
  flex: 1;
  background: linear-gradient(160deg, var(--verde-pm) 0%, var(--verde-escuro) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.login-banner::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 300px; height: 300px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.login-banner::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 240px; height: 240px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.banner-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
}

.brasao {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.banner-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
}

.banner-subtitle {
  font-size: 1.4rem;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 8px;
}

.banner-desc {
  font-size: 1rem;
  opacity: 0.75;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
}

.banner-divider {
  width: 48px;
  height: 3px;
  background: rgba(255,255,255,0.4);
  border-radius: 2px;
  margin: 24px auto;
}

.banner-info {
  font-size: 0.95rem;
  opacity: 0.8;
  line-height: 1.7;
}

/* Área do formulário */
.login-form-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: var(--verde-bg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--branco);
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  padding: 40px 36px;
}

.login-card-header {
  margin-bottom: 28px;
}

.login-card-header h3 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--verde-pm);
  margin-bottom: 8px;
}

.login-card-header p {
  font-size: 0.9rem;
  color: var(--texto-suave);
  line-height: 1.5;
}

/* Alerta de erro */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert-icon { font-size: 1.1rem; flex-shrink: 0; }

/* Formulário */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--texto);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--texto);
  background: var(--branco);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus {
  border-color: var(--verde-pm);
  box-shadow: 0 0 0 3px rgba(26, 107, 58, 0.12);
}

.input-password {
  position: relative;
}

.input-password input {
  padding-right: 48px;
}

.toggle-senha {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  display: flex;
  align-items: center;
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--verde-claro), var(--verde-pm));
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  margin-top: 8px;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26, 107, 58, 0.35);
}

.btn-login:active { transform: translateY(0); }

.login-help {
  margin-top: 20px;
  font-size: 0.8rem;
  color: var(--texto-suave);
  text-align: center;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════ */
/*  DASHBOARD                                                      */
/* ══════════════════════════════════════════════════════════════ */
.dashboard-page {
  background: var(--verde-bg);
}

/* Navbar */
.navbar {
  background: linear-gradient(135deg, var(--verde-pm), var(--verde-escuro));
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-icon { font-size: 1.5rem; }

.navbar-title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.navbar-sub {
  display: block;
  font-size: 0.72rem;
  opacity: 0.75;
  letter-spacing: 0.5px;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-cpf {
  font-size: 0.72rem;
  opacity: 0.75;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-logout:hover { background: rgba(255,255,255,0.25); }

/* Conteúdo principal */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Card de boas-vindas */
.welcome-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  border-left: 5px solid var(--verde-pm);
}

.welcome-text h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--verde-pm);
  margin-bottom: 6px;
}

.welcome-text p {
  font-size: 0.9rem;
  color: var(--texto-suave);
}

.welcome-stats {
  display: flex;
  gap: 28px;
  flex-shrink: 0;
}

.stat {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--verde-pm);
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--texto-suave);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* Seção por ano */
.ano-section {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  margin-bottom: 20px;
  overflow: hidden;
}

.ano-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--borda);
  transition: background 0.15s;
}

.ano-header:hover { background: var(--verde-bg); }

.ano-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--verde-pm);
}

.ano-count {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--texto-suave);
  background: var(--verde-bg);
  padding: 3px 10px;
  border-radius: 20px;
}

.ano-chevron {
  font-size: 0.8rem;
  color: var(--texto-suave);
  transition: transform 0.2s;
}

/* Grid de contracheques */
.contracheques-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 20px 24px;
  transition: max-height 0.3s ease;
}

.contracheques-grid.collapsed {
  display: none;
}

/* Card individual */
.card-contracheque {
  background: white;
  border: 1.5px solid var(--borda);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.card-contracheque:hover {
  border-color: var(--verde-claro);
  box-shadow: 0 4px 16px rgba(26,107,58,0.12);
  transform: translateY(-2px);
}

.card-cc-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-cc-icone {
  font-size: 2rem;
  flex-shrink: 0;
}

.card-cc-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-cc-periodo {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--texto);
}

.card-cc-label {
  font-size: 0.72rem;
  color: var(--texto-suave);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.card-cc-actions {
  display: flex;
  gap: 8px;
}

.btn-card {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 8px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.1s;
  cursor: pointer;
}

.btn-card:hover { opacity: 0.88; transform: scale(1.02); }

.btn-ver {
  background: #e0f2f1;
  color: var(--verde-escuro);
}

.btn-baixar {
  background: linear-gradient(135deg, var(--verde-claro), var(--verde-pm));
  color: white;
}

/* Estado vazio */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--sombra);
}

.empty-icon { font-size: 4rem; margin-bottom: 16px; }

.empty-state h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--texto);
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--texto-suave);
  line-height: 1.6;
}

/* Modal PDF */
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
}

.pdf-modal-container {
  position: relative;
  z-index: 1;
  background: white;
  border-radius: var(--radius);
  width: 90vw;
  max-width: 900px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
}

.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--borda);
  font-weight: 600;
  font-size: 1rem;
  color: var(--verde-pm);
}

.btn-fechar {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--texto-suave);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.btn-fechar:hover { background: #f1f5f9; }

.pdf-frame {
  flex: 1;
  border: none;
  width: 100%;
}

/* Rodapé */
.footer {
  background: var(--verde-escuro);
  color: rgba(255,255,255,0.65);
  text-align: center;
  padding: 20px 24px;
  font-size: 0.78rem;
  line-height: 1.8;
  margin-top: 48px;
}

/* ══════════════════════════════════════════════════════════════ */
/*  PAINEL ADMINISTRADOR                                           */
/* ══════════════════════════════════════════════════════════════ */

/* Navbar admin (roxo escuro) */
.admin-navbar {
  background: linear-gradient(135deg, #4c1d95, #2e1065) !important;
}

/* Banner admin (roxo) */
.admin-banner {
  background: linear-gradient(160deg, #6d28d9 0%, #4c1d95 100%) !important;
}

.btn-admin {
  background: linear-gradient(135deg, #7c3aed, #4c1d95) !important;
}

.admin-badge {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
}

/* Cards de estatísticas */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-left: 5px solid transparent;
}

.stat-blue   { border-left-color: #0ea5e9; }
.stat-green  { border-left-color: var(--verde-pm); }
.stat-purple { border-left-color: #7c3aed; }
.stat-orange { border-left-color: #f59e0b; }

.stat-card-icon { font-size: 2.2rem; flex-shrink: 0; }

.stat-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-card-num {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--texto);
  line-height: 1;
}

.stat-card-label {
  font-size: 0.75rem;
  color: var(--texto-suave);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* Seções do admin */
.admin-section {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  padding: 24px;
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--texto);
  margin-bottom: 16px;
}

.section-header .section-title { margin-bottom: 0; }

.section-count {
  font-size: 0.8rem;
  color: var(--texto-suave);
  background: var(--verde-bg);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 500;
}

/* Por ano */
.por-ano-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.por-ano-item {
  background: var(--verde-bg);
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.por-ano-ano {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--verde-pm);
}

.por-ano-qtd {
  font-size: 0.78rem;
  color: var(--texto-suave);
  font-weight: 500;
}

/* Busca */
.busca-form {
  margin-bottom: 20px;
}

.busca-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--verde-bg);
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  padding: 10px 16px;
  transition: border-color 0.2s;
}

.busca-wrapper:focus-within {
  border-color: var(--verde-pm);
  background: white;
}

.busca-icon { font-size: 1rem; color: var(--texto-suave); }

.busca-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--texto);
  outline: none;
}

.busca-btn {
  background: var(--verde-pm);
  color: white;
  border: none;
  border-radius: 7px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}

.busca-btn:hover { opacity: 0.85; }

.busca-limpar {
  font-size: 0.82rem;
  color: #b91c1c;
  font-weight: 500;
  white-space: nowrap;
}

/* Tabela */
.table-wrapper {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--borda);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table thead tr {
  background: var(--verde-bg);
}

.admin-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--texto-suave);
  border-bottom: 1.5px solid var(--borda);
  white-space: nowrap;
}

.admin-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--borda);
  vertical-align: middle;
}

.admin-table tbody tr:last-child td { border-bottom: none; }

.admin-table tbody tr:hover { background: #f8fafb; }

.td-num    { color: var(--texto-suave); font-size: 0.8rem; width: 40px; }
.td-nome   { font-weight: 600; }
.td-cpf    { font-family: monospace; font-size: 0.85rem; color: var(--texto-suave); }
.td-cc     { text-align: center; }
.td-ultimo { font-size: 0.82rem; color: var(--texto-suave); }
.td-acoes  { white-space: nowrap; }
.td-empty  { text-align: center; padding: 40px; color: var(--texto-suave); }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-green { background: #d1fae5; color: #065f46; }
.badge-gray  { background: #f1f5f9; color: #94a3b8; }

/* Botões mini da tabela */
.btn-mini {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-ver-mini {
  background: #e0f2f1;
  color: var(--verde-escuro);
}

.btn-ver-mini:hover { opacity: 0.8; }

.btn-mini-disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: default;
  font-weight: 400;
}

/* Paginação */
.paginacao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--borda);
}

.pag-btn {
  padding: 8px 18px;
  background: var(--verde-pm);
  color: white;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity 0.15s;
}

.pag-btn:hover { opacity: 0.85; }

.pag-info {
  font-size: 0.85rem;
  color: var(--texto-suave);
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════ */
/*  NOVOS COMPONENTES: UPLOAD, EXCLUSÃO, ALTERAR SENHA            */
/* ══════════════════════════════════════════════════════════════ */

/* Flash messages */
.flash-msg {
  padding: 14px 20px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  font-weight: 500;
}
.flash-sucesso { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.flash-erro    { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Barra de ações rápidas */
.acoes-rapidas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.btn-acao {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-acao:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-inserir {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
}
.btn-senha {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

/* Botões mini da tabela */
.btn-upload-mini {
  background: #e0f2fe;
  color: #0369a1;
}
.btn-senha-mini {
  background: #fef3c7;
  color: #92400e;
  border: none;
  font-family: inherit;
  cursor: pointer;
}
.btn-senha-mini:hover,
.btn-upload-mini:hover { opacity: 0.8; }

/* Botão excluir no card de contracheque */
.btn-excluir {
  width: 100%;
  padding: 7px;
  background: none;
  border: 1.5px solid #fca5a5;
  border-radius: 7px;
  color: #b91c1c;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-excluir:hover { background: #fee2e2; }

/* Page title bar */
.page-title-bar {
  margin-bottom: 24px;
}
.page-title-bar h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--verde-pm);
  margin-bottom: 6px;
}
.page-title-bar p {
  font-size: 0.9rem;
  color: var(--texto-suave);
}

/* Alert box (formulário) */
.alert-box {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.88rem;
}
.alert-erro {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.alert-box ul { margin: 8px 0 0 16px; }
.alert-box li { margin-bottom: 4px; }

/* Card de formulário */
.form-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  overflow: hidden;
}

.form-section {
  padding: 24px 28px;
  border-bottom: 1px solid var(--borda);
}
.form-section:last-of-type { border-bottom: none; }

.form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--verde-pm);
  margin-bottom: 16px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--borda);
  border-radius: 9px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--texto);
  background: white;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  border-color: var(--verde-pm);
  box-shadow: 0 0 0 3px rgba(26,107,58,0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.obrigatorio { color: #ef4444; }

/* Servidor selecionado */
.servidor-selecionado {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  border-radius: 9px;
  color: #065f46;
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 8px;
}
.servidor-selecionado.hidden { display: none; }
.servidor-icone { font-size: 1.2rem; }

/* Autocomplete */
.autocomplete-wrapper { position: relative; }

.autocomplete-lista {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: white;
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100;
  max-height: 260px;
  overflow-y: auto;
  display: none;
}
.autocomplete-lista.visible { display: block; }

.ac-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--borda);
  transition: background 0.12s;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: var(--verde-bg); }
.ac-vazio { color: var(--texto-suave); font-size: 0.85rem; cursor: default; }
.ac-nome { font-size: 0.88rem; font-weight: 600; }
.ac-cpf  { font-size: 0.78rem; color: var(--texto-suave); font-family: monospace; }

/* Área de upload */
.upload-area {
  border: 2px dashed var(--borda);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  background: var(--verde-bg);
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--verde-pm);
  background: #e6f4ec;
}
.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-icon { font-size: 2.5rem; display: block; margin-bottom: 8px; }
.upload-placeholder p { font-size: 0.92rem; font-weight: 600; color: var(--texto); margin-bottom: 4px; }
.upload-hint { font-size: 0.78rem; color: var(--texto-suave); }

.upload-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--verde-pm);
}
.upload-preview.hidden { display: none; }
.upload-placeholder.hidden { display: none; }

.btn-remover-arquivo {
  background: #fee2e2;
  color: #b91c1c;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-remover-arquivo:hover { background: #fca5a5; }

/* Ações do formulário */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 28px;
  background: var(--verde-bg);
  border-top: 1px solid var(--borda);
}

.btn-cancelar {
  padding: 10px 20px;
  background: white;
  border: 1.5px solid var(--borda);
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--texto-suave);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-cancelar:hover { background: var(--verde-bg); }

.btn-submit {
  padding: 11px 24px;
  background: linear-gradient(135deg, var(--verde-claro), var(--verde-pm));
  color: white;
  border: none;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-submit:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-submit-sm { padding: 9px 18px; font-size: 0.88rem; }

/* Modais */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
}
.modal-perigo .modal-header { background: #fff1f2; border-bottom: 1px solid #fecdd3; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--borda);
  background: var(--verde-bg);
}
.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--verde-pm);
}
.modal-perigo .modal-header h3 { color: #b91c1c; }

.modal-fechar {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--texto-suave);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.modal-fechar:hover { background: var(--borda); }

.modal-body { padding: 22px; }

.modal-desc {
  font-size: 0.88rem;
  color: var(--texto);
  margin-bottom: 18px;
  line-height: 1.6;
  padding: 12px;
  background: var(--verde-bg);
  border-radius: 8px;
}

.aviso-perigo {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.btn-excluir-confirm {
  padding: 10px 20px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: white;
  border: none;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-excluir-confirm:hover   { opacity: 0.88; }
.btn-excluir-confirm:disabled{ opacity: 0.6; cursor: not-allowed; }

/* Erro inline de senha */
.senha-erro {
  background: #fee2e2;
  color: #991b1b;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  margin-top: -8px;
  margin-bottom: 4px;
}
.senha-erro.hidden { display: none; }

/* ══════════════════════════════════════════════════════════════ */
/*  UPLOAD EM LOTE                                                 */
/* ══════════════════════════════════════════════════════════════ */

/* Botão lote (verde-azulado) */
.btn-lote {
  background: linear-gradient(135deg, #0891b2, #0e7490);
  color: white;
}

/* Card de info sobre padrão */
.lote-info-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: #1e40af;
  line-height: 1.6;
}
.lote-info-icone { font-size: 1.4rem; flex-shrink: 0; }
.lote-info-card code {
  background: #dbeafe;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #1d4ed8;
}
.lote-info-ex { font-size: 0.78rem; color: #3b82f6; }
.lote-info-ex em { font-style: normal; }

/* Zona de drop lote */
.lote-drop-zone {
  position: relative;
  border: 2.5px dashed #cbd5e1;
  border-radius: 14px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #f8fafc;
}
.lote-drop-zone:hover,
.lote-drop-zone.lote-drag-over {
  border-color: var(--verde-pm);
  background: #f0fdf4;
}
.lote-drop-zone.lote-drop-selecionado {
  border-color: var(--verde-claro);
  background: #f0fdf4;
  border-style: solid;
}

.lote-drop-icone {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 12px;
}
.lote-drop-titulo {
  font-size: 1rem;
  font-weight: 600;
  color: var(--texto);
  margin-bottom: 6px;
}
.lote-drop-sub {
  font-size: 0.82rem;
  color: var(--texto-suave);
  margin-bottom: 16px;
}
.lote-drop-btn {
  display: inline-block;
  padding: 9px 22px;
  background: var(--verde-pm);
  color: white;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity 0.15s;
}
.lote-drop-zone:hover .lote-drop-btn { opacity: 0.85; }

/* Chips de resumo */
.lote-resumo-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.lote-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
}
.lote-chip-total  { background: #e2e8f0; color: #475569; }
.lote-chip-ok     { background: #d1fae5; color: #065f46; }
.lote-chip-erro   { background: #fef3c7; color: #92400e; }

/* Tabela de prévia */
.lote-preview-table td { vertical-align: middle; }

.lote-cpf-tag {
  font-family: monospace;
  font-size: 0.8rem;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  color: #475569;
}
.lote-status-ok  { color: #16a34a; font-size: 0.82rem; font-weight: 600; }
.lote-status-err { color: #b45309; font-size: 0.82rem; font-weight: 600; }

/* Aviso prévia */
.lote-aviso-preview {
  font-size: 0.78rem;
  color: var(--texto-suave);
  margin-top: 10px;
  text-align: center;
}

/* Barra de progresso */
.progress-bar-wrapper {
  background: #e2e8f0;
  border-radius: 8px;
  height: 14px;
  overflow: hidden;
  margin: 12px 0 8px;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--verde-claro), var(--verde-pm));
  border-radius: 8px;
  transition: width 0.3s ease;
}
.progress-label {
  font-size: 0.82rem;
  color: var(--texto-suave);
  text-align: center;
}

/* ── Responsivo ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .login-wrapper { flex-direction: column; }

  .login-banner {
    padding: 40px 24px;
    min-height: 220px;
  }

  .banner-title { font-size: 1.4rem; }
  .banner-subtitle { font-size: 1.1rem; }

  .login-form-area { padding: 32px 20px; }
  .login-card { padding: 28px 20px; }

  .navbar-inner { padding: 0 16px; height: 58px; }
  .user-info { display: none; }

  .main-content { padding: 20px 16px; }

  .welcome-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .contracheques-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .ano-header { padding: 14px 16px; }
}
