/* ====================================================================
   STYLE.CSS - Kiosk Soins Parents
   Version 5.0 - Bandeau dynamique + zone alertes + modales unifiées
   ==================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700;800;900&display=swap');

:root {
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body.theme-dark {
  --bg: #121513;
  --surface: #1B211E;
  --surface-2: #242C28;
  --ink: #F0F4ED;
  --ink-2: #9BA498;
  --border: #2D3731;
  --accent: #0099FF;
  --accent-ink: #FFFFFF;
  --danger: #E05353;
  --success: #22C55E;
  --warning: #F59E0B;

  /* Palette des statuts */
  --statut-planifie: #0E9B3E;
  --statut-preste: #096A09;
  --statut-remplace: #6B7A2A;
  --statut-a-remplacer: #8DA81E;
  --statut-vacant: #DF6D14;
  --statut-annule: #842E1B;
}

body.theme-light {
  --bg: #F5F4EF;
  --surface: #FFFFFF;
  --surface-2: #F0EEE4;
  --ink: #23281F;
  --ink-2: #646B5D;
  --border: #DDD9CD;
  --accent: #234961;
  --accent-ink: #FFFFFF;
  --danger: #B33F3F;
  --success: #16A34A;
  --warning: #B4762A;

  --statut-planifie: #0E9B3E;
  --statut-preste: #096A09;
  --statut-remplace: #6B7A2A;
  --statut-a-remplacer: #8DA81E;
  --statut-vacant: #DF6D14;
  --statut-annule: #842E1B;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: background-color 0.3s ease, color 0.3s ease;
}

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* --------------------------------------------------------------------
   LOGIN PLEIN ÉCRAN
   -------------------------------------------------------------------- */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-overlay.hidden { display: none; }

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.login-icon { font-size: 40px; text-align: center; margin-bottom: 4px; }
.login-title { font-size: 22px; font-weight: 800; text-align: center; margin: 0; line-height: 1.25; }
.login-sub { font-size: 14px; color: var(--ink-2); text-align: center; margin: 0 0 12px; }
.login-label {
  font-size: 12px; font-weight: 800; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: 0.05em; margin-top: 8px;
}
.login-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--ink);
  width: 100%;
  outline: none;
  transition: var(--transition);
}
.login-input:focus { border-color: var(--accent); }
.login-btn {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 16px;
  font-weight: 800;
  margin-top: 14px;
  transition: var(--transition);
}
.login-btn:hover { filter: brightness(1.1); }
.login-btn:active { transform: scale(0.98); }
.login-erreur {
  font-size: 13px; color: var(--danger);
  min-height: 18px; text-align: center;
  margin-top: 6px; font-weight: 700;
}

/* --------------------------------------------------------------------
   CONTENEUR APP
   -------------------------------------------------------------------- */
.app-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 14px 16px 100px;
  min-height: 100vh;
  position: relative;
}

/* --------------------------------------------------------------------
   BANDEAU GARDE (couleur selon statut)
   -------------------------------------------------------------------- */
.kiosk-header { margin-bottom: 14px; }

