:root {
  --navy: #4F116F;
  --navy-light: #D52F5E;

  --paper: #FCDDA9;
  --card: #FFF8ED;

  --ink: #4F116F;
  --ink-soft: #8B5967;

  --line: #F0B98D;

  --teal: #F7521C;
  --teal-soft: #FFE0C7;

  --amber: #EF3A2F;
  --amber-soft: #FFE0DA;

  --radius: 10px;

  --shadow:
    0 2px 5px rgba(79, 17, 111, 0.08),
    0 8px 24px rgba(79, 17, 111, 0.12);
}

* {
  box-sizing: border-box;
}
.serpent {
  width: 100px;
  height: auto;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
html,
body {
  margin: 0;
  padding: 0;

  background: var(--paper);
  color: var(--ink);

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  font-size: 15px;
  line-height: 1.5;
}

h1,
h2,
h3,
h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
  margin: 0 0 0.4em 0;
  color: var(--navy);
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}


/* ================================
   STRUCTURE
   ================================ */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}


/* ================================
   BANDEAU DU HAUT
   ================================ */

.sidebar {
  width: 100%;
  min-height: 100px;
  background: var(--navy);
  background: linear-gradient(90deg, #4F116F 0%, #D52F5E 18%, #E52947 34%, #F7521C 50%, #E52947 66%, #D52F5E 82%, #4F116F 100%);
  padding: 0 30px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 35px;
  box-shadow: 0 10px 20px rgba(79, 17, 111, 0.2);
  position: relative;
  z-index: 10;
}

.sidebar .brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: #FFFFFF;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.sidebar .brand span {
  color: #D52F5E;
}


/* ================================
   NAVIGATION
   ================================ */

.sidebar nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
}

.sidebar a.nav-link {
  display: block;
  padding: 10px 16px;
  border-radius: 8px;
  color: #FCDDA9;
  text-decoration: none;
  font-size: 0.94rem;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.sidebar a.nav-link:hover {
  background: #EF3A2F;
  color: #FFFFFF;
}

.sidebar a.nav-link.active {
  background: #4F116F;
  color: #FFFFFF;
  font-weight: 600;
}


/* ================================
   UTILISATEUR
   ================================ */

.sidebar .user-box {
  margin-left: auto;
  padding: 0;
  border-top: none;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #FCDDA9;
  font-size: 0.85rem;
  white-space: nowrap;
}

.sidebar .logout-btn {
  margin-top: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
  width: auto;
  text-align: center;
  transition: background 0.15s ease;
}

.sidebar .logout-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}


/* ================================
   CONTENU
   ================================ */

main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 40px;
}


/* ================================
   HEADER
   ================================ */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 10px;
  flex-wrap: wrap;
}
.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.page-header p.subtitle {
  color: var(--ink-soft);
  margin: 4px 0 0;
  font-size: 0.92rem;
}


/* ================================
   CARTES
   ================================ */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}


/* ================================
   BOUTONS
   ================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition:
    transform 0.05s ease,
    opacity 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--navy);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--navy-light);
}

.btn-accent {
  background: var(--teal);
  color: #FFFFFF;
}

.btn-accent:hover {
  opacity: 0.9;
}

.btn-outline {
  background: #FFFFFF;
  color: var(--navy);
  border: 1px solid var(--line);
}

.btn-outline:hover {
  background: #FFF1DB;
  border-color: var(--navy);
}

.btn-danger {
  background: var(--amber-soft);
  color: var(--amber);
}

.btn-danger:hover {
  opacity: 0.85;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.8rem;
}


/* ================================
   FORMULAIRES
   ================================ */

