/* ═══════════════════════════════════════════════
   Controle de Ocorrências RH/DP — Estilos globais
═══════════════════════════════════════════════ */

/* Layout */
* { box-sizing: border-box; }
body { font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; }

/* ── Botões ─────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  background-color: #EA232F; color: #fff;
  padding: 0.5rem 1.25rem; border-radius: 0.5rem;
  font-weight: 600; font-size: 0.875rem; cursor: pointer;
  border: none; transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn-primary:hover { background-color: #c41c27; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  background-color: #f3f4f6; color: #374151;
  padding: 0.5rem 1.25rem; border-radius: 0.5rem;
  font-weight: 500; font-size: 0.875rem; cursor: pointer;
  border: 1px solid #e5e7eb; transition: background 0.15s;
  white-space: nowrap;
}
.btn-secondary:hover { background-color: #e5e7eb; }

.btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  background-color: #fff; color: #374151;
  padding: 0.5rem 1rem; border-radius: 0.5rem;
  font-weight: 500; font-size: 0.875rem; cursor: pointer;
  border: 1px solid #d1d5db; transition: all 0.15s;
  white-space: nowrap;
}
.btn-outline:hover { border-color: #EA232F; color: #EA232F; background: #fef2f2; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 0.5rem;
  cursor: pointer; border: none; transition: all 0.15s;
}
.btn-icon-blue { background: #eff6ff; color: #2563eb; }
.btn-icon-blue:hover { background: #dbeafe; }
.btn-icon-red { background: #fef2f2; color: #dc2626; }
.btn-icon-red:hover { background: #fee2e2; }
.btn-icon-green { background: #f0fdf4; color: #16a34a; }
.btn-icon-green:hover { background: #dcfce7; }
.btn-icon-gray { background: #f3f4f6; color: #4b5563; }
.btn-icon-gray:hover { background: #e5e7eb; }

/* ── Inputs ─────────────────────────────────────── */
.input-field {
  width: 100%; border: 1px solid #e5e7eb; border-radius: 0.5rem;
  padding: 0.55rem 0.75rem; font-size: 0.875rem; color: #1f2937;
  background: #fff; transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.input-field:focus { border-color: #EA232F; box-shadow: 0 0 0 3px rgba(234,35,47,0.1); }
.input-sm {
  border: 1px solid #e5e7eb; border-radius: 0.5rem;
  padding: 0.45rem 0.65rem; font-size: 0.8rem; color: #1f2937;
  background: #fff; outline: none; transition: border-color 0.15s;
}
.input-sm:focus { border-color: #EA232F; }
.label { display: block; font-size: 0.78rem; font-weight: 500; color: #6b7280; margin-bottom: 0.25rem; }

/* ── Navegação ──────────────────────────────────── */
.nav-link {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%; padding: 0.55rem 0.75rem; border-radius: 0.5rem;
  font-size: 0.875rem; color: #4b5563; cursor: pointer;
  border: none; background: transparent; text-align: left;
  transition: all 0.15s;
}
.nav-link:hover { background: #fef2f2; color: #EA232F; }
.nav-link.active { background: #fef2f2; color: #EA232F; font-weight: 600; }

/* ── Tabela ─────────────────────────────────────── */
.th {
  padding: 0.65rem 1rem; text-align: left;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: #6b7280;
}
.td { padding: 0.75rem 1rem; }
tr:hover > .td { background-color: #fafafa; }

/* ── Cards dashboard ────────────────────────────── */
.stat-card {
  display: flex; gap: 1rem; align-items: center;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 0.75rem;
  padding: 1.1rem 1.25rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.stat-card:hover { border-color: #EA232F30; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.stat-icon {
  width: 2.75rem; height: 2.75rem; border-radius: 0.625rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex-shrink: 0;
}
.stat-label { font-size: 0.78rem; color: #6b7280; margin-bottom: 0.1rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }

/* ── Badges ─────────────────────────────────────── */
.badge-gravidade {
  display: inline-flex; align-items: center;
  padding: 0.3rem 0.75rem; border-radius: 9999px;
  font-size: 0.78rem; font-weight: 600;
}
.badge-status {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.65rem; border-radius: 9999px;
  font-size: 0.72rem; font-weight: 600;
}

/* Cores gravidade */
.g-baixa { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.g-media { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.g-alta { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }
.g-critica { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* Cores status */
.s-em_aberto { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.s-em_analise { background: #fefce8; color: #854d0e; border: 1px solid #fef08a; }
.s-em_processo { background: #fff7ed; color: #9a3412; border: 1px solid #fdba74; }
.s-aguardando_evidencias { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.s-advertencia_gerada { background: #fdf4ff; color: #86198f; border: 1px solid #f0abfc; }
.s-aguardando_assinatura { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.s-concluido { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.s-arquivado { background: #f9fafb; color: #4b5563; border: 1px solid #e5e7eb; }
.s-cancelado { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Seções ─────────────────────────────────────── */
.section-title {
  font-size: 0.875rem; font-weight: 700; color: #374151;
  padding-bottom: 0.5rem; margin-bottom: 0.75rem;
  border-bottom: 2px solid #fef2f2;
  display: flex; align-items: center;
}

/* ── Modais ─────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 1rem;
}
.modal-box {
  background: #fff; border-radius: 1rem;
  width: 100%; max-width: 42rem;
  max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  display: flex; gap: 0.75rem; justify-content: flex-end;
}
.modal-close {
  width: 2rem; height: 2rem; border-radius: 0.375rem;
  background: #f3f4f6; border: none; cursor: pointer; color: #6b7280;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { background: #e5e7eb; color: #111; }

/* ── Histórico timeline ─────────────────────────── */
.timeline-item {
  display: flex; gap: 0.75rem; position: relative;
}
.timeline-item::before {
  content: ''; position: absolute;
  left: 1rem; top: 2rem; bottom: -0.75rem;
  width: 2px; background: #e5e7eb;
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 2rem; height: 2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; flex-shrink: 0; z-index: 1;
}

/* ── Tabs relatório ─────────────────────────────── */
.tab-btn {
  padding: 0.5rem 1.25rem; border-radius: 0.5rem;
  font-size: 0.8rem; font-weight: 500; cursor: pointer;
  border: 1px solid #e5e7eb; background: #fff; color: #6b7280;
  white-space: nowrap; transition: all 0.15s;
}
.tab-btn.active { background: #EA232F; color: #fff; border-color: #EA232F; }
.tab-btn:hover:not(.active) { border-color: #EA232F; color: #EA232F; }

/* ── Responsividade sidebar ─────────────────────── */
@media (max-width: 1023px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
}

/* ── Impressão advertência ──────────────────────── */
@media print {
  body > *:not(#modal-advertencia) { display: none !important; }
  #modal-advertencia { position: static !important; }
  .modal-overlay { display: block !important; position: static !important; padding: 0 !important; background: none !important; }
  .modal-box { box-shadow: none !important; max-height: none !important; max-width: none !important; }
  .modal-header, .modal-footer { display: none !important; }
  .modal-body { padding: 0 !important; }
  #advertencia-preview { border: none !important; max-height: none !important; overflow: visible !important; }
}

/* ── Animações ──────────────────────────────────── */
.view { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── Loading spinner ────────────────────────────── */
.loading { display: inline-block; width: 1rem; height: 1rem; border: 2px solid #e5e7eb; border-top-color: #EA232F; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbar custom ───────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