.garde-banner {
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  color: #fff;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.garde-banner:hover { transform: translateY(-1px); }
.garde-banner:active { transform: scale(0.99); }

/* Couleurs du bandeau selon le statut */
.garde-banner.statut-planifie { background: var(--statut-planifie); }
.garde-banner.statut-preste { background: var(--statut-preste); }
.garde-banner.statut-remplace { background: var(--statut-remplace); }
.garde-banner.statut-a-remplacer { background: var(--statut-a-remplacer); }
.garde-banner.statut-vacant { background: var(--statut-vacant); }
.garde-banner.statut-annule { background: var(--statut-annule); }

.garde-left { display: flex; flex-direction: column; flex-shrink: 0; }
.garde-heure { font-size: 18px; font-weight: 800; line-height: 1.1; }
.garde-date { font-size: 11px; font-weight: 600; opacity: 0.95; }

.garde-center {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.garde-center strong { font-weight: 900; font-size: 16px; }

.garde-right { flex-shrink: 0; }
.pill-alertes {
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  border-radius: 18px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

/* --------------------------------------------------------------------
   ZONE ALERTES / MONITORING
   -------------------------------------------------------------------- */
.alert-zone {
  margin-bottom: 16px;
  max-height: 340px;
  overflow-y: auto;
  border-radius: var(--radius-md);
}
.alert-zone.hidden { display: none; }

.alert-zone-empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}

.alert-zone-error {
  background: rgba(220, 38, 38, 0.15);
  border: 2px solid var(--danger);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  color: var(--danger);
  font-size: 14px;
  font-weight: 800;
}

.alert-item {
  background: var(--surface);
  border-left: 5px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.alert-item.danger { border-left-color: var(--danger); }
.alert-item.warning { border-left-color: var(--warning); }
.alert-item-icon { font-size: 22px; }
.alert-item-content { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.alert-item-title { font-size: 14px; font-weight: 800; }
.alert-item-sub { font-size: 12px; color: var(--ink-2); }

/* --------------------------------------------------------------------
   TITRES DE SECTION & TUILES
   -------------------------------------------------------------------- */
.section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  margin: 0 0 10px 2px;
}

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  min-height: 130px;
  transition: var(--transition);
  color: var(--ink);
}
.tile:hover { background: var(--surface-2); border-color: var(--accent); }
.tile:active { transform: scale(0.98); }

.tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tile-icon { font-size: 28px; }
.tile-counter {
  background: rgba(255,255,255,0.08);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-2);
}
body.theme-light .tile-counter { background: rgba(0,0,0,0.06); }

.tile-body { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
.tile-title { font-size: 17px; font-weight: 800; }
.tile-desc { font-size: 13px; color: var(--ink-2); font-weight: 500; }

/* --------------------------------------------------------------------
   VUES
   -------------------------------------------------------------------- */
.view { display: none; animation: fadeIn 0.2s ease-out; }
.view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.view-header h2 { margin: 0; font-size: 18px; font-weight: 800; }

.btn-back {
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 20px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(34, 197, 94, 0.3);
  transition: var(--transition);
}
.btn-back:hover { background: #15803D; transform: translateX(-2px); }

.empty-state {
  text-align: center;
  color: var(--ink-2);
  padding: 24px;
  font-size: 14px;
}

/* --------------------------------------------------------------------
   VUE PRÉSENCE - NAVIGATION JOUR
   -------------------------------------------------------------------- */
.day-slider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: 16px;
}
.day-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  transition: var(--transition);
}
.day-btn:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.day-label {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  text-transform: capitalize;
}

/* --------------------------------------------------------------------
   CARTES DE CRÉNEAUX
   -------------------------------------------------------------------- */
.creneaux-list { display: flex; flex-direction: column; gap: 12px; }

.creneau {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 2.5px solid;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: var(--transition);
}

.creneau-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.creneau-heure { font-size: 16px; font-weight: 800; color: #fff; white-space: nowrap; }
.creneau-nom { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.3; }
.creneau-remplace { font-size: 12px; font-weight: 600; opacity: 0.85; color: #fff; }

.creneau-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.creneau-statut {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.creneau-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.creneau-actions button {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-reprendre { background: #16A34A; }
.btn-reprendre:hover { background: #22C55E; }
.btn-annuler { background: #B33F3F; }
.btn-annuler:hover { background: #DC2626; }
.btn-confirmer { background: #E5983A; color: #4B1D1D; }
.btn-confirmer:hover { background: #F59E0B; }

/* Palette des statuts */
.creneau.vacant { background: #4B1D1D; border-color: #DC2626; }
.creneau.vacant .creneau-statut { color: #FCA5A5; }

.creneau.annule { background: #3B0F0F; border-color: #991B1B; }
.creneau.annule .creneau-statut { color: #F87171; }

.creneau.a_remplacer { background: #78350F; border-color: #F59E0B; }
.creneau.a_remplacer .creneau-statut { color: #FDE68A; }

.creneau.planifie { background: #06671E; border-color: #16A34A; }
.creneau.planifie .creneau-statut { color: #86EFAC; }

.creneau.planifie.remplace { background: #064E3B; border-color: #059669; }
.creneau.planifie.remplace .creneau-statut { color: #6EE7B7; }

.creneau.preste { background: #052E16; border-color: #15803D; opacity: 0.9; }
.creneau.preste .creneau-statut { color: #4ADE80; }

/* --------------------------------------------------------------------
   FOOTER + CARROUSEL BAS
   -------------------------------------------------------------------- */
.kiosk-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 100;
  flex-wrap: wrap;
}

.carrousel-bas {
  flex: 1;
  min-width: 200px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 4px 0;
}
.carrousel-bas-item {
  display: inline-block;
  animation: defilement 30s linear infinite;
  padding-left: 100%;
}
.carrousel-bas-item.hidden { display: none; }
@keyframes defilement {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

.footer-right { display: flex; align-items: center; gap: 8px; }

.session-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
}
.session-pill.hidden { display: none; }
.session-role {
  font-size: 11px;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
}

.tool-btn {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
}
.tool-btn:hover { background: var(--border); }
.tool-btn.icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* --------------------------------------------------------------------
   MODALES
   -------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.modal-window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 6px;
  text-align: center;
}
.modal-sub {
  font-size: 14px;
  color: var(--ink-2);
  text-align: center;
  margin: 0 0 16px;
}
.modal-pin {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.4em;
  color: var(--ink);
  width: 100%;
  outline: none;
}
.modal-pin:focus { border-color: var(--accent); }
.modal-erreur {
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
  text-align: center;
  margin-top: 8px;
  font-weight: 700;
}
.modal-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.btn-cancel, .btn-validate {
  flex: 1;
  padding: 14px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 10px;
  border: none;
  transition: var(--transition);
}
.btn-cancel { background: var(--surface-2); color: var(--ink); }
.btn-cancel:hover { background: var(--border); }
.btn-validate { background: var(--success); color: #fff; }
.btn-validate:hover { filter: brightness(1.1); }

.full-width { width: 100%; margin-top: 14px; }

/* Choix rapide du motif */
.motif-choices {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.motif-choice {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  transition: var(--transition);
}
.motif-choice:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* --------------------------------------------------------------------
   SIBLINGS GRID (choix du remplaçant)
   -------------------------------------------------------------------- */
.siblings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.sibling-btn {
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  transition: var(--transition);
}
.sibling-btn:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.sibling-btn.selected {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

/* --------------------------------------------------------------------
   RESPONSIVE MOBILE
   -------------------------------------------------------------------- */
@media (max-width: 600px) {
  .app-container { padding: 10px 12px 100px; }

  .tiles-grid { grid-template-columns: 1fr; }
  .tile { min-height: 100px; padding: 16px; }

  .garde-banner { padding: 10px 14px; }
  .garde-heure { font-size: 16px; }
  .garde-date { font-size: 10px; }
  .garde-center { font-size: 13px; }
  .garde-center strong { font-size: 14px; }
  .pill-alertes { font-size: 11px; padding: 5px 10px; }

  .view-header h2 { font-size: 16px; }
  .btn-back { width: 36px; height: 36px; font-size: 18px; }

  /* Créneaux : restent compacts sur une ligne, boutons empilés à droite */
  .creneau {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }
  .creneau-left { gap: 2px; flex: 1; min-width: 0; }
  .creneau-heure { font-size: 14px; }
  .creneau-nom { font-size: 13px; line-height: 1.2; }
  .creneau-remplace { font-size: 10px; }
  .creneau-right { flex-shrink: 0; align-items: flex-end; gap: 6px; }
  .creneau-statut { font-size: 10px; }
  .creneau-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
  .creneau-actions button {
    padding: 6px 12px;
    font-size: 11px;
    min-width: 110px;
    text-align: center;
  }

  .modal-window { padding: 20px; }
  .modal-title { font-size: 18px; }

  .day-btn { padding: 8px 10px; font-size: 13px; }
  .day-label { font-size: 13px; }

  /* Footer + carrousel bas : reste discret */
  .kiosk-footer { padding: 8px 12px; }
  .carrousel-bas { font-size: 12px; }
  .session-pill { font-size: 12px; padding: 5px 10px; }
  .tool-btn.icon-only { width: 36px; height: 36px; font-size: 16px; }
}

@media (max-width: 380px) {
  .garde-heure { font-size: 14px; }
  .garde-date { font-size: 9px; }
  .garde-center { font-size: 12px; }
  .garde-center strong { font-size: 13px; }
  .pill-alertes { font-size: 10px; padding: 4px 8px; }
  .creneau-heure { font-size: 13px; }
  .creneau-nom { font-size: 12px; }
  .creneau-remplace { font-size: 9px; }
  .creneau-statut { font-size: 9px; }
  .creneau-actions button { min-width: 90px; padding: 5px 10px; font-size: 10px; }
}

/* ====================================================================
   MODULE TÂCHES
   ==================================================================== */

.taches-bloc { margin-bottom: 20px; }

.bloc-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 12px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--warning);
  letter-spacing: 0.05em;
}
.bloc-separator::before,
.bloc-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.tache-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: var(--transition);
}

.tache-card.faite {
  padding: 8px 14px;
  opacity: 0.75;
  width: 50%;
  min-width: 260px;
  max-width: 100%;
  border-left-color: var(--success);
  background: rgba(34,197,94,0.08);
}
.tache-card.faite .tache-nom {
  font-size: 14px;
  text-decoration: line-through;
  text-decoration-color: rgba(255,255,255,0.3);
}
.tache-card.faite .tache-meta { font-size: 11px; }

.tache-card.retard {
  border-left-color: var(--warning);
  background: rgba(245,158,11,0.08);
}

.tache-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.tache-nom { font-size: 15px; font-weight: 800; }
.tache-meta { font-size: 12px; color: var(--ink-2); }

.tache-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  transition: var(--transition);
}
.btn-valider { background: #16A34A; }
.btn-valider:hover { background: #22C55E; }
.btn-cloturer { background: #E5983A; color: #4B1D1D; }
.btn-cloturer:hover { background: #F59E0B; }
.btn-annuler { background: #B33F3F; }
.btn-annuler:hover { background: #DC2626; }

@media (max-width: 600px) {
  .tache-card { padding: 10px 14px; }
  .tache-card.faite { width: 100%; min-width: 0; }
  .tache-nom { font-size: 14px; }
  .tache-meta { font-size: 11px; }
  .btn-sm { padding: 6px 12px; font-size: 11px; }
}

/* Toast non bloquant */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--danger);
  color: #fff;
  padding: 12px 24px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 14px;
  z-index: 2000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--success); }
/*Syte pour rdv */
/* ====================================================================
   MODULE RDV
   ==================================================================== */

.rdv-vue-bascule {
  display: flex;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 12px;
  width: fit-content;
}
.rdv-vue-bascule button {
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: var(--transition);
}
.rdv-vue-bascule button.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.rdv-date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: 16px;
}
.rdv-date-nav button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  transition: var(--transition);
}
.rdv-date-nav button:hover { background: var(--accent); color: var(--accent-ink); }
.rdv-date-label {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  text-transform: capitalize;
}

.rdv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
}
.rdv-card:hover { background: var(--surface-2); transform: translateX(2px); }
.rdv-card.passe { border-left-color: var(--warning); background: rgba(245,158,11,0.08); }
.rdv-card.effectue { border-left-color: var(--success); background: rgba(34,197,94,0.08); }
.rdv-card.manque { border-left-color: var(--danger); background: rgba(220,38,38,0.08); }
.rdv-card.annule { border-left-color: var(--border); opacity: 0.6; }

.rdv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rdv-titre { font-size: 16px; font-weight: 800; margin: 0; }
.rdv-statut {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 3px 8px; border-radius: 99px;
  background: rgba(255,255,255,0.08); color: var(--ink-2);
}
.rdv-meta { font-size: 13px; color: var(--ink-2); margin: 4px 0 0; }
.rdv-accompagnant { font-size: 13px; font-weight: 700; margin-top: 6px; }
.rdv-accompagnant.ok { color: var(--success); }
.rdv-accompagnant.recherche {
  color: var(--warning);
  display: flex; align-items: center; gap: 6px;
  background: rgba(245,158,11,0.12);
  padding: 6px 10px; border-radius: 8px;
  margin-top: 8px;
}

/* Semaine RDV */
.rdv-semaine-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.rdv-semaine-col {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 8px; min-height: 200px;
}
.rdv-semaine-col-titre {
  font-size: 12px; font-weight: 800; text-align: center;
  padding-bottom: 6px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border); color: var(--ink-2);
}
.rdv-semaine-col-titre.aujourdhui { color: var(--accent); }
.rdv-semaine-rdv {
  background: var(--surface-2); border-radius: 6px; padding: 6px;
  margin-bottom: 4px; font-size: 11px; line-height: 1.3; cursor: pointer;
}
.rdv-semaine-rdv:hover { background: var(--accent); color: var(--accent-ink); }
.rdv-semaine-time { font-weight: 800; }

.rdv-semaine-liste .rdv-jour-bloc { margin-bottom: 16px; }
.rdv-semaine-liste .rdv-jour-titre {
  font-size: 14px; font-weight: 800; padding: 6px 0;
  margin-bottom: 8px; border-bottom: 1px solid var(--border);
  color: var(--ink-2); text-transform: capitalize;
}
.rdv-semaine-liste .rdv-jour-titre.aujourdhui { color: var(--accent); }

/* Fiche RDV */
.fiche-rdv {
  max-width: 480px; width: 100%;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  max-height: 90vh; overflow-y: auto;
}
.fiche-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 12px; margin-bottom: 16px;
}
.fiche-type {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 99px;
}
.fiche-close {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--ink-2); width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-weight: 800;
}
.fiche-titre { font-size: 20px; font-weight: 800; margin: 0 0 4px; }
.fiche-date { font-size: 14px; font-weight: 700; color: var(--accent); margin: 0 0 16px; }
.fiche-ligne {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.fiche-ligne:last-of-type { border-bottom: none; }
.fiche-ligne-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  color: var(--ink-2); letter-spacing: 0.04em; min-width: 100px;
}
.fiche-actions {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.fiche-actions button {
  padding: 14px; font-size: 14px; font-weight: 800;
  border-radius: 10px; border: none; color: #fff; cursor: pointer;
}
.fiche-btn-accompagner { background: #234961; }
.fiche-btn-desinscrire { background: #B33F3F; }
.fiche-btn-desinscrire:hover { background: #DC2626; }
.fiche-btn-effectue { background: #16A34A; }
.fiche-btn-manque { background: #B33F3F; }
.fiche-btn-annule { background: #991B1B; }
.fiche-btn-retour {
  background: var(--surface-2) !important;
  color: var(--ink) !important;
  border: 1px solid var(--border) !important;
}

.conflit-bloc {
  background: rgba(245,158,11,0.12);
  border: 1px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 14px; margin-top: 16px;
  font-size: 14px; line-height: 1.6;
}

/* Toast global */
.toast {
  position: fixed; bottom: 100px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent); color: var(--accent-ink);
  padding: 14px 28px; border-radius: 99px;
  font-weight: 700; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 3000; opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

@media (max-width: 700px) {
  .rdv-semaine-grid { display: none; }
}
@media (min-width: 701px) {
  .rdv-semaine-liste { display: none; }
}

/* ====================================================================
   ALERTES MONITORING (nouvelle charte)
   ==================================================================== */

.alert-item {
  border-left: none;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}
.alert-item:hover { transform: translateX(2px); }

/* Médicament non pris — police jaune sur fond rouge vif */
.alert-item.rouge-vif {
  background: #DC2626;
  border-color: #991B1B;
  color: #FDE047;
}
.alert-item.rouge-vif .alert-item-sub { color: #FEF08A; }

/* RDV non pourvu — police noire sur fond rouge léger */
.alert-item.rouge-leger {
  background: #FCA5A5;
  border-color: #DC2626;
  color: #111827;
}
.alert-item.rouge-leger .alert-item-sub { color: #7F1D1D; }

/* RDV rappel — bleu ciel */
.alert-item.bleu {
  background: #93C5FD;
  border-color: #3B82F6;
  color: #0C1E3A;
}
.alert-item.bleu .alert-item-sub { color: #1E3A8A; }

/* RDV demain / tâche tardive — orange */
.alert-item.orange {
  background: #FBBF24;
  border-color: #F59E0B;
  color: #451A03;
}
.alert-item.orange .alert-item-sub { color: #78350F; }

/* Tâche tardive — orange pâle */
.alert-item.orange-pale {
  background: #FDE68A;
  border-color: #F59E0B;
  color: #451A03;
}
.alert-item.orange-pale .alert-item-sub { color: #78350F; }

/* Tâche du jour — vert */
.alert-item.vert {
  background: #86EFAC;
  border-color: #16A34A;
  color: #052E16;
}
.alert-item.vert .alert-item-sub { color: #14532D; }

/* Éléments internes */
.alert-item-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.alert-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.alert-item-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}
.alert-item-sub {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

/* Bouton interne (Marquer pris) */
.alert-item-btn {
  background: rgba(0,0,0,0.2);
  color: inherit;
  border: 1px solid currentColor;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}
.alert-item-btn:hover { background: rgba(0,0,0,0.35); }