.field {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  background: #FFFFFF;
  color: var(--ink);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 0;
  border-color: var(--teal);
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row .field {
  flex: 1;
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.error-msg {
  background: var(--amber-soft);
  color: var(--amber);
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 0.85rem;
  margin-bottom: 12px;
  display: none;
}

.error-msg.show {
  display: block;
}


/* ================================
   TABLEAUX
   ================================ */

table {
  width: 100%;
  border-collapse: collapse;
  background: #FFFFFF;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}

th {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.78rem;
}

tr:hover td {
  background: #FFF1DB;
}


/* ================================
   BADGES
   ================================ */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
}

.badge.paid {
  background: var(--teal-soft);
  color: var(--teal);
}

.badge.unpaid {
  background: var(--amber-soft);
  color: var(--amber);
}


/* ================================
   CALENDRIER
   ================================ */

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.calendar-nav .month-label {
  font-weight: 700;
  font-size: 1.05rem;
  min-width: 170px;
  text-align: center;
}

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

.calendar-grid .day-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-align: center;
  padding-bottom: 4px;
}

.day-cell {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 84px;
  padding: 7px;
  font-size: 0.8rem;
  position: relative;
}

.day-cell.empty {
  background: transparent;
  border: none;
}

.day-cell .day-number {
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.day-cell.today {
  border-color: var(--teal);
}

.day-cell.today .day-number {
  color: var(--teal);
  font-weight: 700;
}

.day-cell .event-pill {
  margin-top: 5px;
  background: var(--navy);
  color: #FFFFFF;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 0.72rem;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-cell .event-pill:hover {
  background: var(--navy-light);
}

.day-cell .event-pill + .event-pill {
  margin-top: 3px;
}


/* ================================
   MODAL
   ================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(79, 17, 111, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-backdrop.show {
  display: flex;
}

.modal {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 26px;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(79, 17, 111, 0.25);
}

.modal.wide {
  max-width: 640px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--ink-soft);
  line-height: 1;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}


/* ================================
   LOGIN
   ================================ */

.login-wrap {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: space-around;

    padding: 40px 8%;

    background-color: transparent;

    position: relative;
    overflow: hidden;
}

/* Fond dégradé flouté derrière la carte de connexion */
.login-wrap::before {
  content: "";
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  filter: blur(12px);
  z-index: 0;
}

.login-card {
    background: #FFFFFF;

    padding: 40px;

    border-radius: 14px;

    width: 100%;
    max-width: 380px;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);

    position: relative;

    z-index: 2;
}

.login-card .brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.login-card .brand span {
  color: var(--teal);
}

.login-card p.tagline {
  color: var(--ink-soft);
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.login-card .btn {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}

/* Survol noir spécifique au bouton "Se connecter" */
.login-card .btn-primary:hover {
  background: #0a0908;
}

/* Conteneur du champ mot de passe + bouton afficher/masquer */
.password-wrap {
  position: relative;
  width: 100%;
}

.password-wrap input {
  width: 100%;
  padding-right: 90px;
}

.toggle-password-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1px solid var(--teal);
  border-radius: 20px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--teal);
  transition: background 0.2s ease, color 0.2s ease;
}

.toggle-password-btn:hover {
  background: var(--teal);
  color: #FFFFFF;
}

/* Crédit en bas de page */
.site-credit {
  position: fixed;
  bottom: 12px;
  right: 16px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  z-index: 2;
}


/* ================================
   OUTILS
   ================================ */

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.toolbar input[type="search"] {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  min-width: 220px;
  background: #FFFFFF;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
}

.tabs button {
  background: none;
  border: none;
  padding: 8px 14px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.85rem;
}

.tabs button.active {
  background: var(--navy);
  color: #FFFFFF;
}

.empty-state {
  color: var(--ink-soft);
  padding: 40px 0;
  text-align: center;
  font-size: 0.9rem;
}

.muted {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.row-actions {
  display: flex;
  gap: 6px;
}


/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 800px) {

  .sidebar {
    height: auto;
    min-height: 70px;
    padding: 12px 18px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .sidebar nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .sidebar .user-box {
    margin-left: auto;
  }

  main {
    padding: 24px 20px;
  }

  .calendar-grid {
    gap: 4px;
  }

  .day-cell {
    min-height: 70px;
    padding: 5px;
  }
}


@media (max-width: 550px) {

  .sidebar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .sidebar .brand {
    text-align: center;
  }

  .sidebar nav {
    justify-content: center;
  }

  .sidebar .user-box {
    margin-left: 0;
    justify-content: center;
  }

  main {
    padding: 20px 14px;
  }

  .field-row {
    flex-direction: column;
    gap: 0;
  }

  .calendar-grid {
    gap: 2px;
  }

  .day-cell {
    min-height: 60px;
    font-size: 0.7rem;
  }

  .day-cell .event-pill {
    font-size: 0.65rem;
  }
}
.Serpent {
    width: 650px;
    height: auto;

    position: relative;

    z-index: 1;

    opacity: 0.9;
}