:root {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --accent: #007bff;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.header {
  background-color: var(--bg-secondary);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.card {
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.btn {
  background-color: var(--accent);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  margin: 0.25rem;
}

.btn-success {
  background-color: var(--success);
}

.btn-danger {
  background-color: var(--danger);
}

.btn-warning {
  background-color: var(--warning);
}

.btn:hover {
  opacity: 0.9;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem;
  background-color: var(--bg-primary);
  border: 1px solid var(--text-secondary);
  color: var(--text-primary);
  border-radius: 4px;
}

.employee-card {
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.employee-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.employee-name {
  font-size: 1.2rem;
  font-weight: bold;
}

.employee-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.employee-schedule {
  display: flex;
  gap: 1rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  margin-bottom: 1rem;
}

.schedule-time {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.schedule-icon {
  font-size: 1.1rem;
}

.employee-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.9em;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0;
}

.status-working {
  background: var(--success);
  color: white;
}

.status-off {
  background: var(--danger);
  color: white;
}

.status-leave {
  background: var(--warning);
  color: var(--bg-primary);
}

.work-schedule {
  color: var(--text-secondary);
  font-size: 0.9em;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.employee-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.employee-info {
  margin-bottom: 1rem;
}

.employee-name {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.employee-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.employee-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: var(--bg-secondary);
  margin: 15% auto;
  padding: 20px;
  width: 80%;
  max-width: 500px;
  border-radius: 8px;
}

.tab-container {
  margin-bottom: 2rem;
}

.tab-buttons {
  display: flex;
  margin-bottom: 1rem;
}

.tab-button {
  background: var(--bg-secondary);
  border: none;
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab-button.active {
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.report-header {
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  text-align: center;
}

.report-header h2 {
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  transition: transform 0.2s;
}

.summary-card:hover {
  transform: translateY(-2px);
}

.summary-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.summary-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.summary-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.report-section {
  margin-bottom: 2rem;
}

.report-section h3 {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bg-secondary);
}

.employee-performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.performance-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
}

.performance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.completion-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: bold;
  font-size: 0.9rem;
}

.performance-stats {
  margin-bottom: 1rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row:last-child {
  border-bottom: none;
}

.performance-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.tasks-analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.task-analysis-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
}

.task-analysis-card.fixed-task {
  border-left: 4px solid var(--accent);
}

.task-analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.fixed-badge {
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

.assigned-employees {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.employee-chip {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .report-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .employee-performance-grid,
  .tasks-analysis-grid {
    grid-template-columns: 1fr;
  }
}

th,
td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--bg-primary);
}

th {
  background-color: var(--bg-primary);
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 10px;
  font-weight: bold;
}

.calendar-header div {
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: 4px;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.calendar-day {
  cursor: pointer;
}

.calendar-day {
  background: var(--bg-secondary);
  padding: 10px;
  text-align: center;
  border-radius: 4px;
  position: relative;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day.empty {
  background: transparent;
}

.calendar-day.has-leave {
  background: var(--accent);
  color: white;
}

.calendar-day .leave-count {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.8em;
}

.leave-details {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  padding: 8px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  min-width: 150px;
  white-space: nowrap;
}

.leave-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.btn-remove-leave {
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 8px;
  font-size: 14px;
  padding: 0;
}

.btn-remove-leave:hover {
  opacity: 0.8;
}

.calendar-day:hover .leave-count {
  opacity: 0.8;
}

.store-card {
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.store-info {
  margin-bottom: 1rem;
}

.store-name {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.store-details {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.store-actions {
  display: flex;
  gap: 0.5rem;
}

.employee-card .store-badge {
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  display: inline-block;
  margin-left: 8px;
}

.employee-counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.counter-card {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.counter-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.counter-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.store-info {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-size: 0.9em;
  line-height: 1.4;
}

.task-list {
  max-height: 400px;
  overflow-y: auto;
  margin: 1rem 0;
}

.task-item {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.task-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.task-status {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8em;
}

.task-status.pendente {
  background: var(--warning);
  color: var(--bg-primary);
}

.task-status.em-andamento {
  background: var(--accent);
  color: white;
}

.task-status.concluido {
  background: var(--success);
  color: white;
}

.task-type {
  font-size: 0.8em;
  color: var(--text-secondary);
}

.requests-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.request-card {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.request-info {
  flex: 1;
}

.request-dates {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.request-actions {
  display: flex;
  gap: 0.5rem;
}

/* Estilos para horários alternativos */
.alternative-schedules-container {
  margin-top: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

.alternative-schedules-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.schedule-row {
  display: grid;
  grid-template-columns: 2fr 3fr 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

.schedule-times {
  display: flex;
  align-items: center;
  gap: 10px;
}

.schedule-times span {
  color: #666;
}

.btn-remove-schedule {
  padding: 4px 8px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-remove-schedule:hover {
  background: #c82333;
}

/* Estilos para exibição de horários alternativos na lista */
.alternative-schedules-container {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.alternative-schedules-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.alternative-schedules-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.schedule-row {
  display: grid;
  grid-template-columns: 1fr 2fr 80px;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.schedule-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.schedule-day select {
  width: 100%;
  padding: 0.5rem;
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.schedule-times {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: center;
}

.schedule-times span {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
}

.schedule-times input {
  padding: 0.5rem;
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.9rem;
  width: 100%;
}

.btn-remove-schedule {
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.5rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
  width: 100%;
  font-size: 0.9rem;
}

.btn-remove-schedule:hover {
  opacity: 0.9;
}

/* Container principal dos horários alternativos */
.alternative-schedules-list {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.alternative-schedules-list h4 {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alternative-schedules-list h4::before {
  content: "🕒";
  font-size: 1rem;
}

/* Grid de horários */
.schedules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

/* Item individual do horário */
.schedule-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.schedule-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Dia da semana */
.schedule-day {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.schedule-day::before {
  content: "📅";
  font-size: 0.9rem;
}

/* Horário */
.schedule-time {
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.schedule-time::before {
  content: "⏰";
  font-size: 0.85rem;
}

/* Responsividade */
@media (max-width: 768px) {
  .schedules-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .schedule-item {
    padding: 0.5rem;
  }
}

/* Animação de entrada suave */
.schedule-item {
  animation: scheduleItemFadeIn 0.3s ease forwards;
  opacity: 0;
  transform: translateY(10px);
}

@keyframes scheduleItemFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Aplicar delay na animação para cada item */
.schedule-item:nth-child(1) {
  animation-delay: 0.1s;
}

.schedule-item:nth-child(2) {
  animation-delay: 0.2s;
}

.schedule-item:nth-child(3) {
  animation-delay: 0.3s;
}

.schedule-item:nth-child(4) {
  animation-delay: 0.4s;
}

.schedule-item:nth-child(5) {
  animation-delay: 0.5s;
}

.schedule-item:nth-child(6) {
  animation-delay: 0.6s;
}

.schedule-item:nth-child(7) {
  animation-delay: 0.7s;
}

/* Tooltip para horários longos */
.schedule-time {
  position: relative;
}


/* Modal de Edição */
.edit-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
  overflow-y: auto;
}

.edit-modal-content {
  background: var(--bg-primary);
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scrollbar personalizada para o modal */
.edit-modal-content::-webkit-scrollbar {
  width: 8px;
}

.edit-modal-content::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.edit-modal-content::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.edit-modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
  opacity: 0.8;
}

/* Conteúdo interno do modal */
.edit-modal-header {
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
}

.edit-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.edit-modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

/* Formulário dentro do modal */
#editEmployeeForm {
  padding: 1.5rem;
}

.edit-form-group {
  margin-bottom: 1.5rem;
}

.edit-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.edit-form-group input,
.edit-form-group select {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.edit-form-group input:focus,
.edit-form-group select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.edit-modal-footer {
  position: sticky;
  bottom: 0;
  background: var(--bg-primary);
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  z-index: 1;
}

/* Responsividade */
@media (max-width: 768px) {
  .edit-modal {
    padding: 0.5rem;
  }

  .edit-modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .edit-modal-header,
  #editEmployeeForm,
  .edit-modal-footer {
    padding: 1rem;
  }
}

/* Ajustes para o modal de horários alternativos dentro do modal de edição */
.edit-modal .alternative-schedules-container {
  margin-top: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1.5rem;
}

.edit-modal .alternative-schedules-header {
  margin-bottom: 1rem;
}

.edit-modal .schedule-row {
  margin-bottom: 1rem;
  background: var(--bg-primary);
}

/* Melhorias na acessibilidade */
.edit-modal-content:focus {
  outline: none;
}

.edit-modal-content[role="dialog"] {
  outline: none;
}