* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Estilo para o container do Header */
.header {
  text-align: center;
  /* Centraliza o texto e a imagem */
  padding: 20px;
  margin-bottom: 20px;
  background-color: #f8f9fa;
  /* Cor de fundo opcional */
  border-bottom: 2px solid #ddd;
  /* Linha divisória opcional */
}

/* Estilo específico para a Logo */
.header-logo {
  width: 300px;
  /* Ajuste o tamanho conforme necessário (ex: 80px, 120px) */
  height: auto;
  /* Mantém a proporção da imagem */
  display: block;
  margin: 0 auto 15px auto;
  /* Centraliza e dá espaço abaixo da logo */
}

/* Estilo opcional para o Título */
.header h1 {
  margin: 0;
  font-size: 24px;
  color: #333;
}

/* Estilo opcional para o Subtítulo */
.header p {
  margin: 5px 0 0 0;
  color: #666;
  font-size: 14px;
}

.toolbar {
  background: #f8f9fa;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  border-bottom: 2px solid #e9ecef;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #2a5298;
  color: white;
}

.btn-primary:hover {
  background: #1e3c72;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(42, 82, 152, 0.3);
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #218838;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-info {
  background: #17a2b8;
  color: white;
}

.btn-info:hover {
  background: #138496;
}

.month-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  /* ← ADICIONADO para mobile */
  width: 100%;
  /* ← ADICIONADO para mobile */
}

.month-selector select {
  padding: 10px 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1em;
  cursor: pointer;
  flex: 1;
  /* ← ADICIONADO para distribuir espaço */
  min-width: 120px;
  /* ← ADICIONADO para evitar quebra */
}

.scale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  /* ← AUTO-AJUSTÁVEL */
  gap: 10px;
  padding: 30px;
  background: #f8f9fa;
  display: grid !important; /* 🔥 Força exibição */
  visibility: visible !important;
  opacity: 1 !important;
}

.day-column {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  /* ← LARGURA MÍNIMA */
}

.day-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 8px;
  text-align: center;
  font-weight: bold;
  border-radius: 10px 10px 0 0;
}

.day-header.domingo {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.day-content {
  padding: 10px;
  min-height: 200px;
  /* ← REDUZIDO PARA CABER MAIS DIAS */
}

.day-header.segunda {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.day-header.terca {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.day-header.quarta {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.day-header.quinta {
  background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.day-header.sexta {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  color: #333;
}

.day-header.sabado {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
  color: #333;
}

.day-content {
  padding: 10px;
  min-height: 400px;
  border: 1px solid #e9ecef;
  /* ← ADICIONADO para separação visual */
  border-top: none;
  /* ← ADICIONADO */
  border-radius: 0 0 10px 10px;
  /* ← ADICIONADO */
}

.activity-card {
  background: #f8f9fa;
  border-left: 4px solid #2a5298;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.activity-card:hover {
  transform: translateX(5px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.activity-card .time {
  font-weight: bold;
  color: #2a5298;
  font-size: 0.9em;
  margin-bottom: 5px;
  display: flex;
  /* ← ADICIONADO */
  align-items: center;
  /* ← ADICIONADO */
  gap: 5px;
  /* ← ADICIONADO */
}

.activity-card .date-badge {
  background: #2a5298;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  font-weight: 600;
}

.activity-card .type {
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
  font-size: 0.95em;
}

.activity-card .details {
  font-size: 0.85em;
  color: #666;
  line-height: 1.6;
}

.activity-card .details strong {
  color: #2a5298;
}

.activity-card .details .label {
  font-weight: 600;
  color: #2a5298;
  margin-right: 5px;
}

.activity-card .delete-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
}

.activity-card:hover .delete-btn {
  display: flex;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e9ecef;
}

.modal-header h2 {
  color: #2a5298;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1em;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2a5298;
}

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 2px solid #e9ecef;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.empty-state i {
  font-size: 3em;
  margin-bottom: 10px;
}

@media print {
  body {
    background: white;
    padding: 0;
  }

  .container {
    box-shadow: none;
  }

  .toolbar,
  .delete-btn {
    display: none !important;
  }

  .scale-grid {
    padding: 15px;
  }

  .activity-card {
    break-inside: avoid;
  }
}

@media (max-width: 1024px) {
  .scale-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 768px) {
  .header h1 {
    font-size: 1.5em;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .month-selector {
    flex-direction: column;
    align-items: stretch;
  }

  .month-selector select,
  #locationFilter {
    width: 100%;
    margin-bottom: 5px;
  }

  /* AQUI ESTÁ O SEGREDO DO LAYOUT MOBILE */
  .scale-grid {
    grid-template-columns: repeat(2, 1fr);
    /* FORÇA 2 COLUNAS */
    padding: 10px;
    gap: 8px;
  }

  .day-column {
    min-width: auto;
    /* Permite que a coluna encolha */
    width: 100%;
  }

  .day-header {
    padding: 8px 4px;
    border-radius: 8px 8px 0 0;
  }

  .day-header div:first-child {
    font-size: 1.2em !important;
    /* Número do dia menor */
  }

  .day-header div:last-child {
    font-size: 0.65em !important;
    /* Dia da semana menor */
  }

  .day-content {
    min-height: auto;
    /* REMOVE O ESPAÇO EM BRANCO */
    padding: 8px;
    border-radius: 0 0 8px 8px;
  }

  .activity-card {
    margin-bottom: 5px;
    padding: 8px;
    font-size: 0.85em;
  }

  .activity-card .details {
    font-size: 0.75em;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

.stats {
  background: white;
  padding: 20px 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  border-bottom: 2px solid #e9ecef;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
}

.stat-card h3 {
  font-size: 2em;
  margin-bottom: 5px;
}

.stat-card p {
  opacity: 0.9;
}

.month-selector select {
  padding: 10px 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1em;
  cursor: pointer;
}

#locationFilter {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  font-weight: 600;
  flex: 1;
  /* ← ADICIONADO */
  min-width: 150px;
  /* ← ADICIONADO */
}

#locationFilter option {
  background: white;
  color: #333;
}

@media (max-width: 480px) {
  .scale-grid {
    grid-template-columns: 1fr;
    /* ← 1 COLUNA EM TELAS MUITO PEQUENAS */
  }
}
