:root {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #203047;
  background: #f2f5fa;
  line-height: 1.5;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: #245ba3;
  color: white;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.94);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

a {
  color: #174b91;
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.25;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  margin: 0 0 14px;
  font-size: 1.15rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 26px;
  background: #173b70;
  color: white;
}

.surtitre {
  margin: 0 0 10px;
  font-weight: 600;
}

header .surtitre {
  color: #c6dcff;
}

main {
  max-width: 1280px;
  margin: auto;
  padding: 24px;
}

.connexion {
  max-width: 560px;
  margin: 50px auto;
}

.connexion h1 {
  margin-bottom: 24px;
}

.carte {
  min-width: 0;
  padding: 24px;
  margin-bottom: 20px;
  background: white;
  border: 1px solid #d8e1ed;
  border-radius: 12px;
}

.cartes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

nav a {
  padding: 10px 16px;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
  background: white;
  text-decoration: none;
}

nav a.actif {
  background: #173b70;
  color: white;
}

.barre,
.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.barre {
  justify-content: space-between;
  margin-bottom: 18px;
}

.actions {
  margin-top: 14px;
}

.secondaire {
  background: #e7edf6;
  color: #173b70;
}

.danger {
  background: #fff0f0;
  color: #9d2020;
  border: 1px solid #e7baba;
}

label {
  display: block;
  margin: 15px 0 6px;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid #abbad0;
  border-radius: 7px;
  background: white;
  color: #203047;
}

textarea {
  min-height: 160px;
  resize: vertical;
}

input[type="color"] {
  height: 46px;
}

input[type="checkbox"] {
  width: auto;
  margin: 0 8px 0 0;
}

.choix {
  display: flex;
  align-items: center;
  margin: 10px 0;
}

fieldset {
  margin-top: 15px;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
}

.meta {
  margin: 8px 0;
  color: #526176;
  font-size: 0.875rem;
}

.texte {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.recent {
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
}

#acces-admin {
  padding-top: 4px;
}

dialog {
  width: min(640px, 94vw);
  max-height: 90vh;
  padding: 26px;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 20px 80px #0004;
}

dialog::backdrop {
  background: #14284388;
}

.erreur,
#message {
  color: #a32020;
  white-space: pre-wrap;
}

#message {
  max-width: 1280px;
  margin: 16px auto;
  padding: 0 24px;
}

#message:empty {
  display: none;
}

.calendrier-defilement {
  overflow-x: auto;
}

.calendrier {
  min-width: 680px;
}

.calendrier .fc-toolbar {
  gap: 12px;
  flex-wrap: wrap;
}

.calendrier .fc-toolbar-title {
  font-size: 1.2rem;
}

.calendrier .fc-event {
  cursor: pointer;
}

.echeance {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  text-align: left;
  background: #edf2fb;
  color: #203047;
  border-left: 4px solid #245ba3;
}

footer {
  padding: 24px;
  color: #526176;
  font-size: 0.875rem;
  text-align: center;
}

:focus-visible {
  outline: 3px solid #e5a515;
  outline-offset: 3px;
}

@media (max-width: 700px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 16px;
  }

  main {
    padding: 16px;
  }

  .cartes {
    grid-template-columns: 1fr;
  }

  .carte {
    padding: 18px;
  }

  .connexion {
    margin: 20px auto;
  }

  button {
    max-width: 100%;
  }
}
