* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #f4f6f9;
  color: #333333;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

/* BARRA LATERAL FIXA (AZUL MARINHO ÁPICE) */
.sidebar {
  width: 260px;
  background-color: #0b132b; 
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 0;
  position: fixed;
  height: 100vh;
}

.brand {
  padding: 0 24px 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand h2 {
  font-size: 1.4rem;
  letter-spacing: 1px;
}

.brand span {
  font-size: 0.8rem;
  color: #ff007f; /* Fúcsia da Ápice Dev */
  font-weight: bold;
}

.menu {
  display: flex;
  flex-direction: column;
  margin-top: 20px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: none;
  border: none;
  color: #a0aec0;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.nav-item i {
  font-size: 1.1rem;
  width: 20px;
}

.nav-item:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.05);
}

/* ESTADO ATIVO */
.nav-item.active {
  color: #ffffff;
  background-color: rgba(255, 0, 127, 0.15); 
  border-left: 4px solid #ff007f;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile i {
  font-size: 1.8rem;
  color: #ff6b00;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.user-role {
  font-size: 0.75rem;
  color: #a0aec0;
}

/* ÁREA DE CONTEÚDO */
.content-area {
  margin-left: 260px;
  flex-grow: 1;
  padding: 32px;
}

.top-header h1 {
  font-size: 1.6rem;
  color: #0b132b;
  margin-bottom: 24px;
}

/* CLASSE UTILITÁRIA */
.hidden {
  display: none !important;
}

/* TELA DE LOGIN */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #0b132b;
  padding: 20px;
}

.login-card {
  background: #ffffff;
  padding: 40px;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-header h2 {
  color: #0b132b;
  font-size: 1.8rem;
  letter-spacing: 1px;
}

.login-header span {
  color: #ff007f;
  font-size: 0.85rem;
  font-weight: 600;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4a5568;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: #ff007f;
}

#btn-login {
  width: 100%;
  padding: 12px;
  background-color: #ff007f;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

#btn-login:hover {
  background-color: #e0006f;
}

.error-message {
  background-color: #fff5f5;
  color: #e53e3e;
  border: 1px solid #feb2b2;
  padding: 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  text-align: center;
}

/* SEÇÕES E CARDS DO DASHBOARD */
.dashboard-section {
  background-color: #ffffff;
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 1.2rem;
  color: #0b132b;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header h2 i {
  color: #ff007f;
}

.btn-secondary {
  background: #edf2f7;
  color: #4a5568;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

/* CARDS DE AVISO */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.aviso-card {
  border: 1px solid #e2e8f0;
  border-left: 5px solid #ff6b00;
  border-radius: 8px;
  padding: 16px;
  background-color: #fffaf0;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.aviso-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.aviso-card.ausencia {
  border-left-color: #e53e3e;
  background-color: #fff5f5;
}

.aviso-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.aviso-funcionario {
  font-weight: 700;
  color: #0b132b;
  font-size: 1rem;
}

.aviso-badge-data {
  background-color: #ffffff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #4a5568;
  border: 1px solid #cbd5e0;
}

.aviso-descricao {
  font-size: 0.85rem;
  color: #4a5568;
  line-height: 1.4;
  margin-bottom: 12px;
}

.aviso-action-hint {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ff007f;
  display: flex;
  align-items: center;
  gap: 6px;
}

.state-card {
  text-align: center;
  padding: 40px 20px;
  color: #718096;
}

.state-card i {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

/* MODAIS GERAIS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 19, 43, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-card {
  background: #ffffff;
  padding: 32px;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-card h3 {
  color: #0b132b;
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: #ff007f;
  font-weight: 600;
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.modal-card select, .modal-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.btn-cancel {
  background: #e2e8f0;
  color: #4a5568;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: #ff007f;
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary:hover {
  background: #e0006f;
}

/* GESTÃO DE PESSOAS - ESTILOS WEB */
.modal-lg {
  max-width: 650px;
}

.search-bar-container {
  position: relative;
  margin-bottom: 20px;
}

.search-bar-container .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #a0aec0;
}

.search-bar-container input {
  width: 100%;
  padding: 10px 12px 10px 40px;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar-container input:focus {
  border-color: #ff007f;
}

/* CARDS DE FUNCIONÁRIOS */
.func-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
  overflow: hidden;
}

.func-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: #edf2f7;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #718096;
  border: 2px solid #e2e8f0;
  flex-shrink: 0;
}

