body {
  background-color: #f1f5f9;
  color: var(--text);
  line-height: 1.6;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

.page-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border);
  letter-spacing: -0.5px;
}

#dynamicContentContainer {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.hidden {
  display: none;
}

.dashboard-content-wrapper {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.dashboard-content-wrapper.active {
  display: block;
  opacity: 1;
}

.manager-tabs-container {
  margin-bottom: 30px;
}

.manager-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
  border-bottom: 2px solid var(--border);
}

.manager-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  top: 2px;
}

.manager-tab:hover {
  color: var(--primary);
  background-color: var(--surface-hover);
}

.manager-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background-color: transparent;
}

.manager-tab i {
  font-size: 1.1rem;
}

.manager-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.12);
  border-color: transparent;
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
  transform: scale(1.1);
}

.stat-card.pending .stat-icon {
  background: var(--warning-light);
  color: var(--warning-dark);
}

.stat-card.present .stat-icon {
  background: var(--success-light);
  color: var(--success-dark);
}

.stat-card.absent .stat-icon {
  background: var(--error-light);
  color: var(--error-dark);
}

.stat-card.overtime .stat-icon {
  background: var(--info-light);
  color: var(--info-dark);
}

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

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -1px;
}

.stat-label {
  font-size: 0.95rem;
  color: var(--text-light);
  font-weight: 600;
}

/* ========================================================== */
/* --- TABELA DE AJUSTES/AFASTAMENTOS --- */
/* ========================================================== */

.status-badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}
.status-badge.status-pendente {
  background-color: var(--warning-light);
  color: var(--warning-dark);
}
.status-badge.status-aprovado {
  background-color: var(--success-light);
  color: var(--success-dark);
}
.status-badge.status-recusado {
  background-color: var(--error-light);
  color: var(--error-dark);
}
.status-badge.status-aguardando,
.status-badge.status-esclarecimento_enviado {
  background-color: var(--info-light);
  color: var(--info-dark);
}

/* ========================================================== */
/* ✅ ESTILOS GERAIS PARA MODAIS (RESOLUÇÃO DE VISIBILIDADE) */
/* ========================================================== */

.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.modal.show {
  display: block;
  opacity: 1;
  visibility: visible;
}

.modal-content,
.modal-content-rh {
  background-color: var(--surface);
  margin: 10% auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  width: 90%;
  max-width: 600px;
  position: relative;
  transform: translateY(-50px);
  transition: transform 0.3s ease-out;
}

.modal.show .modal-content,
.modal.show .modal-content-rh {
  transform: translateY(0);
}

.modal-content.small {
  max-width: 450px;
}

/* Estilo do Cabeçalho da Modal (Novo Aviso/Confirmação) */
.modal-header-aviso {
  background-color: #333; /* Fundo escuro */
  padding: 15px 20px;
  margin: -20px -20px 15px -20px;
  border-radius: 12px 12px 0 0;
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3,
.modal-header-aviso h4 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white); /* Título branco */
}

/* Botão Fechar (X) */
.close-modal,
.close-button-rh {
  color: var(--white);
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  border: none;
  background: none;
  padding: 0;
  transition: color 0.2s;
}
.close-modal:hover,
.close-button-rh:hover {
  color: var(--error);
}

/* Rodapé */
.modal-footer,
.modal-footer-aviso {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* Botões: Ajusta o tamanho do botão cancelar/secundário */
.btn {
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.btn-secondary {
  background-color: var(--surface-hover);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background-color: var(--border);
  color: var(--text);
  border-color: var(--secondary);
  transform: none;
  box-shadow: none;
}

/* ========================================================== */
/* ✅ REDESIGN COMPLETO DO CHAT RÁPIDO RH */
/* ========================================================== */

/* --- Estrutura e Dimensões do Modal Chat --- */

#chatMasterModal .modal-content,
#chatMasterModal .modal-content-rh {
  max-width: 420px;
  width: 95%;
  height: 90vh;
  margin: 5vh auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* --- Container Principal --- */

.chat-master-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
}

/* --- Header do Chat --- */
.chat-master-header {
  display: flex;
  flex-direction: column;
  padding: 15px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-hover);
  position: relative;
  z-index: 10;
}

.chat-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.chat-context-link {
  font-size: 0.85em;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  margin-top: 5px;
  transition: color 0.2s;
}

/* --- Área de Mensagens --- */
.chat-master-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 15px;
  background-color: #f7f7f7;
}

.chat-placeholder {
  text-align: center;
  color: var(--text-light);
  font-size: 0.9em;
}

/* --- Bolhas e Mensagens --- */
.chat-message {
  display: flex;
  margin-bottom: 15px;
  max-width: 90%;
  align-items: flex-end;
}

.chat-message.is-me {
  margin-left: auto;
  justify-content: flex-end;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--secondary);
  color: white;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-message-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  line-height: 1.4;
  font-size: 0.95rem;
  max-width: 100%;
  word-wrap: break-word;
}

.chat-message.is-me .chat-message-bubble {
  background-color: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.is-other .chat-message-bubble {
  background-color: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.chat-message-meta {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-light);
  display: flex;
  gap: 10px;
}
.chat-message.is-me .chat-message-meta {
  justify-content: flex-end;
}
.chat-message.is-me .chat-message-meta .sender {
  color: var(--primary-dark);
}

.chat-typing-indicator {
  height: 1.5em;
  font-size: 0.8em;
  color: var(--info-dark);
  padding: 5px 15px 0;
  flex-shrink: 0;
}

/* --- Área de Input e Botões --- */
.chat-master-input-area {
  display: flex;
  align-items: flex-end;
  padding: 10px 15px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

.chat-input-textarea {
  flex-grow: 1;
  max-height: 100px;
  resize: none;
  padding: 10px;
  border-radius: 20px;
  border-color: var(--border);
  margin: 0 8px;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.chat-emoji-btn,
.chat-send-btn {
  padding: 8px;
  margin-bottom: 2px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.chat-emoji-btn {
  font-size: 1.2rem;
  background: none;
  color: var(--secondary);
}
.chat-emoji-btn:hover {
  color: var(--primary);
  background: var(--surface-hover);
}

.chat-send-btn {
  font-size: 1rem;
  background-color: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}
.chat-send-btn:hover {
  background-color: var(--primary-dark);
}
