@charset "UTF-8";
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --primary: #c40000;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
}

* {
  box-sizing: border-box;
}

#agenda_wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

.calendar-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.view-switch, .filters {
  display: flex;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}

.view-btn, .filter-btn {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.view-btn.active, .filter-btn.active {
  background: var(--primary);
  color: #fff;
}

.month-nav {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.9rem;
}

.month-nav button {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 1rem;
}

.calendar {
  display: grid;
  gap: 16px;
}

.calendar.year-view {
  grid-template-columns: repeat(2, 1fr);
}

.calendar.month-view {
  grid-template-columns: 1fr;
}

.month {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  height: fit-content;
}

.month-header {
  padding: 8px 12px;
  font-weight: 600;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  overflow: auto;
}

.day-name, .day {
  background: var(--card);
  min-height: 90px;
  padding: 8px;
  font-size: 0.85rem;
}

.day-name {
  min-height: auto;
  text-align: center;
  font-weight: 600;
  color: var(--muted);
}

.day-number {
  font-weight: 600;
  margin-bottom: 6px;
}

.event {
  background: rgba(8, 205, 8, 0.2);
  border-left: 3px solid #69c400;
  padding: 4px 6px;
  margin-bottom: 4px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

.event span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}

.day.weekend {
  background: #f0f0f0;
}

/* Dias de fim de semana cinza */
.event.past {
  background: rgba(196, 0, 0, 0.08);
  border-left-color: var(--primary);
}

/* Eventos concluídos */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: var(--card);
  border-radius: 12px;
  padding: 30px;
  max-width: 420px;
  width: calc(100% - 32px);
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: 0;
  font-size: 1.2rem;
  cursor: pointer;
}

#modalWinner:empty {
  display: none;
}

@media (max-width: 991px) {
  .view-switch {
    display: none;
  }
}
@media (max-width: 768px) {
  .calendar {
    grid-template-columns: 1fr;
  }
  .day-name {
    display: none;
  }
  .day {
    min-height: auto;
  }
  .month-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}