.func-info {
  flex: 1;
  min-width: 0;
}

.func-info h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #0b132b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.func-info p {
  margin: 2px 0;
  font-size: 0.8rem;
  color: #718096;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.func-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-icon {
  background: #edf2f7;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  color: #4a5568;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.btn-icon:hover {
  background: #e2e8f0;
  color: #0b132b;
}

.btn-icon.danger:hover {
  background: #fed7d7;
  color: #e53e3e;
}

/* UPLOAD E PREVIEW DA FOTO */
.foto-upload-container {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #f7fafc;
  padding: 16px;
  border-radius: 8px;
  border: 1px dashed #cbd5e0;
  margin-bottom: 20px;
}

.foto-preview-box {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid #cbd5e0;
}

.foto-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.foto-preview-box i {
  font-size: 2rem;
  color: #a0aec0;
}

.foto-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.badge-status-foto {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.badge-status-foto.neutral { background: #edf2f7; color: #718096; }
.badge-status-foto.success { background: #c6f6d5; color: #22543d; }
.badge-status-foto.error { background: #fed7d7; color: #742a2a; }

.checkbox-group {
  display: flex;
  align-items: center;
  height: 100%;
  padding-top: 24px;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #2d3748;
}

/* JORNADA DE TRABALHO */
.jornada-card-intervalo {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

.jornada-dias-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
}

.jornada-dia-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #edf2f7;
}

.jornada-dia-row:last-child {
  border-bottom: none;
}

.jornada-dia-info {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 160px;
}

.jornada-dia-horarios {
  display: flex;
  align-items: center;
  gap: 12px;
}

.jornada-dia-horarios input[type="time"] {
  padding: 6px 10px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
}

.jornada-dia-horarios input:disabled {
  background-color: #edf2f7;
  opacity: 0.5;
  cursor: not-allowed;
}

/* GESTÃO DE FÉRIAS */
.config-antecedencia-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #4a5568;
}

.ferias-secao {
  margin-bottom: 24px;
}

.ferias-titulo {
  font-size: 1.1rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ferias-titulo.critico { color: #e74c3c; }
.ferias-titulo.agendado { color: #1a365d; }
.ferias-titulo.regular { color: #2ecc71; }

.badge-ferias {
  padding: 6px 12px;
  border-radius: 18px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
  margin-top: 6px;
}

.badge-ferias.critico {
  background-color: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.badge-ferias.agendado {
  background-color: #1a365d;
  color: #ffffff;
}

.badge-ferias.regular {
  background-color: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

/* SUBMENUS / ABAS SUPERIORES DE FUNCIONÁRIOS */
.sub-tab-bar {
  display: flex;
  gap: 12px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 24px;
  padding-bottom: 0;
}

.sub-tab-btn {
  background: transparent;
  border: none;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #718096;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -2px;
}

.sub-tab-btn:hover {
  color: #0b132b;
}

.sub-tab-btn.active {
  color: #0b132b;
  border-bottom-color: #ff007f;
}

/* CONTAINER E ABAS DE RELATÓRIOS */
.reports-wrapper {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tabs-header {
  display: flex;
  gap: 10px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #718096;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.tab-btn.active {
  color: #0b132b;
  border-bottom-color: #ff007f;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* FILTROS DE RELATÓRIO */
.filter-card {
  background: #f8fafc;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  box-sizing: border-box;
  outline: none;
}

.form-control:focus {
  border-color: #ff007f;
}

.filter-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* BOTÕES GLOBAIS (PADRONIZADOS) */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  transition: background-color 0.2s, opacity 0.2s;
}

.btn-primary { background: #ff007f; color: #ffffff; }
.btn-primary:hover { background: #e0006f; }

.btn-secondary { background: #edf2f7; color: #4a5568; }
.btn-secondary:hover { background: #e2e8f0; }

.btn-dark { background: #0b132b; color: #ffffff; }
.btn-dark:hover { background: #1a233d; }

.btn-success { background: #28a745; color: #ffffff; }
.btn-success:hover { background: #218838; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* CARDS TOTALIZADORES DO RESUMO */
.summary-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.summary-card {
  background: #fff;
  border-left: 4px solid #0b132b;
  padding: 15px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}

.summary-card.warning { border-left-color: #e67e22; }
.summary-card.primary { border-left-color: #ff007f; }
.summary-card.danger { border-left-color: #e53e3e; }

.summary-title { font-size: 12px; color: #718096; text-transform: uppercase; font-weight: bold; }
.summary-value { font-size: 20px; font-weight: bold; color: #0b132b; margin-top: 5px; }

/* TABELA CUSTOMIZADA */
.table-responsive { overflow-x: auto; }
.custom-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.custom-table th { background: #0b132b; color: #fff; text-align: left; padding: 12px; }
.custom-table td { padding: 10px 12px; border-bottom: 1px solid #edf2f7; }
.custom-table tr:nth-child(even) { background: #fcfcfc; }
.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ESTRUTURA UNIVERSAL DE MODAIS */
.modal { 
  display: none; /* Mantém oculto por padrão no carregamento */
  position: fixed; 
  z-index: 1000; 
  left: 0; 
  top: 0; 
  width: 100vw; 
  height: 100vh; 
  background: rgba(11, 19, 43, 0.6); 
  justify-content: center;
  align-items: center;
}

.modal-content { 
  background: #ffffff; 
  padding: 28px; 
  width: 90%; 
  max-width: 500px; 
  border-radius: 10px; 
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); 
  position: relative; 
}

.close-modal { 
  position: absolute; 
  right: 15px; 
  top: 10px; 
  font-size: 24px; 
  cursor: pointer; 
  color: #aaa; 
}

.close-modal:hover { 
  color: #000; 
}

#img-auditoria-preview { 
  max-width: 100%; 
  height: auto; 
  border-radius: 6px; 
  margin-top: 10px; 
}

/* Sub-abas de Configurações */
.config-tabs-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.btn-config-tab {
  background: transparent;
  border: none;
  color: #a0aec0;
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.btn-config-tab:hover {
  color: #ffffff;
  background: rgba(255, 0, 127, 0.1);
}

.btn-config-tab.active {
  background: #ff007f;
  color: #ffffff;
}

/* Card do Formulário de Feriados */
.card-form-feriado, .card-tabela-feriados {
  background: #141e3d;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.grid-form-feriado {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr auto;
  gap: 16px;
  align-items: flex-end;
}

.btn-align {
  display: flex;
  align-items: flex-end;
}

.btn-deletar-feriado {
  background: rgba(229, 62, 62, 0.2);
  color: #e53e3e;
  border: 1px solid #e53e3e;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-deletar-feriado:hover {
  background: #e53e3e;
  color: #ffffff;
}

/* Toggle Switch Estilizado */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 34px;
}

.slider-toggle:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider-toggle {
  background-color: #0284c7;
}

input:checked + .slider-toggle:before {
  transform: translateX(24px);
}

.disabled-layer {
  opacity: 0.4;
  pointer-events: none;
}

/* ESTILOS DA ABA ADIÇÕES DE PONTO */
.lista-registros {
  list-style: none;
  padding: 0;
  margin-top: 15px;
}

.registro-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #2d3748;
}

.registro-item strong {
  color: #0b132b;
}

/* Container de rolagem interna para a modal */
.modal-body-scroll {
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 6px;
  margin-bottom: 10px;
}

/* Card individual de cada trecho/tarefa */
.card-bloco-tarefa {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-left: 4px solid #c2185b;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  position: relative;
}

/* Botão para excluir um bloco intermediário */
.btn-remover-bloco {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: #dc3545;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

@media (max-width: 768px) {
  .grid-form-feriado {
    grid-template-columns: 1fr;
  }
}