.events-page,
.events-page * {
  box-sizing: border-box;
}

.events-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: rgba(255,255,255,.94);
  min-height: 100%;
  padding: 4px;
}

.events-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.events-topbar h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
}

.events-topbar p {
  margin: 6px 0 0;
  color: rgba(255,255,255,.62);
}

.events-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.events-month-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 6px;
}

.events-current-month {
  min-width: 180px;
  text-align: center;
  font-weight: 700;
  text-transform: capitalize;
}

.events-layout {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 18px;
  min-height: 0;
}

.events-left,
.events-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.events-calendar-card,
.events-summary-card,
.events-agenda-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}

.events-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.events-weekdays div {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.56);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.events-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.events-day {
  min-height: 112px;
  border-radius: 16px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.07);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  color: #fff;
  cursor: pointer;
  transition: .18s ease;
}

.events-day:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.14);
}

.events-day.muted {
  opacity: .38;
}

.events-day.today {
  box-shadow: inset 0 0 0 1px rgba(72,146,255,.55);
}

.events-day.selected {
  background: rgba(72,146,255,.12);
  border-color: rgba(72,146,255,.5);
}

.events-day-number {
  font-size: 15px;
  font-weight: 800;
}

.events-day-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 10px;
  flex-wrap: wrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.dot.blue, .preview-chip.blue, .event-card.blue, .event-badge.blue { background: rgba(72,146,255,.22); border-color: rgba(72,146,255,.45); }
.dot.green, .preview-chip.green, .event-card.green, .event-badge.green { background: rgba(41,199,111,.20); border-color: rgba(41,199,111,.42); }
.dot.orange, .preview-chip.orange, .event-card.orange, .event-badge.orange { background: rgba(255,166,77,.20); border-color: rgba(255,166,77,.42); }
.dot.red, .preview-chip.red, .event-card.red, .event-badge.red { background: rgba(255,91,91,.20); border-color: rgba(255,91,91,.42); }
.dot.purple, .preview-chip.purple, .event-card.purple, .event-badge.purple { background: rgba(170,104,255,.20); border-color: rgba(170,104,255,.42); }

.events-day-preview {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
}

.preview-chip {
  border: 1px solid transparent;
  color: rgba(255,255,255,.94);
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.events-more {
  font-size: 10px;
  color: rgba(255,255,255,.6);
  font-weight: 700;
}

.events-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.events-summary-head h3 {
  margin: 0;
  font-size: 18px;
  text-transform: capitalize;
}

.events-count-badge {
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(72,146,255,.18);
  border: 1px solid rgba(72,146,255,.35);
  font-weight: 800;
}

.events-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.events-kpi {
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  padding: 12px;
}

.events-kpi span {
  display: block;
  color: rgba(255,255,255,.62);
  font-size: 12px;
  margin-bottom: 6px;
}

.events-kpi strong {
  font-size: 22px;
  font-weight: 800;
}

.events-inline-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 90px;
  gap: 10px;
  align-items: center;
}

.events-agenda-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.events-agenda-list::-webkit-scrollbar {
  width: 8px;
}

.events-agenda-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,.04);
  border-radius: 999px;
}

.events-agenda-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.18);
  border-radius: 999px;
}

.event-card {
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 14px;
  backdrop-filter: blur(8px);
}

.event-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.event-card-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
}

.event-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  color: rgba(255,255,255,.68);
  font-size: 12px;
}

.event-card-time {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.78);
  white-space: nowrap;
}

.event-card-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-line {
  color: rgba(255,255,255,.88);
  line-height: 1.45;
}

.event-line.desc {
  color: rgba(255,255,255,.68);
}

.event-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.events-empty {
  padding: 28px 16px;
  text-align: center;
  color: rgba(255,255,255,.58);
}

.event-view-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.event-view-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.event-badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  font-size: 12px;
  font-weight: 700;
}

.event-view-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.view-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.06);
}

.view-row.full {
  grid-template-columns: 140px 1fr;
}

.view-k {
  color: rgba(255,255,255,.56);
  font-weight: 700;
}

.view-v {
  color: rgba(255,255,255,.92);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 1250px) {
  .events-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .events-inline-filters {
    grid-template-columns: 1fr;
  }

  .events-kpis {
    grid-template-columns: 1fr;
  }

  .events-calendar-grid {
    gap: 6px;
  }

  .events-day {
    min-height: 96px;
    padding: 8px;
  }
}

/* Navigation mois */
.events-month-nav .btn,
#eventsPrevMonth,
#eventsNextMonth {
  width: 42px;
  height: 32px;
  min-width: 42px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  color: rgba(255,255,255,.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: .18s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.events-month-nav .btn:hover,
#eventsPrevMonth:hover,
#eventsNextMonth:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.07));
  border-color: rgba(255,255,255,.18);
  transform: translateY(-1px);
}

.events-month-nav .btn:active,
#eventsPrevMonth:active,
#eventsNextMonth:active {
  transform: translateY(0);
}

/* Barre de recherche + filtres */
.events-inline-filters .input,
#eventsSearch,
#eventsCategoryFilter {
  height: 40px;
  width: 100%;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(10, 22, 52, .88);
  color: rgba(255,255,255,.94);
  outline: none;
  font-size: 14px;
  font-weight: 500;
  transition: .18s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

#eventsSearch::placeholder {
  color: rgba(255,255,255,.42);
}

.events-inline-filters .input:focus,
#eventsSearch:focus,
#eventsCategoryFilter:focus {
  border-color: rgba(72,146,255,.55);
  box-shadow: 0 0 0 3px rgba(72,146,255,.14);
}

/* Select */
#eventsCategoryFilter {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,.75) 50%),
    linear-gradient(135deg, rgba(255,255,255,.75) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 17px,
    calc(100% - 12px) 17px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* Bouton reset */
#eventsResetFilters,
.events-inline-filters .btn {
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  color: rgba(255,255,255,.92);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: .18s ease;
  white-space: nowrap;
}

#eventsResetFilters:hover,
.events-inline-filters .btn:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.07));
  border-color: rgba(255,255,255,.18);
  transform: translateY(-1px);
}

#eventsResetFilters:active,
.events-inline-filters .btn:active {
  transform: translateY(0);
}

.events-page input,
.events-page select,
.events-page button,
.events-page textarea {
  font-family: inherit;
}