/* Цвета типов событий: левая полоса карточки и метка. */
.event-card, .legend-chip { --event-color: #6b7280; }
:is(.event-card, .legend-chip).coupon { --event-color: #12b76a; }
:is(.event-card, .legend-chip).maturity { --event-color: #f04438; }
:is(.event-card, .legend-chip).amortization { --event-color: #ee46bc; }
:is(.event-card, .legend-chip).call { --event-color: #f79009; }
:is(.event-card, .legend-chip).conversion { --event-color: #6b7280; }
:is(.event-card, .legend-chip).dividend { --event-color: #7a5af8; }

.events-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.events-heading {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.events-all { margin-top: 14px; }

.event-card {
  display: flex;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border-radius: 10px;
  border-left: 3px solid var(--event-color);
  background: #f9fafb;
}

.event-date {
  display: grid;
  align-content: start;
  min-width: 44px;
  line-height: 1.2;
}

.event-date b { font-size: 20px; }
.event-date small { color: #6b7280; }

.event-body { min-width: 0; display: grid; gap: 4px; }

.event-type {
  font-size: 12px;
  font-weight: 600;
  color: var(--event-color);
}

.event-title {
  display: grid;
  gap: 2px;
  overflow: hidden;
}

.event-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-title small {
  color: #6b7280;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
}

.event-card.past-unconfirmed {
  background: linear-gradient(90deg, #fff 0%, #fed7aa 100%);
}

.event-card.past-completed {
  background: linear-gradient(90deg, #fff 0%, #bbf7d0 100%);
}

.event-amount { font-size: 13px; color: #374151; }

.calendar-top { margin-bottom: 12px; }

.link-back {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: #4b5563;
  cursor: pointer;
}

.calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
}

.week-nav { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
}

.legend { display: flex; flex-wrap: wrap; gap: 6px; }

.legend-chip {
  padding: 3px 10px;
  border-radius: 8px;
  background: #f2f4f7;
  font-size: 13px;
}

.legend-chip::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: middle;
  background: var(--event-color);
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px dashed #d0d5dd;
}

.week-day {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 180px;
  padding: 10px 6px;
  border-right: 1px dashed #d0d5dd;
}

.week-day:last-of-type { border-right: 0; }
.week-day.today { background: #f0fdf4; }
.week-day.today .week-day-head b { color: #15803d; }

.week-day-head {
  display: grid;
  justify-items: center;
  margin-bottom: 4px;
}

.week-day-head span { color: #6b7280; font-size: 13px; }

.week-empty { grid-column: 1 / -1; padding: 12px; text-align: center; }

@media (max-width: 900px) {
  .week-grid { grid-template-columns: 1fr; }
  .week-day { min-height: 0; border-right: 0; border-bottom: 1px dashed #d0d5dd; }
  .week-day.empty-day { display: none; }
  .week-day-head { justify-items: start; grid-auto-flow: column; justify-content: start; gap: 8px; }
}
