html,
body {
  margin: 0;
  padding: 0;
  background: transparent;
  font-family: Roboto, Arial, sans-serif;
  color: #24303a;
}

.calendar {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 14px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  box-sizing: border-box;
  overflow: visible;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 0 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(154, 118, 77, 0.18);
  background: transparent;
  font-weight: 700;
}

#month-year {
  flex: 1;
  text-align: center;
  text-transform: capitalize;
  font-size: 1rem;
  color: #24303a;
}

.nav-button {
  width: 32px;
  height: 32px;
  border: 1px solid #e2d6c5;
  border-radius: 8px;
  background: #fffdf9;
  color: #9a764d;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.nav-button:hover {
  background: #f7f4ee;
}

.weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 0;
}

.weekdays {
  margin-bottom: 8px;
  background: transparent;
  text-align: center;
}

.weekdays div {
  font-size: 0.78rem;
  font-weight: 700;
  color: #9a764d;
}

.calendar-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-height: 30px;
  aspect-ratio: 1;
  border: 1px solid rgba(226, 214, 197, 0.85);
  border-radius: 8px;
  background: #fffdf9;
  color: #4e5961;
  font-size: 0.88rem;
  line-height: 1;
  cursor: pointer;
  box-sizing: border-box;
  position: relative;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.calendar-day:hover {
  background: #f7f4ee;
  border-color: rgba(154, 118, 77, 0.35);
  color: #24303a;
}

.calendar-day.current-day {
  border-color: #9a764d;
  background: #9a764d;
  color: #fff;
}

.calendar-days .calendar-day:empty {
  visibility: hidden;
  pointer-events: none;
}

.calendar-day[data-event]::before {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9a764d;
}

.calendar-day.current-day[data-event]::before {
  background: #fff;
}

.calendar-day[data-event]:hover::after {
  content: attr(data-event);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  max-width: 180px;
  padding: 6px 9px;
  border-radius: 8px;
  background: #24303a;
  color: #fff;
  font-size: 0.75rem;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(36, 48, 58, 0.18);
}

.modal-content {
  border: 1px solid rgba(154, 118, 77, 0.18);
  border-radius: 18px;
  background: #fffdf9;
  color: #24303a;
}

.modal-content input {
  border: 1px solid #e2d6c5;
  border-radius: 8px;
}

.modal-content button,
#save-event,
#close-modal,
#login-submit,
#login-close {
  border-radius: 8px;
}

#save-event,
#login-submit {
  background-color: #9a764d;
  color: #fff;
}

#save-event:hover,
#login-submit:hover {
  background-color: #84633f;
}

#close-modal,
#login-close {
  background-color: #f7f4ee;
  color: #24303a;
}

@media (max-width: 600px) {
  .calendar {
    padding: 12px;
    border-radius: 16px;
  }

  .calendar-day {
    min-height: 26px;
    font-size: 0.78rem;
  }

  .weekdays div {
    font-size: 0.72rem;
  }
}
