/* MZM Lots — стили календаря */

.nav-tabs {
  display: flex;
  gap: 4px;
  margin: 0 20px 12px;
  border-bottom: 1px solid #d0d7de;
}
.nav-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: #6e7681;
  text-decoration: none;
  margin-bottom: -1px;
}
.nav-tab:hover { color: #1f2328; }
.nav-tab.active {
  color: #1f2328;
  border-bottom-color: #0969da;
}

.month-label {
  font-weight: 600;
  font-size: 16px;
  margin: 0 12px;
  min-width: 180px;
  text-align: center;
  display: inline-block;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #d0d7de;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  overflow: hidden;
}

.cal-header {
  background: #f6f8fa;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #6e7681;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cal-cell {
  background: #fff;
  min-height: 100px;
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  transition: background 0.1s;
}
.cal-cell:hover { background: #f6f8fa; }
.cal-cell-other { background: #fafbfc; opacity: 0.5; }
.cal-cell-other:hover { background: #f3f4f6; }
.cal-cell-today { background: #fffbea; }
.cal-cell-today .cal-cell-day {
  background: #0969da;
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cal-cell-day {
  font-size: 13px;
  color: #6e7681;
  font-weight: 500;
  padding: 0 2px;
}

.cal-event {
  background: #d6e9ff;
  color: #084285;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-left: 3px solid #0969da;
}
.cal-event:hover { background: #b9d8ff; }
.cal-event-time {
  font-weight: 600;
  margin-right: 2px;
}

/* Попап */
.event-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.event-modal[hidden] { display: none !important; }
.event-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}
.event-modal-window {
  position: relative;
  background: #fff;
  border-radius: 10px;
  padding: 22px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.event-modal-window h2 { margin: 0 0 6px; font-size: 18px; }
.event-modal-window label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #6e7681;
  font-weight: 500;
}
.event-modal-window input,
.event-modal-window textarea,
.event-modal-window select {
  padding: 8px 10px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #1f2328;
}
.event-modal-window input:focus,
.event-modal-window textarea:focus,
.event-modal-window select:focus {
  outline: none;
  border-color: #0969da;
}

.event-modal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.ev-modal-spacer { flex: 1; }
.btn-primary {
  background: #0969da;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.btn-primary:hover { background: #0858b8; }
.btn-danger {
  background: #fff;
  color: #c84a31;
  border: 1px solid #f1c0c0;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}
.btn-danger:hover { background: #fbeaea; }

/* Мобильная адаптация */
@media (max-width: 768px) {
  .calendar-grid { grid-template-columns: repeat(7, 1fr); font-size: 11px; }
  .cal-cell { min-height: 60px; padding: 3px 4px; }
  .cal-event { font-size: 10px; padding: 1px 3px; }
  .cal-event-time { display: none; }
  .month-label { font-size: 14px; min-width: 120px; margin: 0 6px; }
  .topbar h1 { font-size: 18px; }
}

.event-modal-window { position: relative; }
.event-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #6e7681;
  padding: 4px 8px;
}
.event-modal-close:hover { color: #1f2328; }
