:root {
  --bleu: #173b7a;
  --bleu2: #2563eb;
  --fond: #f5f8fc;
  --texte: #172033;
  --gris: #667085;
  --ligne: #d8e2f0;
  --card: #fff;
  --shadow: 0 12px 30px rgba(23, 59, 122, 0.1);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    Inter,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  background: linear-gradient(180deg, #eff7ff 0%, #f8fafc 38%, #fff 100%);
  color: var(--texte);
}
header {
  padding: 38px 22px 28px;
  background: linear-gradient(135deg, var(--bleu), #2458b3);
  color: #fff;
  position: relative;
  overflow: hidden;
}
header:after {
  content: "";
  position: absolute;
  right: -90px;
  top: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}
.wrap,
main,
footer,
.admin {
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.wrap {
  padding: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}
.logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  width: auto;
  height: 74px;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}
.logo img {
  display: block;
  height: 74px;
  width: auto;
  max-width: min(42vw, 320px);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.18));
}
h1 {
  font-size: clamp(30px, 4.5vw, 54px);
  line-height: 1.02;
  margin: 0 0 10px;
  font-weight: 900;
  letter-spacing: -1.4px;
}
.subtitle {
  font-size: 18px;
  max-width: 900px;
  opacity: 0.92;
  margin: 0 0 8px;
}
.contact {
  font-size: 14px;
  opacity: 0.9;
  margin-top: 8px;
}
.toolbar {
  max-width: 1180px;
  margin: -24px auto 28px;
  padding: 0 22px;
  position: relative;
  z-index: 5;
}
.panel {
  background: #fff;
  border: 1px solid var(--ligne);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.topline {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
.search {
  flex: 1;
  min-width: 260px;
}
.search input {
  width: 100%;
  border: 1px solid var(--ligne);
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 15px;
  outline: none;
}
.search input:focus {
  border-color: var(--bleu2);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}
.buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
button,
.btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  background: #eef4ff;
  color: var(--bleu);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
}
button:hover,
.btn:hover {
  filter: brightness(0.97);
}
button.primary,
.btn.primary {
  background: var(--bleu);
  color: #fff;
}
button.danger {
  background: #fee2e2;
  color: #991b1b;
}
button.ghost,
.btn.ghost {
  background: #fff;
  border: 1px solid var(--ligne);
}
.checks {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.chip-check {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ligne);
  border-radius: 999px;
  padding: 8px 11px;
  background: #fff;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  font-weight: 800;
}
.chip-check input {
  accent-color: var(--bleu2);
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--gris);
  font-size: 14px;
  margin-top: 12px;
}
.meta strong {
  color: var(--bleu);
}
main {
  padding: 0 22px 60px;
}
.legend-note {
  margin: 0 0 22px;
  padding: 14px 18px;
  border-left: 5px solid var(--bleu2);
  background: #f8fbff;
  border-radius: 14px;
  color: #334155;
}
.month {
  margin: 26px 0 32px;
}
.month-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
}
.month-title h2 {
  margin: 0;
  color: var(--bleu);
  font-size: 25px;
}
.month-title span {
  background: #e8f1ff;
  color: var(--bleu);
  font-weight: 800;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.event {
  background: var(--card);
  border: 1px solid var(--ligne);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  display: flex;
  gap: 14px;
  transition:
    0.18s transform,
    0.18s box-shadow;
  cursor: pointer;
}
.event:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.event:focus {
  outline: 3px solid rgba(37, 99, 235, 0.25);
}
.datebox {
  min-width: 74px;
  text-align: center;
  border-radius: 16px;
  background: linear-gradient(180deg, #f0f7ff, #fff);
  border: 1px solid var(--ligne);
  padding: 10px 7px;
  height: max-content;
}
.day {
  font-size: 28px;
  font-weight: 900;
  color: var(--bleu);
  line-height: 1;
}
.mon {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--gris);
  font-weight: 800;
  margin-top: 3px;
}
.year {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
}
.content {
  min-width: 0;
  flex: 1;
}
.time {
  font-size: 13px;
  color: var(--gris);
  font-weight: 800;
  margin-bottom: 5px;
}
.title {
  font-size: 18px;
  font-weight: 900;
  margin: 0 0 7px;
  color: #0f172a;
}
.desc {
  font-size: 14px;
  color: #475569;
  line-height: 1.43;
  margin: 0 0 11px;
}
.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tag {
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  padding: 5px 8px;
  color: #fff;
}
.free-tag {
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  padding: 5px 8px;
  background: #f1f5f9;
  color: #334155;
}
.status {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 900;
}
.empty {
  display: none;
  text-align: center;
  padding: 32px;
  border: 1px dashed var(--ligne);
  border-radius: 18px;
  color: var(--gris);
  background: #fff;
}
.hidden {
  display: none !important;
}
footer {
  padding: 0 22px 40px;
  color: #64748b;
  font-size: 13px;
}
.footbox {
  border-top: 1px solid var(--ligne);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 50;
}
.modal {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.3);
  border: 1px solid var(--ligne);
}
.modal-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--ligne);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.modal-body {
  padding: 20px 22px;
}
.modal h2 {
  margin: 0;
  color: var(--bleu);
  font-size: 25px;
}
.close {
  font-size: 22px;
  line-height: 1;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  justify-content: center;
  padding: 0;
}
.detail-line {
  margin: 8px 0;
  color: #475569;
}
.detail-line strong {
  color: #0f172a;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.split-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.calbox {
  background: #f8fafc;
  border: 1px solid var(--ligne);
  border-radius: 16px;
  padding: 12px;
  margin-top: 16px;
}
.admin {
  padding: 24px 22px 60px;
}
.admin-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}
.admin h2 {
  color: var(--bleu);
  margin: 0 0 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field.full {
  grid-column: 1/-1;
}
.field label {
  font-weight: 800;
  font-size: 13px;
  color: #334155;
}
.field input,
.field textarea,
.field select {
  border: 1px solid var(--ligne);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
}
.field textarea {
  min-height: 84px;
  resize: vertical;
}
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 650px;
  overflow: auto;
}
.admin-item {
  border: 1px solid var(--ligne);
  border-radius: 14px;
  padding: 10px;
  background: #fff;
}
.admin-item-title {
  font-weight: 900;
  color: #0f172a;
}
.admin-item-meta {
  font-size: 12px;
  color: #64748b;
  margin: 3px 0 8px;
}
.small-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.small-actions button {
  font-size: 12px;
  padding: 7px 10px;
}
.theme-row {
  display: grid;
  grid-template-columns: 1fr 88px auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.theme-row input {
  border: 1px solid var(--ligne);
  border-radius: 10px;
  padding: 9px;
  font-family: inherit;
}
.notice {
  font-size: 13px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid var(--ligne);
  border-radius: 14px;
  padding: 12px;
  margin-top: 12px;
}
.file-input {
  display: none;
}
.login {
  max-width: 520px;
  margin: -20px auto 34px;
  padding: 0 22px;
}
.login .panel {
  padding: 22px;
}
.login input {
  width: 100%;
  border: 1px solid var(--ligne);
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 15px;
  margin: 10px 0;
}
.locked .admin {
  display: none;
}
.error {
  color: #991b1b;
  font-weight: 800;
  font-size: 13px;
}
.admin-link {
  position: fixed;
  right: 12px;
  bottom: 12px;
  opacity: 0.25;
}
.admin-link:hover {
  opacity: 1;
}
@media (max-width: 850px) {
  .grid,
  .admin-grid,
  .form-grid,
  .split-actions {
    grid-template-columns: 1fr;
  }
  .event {
    padding: 14px;
  }
  .datebox {
    min-width: 66px;
  }
  .buttons {
    width: 100%;
  }
  .buttons button,
  .buttons .btn {
    flex: 1;
    justify-content: center;
  }
  .chip-check {
    font-size: 13px;
  }
  .brand {
    align-items: flex-start;
  }
  .logo {
    height: 52px;
  }
  .logo img {
    height: 52px;
    max-width: 58vw;
  }
  .theme-row {
    grid-template-columns: 1fr 78px;
  }
  .theme-row button {
    grid-column: 1/-1;
  }
}
@media print {
  header,
  .toolbar,
  .legend-note,
  footer,
  .admin,
  .modal-backdrop,
  .admin-link {
    display: none !important;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .event {
    break-inside: avoid;
    box-shadow: none;
    cursor: default;
  }
  .month {
    page-break-inside: avoid;
  }
  body {
    background: #fff;
  }
}
